From ea66e4c1848bf6069710c4e2516f04e4d08e1444 Mon Sep 17 00:00:00 2001 From: lyd911 Date: Tue, 7 Apr 2020 16:35:17 +0800 Subject: [PATCH] delete redundant dep files --- Gopkg.toml | 27 +- .../github.com/PuerkitoBio/purell/.gitignore | 5 - .../github.com/PuerkitoBio/purell/.travis.yml | 12 - vendor/github.com/PuerkitoBio/purell/LICENSE | 12 - .../github.com/PuerkitoBio/purell/README.md | 188 - .../github.com/PuerkitoBio/purell/purell.go | 379 - .../github.com/PuerkitoBio/urlesc/.travis.yml | 15 - vendor/github.com/PuerkitoBio/urlesc/LICENSE | 27 - .../github.com/PuerkitoBio/urlesc/README.md | 16 - .../github.com/PuerkitoBio/urlesc/urlesc.go | 180 - .../github.com/emicklei/go-restful/.gitignore | 71 - .../emicklei/go-restful/.travis.yml | 6 - .../github.com/emicklei/go-restful/CHANGES.md | 292 - vendor/github.com/emicklei/go-restful/LICENSE | 22 - .../github.com/emicklei/go-restful/Makefile | 7 - .../github.com/emicklei/go-restful/README.md | 110 - vendor/github.com/emicklei/go-restful/Srcfile | 1 - .../emicklei/go-restful/bench_test.sh | 10 - .../emicklei/go-restful/compress.go | 123 - .../emicklei/go-restful/compressor_cache.go | 103 - .../emicklei/go-restful/compressor_pools.go | 91 - .../emicklei/go-restful/compressors.go | 54 - .../emicklei/go-restful/constants.go | 30 - .../emicklei/go-restful/container.go | 374 - .../emicklei/go-restful/cors_filter.go | 202 - .../emicklei/go-restful/coverage.sh | 2 - .../github.com/emicklei/go-restful/curly.go | 173 - .../emicklei/go-restful/curly_route.go | 54 - .../emicklei/go-restful/custom_verb.go | 29 - vendor/github.com/emicklei/go-restful/doc.go | 185 - .../emicklei/go-restful/entity_accessors.go | 162 - .../github.com/emicklei/go-restful/filter.go | 35 - vendor/github.com/emicklei/go-restful/json.go | 11 - .../emicklei/go-restful/jsoniter.go | 12 - .../github.com/emicklei/go-restful/jsr311.go | 297 - .../github.com/emicklei/go-restful/log/log.go | 34 - .../github.com/emicklei/go-restful/logger.go | 32 - vendor/github.com/emicklei/go-restful/mime.go | 50 - .../emicklei/go-restful/options_filter.go | 34 - .../emicklei/go-restful/parameter.go | 143 - .../emicklei/go-restful/path_expression.go | 74 - .../emicklei/go-restful/path_processor.go | 74 - .../github.com/emicklei/go-restful/request.go | 118 - .../emicklei/go-restful/response.go | 256 - .../github.com/emicklei/go-restful/route.go | 163 - .../emicklei/go-restful/route_builder.go | 353 - .../github.com/emicklei/go-restful/router.go | 20 - .../emicklei/go-restful/service_error.go | 23 - .../emicklei/go-restful/web_service.go | 290 - .../go-restful/web_service_container.go | 39 - .../github.com/evanphx/json-patch/.travis.yml | 16 - .../github.com/evanphx/json-patch/README.md | 297 - vendor/github.com/evanphx/json-patch/go.mod | 5 - vendor/github.com/evanphx/json-patch/go.sum | 2 - vendor/github.com/evanphx/json-patch/patch.go | 4 + vendor/github.com/ghodss/yaml/.gitignore | 20 - vendor/github.com/ghodss/yaml/.travis.yml | 7 - vendor/github.com/ghodss/yaml/README.md | 121 - .../go-openapi/jsonpointer/.editorconfig | 26 - .../go-openapi/jsonpointer/.gitignore | 1 - .../go-openapi/jsonpointer/.travis.yml | 15 - .../go-openapi/jsonpointer/CODE_OF_CONDUCT.md | 74 - .../github.com/go-openapi/jsonpointer/LICENSE | 202 - .../go-openapi/jsonpointer/README.md | 15 - .../github.com/go-openapi/jsonpointer/go.mod | 9 - .../github.com/go-openapi/jsonpointer/go.sum | 24 - .../go-openapi/jsonpointer/pointer.go | 390 - .../go-openapi/jsonreference/.gitignore | 1 - .../go-openapi/jsonreference/.travis.yml | 15 - .../jsonreference/CODE_OF_CONDUCT.md | 74 - .../go-openapi/jsonreference/LICENSE | 202 - .../go-openapi/jsonreference/README.md | 15 - .../go-openapi/jsonreference/go.mod | 12 - .../go-openapi/jsonreference/go.sum | 44 - .../go-openapi/jsonreference/reference.go | 156 - .../github.com/go-openapi/spec/.editorconfig | 26 - vendor/github.com/go-openapi/spec/.gitignore | 2 - .../github.com/go-openapi/spec/.golangci.yml | 28 - vendor/github.com/go-openapi/spec/.travis.yml | 13 - .../go-openapi/spec/CODE_OF_CONDUCT.md | 74 - vendor/github.com/go-openapi/spec/LICENSE | 202 - vendor/github.com/go-openapi/spec/README.md | 10 - vendor/github.com/go-openapi/spec/bindata.go | 297 - vendor/github.com/go-openapi/spec/cache.go | 60 - .../go-openapi/spec/contact_info.go | 54 - vendor/github.com/go-openapi/spec/debug.go | 47 - vendor/github.com/go-openapi/spec/expander.go | 651 - .../go-openapi/spec/external_docs.go | 24 - vendor/github.com/go-openapi/spec/go.mod | 12 - vendor/github.com/go-openapi/spec/go.sum | 49 - vendor/github.com/go-openapi/spec/header.go | 197 - vendor/github.com/go-openapi/spec/info.go | 165 - vendor/github.com/go-openapi/spec/items.go | 244 - vendor/github.com/go-openapi/spec/license.go | 53 - .../github.com/go-openapi/spec/normalizer.go | 152 - .../github.com/go-openapi/spec/operation.go | 398 - .../github.com/go-openapi/spec/parameter.go | 321 - .../github.com/go-openapi/spec/path_item.go | 87 - vendor/github.com/go-openapi/spec/paths.go | 97 - vendor/github.com/go-openapi/spec/ref.go | 193 - vendor/github.com/go-openapi/spec/response.go | 131 - .../github.com/go-openapi/spec/responses.go | 127 - vendor/github.com/go-openapi/spec/schema.go | 596 - .../go-openapi/spec/schema_loader.go | 271 - .../go-openapi/spec/security_scheme.go | 140 - vendor/github.com/go-openapi/spec/spec.go | 86 - vendor/github.com/go-openapi/spec/swagger.go | 448 - vendor/github.com/go-openapi/spec/tag.go | 75 - vendor/github.com/go-openapi/spec/unused.go | 174 - .../github.com/go-openapi/spec/xml_object.go | 68 - .../github.com/go-openapi/swag/.editorconfig | 26 - vendor/github.com/go-openapi/swag/.gitignore | 4 - .../github.com/go-openapi/swag/.golangci.yml | 22 - vendor/github.com/go-openapi/swag/.travis.yml | 13 - .../go-openapi/swag/CODE_OF_CONDUCT.md | 74 - vendor/github.com/go-openapi/swag/LICENSE | 202 - vendor/github.com/go-openapi/swag/README.md | 22 - vendor/github.com/go-openapi/swag/convert.go | 208 - .../go-openapi/swag/convert_types.go | 595 - vendor/github.com/go-openapi/swag/doc.go | 32 - vendor/github.com/go-openapi/swag/go.mod | 16 - vendor/github.com/go-openapi/swag/go.sum | 20 - vendor/github.com/go-openapi/swag/json.go | 312 - vendor/github.com/go-openapi/swag/loading.go | 80 - .../github.com/go-openapi/swag/name_lexem.go | 87 - vendor/github.com/go-openapi/swag/net.go | 38 - vendor/github.com/go-openapi/swag/path.go | 59 - .../github.com/go-openapi/swag/post_go18.go | 23 - .../github.com/go-openapi/swag/post_go19.go | 67 - vendor/github.com/go-openapi/swag/pre_go18.go | 23 - vendor/github.com/go-openapi/swag/pre_go19.go | 69 - vendor/github.com/go-openapi/swag/split.go | 262 - vendor/github.com/go-openapi/swag/util.go | 385 - vendor/github.com/go-openapi/swag/yaml.go | 246 - .../github.com/gogo/protobuf/proto/Makefile | 43 - vendor/github.com/golang/glog/README | 44 - .../github.com/golang/groupcache/lru/lru.go | 14 +- .../golang/protobuf/ptypes/any/any.proto | 155 - .../protobuf/ptypes/duration/duration.proto | 116 - .../protobuf/ptypes/timestamp/timestamp.proto | 138 - .../github.com/google/go-cmp/cmp/compare.go | 83 +- .../google/go-cmp/cmp/export_panic.go | 4 +- .../google/go-cmp/cmp/export_unsafe.go | 6 +- .../google/go-cmp/cmp/internal/value/sort.go | 4 +- .../google/go-cmp/cmp/internal/value/zero.go | 9 +- .../github.com/google/go-cmp/cmp/options.go | 55 +- vendor/github.com/google/go-cmp/cmp/path.go | 71 +- .../google/go-cmp/cmp/report_compare.go | 2 +- .../google/go-cmp/cmp/report_reflect.go | 1 + .../google/go-cmp/cmp/report_slices.go | 4 +- .../google/go-cmp/cmp/report_text.go | 7 +- vendor/github.com/google/gofuzz/.travis.yml | 13 - .../github.com/google/gofuzz/CONTRIBUTING.md | 67 - vendor/github.com/google/gofuzz/README.md | 71 - vendor/github.com/google/gofuzz/go.mod | 3 - .../googleapis/gnostic/OpenAPIv2/OpenAPIv2.go | 845 +- .../gnostic/OpenAPIv2/OpenAPIv2.pb.go | 3731 ++--- .../gnostic/OpenAPIv2/OpenAPIv2.proto | 663 - .../googleapis/gnostic/OpenAPIv2/README.md | 16 - .../gnostic/OpenAPIv2/openapi-2.0.json | 1610 -- .../googleapis/gnostic/compiler/README.md | 3 - .../googleapis/gnostic/compiler/reader.go | 99 +- .../googleapis/gnostic/extensions/README.md | 5 - .../gnostic/extensions/extension.pb.go | 237 +- .../gnostic/extensions/extension.proto | 93 - .../hashicorp/golang-lru/.gitignore | 23 - .../github.com/hashicorp/golang-lru/README.md | 25 - vendor/github.com/hashicorp/golang-lru/go.mod | 3 - vendor/github.com/hashicorp/golang-lru/lru.go | 48 +- .../hashicorp/golang-lru/simplelru/lru.go | 16 - .../golang-lru/simplelru/lru_interface.go | 7 +- vendor/github.com/imdario/mergo/.gitignore | 33 - vendor/github.com/imdario/mergo/.travis.yml | 9 - .../imdario/mergo/CODE_OF_CONDUCT.md | 46 - vendor/github.com/imdario/mergo/README.md | 238 - vendor/github.com/imdario/mergo/map.go | 1 - vendor/github.com/imdario/mergo/merge.go | 62 +- .../github.com/json-iterator/go/.codecov.yml | 3 - vendor/github.com/json-iterator/go/.gitignore | 4 - .../github.com/json-iterator/go/.travis.yml | 14 - vendor/github.com/json-iterator/go/Gopkg.toml | 26 - vendor/github.com/json-iterator/go/README.md | 87 - vendor/github.com/json-iterator/go/build.sh | 12 - .../go/fuzzy_mode_convert_table.md | 7 - vendor/github.com/json-iterator/go/go.mod | 11 - vendor/github.com/json-iterator/go/go.sum | 14 - .../json-iterator/go/reflect_extension.go | 2 +- .../json-iterator/go/reflect_map.go | 10 +- .../go/reflect_struct_encoder.go | 1 - vendor/github.com/json-iterator/go/test.sh | 12 - .../go-windows-terminal-sequences/README.md | 41 - .../go-windows-terminal-sequences/go.mod | 1 - vendor/github.com/kubeflow/common/LICENSE | 201 - .../common/pkg/apis/common/v1/constants.go | 18 - .../kubeflow/common/pkg/apis/common/v1/doc.go | 20 - .../common/pkg/apis/common/v1/interface.go | 74 - .../pkg/apis/common/v1/openapi_generated.go | 12950 ---------------- .../common/pkg/apis/common/v1/types.go | 201 - .../apis/common/v1/zz_generated.deepcopy.go | 187 - .../apis/common/v1/zz_generated.defaults.go | 30 - vendor/github.com/mailru/easyjson/LICENSE | 7 - .../github.com/mailru/easyjson/buffer/pool.go | 270 - .../mailru/easyjson/jlexer/bytestostr.go | 24 - .../easyjson/jlexer/bytestostr_nounsafe.go | 13 - .../mailru/easyjson/jlexer/error.go | 15 - .../mailru/easyjson/jlexer/lexer.go | 1182 -- .../mailru/easyjson/jwriter/writer.go | 407 - .../modern-go/concurrent/.gitignore | 1 - .../modern-go/concurrent/.travis.yml | 14 - .../github.com/modern-go/concurrent/README.md | 49 - .../github.com/modern-go/concurrent/test.sh | 12 - .../github.com/modern-go/reflect2/.gitignore | 2 - .../github.com/modern-go/reflect2/.travis.yml | 15 - .../github.com/modern-go/reflect2/Gopkg.toml | 35 - .../github.com/modern-go/reflect2/README.md | 71 - vendor/github.com/modern-go/reflect2/test.sh | 12 - .../github.com/modern-go/reflect2/type_map.go | 16 +- vendor/github.com/pkg/errors/.gitignore | 24 - vendor/github.com/pkg/errors/.travis.yml | 10 - vendor/github.com/pkg/errors/Makefile | 44 - vendor/github.com/pkg/errors/README.md | 59 - vendor/github.com/pkg/errors/appveyor.yml | 32 - vendor/github.com/sirupsen/logrus/.gitignore | 2 - vendor/github.com/sirupsen/logrus/.travis.yml | 25 - .../github.com/sirupsen/logrus/CHANGELOG.md | 200 - vendor/github.com/sirupsen/logrus/README.md | 495 - .../github.com/sirupsen/logrus/appveyor.yml | 14 - vendor/github.com/sirupsen/logrus/entry.go | 49 +- vendor/github.com/sirupsen/logrus/exported.go | 2 +- vendor/github.com/sirupsen/logrus/go.mod | 10 - vendor/github.com/sirupsen/logrus/go.sum | 16 - .../sirupsen/logrus/json_formatter.go | 4 + vendor/github.com/sirupsen/logrus/logger.go | 11 +- vendor/github.com/sirupsen/logrus/logrus.go | 2 +- .../sirupsen/logrus/terminal_check_bsd.go | 2 +- .../sirupsen/logrus/terminal_check_js.go | 7 + .../sirupsen/logrus/terminal_check_unix.go | 2 +- .../sirupsen/logrus/text_formatter.go | 47 +- vendor/github.com/sirupsen/logrus/writer.go | 6 + vendor/github.com/spf13/pflag/.gitignore | 2 - vendor/github.com/spf13/pflag/.travis.yml | 22 - vendor/github.com/spf13/pflag/README.md | 296 - vendor/github.com/spf13/pflag/go.mod | 3 - vendor/github.com/spf13/pflag/go.sum | 0 vendor/golang.org/x/mod/LICENSE | 27 - vendor/golang.org/x/mod/PATENTS | 22 - vendor/golang.org/x/mod/module/module.go | 718 - vendor/golang.org/x/mod/semver/semver.go | 388 - vendor/golang.org/x/net/http2/.gitignore | 2 - vendor/golang.org/x/net/http2/Dockerfile | 51 - vendor/golang.org/x/net/http2/Makefile | 3 - vendor/golang.org/x/net/http2/README | 20 - vendor/golang.org/x/net/http2/hpack/encode.go | 2 +- vendor/golang.org/x/net/http2/http2.go | 6 - vendor/golang.org/x/net/http2/pipe.go | 7 +- vendor/golang.org/x/net/http2/server.go | 25 +- vendor/golang.org/x/net/http2/transport.go | 92 +- .../x/net/http2/writesched_priority.go | 2 +- vendor/golang.org/x/net/idna/tables11.0.0.go | 2 +- vendor/golang.org/x/net/idna/tables12.00.go | 4733 ++++++ vendor/golang.org/x/oauth2/.travis.yml | 13 - vendor/golang.org/x/oauth2/CONTRIBUTING.md | 26 - vendor/golang.org/x/oauth2/README.md | 36 - vendor/golang.org/x/oauth2/go.mod | 10 - vendor/golang.org/x/oauth2/go.sum | 12 - vendor/golang.org/x/oauth2/transport.go | 79 +- vendor/golang.org/x/sys/unix/.gitignore | 2 - vendor/golang.org/x/sys/unix/README.md | 184 - vendor/golang.org/x/sys/unix/mkall.sh | 240 - vendor/golang.org/x/sys/unix/mkerrors.sh | 699 - vendor/golang.org/x/sys/unix/syscall_linux.go | 6 + vendor/golang.org/x/sys/unix/syscall_unix.go | 2 +- vendor/golang.org/x/sys/unix/zerrors_linux.go | 25 +- .../x/sys/unix/zerrors_linux_386.go | 2 + .../x/sys/unix/zerrors_linux_amd64.go | 2 + .../x/sys/unix/zerrors_linux_arm.go | 2 + .../x/sys/unix/zerrors_linux_arm64.go | 2 + .../x/sys/unix/zerrors_linux_mips.go | 2 + .../x/sys/unix/zerrors_linux_mips64.go | 2 + .../x/sys/unix/zerrors_linux_mips64le.go | 2 + .../x/sys/unix/zerrors_linux_mipsle.go | 2 + .../x/sys/unix/zerrors_linux_ppc64.go | 2 + .../x/sys/unix/zerrors_linux_ppc64le.go | 2 + .../x/sys/unix/zerrors_linux_riscv64.go | 2 + .../x/sys/unix/zerrors_linux_s390x.go | 2 + .../x/sys/unix/zerrors_linux_sparc64.go | 2 + .../golang.org/x/sys/unix/zsyscall_linux.go | 16 + .../x/sys/unix/zsysnum_linux_386.go | 2 + .../x/sys/unix/zsysnum_linux_amd64.go | 2 + .../x/sys/unix/zsysnum_linux_arm.go | 2 + .../x/sys/unix/zsysnum_linux_arm64.go | 2 + .../x/sys/unix/zsysnum_linux_mips.go | 2 + .../x/sys/unix/zsysnum_linux_mips64.go | 2 + .../x/sys/unix/zsysnum_linux_mips64le.go | 2 + .../x/sys/unix/zsysnum_linux_mipsle.go | 2 + .../x/sys/unix/zsysnum_linux_ppc64.go | 2 + .../x/sys/unix/zsysnum_linux_ppc64le.go | 2 + .../x/sys/unix/zsysnum_linux_riscv64.go | 2 + .../x/sys/unix/zsysnum_linux_s390x.go | 2 + .../x/sys/unix/zsysnum_linux_sparc64.go | 2 + vendor/golang.org/x/sys/unix/ztypes_linux.go | 67 +- .../golang.org/x/sys/unix/ztypes_linux_386.go | 1 + .../x/sys/unix/ztypes_linux_amd64.go | 1 + .../golang.org/x/sys/unix/ztypes_linux_arm.go | 1 + .../x/sys/unix/ztypes_linux_arm64.go | 1 + .../x/sys/unix/ztypes_linux_mips.go | 1 + .../x/sys/unix/ztypes_linux_mips64.go | 1 + .../x/sys/unix/ztypes_linux_mips64le.go | 1 + .../x/sys/unix/ztypes_linux_mipsle.go | 1 + .../x/sys/unix/ztypes_linux_ppc64.go | 1 + .../x/sys/unix/ztypes_linux_ppc64le.go | 1 + .../x/sys/unix/ztypes_linux_riscv64.go | 1 + .../x/sys/unix/ztypes_linux_s390x.go | 1 + .../x/sys/unix/ztypes_linux_sparc64.go | 1 + vendor/golang.org/x/sys/windows/mkerrors.bash | 63 - .../x/sys/windows/mkknownfolderids.bash | 27 - vendor/golang.org/x/text/width/gen.go | 115 - vendor/golang.org/x/text/width/gen_common.go | 96 - vendor/golang.org/x/text/width/gen_trieval.go | 34 - vendor/golang.org/x/text/width/kind_string.go | 28 - .../golang.org/x/text/width/tables10.0.0.go | 1318 -- .../golang.org/x/text/width/tables11.0.0.go | 1330 -- vendor/golang.org/x/text/width/tables9.0.0.go | 1286 -- vendor/golang.org/x/text/width/transform.go | 239 - vendor/golang.org/x/text/width/trieval.go | 30 - vendor/golang.org/x/text/width/width.go | 206 - vendor/golang.org/x/time/rate/rate.go | 30 +- vendor/golang.org/x/tools/AUTHORS | 3 - vendor/golang.org/x/tools/CONTRIBUTORS | 3 - vendor/golang.org/x/tools/LICENSE | 27 - vendor/golang.org/x/tools/PATENTS | 22 - vendor/golang.org/x/tools/cmd/getgo/LICENSE | 27 - .../x/tools/go/ast/astutil/enclosing.go | 627 - .../x/tools/go/ast/astutil/imports.go | 482 - .../x/tools/go/ast/astutil/rewrite.go | 477 - .../golang.org/x/tools/go/ast/astutil/util.go | 14 - vendor/golang.org/x/tools/imports/forward.go | 70 - .../x/tools/internal/fastwalk/fastwalk.go | 196 - .../fastwalk/fastwalk_dirent_fileno.go | 13 - .../internal/fastwalk/fastwalk_dirent_ino.go | 14 - .../fastwalk/fastwalk_dirent_namlen_bsd.go | 13 - .../fastwalk/fastwalk_dirent_namlen_linux.go | 29 - .../internal/fastwalk/fastwalk_portable.go | 37 - .../tools/internal/fastwalk/fastwalk_unix.go | 128 - .../x/tools/internal/gocommand/invoke.go | 126 - .../x/tools/internal/gopathwalk/walk.go | 275 - .../x/tools/internal/imports/fix.go | 1578 -- .../x/tools/internal/imports/imports.go | 408 - .../x/tools/internal/imports/mkindex.go | 173 - .../x/tools/internal/imports/mkstdlib.go | 128 - .../x/tools/internal/imports/mod.go | 718 - .../x/tools/internal/imports/mod_cache.go | 232 - .../x/tools/internal/imports/sortimports.go | 280 - .../x/tools/internal/imports/zstdlib.go | 10377 ------------- vendor/golang.org/x/xerrors/LICENSE | 27 - vendor/golang.org/x/xerrors/PATENTS | 22 - vendor/golang.org/x/xerrors/README | 2 - vendor/golang.org/x/xerrors/adaptor.go | 193 - vendor/golang.org/x/xerrors/codereview.cfg | 1 - vendor/golang.org/x/xerrors/doc.go | 22 - vendor/golang.org/x/xerrors/errors.go | 33 - vendor/golang.org/x/xerrors/fmt.go | 187 - vendor/golang.org/x/xerrors/format.go | 34 - vendor/golang.org/x/xerrors/frame.go | 56 - vendor/golang.org/x/xerrors/go.mod | 3 - .../golang.org/x/xerrors/internal/internal.go | 8 - vendor/golang.org/x/xerrors/wrap.go | 106 - .../v1/gonum/.travis/deps.d/linux/01-deps.sh | 1 - .../v1/gonum/.travis/deps.d/osx/nothing.sh | 1 - .../gonum/.travis/deps.d/windows/nothing.sh | 1 - .../.travis/run.d/linux/01-check-copyright.sh | 1 - .../.travis/run.d/linux/02-check-imports.sh | 1 - .../run.d/linux/03-check-formatting.sh | 1 - .../v1/gonum/.travis/run.d/linux/04-test.sh | 1 - .../.travis/run.d/linux/05-test-coverage.sh | 1 - .../.travis/run.d/linux/06-check-generate.sh | 1 - .../v1/gonum/.travis/run.d/osx/01-test.sh | 1 - vendor/gonum.org/v1/gonum/AUTHORS | 98 - vendor/gonum.org/v1/gonum/CONTRIBUTORS | 100 - vendor/gonum.org/v1/gonum/LICENSE | 23 - vendor/gonum.org/v1/gonum/blas/README.md | 47 - vendor/gonum.org/v1/gonum/blas/blas.go | 283 - .../gonum.org/v1/gonum/blas/blas64/blas64.go | 472 - vendor/gonum.org/v1/gonum/blas/blas64/conv.go | 277 - .../v1/gonum/blas/blas64/conv_symmetric.go | 153 - vendor/gonum.org/v1/gonum/blas/blas64/doc.go | 6 - .../v1/gonum/blas/cblas128/cblas128.go | 532 - .../gonum.org/v1/gonum/blas/cblas128/conv.go | 279 - .../v1/gonum/blas/cblas128/conv_hermitian.go | 155 - .../v1/gonum/blas/cblas128/conv_symmetric.go | 155 - .../gonum.org/v1/gonum/blas/cblas128/doc.go | 6 - .../gonum.org/v1/gonum/blas/conversions.bash | 159 - vendor/gonum.org/v1/gonum/blas/doc.go | 108 - vendor/gonum.org/v1/gonum/blas/gonum/dgemm.go | 314 - vendor/gonum.org/v1/gonum/blas/gonum/doc.go | 88 - .../gonum.org/v1/gonum/blas/gonum/errors.go | 35 - vendor/gonum.org/v1/gonum/blas/gonum/gemv.go | 190 - vendor/gonum.org/v1/gonum/blas/gonum/gonum.go | 58 - .../v1/gonum/blas/gonum/level1cmplx128.go | 445 - .../v1/gonum/blas/gonum/level1cmplx64.go | 467 - .../v1/gonum/blas/gonum/level1float32.go | 602 - .../gonum/blas/gonum/level1float32_dsdot.go | 53 - .../v1/gonum/blas/gonum/level1float32_sdot.go | 53 - .../gonum/blas/gonum/level1float32_sdsdot.go | 53 - .../v1/gonum/blas/gonum/level1float64.go | 578 - .../v1/gonum/blas/gonum/level1float64_ddot.go | 49 - .../v1/gonum/blas/gonum/level2cmplx128.go | 2906 ---- .../v1/gonum/blas/gonum/level2cmplx64.go | 2942 ---- .../v1/gonum/blas/gonum/level2float32.go | 2296 --- .../v1/gonum/blas/gonum/level2float64.go | 2264 --- .../v1/gonum/blas/gonum/level3cmplx128.go | 1715 -- .../v1/gonum/blas/gonum/level3cmplx64.go | 1735 --- .../v1/gonum/blas/gonum/level3float32.go | 876 -- .../v1/gonum/blas/gonum/level3float64.go | 864 -- vendor/gonum.org/v1/gonum/blas/gonum/sgemm.go | 318 - .../v1/gonum/blas/gonum/single_precision.bash | 220 - vendor/gonum.org/v1/gonum/floats/README.md | 4 - vendor/gonum.org/v1/gonum/floats/doc.go | 11 - vendor/gonum.org/v1/gonum/floats/floats.go | 925 -- vendor/gonum.org/v1/gonum/graph/.gitignore | 1 - vendor/gonum.org/v1/gonum/graph/README.md | 3 - vendor/gonum.org/v1/gonum/graph/complement.go | 96 - vendor/gonum.org/v1/gonum/graph/doc.go | 9 - .../formats/cytoscapejs/testdata/LICENSE | 21 - .../formats/sigmajs/testdata/LICENSE.txt | 12 - vendor/gonum.org/v1/gonum/graph/graph.go | 282 - .../v1/gonum/graph/internal/linear/doc.go | 6 - .../v1/gonum/graph/internal/linear/linear.go | 73 - .../v1/gonum/graph/internal/ordered/doc.go | 6 - .../v1/gonum/graph/internal/ordered/sort.go | 93 - .../v1/gonum/graph/internal/set/doc.go | 6 - .../v1/gonum/graph/internal/set/same.go | 36 - .../graph/internal/set/same_appengine.go | 36 - .../v1/gonum/graph/internal/set/set.go | 228 - .../v1/gonum/graph/internal/uid/uid.go | 54 - .../gonum.org/v1/gonum/graph/iterator/doc.go | 9 - .../v1/gonum/graph/iterator/edges.go | 131 - .../v1/gonum/graph/iterator/lines.go | 131 - .../v1/gonum/graph/iterator/nodes.go | 180 - vendor/gonum.org/v1/gonum/graph/multigraph.go | 198 - .../gonum.org/v1/gonum/graph/nodes_edges.go | 300 - .../graph/simple/dense_directed_matrix.go | 301 - .../graph/simple/dense_undirected_matrix.go | 268 - .../v1/gonum/graph/simple/directed.go | 241 - vendor/gonum.org/v1/gonum/graph/simple/doc.go | 9 - .../gonum.org/v1/gonum/graph/simple/simple.go | 72 - .../v1/gonum/graph/simple/undirected.go | 223 - .../gonum/graph/simple/weighted_directed.go | 285 - .../gonum/graph/simple/weighted_undirected.go | 280 - .../v1/gonum/graph/topo/bron_kerbosch.go | 250 - .../v1/gonum/graph/topo/clique_graph.go | 111 - vendor/gonum.org/v1/gonum/graph/topo/doc.go | 6 - .../v1/gonum/graph/topo/johnson_cycles.go | 285 - .../v1/gonum/graph/topo/non_tomita_choice.go | 9 - .../v1/gonum/graph/topo/paton_cycles.go | 83 - .../gonum.org/v1/gonum/graph/topo/tarjan.go | 199 - .../v1/gonum/graph/topo/tomita_choice.go | 9 - vendor/gonum.org/v1/gonum/graph/topo/topo.go | 112 - .../gonum.org/v1/gonum/graph/traverse/doc.go | 6 - .../v1/gonum/graph/traverse/traverse.go | 231 - vendor/gonum.org/v1/gonum/graph/undirect.go | 284 - .../gonum/internal/asm/c128/axpyinc_amd64.s | 134 - .../gonum/internal/asm/c128/axpyincto_amd64.s | 141 - .../internal/asm/c128/axpyunitary_amd64.s | 122 - .../internal/asm/c128/axpyunitaryto_amd64.s | 123 - .../v1/gonum/internal/asm/c128/doc.go | 6 - .../gonum/internal/asm/c128/dotcinc_amd64.s | 153 - .../internal/asm/c128/dotcunitary_amd64.s | 143 - .../gonum/internal/asm/c128/dotuinc_amd64.s | 141 - .../internal/asm/c128/dotuunitary_amd64.s | 130 - .../gonum/internal/asm/c128/dscalinc_amd64.s | 69 - .../internal/asm/c128/dscalunitary_amd64.s | 66 - .../v1/gonum/internal/asm/c128/scal.go | 31 - .../internal/asm/c128/scalUnitary_amd64.s | 116 - .../gonum/internal/asm/c128/scalinc_amd64.s | 121 - .../v1/gonum/internal/asm/c128/stubs_amd64.go | 96 - .../v1/gonum/internal/asm/c128/stubs_noasm.go | 163 - .../v1/gonum/internal/asm/c64/axpyinc_amd64.s | 151 - .../gonum/internal/asm/c64/axpyincto_amd64.s | 156 - .../internal/asm/c64/axpyunitary_amd64.s | 160 - .../internal/asm/c64/axpyunitaryto_amd64.s | 157 - .../v1/gonum/internal/asm/c64/conj.go | 7 - .../v1/gonum/internal/asm/c64/doc.go | 6 - .../v1/gonum/internal/asm/c64/dotcinc_amd64.s | 160 - .../internal/asm/c64/dotcunitary_amd64.s | 208 - .../v1/gonum/internal/asm/c64/dotuinc_amd64.s | 148 - .../internal/asm/c64/dotuunitary_amd64.s | 197 - .../v1/gonum/internal/asm/c64/scal.go | 79 - .../v1/gonum/internal/asm/c64/stubs_amd64.go | 68 - .../v1/gonum/internal/asm/c64/stubs_noasm.go | 113 - .../v1/gonum/internal/asm/f32/axpyinc_amd64.s | 73 - .../gonum/internal/asm/f32/axpyincto_amd64.s | 78 - .../internal/asm/f32/axpyunitary_amd64.s | 97 - .../internal/asm/f32/axpyunitaryto_amd64.s | 98 - .../v1/gonum/internal/asm/f32/ddotinc_amd64.s | 91 - .../internal/asm/f32/ddotunitary_amd64.s | 110 - .../v1/gonum/internal/asm/f32/doc.go | 6 - .../v1/gonum/internal/asm/f32/dotinc_amd64.s | 85 - .../gonum/internal/asm/f32/dotunitary_amd64.s | 106 - .../v1/gonum/internal/asm/f32/ge_amd64.go | 15 - .../v1/gonum/internal/asm/f32/ge_amd64.s | 757 - .../v1/gonum/internal/asm/f32/ge_noasm.go | 36 - .../v1/gonum/internal/asm/f32/l2norm.go | 90 - .../v1/gonum/internal/asm/f32/scal.go | 55 - .../v1/gonum/internal/asm/f32/stubs_amd64.go | 68 - .../v1/gonum/internal/asm/f32/stubs_noasm.go | 113 - .../v1/gonum/internal/asm/f64/abssum_amd64.s | 82 - .../gonum/internal/asm/f64/abssuminc_amd64.s | 90 - .../v1/gonum/internal/asm/f64/add_amd64.s | 66 - .../gonum/internal/asm/f64/addconst_amd64.s | 53 - .../v1/gonum/internal/asm/f64/axpy.go | 57 - .../v1/gonum/internal/asm/f64/axpyinc_amd64.s | 142 - .../gonum/internal/asm/f64/axpyincto_amd64.s | 148 - .../internal/asm/f64/axpyunitary_amd64.s | 134 - .../internal/asm/f64/axpyunitaryto_amd64.s | 140 - .../v1/gonum/internal/asm/f64/cumprod_amd64.s | 71 - .../v1/gonum/internal/asm/f64/cumsum_amd64.s | 64 - .../v1/gonum/internal/asm/f64/div_amd64.s | 67 - .../v1/gonum/internal/asm/f64/divto_amd64.s | 73 - .../v1/gonum/internal/asm/f64/doc.go | 6 - .../v1/gonum/internal/asm/f64/dot.go | 35 - .../v1/gonum/internal/asm/f64/dot_amd64.s | 145 - .../v1/gonum/internal/asm/f64/ge_amd64.go | 22 - .../v1/gonum/internal/asm/f64/ge_noasm.go | 118 - .../v1/gonum/internal/asm/f64/gemvN_amd64.s | 685 - .../v1/gonum/internal/asm/f64/gemvT_amd64.s | 745 - .../v1/gonum/internal/asm/f64/ger_amd64.s | 591 - .../v1/gonum/internal/asm/f64/l1norm_amd64.s | 58 - .../v1/gonum/internal/asm/f64/l2norm_amd64.s | 109 - .../v1/gonum/internal/asm/f64/l2norm_noasm.go | 92 - .../gonum/internal/asm/f64/l2normdist_amd64.s | 115 - .../gonum/internal/asm/f64/l2norminc_amd64.s | 110 - .../gonum/internal/asm/f64/linfnorm_amd64.s | 57 - .../v1/gonum/internal/asm/f64/scal.go | 57 - .../v1/gonum/internal/asm/f64/scalinc_amd64.s | 113 - .../gonum/internal/asm/f64/scalincto_amd64.s | 122 - .../internal/asm/f64/scalunitary_amd64.s | 112 - .../internal/asm/f64/scalunitaryto_amd64.s | 113 - .../v1/gonum/internal/asm/f64/stubs_amd64.go | 252 - .../v1/gonum/internal/asm/f64/stubs_noasm.go | 170 - .../v1/gonum/internal/asm/f64/sum_amd64.s | 100 - .../v1/gonum/internal/cmplx64/abs.go | 14 - .../v1/gonum/internal/cmplx64/conj.go | 12 - .../v1/gonum/internal/cmplx64/doc.go | 7 - .../v1/gonum/internal/cmplx64/isinf.go | 25 - .../v1/gonum/internal/cmplx64/isnan.go | 29 - .../v1/gonum/internal/cmplx64/sqrt.go | 108 - .../gonum.org/v1/gonum/internal/math32/doc.go | 7 - .../v1/gonum/internal/math32/math.go | 111 - .../v1/gonum/internal/math32/signbit.go | 16 - .../v1/gonum/internal/math32/sqrt.go | 24 - .../v1/gonum/internal/math32/sqrt_amd64.go | 20 - .../v1/gonum/internal/math32/sqrt_amd64.s | 17 - .../v1/gonum/internal/math32/sqrt_arm64.go | 20 - .../v1/gonum/internal/math32/sqrt_arm64.s | 18 - vendor/gonum.org/v1/gonum/lapack/.gitignore | 0 vendor/gonum.org/v1/gonum/lapack/README.md | 28 - vendor/gonum.org/v1/gonum/lapack/doc.go | 6 - .../gonum.org/v1/gonum/lapack/gonum/dbdsqr.go | 505 - .../v1/gonum/lapack/gonum/dcombssq.go | 21 - .../gonum.org/v1/gonum/lapack/gonum/dgebak.go | 89 - .../gonum.org/v1/gonum/lapack/gonum/dgebal.go | 239 - .../gonum.org/v1/gonum/lapack/gonum/dgebd2.go | 86 - .../gonum.org/v1/gonum/lapack/gonum/dgebrd.go | 161 - .../gonum.org/v1/gonum/lapack/gonum/dgecon.go | 92 - .../gonum.org/v1/gonum/lapack/gonum/dgeev.go | 279 - .../gonum.org/v1/gonum/lapack/gonum/dgehd2.go | 97 - .../gonum.org/v1/gonum/lapack/gonum/dgehrd.go | 194 - .../gonum.org/v1/gonum/lapack/gonum/dgelq2.go | 65 - .../gonum.org/v1/gonum/lapack/gonum/dgelqf.go | 97 - .../gonum.org/v1/gonum/lapack/gonum/dgels.go | 219 - .../gonum.org/v1/gonum/lapack/gonum/dgeql2.go | 61 - .../gonum.org/v1/gonum/lapack/gonum/dgeqp3.go | 186 - .../gonum.org/v1/gonum/lapack/gonum/dgeqr2.go | 76 - .../gonum.org/v1/gonum/lapack/gonum/dgeqrf.go | 108 - .../gonum.org/v1/gonum/lapack/gonum/dgerq2.go | 68 - .../gonum.org/v1/gonum/lapack/gonum/dgerqf.go | 129 - .../gonum.org/v1/gonum/lapack/gonum/dgesvd.go | 1374 -- .../gonum.org/v1/gonum/lapack/gonum/dgetf2.go | 84 - .../gonum.org/v1/gonum/lapack/gonum/dgetrf.go | 85 - .../gonum.org/v1/gonum/lapack/gonum/dgetri.go | 116 - .../gonum.org/v1/gonum/lapack/gonum/dgetrs.go | 72 - .../v1/gonum/lapack/gonum/dggsvd3.go | 242 - .../v1/gonum/lapack/gonum/dggsvp3.go | 281 - .../gonum.org/v1/gonum/lapack/gonum/dhseqr.go | 252 - .../gonum.org/v1/gonum/lapack/gonum/dlabrd.go | 173 - .../gonum.org/v1/gonum/lapack/gonum/dlacn2.go | 134 - .../gonum.org/v1/gonum/lapack/gonum/dlacpy.go | 59 - .../gonum.org/v1/gonum/lapack/gonum/dlae2.go | 49 - .../gonum.org/v1/gonum/lapack/gonum/dlaev2.go | 82 - .../gonum.org/v1/gonum/lapack/gonum/dlaexc.go | 269 - .../gonum.org/v1/gonum/lapack/gonum/dlags2.go | 182 - .../gonum.org/v1/gonum/lapack/gonum/dlahqr.go | 431 - .../gonum.org/v1/gonum/lapack/gonum/dlahr2.go | 195 - .../gonum.org/v1/gonum/lapack/gonum/dlaln2.go | 405 - .../gonum.org/v1/gonum/lapack/gonum/dlange.go | 88 - .../gonum.org/v1/gonum/lapack/gonum/dlansb.go | 135 - .../gonum.org/v1/gonum/lapack/gonum/dlanst.go | 75 - .../gonum.org/v1/gonum/lapack/gonum/dlansy.go | 128 - .../gonum.org/v1/gonum/lapack/gonum/dlantr.go | 256 - .../gonum.org/v1/gonum/lapack/gonum/dlanv2.go | 132 - .../gonum.org/v1/gonum/lapack/gonum/dlapll.go | 55 - .../gonum.org/v1/gonum/lapack/gonum/dlapmt.go | 89 - .../gonum.org/v1/gonum/lapack/gonum/dlapy2.go | 14 - .../gonum.org/v1/gonum/lapack/gonum/dlaqp2.go | 127 - .../gonum.org/v1/gonum/lapack/gonum/dlaqps.go | 244 - .../v1/gonum/lapack/gonum/dlaqr04.go | 478 - .../gonum.org/v1/gonum/lapack/gonum/dlaqr1.go | 59 - .../v1/gonum/lapack/gonum/dlaqr23.go | 415 - .../gonum.org/v1/gonum/lapack/gonum/dlaqr5.go | 644 - .../gonum.org/v1/gonum/lapack/gonum/dlarf.go | 98 - .../gonum.org/v1/gonum/lapack/gonum/dlarfb.go | 449 - .../gonum.org/v1/gonum/lapack/gonum/dlarfg.go | 71 - .../gonum.org/v1/gonum/lapack/gonum/dlarft.go | 166 - .../gonum.org/v1/gonum/lapack/gonum/dlarfx.go | 550 - .../gonum.org/v1/gonum/lapack/gonum/dlartg.go | 80 - .../gonum.org/v1/gonum/lapack/gonum/dlas2.go | 43 - .../gonum.org/v1/gonum/lapack/gonum/dlascl.go | 111 - .../gonum.org/v1/gonum/lapack/gonum/dlaset.go | 58 - .../gonum.org/v1/gonum/lapack/gonum/dlasq1.go | 100 - .../gonum.org/v1/gonum/lapack/gonum/dlasq2.go | 369 - .../gonum.org/v1/gonum/lapack/gonum/dlasq3.go | 172 - .../gonum.org/v1/gonum/lapack/gonum/dlasq4.go | 249 - .../gonum.org/v1/gonum/lapack/gonum/dlasq5.go | 140 - .../gonum.org/v1/gonum/lapack/gonum/dlasq6.go | 118 - .../gonum.org/v1/gonum/lapack/gonum/dlasr.go | 279 - .../gonum.org/v1/gonum/lapack/gonum/dlasrt.go | 36 - .../gonum.org/v1/gonum/lapack/gonum/dlassq.go | 41 - .../gonum.org/v1/gonum/lapack/gonum/dlasv2.go | 115 - .../gonum.org/v1/gonum/lapack/gonum/dlaswp.go | 52 - .../gonum.org/v1/gonum/lapack/gonum/dlasy2.go | 290 - .../gonum.org/v1/gonum/lapack/gonum/dlatbs.go | 452 - .../gonum.org/v1/gonum/lapack/gonum/dlatrd.go | 165 - .../gonum.org/v1/gonum/lapack/gonum/dlatrs.go | 359 - .../gonum.org/v1/gonum/lapack/gonum/dlauu2.go | 64 - .../gonum.org/v1/gonum/lapack/gonum/dlauum.go | 81 - vendor/gonum.org/v1/gonum/lapack/gonum/doc.go | 28 - .../gonum.org/v1/gonum/lapack/gonum/dorg2l.go | 76 - .../gonum.org/v1/gonum/lapack/gonum/dorg2r.go | 75 - .../gonum.org/v1/gonum/lapack/gonum/dorgbr.go | 138 - .../gonum.org/v1/gonum/lapack/gonum/dorghr.go | 101 - .../gonum.org/v1/gonum/lapack/gonum/dorgl2.go | 71 - .../gonum.org/v1/gonum/lapack/gonum/dorglq.go | 123 - .../gonum.org/v1/gonum/lapack/gonum/dorgql.go | 136 - .../gonum.org/v1/gonum/lapack/gonum/dorgqr.go | 134 - .../gonum.org/v1/gonum/lapack/gonum/dorgtr.go | 104 - .../gonum.org/v1/gonum/lapack/gonum/dorm2r.go | 101 - .../gonum.org/v1/gonum/lapack/gonum/dormbr.go | 178 - .../gonum.org/v1/gonum/lapack/gonum/dormhr.go | 129 - .../gonum.org/v1/gonum/lapack/gonum/dorml2.go | 102 - .../gonum.org/v1/gonum/lapack/gonum/dormlq.go | 174 - .../gonum.org/v1/gonum/lapack/gonum/dormqr.go | 177 - .../gonum.org/v1/gonum/lapack/gonum/dormr2.go | 103 - .../gonum.org/v1/gonum/lapack/gonum/dpbcon.go | 108 - .../gonum.org/v1/gonum/lapack/gonum/dpbtf2.go | 112 - .../gonum.org/v1/gonum/lapack/gonum/dpbtrf.go | 214 - .../gonum.org/v1/gonum/lapack/gonum/dpbtrs.go | 67 - .../gonum.org/v1/gonum/lapack/gonum/dpocon.go | 90 - .../gonum.org/v1/gonum/lapack/gonum/dpotf2.go | 82 - .../gonum.org/v1/gonum/lapack/gonum/dpotrf.go | 81 - .../gonum.org/v1/gonum/lapack/gonum/dpotri.go | 44 - .../gonum.org/v1/gonum/lapack/gonum/dpotrs.go | 62 - .../gonum.org/v1/gonum/lapack/gonum/drscl.go | 63 - .../gonum.org/v1/gonum/lapack/gonum/dsteqr.go | 376 - .../gonum.org/v1/gonum/lapack/gonum/dsterf.go | 285 - .../gonum.org/v1/gonum/lapack/gonum/dsyev.go | 130 - .../gonum.org/v1/gonum/lapack/gonum/dsytd2.go | 136 - .../gonum.org/v1/gonum/lapack/gonum/dsytrd.go | 172 - .../gonum.org/v1/gonum/lapack/gonum/dtgsja.go | 373 - .../gonum.org/v1/gonum/lapack/gonum/dtrcon.go | 90 - .../v1/gonum/lapack/gonum/dtrevc3.go | 885 -- .../gonum.org/v1/gonum/lapack/gonum/dtrexc.go | 230 - .../gonum.org/v1/gonum/lapack/gonum/dtrti2.go | 69 - .../gonum.org/v1/gonum/lapack/gonum/dtrtri.go | 72 - .../gonum.org/v1/gonum/lapack/gonum/dtrtrs.go | 55 - .../gonum.org/v1/gonum/lapack/gonum/errors.go | 174 - .../gonum.org/v1/gonum/lapack/gonum/iladlc.go | 45 - .../gonum.org/v1/gonum/lapack/gonum/iladlr.go | 41 - .../gonum.org/v1/gonum/lapack/gonum/ilaenv.go | 387 - .../gonum.org/v1/gonum/lapack/gonum/iparmq.go | 115 - .../gonum.org/v1/gonum/lapack/gonum/lapack.go | 51 - vendor/gonum.org/v1/gonum/lapack/lapack.go | 213 - .../gonum.org/v1/gonum/lapack/lapack64/doc.go | 20 - .../v1/gonum/lapack/lapack64/lapack64.go | 581 - vendor/gonum.org/v1/gonum/mat/README.md | 3 - vendor/gonum.org/v1/gonum/mat/band.go | 335 - vendor/gonum.org/v1/gonum/mat/cdense.go | 202 - vendor/gonum.org/v1/gonum/mat/cholesky.go | 700 - vendor/gonum.org/v1/gonum/mat/cmatrix.go | 217 - vendor/gonum.org/v1/gonum/mat/consts.go | 15 - vendor/gonum.org/v1/gonum/mat/dense.go | 586 - .../v1/gonum/mat/dense_arithmetic.go | 867 -- vendor/gonum.org/v1/gonum/mat/diagonal.go | 326 - vendor/gonum.org/v1/gonum/mat/doc.go | 178 - vendor/gonum.org/v1/gonum/mat/eigen.go | 360 - vendor/gonum.org/v1/gonum/mat/errors.go | 151 - vendor/gonum.org/v1/gonum/mat/format.go | 238 - vendor/gonum.org/v1/gonum/mat/gsvd.go | 434 - vendor/gonum.org/v1/gonum/mat/hogsvd.go | 239 - .../v1/gonum/mat/index_bound_checks.go | 348 - .../v1/gonum/mat/index_no_bound_checks.go | 359 - vendor/gonum.org/v1/gonum/mat/inner.go | 124 - vendor/gonum.org/v1/gonum/mat/io.go | 491 - vendor/gonum.org/v1/gonum/mat/lq.go | 269 - vendor/gonum.org/v1/gonum/mat/lu.go | 439 - vendor/gonum.org/v1/gonum/mat/matrix.go | 1008 -- vendor/gonum.org/v1/gonum/mat/offset.go | 31 - .../v1/gonum/mat/offset_appengine.go | 39 - vendor/gonum.org/v1/gonum/mat/pool.go | 238 - vendor/gonum.org/v1/gonum/mat/product.go | 193 - vendor/gonum.org/v1/gonum/mat/qr.go | 266 - vendor/gonum.org/v1/gonum/mat/shadow.go | 242 - .../gonum.org/v1/gonum/mat/shadow_common.go | 54 - .../gonum.org/v1/gonum/mat/shadow_complex.go | 72 - vendor/gonum.org/v1/gonum/mat/solve.go | 140 - vendor/gonum.org/v1/gonum/mat/svd.go | 251 - vendor/gonum.org/v1/gonum/mat/symband.go | 280 - vendor/gonum.org/v1/gonum/mat/symmetric.go | 666 - vendor/gonum.org/v1/gonum/mat/triangular.go | 734 - vendor/gonum.org/v1/gonum/mat/triband.go | 371 - vendor/gonum.org/v1/gonum/mat/vector.go | 798 - .../google.golang.org/appengine/.travis.yml | 20 - .../appengine/CONTRIBUTING.md | 90 - vendor/google.golang.org/appengine/README.md | 100 - vendor/google.golang.org/appengine/go.mod | 9 - vendor/google.golang.org/appengine/go.sum | 11 - .../app_identity/app_identity_service.proto | 64 - .../appengine/internal/base/api_base.proto | 33 - .../internal/datastore/datastore_v3.proto | 551 - .../appengine/internal/log/log_service.proto | 150 - .../internal/modules/modules_service.proto | 80 - .../appengine/internal/regen.sh | 40 - .../internal/remote_api/remote_api.proto | 44 - .../internal/urlfetch/urlfetch_service.proto | 64 - .../appengine/travis_install.sh | 18 - .../appengine/travis_test.sh | 12 - vendor/gopkg.in/yaml.v2/.travis.yml | 16 - vendor/gopkg.in/yaml.v2/README.md | 133 - vendor/gopkg.in/yaml.v2/go.mod | 5 - .../admissionregistration/v1/doc.go} | 27 +- .../admissionregistration/v1/generated.pb.go | 3469 +++++ .../api/admissionregistration/v1/register.go | 53 + .../api/admissionregistration/v1/types.go | 551 + .../v1/types_swagger_doc_generated.go | 151 + .../v1/zz_generated.deepcopy.go | 396 + .../v1beta1/generated.proto | 487 - vendor/k8s.io/api/apps/v1/generated.proto | 701 - .../k8s.io/api/apps/v1beta1/generated.proto | 484 - .../k8s.io/api/apps/v1beta2/generated.proto | 752 - .../v1alpha1/generated.proto | 162 - .../api/authentication/v1/generated.proto | 182 - .../authentication/v1beta1/generated.proto | 118 - .../api/authorization/v1/generated.proto | 272 - .../api/authorization/v1beta1/generated.proto | 272 - .../k8s.io/api/autoscaling/v1/generated.proto | 419 - .../api/autoscaling/v2beta1/generated.proto | 400 - .../api/autoscaling/v2beta2/generated.proto | 372 - vendor/k8s.io/api/batch/v1/generated.proto | 184 - .../k8s.io/api/batch/v1beta1/generated.proto | 137 - .../k8s.io/api/batch/v2alpha1/generated.proto | 135 - .../api/certificates/v1beta1/generated.proto | 121 - .../api/coordination/v1/generated.proto | 80 - .../api/coordination/v1beta1/generated.proto | 80 - vendor/k8s.io/api/core/v1/generated.proto | 5278 ------- .../types => api/discovery/v1alpha1}/doc.go | 11 +- .../api/discovery/v1alpha1/generated.pb.go | 1730 +++ .../k8s.io/api/discovery/v1alpha1/register.go | 56 + vendor/k8s.io/api/discovery/v1alpha1/types.go | 162 + .../v1alpha1/types_swagger_doc_generated.go | 86 + .../discovery/v1alpha1/well_known_labels.go | 28 + .../v1alpha1/zz_generated.deepcopy.go | 195 + vendor/k8s.io/api/discovery/v1beta1/doc.go | 22 + .../api/discovery/v1beta1/generated.pb.go | 1730 +++ .../k8s.io/api/discovery/v1beta1/register.go | 56 + vendor/k8s.io/api/discovery/v1beta1/types.go | 162 + .../v1beta1/types_swagger_doc_generated.go | 86 + .../discovery/v1beta1/well_known_labels.go | 28 + .../v1beta1/zz_generated.deepcopy.go | 195 + .../k8s.io/api/events/v1beta1/generated.proto | 122 - .../api/extensions/v1beta1/generated.proto | 1193 -- .../flowcontrol/v1alpha1/doc.go} | 13 +- .../api/flowcontrol/v1alpha1/generated.pb.go | 5459 +++++++ .../api/flowcontrol/v1alpha1/register.go | 58 + .../k8s.io/api/flowcontrol/v1alpha1/types.go | 513 + .../v1alpha1/types_swagger_doc_generated.go | 258 + .../v1alpha1/zz_generated.deepcopy.go | 541 + .../k8s.io/api/networking/v1/generated.proto | 195 - .../api/networking/v1beta1/generated.proto | 186 - .../k8s.io/api/node/v1alpha1/generated.proto | 118 - .../k8s.io/api/node/v1beta1/generated.proto | 108 - .../k8s.io/api/policy/v1beta1/generated.proto | 400 - vendor/k8s.io/api/rbac/v1/generated.proto | 199 - .../k8s.io/api/rbac/v1alpha1/generated.proto | 209 - .../k8s.io/api/rbac/v1beta1/generated.proto | 208 - .../k8s.io/api/scheduling/v1/generated.proto | 75 - .../api/scheduling/v1alpha1/generated.proto | 76 - .../api/scheduling/v1beta1/generated.proto | 76 - .../api/settings/v1alpha1/generated.proto | 75 - vendor/k8s.io/api/storage/v1/generated.proto | 279 - .../api/storage/v1alpha1/generated.proto | 136 - .../api/storage/v1beta1/generated.proto | 372 - .../pkg/apis/apiextensions/v1/generated.proto | 631 - .../apiextensions/v1beta1/generated.proto | 668 - .../k8s.io/apimachinery/pkg/api/errors/OWNERS | 25 - .../k8s.io/apimachinery/pkg/api/meta/OWNERS | 23 - .../apimachinery/pkg/api/resource/OWNERS | 16 - .../pkg/api/resource/generated.proto | 88 - .../apimachinery/pkg/apis/meta/v1/OWNERS | 32 - .../pkg/apis/meta/v1/generated.proto | 1024 -- .../pkg/apis/meta/v1beta1/generated.proto | 42 - .../apimachinery/pkg/runtime/generated.proto | 127 - .../pkg/util/intstr/generated.proto | 43 - .../apimachinery/pkg/util/mergepatch/OWNERS | 7 - .../pkg/util/strategicpatch/OWNERS | 8 - .../third_party/forked/golang/json/OWNERS | 7 - .../client-go/discovery/discovery_client.go | 7 + vendor/k8s.io/client-go/discovery/doc.go | 2 +- .../k8s.io/client-go/kubernetes/clientset.go | 63 + .../client-go/kubernetes/scheme/register.go | 8 + .../v1/admissionregistration_client.go | 94 + .../typed/admissionregistration/v1}/doc.go | 9 +- .../v1/generated_expansion.go} | 11 +- .../v1/mutatingwebhookconfiguration.go | 164 + .../v1/validatingwebhookconfiguration.go | 164 + .../v1/tokenreview_expansion.go | 8 + .../v1beta1/tokenreview_expansion.go | 8 + .../v1/localsubjectaccessreview_expansion.go | 8 + .../v1/selfsubjectaccessreview_expansion.go | 8 + .../v1/selfsubjectrulesreview_expansion.go | 8 + .../v1/subjectaccessreview_expansion.go | 8 + .../localsubjectaccessreview_expansion.go | 8 + .../selfsubjectaccessreview_expansion.go | 8 + .../selfsubjectrulesreview_expansion.go | 8 + .../v1beta1/subjectaccessreview_expansion.go | 8 + .../typed/core/v1/event_expansion.go | 10 +- .../client-go/kubernetes/typed/core/v1/pod.go | 31 + .../discovery/v1alpha1/discovery_client.go | 89 + .../typed/discovery/v1alpha1}/doc.go | 9 +- .../typed/discovery/v1alpha1/endpointslice.go | 174 + .../discovery/v1alpha1/generated_expansion.go | 21 + .../discovery/v1beta1/discovery_client.go | 89 + .../kubernetes/typed/discovery/v1beta1/doc.go | 20 + .../typed/discovery/v1beta1/endpointslice.go | 174 + .../discovery/v1beta1/generated_expansion.go} | 7 +- .../typed/flowcontrol/v1alpha1/doc.go | 20 + .../v1alpha1/flowcontrol_client.go | 94 + .../typed/flowcontrol/v1alpha1/flowschema.go | 180 + .../v1alpha1/generated_expansion.go | 23 + .../v1alpha1/prioritylevelconfiguration.go | 180 + .../kubernetes/typed/storage/v1/csinode.go | 164 + .../typed/storage/v1/generated_expansion.go | 2 + .../typed/storage/v1/storage_client.go | 5 + .../pkg/apis/clientauthentication/OWNERS | 9 - .../v1beta1/zz_generated.conversion.go | 5 - .../client-go/pkg/version/.gitattributes | 1 - vendor/k8s.io/client-go/pkg/version/def.bzl | 38 - .../plugin/pkg/client/auth/exec/exec.go | 19 +- .../plugin/pkg/client/auth/gcp/OWNERS | 8 - vendor/k8s.io/client-go/rest/OWNERS | 26 - vendor/k8s.io/client-go/rest/client.go | 141 +- vendor/k8s.io/client-go/rest/config.go | 112 +- vendor/k8s.io/client-go/rest/plugin.go | 4 +- vendor/k8s.io/client-go/rest/request.go | 268 +- vendor/k8s.io/client-go/rest/transport.go | 8 +- .../client-go/rest/zz_generated.deepcopy.go | 5 + vendor/k8s.io/client-go/testing/actions.go | 4 +- vendor/k8s.io/client-go/testing/fixture.go | 40 +- vendor/k8s.io/client-go/tools/auth/OWNERS | 9 - vendor/k8s.io/client-go/tools/cache/OWNERS | 51 - .../client-go/tools/cache/controller.go | 5 +- .../client-go/tools/cache/delta_fifo.go | 28 +- .../client-go/tools/cache/expiration_cache.go | 15 +- .../tools/cache/expiration_cache_fakes.go | 3 + .../tools/cache/fake_custom_store.go | 4 +- vendor/k8s.io/client-go/tools/cache/fifo.go | 11 +- vendor/k8s.io/client-go/tools/cache/heap.go | 10 +- vendor/k8s.io/client-go/tools/cache/index.go | 29 +- .../k8s.io/client-go/tools/cache/listers.go | 3 + .../client-go/tools/cache/mutation_cache.go | 1 + .../tools/cache/mutation_detector.go | 28 +- .../k8s.io/client-go/tools/cache/reflector.go | 91 +- .../tools/cache/reflector_metrics.go | 13 - .../client-go/tools/cache/shared_informer.go | 125 +- vendor/k8s.io/client-go/tools/cache/store.go | 0 .../tools/cache/thread_safe_store.go | 8 + .../client-go/tools/cache/undelta_store.go | 8 +- .../client-go/tools/clientcmd/api/types.go | 5 + .../tools/clientcmd/api/v1/conversion.go | 346 +- .../client-go/tools/clientcmd/api/v1/doc.go | 1 + .../tools/clientcmd/api/v1/register.go | 2 +- .../client-go/tools/clientcmd/api/v1/types.go | 2 + .../api/v1/zz_generated.conversion.go | 424 + .../tools/clientcmd/client_config.go | 12 +- .../client-go/tools/clientcmd/loader.go | 26 +- .../client-go/tools/clientcmd/validation.go | 11 +- vendor/k8s.io/client-go/tools/metrics/OWNERS | 9 - vendor/k8s.io/client-go/tools/pager/pager.go | 15 +- vendor/k8s.io/client-go/tools/record/OWNERS | 29 - vendor/k8s.io/client-go/tools/record/doc.go | 3 +- vendor/k8s.io/client-go/tools/record/event.go | 53 +- .../k8s.io/client-go/tools/reference/ref.go | 53 +- vendor/k8s.io/client-go/transport/OWNERS | 9 - vendor/k8s.io/client-go/transport/cache.go | 36 +- vendor/k8s.io/client-go/transport/config.go | 10 + .../client-go/transport/round_trippers.go | 69 +- .../client-go/transport/token_source.go | 9 + .../k8s.io/client-go/transport/transport.go | 20 +- vendor/k8s.io/client-go/util/cert/OWNERS | 9 - vendor/k8s.io/client-go/util/cert/io.go | 17 +- vendor/k8s.io/client-go/util/cert/pem.go | 12 + .../client-go/util/cert/server_inspection.go | 102 + .../util/connrotation/connrotation.go | 10 +- .../client-go/util/flowcontrol/backoff.go | 14 +- .../client-go/util/flowcontrol/throttle.go | 16 + .../k8s.io/client-go/util/homedir/homedir.go | 71 +- .../k8s.io/client-go/util/jsonpath/parser.go | 6 +- vendor/k8s.io/client-go/util/keyutil/OWNERS | 7 - vendor/k8s.io/client-go/util/retry/OWNERS | 4 - vendor/k8s.io/client-go/util/retry/util.go | 68 +- .../util/workqueue/delaying_queue.go | 35 +- vendor/k8s.io/client-go/util/workqueue/doc.go | 2 +- .../client-go/util/workqueue/metrics.go | 84 +- vendor/k8s.io/code-generator/CONTRIBUTING.md | 7 - vendor/k8s.io/code-generator/LICENSE | 202 - vendor/k8s.io/code-generator/OWNERS | 13 - vendor/k8s.io/code-generator/README.md | 24 - .../k8s.io/code-generator/SECURITY_CONTACTS | 17 - .../code-generator/cmd/client-gen/OWNERS | 10 - .../code-generator/cmd/client-gen/README.md | 4 - .../cmd/client-gen/args/args.go | 120 - .../cmd/client-gen/args/gvpackages.go | 183 - .../cmd/client-gen/args/gvtype.go | 110 - .../client-gen/generators/client_generator.go | 403 - .../generators/fake/fake_client_generator.go | 130 - .../fake/generator_fake_for_clientset.go | 167 - .../fake/generator_fake_for_group.go | 130 - .../fake/generator_fake_for_type.go | 479 - .../generators/generator_for_clientset.go | 183 - .../generators/generator_for_expansion.go | 54 - .../generators/generator_for_group.go | 246 - .../generators/generator_for_type.go | 599 - .../generators/scheme/generator_for_scheme.go | 186 - .../cmd/client-gen/generators/util/tags.go | 341 - .../code-generator/cmd/client-gen/main.go | 66 - .../cmd/client-gen/path/path.go | 31 - .../cmd/client-gen/types/helpers.go | 121 - .../cmd/client-gen/types/types.go | 75 - .../cmd/conversion-gen/args/args.go | 83 - .../conversion-gen/generators/conversion.go | 1195 -- .../code-generator/cmd/conversion-gen/main.go | 125 - .../cmd/deepcopy-gen/args/args.go | 54 - .../code-generator/cmd/deepcopy-gen/main.go | 85 - .../cmd/defaulter-gen/args/args.go | 54 - .../code-generator/cmd/defaulter-gen/main.go | 84 - .../cmd/go-to-protobuf/.gitignore | 1 - .../code-generator/cmd/go-to-protobuf/OWNERS | 6 - .../code-generator/cmd/go-to-protobuf/main.go | 39 - .../cmd/go-to-protobuf/protobuf/cmd.go | 428 - .../cmd/go-to-protobuf/protobuf/generator.go | 773 - .../go-to-protobuf/protobuf/import_tracker.go | 50 - .../cmd/go-to-protobuf/protobuf/namer.go | 208 - .../cmd/go-to-protobuf/protobuf/package.go | 215 - .../cmd/go-to-protobuf/protobuf/parser.go | 452 - .../code-generator/cmd/import-boss/.gitignore | 1 - .../code-generator/cmd/import-boss/main.go | 96 - .../cmd/informer-gen/args/args.go | 77 - .../cmd/informer-gen/generators/factory.go | 258 - .../generators/factoryinterface.go | 90 - .../cmd/informer-gen/generators/generic.go | 184 - .../informer-gen/generators/groupinterface.go | 118 - .../cmd/informer-gen/generators/informer.go | 186 - .../cmd/informer-gen/generators/packages.go | 352 - .../cmd/informer-gen/generators/types.go | 42 - .../generators/versioninterface.go | 109 - .../code-generator/cmd/informer-gen/main.go | 63 - .../cmd/lister-gen/.import-restrictions | 1 - .../cmd/lister-gen/args/args.go | 56 - .../cmd/lister-gen/generators/expansion.go | 67 - .../cmd/lister-gen/generators/lister.go | 371 - .../code-generator/cmd/lister-gen/main.go | 60 - .../code-generator/cmd/openapi-gen/main.go | 57 - .../cmd/register-gen/args/args.go | 39 - .../cmd/register-gen/generators/packages.go | 137 - .../generators/register_external.go | 117 - .../code-generator/cmd/register-gen/main.go | 53 - .../code-generator/cmd/set-gen/.gitignore | 1 - .../k8s.io/code-generator/cmd/set-gen/main.go | 56 - .../k8s.io/code-generator/code-of-conduct.md | 3 - .../k8s.io/code-generator/generate-groups.sh | 89 - .../generate-internal-groups.sh | 122 - vendor/k8s.io/code-generator/go.mod | 30 - vendor/k8s.io/code-generator/go.sum | 134 - .../code-generator/pkg/namer/tag-override.go | 58 - .../k8s.io/code-generator/pkg/util/build.go | 61 - .../third_party/forked/golang/reflect/type.go | 91 - vendor/k8s.io/code-generator/tools.go | 35 - vendor/k8s.io/gengo/LICENSE | 202 - vendor/k8s.io/gengo/args/args.go | 212 - .../deepcopy-gen/generators/deepcopy.go | 924 -- .../defaulter-gen/generators/defaulter.go | 832 - .../import-boss/generators/import_restrict.go | 419 - .../gengo/examples/set-gen/generators/sets.go | 362 - .../gengo/examples/set-gen/generators/tags.go | 33 - .../gengo/examples/set-gen/sets/byte.go | 205 - .../k8s.io/gengo/examples/set-gen/sets/int.go | 205 - .../gengo/examples/set-gen/sets/int64.go | 205 - .../gengo/examples/set-gen/sets/string.go | 205 - .../gengo/generator/default_generator.go | 62 - .../k8s.io/gengo/generator/default_package.go | 75 - vendor/k8s.io/gengo/generator/doc.go | 31 - .../k8s.io/gengo/generator/error_tracker.go | 50 - vendor/k8s.io/gengo/generator/execute.go | 314 - vendor/k8s.io/gengo/generator/generator.go | 256 - .../k8s.io/gengo/generator/import_tracker.go | 70 - .../k8s.io/gengo/generator/snippet_writer.go | 154 - .../gengo/generator/transitive_closure.go | 65 - vendor/k8s.io/gengo/namer/doc.go | 31 - vendor/k8s.io/gengo/namer/import_tracker.go | 112 - vendor/k8s.io/gengo/namer/namer.go | 383 - vendor/k8s.io/gengo/namer/order.go | 72 - vendor/k8s.io/gengo/namer/plural_namer.go | 120 - vendor/k8s.io/gengo/parser/parse.go | 859 - vendor/k8s.io/gengo/types/comments.go | 82 - vendor/k8s.io/gengo/types/flatten.go | 57 - vendor/k8s.io/gengo/types/types.go | 526 - vendor/k8s.io/klog/.travis.yml | 16 - vendor/k8s.io/klog/CONTRIBUTING.md | 22 - vendor/k8s.io/klog/OWNERS | 19 - vendor/k8s.io/klog/README.md | 97 - vendor/k8s.io/klog/RELEASE.md | 9 - vendor/k8s.io/klog/SECURITY_CONTACTS | 20 - vendor/k8s.io/klog/code-of-conduct.md | 3 - vendor/k8s.io/klog/go.mod | 5 - vendor/k8s.io/klog/go.sum | 2 - .../kube-openapi/cmd/openapi-gen/args/args.go | 76 - .../k8s.io/kube-openapi/pkg/common/common.go | 192 - .../kube-openapi/pkg/generators/README.md | 49 - .../kube-openapi/pkg/generators/api_linter.go | 220 - .../kube-openapi/pkg/generators/config.go | 91 - .../kube-openapi/pkg/generators/extension.go | 198 - .../kube-openapi/pkg/generators/openapi.go | 692 - .../kube-openapi/pkg/generators/rules/OWNERS | 4 - .../kube-openapi/pkg/generators/rules/doc.go | 23 - .../pkg/generators/rules/idl_tag.go | 53 - .../pkg/generators/rules/names_match.go | 172 - .../generators/rules/omitempty_match_case.go | 64 - .../kube-openapi/pkg/generators/union.go | 207 - .../k8s.io/kube-openapi/pkg/util/proto/OWNERS | 2 - .../kube-openapi/pkg/util/sets/empty.go | 27 - .../kube-openapi/pkg/util/sets/string.go | 207 - vendor/k8s.io/utils/pointer/OWNERS | 10 - vendor/sigs.k8s.io/yaml/.gitignore | 20 - vendor/sigs.k8s.io/yaml/.travis.yml | 13 - vendor/sigs.k8s.io/yaml/CONTRIBUTING.md | 31 - vendor/sigs.k8s.io/yaml/OWNERS | 27 - vendor/sigs.k8s.io/yaml/README.md | 123 - vendor/sigs.k8s.io/yaml/RELEASE.md | 9 - vendor/sigs.k8s.io/yaml/SECURITY_CONTACTS | 17 - vendor/sigs.k8s.io/yaml/code-of-conduct.md | 3 - vendor/sigs.k8s.io/yaml/go.mod | 8 - vendor/sigs.k8s.io/yaml/go.sum | 9 - vendor/sigs.k8s.io/yaml/yaml.go | 61 - 1062 files changed, 26775 insertions(+), 178039 deletions(-) delete mode 100644 vendor/github.com/PuerkitoBio/purell/.gitignore delete mode 100644 vendor/github.com/PuerkitoBio/purell/.travis.yml delete mode 100644 vendor/github.com/PuerkitoBio/purell/LICENSE delete mode 100644 vendor/github.com/PuerkitoBio/purell/README.md delete mode 100644 vendor/github.com/PuerkitoBio/purell/purell.go delete mode 100644 vendor/github.com/PuerkitoBio/urlesc/.travis.yml delete mode 100644 vendor/github.com/PuerkitoBio/urlesc/LICENSE delete mode 100644 vendor/github.com/PuerkitoBio/urlesc/README.md delete mode 100644 vendor/github.com/PuerkitoBio/urlesc/urlesc.go delete mode 100644 vendor/github.com/emicklei/go-restful/.gitignore delete mode 100644 vendor/github.com/emicklei/go-restful/.travis.yml delete mode 100644 vendor/github.com/emicklei/go-restful/CHANGES.md delete mode 100644 vendor/github.com/emicklei/go-restful/LICENSE delete mode 100644 vendor/github.com/emicklei/go-restful/Makefile delete mode 100644 vendor/github.com/emicklei/go-restful/README.md delete mode 100644 vendor/github.com/emicklei/go-restful/Srcfile delete mode 100644 vendor/github.com/emicklei/go-restful/bench_test.sh delete mode 100644 vendor/github.com/emicklei/go-restful/compress.go delete mode 100644 vendor/github.com/emicklei/go-restful/compressor_cache.go delete mode 100644 vendor/github.com/emicklei/go-restful/compressor_pools.go delete mode 100644 vendor/github.com/emicklei/go-restful/compressors.go delete mode 100644 vendor/github.com/emicklei/go-restful/constants.go delete mode 100644 vendor/github.com/emicklei/go-restful/container.go delete mode 100644 vendor/github.com/emicklei/go-restful/cors_filter.go delete mode 100644 vendor/github.com/emicklei/go-restful/coverage.sh delete mode 100644 vendor/github.com/emicklei/go-restful/curly.go delete mode 100644 vendor/github.com/emicklei/go-restful/curly_route.go delete mode 100644 vendor/github.com/emicklei/go-restful/custom_verb.go delete mode 100644 vendor/github.com/emicklei/go-restful/doc.go delete mode 100644 vendor/github.com/emicklei/go-restful/entity_accessors.go delete mode 100644 vendor/github.com/emicklei/go-restful/filter.go delete mode 100644 vendor/github.com/emicklei/go-restful/json.go delete mode 100644 vendor/github.com/emicklei/go-restful/jsoniter.go delete mode 100644 vendor/github.com/emicklei/go-restful/jsr311.go delete mode 100644 vendor/github.com/emicklei/go-restful/log/log.go delete mode 100644 vendor/github.com/emicklei/go-restful/logger.go delete mode 100644 vendor/github.com/emicklei/go-restful/mime.go delete mode 100644 vendor/github.com/emicklei/go-restful/options_filter.go delete mode 100644 vendor/github.com/emicklei/go-restful/parameter.go delete mode 100644 vendor/github.com/emicklei/go-restful/path_expression.go delete mode 100644 vendor/github.com/emicklei/go-restful/path_processor.go delete mode 100644 vendor/github.com/emicklei/go-restful/request.go delete mode 100644 vendor/github.com/emicklei/go-restful/response.go delete mode 100644 vendor/github.com/emicklei/go-restful/route.go delete mode 100644 vendor/github.com/emicklei/go-restful/route_builder.go delete mode 100644 vendor/github.com/emicklei/go-restful/router.go delete mode 100644 vendor/github.com/emicklei/go-restful/service_error.go delete mode 100644 vendor/github.com/emicklei/go-restful/web_service.go delete mode 100644 vendor/github.com/emicklei/go-restful/web_service_container.go delete mode 100644 vendor/github.com/evanphx/json-patch/.travis.yml delete mode 100644 vendor/github.com/evanphx/json-patch/README.md delete mode 100644 vendor/github.com/evanphx/json-patch/go.mod delete mode 100644 vendor/github.com/evanphx/json-patch/go.sum delete mode 100644 vendor/github.com/ghodss/yaml/.gitignore delete mode 100644 vendor/github.com/ghodss/yaml/.travis.yml delete mode 100644 vendor/github.com/ghodss/yaml/README.md delete mode 100644 vendor/github.com/go-openapi/jsonpointer/.editorconfig delete mode 100644 vendor/github.com/go-openapi/jsonpointer/.gitignore delete mode 100644 vendor/github.com/go-openapi/jsonpointer/.travis.yml delete mode 100644 vendor/github.com/go-openapi/jsonpointer/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/jsonpointer/LICENSE delete mode 100644 vendor/github.com/go-openapi/jsonpointer/README.md delete mode 100644 vendor/github.com/go-openapi/jsonpointer/go.mod delete mode 100644 vendor/github.com/go-openapi/jsonpointer/go.sum delete mode 100644 vendor/github.com/go-openapi/jsonpointer/pointer.go delete mode 100644 vendor/github.com/go-openapi/jsonreference/.gitignore delete mode 100644 vendor/github.com/go-openapi/jsonreference/.travis.yml delete mode 100644 vendor/github.com/go-openapi/jsonreference/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/jsonreference/LICENSE delete mode 100644 vendor/github.com/go-openapi/jsonreference/README.md delete mode 100644 vendor/github.com/go-openapi/jsonreference/go.mod delete mode 100644 vendor/github.com/go-openapi/jsonreference/go.sum delete mode 100644 vendor/github.com/go-openapi/jsonreference/reference.go delete mode 100644 vendor/github.com/go-openapi/spec/.editorconfig delete mode 100644 vendor/github.com/go-openapi/spec/.gitignore delete mode 100644 vendor/github.com/go-openapi/spec/.golangci.yml delete mode 100644 vendor/github.com/go-openapi/spec/.travis.yml delete mode 100644 vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/spec/LICENSE delete mode 100644 vendor/github.com/go-openapi/spec/README.md delete mode 100644 vendor/github.com/go-openapi/spec/bindata.go delete mode 100644 vendor/github.com/go-openapi/spec/cache.go delete mode 100644 vendor/github.com/go-openapi/spec/contact_info.go delete mode 100644 vendor/github.com/go-openapi/spec/debug.go delete mode 100644 vendor/github.com/go-openapi/spec/expander.go delete mode 100644 vendor/github.com/go-openapi/spec/external_docs.go delete mode 100644 vendor/github.com/go-openapi/spec/go.mod delete mode 100644 vendor/github.com/go-openapi/spec/go.sum delete mode 100644 vendor/github.com/go-openapi/spec/header.go delete mode 100644 vendor/github.com/go-openapi/spec/info.go delete mode 100644 vendor/github.com/go-openapi/spec/items.go delete mode 100644 vendor/github.com/go-openapi/spec/license.go delete mode 100644 vendor/github.com/go-openapi/spec/normalizer.go delete mode 100644 vendor/github.com/go-openapi/spec/operation.go delete mode 100644 vendor/github.com/go-openapi/spec/parameter.go delete mode 100644 vendor/github.com/go-openapi/spec/path_item.go delete mode 100644 vendor/github.com/go-openapi/spec/paths.go delete mode 100644 vendor/github.com/go-openapi/spec/ref.go delete mode 100644 vendor/github.com/go-openapi/spec/response.go delete mode 100644 vendor/github.com/go-openapi/spec/responses.go delete mode 100644 vendor/github.com/go-openapi/spec/schema.go delete mode 100644 vendor/github.com/go-openapi/spec/schema_loader.go delete mode 100644 vendor/github.com/go-openapi/spec/security_scheme.go delete mode 100644 vendor/github.com/go-openapi/spec/spec.go delete mode 100644 vendor/github.com/go-openapi/spec/swagger.go delete mode 100644 vendor/github.com/go-openapi/spec/tag.go delete mode 100644 vendor/github.com/go-openapi/spec/unused.go delete mode 100644 vendor/github.com/go-openapi/spec/xml_object.go delete mode 100644 vendor/github.com/go-openapi/swag/.editorconfig delete mode 100644 vendor/github.com/go-openapi/swag/.gitignore delete mode 100644 vendor/github.com/go-openapi/swag/.golangci.yml delete mode 100644 vendor/github.com/go-openapi/swag/.travis.yml delete mode 100644 vendor/github.com/go-openapi/swag/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/swag/LICENSE delete mode 100644 vendor/github.com/go-openapi/swag/README.md delete mode 100644 vendor/github.com/go-openapi/swag/convert.go delete mode 100644 vendor/github.com/go-openapi/swag/convert_types.go delete mode 100644 vendor/github.com/go-openapi/swag/doc.go delete mode 100644 vendor/github.com/go-openapi/swag/go.mod delete mode 100644 vendor/github.com/go-openapi/swag/go.sum delete mode 100644 vendor/github.com/go-openapi/swag/json.go delete mode 100644 vendor/github.com/go-openapi/swag/loading.go delete mode 100644 vendor/github.com/go-openapi/swag/name_lexem.go delete mode 100644 vendor/github.com/go-openapi/swag/net.go delete mode 100644 vendor/github.com/go-openapi/swag/path.go delete mode 100644 vendor/github.com/go-openapi/swag/post_go18.go delete mode 100644 vendor/github.com/go-openapi/swag/post_go19.go delete mode 100644 vendor/github.com/go-openapi/swag/pre_go18.go delete mode 100644 vendor/github.com/go-openapi/swag/pre_go19.go delete mode 100644 vendor/github.com/go-openapi/swag/split.go delete mode 100644 vendor/github.com/go-openapi/swag/util.go delete mode 100644 vendor/github.com/go-openapi/swag/yaml.go delete mode 100644 vendor/github.com/gogo/protobuf/proto/Makefile delete mode 100644 vendor/github.com/golang/glog/README delete mode 100644 vendor/github.com/golang/protobuf/ptypes/any/any.proto delete mode 100644 vendor/github.com/golang/protobuf/ptypes/duration/duration.proto delete mode 100644 vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto delete mode 100644 vendor/github.com/google/gofuzz/.travis.yml delete mode 100644 vendor/github.com/google/gofuzz/CONTRIBUTING.md delete mode 100644 vendor/github.com/google/gofuzz/README.md delete mode 100644 vendor/github.com/google/gofuzz/go.mod delete mode 100644 vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.proto delete mode 100644 vendor/github.com/googleapis/gnostic/OpenAPIv2/README.md delete mode 100644 vendor/github.com/googleapis/gnostic/OpenAPIv2/openapi-2.0.json delete mode 100644 vendor/github.com/googleapis/gnostic/compiler/README.md delete mode 100644 vendor/github.com/googleapis/gnostic/extensions/README.md delete mode 100644 vendor/github.com/googleapis/gnostic/extensions/extension.proto delete mode 100644 vendor/github.com/hashicorp/golang-lru/.gitignore delete mode 100644 vendor/github.com/hashicorp/golang-lru/README.md delete mode 100644 vendor/github.com/hashicorp/golang-lru/go.mod delete mode 100644 vendor/github.com/imdario/mergo/.gitignore delete mode 100644 vendor/github.com/imdario/mergo/.travis.yml delete mode 100644 vendor/github.com/imdario/mergo/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/imdario/mergo/README.md delete mode 100644 vendor/github.com/json-iterator/go/.codecov.yml delete mode 100644 vendor/github.com/json-iterator/go/.gitignore delete mode 100644 vendor/github.com/json-iterator/go/.travis.yml delete mode 100644 vendor/github.com/json-iterator/go/Gopkg.toml delete mode 100644 vendor/github.com/json-iterator/go/README.md delete mode 100755 vendor/github.com/json-iterator/go/build.sh delete mode 100644 vendor/github.com/json-iterator/go/fuzzy_mode_convert_table.md delete mode 100644 vendor/github.com/json-iterator/go/go.mod delete mode 100644 vendor/github.com/json-iterator/go/go.sum delete mode 100755 vendor/github.com/json-iterator/go/test.sh delete mode 100644 vendor/github.com/konsorten/go-windows-terminal-sequences/README.md delete mode 100644 vendor/github.com/konsorten/go-windows-terminal-sequences/go.mod delete mode 100644 vendor/github.com/kubeflow/common/LICENSE delete mode 100644 vendor/github.com/kubeflow/common/pkg/apis/common/v1/constants.go delete mode 100644 vendor/github.com/kubeflow/common/pkg/apis/common/v1/doc.go delete mode 100644 vendor/github.com/kubeflow/common/pkg/apis/common/v1/interface.go delete mode 100644 vendor/github.com/kubeflow/common/pkg/apis/common/v1/openapi_generated.go delete mode 100644 vendor/github.com/kubeflow/common/pkg/apis/common/v1/types.go delete mode 100644 vendor/github.com/kubeflow/common/pkg/apis/common/v1/zz_generated.deepcopy.go delete mode 100644 vendor/github.com/kubeflow/common/pkg/apis/common/v1/zz_generated.defaults.go delete mode 100644 vendor/github.com/mailru/easyjson/LICENSE delete mode 100644 vendor/github.com/mailru/easyjson/buffer/pool.go delete mode 100644 vendor/github.com/mailru/easyjson/jlexer/bytestostr.go delete mode 100644 vendor/github.com/mailru/easyjson/jlexer/bytestostr_nounsafe.go delete mode 100644 vendor/github.com/mailru/easyjson/jlexer/error.go delete mode 100644 vendor/github.com/mailru/easyjson/jlexer/lexer.go delete mode 100644 vendor/github.com/mailru/easyjson/jwriter/writer.go delete mode 100644 vendor/github.com/modern-go/concurrent/.gitignore delete mode 100644 vendor/github.com/modern-go/concurrent/.travis.yml delete mode 100644 vendor/github.com/modern-go/concurrent/README.md delete mode 100755 vendor/github.com/modern-go/concurrent/test.sh delete mode 100644 vendor/github.com/modern-go/reflect2/.gitignore delete mode 100644 vendor/github.com/modern-go/reflect2/.travis.yml delete mode 100644 vendor/github.com/modern-go/reflect2/Gopkg.toml delete mode 100644 vendor/github.com/modern-go/reflect2/README.md delete mode 100755 vendor/github.com/modern-go/reflect2/test.sh delete mode 100644 vendor/github.com/pkg/errors/.gitignore delete mode 100644 vendor/github.com/pkg/errors/.travis.yml delete mode 100644 vendor/github.com/pkg/errors/Makefile delete mode 100644 vendor/github.com/pkg/errors/README.md delete mode 100644 vendor/github.com/pkg/errors/appveyor.yml delete mode 100644 vendor/github.com/sirupsen/logrus/.gitignore delete mode 100644 vendor/github.com/sirupsen/logrus/.travis.yml delete mode 100644 vendor/github.com/sirupsen/logrus/CHANGELOG.md delete mode 100644 vendor/github.com/sirupsen/logrus/README.md delete mode 100644 vendor/github.com/sirupsen/logrus/appveyor.yml delete mode 100644 vendor/github.com/sirupsen/logrus/go.mod delete mode 100644 vendor/github.com/sirupsen/logrus/go.sum create mode 100644 vendor/github.com/sirupsen/logrus/terminal_check_js.go delete mode 100644 vendor/github.com/spf13/pflag/.gitignore delete mode 100644 vendor/github.com/spf13/pflag/.travis.yml delete mode 100644 vendor/github.com/spf13/pflag/README.md delete mode 100644 vendor/github.com/spf13/pflag/go.mod delete mode 100644 vendor/github.com/spf13/pflag/go.sum delete mode 100644 vendor/golang.org/x/mod/LICENSE delete mode 100644 vendor/golang.org/x/mod/PATENTS delete mode 100644 vendor/golang.org/x/mod/module/module.go delete mode 100644 vendor/golang.org/x/mod/semver/semver.go delete mode 100644 vendor/golang.org/x/net/http2/.gitignore delete mode 100644 vendor/golang.org/x/net/http2/Dockerfile delete mode 100644 vendor/golang.org/x/net/http2/Makefile delete mode 100644 vendor/golang.org/x/net/http2/README create mode 100644 vendor/golang.org/x/net/idna/tables12.00.go delete mode 100644 vendor/golang.org/x/oauth2/.travis.yml delete mode 100644 vendor/golang.org/x/oauth2/CONTRIBUTING.md delete mode 100644 vendor/golang.org/x/oauth2/README.md delete mode 100644 vendor/golang.org/x/oauth2/go.mod delete mode 100644 vendor/golang.org/x/oauth2/go.sum delete mode 100644 vendor/golang.org/x/sys/unix/.gitignore delete mode 100644 vendor/golang.org/x/sys/unix/README.md delete mode 100755 vendor/golang.org/x/sys/unix/mkall.sh delete mode 100755 vendor/golang.org/x/sys/unix/mkerrors.sh delete mode 100755 vendor/golang.org/x/sys/windows/mkerrors.bash delete mode 100755 vendor/golang.org/x/sys/windows/mkknownfolderids.bash delete mode 100644 vendor/golang.org/x/text/width/gen.go delete mode 100644 vendor/golang.org/x/text/width/gen_common.go delete mode 100644 vendor/golang.org/x/text/width/gen_trieval.go delete mode 100644 vendor/golang.org/x/text/width/kind_string.go delete mode 100644 vendor/golang.org/x/text/width/tables10.0.0.go delete mode 100644 vendor/golang.org/x/text/width/tables11.0.0.go delete mode 100644 vendor/golang.org/x/text/width/tables9.0.0.go delete mode 100644 vendor/golang.org/x/text/width/transform.go delete mode 100644 vendor/golang.org/x/text/width/trieval.go delete mode 100644 vendor/golang.org/x/text/width/width.go delete mode 100644 vendor/golang.org/x/tools/AUTHORS delete mode 100644 vendor/golang.org/x/tools/CONTRIBUTORS delete mode 100644 vendor/golang.org/x/tools/LICENSE delete mode 100644 vendor/golang.org/x/tools/PATENTS delete mode 100644 vendor/golang.org/x/tools/cmd/getgo/LICENSE delete mode 100644 vendor/golang.org/x/tools/go/ast/astutil/enclosing.go delete mode 100644 vendor/golang.org/x/tools/go/ast/astutil/imports.go delete mode 100644 vendor/golang.org/x/tools/go/ast/astutil/rewrite.go delete mode 100644 vendor/golang.org/x/tools/go/ast/astutil/util.go delete mode 100644 vendor/golang.org/x/tools/imports/forward.go delete mode 100644 vendor/golang.org/x/tools/internal/fastwalk/fastwalk.go delete mode 100644 vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_fileno.go delete mode 100644 vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_ino.go delete mode 100644 vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_bsd.go delete mode 100644 vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_linux.go delete mode 100644 vendor/golang.org/x/tools/internal/fastwalk/fastwalk_portable.go delete mode 100644 vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go delete mode 100644 vendor/golang.org/x/tools/internal/gocommand/invoke.go delete mode 100644 vendor/golang.org/x/tools/internal/gopathwalk/walk.go delete mode 100644 vendor/golang.org/x/tools/internal/imports/fix.go delete mode 100644 vendor/golang.org/x/tools/internal/imports/imports.go delete mode 100644 vendor/golang.org/x/tools/internal/imports/mkindex.go delete mode 100644 vendor/golang.org/x/tools/internal/imports/mkstdlib.go delete mode 100644 vendor/golang.org/x/tools/internal/imports/mod.go delete mode 100644 vendor/golang.org/x/tools/internal/imports/mod_cache.go delete mode 100644 vendor/golang.org/x/tools/internal/imports/sortimports.go delete mode 100644 vendor/golang.org/x/tools/internal/imports/zstdlib.go delete mode 100644 vendor/golang.org/x/xerrors/LICENSE delete mode 100644 vendor/golang.org/x/xerrors/PATENTS delete mode 100644 vendor/golang.org/x/xerrors/README delete mode 100644 vendor/golang.org/x/xerrors/adaptor.go delete mode 100644 vendor/golang.org/x/xerrors/codereview.cfg delete mode 100644 vendor/golang.org/x/xerrors/doc.go delete mode 100644 vendor/golang.org/x/xerrors/errors.go delete mode 100644 vendor/golang.org/x/xerrors/fmt.go delete mode 100644 vendor/golang.org/x/xerrors/format.go delete mode 100644 vendor/golang.org/x/xerrors/frame.go delete mode 100644 vendor/golang.org/x/xerrors/go.mod delete mode 100644 vendor/golang.org/x/xerrors/internal/internal.go delete mode 100644 vendor/golang.org/x/xerrors/wrap.go delete mode 120000 vendor/gonum.org/v1/gonum/.travis/deps.d/linux/01-deps.sh delete mode 120000 vendor/gonum.org/v1/gonum/.travis/deps.d/osx/nothing.sh delete mode 120000 vendor/gonum.org/v1/gonum/.travis/deps.d/windows/nothing.sh delete mode 120000 vendor/gonum.org/v1/gonum/.travis/run.d/linux/01-check-copyright.sh delete mode 120000 vendor/gonum.org/v1/gonum/.travis/run.d/linux/02-check-imports.sh delete mode 120000 vendor/gonum.org/v1/gonum/.travis/run.d/linux/03-check-formatting.sh delete mode 120000 vendor/gonum.org/v1/gonum/.travis/run.d/linux/04-test.sh delete mode 120000 vendor/gonum.org/v1/gonum/.travis/run.d/linux/05-test-coverage.sh delete mode 120000 vendor/gonum.org/v1/gonum/.travis/run.d/linux/06-check-generate.sh delete mode 120000 vendor/gonum.org/v1/gonum/.travis/run.d/osx/01-test.sh delete mode 100644 vendor/gonum.org/v1/gonum/AUTHORS delete mode 100644 vendor/gonum.org/v1/gonum/CONTRIBUTORS delete mode 100644 vendor/gonum.org/v1/gonum/LICENSE delete mode 100644 vendor/gonum.org/v1/gonum/blas/README.md delete mode 100644 vendor/gonum.org/v1/gonum/blas/blas.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/blas64/blas64.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/blas64/conv.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/blas64/conv_symmetric.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/blas64/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/cblas128/cblas128.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/cblas128/conv.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/cblas128/conv_hermitian.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/cblas128/conv_symmetric.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/cblas128/doc.go delete mode 100755 vendor/gonum.org/v1/gonum/blas/conversions.bash delete mode 100644 vendor/gonum.org/v1/gonum/blas/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/dgemm.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/errors.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/gemv.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/gonum.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level1cmplx128.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level1cmplx64.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level1float32.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level1float32_dsdot.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level1float32_sdot.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level1float32_sdsdot.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level1float64.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level1float64_ddot.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level2cmplx128.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level2cmplx64.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level2float32.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level2float64.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level3cmplx128.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level3cmplx64.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level3float32.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level3float64.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/sgemm.go delete mode 100755 vendor/gonum.org/v1/gonum/blas/gonum/single_precision.bash delete mode 100644 vendor/gonum.org/v1/gonum/floats/README.md delete mode 100644 vendor/gonum.org/v1/gonum/floats/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/floats/floats.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/.gitignore delete mode 100644 vendor/gonum.org/v1/gonum/graph/README.md delete mode 100644 vendor/gonum.org/v1/gonum/graph/complement.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/formats/cytoscapejs/testdata/LICENSE delete mode 100644 vendor/gonum.org/v1/gonum/graph/formats/sigmajs/testdata/LICENSE.txt delete mode 100644 vendor/gonum.org/v1/gonum/graph/graph.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/internal/linear/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/internal/linear/linear.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/internal/ordered/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/internal/ordered/sort.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/internal/set/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/internal/set/same.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/internal/set/same_appengine.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/internal/set/set.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/internal/uid/uid.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/iterator/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/iterator/edges.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/iterator/lines.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/iterator/nodes.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/multigraph.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/nodes_edges.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/simple/dense_directed_matrix.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/simple/dense_undirected_matrix.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/simple/directed.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/simple/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/simple/simple.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/simple/undirected.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/simple/weighted_directed.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/simple/weighted_undirected.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/topo/bron_kerbosch.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/topo/clique_graph.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/topo/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/topo/johnson_cycles.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/topo/non_tomita_choice.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/topo/paton_cycles.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/topo/tarjan.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/topo/tomita_choice.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/topo/topo.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/traverse/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/traverse/traverse.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/undirect.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/axpyinc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/axpyincto_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/axpyunitary_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/axpyunitaryto_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/dotcinc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/dotcunitary_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/dotuinc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/dotuunitary_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/dscalinc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/dscalunitary_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/scal.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/scalUnitary_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/scalinc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/stubs_amd64.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/stubs_noasm.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/axpyinc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/axpyincto_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/axpyunitary_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/axpyunitaryto_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/conj.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/dotcinc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/dotcunitary_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/dotuinc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/dotuunitary_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/scal.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/stubs_amd64.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/stubs_noasm.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/axpyinc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/axpyincto_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/axpyunitary_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/axpyunitaryto_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/ddotinc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/ddotunitary_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/dotinc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/dotunitary_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/ge_amd64.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/ge_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/ge_noasm.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/l2norm.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/scal.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/stubs_amd64.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/stubs_noasm.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/abssum_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/abssuminc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/add_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/addconst_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/axpy.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/axpyinc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/axpyincto_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/axpyunitary_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/axpyunitaryto_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/cumprod_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/cumsum_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/div_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/divto_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/dot.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/dot_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/ge_amd64.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/ge_noasm.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/gemvN_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/gemvT_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/ger_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/l1norm_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/l2norm_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/l2norm_noasm.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/l2normdist_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/l2norminc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/linfnorm_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/scal.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/scalinc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/scalincto_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/scalunitary_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/scalunitaryto_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/stubs_amd64.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/stubs_noasm.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/sum_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/cmplx64/abs.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/cmplx64/conj.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/cmplx64/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/cmplx64/isinf.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/cmplx64/isnan.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/cmplx64/sqrt.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/math32/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/math32/math.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/math32/signbit.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/math32/sqrt.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/math32/sqrt_amd64.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/math32/sqrt_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/math32/sqrt_arm64.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/math32/sqrt_arm64.s delete mode 100644 vendor/gonum.org/v1/gonum/lapack/.gitignore delete mode 100644 vendor/gonum.org/v1/gonum/lapack/README.md delete mode 100644 vendor/gonum.org/v1/gonum/lapack/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dbdsqr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dcombssq.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgebak.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgebal.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgebd2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgebrd.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgecon.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgeev.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgehd2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgehrd.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgelq2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgelqf.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgels.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgeql2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgeqp3.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgeqr2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgeqrf.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgerq2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgerqf.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgesvd.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgetf2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgetrf.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgetri.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgetrs.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dggsvd3.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dggsvp3.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dhseqr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlabrd.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlacn2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlacpy.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlae2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlaev2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlaexc.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlags2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlahqr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlahr2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlaln2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlange.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlansb.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlanst.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlansy.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlantr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlanv2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlapll.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlapmt.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlapy2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlaqp2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlaqps.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr04.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr1.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr23.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr5.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlarf.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlarfb.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlarfg.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlarft.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlarfx.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlartg.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlas2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlascl.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlaset.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlasq1.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlasq2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlasq3.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlasq4.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlasq5.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlasq6.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlasr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlasrt.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlassq.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlasv2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlaswp.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlasy2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlatbs.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlatrd.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlatrs.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlauu2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlauum.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dorg2l.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dorg2r.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dorgbr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dorghr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dorgl2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dorglq.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dorgql.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dorgqr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dorgtr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dorm2r.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dormbr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dormhr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dorml2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dormlq.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dormqr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dormr2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dpbcon.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dpbtf2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dpbtrf.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dpbtrs.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dpocon.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dpotf2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dpotrf.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dpotri.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dpotrs.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/drscl.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dsteqr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dsterf.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dsyev.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dsytd2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dsytrd.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dtgsja.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dtrcon.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dtrevc3.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dtrexc.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dtrti2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dtrtri.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dtrtrs.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/errors.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/iladlc.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/iladlr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/ilaenv.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/iparmq.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/lapack.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/lapack.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/lapack64/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/lapack64/lapack64.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/README.md delete mode 100644 vendor/gonum.org/v1/gonum/mat/band.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/cdense.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/cholesky.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/cmatrix.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/consts.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/dense.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/dense_arithmetic.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/diagonal.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/eigen.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/errors.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/format.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/gsvd.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/hogsvd.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/index_bound_checks.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/index_no_bound_checks.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/inner.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/io.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/lq.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/lu.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/matrix.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/offset.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/offset_appengine.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/pool.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/product.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/qr.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/shadow.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/shadow_common.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/shadow_complex.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/solve.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/svd.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/symband.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/symmetric.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/triangular.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/triband.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/vector.go delete mode 100644 vendor/google.golang.org/appengine/.travis.yml delete mode 100644 vendor/google.golang.org/appengine/CONTRIBUTING.md delete mode 100644 vendor/google.golang.org/appengine/README.md delete mode 100644 vendor/google.golang.org/appengine/go.mod delete mode 100644 vendor/google.golang.org/appengine/go.sum delete mode 100644 vendor/google.golang.org/appengine/internal/app_identity/app_identity_service.proto delete mode 100644 vendor/google.golang.org/appengine/internal/base/api_base.proto delete mode 100755 vendor/google.golang.org/appengine/internal/datastore/datastore_v3.proto delete mode 100644 vendor/google.golang.org/appengine/internal/log/log_service.proto delete mode 100644 vendor/google.golang.org/appengine/internal/modules/modules_service.proto delete mode 100755 vendor/google.golang.org/appengine/internal/regen.sh delete mode 100644 vendor/google.golang.org/appengine/internal/remote_api/remote_api.proto delete mode 100644 vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto delete mode 100755 vendor/google.golang.org/appengine/travis_install.sh delete mode 100755 vendor/google.golang.org/appengine/travis_test.sh delete mode 100644 vendor/gopkg.in/yaml.v2/.travis.yml delete mode 100644 vendor/gopkg.in/yaml.v2/README.md delete mode 100644 vendor/gopkg.in/yaml.v2/go.mod rename vendor/k8s.io/{code-generator/cmd/go-to-protobuf/protobuf/tags.go => api/admissionregistration/v1/doc.go} (51%) create mode 100644 vendor/k8s.io/api/admissionregistration/v1/generated.pb.go create mode 100644 vendor/k8s.io/api/admissionregistration/v1/register.go create mode 100644 vendor/k8s.io/api/admissionregistration/v1/types.go create mode 100644 vendor/k8s.io/api/admissionregistration/v1/types_swagger_doc_generated.go create mode 100644 vendor/k8s.io/api/admissionregistration/v1/zz_generated.deepcopy.go delete mode 100644 vendor/k8s.io/api/admissionregistration/v1beta1/generated.proto delete mode 100644 vendor/k8s.io/api/apps/v1/generated.proto delete mode 100644 vendor/k8s.io/api/apps/v1beta1/generated.proto delete mode 100644 vendor/k8s.io/api/apps/v1beta2/generated.proto delete mode 100644 vendor/k8s.io/api/auditregistration/v1alpha1/generated.proto delete mode 100644 vendor/k8s.io/api/authentication/v1/generated.proto delete mode 100644 vendor/k8s.io/api/authentication/v1beta1/generated.proto delete mode 100644 vendor/k8s.io/api/authorization/v1/generated.proto delete mode 100644 vendor/k8s.io/api/authorization/v1beta1/generated.proto delete mode 100644 vendor/k8s.io/api/autoscaling/v1/generated.proto delete mode 100644 vendor/k8s.io/api/autoscaling/v2beta1/generated.proto delete mode 100644 vendor/k8s.io/api/autoscaling/v2beta2/generated.proto delete mode 100644 vendor/k8s.io/api/batch/v1/generated.proto delete mode 100644 vendor/k8s.io/api/batch/v1beta1/generated.proto delete mode 100644 vendor/k8s.io/api/batch/v2alpha1/generated.proto delete mode 100644 vendor/k8s.io/api/certificates/v1beta1/generated.proto delete mode 100644 vendor/k8s.io/api/coordination/v1/generated.proto delete mode 100644 vendor/k8s.io/api/coordination/v1beta1/generated.proto delete mode 100644 vendor/k8s.io/api/core/v1/generated.proto rename vendor/k8s.io/{gengo/types => api/discovery/v1alpha1}/doc.go (69%) create mode 100644 vendor/k8s.io/api/discovery/v1alpha1/generated.pb.go create mode 100644 vendor/k8s.io/api/discovery/v1alpha1/register.go create mode 100644 vendor/k8s.io/api/discovery/v1alpha1/types.go create mode 100644 vendor/k8s.io/api/discovery/v1alpha1/types_swagger_doc_generated.go create mode 100644 vendor/k8s.io/api/discovery/v1alpha1/well_known_labels.go create mode 100644 vendor/k8s.io/api/discovery/v1alpha1/zz_generated.deepcopy.go create mode 100644 vendor/k8s.io/api/discovery/v1beta1/doc.go create mode 100644 vendor/k8s.io/api/discovery/v1beta1/generated.pb.go create mode 100644 vendor/k8s.io/api/discovery/v1beta1/register.go create mode 100644 vendor/k8s.io/api/discovery/v1beta1/types.go create mode 100644 vendor/k8s.io/api/discovery/v1beta1/types_swagger_doc_generated.go create mode 100644 vendor/k8s.io/api/discovery/v1beta1/well_known_labels.go create mode 100644 vendor/k8s.io/api/discovery/v1beta1/zz_generated.deepcopy.go delete mode 100644 vendor/k8s.io/api/events/v1beta1/generated.proto delete mode 100644 vendor/k8s.io/api/extensions/v1beta1/generated.proto rename vendor/k8s.io/{gengo/examples/set-gen/sets/empty.go => api/flowcontrol/v1alpha1/doc.go} (62%) create mode 100644 vendor/k8s.io/api/flowcontrol/v1alpha1/generated.pb.go create mode 100644 vendor/k8s.io/api/flowcontrol/v1alpha1/register.go create mode 100644 vendor/k8s.io/api/flowcontrol/v1alpha1/types.go create mode 100644 vendor/k8s.io/api/flowcontrol/v1alpha1/types_swagger_doc_generated.go create mode 100644 vendor/k8s.io/api/flowcontrol/v1alpha1/zz_generated.deepcopy.go delete mode 100644 vendor/k8s.io/api/networking/v1/generated.proto delete mode 100644 vendor/k8s.io/api/networking/v1beta1/generated.proto delete mode 100644 vendor/k8s.io/api/node/v1alpha1/generated.proto delete mode 100644 vendor/k8s.io/api/node/v1beta1/generated.proto delete mode 100644 vendor/k8s.io/api/policy/v1beta1/generated.proto delete mode 100644 vendor/k8s.io/api/rbac/v1/generated.proto delete mode 100644 vendor/k8s.io/api/rbac/v1alpha1/generated.proto delete mode 100644 vendor/k8s.io/api/rbac/v1beta1/generated.proto delete mode 100644 vendor/k8s.io/api/scheduling/v1/generated.proto delete mode 100644 vendor/k8s.io/api/scheduling/v1alpha1/generated.proto delete mode 100644 vendor/k8s.io/api/scheduling/v1beta1/generated.proto delete mode 100644 vendor/k8s.io/api/settings/v1alpha1/generated.proto delete mode 100644 vendor/k8s.io/api/storage/v1/generated.proto delete mode 100644 vendor/k8s.io/api/storage/v1alpha1/generated.proto delete mode 100644 vendor/k8s.io/api/storage/v1beta1/generated.proto delete mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.proto delete mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto delete mode 100644 vendor/k8s.io/apimachinery/pkg/api/errors/OWNERS delete mode 100644 vendor/k8s.io/apimachinery/pkg/api/meta/OWNERS delete mode 100644 vendor/k8s.io/apimachinery/pkg/api/resource/OWNERS delete mode 100644 vendor/k8s.io/apimachinery/pkg/api/resource/generated.proto delete mode 100644 vendor/k8s.io/apimachinery/pkg/apis/meta/v1/OWNERS delete mode 100644 vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto delete mode 100644 vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/generated.proto delete mode 100644 vendor/k8s.io/apimachinery/pkg/runtime/generated.proto delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/intstr/generated.proto delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/mergepatch/OWNERS delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/strategicpatch/OWNERS delete mode 100644 vendor/k8s.io/apimachinery/third_party/forked/golang/json/OWNERS create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/admissionregistration_client.go rename vendor/k8s.io/{kube-openapi/pkg/common => client-go/kubernetes/typed/admissionregistration/v1}/doc.go (77%) rename vendor/k8s.io/{apimachinery/pkg/runtime/schema/generated.proto => client-go/kubernetes/typed/admissionregistration/v1/generated_expansion.go} (71%) create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/discovery_client.go rename vendor/k8s.io/{gengo/parser => client-go/kubernetes/typed/discovery/v1alpha1}/doc.go (75%) create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/endpointslice.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/generated_expansion.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/discovery_client.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/doc.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/endpointslice.go rename vendor/k8s.io/{gengo/examples/set-gen/sets/doc.go => client-go/kubernetes/typed/discovery/v1beta1/generated_expansion.go} (84%) create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/doc.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/flowcontrol_client.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/flowschema.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/generated_expansion.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/prioritylevelconfiguration.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1/csinode.go delete mode 100644 vendor/k8s.io/client-go/pkg/apis/clientauthentication/OWNERS delete mode 100644 vendor/k8s.io/client-go/pkg/version/.gitattributes delete mode 100644 vendor/k8s.io/client-go/pkg/version/def.bzl delete mode 100644 vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/OWNERS delete mode 100644 vendor/k8s.io/client-go/rest/OWNERS delete mode 100644 vendor/k8s.io/client-go/tools/auth/OWNERS delete mode 100644 vendor/k8s.io/client-go/tools/cache/OWNERS mode change 100755 => 100644 vendor/k8s.io/client-go/tools/cache/store.go create mode 100644 vendor/k8s.io/client-go/tools/clientcmd/api/v1/zz_generated.conversion.go delete mode 100644 vendor/k8s.io/client-go/tools/metrics/OWNERS delete mode 100644 vendor/k8s.io/client-go/tools/record/OWNERS delete mode 100644 vendor/k8s.io/client-go/transport/OWNERS delete mode 100644 vendor/k8s.io/client-go/util/cert/OWNERS create mode 100644 vendor/k8s.io/client-go/util/cert/server_inspection.go delete mode 100644 vendor/k8s.io/client-go/util/keyutil/OWNERS delete mode 100644 vendor/k8s.io/client-go/util/retry/OWNERS delete mode 100644 vendor/k8s.io/code-generator/CONTRIBUTING.md delete mode 100644 vendor/k8s.io/code-generator/LICENSE delete mode 100644 vendor/k8s.io/code-generator/OWNERS delete mode 100644 vendor/k8s.io/code-generator/README.md delete mode 100644 vendor/k8s.io/code-generator/SECURITY_CONTACTS delete mode 100644 vendor/k8s.io/code-generator/cmd/client-gen/OWNERS delete mode 100644 vendor/k8s.io/code-generator/cmd/client-gen/README.md delete mode 100644 vendor/k8s.io/code-generator/cmd/client-gen/args/args.go delete mode 100644 vendor/k8s.io/code-generator/cmd/client-gen/args/gvpackages.go delete mode 100644 vendor/k8s.io/code-generator/cmd/client-gen/args/gvtype.go delete mode 100644 vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go delete mode 100644 vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/fake_client_generator.go delete mode 100644 vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_clientset.go delete mode 100644 vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_group.go delete mode 100644 vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go delete mode 100644 vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go delete mode 100644 vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_expansion.go delete mode 100644 vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_group.go delete mode 100644 vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go delete mode 100644 vendor/k8s.io/code-generator/cmd/client-gen/generators/scheme/generator_for_scheme.go delete mode 100644 vendor/k8s.io/code-generator/cmd/client-gen/generators/util/tags.go delete mode 100644 vendor/k8s.io/code-generator/cmd/client-gen/main.go delete mode 100644 vendor/k8s.io/code-generator/cmd/client-gen/path/path.go delete mode 100644 vendor/k8s.io/code-generator/cmd/client-gen/types/helpers.go delete mode 100644 vendor/k8s.io/code-generator/cmd/client-gen/types/types.go delete mode 100644 vendor/k8s.io/code-generator/cmd/conversion-gen/args/args.go delete mode 100644 vendor/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go delete mode 100644 vendor/k8s.io/code-generator/cmd/conversion-gen/main.go delete mode 100644 vendor/k8s.io/code-generator/cmd/deepcopy-gen/args/args.go delete mode 100644 vendor/k8s.io/code-generator/cmd/deepcopy-gen/main.go delete mode 100644 vendor/k8s.io/code-generator/cmd/defaulter-gen/args/args.go delete mode 100644 vendor/k8s.io/code-generator/cmd/defaulter-gen/main.go delete mode 100644 vendor/k8s.io/code-generator/cmd/go-to-protobuf/.gitignore delete mode 100644 vendor/k8s.io/code-generator/cmd/go-to-protobuf/OWNERS delete mode 100644 vendor/k8s.io/code-generator/cmd/go-to-protobuf/main.go delete mode 100644 vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/cmd.go delete mode 100644 vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go delete mode 100644 vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/import_tracker.go delete mode 100644 vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/namer.go delete mode 100644 vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/package.go delete mode 100644 vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/parser.go delete mode 100644 vendor/k8s.io/code-generator/cmd/import-boss/.gitignore delete mode 100644 vendor/k8s.io/code-generator/cmd/import-boss/main.go delete mode 100644 vendor/k8s.io/code-generator/cmd/informer-gen/args/args.go delete mode 100644 vendor/k8s.io/code-generator/cmd/informer-gen/generators/factory.go delete mode 100644 vendor/k8s.io/code-generator/cmd/informer-gen/generators/factoryinterface.go delete mode 100644 vendor/k8s.io/code-generator/cmd/informer-gen/generators/generic.go delete mode 100644 vendor/k8s.io/code-generator/cmd/informer-gen/generators/groupinterface.go delete mode 100644 vendor/k8s.io/code-generator/cmd/informer-gen/generators/informer.go delete mode 100644 vendor/k8s.io/code-generator/cmd/informer-gen/generators/packages.go delete mode 100644 vendor/k8s.io/code-generator/cmd/informer-gen/generators/types.go delete mode 100644 vendor/k8s.io/code-generator/cmd/informer-gen/generators/versioninterface.go delete mode 100644 vendor/k8s.io/code-generator/cmd/informer-gen/main.go delete mode 100644 vendor/k8s.io/code-generator/cmd/lister-gen/.import-restrictions delete mode 100644 vendor/k8s.io/code-generator/cmd/lister-gen/args/args.go delete mode 100644 vendor/k8s.io/code-generator/cmd/lister-gen/generators/expansion.go delete mode 100644 vendor/k8s.io/code-generator/cmd/lister-gen/generators/lister.go delete mode 100644 vendor/k8s.io/code-generator/cmd/lister-gen/main.go delete mode 100644 vendor/k8s.io/code-generator/cmd/openapi-gen/main.go delete mode 100644 vendor/k8s.io/code-generator/cmd/register-gen/args/args.go delete mode 100644 vendor/k8s.io/code-generator/cmd/register-gen/generators/packages.go delete mode 100644 vendor/k8s.io/code-generator/cmd/register-gen/generators/register_external.go delete mode 100644 vendor/k8s.io/code-generator/cmd/register-gen/main.go delete mode 100644 vendor/k8s.io/code-generator/cmd/set-gen/.gitignore delete mode 100644 vendor/k8s.io/code-generator/cmd/set-gen/main.go delete mode 100644 vendor/k8s.io/code-generator/code-of-conduct.md delete mode 100755 vendor/k8s.io/code-generator/generate-groups.sh delete mode 100755 vendor/k8s.io/code-generator/generate-internal-groups.sh delete mode 100644 vendor/k8s.io/code-generator/go.mod delete mode 100644 vendor/k8s.io/code-generator/go.sum delete mode 100644 vendor/k8s.io/code-generator/pkg/namer/tag-override.go delete mode 100644 vendor/k8s.io/code-generator/pkg/util/build.go delete mode 100644 vendor/k8s.io/code-generator/third_party/forked/golang/reflect/type.go delete mode 100644 vendor/k8s.io/code-generator/tools.go delete mode 100644 vendor/k8s.io/gengo/LICENSE delete mode 100644 vendor/k8s.io/gengo/args/args.go delete mode 100644 vendor/k8s.io/gengo/examples/deepcopy-gen/generators/deepcopy.go delete mode 100644 vendor/k8s.io/gengo/examples/defaulter-gen/generators/defaulter.go delete mode 100644 vendor/k8s.io/gengo/examples/import-boss/generators/import_restrict.go delete mode 100644 vendor/k8s.io/gengo/examples/set-gen/generators/sets.go delete mode 100644 vendor/k8s.io/gengo/examples/set-gen/generators/tags.go delete mode 100644 vendor/k8s.io/gengo/examples/set-gen/sets/byte.go delete mode 100644 vendor/k8s.io/gengo/examples/set-gen/sets/int.go delete mode 100644 vendor/k8s.io/gengo/examples/set-gen/sets/int64.go delete mode 100644 vendor/k8s.io/gengo/examples/set-gen/sets/string.go delete mode 100644 vendor/k8s.io/gengo/generator/default_generator.go delete mode 100644 vendor/k8s.io/gengo/generator/default_package.go delete mode 100644 vendor/k8s.io/gengo/generator/doc.go delete mode 100644 vendor/k8s.io/gengo/generator/error_tracker.go delete mode 100644 vendor/k8s.io/gengo/generator/execute.go delete mode 100644 vendor/k8s.io/gengo/generator/generator.go delete mode 100644 vendor/k8s.io/gengo/generator/import_tracker.go delete mode 100644 vendor/k8s.io/gengo/generator/snippet_writer.go delete mode 100644 vendor/k8s.io/gengo/generator/transitive_closure.go delete mode 100644 vendor/k8s.io/gengo/namer/doc.go delete mode 100644 vendor/k8s.io/gengo/namer/import_tracker.go delete mode 100644 vendor/k8s.io/gengo/namer/namer.go delete mode 100644 vendor/k8s.io/gengo/namer/order.go delete mode 100644 vendor/k8s.io/gengo/namer/plural_namer.go delete mode 100644 vendor/k8s.io/gengo/parser/parse.go delete mode 100644 vendor/k8s.io/gengo/types/comments.go delete mode 100644 vendor/k8s.io/gengo/types/flatten.go delete mode 100644 vendor/k8s.io/gengo/types/types.go delete mode 100644 vendor/k8s.io/klog/.travis.yml delete mode 100644 vendor/k8s.io/klog/CONTRIBUTING.md delete mode 100644 vendor/k8s.io/klog/OWNERS delete mode 100644 vendor/k8s.io/klog/README.md delete mode 100644 vendor/k8s.io/klog/RELEASE.md delete mode 100644 vendor/k8s.io/klog/SECURITY_CONTACTS delete mode 100644 vendor/k8s.io/klog/code-of-conduct.md delete mode 100644 vendor/k8s.io/klog/go.mod delete mode 100644 vendor/k8s.io/klog/go.sum delete mode 100644 vendor/k8s.io/kube-openapi/cmd/openapi-gen/args/args.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/common/common.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/generators/README.md delete mode 100644 vendor/k8s.io/kube-openapi/pkg/generators/api_linter.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/generators/config.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/generators/extension.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/generators/openapi.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/generators/rules/OWNERS delete mode 100644 vendor/k8s.io/kube-openapi/pkg/generators/rules/doc.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/generators/rules/idl_tag.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/generators/rules/names_match.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/generators/rules/omitempty_match_case.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/generators/union.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/util/proto/OWNERS delete mode 100644 vendor/k8s.io/kube-openapi/pkg/util/sets/empty.go delete mode 100644 vendor/k8s.io/kube-openapi/pkg/util/sets/string.go delete mode 100644 vendor/k8s.io/utils/pointer/OWNERS delete mode 100644 vendor/sigs.k8s.io/yaml/.gitignore delete mode 100644 vendor/sigs.k8s.io/yaml/.travis.yml delete mode 100644 vendor/sigs.k8s.io/yaml/CONTRIBUTING.md delete mode 100644 vendor/sigs.k8s.io/yaml/OWNERS delete mode 100644 vendor/sigs.k8s.io/yaml/README.md delete mode 100644 vendor/sigs.k8s.io/yaml/RELEASE.md delete mode 100644 vendor/sigs.k8s.io/yaml/SECURITY_CONTACTS delete mode 100644 vendor/sigs.k8s.io/yaml/code-of-conduct.md delete mode 100644 vendor/sigs.k8s.io/yaml/go.mod delete mode 100644 vendor/sigs.k8s.io/yaml/go.sum diff --git a/Gopkg.toml b/Gopkg.toml index b8ab202..e2ae991 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -24,10 +24,17 @@ # go-tests = true # unused-packages = true +[[constraint]] + name = "github.com/ghodss/yaml" + version = "1.0.0" [[constraint]] branch = "master" - name = "github.com/kubeflow/common" + name = "github.com/golang/glog" + +[[constraint]] + name = "github.com/golang/protobuf" + version = "1.3.5" [[constraint]] name = "github.com/onrik/logrus" @@ -35,29 +42,25 @@ [[constraint]] name = "github.com/sirupsen/logrus" - version = "1.4.2" + version = "1.5.0" [[constraint]] name = "k8s.io/api" version = "0.17.4" +[[constraint]] + name = "k8s.io/apiextensions-apiserver" + version = "0.17.4" + [[constraint]] name = "k8s.io/apimachinery" version = "0.17.4" [[constraint]] name = "k8s.io/client-go" - version = "4.0.0" + version = "0.17.4" [prune] go-tests = true + non-go = true unused-packages = true - -[[constraint]] - name = "k8s.io/code-generator" - version = "release-1.7" - version = "4.0.0" - -[[constraint]] - name = "cloud.google.com/go" - version = "0.55.0" diff --git a/vendor/github.com/PuerkitoBio/purell/.gitignore b/vendor/github.com/PuerkitoBio/purell/.gitignore deleted file mode 100644 index 748e4c8..0000000 --- a/vendor/github.com/PuerkitoBio/purell/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -*.sublime-* -.DS_Store -*.swp -*.swo -tags diff --git a/vendor/github.com/PuerkitoBio/purell/.travis.yml b/vendor/github.com/PuerkitoBio/purell/.travis.yml deleted file mode 100644 index cf31e6a..0000000 --- a/vendor/github.com/PuerkitoBio/purell/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: go - -go: - - 1.4.x - - 1.5.x - - 1.6.x - - 1.7.x - - 1.8.x - - 1.9.x - - "1.10.x" - - "1.11.x" - - tip diff --git a/vendor/github.com/PuerkitoBio/purell/LICENSE b/vendor/github.com/PuerkitoBio/purell/LICENSE deleted file mode 100644 index 4b9986d..0000000 --- a/vendor/github.com/PuerkitoBio/purell/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2012, Martin Angers -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -* Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/PuerkitoBio/purell/README.md b/vendor/github.com/PuerkitoBio/purell/README.md deleted file mode 100644 index 07de0c4..0000000 --- a/vendor/github.com/PuerkitoBio/purell/README.md +++ /dev/null @@ -1,188 +0,0 @@ -# Purell - -Purell is a tiny Go library to normalize URLs. It returns a pure URL. Pure-ell. Sanitizer and all. Yeah, I know... - -Based on the [wikipedia paper][wiki] and the [RFC 3986 document][rfc]. - -[![build status](https://travis-ci.org/PuerkitoBio/purell.svg?branch=master)](http://travis-ci.org/PuerkitoBio/purell) - -## Install - -`go get github.com/PuerkitoBio/purell` - -## Changelog - -* **v1.1.1** : Fix failing test due to Go1.12 changes (thanks to @ianlancetaylor). -* **2016-11-14 (v1.1.0)** : IDN: Conform to RFC 5895: Fold character width (thanks to @beeker1121). -* **2016-07-27 (v1.0.0)** : Normalize IDN to ASCII (thanks to @zenovich). -* **2015-02-08** : Add fix for relative paths issue ([PR #5][pr5]) and add fix for unnecessary encoding of reserved characters ([see issue #7][iss7]). -* **v0.2.0** : Add benchmarks, Attempt IDN support. -* **v0.1.0** : Initial release. - -## Examples - -From `example_test.go` (note that in your code, you would import "github.com/PuerkitoBio/purell", and would prefix references to its methods and constants with "purell."): - -```go -package purell - -import ( - "fmt" - "net/url" -) - -func ExampleNormalizeURLString() { - if normalized, err := NormalizeURLString("hTTp://someWEBsite.com:80/Amazing%3f/url/", - FlagLowercaseScheme|FlagLowercaseHost|FlagUppercaseEscapes); err != nil { - panic(err) - } else { - fmt.Print(normalized) - } - // Output: http://somewebsite.com:80/Amazing%3F/url/ -} - -func ExampleMustNormalizeURLString() { - normalized := MustNormalizeURLString("hTTpS://someWEBsite.com:443/Amazing%fa/url/", - FlagsUnsafeGreedy) - fmt.Print(normalized) - - // Output: http://somewebsite.com/Amazing%FA/url -} - -func ExampleNormalizeURL() { - if u, err := url.Parse("Http://SomeUrl.com:8080/a/b/.././c///g?c=3&a=1&b=9&c=0#target"); err != nil { - panic(err) - } else { - normalized := NormalizeURL(u, FlagsUsuallySafeGreedy|FlagRemoveDuplicateSlashes|FlagRemoveFragment) - fmt.Print(normalized) - } - - // Output: http://someurl.com:8080/a/c/g?c=3&a=1&b=9&c=0 -} -``` - -## API - -As seen in the examples above, purell offers three methods, `NormalizeURLString(string, NormalizationFlags) (string, error)`, `MustNormalizeURLString(string, NormalizationFlags) (string)` and `NormalizeURL(*url.URL, NormalizationFlags) (string)`. They all normalize the provided URL based on the specified flags. Here are the available flags: - -```go -const ( - // Safe normalizations - FlagLowercaseScheme NormalizationFlags = 1 << iota // HTTP://host -> http://host, applied by default in Go1.1 - FlagLowercaseHost // http://HOST -> http://host - FlagUppercaseEscapes // http://host/t%ef -> http://host/t%EF - FlagDecodeUnnecessaryEscapes // http://host/t%41 -> http://host/tA - FlagEncodeNecessaryEscapes // http://host/!"#$ -> http://host/%21%22#$ - FlagRemoveDefaultPort // http://host:80 -> http://host - FlagRemoveEmptyQuerySeparator // http://host/path? -> http://host/path - - // Usually safe normalizations - FlagRemoveTrailingSlash // http://host/path/ -> http://host/path - FlagAddTrailingSlash // http://host/path -> http://host/path/ (should choose only one of these add/remove trailing slash flags) - FlagRemoveDotSegments // http://host/path/./a/b/../c -> http://host/path/a/c - - // Unsafe normalizations - FlagRemoveDirectoryIndex // http://host/path/index.html -> http://host/path/ - FlagRemoveFragment // http://host/path#fragment -> http://host/path - FlagForceHTTP // https://host -> http://host - FlagRemoveDuplicateSlashes // http://host/path//a///b -> http://host/path/a/b - FlagRemoveWWW // http://www.host/ -> http://host/ - FlagAddWWW // http://host/ -> http://www.host/ (should choose only one of these add/remove WWW flags) - FlagSortQuery // http://host/path?c=3&b=2&a=1&b=1 -> http://host/path?a=1&b=1&b=2&c=3 - - // Normalizations not in the wikipedia article, required to cover tests cases - // submitted by jehiah - FlagDecodeDWORDHost // http://1113982867 -> http://66.102.7.147 - FlagDecodeOctalHost // http://0102.0146.07.0223 -> http://66.102.7.147 - FlagDecodeHexHost // http://0x42660793 -> http://66.102.7.147 - FlagRemoveUnnecessaryHostDots // http://.host../path -> http://host/path - FlagRemoveEmptyPortSeparator // http://host:/path -> http://host/path - - // Convenience set of safe normalizations - FlagsSafe NormalizationFlags = FlagLowercaseHost | FlagLowercaseScheme | FlagUppercaseEscapes | FlagDecodeUnnecessaryEscapes | FlagEncodeNecessaryEscapes | FlagRemoveDefaultPort | FlagRemoveEmptyQuerySeparator - - // For convenience sets, "greedy" uses the "remove trailing slash" and "remove www. prefix" flags, - // while "non-greedy" uses the "add (or keep) the trailing slash" and "add www. prefix". - - // Convenience set of usually safe normalizations (includes FlagsSafe) - FlagsUsuallySafeGreedy NormalizationFlags = FlagsSafe | FlagRemoveTrailingSlash | FlagRemoveDotSegments - FlagsUsuallySafeNonGreedy NormalizationFlags = FlagsSafe | FlagAddTrailingSlash | FlagRemoveDotSegments - - // Convenience set of unsafe normalizations (includes FlagsUsuallySafe) - FlagsUnsafeGreedy NormalizationFlags = FlagsUsuallySafeGreedy | FlagRemoveDirectoryIndex | FlagRemoveFragment | FlagForceHTTP | FlagRemoveDuplicateSlashes | FlagRemoveWWW | FlagSortQuery - FlagsUnsafeNonGreedy NormalizationFlags = FlagsUsuallySafeNonGreedy | FlagRemoveDirectoryIndex | FlagRemoveFragment | FlagForceHTTP | FlagRemoveDuplicateSlashes | FlagAddWWW | FlagSortQuery - - // Convenience set of all available flags - FlagsAllGreedy = FlagsUnsafeGreedy | FlagDecodeDWORDHost | FlagDecodeOctalHost | FlagDecodeHexHost | FlagRemoveUnnecessaryHostDots | FlagRemoveEmptyPortSeparator - FlagsAllNonGreedy = FlagsUnsafeNonGreedy | FlagDecodeDWORDHost | FlagDecodeOctalHost | FlagDecodeHexHost | FlagRemoveUnnecessaryHostDots | FlagRemoveEmptyPortSeparator -) -``` - -For convenience, the set of flags `FlagsSafe`, `FlagsUsuallySafe[Greedy|NonGreedy]`, `FlagsUnsafe[Greedy|NonGreedy]` and `FlagsAll[Greedy|NonGreedy]` are provided for the similarly grouped normalizations on [wikipedia's URL normalization page][wiki]. You can add (using the bitwise OR `|` operator) or remove (using the bitwise AND NOT `&^` operator) individual flags from the sets if required, to build your own custom set. - -The [full godoc reference is available on gopkgdoc][godoc]. - -Some things to note: - -* `FlagDecodeUnnecessaryEscapes`, `FlagEncodeNecessaryEscapes`, `FlagUppercaseEscapes` and `FlagRemoveEmptyQuerySeparator` are always implicitly set, because internally, the URL string is parsed as an URL object, which automatically decodes unnecessary escapes, uppercases and encodes necessary ones, and removes empty query separators (an unnecessary `?` at the end of the url). So this operation cannot **not** be done. For this reason, `FlagRemoveEmptyQuerySeparator` (as well as the other three) has been included in the `FlagsSafe` convenience set, instead of `FlagsUnsafe`, where Wikipedia puts it. - -* The `FlagDecodeUnnecessaryEscapes` decodes the following escapes (*from -> to*): - - %24 -> $ - - %26 -> & - - %2B-%3B -> +,-./0123456789:; - - %3D -> = - - %40-%5A -> @ABCDEFGHIJKLMNOPQRSTUVWXYZ - - %5F -> _ - - %61-%7A -> abcdefghijklmnopqrstuvwxyz - - %7E -> ~ - - -* When the `NormalizeURL` function is used (passing an URL object), this source URL object is modified (that is, after the call, the URL object will be modified to reflect the normalization). - -* The *replace IP with domain name* normalization (`http://208.77.188.166/ → http://www.example.com/`) is obviously not possible for a library without making some network requests. This is not implemented in purell. - -* The *remove unused query string parameters* and *remove default query parameters* are also not implemented, since this is a very case-specific normalization, and it is quite trivial to do with an URL object. - -### Safe vs Usually Safe vs Unsafe - -Purell allows you to control the level of risk you take while normalizing an URL. You can aggressively normalize, play it totally safe, or anything in between. - -Consider the following URL: - -`HTTPS://www.RooT.com/toto/t%45%1f///a/./b/../c/?z=3&w=2&a=4&w=1#invalid` - -Normalizing with the `FlagsSafe` gives: - -`https://www.root.com/toto/tE%1F///a/./b/../c/?z=3&w=2&a=4&w=1#invalid` - -With the `FlagsUsuallySafeGreedy`: - -`https://www.root.com/toto/tE%1F///a/c?z=3&w=2&a=4&w=1#invalid` - -And with `FlagsUnsafeGreedy`: - -`http://root.com/toto/tE%1F/a/c?a=4&w=1&w=2&z=3` - -## TODOs - -* Add a class/default instance to allow specifying custom directory index names? At the moment, removing directory index removes `(^|/)((?:default|index)\.\w{1,4})$`. - -## Thanks / Contributions - -@rogpeppe -@jehiah -@opennota -@pchristopher1275 -@zenovich -@beeker1121 - -## License - -The [BSD 3-Clause license][bsd]. - -[bsd]: http://opensource.org/licenses/BSD-3-Clause -[wiki]: http://en.wikipedia.org/wiki/URL_normalization -[rfc]: http://tools.ietf.org/html/rfc3986#section-6 -[godoc]: http://go.pkgdoc.org/github.com/PuerkitoBio/purell -[pr5]: https://github.com/PuerkitoBio/purell/pull/5 -[iss7]: https://github.com/PuerkitoBio/purell/issues/7 diff --git a/vendor/github.com/PuerkitoBio/purell/purell.go b/vendor/github.com/PuerkitoBio/purell/purell.go deleted file mode 100644 index 6d0fc19..0000000 --- a/vendor/github.com/PuerkitoBio/purell/purell.go +++ /dev/null @@ -1,379 +0,0 @@ -/* -Package purell offers URL normalization as described on the wikipedia page: -http://en.wikipedia.org/wiki/URL_normalization -*/ -package purell - -import ( - "bytes" - "fmt" - "net/url" - "regexp" - "sort" - "strconv" - "strings" - - "github.com/PuerkitoBio/urlesc" - "golang.org/x/net/idna" - "golang.org/x/text/unicode/norm" - "golang.org/x/text/width" -) - -// A set of normalization flags determines how a URL will -// be normalized. -type NormalizationFlags uint - -const ( - // Safe normalizations - FlagLowercaseScheme NormalizationFlags = 1 << iota // HTTP://host -> http://host, applied by default in Go1.1 - FlagLowercaseHost // http://HOST -> http://host - FlagUppercaseEscapes // http://host/t%ef -> http://host/t%EF - FlagDecodeUnnecessaryEscapes // http://host/t%41 -> http://host/tA - FlagEncodeNecessaryEscapes // http://host/!"#$ -> http://host/%21%22#$ - FlagRemoveDefaultPort // http://host:80 -> http://host - FlagRemoveEmptyQuerySeparator // http://host/path? -> http://host/path - - // Usually safe normalizations - FlagRemoveTrailingSlash // http://host/path/ -> http://host/path - FlagAddTrailingSlash // http://host/path -> http://host/path/ (should choose only one of these add/remove trailing slash flags) - FlagRemoveDotSegments // http://host/path/./a/b/../c -> http://host/path/a/c - - // Unsafe normalizations - FlagRemoveDirectoryIndex // http://host/path/index.html -> http://host/path/ - FlagRemoveFragment // http://host/path#fragment -> http://host/path - FlagForceHTTP // https://host -> http://host - FlagRemoveDuplicateSlashes // http://host/path//a///b -> http://host/path/a/b - FlagRemoveWWW // http://www.host/ -> http://host/ - FlagAddWWW // http://host/ -> http://www.host/ (should choose only one of these add/remove WWW flags) - FlagSortQuery // http://host/path?c=3&b=2&a=1&b=1 -> http://host/path?a=1&b=1&b=2&c=3 - - // Normalizations not in the wikipedia article, required to cover tests cases - // submitted by jehiah - FlagDecodeDWORDHost // http://1113982867 -> http://66.102.7.147 - FlagDecodeOctalHost // http://0102.0146.07.0223 -> http://66.102.7.147 - FlagDecodeHexHost // http://0x42660793 -> http://66.102.7.147 - FlagRemoveUnnecessaryHostDots // http://.host../path -> http://host/path - FlagRemoveEmptyPortSeparator // http://host:/path -> http://host/path - - // Convenience set of safe normalizations - FlagsSafe NormalizationFlags = FlagLowercaseHost | FlagLowercaseScheme | FlagUppercaseEscapes | FlagDecodeUnnecessaryEscapes | FlagEncodeNecessaryEscapes | FlagRemoveDefaultPort | FlagRemoveEmptyQuerySeparator - - // For convenience sets, "greedy" uses the "remove trailing slash" and "remove www. prefix" flags, - // while "non-greedy" uses the "add (or keep) the trailing slash" and "add www. prefix". - - // Convenience set of usually safe normalizations (includes FlagsSafe) - FlagsUsuallySafeGreedy NormalizationFlags = FlagsSafe | FlagRemoveTrailingSlash | FlagRemoveDotSegments - FlagsUsuallySafeNonGreedy NormalizationFlags = FlagsSafe | FlagAddTrailingSlash | FlagRemoveDotSegments - - // Convenience set of unsafe normalizations (includes FlagsUsuallySafe) - FlagsUnsafeGreedy NormalizationFlags = FlagsUsuallySafeGreedy | FlagRemoveDirectoryIndex | FlagRemoveFragment | FlagForceHTTP | FlagRemoveDuplicateSlashes | FlagRemoveWWW | FlagSortQuery - FlagsUnsafeNonGreedy NormalizationFlags = FlagsUsuallySafeNonGreedy | FlagRemoveDirectoryIndex | FlagRemoveFragment | FlagForceHTTP | FlagRemoveDuplicateSlashes | FlagAddWWW | FlagSortQuery - - // Convenience set of all available flags - FlagsAllGreedy = FlagsUnsafeGreedy | FlagDecodeDWORDHost | FlagDecodeOctalHost | FlagDecodeHexHost | FlagRemoveUnnecessaryHostDots | FlagRemoveEmptyPortSeparator - FlagsAllNonGreedy = FlagsUnsafeNonGreedy | FlagDecodeDWORDHost | FlagDecodeOctalHost | FlagDecodeHexHost | FlagRemoveUnnecessaryHostDots | FlagRemoveEmptyPortSeparator -) - -const ( - defaultHttpPort = ":80" - defaultHttpsPort = ":443" -) - -// Regular expressions used by the normalizations -var rxPort = regexp.MustCompile(`(:\d+)/?$`) -var rxDirIndex = regexp.MustCompile(`(^|/)((?:default|index)\.\w{1,4})$`) -var rxDupSlashes = regexp.MustCompile(`/{2,}`) -var rxDWORDHost = regexp.MustCompile(`^(\d+)((?:\.+)?(?:\:\d*)?)$`) -var rxOctalHost = regexp.MustCompile(`^(0\d*)\.(0\d*)\.(0\d*)\.(0\d*)((?:\.+)?(?:\:\d*)?)$`) -var rxHexHost = regexp.MustCompile(`^0x([0-9A-Fa-f]+)((?:\.+)?(?:\:\d*)?)$`) -var rxHostDots = regexp.MustCompile(`^(.+?)(:\d+)?$`) -var rxEmptyPort = regexp.MustCompile(`:+$`) - -// Map of flags to implementation function. -// FlagDecodeUnnecessaryEscapes has no action, since it is done automatically -// by parsing the string as an URL. Same for FlagUppercaseEscapes and FlagRemoveEmptyQuerySeparator. - -// Since maps have undefined traversing order, make a slice of ordered keys -var flagsOrder = []NormalizationFlags{ - FlagLowercaseScheme, - FlagLowercaseHost, - FlagRemoveDefaultPort, - FlagRemoveDirectoryIndex, - FlagRemoveDotSegments, - FlagRemoveFragment, - FlagForceHTTP, // Must be after remove default port (because https=443/http=80) - FlagRemoveDuplicateSlashes, - FlagRemoveWWW, - FlagAddWWW, - FlagSortQuery, - FlagDecodeDWORDHost, - FlagDecodeOctalHost, - FlagDecodeHexHost, - FlagRemoveUnnecessaryHostDots, - FlagRemoveEmptyPortSeparator, - FlagRemoveTrailingSlash, // These two (add/remove trailing slash) must be last - FlagAddTrailingSlash, -} - -// ... and then the map, where order is unimportant -var flags = map[NormalizationFlags]func(*url.URL){ - FlagLowercaseScheme: lowercaseScheme, - FlagLowercaseHost: lowercaseHost, - FlagRemoveDefaultPort: removeDefaultPort, - FlagRemoveDirectoryIndex: removeDirectoryIndex, - FlagRemoveDotSegments: removeDotSegments, - FlagRemoveFragment: removeFragment, - FlagForceHTTP: forceHTTP, - FlagRemoveDuplicateSlashes: removeDuplicateSlashes, - FlagRemoveWWW: removeWWW, - FlagAddWWW: addWWW, - FlagSortQuery: sortQuery, - FlagDecodeDWORDHost: decodeDWORDHost, - FlagDecodeOctalHost: decodeOctalHost, - FlagDecodeHexHost: decodeHexHost, - FlagRemoveUnnecessaryHostDots: removeUnncessaryHostDots, - FlagRemoveEmptyPortSeparator: removeEmptyPortSeparator, - FlagRemoveTrailingSlash: removeTrailingSlash, - FlagAddTrailingSlash: addTrailingSlash, -} - -// MustNormalizeURLString returns the normalized string, and panics if an error occurs. -// It takes an URL string as input, as well as the normalization flags. -func MustNormalizeURLString(u string, f NormalizationFlags) string { - result, e := NormalizeURLString(u, f) - if e != nil { - panic(e) - } - return result -} - -// NormalizeURLString returns the normalized string, or an error if it can't be parsed into an URL object. -// It takes an URL string as input, as well as the normalization flags. -func NormalizeURLString(u string, f NormalizationFlags) (string, error) { - parsed, err := url.Parse(u) - if err != nil { - return "", err - } - - if f&FlagLowercaseHost == FlagLowercaseHost { - parsed.Host = strings.ToLower(parsed.Host) - } - - // The idna package doesn't fully conform to RFC 5895 - // (https://tools.ietf.org/html/rfc5895), so we do it here. - // Taken from Go 1.8 cycle source, courtesy of bradfitz. - // TODO: Remove when (if?) idna package conforms to RFC 5895. - parsed.Host = width.Fold.String(parsed.Host) - parsed.Host = norm.NFC.String(parsed.Host) - if parsed.Host, err = idna.ToASCII(parsed.Host); err != nil { - return "", err - } - - return NormalizeURL(parsed, f), nil -} - -// NormalizeURL returns the normalized string. -// It takes a parsed URL object as input, as well as the normalization flags. -func NormalizeURL(u *url.URL, f NormalizationFlags) string { - for _, k := range flagsOrder { - if f&k == k { - flags[k](u) - } - } - return urlesc.Escape(u) -} - -func lowercaseScheme(u *url.URL) { - if len(u.Scheme) > 0 { - u.Scheme = strings.ToLower(u.Scheme) - } -} - -func lowercaseHost(u *url.URL) { - if len(u.Host) > 0 { - u.Host = strings.ToLower(u.Host) - } -} - -func removeDefaultPort(u *url.URL) { - if len(u.Host) > 0 { - scheme := strings.ToLower(u.Scheme) - u.Host = rxPort.ReplaceAllStringFunc(u.Host, func(val string) string { - if (scheme == "http" && val == defaultHttpPort) || (scheme == "https" && val == defaultHttpsPort) { - return "" - } - return val - }) - } -} - -func removeTrailingSlash(u *url.URL) { - if l := len(u.Path); l > 0 { - if strings.HasSuffix(u.Path, "/") { - u.Path = u.Path[:l-1] - } - } else if l = len(u.Host); l > 0 { - if strings.HasSuffix(u.Host, "/") { - u.Host = u.Host[:l-1] - } - } -} - -func addTrailingSlash(u *url.URL) { - if l := len(u.Path); l > 0 { - if !strings.HasSuffix(u.Path, "/") { - u.Path += "/" - } - } else if l = len(u.Host); l > 0 { - if !strings.HasSuffix(u.Host, "/") { - u.Host += "/" - } - } -} - -func removeDotSegments(u *url.URL) { - if len(u.Path) > 0 { - var dotFree []string - var lastIsDot bool - - sections := strings.Split(u.Path, "/") - for _, s := range sections { - if s == ".." { - if len(dotFree) > 0 { - dotFree = dotFree[:len(dotFree)-1] - } - } else if s != "." { - dotFree = append(dotFree, s) - } - lastIsDot = (s == "." || s == "..") - } - // Special case if host does not end with / and new path does not begin with / - u.Path = strings.Join(dotFree, "/") - if u.Host != "" && !strings.HasSuffix(u.Host, "/") && !strings.HasPrefix(u.Path, "/") { - u.Path = "/" + u.Path - } - // Special case if the last segment was a dot, make sure the path ends with a slash - if lastIsDot && !strings.HasSuffix(u.Path, "/") { - u.Path += "/" - } - } -} - -func removeDirectoryIndex(u *url.URL) { - if len(u.Path) > 0 { - u.Path = rxDirIndex.ReplaceAllString(u.Path, "$1") - } -} - -func removeFragment(u *url.URL) { - u.Fragment = "" -} - -func forceHTTP(u *url.URL) { - if strings.ToLower(u.Scheme) == "https" { - u.Scheme = "http" - } -} - -func removeDuplicateSlashes(u *url.URL) { - if len(u.Path) > 0 { - u.Path = rxDupSlashes.ReplaceAllString(u.Path, "/") - } -} - -func removeWWW(u *url.URL) { - if len(u.Host) > 0 && strings.HasPrefix(strings.ToLower(u.Host), "www.") { - u.Host = u.Host[4:] - } -} - -func addWWW(u *url.URL) { - if len(u.Host) > 0 && !strings.HasPrefix(strings.ToLower(u.Host), "www.") { - u.Host = "www." + u.Host - } -} - -func sortQuery(u *url.URL) { - q := u.Query() - - if len(q) > 0 { - arKeys := make([]string, len(q)) - i := 0 - for k := range q { - arKeys[i] = k - i++ - } - sort.Strings(arKeys) - buf := new(bytes.Buffer) - for _, k := range arKeys { - sort.Strings(q[k]) - for _, v := range q[k] { - if buf.Len() > 0 { - buf.WriteRune('&') - } - buf.WriteString(fmt.Sprintf("%s=%s", k, urlesc.QueryEscape(v))) - } - } - - // Rebuild the raw query string - u.RawQuery = buf.String() - } -} - -func decodeDWORDHost(u *url.URL) { - if len(u.Host) > 0 { - if matches := rxDWORDHost.FindStringSubmatch(u.Host); len(matches) > 2 { - var parts [4]int64 - - dword, _ := strconv.ParseInt(matches[1], 10, 0) - for i, shift := range []uint{24, 16, 8, 0} { - parts[i] = dword >> shift & 0xFF - } - u.Host = fmt.Sprintf("%d.%d.%d.%d%s", parts[0], parts[1], parts[2], parts[3], matches[2]) - } - } -} - -func decodeOctalHost(u *url.URL) { - if len(u.Host) > 0 { - if matches := rxOctalHost.FindStringSubmatch(u.Host); len(matches) > 5 { - var parts [4]int64 - - for i := 1; i <= 4; i++ { - parts[i-1], _ = strconv.ParseInt(matches[i], 8, 0) - } - u.Host = fmt.Sprintf("%d.%d.%d.%d%s", parts[0], parts[1], parts[2], parts[3], matches[5]) - } - } -} - -func decodeHexHost(u *url.URL) { - if len(u.Host) > 0 { - if matches := rxHexHost.FindStringSubmatch(u.Host); len(matches) > 2 { - // Conversion is safe because of regex validation - parsed, _ := strconv.ParseInt(matches[1], 16, 0) - // Set host as DWORD (base 10) encoded host - u.Host = fmt.Sprintf("%d%s", parsed, matches[2]) - // The rest is the same as decoding a DWORD host - decodeDWORDHost(u) - } - } -} - -func removeUnncessaryHostDots(u *url.URL) { - if len(u.Host) > 0 { - if matches := rxHostDots.FindStringSubmatch(u.Host); len(matches) > 1 { - // Trim the leading and trailing dots - u.Host = strings.Trim(matches[1], ".") - if len(matches) > 2 { - u.Host += matches[2] - } - } - } -} - -func removeEmptyPortSeparator(u *url.URL) { - if len(u.Host) > 0 { - u.Host = rxEmptyPort.ReplaceAllString(u.Host, "") - } -} diff --git a/vendor/github.com/PuerkitoBio/urlesc/.travis.yml b/vendor/github.com/PuerkitoBio/urlesc/.travis.yml deleted file mode 100644 index ba6b225..0000000 --- a/vendor/github.com/PuerkitoBio/urlesc/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: go - -go: - - 1.4.x - - 1.5.x - - 1.6.x - - 1.7.x - - 1.8.x - - tip - -install: - - go build . - -script: - - go test -v diff --git a/vendor/github.com/PuerkitoBio/urlesc/LICENSE b/vendor/github.com/PuerkitoBio/urlesc/LICENSE deleted file mode 100644 index 7448756..0000000 --- a/vendor/github.com/PuerkitoBio/urlesc/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2012 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/PuerkitoBio/urlesc/README.md b/vendor/github.com/PuerkitoBio/urlesc/README.md deleted file mode 100644 index 57aff0a..0000000 --- a/vendor/github.com/PuerkitoBio/urlesc/README.md +++ /dev/null @@ -1,16 +0,0 @@ -urlesc [![Build Status](https://travis-ci.org/PuerkitoBio/urlesc.svg?branch=master)](https://travis-ci.org/PuerkitoBio/urlesc) [![GoDoc](http://godoc.org/github.com/PuerkitoBio/urlesc?status.svg)](http://godoc.org/github.com/PuerkitoBio/urlesc) -====== - -Package urlesc implements query escaping as per RFC 3986. - -It contains some parts of the net/url package, modified so as to allow -some reserved characters incorrectly escaped by net/url (see [issue 5684](https://github.com/golang/go/issues/5684)). - -## Install - - go get github.com/PuerkitoBio/urlesc - -## License - -Go license (BSD-3-Clause) - diff --git a/vendor/github.com/PuerkitoBio/urlesc/urlesc.go b/vendor/github.com/PuerkitoBio/urlesc/urlesc.go deleted file mode 100644 index 1b84624..0000000 --- a/vendor/github.com/PuerkitoBio/urlesc/urlesc.go +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package urlesc implements query escaping as per RFC 3986. -// It contains some parts of the net/url package, modified so as to allow -// some reserved characters incorrectly escaped by net/url. -// See https://github.com/golang/go/issues/5684 -package urlesc - -import ( - "bytes" - "net/url" - "strings" -) - -type encoding int - -const ( - encodePath encoding = 1 + iota - encodeUserPassword - encodeQueryComponent - encodeFragment -) - -// Return true if the specified character should be escaped when -// appearing in a URL string, according to RFC 3986. -func shouldEscape(c byte, mode encoding) bool { - // §2.3 Unreserved characters (alphanum) - if 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' || '0' <= c && c <= '9' { - return false - } - - switch c { - case '-', '.', '_', '~': // §2.3 Unreserved characters (mark) - return false - - // §2.2 Reserved characters (reserved) - case ':', '/', '?', '#', '[', ']', '@', // gen-delims - '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=': // sub-delims - // Different sections of the URL allow a few of - // the reserved characters to appear unescaped. - switch mode { - case encodePath: // §3.3 - // The RFC allows sub-delims and : @. - // '/', '[' and ']' can be used to assign meaning to individual path - // segments. This package only manipulates the path as a whole, - // so we allow those as well. That leaves only ? and # to escape. - return c == '?' || c == '#' - - case encodeUserPassword: // §3.2.1 - // The RFC allows : and sub-delims in - // userinfo. The parsing of userinfo treats ':' as special so we must escape - // all the gen-delims. - return c == ':' || c == '/' || c == '?' || c == '#' || c == '[' || c == ']' || c == '@' - - case encodeQueryComponent: // §3.4 - // The RFC allows / and ?. - return c != '/' && c != '?' - - case encodeFragment: // §4.1 - // The RFC text is silent but the grammar allows - // everything, so escape nothing but # - return c == '#' - } - } - - // Everything else must be escaped. - return true -} - -// QueryEscape escapes the string so it can be safely placed -// inside a URL query. -func QueryEscape(s string) string { - return escape(s, encodeQueryComponent) -} - -func escape(s string, mode encoding) string { - spaceCount, hexCount := 0, 0 - for i := 0; i < len(s); i++ { - c := s[i] - if shouldEscape(c, mode) { - if c == ' ' && mode == encodeQueryComponent { - spaceCount++ - } else { - hexCount++ - } - } - } - - if spaceCount == 0 && hexCount == 0 { - return s - } - - t := make([]byte, len(s)+2*hexCount) - j := 0 - for i := 0; i < len(s); i++ { - switch c := s[i]; { - case c == ' ' && mode == encodeQueryComponent: - t[j] = '+' - j++ - case shouldEscape(c, mode): - t[j] = '%' - t[j+1] = "0123456789ABCDEF"[c>>4] - t[j+2] = "0123456789ABCDEF"[c&15] - j += 3 - default: - t[j] = s[i] - j++ - } - } - return string(t) -} - -var uiReplacer = strings.NewReplacer( - "%21", "!", - "%27", "'", - "%28", "(", - "%29", ")", - "%2A", "*", -) - -// unescapeUserinfo unescapes some characters that need not to be escaped as per RFC3986. -func unescapeUserinfo(s string) string { - return uiReplacer.Replace(s) -} - -// Escape reassembles the URL into a valid URL string. -// The general form of the result is one of: -// -// scheme:opaque -// scheme://userinfo@host/path?query#fragment -// -// If u.Opaque is non-empty, String uses the first form; -// otherwise it uses the second form. -// -// In the second form, the following rules apply: -// - if u.Scheme is empty, scheme: is omitted. -// - if u.User is nil, userinfo@ is omitted. -// - if u.Host is empty, host/ is omitted. -// - if u.Scheme and u.Host are empty and u.User is nil, -// the entire scheme://userinfo@host/ is omitted. -// - if u.Host is non-empty and u.Path begins with a /, -// the form host/path does not add its own /. -// - if u.RawQuery is empty, ?query is omitted. -// - if u.Fragment is empty, #fragment is omitted. -func Escape(u *url.URL) string { - var buf bytes.Buffer - if u.Scheme != "" { - buf.WriteString(u.Scheme) - buf.WriteByte(':') - } - if u.Opaque != "" { - buf.WriteString(u.Opaque) - } else { - if u.Scheme != "" || u.Host != "" || u.User != nil { - buf.WriteString("//") - if ui := u.User; ui != nil { - buf.WriteString(unescapeUserinfo(ui.String())) - buf.WriteByte('@') - } - if h := u.Host; h != "" { - buf.WriteString(h) - } - } - if u.Path != "" && u.Path[0] != '/' && u.Host != "" { - buf.WriteByte('/') - } - buf.WriteString(escape(u.Path, encodePath)) - } - if u.RawQuery != "" { - buf.WriteByte('?') - buf.WriteString(u.RawQuery) - } - if u.Fragment != "" { - buf.WriteByte('#') - buf.WriteString(escape(u.Fragment, encodeFragment)) - } - return buf.String() -} diff --git a/vendor/github.com/emicklei/go-restful/.gitignore b/vendor/github.com/emicklei/go-restful/.gitignore deleted file mode 100644 index 446be09..0000000 --- a/vendor/github.com/emicklei/go-restful/.gitignore +++ /dev/null @@ -1,71 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe - -restful.html - -*.out - -tmp.prof - -go-restful.test - -examples/restful-basic-authentication - -examples/restful-encoding-filter - -examples/restful-filters - -examples/restful-hello-world - -examples/restful-resource-functions - -examples/restful-serve-static - -examples/restful-user-service - -*.DS_Store -examples/restful-user-resource - -examples/restful-multi-containers - -examples/restful-form-handling - -examples/restful-CORS-filter - -examples/restful-options-filter - -examples/restful-curly-router - -examples/restful-cpuprofiler-service - -examples/restful-pre-post-filters - -curly.prof - -examples/restful-NCSA-logging - -examples/restful-html-template - -s.html -restful-path-tail -.idea diff --git a/vendor/github.com/emicklei/go-restful/.travis.yml b/vendor/github.com/emicklei/go-restful/.travis.yml deleted file mode 100644 index b22f8f5..0000000 --- a/vendor/github.com/emicklei/go-restful/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: go - -go: - - 1.x - -script: go test -v \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/CHANGES.md b/vendor/github.com/emicklei/go-restful/CHANGES.md deleted file mode 100644 index 77183bd..0000000 --- a/vendor/github.com/emicklei/go-restful/CHANGES.md +++ /dev/null @@ -1,292 +0,0 @@ -# Change history of go-restful - - -v2.12.0 - -- support describing response headers (#426) -- fix openapi examples (#425) -- merge v3 fix (#422) - -v2.11.1 - -- fix WriteError return value (#415) - -v2.11.0 - -- allow prefix and suffix in path variable expression (#414) - -v2.9.6 - -- support google custome verb (#413) - -v2.9.5 - -- fix panic in Response.WriteError if err == nil - -v2.9.4 - -- fix issue #400 , parsing mime type quality -- Route Builder added option for contentEncodingEnabled (#398) - -v2.9.3 - -- Avoid return of 415 Unsupported Media Type when request body is empty (#396) - -v2.9.2 - -- Reduce allocations in per-request methods to improve performance (#395) - -v2.9.1 - -- Fix issue with default responses and invalid status code 0. (#393) - -v2.9.0 - -- add per Route content encoding setting (overrides container setting) - -v2.8.0 - -- add Request.QueryParameters() -- add json-iterator (via build tag) -- disable vgo module (until log is moved) - -v2.7.1 - -- add vgo module - -v2.6.1 - -- add JSONNewDecoderFunc to allow custom JSON Decoder usage (go 1.10+) - -v2.6.0 - -- Make JSR 311 routing and path param processing consistent -- Adding description to RouteBuilder.Reads() -- Update example for Swagger12 and OpenAPI - -2017-09-13 - -- added route condition functions using `.If(func)` in route building. - -2017-02-16 - -- solved issue #304, make operation names unique - -2017-01-30 - - [IMPORTANT] For swagger users, change your import statement to: - swagger "github.com/emicklei/go-restful-swagger12" - -- moved swagger 1.2 code to go-restful-swagger12 -- created TAG 2.0.0 - -2017-01-27 - -- remove defer request body close -- expose Dispatch for testing filters and Routefunctions -- swagger response model cannot be array -- created TAG 1.0.0 - -2016-12-22 - -- (API change) Remove code related to caching request content. Removes SetCacheReadEntity(doCache bool) - -2016-11-26 - -- Default change! now use CurlyRouter (was RouterJSR311) -- Default change! no more caching of request content -- Default change! do not recover from panics - -2016-09-22 - -- fix the DefaultRequestContentType feature - -2016-02-14 - -- take the qualify factor of the Accept header mediatype into account when deciding the contentype of the response -- add constructors for custom entity accessors for xml and json - -2015-09-27 - -- rename new WriteStatusAnd... to WriteHeaderAnd... for consistency - -2015-09-25 - -- fixed problem with changing Header after WriteHeader (issue 235) - -2015-09-14 - -- changed behavior of WriteHeader (immediate write) and WriteEntity (no status write) -- added support for custom EntityReaderWriters. - -2015-08-06 - -- add support for reading entities from compressed request content -- use sync.Pool for compressors of http response and request body -- add Description to Parameter for documentation in Swagger UI - -2015-03-20 - -- add configurable logging - -2015-03-18 - -- if not specified, the Operation is derived from the Route function - -2015-03-17 - -- expose Parameter creation functions -- make trace logger an interface -- fix OPTIONSFilter -- customize rendering of ServiceError -- JSR311 router now handles wildcards -- add Notes to Route - -2014-11-27 - -- (api add) PrettyPrint per response. (as proposed in #167) - -2014-11-12 - -- (api add) ApiVersion(.) for documentation in Swagger UI - -2014-11-10 - -- (api change) struct fields tagged with "description" show up in Swagger UI - -2014-10-31 - -- (api change) ReturnsError -> Returns -- (api add) RouteBuilder.Do(aBuilder) for DRY use of RouteBuilder -- fix swagger nested structs -- sort Swagger response messages by code - -2014-10-23 - -- (api add) ReturnsError allows you to document Http codes in swagger -- fixed problem with greedy CurlyRouter -- (api add) Access-Control-Max-Age in CORS -- add tracing functionality (injectable) for debugging purposes -- support JSON parse 64bit int -- fix empty parameters for swagger -- WebServicesUrl is now optional for swagger -- fixed duplicate AccessControlAllowOrigin in CORS -- (api change) expose ServeMux in container -- (api add) added AllowedDomains in CORS -- (api add) ParameterNamed for detailed documentation - -2014-04-16 - -- (api add) expose constructor of Request for testing. - -2014-06-27 - -- (api add) ParameterNamed gives access to a Parameter definition and its data (for further specification). -- (api add) SetCacheReadEntity allow scontrol over whether or not the request body is being cached (default true for compatibility reasons). - -2014-07-03 - -- (api add) CORS can be configured with a list of allowed domains - -2014-03-12 - -- (api add) Route path parameters can use wildcard or regular expressions. (requires CurlyRouter) - -2014-02-26 - -- (api add) Request now provides information about the matched Route, see method SelectedRoutePath - -2014-02-17 - -- (api change) renamed parameter constants (go-lint checks) - -2014-01-10 - -- (api add) support for CloseNotify, see http://golang.org/pkg/net/http/#CloseNotifier - -2014-01-07 - -- (api change) Write* methods in Response now return the error or nil. -- added example of serving HTML from a Go template. -- fixed comparing Allowed headers in CORS (is now case-insensitive) - -2013-11-13 - -- (api add) Response knows how many bytes are written to the response body. - -2013-10-29 - -- (api add) RecoverHandler(handler RecoverHandleFunction) to change how panic recovery is handled. Default behavior is to log and return a stacktrace. This may be a security issue as it exposes sourcecode information. - -2013-10-04 - -- (api add) Response knows what HTTP status has been written -- (api add) Request can have attributes (map of string->interface, also called request-scoped variables - -2013-09-12 - -- (api change) Router interface simplified -- Implemented CurlyRouter, a Router that does not use|allow regular expressions in paths - -2013-08-05 - - add OPTIONS support - - add CORS support - -2013-08-27 - -- fixed some reported issues (see github) -- (api change) deprecated use of WriteError; use WriteErrorString instead - -2014-04-15 - -- (fix) v1.0.1 tag: fix Issue 111: WriteErrorString - -2013-08-08 - -- (api add) Added implementation Container: a WebServices collection with its own http.ServeMux allowing multiple endpoints per program. Existing uses of go-restful will register their services to the DefaultContainer. -- (api add) the swagger package has be extended to have a UI per container. -- if panic is detected then a small stack trace is printed (thanks to runner-mei) -- (api add) WriteErrorString to Response - -Important API changes: - -- (api remove) package variable DoNotRecover no longer works ; use restful.DefaultContainer.DoNotRecover(true) instead. -- (api remove) package variable EnableContentEncoding no longer works ; use restful.DefaultContainer.EnableContentEncoding(true) instead. - - -2013-07-06 - -- (api add) Added support for response encoding (gzip and deflate(zlib)). This feature is disabled on default (for backwards compatibility). Use restful.EnableContentEncoding = true in your initialization to enable this feature. - -2013-06-19 - -- (improve) DoNotRecover option, moved request body closer, improved ReadEntity - -2013-06-03 - -- (api change) removed Dispatcher interface, hide PathExpression -- changed receiver names of type functions to be more idiomatic Go - -2013-06-02 - -- (optimize) Cache the RegExp compilation of Paths. - -2013-05-22 - -- (api add) Added support for request/response filter functions - -2013-05-18 - - -- (api add) Added feature to change the default Http Request Dispatch function (travis cline) -- (api change) Moved Swagger Webservice to swagger package (see example restful-user) - -[2012-11-14 .. 2013-05-18> - -- See https://github.com/emicklei/go-restful/commits - -2012-11-14 - -- Initial commit - - diff --git a/vendor/github.com/emicklei/go-restful/LICENSE b/vendor/github.com/emicklei/go-restful/LICENSE deleted file mode 100644 index ece7ec6..0000000 --- a/vendor/github.com/emicklei/go-restful/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012,2013 Ernest Micklei - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/Makefile b/vendor/github.com/emicklei/go-restful/Makefile deleted file mode 100644 index b40081c..0000000 --- a/vendor/github.com/emicklei/go-restful/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -all: test - -test: - go test -v . - -ex: - cd examples && ls *.go | xargs go build -o /tmp/ignore \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/README.md b/vendor/github.com/emicklei/go-restful/README.md deleted file mode 100644 index db4107e..0000000 --- a/vendor/github.com/emicklei/go-restful/README.md +++ /dev/null @@ -1,110 +0,0 @@ -go-restful -========== -package for building REST-style Web Services using Google Go - -[![Build Status](https://travis-ci.org/emicklei/go-restful.png)](https://travis-ci.org/emicklei/go-restful) -[![Go Report Card](https://goreportcard.com/badge/github.com/emicklei/go-restful)](https://goreportcard.com/report/github.com/emicklei/go-restful) -[![GoDoc](https://godoc.org/github.com/emicklei/go-restful?status.svg)](https://godoc.org/github.com/emicklei/go-restful) - -- [Code examples](https://github.com/emicklei/go-restful/tree/master/examples) - -REST asks developers to use HTTP methods explicitly and in a way that's consistent with the protocol definition. This basic REST design principle establishes a one-to-one mapping between create, read, update, and delete (CRUD) operations and HTTP methods. According to this mapping: - -- GET = Retrieve a representation of a resource -- POST = Create if you are sending content to the server to create a subordinate of the specified resource collection, using some server-side algorithm. -- PUT = Create if you are sending the full content of the specified resource (URI). -- PUT = Update if you are updating the full content of the specified resource. -- DELETE = Delete if you are requesting the server to delete the resource -- PATCH = Update partial content of a resource -- OPTIONS = Get information about the communication options for the request URI - -### Usage - -#### Without Go Modules - -All versions up to `v2.*.*` (on the master) are not supporting Go modules. - -``` -import ( - restful "github.com/emicklei/go-restful" -) -``` - -#### Using Go Modules - -As of version `v3.0.0` (on the v3 branch), this package supports Go modules. - -``` -import ( - restful "github.com/emicklei/go-restful/v3" -) -``` - -### Example - -```Go -ws := new(restful.WebService) -ws. - Path("/users"). - Consumes(restful.MIME_XML, restful.MIME_JSON). - Produces(restful.MIME_JSON, restful.MIME_XML) - -ws.Route(ws.GET("/{user-id}").To(u.findUser). - Doc("get a user"). - Param(ws.PathParameter("user-id", "identifier of the user").DataType("string")). - Writes(User{})) -... - -func (u UserResource) findUser(request *restful.Request, response *restful.Response) { - id := request.PathParameter("user-id") - ... -} -``` - -[Full API of a UserResource](https://github.com/emicklei/go-restful/tree/master/examples/restful-user-resource.go) - -### Features - -- Routes for request → function mapping with path parameter (e.g. {id} but also prefix_{var} and {var}_suffix) support -- Configurable router: - - (default) Fast routing algorithm that allows static elements, [google custom method](https://cloud.google.com/apis/design/custom_methods), regular expressions and dynamic parameters in the URL path (e.g. /resource/name:customVerb, /meetings/{id} or /static/{subpath:*}) - - Routing algorithm after [JSR311](http://jsr311.java.net/nonav/releases/1.1/spec/spec.html) that is implemented using (but does **not** accept) regular expressions -- Request API for reading structs from JSON/XML and accesing parameters (path,query,header) -- Response API for writing structs to JSON/XML and setting headers -- Customizable encoding using EntityReaderWriter registration -- Filters for intercepting the request → response flow on Service or Route level -- Request-scoped variables using attributes -- Containers for WebServices on different HTTP endpoints -- Content encoding (gzip,deflate) of request and response payloads -- Automatic responses on OPTIONS (using a filter) -- Automatic CORS request handling (using a filter) -- API declaration for Swagger UI ([go-restful-openapi](https://github.com/emicklei/go-restful-openapi), see [go-restful-swagger12](https://github.com/emicklei/go-restful-swagger12)) -- Panic recovery to produce HTTP 500, customizable using RecoverHandler(...) -- Route errors produce HTTP 404/405/406/415 errors, customizable using ServiceErrorHandler(...) -- Configurable (trace) logging -- Customizable gzip/deflate readers and writers using CompressorProvider registration - -## How to customize -There are several hooks to customize the behavior of the go-restful package. - -- Router algorithm -- Panic recovery -- JSON decoder -- Trace logging -- Compression -- Encoders for other serializers -- Use [jsoniter](https://github.com/json-iterator/go) by build this package using a tag, e.g. `go build -tags=jsoniter .` - -TODO: write examples of these. - -## Resources - -- [Example posted on blog](http://ernestmicklei.com/2012/11/go-restful-first-working-example/) -- [Design explained on blog](http://ernestmicklei.com/2012/11/go-restful-api-design/) -- [sourcegraph](https://sourcegraph.com/github.com/emicklei/go-restful) -- [showcase: Zazkia - tcp proxy for testing resiliency](https://github.com/emicklei/zazkia) -- [showcase: Mora - MongoDB REST Api server](https://github.com/emicklei/mora) - -Type ```git shortlog -s``` for a full list of contributors. - -© 2012 - 2020, http://ernestmicklei.com. MIT License. Contributions are welcome. diff --git a/vendor/github.com/emicklei/go-restful/Srcfile b/vendor/github.com/emicklei/go-restful/Srcfile deleted file mode 100644 index 16fd186..0000000 --- a/vendor/github.com/emicklei/go-restful/Srcfile +++ /dev/null @@ -1 +0,0 @@ -{"SkipDirs": ["examples"]} diff --git a/vendor/github.com/emicklei/go-restful/bench_test.sh b/vendor/github.com/emicklei/go-restful/bench_test.sh deleted file mode 100644 index 47ffbe4..0000000 --- a/vendor/github.com/emicklei/go-restful/bench_test.sh +++ /dev/null @@ -1,10 +0,0 @@ -#go test -run=none -file bench_test.go -test.bench . -cpuprofile=bench_test.out - -go test -c -./go-restful.test -test.run=none -test.cpuprofile=tmp.prof -test.bench=BenchmarkMany -./go-restful.test -test.run=none -test.cpuprofile=curly.prof -test.bench=BenchmarkManyCurly - -#go tool pprof go-restful.test tmp.prof -go tool pprof go-restful.test curly.prof - - diff --git a/vendor/github.com/emicklei/go-restful/compress.go b/vendor/github.com/emicklei/go-restful/compress.go deleted file mode 100644 index 220b377..0000000 --- a/vendor/github.com/emicklei/go-restful/compress.go +++ /dev/null @@ -1,123 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "bufio" - "compress/gzip" - "compress/zlib" - "errors" - "io" - "net" - "net/http" - "strings" -) - -// OBSOLETE : use restful.DefaultContainer.EnableContentEncoding(true) to change this setting. -var EnableContentEncoding = false - -// CompressingResponseWriter is a http.ResponseWriter that can perform content encoding (gzip and zlib) -type CompressingResponseWriter struct { - writer http.ResponseWriter - compressor io.WriteCloser - encoding string -} - -// Header is part of http.ResponseWriter interface -func (c *CompressingResponseWriter) Header() http.Header { - return c.writer.Header() -} - -// WriteHeader is part of http.ResponseWriter interface -func (c *CompressingResponseWriter) WriteHeader(status int) { - c.writer.WriteHeader(status) -} - -// Write is part of http.ResponseWriter interface -// It is passed through the compressor -func (c *CompressingResponseWriter) Write(bytes []byte) (int, error) { - if c.isCompressorClosed() { - return -1, errors.New("Compressing error: tried to write data using closed compressor") - } - return c.compressor.Write(bytes) -} - -// CloseNotify is part of http.CloseNotifier interface -func (c *CompressingResponseWriter) CloseNotify() <-chan bool { - return c.writer.(http.CloseNotifier).CloseNotify() -} - -// Close the underlying compressor -func (c *CompressingResponseWriter) Close() error { - if c.isCompressorClosed() { - return errors.New("Compressing error: tried to close already closed compressor") - } - - c.compressor.Close() - if ENCODING_GZIP == c.encoding { - currentCompressorProvider.ReleaseGzipWriter(c.compressor.(*gzip.Writer)) - } - if ENCODING_DEFLATE == c.encoding { - currentCompressorProvider.ReleaseZlibWriter(c.compressor.(*zlib.Writer)) - } - // gc hint needed? - c.compressor = nil - return nil -} - -func (c *CompressingResponseWriter) isCompressorClosed() bool { - return nil == c.compressor -} - -// Hijack implements the Hijacker interface -// This is especially useful when combining Container.EnabledContentEncoding -// in combination with websockets (for instance gorilla/websocket) -func (c *CompressingResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) { - hijacker, ok := c.writer.(http.Hijacker) - if !ok { - return nil, nil, errors.New("ResponseWriter doesn't support Hijacker interface") - } - return hijacker.Hijack() -} - -// WantsCompressedResponse reads the Accept-Encoding header to see if and which encoding is requested. -func wantsCompressedResponse(httpRequest *http.Request) (bool, string) { - header := httpRequest.Header.Get(HEADER_AcceptEncoding) - gi := strings.Index(header, ENCODING_GZIP) - zi := strings.Index(header, ENCODING_DEFLATE) - // use in order of appearance - if gi == -1 { - return zi != -1, ENCODING_DEFLATE - } else if zi == -1 { - return gi != -1, ENCODING_GZIP - } else { - if gi < zi { - return true, ENCODING_GZIP - } - return true, ENCODING_DEFLATE - } -} - -// NewCompressingResponseWriter create a CompressingResponseWriter for a known encoding = {gzip,deflate} -func NewCompressingResponseWriter(httpWriter http.ResponseWriter, encoding string) (*CompressingResponseWriter, error) { - httpWriter.Header().Set(HEADER_ContentEncoding, encoding) - c := new(CompressingResponseWriter) - c.writer = httpWriter - var err error - if ENCODING_GZIP == encoding { - w := currentCompressorProvider.AcquireGzipWriter() - w.Reset(httpWriter) - c.compressor = w - c.encoding = ENCODING_GZIP - } else if ENCODING_DEFLATE == encoding { - w := currentCompressorProvider.AcquireZlibWriter() - w.Reset(httpWriter) - c.compressor = w - c.encoding = ENCODING_DEFLATE - } else { - return nil, errors.New("Unknown encoding:" + encoding) - } - return c, err -} diff --git a/vendor/github.com/emicklei/go-restful/compressor_cache.go b/vendor/github.com/emicklei/go-restful/compressor_cache.go deleted file mode 100644 index ee42601..0000000 --- a/vendor/github.com/emicklei/go-restful/compressor_cache.go +++ /dev/null @@ -1,103 +0,0 @@ -package restful - -// Copyright 2015 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "compress/gzip" - "compress/zlib" -) - -// BoundedCachedCompressors is a CompressorProvider that uses a cache with a fixed amount -// of writers and readers (resources). -// If a new resource is acquired and all are in use, it will return a new unmanaged resource. -type BoundedCachedCompressors struct { - gzipWriters chan *gzip.Writer - gzipReaders chan *gzip.Reader - zlibWriters chan *zlib.Writer - writersCapacity int - readersCapacity int -} - -// NewBoundedCachedCompressors returns a new, with filled cache, BoundedCachedCompressors. -func NewBoundedCachedCompressors(writersCapacity, readersCapacity int) *BoundedCachedCompressors { - b := &BoundedCachedCompressors{ - gzipWriters: make(chan *gzip.Writer, writersCapacity), - gzipReaders: make(chan *gzip.Reader, readersCapacity), - zlibWriters: make(chan *zlib.Writer, writersCapacity), - writersCapacity: writersCapacity, - readersCapacity: readersCapacity, - } - for ix := 0; ix < writersCapacity; ix++ { - b.gzipWriters <- newGzipWriter() - b.zlibWriters <- newZlibWriter() - } - for ix := 0; ix < readersCapacity; ix++ { - b.gzipReaders <- newGzipReader() - } - return b -} - -// AcquireGzipWriter returns an resettable *gzip.Writer. Needs to be released. -func (b *BoundedCachedCompressors) AcquireGzipWriter() *gzip.Writer { - var writer *gzip.Writer - select { - case writer, _ = <-b.gzipWriters: - default: - // return a new unmanaged one - writer = newGzipWriter() - } - return writer -} - -// ReleaseGzipWriter accepts a writer (does not have to be one that was cached) -// only when the cache has room for it. It will ignore it otherwise. -func (b *BoundedCachedCompressors) ReleaseGzipWriter(w *gzip.Writer) { - // forget the unmanaged ones - if len(b.gzipWriters) < b.writersCapacity { - b.gzipWriters <- w - } -} - -// AcquireGzipReader returns a *gzip.Reader. Needs to be released. -func (b *BoundedCachedCompressors) AcquireGzipReader() *gzip.Reader { - var reader *gzip.Reader - select { - case reader, _ = <-b.gzipReaders: - default: - // return a new unmanaged one - reader = newGzipReader() - } - return reader -} - -// ReleaseGzipReader accepts a reader (does not have to be one that was cached) -// only when the cache has room for it. It will ignore it otherwise. -func (b *BoundedCachedCompressors) ReleaseGzipReader(r *gzip.Reader) { - // forget the unmanaged ones - if len(b.gzipReaders) < b.readersCapacity { - b.gzipReaders <- r - } -} - -// AcquireZlibWriter returns an resettable *zlib.Writer. Needs to be released. -func (b *BoundedCachedCompressors) AcquireZlibWriter() *zlib.Writer { - var writer *zlib.Writer - select { - case writer, _ = <-b.zlibWriters: - default: - // return a new unmanaged one - writer = newZlibWriter() - } - return writer -} - -// ReleaseZlibWriter accepts a writer (does not have to be one that was cached) -// only when the cache has room for it. It will ignore it otherwise. -func (b *BoundedCachedCompressors) ReleaseZlibWriter(w *zlib.Writer) { - // forget the unmanaged ones - if len(b.zlibWriters) < b.writersCapacity { - b.zlibWriters <- w - } -} diff --git a/vendor/github.com/emicklei/go-restful/compressor_pools.go b/vendor/github.com/emicklei/go-restful/compressor_pools.go deleted file mode 100644 index d866ce6..0000000 --- a/vendor/github.com/emicklei/go-restful/compressor_pools.go +++ /dev/null @@ -1,91 +0,0 @@ -package restful - -// Copyright 2015 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "bytes" - "compress/gzip" - "compress/zlib" - "sync" -) - -// SyncPoolCompessors is a CompressorProvider that use the standard sync.Pool. -type SyncPoolCompessors struct { - GzipWriterPool *sync.Pool - GzipReaderPool *sync.Pool - ZlibWriterPool *sync.Pool -} - -// NewSyncPoolCompessors returns a new ("empty") SyncPoolCompessors. -func NewSyncPoolCompessors() *SyncPoolCompessors { - return &SyncPoolCompessors{ - GzipWriterPool: &sync.Pool{ - New: func() interface{} { return newGzipWriter() }, - }, - GzipReaderPool: &sync.Pool{ - New: func() interface{} { return newGzipReader() }, - }, - ZlibWriterPool: &sync.Pool{ - New: func() interface{} { return newZlibWriter() }, - }, - } -} - -func (s *SyncPoolCompessors) AcquireGzipWriter() *gzip.Writer { - return s.GzipWriterPool.Get().(*gzip.Writer) -} - -func (s *SyncPoolCompessors) ReleaseGzipWriter(w *gzip.Writer) { - s.GzipWriterPool.Put(w) -} - -func (s *SyncPoolCompessors) AcquireGzipReader() *gzip.Reader { - return s.GzipReaderPool.Get().(*gzip.Reader) -} - -func (s *SyncPoolCompessors) ReleaseGzipReader(r *gzip.Reader) { - s.GzipReaderPool.Put(r) -} - -func (s *SyncPoolCompessors) AcquireZlibWriter() *zlib.Writer { - return s.ZlibWriterPool.Get().(*zlib.Writer) -} - -func (s *SyncPoolCompessors) ReleaseZlibWriter(w *zlib.Writer) { - s.ZlibWriterPool.Put(w) -} - -func newGzipWriter() *gzip.Writer { - // create with an empty bytes writer; it will be replaced before using the gzipWriter - writer, err := gzip.NewWriterLevel(new(bytes.Buffer), gzip.BestSpeed) - if err != nil { - panic(err.Error()) - } - return writer -} - -func newGzipReader() *gzip.Reader { - // create with an empty reader (but with GZIP header); it will be replaced before using the gzipReader - // we can safely use currentCompressProvider because it is set on package initialization. - w := currentCompressorProvider.AcquireGzipWriter() - defer currentCompressorProvider.ReleaseGzipWriter(w) - b := new(bytes.Buffer) - w.Reset(b) - w.Flush() - w.Close() - reader, err := gzip.NewReader(bytes.NewReader(b.Bytes())) - if err != nil { - panic(err.Error()) - } - return reader -} - -func newZlibWriter() *zlib.Writer { - writer, err := zlib.NewWriterLevel(new(bytes.Buffer), gzip.BestSpeed) - if err != nil { - panic(err.Error()) - } - return writer -} diff --git a/vendor/github.com/emicklei/go-restful/compressors.go b/vendor/github.com/emicklei/go-restful/compressors.go deleted file mode 100644 index 9db4a8c..0000000 --- a/vendor/github.com/emicklei/go-restful/compressors.go +++ /dev/null @@ -1,54 +0,0 @@ -package restful - -// Copyright 2015 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "compress/gzip" - "compress/zlib" -) - -// CompressorProvider describes a component that can provider compressors for the std methods. -type CompressorProvider interface { - // Returns a *gzip.Writer which needs to be released later. - // Before using it, call Reset(). - AcquireGzipWriter() *gzip.Writer - - // Releases an acquired *gzip.Writer. - ReleaseGzipWriter(w *gzip.Writer) - - // Returns a *gzip.Reader which needs to be released later. - AcquireGzipReader() *gzip.Reader - - // Releases an acquired *gzip.Reader. - ReleaseGzipReader(w *gzip.Reader) - - // Returns a *zlib.Writer which needs to be released later. - // Before using it, call Reset(). - AcquireZlibWriter() *zlib.Writer - - // Releases an acquired *zlib.Writer. - ReleaseZlibWriter(w *zlib.Writer) -} - -// DefaultCompressorProvider is the actual provider of compressors (zlib or gzip). -var currentCompressorProvider CompressorProvider - -func init() { - currentCompressorProvider = NewSyncPoolCompessors() -} - -// CurrentCompressorProvider returns the current CompressorProvider. -// It is initialized using a SyncPoolCompessors. -func CurrentCompressorProvider() CompressorProvider { - return currentCompressorProvider -} - -// SetCompressorProvider sets the actual provider of compressors (zlib or gzip). -func SetCompressorProvider(p CompressorProvider) { - if p == nil { - panic("cannot set compressor provider to nil") - } - currentCompressorProvider = p -} diff --git a/vendor/github.com/emicklei/go-restful/constants.go b/vendor/github.com/emicklei/go-restful/constants.go deleted file mode 100644 index 203439c..0000000 --- a/vendor/github.com/emicklei/go-restful/constants.go +++ /dev/null @@ -1,30 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -const ( - MIME_XML = "application/xml" // Accept or Content-Type used in Consumes() and/or Produces() - MIME_JSON = "application/json" // Accept or Content-Type used in Consumes() and/or Produces() - MIME_OCTET = "application/octet-stream" // If Content-Type is not present in request, use the default - - HEADER_Allow = "Allow" - HEADER_Accept = "Accept" - HEADER_Origin = "Origin" - HEADER_ContentType = "Content-Type" - HEADER_LastModified = "Last-Modified" - HEADER_AcceptEncoding = "Accept-Encoding" - HEADER_ContentEncoding = "Content-Encoding" - HEADER_AccessControlExposeHeaders = "Access-Control-Expose-Headers" - HEADER_AccessControlRequestMethod = "Access-Control-Request-Method" - HEADER_AccessControlRequestHeaders = "Access-Control-Request-Headers" - HEADER_AccessControlAllowMethods = "Access-Control-Allow-Methods" - HEADER_AccessControlAllowOrigin = "Access-Control-Allow-Origin" - HEADER_AccessControlAllowCredentials = "Access-Control-Allow-Credentials" - HEADER_AccessControlAllowHeaders = "Access-Control-Allow-Headers" - HEADER_AccessControlMaxAge = "Access-Control-Max-Age" - - ENCODING_GZIP = "gzip" - ENCODING_DEFLATE = "deflate" -) diff --git a/vendor/github.com/emicklei/go-restful/container.go b/vendor/github.com/emicklei/go-restful/container.go deleted file mode 100644 index 2f2bfe1..0000000 --- a/vendor/github.com/emicklei/go-restful/container.go +++ /dev/null @@ -1,374 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "bytes" - "errors" - "fmt" - "net/http" - "os" - "runtime" - "strings" - "sync" - - "github.com/emicklei/go-restful/log" -) - -// Container holds a collection of WebServices and a http.ServeMux to dispatch http requests. -// The requests are further dispatched to routes of WebServices using a RouteSelector -type Container struct { - webServicesLock sync.RWMutex - webServices []*WebService - ServeMux *http.ServeMux - isRegisteredOnRoot bool - containerFilters []FilterFunction - doNotRecover bool // default is true - recoverHandleFunc RecoverHandleFunction - serviceErrorHandleFunc ServiceErrorHandleFunction - router RouteSelector // default is a CurlyRouter (RouterJSR311 is a slower alternative) - contentEncodingEnabled bool // default is false -} - -// NewContainer creates a new Container using a new ServeMux and default router (CurlyRouter) -func NewContainer() *Container { - return &Container{ - webServices: []*WebService{}, - ServeMux: http.NewServeMux(), - isRegisteredOnRoot: false, - containerFilters: []FilterFunction{}, - doNotRecover: true, - recoverHandleFunc: logStackOnRecover, - serviceErrorHandleFunc: writeServiceError, - router: CurlyRouter{}, - contentEncodingEnabled: false} -} - -// RecoverHandleFunction declares functions that can be used to handle a panic situation. -// The first argument is what recover() returns. The second must be used to communicate an error response. -type RecoverHandleFunction func(interface{}, http.ResponseWriter) - -// RecoverHandler changes the default function (logStackOnRecover) to be called -// when a panic is detected. DoNotRecover must be have its default value (=false). -func (c *Container) RecoverHandler(handler RecoverHandleFunction) { - c.recoverHandleFunc = handler -} - -// ServiceErrorHandleFunction declares functions that can be used to handle a service error situation. -// The first argument is the service error, the second is the request that resulted in the error and -// the third must be used to communicate an error response. -type ServiceErrorHandleFunction func(ServiceError, *Request, *Response) - -// ServiceErrorHandler changes the default function (writeServiceError) to be called -// when a ServiceError is detected. -func (c *Container) ServiceErrorHandler(handler ServiceErrorHandleFunction) { - c.serviceErrorHandleFunc = handler -} - -// DoNotRecover controls whether panics will be caught to return HTTP 500. -// If set to true, Route functions are responsible for handling any error situation. -// Default value is true. -func (c *Container) DoNotRecover(doNot bool) { - c.doNotRecover = doNot -} - -// Router changes the default Router (currently CurlyRouter) -func (c *Container) Router(aRouter RouteSelector) { - c.router = aRouter -} - -// EnableContentEncoding (default=false) allows for GZIP or DEFLATE encoding of responses. -func (c *Container) EnableContentEncoding(enabled bool) { - c.contentEncodingEnabled = enabled -} - -// Add a WebService to the Container. It will detect duplicate root paths and exit in that case. -func (c *Container) Add(service *WebService) *Container { - c.webServicesLock.Lock() - defer c.webServicesLock.Unlock() - - // if rootPath was not set then lazy initialize it - if len(service.rootPath) == 0 { - service.Path("/") - } - - // cannot have duplicate root paths - for _, each := range c.webServices { - if each.RootPath() == service.RootPath() { - log.Printf("WebService with duplicate root path detected:['%v']", each) - os.Exit(1) - } - } - - // If not registered on root then add specific mapping - if !c.isRegisteredOnRoot { - c.isRegisteredOnRoot = c.addHandler(service, c.ServeMux) - } - c.webServices = append(c.webServices, service) - return c -} - -// addHandler may set a new HandleFunc for the serveMux -// this function must run inside the critical region protected by the webServicesLock. -// returns true if the function was registered on root ("/") -func (c *Container) addHandler(service *WebService, serveMux *http.ServeMux) bool { - pattern := fixedPrefixPath(service.RootPath()) - // check if root path registration is needed - if "/" == pattern || "" == pattern { - serveMux.HandleFunc("/", c.dispatch) - return true - } - // detect if registration already exists - alreadyMapped := false - for _, each := range c.webServices { - if each.RootPath() == service.RootPath() { - alreadyMapped = true - break - } - } - if !alreadyMapped { - serveMux.HandleFunc(pattern, c.dispatch) - if !strings.HasSuffix(pattern, "/") { - serveMux.HandleFunc(pattern+"/", c.dispatch) - } - } - return false -} - -func (c *Container) Remove(ws *WebService) error { - if c.ServeMux == http.DefaultServeMux { - errMsg := fmt.Sprintf("cannot remove a WebService from a Container using the DefaultServeMux: ['%v']", ws) - log.Print(errMsg) - return errors.New(errMsg) - } - c.webServicesLock.Lock() - defer c.webServicesLock.Unlock() - // build a new ServeMux and re-register all WebServices - newServeMux := http.NewServeMux() - newServices := []*WebService{} - newIsRegisteredOnRoot := false - for _, each := range c.webServices { - if each.rootPath != ws.rootPath { - // If not registered on root then add specific mapping - if !newIsRegisteredOnRoot { - newIsRegisteredOnRoot = c.addHandler(each, newServeMux) - } - newServices = append(newServices, each) - } - } - c.webServices, c.ServeMux, c.isRegisteredOnRoot = newServices, newServeMux, newIsRegisteredOnRoot - return nil -} - -// logStackOnRecover is the default RecoverHandleFunction and is called -// when DoNotRecover is false and the recoverHandleFunc is not set for the container. -// Default implementation logs the stacktrace and writes the stacktrace on the response. -// This may be a security issue as it exposes sourcecode information. -func logStackOnRecover(panicReason interface{}, httpWriter http.ResponseWriter) { - var buffer bytes.Buffer - buffer.WriteString(fmt.Sprintf("recover from panic situation: - %v\r\n", panicReason)) - for i := 2; ; i += 1 { - _, file, line, ok := runtime.Caller(i) - if !ok { - break - } - buffer.WriteString(fmt.Sprintf(" %s:%d\r\n", file, line)) - } - log.Print(buffer.String()) - httpWriter.WriteHeader(http.StatusInternalServerError) - httpWriter.Write(buffer.Bytes()) -} - -// writeServiceError is the default ServiceErrorHandleFunction and is called -// when a ServiceError is returned during route selection. Default implementation -// calls resp.WriteErrorString(err.Code, err.Message) -func writeServiceError(err ServiceError, req *Request, resp *Response) { - resp.WriteErrorString(err.Code, err.Message) -} - -// Dispatch the incoming Http Request to a matching WebService. -func (c *Container) Dispatch(httpWriter http.ResponseWriter, httpRequest *http.Request) { - if httpWriter == nil { - panic("httpWriter cannot be nil") - } - if httpRequest == nil { - panic("httpRequest cannot be nil") - } - c.dispatch(httpWriter, httpRequest) -} - -// Dispatch the incoming Http Request to a matching WebService. -func (c *Container) dispatch(httpWriter http.ResponseWriter, httpRequest *http.Request) { - writer := httpWriter - - // CompressingResponseWriter should be closed after all operations are done - defer func() { - if compressWriter, ok := writer.(*CompressingResponseWriter); ok { - compressWriter.Close() - } - }() - - // Instal panic recovery unless told otherwise - if !c.doNotRecover { // catch all for 500 response - defer func() { - if r := recover(); r != nil { - c.recoverHandleFunc(r, writer) - return - } - }() - } - - // Find best match Route ; err is non nil if no match was found - var webService *WebService - var route *Route - var err error - func() { - c.webServicesLock.RLock() - defer c.webServicesLock.RUnlock() - webService, route, err = c.router.SelectRoute( - c.webServices, - httpRequest) - }() - - // Detect if compression is needed - // assume without compression, test for override - contentEncodingEnabled := c.contentEncodingEnabled - if route != nil && route.contentEncodingEnabled != nil { - contentEncodingEnabled = *route.contentEncodingEnabled - } - if contentEncodingEnabled { - doCompress, encoding := wantsCompressedResponse(httpRequest) - if doCompress { - var err error - writer, err = NewCompressingResponseWriter(httpWriter, encoding) - if err != nil { - log.Print("unable to install compressor: ", err) - httpWriter.WriteHeader(http.StatusInternalServerError) - return - } - } - } - - if err != nil { - // a non-200 response has already been written - // run container filters anyway ; they should not touch the response... - chain := FilterChain{Filters: c.containerFilters, Target: func(req *Request, resp *Response) { - switch err.(type) { - case ServiceError: - ser := err.(ServiceError) - c.serviceErrorHandleFunc(ser, req, resp) - } - // TODO - }} - chain.ProcessFilter(NewRequest(httpRequest), NewResponse(writer)) - return - } - pathProcessor, routerProcessesPath := c.router.(PathProcessor) - if !routerProcessesPath { - pathProcessor = defaultPathProcessor{} - } - pathParams := pathProcessor.ExtractParameters(route, webService, httpRequest.URL.Path) - wrappedRequest, wrappedResponse := route.wrapRequestResponse(writer, httpRequest, pathParams) - // pass through filters (if any) - if size := len(c.containerFilters) + len(webService.filters) + len(route.Filters); size > 0 { - // compose filter chain - allFilters := make([]FilterFunction, 0, size) - allFilters = append(allFilters, c.containerFilters...) - allFilters = append(allFilters, webService.filters...) - allFilters = append(allFilters, route.Filters...) - chain := FilterChain{Filters: allFilters, Target: route.Function} - chain.ProcessFilter(wrappedRequest, wrappedResponse) - } else { - // no filters, handle request by route - route.Function(wrappedRequest, wrappedResponse) - } -} - -// fixedPrefixPath returns the fixed part of the partspec ; it may include template vars {} -func fixedPrefixPath(pathspec string) string { - varBegin := strings.Index(pathspec, "{") - if -1 == varBegin { - return pathspec - } - return pathspec[:varBegin] -} - -// ServeHTTP implements net/http.Handler therefore a Container can be a Handler in a http.Server -func (c *Container) ServeHTTP(httpwriter http.ResponseWriter, httpRequest *http.Request) { - c.ServeMux.ServeHTTP(httpwriter, httpRequest) -} - -// Handle registers the handler for the given pattern. If a handler already exists for pattern, Handle panics. -func (c *Container) Handle(pattern string, handler http.Handler) { - c.ServeMux.Handle(pattern, handler) -} - -// HandleWithFilter registers the handler for the given pattern. -// Container's filter chain is applied for handler. -// If a handler already exists for pattern, HandleWithFilter panics. -func (c *Container) HandleWithFilter(pattern string, handler http.Handler) { - f := func(httpResponse http.ResponseWriter, httpRequest *http.Request) { - if len(c.containerFilters) == 0 { - handler.ServeHTTP(httpResponse, httpRequest) - return - } - - chain := FilterChain{Filters: c.containerFilters, Target: func(req *Request, resp *Response) { - handler.ServeHTTP(resp, req.Request) - }} - chain.ProcessFilter(NewRequest(httpRequest), NewResponse(httpResponse)) - } - - c.Handle(pattern, http.HandlerFunc(f)) -} - -// Filter appends a container FilterFunction. These are called before dispatching -// a http.Request to a WebService from the container -func (c *Container) Filter(filter FilterFunction) { - c.containerFilters = append(c.containerFilters, filter) -} - -// RegisteredWebServices returns the collections of added WebServices -func (c *Container) RegisteredWebServices() []*WebService { - c.webServicesLock.RLock() - defer c.webServicesLock.RUnlock() - result := make([]*WebService, len(c.webServices)) - for ix := range c.webServices { - result[ix] = c.webServices[ix] - } - return result -} - -// computeAllowedMethods returns a list of HTTP methods that are valid for a Request -func (c *Container) computeAllowedMethods(req *Request) []string { - // Go through all RegisteredWebServices() and all its Routes to collect the options - methods := []string{} - requestPath := req.Request.URL.Path - for _, ws := range c.RegisteredWebServices() { - matches := ws.pathExpr.Matcher.FindStringSubmatch(requestPath) - if matches != nil { - finalMatch := matches[len(matches)-1] - for _, rt := range ws.Routes() { - matches := rt.pathExpr.Matcher.FindStringSubmatch(finalMatch) - if matches != nil { - lastMatch := matches[len(matches)-1] - if lastMatch == "" || lastMatch == "/" { // do not include if value is neither empty nor ‘/’. - methods = append(methods, rt.Method) - } - } - } - } - } - // methods = append(methods, "OPTIONS") not sure about this - return methods -} - -// newBasicRequestResponse creates a pair of Request,Response from its http versions. -// It is basic because no parameter or (produces) content-type information is given. -func newBasicRequestResponse(httpWriter http.ResponseWriter, httpRequest *http.Request) (*Request, *Response) { - resp := NewResponse(httpWriter) - resp.requestAccept = httpRequest.Header.Get(HEADER_Accept) - return NewRequest(httpRequest), resp -} diff --git a/vendor/github.com/emicklei/go-restful/cors_filter.go b/vendor/github.com/emicklei/go-restful/cors_filter.go deleted file mode 100644 index 1efeef0..0000000 --- a/vendor/github.com/emicklei/go-restful/cors_filter.go +++ /dev/null @@ -1,202 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "regexp" - "strconv" - "strings" -) - -// CrossOriginResourceSharing is used to create a Container Filter that implements CORS. -// Cross-origin resource sharing (CORS) is a mechanism that allows JavaScript on a web page -// to make XMLHttpRequests to another domain, not the domain the JavaScript originated from. -// -// http://en.wikipedia.org/wiki/Cross-origin_resource_sharing -// http://enable-cors.org/server.html -// http://www.html5rocks.com/en/tutorials/cors/#toc-handling-a-not-so-simple-request -type CrossOriginResourceSharing struct { - ExposeHeaders []string // list of Header names - AllowedHeaders []string // list of Header names - AllowedDomains []string // list of allowed values for Http Origin. An allowed value can be a regular expression to support subdomain matching. If empty all are allowed. - AllowedMethods []string - MaxAge int // number of seconds before requiring new Options request - CookiesAllowed bool - Container *Container - - allowedOriginPatterns []*regexp.Regexp // internal field for origin regexp check. -} - -// Filter is a filter function that implements the CORS flow as documented on http://enable-cors.org/server.html -// and http://www.html5rocks.com/static/images/cors_server_flowchart.png -func (c CrossOriginResourceSharing) Filter(req *Request, resp *Response, chain *FilterChain) { - origin := req.Request.Header.Get(HEADER_Origin) - if len(origin) == 0 { - if trace { - traceLogger.Print("no Http header Origin set") - } - chain.ProcessFilter(req, resp) - return - } - if !c.isOriginAllowed(origin) { // check whether this origin is allowed - if trace { - traceLogger.Printf("HTTP Origin:%s is not part of %v, neither matches any part of %v", origin, c.AllowedDomains, c.allowedOriginPatterns) - } - chain.ProcessFilter(req, resp) - return - } - if req.Request.Method != "OPTIONS" { - c.doActualRequest(req, resp) - chain.ProcessFilter(req, resp) - return - } - if acrm := req.Request.Header.Get(HEADER_AccessControlRequestMethod); acrm != "" { - c.doPreflightRequest(req, resp) - } else { - c.doActualRequest(req, resp) - chain.ProcessFilter(req, resp) - return - } -} - -func (c CrossOriginResourceSharing) doActualRequest(req *Request, resp *Response) { - c.setOptionsHeaders(req, resp) - // continue processing the response -} - -func (c *CrossOriginResourceSharing) doPreflightRequest(req *Request, resp *Response) { - if len(c.AllowedMethods) == 0 { - if c.Container == nil { - c.AllowedMethods = DefaultContainer.computeAllowedMethods(req) - } else { - c.AllowedMethods = c.Container.computeAllowedMethods(req) - } - } - - acrm := req.Request.Header.Get(HEADER_AccessControlRequestMethod) - if !c.isValidAccessControlRequestMethod(acrm, c.AllowedMethods) { - if trace { - traceLogger.Printf("Http header %s:%s is not in %v", - HEADER_AccessControlRequestMethod, - acrm, - c.AllowedMethods) - } - return - } - acrhs := req.Request.Header.Get(HEADER_AccessControlRequestHeaders) - if len(acrhs) > 0 { - for _, each := range strings.Split(acrhs, ",") { - if !c.isValidAccessControlRequestHeader(strings.Trim(each, " ")) { - if trace { - traceLogger.Printf("Http header %s:%s is not in %v", - HEADER_AccessControlRequestHeaders, - acrhs, - c.AllowedHeaders) - } - return - } - } - } - resp.AddHeader(HEADER_AccessControlAllowMethods, strings.Join(c.AllowedMethods, ",")) - resp.AddHeader(HEADER_AccessControlAllowHeaders, acrhs) - c.setOptionsHeaders(req, resp) - - // return http 200 response, no body -} - -func (c CrossOriginResourceSharing) setOptionsHeaders(req *Request, resp *Response) { - c.checkAndSetExposeHeaders(resp) - c.setAllowOriginHeader(req, resp) - c.checkAndSetAllowCredentials(resp) - if c.MaxAge > 0 { - resp.AddHeader(HEADER_AccessControlMaxAge, strconv.Itoa(c.MaxAge)) - } -} - -func (c CrossOriginResourceSharing) isOriginAllowed(origin string) bool { - if len(origin) == 0 { - return false - } - if len(c.AllowedDomains) == 0 { - return true - } - - allowed := false - for _, domain := range c.AllowedDomains { - if domain == origin { - allowed = true - break - } - } - - if !allowed { - if len(c.allowedOriginPatterns) == 0 { - // compile allowed domains to allowed origin patterns - allowedOriginRegexps, err := compileRegexps(c.AllowedDomains) - if err != nil { - return false - } - c.allowedOriginPatterns = allowedOriginRegexps - } - - for _, pattern := range c.allowedOriginPatterns { - if allowed = pattern.MatchString(origin); allowed { - break - } - } - } - - return allowed -} - -func (c CrossOriginResourceSharing) setAllowOriginHeader(req *Request, resp *Response) { - origin := req.Request.Header.Get(HEADER_Origin) - if c.isOriginAllowed(origin) { - resp.AddHeader(HEADER_AccessControlAllowOrigin, origin) - } -} - -func (c CrossOriginResourceSharing) checkAndSetExposeHeaders(resp *Response) { - if len(c.ExposeHeaders) > 0 { - resp.AddHeader(HEADER_AccessControlExposeHeaders, strings.Join(c.ExposeHeaders, ",")) - } -} - -func (c CrossOriginResourceSharing) checkAndSetAllowCredentials(resp *Response) { - if c.CookiesAllowed { - resp.AddHeader(HEADER_AccessControlAllowCredentials, "true") - } -} - -func (c CrossOriginResourceSharing) isValidAccessControlRequestMethod(method string, allowedMethods []string) bool { - for _, each := range allowedMethods { - if each == method { - return true - } - } - return false -} - -func (c CrossOriginResourceSharing) isValidAccessControlRequestHeader(header string) bool { - for _, each := range c.AllowedHeaders { - if strings.ToLower(each) == strings.ToLower(header) { - return true - } - } - return false -} - -// Take a list of strings and compile them into a list of regular expressions. -func compileRegexps(regexpStrings []string) ([]*regexp.Regexp, error) { - regexps := []*regexp.Regexp{} - for _, regexpStr := range regexpStrings { - r, err := regexp.Compile(regexpStr) - if err != nil { - return regexps, err - } - regexps = append(regexps, r) - } - return regexps, nil -} diff --git a/vendor/github.com/emicklei/go-restful/coverage.sh b/vendor/github.com/emicklei/go-restful/coverage.sh deleted file mode 100644 index e27dbf1..0000000 --- a/vendor/github.com/emicklei/go-restful/coverage.sh +++ /dev/null @@ -1,2 +0,0 @@ -go test -coverprofile=coverage.out -go tool cover -html=coverage.out \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/curly.go b/vendor/github.com/emicklei/go-restful/curly.go deleted file mode 100644 index ba1fc5d..0000000 --- a/vendor/github.com/emicklei/go-restful/curly.go +++ /dev/null @@ -1,173 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "net/http" - "regexp" - "sort" - "strings" -) - -// CurlyRouter expects Routes with paths that contain zero or more parameters in curly brackets. -type CurlyRouter struct{} - -// SelectRoute is part of the Router interface and returns the best match -// for the WebService and its Route for the given Request. -func (c CurlyRouter) SelectRoute( - webServices []*WebService, - httpRequest *http.Request) (selectedService *WebService, selected *Route, err error) { - - requestTokens := tokenizePath(httpRequest.URL.Path) - - detectedService := c.detectWebService(requestTokens, webServices) - if detectedService == nil { - if trace { - traceLogger.Printf("no WebService was found to match URL path:%s\n", httpRequest.URL.Path) - } - return nil, nil, NewError(http.StatusNotFound, "404: Page Not Found") - } - candidateRoutes := c.selectRoutes(detectedService, requestTokens) - if len(candidateRoutes) == 0 { - if trace { - traceLogger.Printf("no Route in WebService with path %s was found to match URL path:%s\n", detectedService.rootPath, httpRequest.URL.Path) - } - return detectedService, nil, NewError(http.StatusNotFound, "404: Page Not Found") - } - selectedRoute, err := c.detectRoute(candidateRoutes, httpRequest) - if selectedRoute == nil { - return detectedService, nil, err - } - return detectedService, selectedRoute, nil -} - -// selectRoutes return a collection of Route from a WebService that matches the path tokens from the request. -func (c CurlyRouter) selectRoutes(ws *WebService, requestTokens []string) sortableCurlyRoutes { - candidates := make(sortableCurlyRoutes, 0, 8) - for _, each := range ws.routes { - matches, paramCount, staticCount := c.matchesRouteByPathTokens(each.pathParts, requestTokens, each.hasCustomVerb) - if matches { - candidates.add(curlyRoute{each, paramCount, staticCount}) // TODO make sure Routes() return pointers? - } - } - sort.Sort(candidates) - return candidates -} - -// matchesRouteByPathTokens computes whether it matches, howmany parameters do match and what the number of static path elements are. -func (c CurlyRouter) matchesRouteByPathTokens(routeTokens, requestTokens []string, routeHasCustomVerb bool) (matches bool, paramCount int, staticCount int) { - if len(routeTokens) < len(requestTokens) { - // proceed in matching only if last routeToken is wildcard - count := len(routeTokens) - if count == 0 || !strings.HasSuffix(routeTokens[count-1], "*}") { - return false, 0, 0 - } - // proceed - } - for i, routeToken := range routeTokens { - if i == len(requestTokens) { - // reached end of request path - return false, 0, 0 - } - requestToken := requestTokens[i] - if routeHasCustomVerb && hasCustomVerb(routeToken){ - if !isMatchCustomVerb(routeToken, requestToken) { - return false, 0, 0 - } - staticCount++ - requestToken = removeCustomVerb(requestToken) - routeToken = removeCustomVerb(routeToken) - } - - if strings.HasPrefix(routeToken, "{") { - paramCount++ - if colon := strings.Index(routeToken, ":"); colon != -1 { - // match by regex - matchesToken, matchesRemainder := c.regularMatchesPathToken(routeToken, colon, requestToken) - if !matchesToken { - return false, 0, 0 - } - if matchesRemainder { - break - } - } - } else { // no { prefix - if requestToken != routeToken { - return false, 0, 0 - } - staticCount++ - } - } - return true, paramCount, staticCount -} - -// regularMatchesPathToken tests whether the regular expression part of routeToken matches the requestToken or all remaining tokens -// format routeToken is {someVar:someExpression}, e.g. {zipcode:[\d][\d][\d][\d][A-Z][A-Z]} -func (c CurlyRouter) regularMatchesPathToken(routeToken string, colon int, requestToken string) (matchesToken bool, matchesRemainder bool) { - regPart := routeToken[colon+1 : len(routeToken)-1] - if regPart == "*" { - if trace { - traceLogger.Printf("wildcard parameter detected in route token %s that matches %s\n", routeToken, requestToken) - } - return true, true - } - matched, err := regexp.MatchString(regPart, requestToken) - return (matched && err == nil), false -} - -var jsr311Router = RouterJSR311{} - -// detectRoute selectes from a list of Route the first match by inspecting both the Accept and Content-Type -// headers of the Request. See also RouterJSR311 in jsr311.go -func (c CurlyRouter) detectRoute(candidateRoutes sortableCurlyRoutes, httpRequest *http.Request) (*Route, error) { - // tracing is done inside detectRoute - return jsr311Router.detectRoute(candidateRoutes.routes(), httpRequest) -} - -// detectWebService returns the best matching webService given the list of path tokens. -// see also computeWebserviceScore -func (c CurlyRouter) detectWebService(requestTokens []string, webServices []*WebService) *WebService { - var best *WebService - score := -1 - for _, each := range webServices { - matches, eachScore := c.computeWebserviceScore(requestTokens, each.pathExpr.tokens) - if matches && (eachScore > score) { - best = each - score = eachScore - } - } - return best -} - -// computeWebserviceScore returns whether tokens match and -// the weighted score of the longest matching consecutive tokens from the beginning. -func (c CurlyRouter) computeWebserviceScore(requestTokens []string, tokens []string) (bool, int) { - if len(tokens) > len(requestTokens) { - return false, 0 - } - score := 0 - for i := 0; i < len(tokens); i++ { - each := requestTokens[i] - other := tokens[i] - if len(each) == 0 && len(other) == 0 { - score++ - continue - } - if len(other) > 0 && strings.HasPrefix(other, "{") { - // no empty match - if len(each) == 0 { - return false, score - } - score += 1 - } else { - // not a parameter - if each != other { - return false, score - } - score += (len(tokens) - i) * 10 //fuzzy - } - } - return true, score -} diff --git a/vendor/github.com/emicklei/go-restful/curly_route.go b/vendor/github.com/emicklei/go-restful/curly_route.go deleted file mode 100644 index 403dd3b..0000000 --- a/vendor/github.com/emicklei/go-restful/curly_route.go +++ /dev/null @@ -1,54 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -// curlyRoute exits for sorting Routes by the CurlyRouter based on number of parameters and number of static path elements. -type curlyRoute struct { - route Route - paramCount int - staticCount int -} - -// sortableCurlyRoutes orders by most parameters and path elements first. -type sortableCurlyRoutes []curlyRoute - -func (s *sortableCurlyRoutes) add(route curlyRoute) { - *s = append(*s, route) -} - -func (s sortableCurlyRoutes) routes() (routes []Route) { - routes = make([]Route, 0, len(s)) - for _, each := range s { - routes = append(routes, each.route) // TODO change return type - } - return routes -} - -func (s sortableCurlyRoutes) Len() int { - return len(s) -} -func (s sortableCurlyRoutes) Swap(i, j int) { - s[i], s[j] = s[j], s[i] -} -func (s sortableCurlyRoutes) Less(i, j int) bool { - a := s[j] - b := s[i] - - // primary key - if a.staticCount < b.staticCount { - return true - } - if a.staticCount > b.staticCount { - return false - } - // secundary key - if a.paramCount < b.paramCount { - return true - } - if a.paramCount > b.paramCount { - return false - } - return a.route.Path < b.route.Path -} diff --git a/vendor/github.com/emicklei/go-restful/custom_verb.go b/vendor/github.com/emicklei/go-restful/custom_verb.go deleted file mode 100644 index bfc17ef..0000000 --- a/vendor/github.com/emicklei/go-restful/custom_verb.go +++ /dev/null @@ -1,29 +0,0 @@ -package restful - -import ( - "fmt" - "regexp" -) - -var ( - customVerbReg = regexp.MustCompile(":([A-Za-z]+)$") -) - -func hasCustomVerb(routeToken string) bool { - return customVerbReg.MatchString(routeToken) -} - -func isMatchCustomVerb(routeToken string, pathToken string) bool { - rs := customVerbReg.FindStringSubmatch(routeToken) - if len(rs) < 2 { - return false - } - - customVerb := rs[1] - specificVerbReg := regexp.MustCompile(fmt.Sprintf(":%s$", customVerb)) - return specificVerbReg.MatchString(pathToken) -} - -func removeCustomVerb(str string) string { - return customVerbReg.ReplaceAllString(str, "") -} diff --git a/vendor/github.com/emicklei/go-restful/doc.go b/vendor/github.com/emicklei/go-restful/doc.go deleted file mode 100644 index f7c16b0..0000000 --- a/vendor/github.com/emicklei/go-restful/doc.go +++ /dev/null @@ -1,185 +0,0 @@ -/* -Package restful , a lean package for creating REST-style WebServices without magic. - -WebServices and Routes - -A WebService has a collection of Route objects that dispatch incoming Http Requests to a function calls. -Typically, a WebService has a root path (e.g. /users) and defines common MIME types for its routes. -WebServices must be added to a container (see below) in order to handler Http requests from a server. - -A Route is defined by a HTTP method, an URL path and (optionally) the MIME types it consumes (Content-Type) and produces (Accept). -This package has the logic to find the best matching Route and if found, call its Function. - - ws := new(restful.WebService) - ws. - Path("/users"). - Consumes(restful.MIME_JSON, restful.MIME_XML). - Produces(restful.MIME_JSON, restful.MIME_XML) - - ws.Route(ws.GET("/{user-id}").To(u.findUser)) // u is a UserResource - - ... - - // GET http://localhost:8080/users/1 - func (u UserResource) findUser(request *restful.Request, response *restful.Response) { - id := request.PathParameter("user-id") - ... - } - -The (*Request, *Response) arguments provide functions for reading information from the request and writing information back to the response. - -See the example https://github.com/emicklei/go-restful/blob/master/examples/restful-user-resource.go with a full implementation. - -Regular expression matching Routes - -A Route parameter can be specified using the format "uri/{var[:regexp]}" or the special version "uri/{var:*}" for matching the tail of the path. -For example, /persons/{name:[A-Z][A-Z]} can be used to restrict values for the parameter "name" to only contain capital alphabetic characters. -Regular expressions must use the standard Go syntax as described in the regexp package. (https://code.google.com/p/re2/wiki/Syntax) -This feature requires the use of a CurlyRouter. - -Containers - -A Container holds a collection of WebServices, Filters and a http.ServeMux for multiplexing http requests. -Using the statements "restful.Add(...) and restful.Filter(...)" will register WebServices and Filters to the Default Container. -The Default container of go-restful uses the http.DefaultServeMux. -You can create your own Container and create a new http.Server for that particular container. - - container := restful.NewContainer() - server := &http.Server{Addr: ":8081", Handler: container} - -Filters - -A filter dynamically intercepts requests and responses to transform or use the information contained in the requests or responses. -You can use filters to perform generic logging, measurement, authentication, redirect, set response headers etc. -In the restful package there are three hooks into the request,response flow where filters can be added. -Each filter must define a FilterFunction: - - func (req *restful.Request, resp *restful.Response, chain *restful.FilterChain) - -Use the following statement to pass the request,response pair to the next filter or RouteFunction - - chain.ProcessFilter(req, resp) - -Container Filters - -These are processed before any registered WebService. - - // install a (global) filter for the default container (processed before any webservice) - restful.Filter(globalLogging) - -WebService Filters - -These are processed before any Route of a WebService. - - // install a webservice filter (processed before any route) - ws.Filter(webserviceLogging).Filter(measureTime) - - -Route Filters - -These are processed before calling the function associated with the Route. - - // install 2 chained route filters (processed before calling findUser) - ws.Route(ws.GET("/{user-id}").Filter(routeLogging).Filter(NewCountFilter().routeCounter).To(findUser)) - -See the example https://github.com/emicklei/go-restful/blob/master/examples/restful-filters.go with full implementations. - -Response Encoding - -Two encodings are supported: gzip and deflate. To enable this for all responses: - - restful.DefaultContainer.EnableContentEncoding(true) - -If a Http request includes the Accept-Encoding header then the response content will be compressed using the specified encoding. -Alternatively, you can create a Filter that performs the encoding and install it per WebService or Route. - -See the example https://github.com/emicklei/go-restful/blob/master/examples/restful-encoding-filter.go - -OPTIONS support - -By installing a pre-defined container filter, your Webservice(s) can respond to the OPTIONS Http request. - - Filter(OPTIONSFilter()) - -CORS - -By installing the filter of a CrossOriginResourceSharing (CORS), your WebService(s) can handle CORS requests. - - cors := CrossOriginResourceSharing{ExposeHeaders: []string{"X-My-Header"}, CookiesAllowed: false, Container: DefaultContainer} - Filter(cors.Filter) - -Error Handling - -Unexpected things happen. If a request cannot be processed because of a failure, your service needs to tell via the response what happened and why. -For this reason HTTP status codes exist and it is important to use the correct code in every exceptional situation. - - 400: Bad Request - -If path or query parameters are not valid (content or type) then use http.StatusBadRequest. - - 404: Not Found - -Despite a valid URI, the resource requested may not be available - - 500: Internal Server Error - -If the application logic could not process the request (or write the response) then use http.StatusInternalServerError. - - 405: Method Not Allowed - -The request has a valid URL but the method (GET,PUT,POST,...) is not allowed. - - 406: Not Acceptable - -The request does not have or has an unknown Accept Header set for this operation. - - 415: Unsupported Media Type - -The request does not have or has an unknown Content-Type Header set for this operation. - -ServiceError - -In addition to setting the correct (error) Http status code, you can choose to write a ServiceError message on the response. - -Performance options - -This package has several options that affect the performance of your service. It is important to understand them and how you can change it. - - restful.DefaultContainer.DoNotRecover(false) - -DoNotRecover controls whether panics will be caught to return HTTP 500. -If set to false, the container will recover from panics. -Default value is true - - restful.SetCompressorProvider(NewBoundedCachedCompressors(20, 20)) - -If content encoding is enabled then the default strategy for getting new gzip/zlib writers and readers is to use a sync.Pool. -Because writers are expensive structures, performance is even more improved when using a preloaded cache. You can also inject your own implementation. - -Trouble shooting - -This package has the means to produce detail logging of the complete Http request matching process and filter invocation. -Enabling this feature requires you to set an implementation of restful.StdLogger (e.g. log.Logger) instance such as: - - restful.TraceLogger(log.New(os.Stdout, "[restful] ", log.LstdFlags|log.Lshortfile)) - -Logging - -The restful.SetLogger() method allows you to override the logger used by the package. By default restful -uses the standard library `log` package and logs to stdout. Different logging packages are supported as -long as they conform to `StdLogger` interface defined in the `log` sub-package, writing an adapter for your -preferred package is simple. - -Resources - -[project]: https://github.com/emicklei/go-restful - -[examples]: https://github.com/emicklei/go-restful/blob/master/examples - -[design]: http://ernestmicklei.com/2012/11/11/go-restful-api-design/ - -[showcases]: https://github.com/emicklei/mora, https://github.com/emicklei/landskape - -(c) 2012-2015, http://ernestmicklei.com. MIT License -*/ -package restful diff --git a/vendor/github.com/emicklei/go-restful/entity_accessors.go b/vendor/github.com/emicklei/go-restful/entity_accessors.go deleted file mode 100644 index 66dfc82..0000000 --- a/vendor/github.com/emicklei/go-restful/entity_accessors.go +++ /dev/null @@ -1,162 +0,0 @@ -package restful - -// Copyright 2015 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "encoding/xml" - "strings" - "sync" -) - -// EntityReaderWriter can read and write values using an encoding such as JSON,XML. -type EntityReaderWriter interface { - // Read a serialized version of the value from the request. - // The Request may have a decompressing reader. Depends on Content-Encoding. - Read(req *Request, v interface{}) error - - // Write a serialized version of the value on the response. - // The Response may have a compressing writer. Depends on Accept-Encoding. - // status should be a valid Http Status code - Write(resp *Response, status int, v interface{}) error -} - -// entityAccessRegistry is a singleton -var entityAccessRegistry = &entityReaderWriters{ - protection: new(sync.RWMutex), - accessors: map[string]EntityReaderWriter{}, -} - -// entityReaderWriters associates MIME to an EntityReaderWriter -type entityReaderWriters struct { - protection *sync.RWMutex - accessors map[string]EntityReaderWriter -} - -func init() { - RegisterEntityAccessor(MIME_JSON, NewEntityAccessorJSON(MIME_JSON)) - RegisterEntityAccessor(MIME_XML, NewEntityAccessorXML(MIME_XML)) -} - -// RegisterEntityAccessor add/overrides the ReaderWriter for encoding content with this MIME type. -func RegisterEntityAccessor(mime string, erw EntityReaderWriter) { - entityAccessRegistry.protection.Lock() - defer entityAccessRegistry.protection.Unlock() - entityAccessRegistry.accessors[mime] = erw -} - -// NewEntityAccessorJSON returns a new EntityReaderWriter for accessing JSON content. -// This package is already initialized with such an accessor using the MIME_JSON contentType. -func NewEntityAccessorJSON(contentType string) EntityReaderWriter { - return entityJSONAccess{ContentType: contentType} -} - -// NewEntityAccessorXML returns a new EntityReaderWriter for accessing XML content. -// This package is already initialized with such an accessor using the MIME_XML contentType. -func NewEntityAccessorXML(contentType string) EntityReaderWriter { - return entityXMLAccess{ContentType: contentType} -} - -// accessorAt returns the registered ReaderWriter for this MIME type. -func (r *entityReaderWriters) accessorAt(mime string) (EntityReaderWriter, bool) { - r.protection.RLock() - defer r.protection.RUnlock() - er, ok := r.accessors[mime] - if !ok { - // retry with reverse lookup - // more expensive but we are in an exceptional situation anyway - for k, v := range r.accessors { - if strings.Contains(mime, k) { - return v, true - } - } - } - return er, ok -} - -// entityXMLAccess is a EntityReaderWriter for XML encoding -type entityXMLAccess struct { - // This is used for setting the Content-Type header when writing - ContentType string -} - -// Read unmarshalls the value from XML -func (e entityXMLAccess) Read(req *Request, v interface{}) error { - return xml.NewDecoder(req.Request.Body).Decode(v) -} - -// Write marshalls the value to JSON and set the Content-Type Header. -func (e entityXMLAccess) Write(resp *Response, status int, v interface{}) error { - return writeXML(resp, status, e.ContentType, v) -} - -// writeXML marshalls the value to JSON and set the Content-Type Header. -func writeXML(resp *Response, status int, contentType string, v interface{}) error { - if v == nil { - resp.WriteHeader(status) - // do not write a nil representation - return nil - } - if resp.prettyPrint { - // pretty output must be created and written explicitly - output, err := xml.MarshalIndent(v, " ", " ") - if err != nil { - return err - } - resp.Header().Set(HEADER_ContentType, contentType) - resp.WriteHeader(status) - _, err = resp.Write([]byte(xml.Header)) - if err != nil { - return err - } - _, err = resp.Write(output) - return err - } - // not-so-pretty - resp.Header().Set(HEADER_ContentType, contentType) - resp.WriteHeader(status) - return xml.NewEncoder(resp).Encode(v) -} - -// entityJSONAccess is a EntityReaderWriter for JSON encoding -type entityJSONAccess struct { - // This is used for setting the Content-Type header when writing - ContentType string -} - -// Read unmarshalls the value from JSON -func (e entityJSONAccess) Read(req *Request, v interface{}) error { - decoder := NewDecoder(req.Request.Body) - decoder.UseNumber() - return decoder.Decode(v) -} - -// Write marshalls the value to JSON and set the Content-Type Header. -func (e entityJSONAccess) Write(resp *Response, status int, v interface{}) error { - return writeJSON(resp, status, e.ContentType, v) -} - -// write marshalls the value to JSON and set the Content-Type Header. -func writeJSON(resp *Response, status int, contentType string, v interface{}) error { - if v == nil { - resp.WriteHeader(status) - // do not write a nil representation - return nil - } - if resp.prettyPrint { - // pretty output must be created and written explicitly - output, err := MarshalIndent(v, "", " ") - if err != nil { - return err - } - resp.Header().Set(HEADER_ContentType, contentType) - resp.WriteHeader(status) - _, err = resp.Write(output) - return err - } - // not-so-pretty - resp.Header().Set(HEADER_ContentType, contentType) - resp.WriteHeader(status) - return NewEncoder(resp).Encode(v) -} diff --git a/vendor/github.com/emicklei/go-restful/filter.go b/vendor/github.com/emicklei/go-restful/filter.go deleted file mode 100644 index c23bfb5..0000000 --- a/vendor/github.com/emicklei/go-restful/filter.go +++ /dev/null @@ -1,35 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -// FilterChain is a request scoped object to process one or more filters before calling the target RouteFunction. -type FilterChain struct { - Filters []FilterFunction // ordered list of FilterFunction - Index int // index into filters that is currently in progress - Target RouteFunction // function to call after passing all filters -} - -// ProcessFilter passes the request,response pair through the next of Filters. -// Each filter can decide to proceed to the next Filter or handle the Response itself. -func (f *FilterChain) ProcessFilter(request *Request, response *Response) { - if f.Index < len(f.Filters) { - f.Index++ - f.Filters[f.Index-1](request, response, f) - } else { - f.Target(request, response) - } -} - -// FilterFunction definitions must call ProcessFilter on the FilterChain to pass on the control and eventually call the RouteFunction -type FilterFunction func(*Request, *Response, *FilterChain) - -// NoBrowserCacheFilter is a filter function to set HTTP headers that disable browser caching -// See examples/restful-no-cache-filter.go for usage -func NoBrowserCacheFilter(req *Request, resp *Response, chain *FilterChain) { - resp.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate") // HTTP 1.1. - resp.Header().Set("Pragma", "no-cache") // HTTP 1.0. - resp.Header().Set("Expires", "0") // Proxies. - chain.ProcessFilter(req, resp) -} diff --git a/vendor/github.com/emicklei/go-restful/json.go b/vendor/github.com/emicklei/go-restful/json.go deleted file mode 100644 index 8711651..0000000 --- a/vendor/github.com/emicklei/go-restful/json.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build !jsoniter - -package restful - -import "encoding/json" - -var ( - MarshalIndent = json.MarshalIndent - NewDecoder = json.NewDecoder - NewEncoder = json.NewEncoder -) diff --git a/vendor/github.com/emicklei/go-restful/jsoniter.go b/vendor/github.com/emicklei/go-restful/jsoniter.go deleted file mode 100644 index 11b8f8a..0000000 --- a/vendor/github.com/emicklei/go-restful/jsoniter.go +++ /dev/null @@ -1,12 +0,0 @@ -// +build jsoniter - -package restful - -import "github.com/json-iterator/go" - -var ( - json = jsoniter.ConfigCompatibleWithStandardLibrary - MarshalIndent = json.MarshalIndent - NewDecoder = json.NewDecoder - NewEncoder = json.NewEncoder -) diff --git a/vendor/github.com/emicklei/go-restful/jsr311.go b/vendor/github.com/emicklei/go-restful/jsr311.go deleted file mode 100644 index 3ede189..0000000 --- a/vendor/github.com/emicklei/go-restful/jsr311.go +++ /dev/null @@ -1,297 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "errors" - "fmt" - "net/http" - "sort" -) - -// RouterJSR311 implements the flow for matching Requests to Routes (and consequently Resource Functions) -// as specified by the JSR311 http://jsr311.java.net/nonav/releases/1.1/spec/spec.html. -// RouterJSR311 implements the Router interface. -// Concept of locators is not implemented. -type RouterJSR311 struct{} - -// SelectRoute is part of the Router interface and returns the best match -// for the WebService and its Route for the given Request. -func (r RouterJSR311) SelectRoute( - webServices []*WebService, - httpRequest *http.Request) (selectedService *WebService, selectedRoute *Route, err error) { - - // Identify the root resource class (WebService) - dispatcher, finalMatch, err := r.detectDispatcher(httpRequest.URL.Path, webServices) - if err != nil { - return nil, nil, NewError(http.StatusNotFound, "") - } - // Obtain the set of candidate methods (Routes) - routes := r.selectRoutes(dispatcher, finalMatch) - if len(routes) == 0 { - return dispatcher, nil, NewError(http.StatusNotFound, "404: Page Not Found") - } - - // Identify the method (Route) that will handle the request - route, ok := r.detectRoute(routes, httpRequest) - return dispatcher, route, ok -} - -// ExtractParameters is used to obtain the path parameters from the route using the same matching -// engine as the JSR 311 router. -func (r RouterJSR311) ExtractParameters(route *Route, webService *WebService, urlPath string) map[string]string { - webServiceExpr := webService.pathExpr - webServiceMatches := webServiceExpr.Matcher.FindStringSubmatch(urlPath) - pathParameters := r.extractParams(webServiceExpr, webServiceMatches) - routeExpr := route.pathExpr - routeMatches := routeExpr.Matcher.FindStringSubmatch(webServiceMatches[len(webServiceMatches)-1]) - routeParams := r.extractParams(routeExpr, routeMatches) - for key, value := range routeParams { - pathParameters[key] = value - } - return pathParameters -} - -func (RouterJSR311) extractParams(pathExpr *pathExpression, matches []string) map[string]string { - params := map[string]string{} - for i := 1; i < len(matches); i++ { - if len(pathExpr.VarNames) >= i { - params[pathExpr.VarNames[i-1]] = matches[i] - } - } - return params -} - -// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2 -func (r RouterJSR311) detectRoute(routes []Route, httpRequest *http.Request) (*Route, error) { - candidates := make([]*Route, 0, 8) - for i, each := range routes { - ok := true - for _, fn := range each.If { - if !fn(httpRequest) { - ok = false - break - } - } - if ok { - candidates = append(candidates, &routes[i]) - } - } - if len(candidates) == 0 { - if trace { - traceLogger.Printf("no Route found (from %d) that passes conditional checks", len(routes)) - } - return nil, NewError(http.StatusNotFound, "404: Not Found") - } - - // http method - previous := candidates - candidates = candidates[:0] - for _, each := range previous { - if httpRequest.Method == each.Method { - candidates = append(candidates, each) - } - } - if len(candidates) == 0 { - if trace { - traceLogger.Printf("no Route found (in %d routes) that matches HTTP method %s\n", len(previous), httpRequest.Method) - } - return nil, NewError(http.StatusMethodNotAllowed, "405: Method Not Allowed") - } - - // content-type - contentType := httpRequest.Header.Get(HEADER_ContentType) - previous = candidates - candidates = candidates[:0] - for _, each := range previous { - if each.matchesContentType(contentType) { - candidates = append(candidates, each) - } - } - if len(candidates) == 0 { - if trace { - traceLogger.Printf("no Route found (from %d) that matches HTTP Content-Type: %s\n", len(previous), contentType) - } - if httpRequest.ContentLength > 0 { - return nil, NewError(http.StatusUnsupportedMediaType, "415: Unsupported Media Type") - } - } - - // accept - previous = candidates - candidates = candidates[:0] - accept := httpRequest.Header.Get(HEADER_Accept) - if len(accept) == 0 { - accept = "*/*" - } - for _, each := range previous { - if each.matchesAccept(accept) { - candidates = append(candidates, each) - } - } - if len(candidates) == 0 { - if trace { - traceLogger.Printf("no Route found (from %d) that matches HTTP Accept: %s\n", len(previous), accept) - } - return nil, NewError(http.StatusNotAcceptable, "406: Not Acceptable") - } - // return r.bestMatchByMedia(outputMediaOk, contentType, accept), nil - return candidates[0], nil -} - -// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2 -// n/m > n/* > */* -func (r RouterJSR311) bestMatchByMedia(routes []Route, contentType string, accept string) *Route { - // TODO - return &routes[0] -} - -// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2 (step 2) -func (r RouterJSR311) selectRoutes(dispatcher *WebService, pathRemainder string) []Route { - filtered := &sortableRouteCandidates{} - for _, each := range dispatcher.Routes() { - pathExpr := each.pathExpr - matches := pathExpr.Matcher.FindStringSubmatch(pathRemainder) - if matches != nil { - lastMatch := matches[len(matches)-1] - if len(lastMatch) == 0 || lastMatch == "/" { // do not include if value is neither empty nor ‘/’. - filtered.candidates = append(filtered.candidates, - routeCandidate{each, len(matches) - 1, pathExpr.LiteralCount, pathExpr.VarCount}) - } - } - } - if len(filtered.candidates) == 0 { - if trace { - traceLogger.Printf("WebService on path %s has no routes that match URL path remainder:%s\n", dispatcher.rootPath, pathRemainder) - } - return []Route{} - } - sort.Sort(sort.Reverse(filtered)) - - // select other routes from candidates whoes expression matches rmatch - matchingRoutes := []Route{filtered.candidates[0].route} - for c := 1; c < len(filtered.candidates); c++ { - each := filtered.candidates[c] - if each.route.pathExpr.Matcher.MatchString(pathRemainder) { - matchingRoutes = append(matchingRoutes, each.route) - } - } - return matchingRoutes -} - -// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2 (step 1) -func (r RouterJSR311) detectDispatcher(requestPath string, dispatchers []*WebService) (*WebService, string, error) { - filtered := &sortableDispatcherCandidates{} - for _, each := range dispatchers { - matches := each.pathExpr.Matcher.FindStringSubmatch(requestPath) - if matches != nil { - filtered.candidates = append(filtered.candidates, - dispatcherCandidate{each, matches[len(matches)-1], len(matches), each.pathExpr.LiteralCount, each.pathExpr.VarCount}) - } - } - if len(filtered.candidates) == 0 { - if trace { - traceLogger.Printf("no WebService was found to match URL path:%s\n", requestPath) - } - return nil, "", errors.New("not found") - } - sort.Sort(sort.Reverse(filtered)) - return filtered.candidates[0].dispatcher, filtered.candidates[0].finalMatch, nil -} - -// Types and functions to support the sorting of Routes - -type routeCandidate struct { - route Route - matchesCount int // the number of capturing groups - literalCount int // the number of literal characters (means those not resulting from template variable substitution) - nonDefaultCount int // the number of capturing groups with non-default regular expressions (i.e. not ‘([^ /]+?)’) -} - -func (r routeCandidate) expressionToMatch() string { - return r.route.pathExpr.Source -} - -func (r routeCandidate) String() string { - return fmt.Sprintf("(m=%d,l=%d,n=%d)", r.matchesCount, r.literalCount, r.nonDefaultCount) -} - -type sortableRouteCandidates struct { - candidates []routeCandidate -} - -func (rcs *sortableRouteCandidates) Len() int { - return len(rcs.candidates) -} -func (rcs *sortableRouteCandidates) Swap(i, j int) { - rcs.candidates[i], rcs.candidates[j] = rcs.candidates[j], rcs.candidates[i] -} -func (rcs *sortableRouteCandidates) Less(i, j int) bool { - ci := rcs.candidates[i] - cj := rcs.candidates[j] - // primary key - if ci.literalCount < cj.literalCount { - return true - } - if ci.literalCount > cj.literalCount { - return false - } - // secundary key - if ci.matchesCount < cj.matchesCount { - return true - } - if ci.matchesCount > cj.matchesCount { - return false - } - // tertiary key - if ci.nonDefaultCount < cj.nonDefaultCount { - return true - } - if ci.nonDefaultCount > cj.nonDefaultCount { - return false - } - // quaternary key ("source" is interpreted as Path) - return ci.route.Path < cj.route.Path -} - -// Types and functions to support the sorting of Dispatchers - -type dispatcherCandidate struct { - dispatcher *WebService - finalMatch string - matchesCount int // the number of capturing groups - literalCount int // the number of literal characters (means those not resulting from template variable substitution) - nonDefaultCount int // the number of capturing groups with non-default regular expressions (i.e. not ‘([^ /]+?)’) -} -type sortableDispatcherCandidates struct { - candidates []dispatcherCandidate -} - -func (dc *sortableDispatcherCandidates) Len() int { - return len(dc.candidates) -} -func (dc *sortableDispatcherCandidates) Swap(i, j int) { - dc.candidates[i], dc.candidates[j] = dc.candidates[j], dc.candidates[i] -} -func (dc *sortableDispatcherCandidates) Less(i, j int) bool { - ci := dc.candidates[i] - cj := dc.candidates[j] - // primary key - if ci.matchesCount < cj.matchesCount { - return true - } - if ci.matchesCount > cj.matchesCount { - return false - } - // secundary key - if ci.literalCount < cj.literalCount { - return true - } - if ci.literalCount > cj.literalCount { - return false - } - // tertiary key - return ci.nonDefaultCount < cj.nonDefaultCount -} diff --git a/vendor/github.com/emicklei/go-restful/log/log.go b/vendor/github.com/emicklei/go-restful/log/log.go deleted file mode 100644 index 6cd44c7..0000000 --- a/vendor/github.com/emicklei/go-restful/log/log.go +++ /dev/null @@ -1,34 +0,0 @@ -package log - -import ( - stdlog "log" - "os" -) - -// StdLogger corresponds to a minimal subset of the interface satisfied by stdlib log.Logger -type StdLogger interface { - Print(v ...interface{}) - Printf(format string, v ...interface{}) -} - -var Logger StdLogger - -func init() { - // default Logger - SetLogger(stdlog.New(os.Stderr, "[restful] ", stdlog.LstdFlags|stdlog.Lshortfile)) -} - -// SetLogger sets the logger for this package -func SetLogger(customLogger StdLogger) { - Logger = customLogger -} - -// Print delegates to the Logger -func Print(v ...interface{}) { - Logger.Print(v...) -} - -// Printf delegates to the Logger -func Printf(format string, v ...interface{}) { - Logger.Printf(format, v...) -} diff --git a/vendor/github.com/emicklei/go-restful/logger.go b/vendor/github.com/emicklei/go-restful/logger.go deleted file mode 100644 index 6595df0..0000000 --- a/vendor/github.com/emicklei/go-restful/logger.go +++ /dev/null @@ -1,32 +0,0 @@ -package restful - -// Copyright 2014 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. -import ( - "github.com/emicklei/go-restful/log" -) - -var trace bool = false -var traceLogger log.StdLogger - -func init() { - traceLogger = log.Logger // use the package logger by default -} - -// TraceLogger enables detailed logging of Http request matching and filter invocation. Default no logger is set. -// You may call EnableTracing() directly to enable trace logging to the package-wide logger. -func TraceLogger(logger log.StdLogger) { - traceLogger = logger - EnableTracing(logger != nil) -} - -// SetLogger exposes the setter for the global logger on the top-level package -func SetLogger(customLogger log.StdLogger) { - log.SetLogger(customLogger) -} - -// EnableTracing can be used to Trace logging on and off. -func EnableTracing(enabled bool) { - trace = enabled -} diff --git a/vendor/github.com/emicklei/go-restful/mime.go b/vendor/github.com/emicklei/go-restful/mime.go deleted file mode 100644 index 3301447..0000000 --- a/vendor/github.com/emicklei/go-restful/mime.go +++ /dev/null @@ -1,50 +0,0 @@ -package restful - -import ( - "strconv" - "strings" -) - -type mime struct { - media string - quality float64 -} - -// insertMime adds a mime to a list and keeps it sorted by quality. -func insertMime(l []mime, e mime) []mime { - for i, each := range l { - // if current mime has lower quality then insert before - if e.quality > each.quality { - left := append([]mime{}, l[0:i]...) - return append(append(left, e), l[i:]...) - } - } - return append(l, e) -} - -const qFactorWeightingKey = "q" - -// sortedMimes returns a list of mime sorted (desc) by its specified quality. -// e.g. text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3 -func sortedMimes(accept string) (sorted []mime) { - for _, each := range strings.Split(accept, ",") { - typeAndQuality := strings.Split(strings.Trim(each, " "), ";") - if len(typeAndQuality) == 1 { - sorted = insertMime(sorted, mime{typeAndQuality[0], 1.0}) - } else { - // take factor - qAndWeight := strings.Split(typeAndQuality[1], "=") - if len(qAndWeight) == 2 && strings.Trim(qAndWeight[0], " ") == qFactorWeightingKey { - f, err := strconv.ParseFloat(qAndWeight[1], 64) - if err != nil { - traceLogger.Printf("unable to parse quality in %s, %v", each, err) - } else { - sorted = insertMime(sorted, mime{typeAndQuality[0], f}) - } - } else { - sorted = insertMime(sorted, mime{typeAndQuality[0], 1.0}) - } - } - } - return -} diff --git a/vendor/github.com/emicklei/go-restful/options_filter.go b/vendor/github.com/emicklei/go-restful/options_filter.go deleted file mode 100644 index 5c1b342..0000000 --- a/vendor/github.com/emicklei/go-restful/options_filter.go +++ /dev/null @@ -1,34 +0,0 @@ -package restful - -import "strings" - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -// OPTIONSFilter is a filter function that inspects the Http Request for the OPTIONS method -// and provides the response with a set of allowed methods for the request URL Path. -// As for any filter, you can also install it for a particular WebService within a Container. -// Note: this filter is not needed when using CrossOriginResourceSharing (for CORS). -func (c *Container) OPTIONSFilter(req *Request, resp *Response, chain *FilterChain) { - if "OPTIONS" != req.Request.Method { - chain.ProcessFilter(req, resp) - return - } - - archs := req.Request.Header.Get(HEADER_AccessControlRequestHeaders) - methods := strings.Join(c.computeAllowedMethods(req), ",") - origin := req.Request.Header.Get(HEADER_Origin) - - resp.AddHeader(HEADER_Allow, methods) - resp.AddHeader(HEADER_AccessControlAllowOrigin, origin) - resp.AddHeader(HEADER_AccessControlAllowHeaders, archs) - resp.AddHeader(HEADER_AccessControlAllowMethods, methods) -} - -// OPTIONSFilter is a filter function that inspects the Http Request for the OPTIONS method -// and provides the response with a set of allowed methods for the request URL Path. -// Note: this filter is not needed when using CrossOriginResourceSharing (for CORS). -func OPTIONSFilter() FilterFunction { - return DefaultContainer.OPTIONSFilter -} diff --git a/vendor/github.com/emicklei/go-restful/parameter.go b/vendor/github.com/emicklei/go-restful/parameter.go deleted file mode 100644 index e879330..0000000 --- a/vendor/github.com/emicklei/go-restful/parameter.go +++ /dev/null @@ -1,143 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -const ( - // PathParameterKind = indicator of Request parameter type "path" - PathParameterKind = iota - - // QueryParameterKind = indicator of Request parameter type "query" - QueryParameterKind - - // BodyParameterKind = indicator of Request parameter type "body" - BodyParameterKind - - // HeaderParameterKind = indicator of Request parameter type "header" - HeaderParameterKind - - // FormParameterKind = indicator of Request parameter type "form" - FormParameterKind - - // CollectionFormatCSV comma separated values `foo,bar` - CollectionFormatCSV = CollectionFormat("csv") - - // CollectionFormatSSV space separated values `foo bar` - CollectionFormatSSV = CollectionFormat("ssv") - - // CollectionFormatTSV tab separated values `foo\tbar` - CollectionFormatTSV = CollectionFormat("tsv") - - // CollectionFormatPipes pipe separated values `foo|bar` - CollectionFormatPipes = CollectionFormat("pipes") - - // CollectionFormatMulti corresponds to multiple parameter instances instead of multiple values for a single - // instance `foo=bar&foo=baz`. This is valid only for QueryParameters and FormParameters - CollectionFormatMulti = CollectionFormat("multi") -) - -type CollectionFormat string - -func (cf CollectionFormat) String() string { - return string(cf) -} - -// Parameter is for documententing the parameter used in a Http Request -// ParameterData kinds are Path,Query and Body -type Parameter struct { - data *ParameterData -} - -// ParameterData represents the state of a Parameter. -// It is made public to make it accessible to e.g. the Swagger package. -type ParameterData struct { - Name, Description, DataType, DataFormat string - Kind int - Required bool - AllowableValues map[string]string - AllowMultiple bool - DefaultValue string - CollectionFormat string -} - -// Data returns the state of the Parameter -func (p *Parameter) Data() ParameterData { - return *p.data -} - -// Kind returns the parameter type indicator (see const for valid values) -func (p *Parameter) Kind() int { - return p.data.Kind -} - -func (p *Parameter) bePath() *Parameter { - p.data.Kind = PathParameterKind - return p -} -func (p *Parameter) beQuery() *Parameter { - p.data.Kind = QueryParameterKind - return p -} -func (p *Parameter) beBody() *Parameter { - p.data.Kind = BodyParameterKind - return p -} - -func (p *Parameter) beHeader() *Parameter { - p.data.Kind = HeaderParameterKind - return p -} - -func (p *Parameter) beForm() *Parameter { - p.data.Kind = FormParameterKind - return p -} - -// Required sets the required field and returns the receiver -func (p *Parameter) Required(required bool) *Parameter { - p.data.Required = required - return p -} - -// AllowMultiple sets the allowMultiple field and returns the receiver -func (p *Parameter) AllowMultiple(multiple bool) *Parameter { - p.data.AllowMultiple = multiple - return p -} - -// AllowableValues sets the allowableValues field and returns the receiver -func (p *Parameter) AllowableValues(values map[string]string) *Parameter { - p.data.AllowableValues = values - return p -} - -// DataType sets the dataType field and returns the receiver -func (p *Parameter) DataType(typeName string) *Parameter { - p.data.DataType = typeName - return p -} - -// DataFormat sets the dataFormat field for Swagger UI -func (p *Parameter) DataFormat(formatName string) *Parameter { - p.data.DataFormat = formatName - return p -} - -// DefaultValue sets the default value field and returns the receiver -func (p *Parameter) DefaultValue(stringRepresentation string) *Parameter { - p.data.DefaultValue = stringRepresentation - return p -} - -// Description sets the description value field and returns the receiver -func (p *Parameter) Description(doc string) *Parameter { - p.data.Description = doc - return p -} - -// CollectionFormat sets the collection format for an array type -func (p *Parameter) CollectionFormat(format CollectionFormat) *Parameter { - p.data.CollectionFormat = format.String() - return p -} diff --git a/vendor/github.com/emicklei/go-restful/path_expression.go b/vendor/github.com/emicklei/go-restful/path_expression.go deleted file mode 100644 index 95a9a25..0000000 --- a/vendor/github.com/emicklei/go-restful/path_expression.go +++ /dev/null @@ -1,74 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "bytes" - "fmt" - "regexp" - "strings" -) - -// PathExpression holds a compiled path expression (RegExp) needed to match against -// Http request paths and to extract path parameter values. -type pathExpression struct { - LiteralCount int // the number of literal characters (means those not resulting from template variable substitution) - VarNames []string // the names of parameters (enclosed by {}) in the path - VarCount int // the number of named parameters (enclosed by {}) in the path - Matcher *regexp.Regexp - Source string // Path as defined by the RouteBuilder - tokens []string -} - -// NewPathExpression creates a PathExpression from the input URL path. -// Returns an error if the path is invalid. -func newPathExpression(path string) (*pathExpression, error) { - expression, literalCount, varNames, varCount, tokens := templateToRegularExpression(path) - compiled, err := regexp.Compile(expression) - if err != nil { - return nil, err - } - return &pathExpression{literalCount, varNames, varCount, compiled, expression, tokens}, nil -} - -// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-370003.7.3 -func templateToRegularExpression(template string) (expression string, literalCount int, varNames []string, varCount int, tokens []string) { - var buffer bytes.Buffer - buffer.WriteString("^") - //tokens = strings.Split(template, "/") - tokens = tokenizePath(template) - for _, each := range tokens { - if each == "" { - continue - } - buffer.WriteString("/") - if strings.HasPrefix(each, "{") { - // check for regular expression in variable - colon := strings.Index(each, ":") - var varName string - if colon != -1 { - // extract expression - varName = strings.TrimSpace(each[1:colon]) - paramExpr := strings.TrimSpace(each[colon+1 : len(each)-1]) - if paramExpr == "*" { // special case - buffer.WriteString("(.*)") - } else { - buffer.WriteString(fmt.Sprintf("(%s)", paramExpr)) // between colon and closing moustache - } - } else { - // plain var - varName = strings.TrimSpace(each[1 : len(each)-1]) - buffer.WriteString("([^/]+?)") - } - varNames = append(varNames, varName) - varCount += 1 - } else { - literalCount += len(each) - encoded := each // TODO URI encode - buffer.WriteString(regexp.QuoteMeta(encoded)) - } - } - return strings.TrimRight(buffer.String(), "/") + "(/.*)?$", literalCount, varNames, varCount, tokens -} diff --git a/vendor/github.com/emicklei/go-restful/path_processor.go b/vendor/github.com/emicklei/go-restful/path_processor.go deleted file mode 100644 index 1415732..0000000 --- a/vendor/github.com/emicklei/go-restful/path_processor.go +++ /dev/null @@ -1,74 +0,0 @@ -package restful - -import ( - "bytes" - "strings" -) - -// Copyright 2018 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -// PathProcessor is extra behaviour that a Router can provide to extract path parameters from the path. -// If a Router does not implement this interface then the default behaviour will be used. -type PathProcessor interface { - // ExtractParameters gets the path parameters defined in the route and webService from the urlPath - ExtractParameters(route *Route, webService *WebService, urlPath string) map[string]string -} - -type defaultPathProcessor struct{} - -// Extract the parameters from the request url path -func (d defaultPathProcessor) ExtractParameters(r *Route, _ *WebService, urlPath string) map[string]string { - urlParts := tokenizePath(urlPath) - pathParameters := map[string]string{} - for i, key := range r.pathParts { - var value string - if i >= len(urlParts) { - value = "" - } else { - value = urlParts[i] - } - if r.hasCustomVerb && hasCustomVerb(key) { - key = removeCustomVerb(key) - value = removeCustomVerb(value) - } - - if strings.Index(key, "{") > -1 { // path-parameter - if colon := strings.Index(key, ":"); colon != -1 { - // extract by regex - regPart := key[colon+1 : len(key)-1] - keyPart := key[1:colon] - if regPart == "*" { - pathParameters[keyPart] = untokenizePath(i, urlParts) - break - } else { - pathParameters[keyPart] = value - } - } else { - // without enclosing {} - startIndex := strings.Index(key, "{") - endKeyIndex := strings.Index(key, "}") - - suffixLength := len(key) - endKeyIndex - 1 - endValueIndex := len(value) - suffixLength - - pathParameters[key[startIndex+1:endKeyIndex]] = value[startIndex:endValueIndex] - } - } - } - return pathParameters -} - -// Untokenize back into an URL path using the slash separator -func untokenizePath(offset int, parts []string) string { - var buffer bytes.Buffer - for p := offset; p < len(parts); p++ { - buffer.WriteString(parts[p]) - // do not end - if p < len(parts)-1 { - buffer.WriteString("/") - } - } - return buffer.String() -} diff --git a/vendor/github.com/emicklei/go-restful/request.go b/vendor/github.com/emicklei/go-restful/request.go deleted file mode 100644 index a20730f..0000000 --- a/vendor/github.com/emicklei/go-restful/request.go +++ /dev/null @@ -1,118 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "compress/zlib" - "net/http" -) - -var defaultRequestContentType string - -// Request is a wrapper for a http Request that provides convenience methods -type Request struct { - Request *http.Request - pathParameters map[string]string - attributes map[string]interface{} // for storing request-scoped values - selectedRoutePath string // root path + route path that matched the request, e.g. /meetings/{id}/attendees -} - -func NewRequest(httpRequest *http.Request) *Request { - return &Request{ - Request: httpRequest, - pathParameters: map[string]string{}, - attributes: map[string]interface{}{}, - } // empty parameters, attributes -} - -// If ContentType is missing or */* is given then fall back to this type, otherwise -// a "Unable to unmarshal content of type:" response is returned. -// Valid values are restful.MIME_JSON and restful.MIME_XML -// Example: -// restful.DefaultRequestContentType(restful.MIME_JSON) -func DefaultRequestContentType(mime string) { - defaultRequestContentType = mime -} - -// PathParameter accesses the Path parameter value by its name -func (r *Request) PathParameter(name string) string { - return r.pathParameters[name] -} - -// PathParameters accesses the Path parameter values -func (r *Request) PathParameters() map[string]string { - return r.pathParameters -} - -// QueryParameter returns the (first) Query parameter value by its name -func (r *Request) QueryParameter(name string) string { - return r.Request.FormValue(name) -} - -// QueryParameters returns the all the query parameters values by name -func (r *Request) QueryParameters(name string) []string { - return r.Request.URL.Query()[name] -} - -// BodyParameter parses the body of the request (once for typically a POST or a PUT) and returns the value of the given name or an error. -func (r *Request) BodyParameter(name string) (string, error) { - err := r.Request.ParseForm() - if err != nil { - return "", err - } - return r.Request.PostFormValue(name), nil -} - -// HeaderParameter returns the HTTP Header value of a Header name or empty if missing -func (r *Request) HeaderParameter(name string) string { - return r.Request.Header.Get(name) -} - -// ReadEntity checks the Accept header and reads the content into the entityPointer. -func (r *Request) ReadEntity(entityPointer interface{}) (err error) { - contentType := r.Request.Header.Get(HEADER_ContentType) - contentEncoding := r.Request.Header.Get(HEADER_ContentEncoding) - - // check if the request body needs decompression - if ENCODING_GZIP == contentEncoding { - gzipReader := currentCompressorProvider.AcquireGzipReader() - defer currentCompressorProvider.ReleaseGzipReader(gzipReader) - gzipReader.Reset(r.Request.Body) - r.Request.Body = gzipReader - } else if ENCODING_DEFLATE == contentEncoding { - zlibReader, err := zlib.NewReader(r.Request.Body) - if err != nil { - return err - } - r.Request.Body = zlibReader - } - - // lookup the EntityReader, use defaultRequestContentType if needed and provided - entityReader, ok := entityAccessRegistry.accessorAt(contentType) - if !ok { - if len(defaultRequestContentType) != 0 { - entityReader, ok = entityAccessRegistry.accessorAt(defaultRequestContentType) - } - if !ok { - return NewError(http.StatusBadRequest, "Unable to unmarshal content of type:"+contentType) - } - } - return entityReader.Read(r, entityPointer) -} - -// SetAttribute adds or replaces the attribute with the given value. -func (r *Request) SetAttribute(name string, value interface{}) { - r.attributes[name] = value -} - -// Attribute returns the value associated to the given name. Returns nil if absent. -func (r Request) Attribute(name string) interface{} { - return r.attributes[name] -} - -// SelectedRoutePath root path + route path that matched the request, e.g. /meetings/{id}/attendees -func (r Request) SelectedRoutePath() string { - return r.selectedRoutePath -} diff --git a/vendor/github.com/emicklei/go-restful/response.go b/vendor/github.com/emicklei/go-restful/response.go deleted file mode 100644 index e2f78f0..0000000 --- a/vendor/github.com/emicklei/go-restful/response.go +++ /dev/null @@ -1,256 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "bufio" - "errors" - "net" - "net/http" -) - -// DefaultResponseMimeType is DEPRECATED, use DefaultResponseContentType(mime) -var DefaultResponseMimeType string - -//PrettyPrintResponses controls the indentation feature of XML and JSON serialization -var PrettyPrintResponses = true - -// Response is a wrapper on the actual http ResponseWriter -// It provides several convenience methods to prepare and write response content. -type Response struct { - http.ResponseWriter - requestAccept string // mime-type what the Http Request says it wants to receive - routeProduces []string // mime-types what the Route says it can produce - statusCode int // HTTP status code that has been written explicitly (if zero then net/http has written 200) - contentLength int // number of bytes written for the response body - prettyPrint bool // controls the indentation feature of XML and JSON serialization. It is initialized using var PrettyPrintResponses. - err error // err property is kept when WriteError is called - hijacker http.Hijacker // if underlying ResponseWriter supports it -} - -// NewResponse creates a new response based on a http ResponseWriter. -func NewResponse(httpWriter http.ResponseWriter) *Response { - hijacker, _ := httpWriter.(http.Hijacker) - return &Response{ResponseWriter: httpWriter, routeProduces: []string{}, statusCode: http.StatusOK, prettyPrint: PrettyPrintResponses, hijacker: hijacker} -} - -// DefaultResponseContentType set a default. -// If Accept header matching fails, fall back to this type. -// Valid values are restful.MIME_JSON and restful.MIME_XML -// Example: -// restful.DefaultResponseContentType(restful.MIME_JSON) -func DefaultResponseContentType(mime string) { - DefaultResponseMimeType = mime -} - -// InternalServerError writes the StatusInternalServerError header. -// DEPRECATED, use WriteErrorString(http.StatusInternalServerError,reason) -func (r Response) InternalServerError() Response { - r.WriteHeader(http.StatusInternalServerError) - return r -} - -// Hijack implements the http.Hijacker interface. This expands -// the Response to fulfill http.Hijacker if the underlying -// http.ResponseWriter supports it. -func (r *Response) Hijack() (net.Conn, *bufio.ReadWriter, error) { - if r.hijacker == nil { - return nil, nil, errors.New("http.Hijacker not implemented by underlying http.ResponseWriter") - } - return r.hijacker.Hijack() -} - -// PrettyPrint changes whether this response must produce pretty (line-by-line, indented) JSON or XML output. -func (r *Response) PrettyPrint(bePretty bool) { - r.prettyPrint = bePretty -} - -// AddHeader is a shortcut for .Header().Add(header,value) -func (r Response) AddHeader(header string, value string) Response { - r.Header().Add(header, value) - return r -} - -// SetRequestAccepts tells the response what Mime-type(s) the HTTP request said it wants to accept. Exposed for testing. -func (r *Response) SetRequestAccepts(mime string) { - r.requestAccept = mime -} - -// EntityWriter returns the registered EntityWriter that the entity (requested resource) -// can write according to what the request wants (Accept) and what the Route can produce or what the restful defaults say. -// If called before WriteEntity and WriteHeader then a false return value can be used to write a 406: Not Acceptable. -func (r *Response) EntityWriter() (EntityReaderWriter, bool) { - sorted := sortedMimes(r.requestAccept) - for _, eachAccept := range sorted { - for _, eachProduce := range r.routeProduces { - if eachProduce == eachAccept.media { - if w, ok := entityAccessRegistry.accessorAt(eachAccept.media); ok { - return w, true - } - } - } - if eachAccept.media == "*/*" { - for _, each := range r.routeProduces { - if w, ok := entityAccessRegistry.accessorAt(each); ok { - return w, true - } - } - } - } - // if requestAccept is empty - writer, ok := entityAccessRegistry.accessorAt(r.requestAccept) - if !ok { - // if not registered then fallback to the defaults (if set) - if DefaultResponseMimeType == MIME_JSON { - return entityAccessRegistry.accessorAt(MIME_JSON) - } - if DefaultResponseMimeType == MIME_XML { - return entityAccessRegistry.accessorAt(MIME_XML) - } - // Fallback to whatever the route says it can produce. - // https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html - for _, each := range r.routeProduces { - if w, ok := entityAccessRegistry.accessorAt(each); ok { - return w, true - } - } - if trace { - traceLogger.Printf("no registered EntityReaderWriter found for %s", r.requestAccept) - } - } - return writer, ok -} - -// WriteEntity calls WriteHeaderAndEntity with Http Status OK (200) -func (r *Response) WriteEntity(value interface{}) error { - return r.WriteHeaderAndEntity(http.StatusOK, value) -} - -// WriteHeaderAndEntity marshals the value using the representation denoted by the Accept Header and the registered EntityWriters. -// If no Accept header is specified (or */*) then respond with the Content-Type as specified by the first in the Route.Produces. -// If an Accept header is specified then respond with the Content-Type as specified by the first in the Route.Produces that is matched with the Accept header. -// If the value is nil then no response is send except for the Http status. You may want to call WriteHeader(http.StatusNotFound) instead. -// If there is no writer available that can represent the value in the requested MIME type then Http Status NotAcceptable is written. -// Current implementation ignores any q-parameters in the Accept Header. -// Returns an error if the value could not be written on the response. -func (r *Response) WriteHeaderAndEntity(status int, value interface{}) error { - writer, ok := r.EntityWriter() - if !ok { - r.WriteHeader(http.StatusNotAcceptable) - return nil - } - return writer.Write(r, status, value) -} - -// WriteAsXml is a convenience method for writing a value in xml (requires Xml tags on the value) -// It uses the standard encoding/xml package for marshalling the value ; not using a registered EntityReaderWriter. -func (r *Response) WriteAsXml(value interface{}) error { - return writeXML(r, http.StatusOK, MIME_XML, value) -} - -// WriteHeaderAndXml is a convenience method for writing a status and value in xml (requires Xml tags on the value) -// It uses the standard encoding/xml package for marshalling the value ; not using a registered EntityReaderWriter. -func (r *Response) WriteHeaderAndXml(status int, value interface{}) error { - return writeXML(r, status, MIME_XML, value) -} - -// WriteAsJson is a convenience method for writing a value in json. -// It uses the standard encoding/json package for marshalling the value ; not using a registered EntityReaderWriter. -func (r *Response) WriteAsJson(value interface{}) error { - return writeJSON(r, http.StatusOK, MIME_JSON, value) -} - -// WriteJson is a convenience method for writing a value in Json with a given Content-Type. -// It uses the standard encoding/json package for marshalling the value ; not using a registered EntityReaderWriter. -func (r *Response) WriteJson(value interface{}, contentType string) error { - return writeJSON(r, http.StatusOK, contentType, value) -} - -// WriteHeaderAndJson is a convenience method for writing the status and a value in Json with a given Content-Type. -// It uses the standard encoding/json package for marshalling the value ; not using a registered EntityReaderWriter. -func (r *Response) WriteHeaderAndJson(status int, value interface{}, contentType string) error { - return writeJSON(r, status, contentType, value) -} - -// WriteError writes the http status and the error string on the response. err can be nil. -// Return an error if writing was not succesful. -func (r *Response) WriteError(httpStatus int, err error) (writeErr error) { - r.err = err - if err == nil { - writeErr = r.WriteErrorString(httpStatus, "") - } else { - writeErr = r.WriteErrorString(httpStatus, err.Error()) - } - return writeErr -} - -// WriteServiceError is a convenience method for a responding with a status and a ServiceError -func (r *Response) WriteServiceError(httpStatus int, err ServiceError) error { - r.err = err - return r.WriteHeaderAndEntity(httpStatus, err) -} - -// WriteErrorString is a convenience method for an error status with the actual error -func (r *Response) WriteErrorString(httpStatus int, errorReason string) error { - if r.err == nil { - // if not called from WriteError - r.err = errors.New(errorReason) - } - r.WriteHeader(httpStatus) - if _, err := r.Write([]byte(errorReason)); err != nil { - return err - } - return nil -} - -// Flush implements http.Flusher interface, which sends any buffered data to the client. -func (r *Response) Flush() { - if f, ok := r.ResponseWriter.(http.Flusher); ok { - f.Flush() - } else if trace { - traceLogger.Printf("ResponseWriter %v doesn't support Flush", r) - } -} - -// WriteHeader is overridden to remember the Status Code that has been written. -// Changes to the Header of the response have no effect after this. -func (r *Response) WriteHeader(httpStatus int) { - r.statusCode = httpStatus - r.ResponseWriter.WriteHeader(httpStatus) -} - -// StatusCode returns the code that has been written using WriteHeader. -func (r Response) StatusCode() int { - if 0 == r.statusCode { - // no status code has been written yet; assume OK - return http.StatusOK - } - return r.statusCode -} - -// Write writes the data to the connection as part of an HTTP reply. -// Write is part of http.ResponseWriter interface. -func (r *Response) Write(bytes []byte) (int, error) { - written, err := r.ResponseWriter.Write(bytes) - r.contentLength += written - return written, err -} - -// ContentLength returns the number of bytes written for the response content. -// Note that this value is only correct if all data is written through the Response using its Write* methods. -// Data written directly using the underlying http.ResponseWriter is not accounted for. -func (r Response) ContentLength() int { - return r.contentLength -} - -// CloseNotify is part of http.CloseNotifier interface -func (r Response) CloseNotify() <-chan bool { - return r.ResponseWriter.(http.CloseNotifier).CloseNotify() -} - -// Error returns the err created by WriteError -func (r Response) Error() error { - return r.err -} diff --git a/vendor/github.com/emicklei/go-restful/route.go b/vendor/github.com/emicklei/go-restful/route.go deleted file mode 100644 index fbac6ca..0000000 --- a/vendor/github.com/emicklei/go-restful/route.go +++ /dev/null @@ -1,163 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "net/http" - "strings" -) - -// RouteFunction declares the signature of a function that can be bound to a Route. -type RouteFunction func(*Request, *Response) - -// RouteSelectionConditionFunction declares the signature of a function that -// can be used to add extra conditional logic when selecting whether the route -// matches the HTTP request. -type RouteSelectionConditionFunction func(httpRequest *http.Request) bool - -// Route binds a HTTP Method,Path,Consumes combination to a RouteFunction. -type Route struct { - Method string - Produces []string - Consumes []string - Path string // webservice root path + described path - Function RouteFunction - Filters []FilterFunction - If []RouteSelectionConditionFunction - - // cached values for dispatching - relativePath string - pathParts []string - pathExpr *pathExpression // cached compilation of relativePath as RegExp - - // documentation - Doc string - Notes string - Operation string - ParameterDocs []*Parameter - ResponseErrors map[int]ResponseError - DefaultResponse *ResponseError - ReadSample, WriteSample interface{} // structs that model an example request or response payload - - // Extra information used to store custom information about the route. - Metadata map[string]interface{} - - // marks a route as deprecated - Deprecated bool - - //Overrides the container.contentEncodingEnabled - contentEncodingEnabled *bool - - // indicate route path has custom verb - hasCustomVerb bool -} - -// Initialize for Route -func (r *Route) postBuild() { - r.pathParts = tokenizePath(r.Path) - r.hasCustomVerb = hasCustomVerb(r.Path) -} - -// Create Request and Response from their http versions -func (r *Route) wrapRequestResponse(httpWriter http.ResponseWriter, httpRequest *http.Request, pathParams map[string]string) (*Request, *Response) { - wrappedRequest := NewRequest(httpRequest) - wrappedRequest.pathParameters = pathParams - wrappedRequest.selectedRoutePath = r.Path - wrappedResponse := NewResponse(httpWriter) - wrappedResponse.requestAccept = httpRequest.Header.Get(HEADER_Accept) - wrappedResponse.routeProduces = r.Produces - return wrappedRequest, wrappedResponse -} - -func stringTrimSpaceCutset(r rune) bool { - return r == ' ' -} - -// Return whether the mimeType matches to what this Route can produce. -func (r Route) matchesAccept(mimeTypesWithQuality string) bool { - remaining := mimeTypesWithQuality - for { - var mimeType string - if end := strings.Index(remaining, ","); end == -1 { - mimeType, remaining = remaining, "" - } else { - mimeType, remaining = remaining[:end], remaining[end+1:] - } - if quality := strings.Index(mimeType, ";"); quality != -1 { - mimeType = mimeType[:quality] - } - mimeType = strings.TrimFunc(mimeType, stringTrimSpaceCutset) - if mimeType == "*/*" { - return true - } - for _, producibleType := range r.Produces { - if producibleType == "*/*" || producibleType == mimeType { - return true - } - } - if len(remaining) == 0 { - return false - } - } -} - -// Return whether this Route can consume content with a type specified by mimeTypes (can be empty). -func (r Route) matchesContentType(mimeTypes string) bool { - - if len(r.Consumes) == 0 { - // did not specify what it can consume ; any media type (“*/*”) is assumed - return true - } - - if len(mimeTypes) == 0 { - // idempotent methods with (most-likely or guaranteed) empty content match missing Content-Type - m := r.Method - if m == "GET" || m == "HEAD" || m == "OPTIONS" || m == "DELETE" || m == "TRACE" { - return true - } - // proceed with default - mimeTypes = MIME_OCTET - } - - remaining := mimeTypes - for { - var mimeType string - if end := strings.Index(remaining, ","); end == -1 { - mimeType, remaining = remaining, "" - } else { - mimeType, remaining = remaining[:end], remaining[end+1:] - } - if quality := strings.Index(mimeType, ";"); quality != -1 { - mimeType = mimeType[:quality] - } - mimeType = strings.TrimFunc(mimeType, stringTrimSpaceCutset) - for _, consumeableType := range r.Consumes { - if consumeableType == "*/*" || consumeableType == mimeType { - return true - } - } - if len(remaining) == 0 { - return false - } - } -} - -// Tokenize an URL path using the slash separator ; the result does not have empty tokens -func tokenizePath(path string) []string { - if "/" == path { - return nil - } - return strings.Split(strings.Trim(path, "/"), "/") -} - -// for debugging -func (r Route) String() string { - return r.Method + " " + r.Path -} - -// EnableContentEncoding (default=false) allows for GZIP or DEFLATE encoding of responses. Overrides the container.contentEncodingEnabled value. -func (r Route) EnableContentEncoding(enabled bool) { - r.contentEncodingEnabled = &enabled -} diff --git a/vendor/github.com/emicklei/go-restful/route_builder.go b/vendor/github.com/emicklei/go-restful/route_builder.go deleted file mode 100644 index 5c57c67..0000000 --- a/vendor/github.com/emicklei/go-restful/route_builder.go +++ /dev/null @@ -1,353 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "fmt" - "os" - "reflect" - "runtime" - "strings" - "sync/atomic" - - "github.com/emicklei/go-restful/log" -) - -// RouteBuilder is a helper to construct Routes. -type RouteBuilder struct { - rootPath string - currentPath string - produces []string - consumes []string - httpMethod string // required - function RouteFunction // required - filters []FilterFunction - conditions []RouteSelectionConditionFunction - - typeNameHandleFunc TypeNameHandleFunction // required - - // documentation - doc string - notes string - operation string - readSample, writeSample interface{} - parameters []*Parameter - errorMap map[int]ResponseError - defaultResponse *ResponseError - metadata map[string]interface{} - deprecated bool - contentEncodingEnabled *bool -} - -// Do evaluates each argument with the RouteBuilder itself. -// This allows you to follow DRY principles without breaking the fluent programming style. -// Example: -// ws.Route(ws.DELETE("/{name}").To(t.deletePerson).Do(Returns200, Returns500)) -// -// func Returns500(b *RouteBuilder) { -// b.Returns(500, "Internal Server Error", restful.ServiceError{}) -// } -func (b *RouteBuilder) Do(oneArgBlocks ...func(*RouteBuilder)) *RouteBuilder { - for _, each := range oneArgBlocks { - each(b) - } - return b -} - -// To bind the route to a function. -// If this route is matched with the incoming Http Request then call this function with the *Request,*Response pair. Required. -func (b *RouteBuilder) To(function RouteFunction) *RouteBuilder { - b.function = function - return b -} - -// Method specifies what HTTP method to match. Required. -func (b *RouteBuilder) Method(method string) *RouteBuilder { - b.httpMethod = method - return b -} - -// Produces specifies what MIME types can be produced ; the matched one will appear in the Content-Type Http header. -func (b *RouteBuilder) Produces(mimeTypes ...string) *RouteBuilder { - b.produces = mimeTypes - return b -} - -// Consumes specifies what MIME types can be consumes ; the Accept Http header must matched any of these -func (b *RouteBuilder) Consumes(mimeTypes ...string) *RouteBuilder { - b.consumes = mimeTypes - return b -} - -// Path specifies the relative (w.r.t WebService root path) URL path to match. Default is "/". -func (b *RouteBuilder) Path(subPath string) *RouteBuilder { - b.currentPath = subPath - return b -} - -// Doc tells what this route is all about. Optional. -func (b *RouteBuilder) Doc(documentation string) *RouteBuilder { - b.doc = documentation - return b -} - -// Notes is a verbose explanation of the operation behavior. Optional. -func (b *RouteBuilder) Notes(notes string) *RouteBuilder { - b.notes = notes - return b -} - -// Reads tells what resource type will be read from the request payload. Optional. -// A parameter of type "body" is added ,required is set to true and the dataType is set to the qualified name of the sample's type. -func (b *RouteBuilder) Reads(sample interface{}, optionalDescription ...string) *RouteBuilder { - fn := b.typeNameHandleFunc - if fn == nil { - fn = reflectTypeName - } - typeAsName := fn(sample) - description := "" - if len(optionalDescription) > 0 { - description = optionalDescription[0] - } - b.readSample = sample - bodyParameter := &Parameter{&ParameterData{Name: "body", Description: description}} - bodyParameter.beBody() - bodyParameter.Required(true) - bodyParameter.DataType(typeAsName) - b.Param(bodyParameter) - return b -} - -// ParameterNamed returns a Parameter already known to the RouteBuilder. Returns nil if not. -// Use this to modify or extend information for the Parameter (through its Data()). -func (b RouteBuilder) ParameterNamed(name string) (p *Parameter) { - for _, each := range b.parameters { - if each.Data().Name == name { - return each - } - } - return p -} - -// Writes tells what resource type will be written as the response payload. Optional. -func (b *RouteBuilder) Writes(sample interface{}) *RouteBuilder { - b.writeSample = sample - return b -} - -// Param allows you to document the parameters of the Route. It adds a new Parameter (does not check for duplicates). -func (b *RouteBuilder) Param(parameter *Parameter) *RouteBuilder { - if b.parameters == nil { - b.parameters = []*Parameter{} - } - b.parameters = append(b.parameters, parameter) - return b -} - -// Operation allows you to document what the actual method/function call is of the Route. -// Unless called, the operation name is derived from the RouteFunction set using To(..). -func (b *RouteBuilder) Operation(name string) *RouteBuilder { - b.operation = name - return b -} - -// ReturnsError is deprecated, use Returns instead. -func (b *RouteBuilder) ReturnsError(code int, message string, model interface{}) *RouteBuilder { - log.Print("ReturnsError is deprecated, use Returns instead.") - return b.Returns(code, message, model) -} - -// Returns allows you to document what responses (errors or regular) can be expected. -// The model parameter is optional ; either pass a struct instance or use nil if not applicable. -func (b *RouteBuilder) Returns(code int, message string, model interface{}) *RouteBuilder { - err := ResponseError{ - Code: code, - Message: message, - Model: model, - IsDefault: false, // this field is deprecated, use default response instead. - } - // lazy init because there is no NewRouteBuilder (yet) - if b.errorMap == nil { - b.errorMap = map[int]ResponseError{} - } - b.errorMap[code] = err - return b -} - -// ReturnsWithHeaders is similar to Returns, but can specify response headers -func (b *RouteBuilder) ReturnsWithHeaders(code int, message string, model interface{}, headers map[string]Header) *RouteBuilder { - b.Returns(code, message, model) - err := b.errorMap[code] - err.Headers = headers - b.errorMap[code] = err - return b -} - -// DefaultReturns is a special Returns call that sets the default of the response. -func (b *RouteBuilder) DefaultReturns(message string, model interface{}) *RouteBuilder { - b.defaultResponse = &ResponseError{ - Message: message, - Model: model, - } - return b -} - -// Metadata adds or updates a key=value pair to the metadata map. -func (b *RouteBuilder) Metadata(key string, value interface{}) *RouteBuilder { - if b.metadata == nil { - b.metadata = map[string]interface{}{} - } - b.metadata[key] = value - return b -} - -// Deprecate sets the value of deprecated to true. Deprecated routes have a special UI treatment to warn against use -func (b *RouteBuilder) Deprecate() *RouteBuilder { - b.deprecated = true - return b -} - -// ResponseError represents a response; not necessarily an error. -type ResponseError struct { - Code int - Message string - Model interface{} - Headers map[string]Header - IsDefault bool -} - -// Header describes a header for a response of the API -// -// For more information: http://goo.gl/8us55a#headerObject -type Header struct { - *Items - Description string -} - -// Items describe swagger simple schemas for headers -type Items struct { - Type string - Format string - Items *Items - CollectionFormat string - Default interface{} -} - -func (b *RouteBuilder) servicePath(path string) *RouteBuilder { - b.rootPath = path - return b -} - -// Filter appends a FilterFunction to the end of filters for this Route to build. -func (b *RouteBuilder) Filter(filter FilterFunction) *RouteBuilder { - b.filters = append(b.filters, filter) - return b -} - -// If sets a condition function that controls matching the Route based on custom logic. -// The condition function is provided the HTTP request and should return true if the route -// should be considered. -// -// Efficiency note: the condition function is called before checking the method, produces, and -// consumes criteria, so that the correct HTTP status code can be returned. -// -// Lifecycle note: no filter functions have been called prior to calling the condition function, -// so the condition function should not depend on any context that might be set up by container -// or route filters. -func (b *RouteBuilder) If(condition RouteSelectionConditionFunction) *RouteBuilder { - b.conditions = append(b.conditions, condition) - return b -} - -// ContentEncodingEnabled allows you to override the Containers value for auto-compressing this route response. -func (b *RouteBuilder) ContentEncodingEnabled(enabled bool) *RouteBuilder { - b.contentEncodingEnabled = &enabled - return b -} - -// If no specific Route path then set to rootPath -// If no specific Produces then set to rootProduces -// If no specific Consumes then set to rootConsumes -func (b *RouteBuilder) copyDefaults(rootProduces, rootConsumes []string) { - if len(b.produces) == 0 { - b.produces = rootProduces - } - if len(b.consumes) == 0 { - b.consumes = rootConsumes - } -} - -// typeNameHandler sets the function that will convert types to strings in the parameter -// and model definitions. -func (b *RouteBuilder) typeNameHandler(handler TypeNameHandleFunction) *RouteBuilder { - b.typeNameHandleFunc = handler - return b -} - -// Build creates a new Route using the specification details collected by the RouteBuilder -func (b *RouteBuilder) Build() Route { - pathExpr, err := newPathExpression(b.currentPath) - if err != nil { - log.Printf("Invalid path:%s because:%v", b.currentPath, err) - os.Exit(1) - } - if b.function == nil { - log.Printf("No function specified for route:" + b.currentPath) - os.Exit(1) - } - operationName := b.operation - if len(operationName) == 0 && b.function != nil { - // extract from definition - operationName = nameOfFunction(b.function) - } - route := Route{ - Method: b.httpMethod, - Path: concatPath(b.rootPath, b.currentPath), - Produces: b.produces, - Consumes: b.consumes, - Function: b.function, - Filters: b.filters, - If: b.conditions, - relativePath: b.currentPath, - pathExpr: pathExpr, - Doc: b.doc, - Notes: b.notes, - Operation: operationName, - ParameterDocs: b.parameters, - ResponseErrors: b.errorMap, - DefaultResponse: b.defaultResponse, - ReadSample: b.readSample, - WriteSample: b.writeSample, - Metadata: b.metadata, - Deprecated: b.deprecated, - contentEncodingEnabled: b.contentEncodingEnabled, - } - route.postBuild() - return route -} - -func concatPath(path1, path2 string) string { - return strings.TrimRight(path1, "/") + "/" + strings.TrimLeft(path2, "/") -} - -var anonymousFuncCount int32 - -// nameOfFunction returns the short name of the function f for documentation. -// It uses a runtime feature for debugging ; its value may change for later Go versions. -func nameOfFunction(f interface{}) string { - fun := runtime.FuncForPC(reflect.ValueOf(f).Pointer()) - tokenized := strings.Split(fun.Name(), ".") - last := tokenized[len(tokenized)-1] - last = strings.TrimSuffix(last, ")·fm") // < Go 1.5 - last = strings.TrimSuffix(last, ")-fm") // Go 1.5 - last = strings.TrimSuffix(last, "·fm") // < Go 1.5 - last = strings.TrimSuffix(last, "-fm") // Go 1.5 - if last == "func1" { // this could mean conflicts in API docs - val := atomic.AddInt32(&anonymousFuncCount, 1) - last = "func" + fmt.Sprintf("%d", val) - atomic.StoreInt32(&anonymousFuncCount, val) - } - return last -} diff --git a/vendor/github.com/emicklei/go-restful/router.go b/vendor/github.com/emicklei/go-restful/router.go deleted file mode 100644 index 19078af..0000000 --- a/vendor/github.com/emicklei/go-restful/router.go +++ /dev/null @@ -1,20 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import "net/http" - -// A RouteSelector finds the best matching Route given the input HTTP Request -// RouteSelectors can optionally also implement the PathProcessor interface to also calculate the -// path parameters after the route has been selected. -type RouteSelector interface { - - // SelectRoute finds a Route given the input HTTP Request and a list of WebServices. - // It returns a selected Route and its containing WebService or an error indicating - // a problem. - SelectRoute( - webServices []*WebService, - httpRequest *http.Request) (selectedService *WebService, selected *Route, err error) -} diff --git a/vendor/github.com/emicklei/go-restful/service_error.go b/vendor/github.com/emicklei/go-restful/service_error.go deleted file mode 100644 index 62d1108..0000000 --- a/vendor/github.com/emicklei/go-restful/service_error.go +++ /dev/null @@ -1,23 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import "fmt" - -// ServiceError is a transport object to pass information about a non-Http error occurred in a WebService while processing a request. -type ServiceError struct { - Code int - Message string -} - -// NewError returns a ServiceError using the code and reason -func NewError(code int, message string) ServiceError { - return ServiceError{Code: code, Message: message} -} - -// Error returns a text representation of the service error -func (s ServiceError) Error() string { - return fmt.Sprintf("[ServiceError:%v] %v", s.Code, s.Message) -} diff --git a/vendor/github.com/emicklei/go-restful/web_service.go b/vendor/github.com/emicklei/go-restful/web_service.go deleted file mode 100644 index 4f90796..0000000 --- a/vendor/github.com/emicklei/go-restful/web_service.go +++ /dev/null @@ -1,290 +0,0 @@ -package restful - -import ( - "errors" - "os" - "reflect" - "sync" - - "github.com/emicklei/go-restful/log" -) - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -// WebService holds a collection of Route values that bind a Http Method + URL Path to a function. -type WebService struct { - rootPath string - pathExpr *pathExpression // cached compilation of rootPath as RegExp - routes []Route - produces []string - consumes []string - pathParameters []*Parameter - filters []FilterFunction - documentation string - apiVersion string - - typeNameHandleFunc TypeNameHandleFunction - - dynamicRoutes bool - - // protects 'routes' if dynamic routes are enabled - routesLock sync.RWMutex -} - -func (w *WebService) SetDynamicRoutes(enable bool) { - w.dynamicRoutes = enable -} - -// TypeNameHandleFunction declares functions that can handle translating the name of a sample object -// into the restful documentation for the service. -type TypeNameHandleFunction func(sample interface{}) string - -// TypeNameHandler sets the function that will convert types to strings in the parameter -// and model definitions. If not set, the web service will invoke -// reflect.TypeOf(object).String(). -func (w *WebService) TypeNameHandler(handler TypeNameHandleFunction) *WebService { - w.typeNameHandleFunc = handler - return w -} - -// reflectTypeName is the default TypeNameHandleFunction and for a given object -// returns the name that Go identifies it with (e.g. "string" or "v1.Object") via -// the reflection API. -func reflectTypeName(sample interface{}) string { - return reflect.TypeOf(sample).String() -} - -// compilePathExpression ensures that the path is compiled into a RegEx for those routers that need it. -func (w *WebService) compilePathExpression() { - compiled, err := newPathExpression(w.rootPath) - if err != nil { - log.Printf("invalid path:%s because:%v", w.rootPath, err) - os.Exit(1) - } - w.pathExpr = compiled -} - -// ApiVersion sets the API version for documentation purposes. -func (w *WebService) ApiVersion(apiVersion string) *WebService { - w.apiVersion = apiVersion - return w -} - -// Version returns the API version for documentation purposes. -func (w *WebService) Version() string { return w.apiVersion } - -// Path specifies the root URL template path of the WebService. -// All Routes will be relative to this path. -func (w *WebService) Path(root string) *WebService { - w.rootPath = root - if len(w.rootPath) == 0 { - w.rootPath = "/" - } - w.compilePathExpression() - return w -} - -// Param adds a PathParameter to document parameters used in the root path. -func (w *WebService) Param(parameter *Parameter) *WebService { - if w.pathParameters == nil { - w.pathParameters = []*Parameter{} - } - w.pathParameters = append(w.pathParameters, parameter) - return w -} - -// PathParameter creates a new Parameter of kind Path for documentation purposes. -// It is initialized as required with string as its DataType. -func (w *WebService) PathParameter(name, description string) *Parameter { - return PathParameter(name, description) -} - -// PathParameter creates a new Parameter of kind Path for documentation purposes. -// It is initialized as required with string as its DataType. -func PathParameter(name, description string) *Parameter { - p := &Parameter{&ParameterData{Name: name, Description: description, Required: true, DataType: "string"}} - p.bePath() - return p -} - -// QueryParameter creates a new Parameter of kind Query for documentation purposes. -// It is initialized as not required with string as its DataType. -func (w *WebService) QueryParameter(name, description string) *Parameter { - return QueryParameter(name, description) -} - -// QueryParameter creates a new Parameter of kind Query for documentation purposes. -// It is initialized as not required with string as its DataType. -func QueryParameter(name, description string) *Parameter { - p := &Parameter{&ParameterData{Name: name, Description: description, Required: false, DataType: "string", CollectionFormat: CollectionFormatCSV.String()}} - p.beQuery() - return p -} - -// BodyParameter creates a new Parameter of kind Body for documentation purposes. -// It is initialized as required without a DataType. -func (w *WebService) BodyParameter(name, description string) *Parameter { - return BodyParameter(name, description) -} - -// BodyParameter creates a new Parameter of kind Body for documentation purposes. -// It is initialized as required without a DataType. -func BodyParameter(name, description string) *Parameter { - p := &Parameter{&ParameterData{Name: name, Description: description, Required: true}} - p.beBody() - return p -} - -// HeaderParameter creates a new Parameter of kind (Http) Header for documentation purposes. -// It is initialized as not required with string as its DataType. -func (w *WebService) HeaderParameter(name, description string) *Parameter { - return HeaderParameter(name, description) -} - -// HeaderParameter creates a new Parameter of kind (Http) Header for documentation purposes. -// It is initialized as not required with string as its DataType. -func HeaderParameter(name, description string) *Parameter { - p := &Parameter{&ParameterData{Name: name, Description: description, Required: false, DataType: "string"}} - p.beHeader() - return p -} - -// FormParameter creates a new Parameter of kind Form (using application/x-www-form-urlencoded) for documentation purposes. -// It is initialized as required with string as its DataType. -func (w *WebService) FormParameter(name, description string) *Parameter { - return FormParameter(name, description) -} - -// FormParameter creates a new Parameter of kind Form (using application/x-www-form-urlencoded) for documentation purposes. -// It is initialized as required with string as its DataType. -func FormParameter(name, description string) *Parameter { - p := &Parameter{&ParameterData{Name: name, Description: description, Required: false, DataType: "string"}} - p.beForm() - return p -} - -// Route creates a new Route using the RouteBuilder and add to the ordered list of Routes. -func (w *WebService) Route(builder *RouteBuilder) *WebService { - w.routesLock.Lock() - defer w.routesLock.Unlock() - builder.copyDefaults(w.produces, w.consumes) - w.routes = append(w.routes, builder.Build()) - return w -} - -// RemoveRoute removes the specified route, looks for something that matches 'path' and 'method' -func (w *WebService) RemoveRoute(path, method string) error { - if !w.dynamicRoutes { - return errors.New("dynamic routes are not enabled.") - } - w.routesLock.Lock() - defer w.routesLock.Unlock() - newRoutes := make([]Route, (len(w.routes) - 1)) - current := 0 - for ix := range w.routes { - if w.routes[ix].Method == method && w.routes[ix].Path == path { - continue - } - newRoutes[current] = w.routes[ix] - current++ - } - w.routes = newRoutes - return nil -} - -// Method creates a new RouteBuilder and initialize its http method -func (w *WebService) Method(httpMethod string) *RouteBuilder { - return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method(httpMethod) -} - -// Produces specifies that this WebService can produce one or more MIME types. -// Http requests must have one of these values set for the Accept header. -func (w *WebService) Produces(contentTypes ...string) *WebService { - w.produces = contentTypes - return w -} - -// Consumes specifies that this WebService can consume one or more MIME types. -// Http requests must have one of these values set for the Content-Type header. -func (w *WebService) Consumes(accepts ...string) *WebService { - w.consumes = accepts - return w -} - -// Routes returns the Routes associated with this WebService -func (w *WebService) Routes() []Route { - if !w.dynamicRoutes { - return w.routes - } - // Make a copy of the array to prevent concurrency problems - w.routesLock.RLock() - defer w.routesLock.RUnlock() - result := make([]Route, len(w.routes)) - for ix := range w.routes { - result[ix] = w.routes[ix] - } - return result -} - -// RootPath returns the RootPath associated with this WebService. Default "/" -func (w *WebService) RootPath() string { - return w.rootPath -} - -// PathParameters return the path parameter names for (shared among its Routes) -func (w *WebService) PathParameters() []*Parameter { - return w.pathParameters -} - -// Filter adds a filter function to the chain of filters applicable to all its Routes -func (w *WebService) Filter(filter FilterFunction) *WebService { - w.filters = append(w.filters, filter) - return w -} - -// Doc is used to set the documentation of this service. -func (w *WebService) Doc(plainText string) *WebService { - w.documentation = plainText - return w -} - -// Documentation returns it. -func (w *WebService) Documentation() string { - return w.documentation -} - -/* - Convenience methods -*/ - -// HEAD is a shortcut for .Method("HEAD").Path(subPath) -func (w *WebService) HEAD(subPath string) *RouteBuilder { - return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method("HEAD").Path(subPath) -} - -// GET is a shortcut for .Method("GET").Path(subPath) -func (w *WebService) GET(subPath string) *RouteBuilder { - return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method("GET").Path(subPath) -} - -// POST is a shortcut for .Method("POST").Path(subPath) -func (w *WebService) POST(subPath string) *RouteBuilder { - return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method("POST").Path(subPath) -} - -// PUT is a shortcut for .Method("PUT").Path(subPath) -func (w *WebService) PUT(subPath string) *RouteBuilder { - return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method("PUT").Path(subPath) -} - -// PATCH is a shortcut for .Method("PATCH").Path(subPath) -func (w *WebService) PATCH(subPath string) *RouteBuilder { - return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method("PATCH").Path(subPath) -} - -// DELETE is a shortcut for .Method("DELETE").Path(subPath) -func (w *WebService) DELETE(subPath string) *RouteBuilder { - return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method("DELETE").Path(subPath) -} diff --git a/vendor/github.com/emicklei/go-restful/web_service_container.go b/vendor/github.com/emicklei/go-restful/web_service_container.go deleted file mode 100644 index c9d31b0..0000000 --- a/vendor/github.com/emicklei/go-restful/web_service_container.go +++ /dev/null @@ -1,39 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "net/http" -) - -// DefaultContainer is a restful.Container that uses http.DefaultServeMux -var DefaultContainer *Container - -func init() { - DefaultContainer = NewContainer() - DefaultContainer.ServeMux = http.DefaultServeMux -} - -// If set the true then panics will not be caught to return HTTP 500. -// In that case, Route functions are responsible for handling any error situation. -// Default value is false = recover from panics. This has performance implications. -// OBSOLETE ; use restful.DefaultContainer.DoNotRecover(true) -var DoNotRecover = false - -// Add registers a new WebService add it to the DefaultContainer. -func Add(service *WebService) { - DefaultContainer.Add(service) -} - -// Filter appends a container FilterFunction from the DefaultContainer. -// These are called before dispatching a http.Request to a WebService. -func Filter(filter FilterFunction) { - DefaultContainer.Filter(filter) -} - -// RegisteredWebServices returns the collections of WebServices from the DefaultContainer -func RegisteredWebServices() []*WebService { - return DefaultContainer.RegisteredWebServices() -} diff --git a/vendor/github.com/evanphx/json-patch/.travis.yml b/vendor/github.com/evanphx/json-patch/.travis.yml deleted file mode 100644 index 2092c72..0000000 --- a/vendor/github.com/evanphx/json-patch/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: go - -go: - - 1.8 - - 1.7 - -install: - - if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi - - go get github.com/jessevdk/go-flags - -script: - - go get - - go test -cover ./... - -notifications: - email: false diff --git a/vendor/github.com/evanphx/json-patch/README.md b/vendor/github.com/evanphx/json-patch/README.md deleted file mode 100644 index f1ae569..0000000 --- a/vendor/github.com/evanphx/json-patch/README.md +++ /dev/null @@ -1,297 +0,0 @@ -# JSON-Patch -`jsonpatch` is a library which provides functionality for both applying -[RFC6902 JSON patches](http://tools.ietf.org/html/rfc6902) against documents, as -well as for calculating & applying [RFC7396 JSON merge patches](https://tools.ietf.org/html/rfc7396). - -[![GoDoc](https://godoc.org/github.com/evanphx/json-patch?status.svg)](http://godoc.org/github.com/evanphx/json-patch) -[![Build Status](https://travis-ci.org/evanphx/json-patch.svg?branch=master)](https://travis-ci.org/evanphx/json-patch) -[![Report Card](https://goreportcard.com/badge/github.com/evanphx/json-patch)](https://goreportcard.com/report/github.com/evanphx/json-patch) - -# Get It! - -**Latest and greatest**: -```bash -go get -u github.com/evanphx/json-patch -``` - -**Stable Versions**: -* Version 4: `go get -u gopkg.in/evanphx/json-patch.v4` - -(previous versions below `v3` are unavailable) - -# Use It! -* [Create and apply a merge patch](#create-and-apply-a-merge-patch) -* [Create and apply a JSON Patch](#create-and-apply-a-json-patch) -* [Comparing JSON documents](#comparing-json-documents) -* [Combine merge patches](#combine-merge-patches) - - -# Configuration - -* There is a global configuration variable `jsonpatch.SupportNegativeIndices`. - This defaults to `true` and enables the non-standard practice of allowing - negative indices to mean indices starting at the end of an array. This - functionality can be disabled by setting `jsonpatch.SupportNegativeIndices = - false`. - -* There is a global configuration variable `jsonpatch.AccumulatedCopySizeLimit`, - which limits the total size increase in bytes caused by "copy" operations in a - patch. It defaults to 0, which means there is no limit. - -## Create and apply a merge patch -Given both an original JSON document and a modified JSON document, you can create -a [Merge Patch](https://tools.ietf.org/html/rfc7396) document. - -It can describe the changes needed to convert from the original to the -modified JSON document. - -Once you have a merge patch, you can apply it to other JSON documents using the -`jsonpatch.MergePatch(document, patch)` function. - -```go -package main - -import ( - "fmt" - - jsonpatch "github.com/evanphx/json-patch" -) - -func main() { - // Let's create a merge patch from these two documents... - original := []byte(`{"name": "John", "age": 24, "height": 3.21}`) - target := []byte(`{"name": "Jane", "age": 24}`) - - patch, err := jsonpatch.CreateMergePatch(original, target) - if err != nil { - panic(err) - } - - // Now lets apply the patch against a different JSON document... - - alternative := []byte(`{"name": "Tina", "age": 28, "height": 3.75}`) - modifiedAlternative, err := jsonpatch.MergePatch(alternative, patch) - - fmt.Printf("patch document: %s\n", patch) - fmt.Printf("updated alternative doc: %s\n", modifiedAlternative) -} -``` - -When ran, you get the following output: - -```bash -$ go run main.go -patch document: {"height":null,"name":"Jane"} -updated tina doc: {"age":28,"name":"Jane"} -``` - -## Create and apply a JSON Patch -You can create patch objects using `DecodePatch([]byte)`, which can then -be applied against JSON documents. - -The following is an example of creating a patch from two operations, and -applying it against a JSON document. - -```go -package main - -import ( - "fmt" - - jsonpatch "github.com/evanphx/json-patch" -) - -func main() { - original := []byte(`{"name": "John", "age": 24, "height": 3.21}`) - patchJSON := []byte(`[ - {"op": "replace", "path": "/name", "value": "Jane"}, - {"op": "remove", "path": "/height"} - ]`) - - patch, err := jsonpatch.DecodePatch(patchJSON) - if err != nil { - panic(err) - } - - modified, err := patch.Apply(original) - if err != nil { - panic(err) - } - - fmt.Printf("Original document: %s\n", original) - fmt.Printf("Modified document: %s\n", modified) -} -``` - -When ran, you get the following output: - -```bash -$ go run main.go -Original document: {"name": "John", "age": 24, "height": 3.21} -Modified document: {"age":24,"name":"Jane"} -``` - -## Comparing JSON documents -Due to potential whitespace and ordering differences, one cannot simply compare -JSON strings or byte-arrays directly. - -As such, you can instead use `jsonpatch.Equal(document1, document2)` to -determine if two JSON documents are _structurally_ equal. This ignores -whitespace differences, and key-value ordering. - -```go -package main - -import ( - "fmt" - - jsonpatch "github.com/evanphx/json-patch" -) - -func main() { - original := []byte(`{"name": "John", "age": 24, "height": 3.21}`) - similar := []byte(` - { - "age": 24, - "height": 3.21, - "name": "John" - } - `) - different := []byte(`{"name": "Jane", "age": 20, "height": 3.37}`) - - if jsonpatch.Equal(original, similar) { - fmt.Println(`"original" is structurally equal to "similar"`) - } - - if !jsonpatch.Equal(original, different) { - fmt.Println(`"original" is _not_ structurally equal to "different"`) - } -} -``` - -When ran, you get the following output: -```bash -$ go run main.go -"original" is structurally equal to "similar" -"original" is _not_ structurally equal to "different" -``` - -## Combine merge patches -Given two JSON merge patch documents, it is possible to combine them into a -single merge patch which can describe both set of changes. - -The resulting merge patch can be used such that applying it results in a -document structurally similar as merging each merge patch to the document -in succession. - -```go -package main - -import ( - "fmt" - - jsonpatch "github.com/evanphx/json-patch" -) - -func main() { - original := []byte(`{"name": "John", "age": 24, "height": 3.21}`) - - nameAndHeight := []byte(`{"height":null,"name":"Jane"}`) - ageAndEyes := []byte(`{"age":4.23,"eyes":"blue"}`) - - // Let's combine these merge patch documents... - combinedPatch, err := jsonpatch.MergeMergePatches(nameAndHeight, ageAndEyes) - if err != nil { - panic(err) - } - - // Apply each patch individual against the original document - withoutCombinedPatch, err := jsonpatch.MergePatch(original, nameAndHeight) - if err != nil { - panic(err) - } - - withoutCombinedPatch, err = jsonpatch.MergePatch(withoutCombinedPatch, ageAndEyes) - if err != nil { - panic(err) - } - - // Apply the combined patch against the original document - - withCombinedPatch, err := jsonpatch.MergePatch(original, combinedPatch) - if err != nil { - panic(err) - } - - // Do both result in the same thing? They should! - if jsonpatch.Equal(withCombinedPatch, withoutCombinedPatch) { - fmt.Println("Both JSON documents are structurally the same!") - } - - fmt.Printf("combined merge patch: %s", combinedPatch) -} -``` - -When ran, you get the following output: -```bash -$ go run main.go -Both JSON documents are structurally the same! -combined merge patch: {"age":4.23,"eyes":"blue","height":null,"name":"Jane"} -``` - -# CLI for comparing JSON documents -You can install the commandline program `json-patch`. - -This program can take multiple JSON patch documents as arguments, -and fed a JSON document from `stdin`. It will apply the patch(es) against -the document and output the modified doc. - -**patch.1.json** -```json -[ - {"op": "replace", "path": "/name", "value": "Jane"}, - {"op": "remove", "path": "/height"} -] -``` - -**patch.2.json** -```json -[ - {"op": "add", "path": "/address", "value": "123 Main St"}, - {"op": "replace", "path": "/age", "value": "21"} -] -``` - -**document.json** -```json -{ - "name": "John", - "age": 24, - "height": 3.21 -} -``` - -You can then run: - -```bash -$ go install github.com/evanphx/json-patch/cmd/json-patch -$ cat document.json | json-patch -p patch.1.json -p patch.2.json -{"address":"123 Main St","age":"21","name":"Jane"} -``` - -# Help It! -Contributions are welcomed! Leave [an issue](https://github.com/evanphx/json-patch/issues) -or [create a PR](https://github.com/evanphx/json-patch/compare). - - -Before creating a pull request, we'd ask that you make sure tests are passing -and that you have added new tests when applicable. - -Contributors can run tests using: - -```bash -go test -cover ./... -``` - -Builds for pull requests are tested automatically -using [TravisCI](https://travis-ci.org/evanphx/json-patch). diff --git a/vendor/github.com/evanphx/json-patch/go.mod b/vendor/github.com/evanphx/json-patch/go.mod deleted file mode 100644 index a858cab..0000000 --- a/vendor/github.com/evanphx/json-patch/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module github.com/evanphx/json-patch - -go 1.12 - -require github.com/pkg/errors v0.8.1 diff --git a/vendor/github.com/evanphx/json-patch/go.sum b/vendor/github.com/evanphx/json-patch/go.sum deleted file mode 100644 index f29ab35..0000000 --- a/vendor/github.com/evanphx/json-patch/go.sum +++ /dev/null @@ -1,2 +0,0 @@ -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= diff --git a/vendor/github.com/evanphx/json-patch/patch.go b/vendor/github.com/evanphx/json-patch/patch.go index 0e5034b..e736759 100644 --- a/vendor/github.com/evanphx/json-patch/patch.go +++ b/vendor/github.com/evanphx/json-patch/patch.go @@ -213,6 +213,10 @@ func (n *lazyNode) equal(o *lazyNode) bool { return false } + if (v == nil) != (ov == nil) { + return false + } + if v == nil && ov == nil { continue } diff --git a/vendor/github.com/ghodss/yaml/.gitignore b/vendor/github.com/ghodss/yaml/.gitignore deleted file mode 100644 index e256a31..0000000 --- a/vendor/github.com/ghodss/yaml/.gitignore +++ /dev/null @@ -1,20 +0,0 @@ -# OSX leaves these everywhere on SMB shares -._* - -# Eclipse files -.classpath -.project -.settings/** - -# Emacs save files -*~ - -# Vim-related files -[._]*.s[a-w][a-z] -[._]s[a-w][a-z] -*.un~ -Session.vim -.netrwhist - -# Go test binaries -*.test diff --git a/vendor/github.com/ghodss/yaml/.travis.yml b/vendor/github.com/ghodss/yaml/.travis.yml deleted file mode 100644 index 0e9d6ed..0000000 --- a/vendor/github.com/ghodss/yaml/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: go -go: - - 1.3 - - 1.4 -script: - - go test - - go build diff --git a/vendor/github.com/ghodss/yaml/README.md b/vendor/github.com/ghodss/yaml/README.md deleted file mode 100644 index 0200f75..0000000 --- a/vendor/github.com/ghodss/yaml/README.md +++ /dev/null @@ -1,121 +0,0 @@ -# YAML marshaling and unmarshaling support for Go - -[![Build Status](https://travis-ci.org/ghodss/yaml.svg)](https://travis-ci.org/ghodss/yaml) - -## Introduction - -A wrapper around [go-yaml](https://github.com/go-yaml/yaml) designed to enable a better way of handling YAML when marshaling to and from structs. - -In short, this library first converts YAML to JSON using go-yaml and then uses `json.Marshal` and `json.Unmarshal` to convert to or from the struct. This means that it effectively reuses the JSON struct tags as well as the custom JSON methods `MarshalJSON` and `UnmarshalJSON` unlike go-yaml. For a detailed overview of the rationale behind this method, [see this blog post](http://ghodss.com/2014/the-right-way-to-handle-yaml-in-golang/). - -## Compatibility - -This package uses [go-yaml](https://github.com/go-yaml/yaml) and therefore supports [everything go-yaml supports](https://github.com/go-yaml/yaml#compatibility). - -## Caveats - -**Caveat #1:** When using `yaml.Marshal` and `yaml.Unmarshal`, binary data should NOT be preceded with the `!!binary` YAML tag. If you do, go-yaml will convert the binary data from base64 to native binary data, which is not compatible with JSON. You can still use binary in your YAML files though - just store them without the `!!binary` tag and decode the base64 in your code (e.g. in the custom JSON methods `MarshalJSON` and `UnmarshalJSON`). This also has the benefit that your YAML and your JSON binary data will be decoded exactly the same way. As an example: - -``` -BAD: - exampleKey: !!binary gIGC - -GOOD: - exampleKey: gIGC -... and decode the base64 data in your code. -``` - -**Caveat #2:** When using `YAMLToJSON` directly, maps with keys that are maps will result in an error since this is not supported by JSON. This error will occur in `Unmarshal` as well since you can't unmarshal map keys anyways since struct fields can't be keys. - -## Installation and usage - -To install, run: - -``` -$ go get github.com/ghodss/yaml -``` - -And import using: - -``` -import "github.com/ghodss/yaml" -``` - -Usage is very similar to the JSON library: - -```go -package main - -import ( - "fmt" - - "github.com/ghodss/yaml" -) - -type Person struct { - Name string `json:"name"` // Affects YAML field names too. - Age int `json:"age"` -} - -func main() { - // Marshal a Person struct to YAML. - p := Person{"John", 30} - y, err := yaml.Marshal(p) - if err != nil { - fmt.Printf("err: %v\n", err) - return - } - fmt.Println(string(y)) - /* Output: - age: 30 - name: John - */ - - // Unmarshal the YAML back into a Person struct. - var p2 Person - err = yaml.Unmarshal(y, &p2) - if err != nil { - fmt.Printf("err: %v\n", err) - return - } - fmt.Println(p2) - /* Output: - {John 30} - */ -} -``` - -`yaml.YAMLToJSON` and `yaml.JSONToYAML` methods are also available: - -```go -package main - -import ( - "fmt" - - "github.com/ghodss/yaml" -) - -func main() { - j := []byte(`{"name": "John", "age": 30}`) - y, err := yaml.JSONToYAML(j) - if err != nil { - fmt.Printf("err: %v\n", err) - return - } - fmt.Println(string(y)) - /* Output: - name: John - age: 30 - */ - j2, err := yaml.YAMLToJSON(y) - if err != nil { - fmt.Printf("err: %v\n", err) - return - } - fmt.Println(string(j2)) - /* Output: - {"age":30,"name":"John"} - */ -} -``` diff --git a/vendor/github.com/go-openapi/jsonpointer/.editorconfig b/vendor/github.com/go-openapi/jsonpointer/.editorconfig deleted file mode 100644 index 3152da6..0000000 --- a/vendor/github.com/go-openapi/jsonpointer/.editorconfig +++ /dev/null @@ -1,26 +0,0 @@ -# top-most EditorConfig file -root = true - -# Unix-style newlines with a newline ending every file -[*] -end_of_line = lf -insert_final_newline = true -indent_style = space -indent_size = 2 -trim_trailing_whitespace = true - -# Set default charset -[*.{js,py,go,scala,rb,java,html,css,less,sass,md}] -charset = utf-8 - -# Tab indentation (no size specified) -[*.go] -indent_style = tab - -[*.md] -trim_trailing_whitespace = false - -# Matches the exact files either package.json or .travis.yml -[{package.json,.travis.yml}] -indent_style = space -indent_size = 2 diff --git a/vendor/github.com/go-openapi/jsonpointer/.gitignore b/vendor/github.com/go-openapi/jsonpointer/.gitignore deleted file mode 100644 index 769c244..0000000 --- a/vendor/github.com/go-openapi/jsonpointer/.gitignore +++ /dev/null @@ -1 +0,0 @@ -secrets.yml diff --git a/vendor/github.com/go-openapi/jsonpointer/.travis.yml b/vendor/github.com/go-openapi/jsonpointer/.travis.yml deleted file mode 100644 index 9aef918..0000000 --- a/vendor/github.com/go-openapi/jsonpointer/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -after_success: -- bash <(curl -s https://codecov.io/bash) -go: -- 1.11.x -- 1.12.x -install: -- GO111MODULE=off go get -u gotest.tools/gotestsum -env: -- GO111MODULE=on -language: go -notifications: - slack: - secure: a5VgoiwB1G/AZqzmephPZIhEB9avMlsWSlVnM1dSAtYAwdrQHGTQxAmpOxYIoSPDhWNN5bfZmjd29++UlTwLcHSR+e0kJhH6IfDlsHj/HplNCJ9tyI0zYc7XchtdKgeMxMzBKCzgwFXGSbQGydXTliDNBo0HOzmY3cou/daMFTP60K+offcjS+3LRAYb1EroSRXZqrk1nuF/xDL3792DZUdPMiFR/L/Df6y74D6/QP4sTkTDFQitz4Wy/7jbsfj8dG6qK2zivgV6/l+w4OVjFkxVpPXogDWY10vVXNVynqxfJ7to2d1I9lNCHE2ilBCkWMIPdyJF7hjF8pKW+82yP4EzRh0vu8Xn0HT5MZpQxdRY/YMxNrWaG7SxsoEaO4q5uhgdzAqLYY3TRa7MjIK+7Ur+aqOeTXn6OKwVi0CjvZ6mIU3WUKSwiwkFZMbjRAkSb5CYwMEfGFO/z964xz83qGt6WAtBXNotqCQpTIiKtDHQeLOMfksHImCg6JLhQcWBVxamVgu0G3Pdh8Y6DyPnxraXY95+QDavbjqv7TeYT9T/FNnrkXaTTK0s4iWE5H4ACU0Qvz0wUYgfQrZv0/Hp7V17+rabUwnzYySHCy9SWX/7OV9Cfh31iMp9ZIffr76xmmThtOEqs8TrTtU6BWI3rWwvA9cXQipZTVtL0oswrGw= -script: -- gotestsum -f short-verbose -- -race -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/vendor/github.com/go-openapi/jsonpointer/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/jsonpointer/CODE_OF_CONDUCT.md deleted file mode 100644 index 9322b06..0000000 --- a/vendor/github.com/go-openapi/jsonpointer/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at ivan+abuse@flanders.co.nz. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/github.com/go-openapi/jsonpointer/LICENSE b/vendor/github.com/go-openapi/jsonpointer/LICENSE deleted file mode 100644 index d645695..0000000 --- a/vendor/github.com/go-openapi/jsonpointer/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/go-openapi/jsonpointer/README.md b/vendor/github.com/go-openapi/jsonpointer/README.md deleted file mode 100644 index 813788a..0000000 --- a/vendor/github.com/go-openapi/jsonpointer/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# gojsonpointer [![Build Status](https://travis-ci.org/go-openapi/jsonpointer.svg?branch=master)](https://travis-ci.org/go-openapi/jsonpointer) [![codecov](https://codecov.io/gh/go-openapi/jsonpointer/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/jsonpointer) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) - -[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/jsonpointer/master/LICENSE) [![GoDoc](https://godoc.org/github.com/go-openapi/jsonpointer?status.svg)](http://godoc.org/github.com/go-openapi/jsonpointer) -An implementation of JSON Pointer - Go language - -## Status -Completed YES - -Tested YES - -## References -http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-07 - -### Note -The 4.Evaluation part of the previous reference, starting with 'If the currently referenced value is a JSON array, the reference token MUST contain either...' is not implemented. diff --git a/vendor/github.com/go-openapi/jsonpointer/go.mod b/vendor/github.com/go-openapi/jsonpointer/go.mod deleted file mode 100644 index 3e45e22..0000000 --- a/vendor/github.com/go-openapi/jsonpointer/go.mod +++ /dev/null @@ -1,9 +0,0 @@ -module github.com/go-openapi/jsonpointer - -require ( - github.com/go-openapi/swag v0.19.5 - github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e // indirect - github.com/stretchr/testify v1.3.0 -) - -go 1.13 diff --git a/vendor/github.com/go-openapi/jsonpointer/go.sum b/vendor/github.com/go-openapi/jsonpointer/go.sum deleted file mode 100644 index 953d4f3..0000000 --- a/vendor/github.com/go-openapi/jsonpointer/go.sum +++ /dev/null @@ -1,24 +0,0 @@ -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63 h1:nTT4s92Dgz2HlrB2NaMgvlfqHH39OgMhA7z3PK7PGD4= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/go-openapi/jsonpointer/pointer.go b/vendor/github.com/go-openapi/jsonpointer/pointer.go deleted file mode 100644 index b284eb7..0000000 --- a/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() { - 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/vendor/github.com/go-openapi/jsonreference/.gitignore b/vendor/github.com/go-openapi/jsonreference/.gitignore deleted file mode 100644 index 769c244..0000000 --- a/vendor/github.com/go-openapi/jsonreference/.gitignore +++ /dev/null @@ -1 +0,0 @@ -secrets.yml diff --git a/vendor/github.com/go-openapi/jsonreference/.travis.yml b/vendor/github.com/go-openapi/jsonreference/.travis.yml deleted file mode 100644 index 40b9075..0000000 --- a/vendor/github.com/go-openapi/jsonreference/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -after_success: -- bash <(curl -s https://codecov.io/bash) -go: -- 1.11.x -- 1.12.x -install: -- GO111MODULE=off go get -u gotest.tools/gotestsum -env: -- GO111MODULE=on -language: go -notifications: - slack: - secure: OpQG/36F7DSF00HLm9WZMhyqFCYYyYTsVDObW226cWiR8PWYiNfLZiSEvIzT1Gx4dDjhigKTIqcLhG34CkL5iNXDjm9Yyo2RYhQPlK8NErNqUEXuBqn4RqYHW48VGhEhOyDd4Ei0E2FN5ZbgpvHgtpkdZ6XDi64r3Ac89isP9aPHXQTuv2Jog6b4/OKKiUTftLcTIst0p4Cp3gqOJWf1wnoj+IadWiECNVQT6zb47IYjtyw6+uV8iUjTzdKcRB6Zc6b4Dq7JAg1Zd7Jfxkql3hlKp4PNlRf9Cy7y5iA3G7MLyg3FcPX5z2kmcyPt2jOTRMBWUJ5zIQpOxizAcN8WsT3WWBL5KbuYK6k0PzujrIDLqdxGpNmjkkMfDBT9cKmZpm2FdW+oZgPFJP+oKmAo4u4KJz/vjiPTXgQlN5bmrLuRMCp+AwC5wkIohTqWZVPE2TK6ZSnMYcg/W39s+RP/9mJoyryAvPSpBOLTI+biCgaUCTOAZxNTWpMFc3tPYntc41WWkdKcooZ9JA5DwfcaVFyTGQ3YXz+HvX6G1z/gW0Q/A4dBi9mj2iE1xm7tRTT+4VQ2AXFvSEI1HJpfPgYnwAtwOD1v3Qm2EUHk9sCdtEDR4wVGEPIVn44GnwFMnGKx9JWppMPYwFu3SVDdHt+E+LOlhZUply11Aa+IVrT2KUQ= -script: -- gotestsum -f short-verbose -- -race -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/vendor/github.com/go-openapi/jsonreference/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/jsonreference/CODE_OF_CONDUCT.md deleted file mode 100644 index 9322b06..0000000 --- a/vendor/github.com/go-openapi/jsonreference/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at ivan+abuse@flanders.co.nz. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/github.com/go-openapi/jsonreference/LICENSE b/vendor/github.com/go-openapi/jsonreference/LICENSE deleted file mode 100644 index d645695..0000000 --- a/vendor/github.com/go-openapi/jsonreference/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/go-openapi/jsonreference/README.md b/vendor/github.com/go-openapi/jsonreference/README.md deleted file mode 100644 index 66345f4..0000000 --- a/vendor/github.com/go-openapi/jsonreference/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# gojsonreference [![Build Status](https://travis-ci.org/go-openapi/jsonreference.svg?branch=master)](https://travis-ci.org/go-openapi/jsonreference) [![codecov](https://codecov.io/gh/go-openapi/jsonreference/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/jsonreference) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) - -[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/jsonreference/master/LICENSE) [![GoDoc](https://godoc.org/github.com/go-openapi/jsonreference?status.svg)](http://godoc.org/github.com/go-openapi/jsonreference) -An implementation of JSON Reference - Go language - -## Status -Work in progress ( 90% done ) - -## Dependencies -https://github.com/go-openapi/jsonpointer - -## References -http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-07 - -http://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03 diff --git a/vendor/github.com/go-openapi/jsonreference/go.mod b/vendor/github.com/go-openapi/jsonreference/go.mod deleted file mode 100644 index aff1d01..0000000 --- a/vendor/github.com/go-openapi/jsonreference/go.mod +++ /dev/null @@ -1,12 +0,0 @@ -module github.com/go-openapi/jsonreference - -require ( - github.com/PuerkitoBio/purell v1.1.1 - github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect - github.com/go-openapi/jsonpointer v0.19.3 - github.com/stretchr/testify v1.3.0 - golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 // indirect - golang.org/x/text v0.3.2 // indirect -) - -go 1.13 diff --git a/vendor/github.com/go-openapi/jsonreference/go.sum b/vendor/github.com/go-openapi/jsonreference/go.sum deleted file mode 100644 index c7ceab5..0000000 --- a/vendor/github.com/go-openapi/jsonreference/go.sum +++ /dev/null @@ -1,44 +0,0 @@ -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-openapi/jsonpointer v0.19.2 h1:A9+F4Dc/MCNB5jibxf6rRvOvR/iFgQdyNx9eIhnGqq0= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/swag v0.19.2 h1:jvO6bCMBEilGwMfHhrd61zIID4oIFdwb76V17SM88dE= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63 h1:nTT4s92Dgz2HlrB2NaMgvlfqHH39OgMhA7z3PK7PGD4= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/go-openapi/jsonreference/reference.go b/vendor/github.com/go-openapi/jsonreference/reference.go deleted file mode 100644 index 3bc0a6e..0000000 --- a/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/vendor/github.com/go-openapi/spec/.editorconfig b/vendor/github.com/go-openapi/spec/.editorconfig deleted file mode 100644 index 3152da6..0000000 --- a/vendor/github.com/go-openapi/spec/.editorconfig +++ /dev/null @@ -1,26 +0,0 @@ -# top-most EditorConfig file -root = true - -# Unix-style newlines with a newline ending every file -[*] -end_of_line = lf -insert_final_newline = true -indent_style = space -indent_size = 2 -trim_trailing_whitespace = true - -# Set default charset -[*.{js,py,go,scala,rb,java,html,css,less,sass,md}] -charset = utf-8 - -# Tab indentation (no size specified) -[*.go] -indent_style = tab - -[*.md] -trim_trailing_whitespace = false - -# Matches the exact files either package.json or .travis.yml -[{package.json,.travis.yml}] -indent_style = space -indent_size = 2 diff --git a/vendor/github.com/go-openapi/spec/.gitignore b/vendor/github.com/go-openapi/spec/.gitignore deleted file mode 100644 index dd91ed6..0000000 --- a/vendor/github.com/go-openapi/spec/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -secrets.yml -coverage.out diff --git a/vendor/github.com/go-openapi/spec/.golangci.yml b/vendor/github.com/go-openapi/spec/.golangci.yml deleted file mode 100644 index 4e17ed4..0000000 --- a/vendor/github.com/go-openapi/spec/.golangci.yml +++ /dev/null @@ -1,28 +0,0 @@ -linters-settings: - govet: - check-shadowing: true - golint: - min-confidence: 0 - gocyclo: - min-complexity: 45 - maligned: - suggest-new: true - dupl: - threshold: 200 - goconst: - min-len: 2 - min-occurrences: 2 - -linters: - enable-all: true - disable: - - maligned - - unparam - - lll - - gochecknoinits - - gochecknoglobals - - funlen - - godox - - gocognit - - whitespace - - wsl diff --git a/vendor/github.com/go-openapi/spec/.travis.yml b/vendor/github.com/go-openapi/spec/.travis.yml deleted file mode 100644 index f1a3f80..0000000 --- a/vendor/github.com/go-openapi/spec/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -after_success: -- bash <(curl -s https://codecov.io/bash) -go: -- 1.13.x -- 1.14.x -install: -- GO111MODULE=off go get -u gotest.tools/gotestsum -language: go -notifications: - slack: - secure: QUWvCkBBK09GF7YtEvHHVt70JOkdlNBG0nIKu/5qc4/nW5HP8I2w0SEf/XR2je0eED1Qe3L/AfMCWwrEj+IUZc3l4v+ju8X8R3Lomhme0Eb0jd1MTMCuPcBT47YCj0M7RON7vXtbFfm1hFJ/jLe5+9FXz0hpXsR24PJc5ZIi/ogNwkaPqG4BmndzecpSh0vc2FJPZUD9LT0I09REY/vXR0oQAalLkW0asGD5taHZTUZq/kBpsNxaAFrLM23i4mUcf33M5fjLpvx5LRICrX/57XpBrDh2TooBU6Qj3CgoY0uPRYUmSNxbVx1czNzl2JtEpb5yjoxfVPQeg0BvQM00G8LJINISR+ohrjhkZmAqchDupAX+yFrxTtORa78CtnIL6z/aTNlgwwVD8kvL/1pFA/JWYmKDmz93mV/+6wubGzNSQCstzjkFA4/iZEKewKUoRIAi/fxyscP6L/rCpmY/4llZZvrnyTqVbt6URWpopUpH4rwYqreXAtJxJsfBJIeSmUIiDIOMGkCTvyTEW3fWGmGoqWtSHLoaWDyAIGb7azb+KvfpWtEcoPFWfSWU+LGee0A/YsUhBl7ADB9A0CJEuR8q4BPpKpfLwPKSiKSAXL7zDkyjExyhtgqbSl2jS+rKIHOZNL8JkCcTP2MKMVd563C5rC5FMKqu3S9m2b6380E= -script: -- gotestsum -f short-verbose -- -race -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md deleted file mode 100644 index 9322b06..0000000 --- a/vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at ivan+abuse@flanders.co.nz. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/github.com/go-openapi/spec/LICENSE b/vendor/github.com/go-openapi/spec/LICENSE deleted file mode 100644 index d645695..0000000 --- a/vendor/github.com/go-openapi/spec/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/go-openapi/spec/README.md b/vendor/github.com/go-openapi/spec/README.md deleted file mode 100644 index 6354742..0000000 --- a/vendor/github.com/go-openapi/spec/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# OAI object model [![Build Status](https://travis-ci.org/go-openapi/spec.svg?branch=master)](https://travis-ci.org/go-openapi/spec) [![codecov](https://codecov.io/gh/go-openapi/spec/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/spec) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) - -[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/spec/master/LICENSE) -[![GoDoc](https://godoc.org/github.com/go-openapi/spec?status.svg)](http://godoc.org/github.com/go-openapi/spec) -[![GolangCI](https://golangci.com/badges/github.com/go-openapi/spec.svg)](https://golangci.com) -[![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/spec)](https://goreportcard.com/report/github.com/go-openapi/spec) - -The object model for OpenAPI specification documents. - -Currently supports Swagger 2.0. diff --git a/vendor/github.com/go-openapi/spec/bindata.go b/vendor/github.com/go-openapi/spec/bindata.go deleted file mode 100644 index 66b1f32..0000000 --- a/vendor/github.com/go-openapi/spec/bindata.go +++ /dev/null @@ -1,297 +0,0 @@ -// Code generated by go-bindata. DO NOT EDIT. -// sources: -// schemas/jsonschema-draft-04.json (4.357kB) -// schemas/v2/schema.json (40.248kB) - -package spec - -import ( - "bytes" - "compress/gzip" - "crypto/sha256" - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "strings" - "time" -) - -func bindataRead(data []byte, name string) ([]byte, error) { - gz, err := gzip.NewReader(bytes.NewBuffer(data)) - if err != nil { - return nil, fmt.Errorf("read %q: %v", name, err) - } - - var buf bytes.Buffer - _, err = io.Copy(&buf, gz) - clErr := gz.Close() - - if err != nil { - return nil, fmt.Errorf("read %q: %v", name, err) - } - if clErr != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -type asset struct { - bytes []byte - info os.FileInfo - digest [sha256.Size]byte -} - -type bindataFileInfo struct { - name string - size int64 - mode os.FileMode - modTime time.Time -} - -func (fi bindataFileInfo) Name() string { - return fi.name -} -func (fi bindataFileInfo) Size() int64 { - return fi.size -} -func (fi bindataFileInfo) Mode() os.FileMode { - return fi.mode -} -func (fi bindataFileInfo) ModTime() time.Time { - return fi.modTime -} -func (fi bindataFileInfo) IsDir() bool { - return false -} -func (fi bindataFileInfo) Sys() interface{} { - return nil -} - -var _jsonschemaDraft04Json = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x57\x3d\x6f\xdb\x3c\x10\xde\xf3\x2b\x08\x26\x63\xf2\x2a\x2f\xd0\xc9\x5b\xd1\x2e\x01\x5a\x34\x43\x37\x23\x03\x6d\x9d\x6c\x06\x14\xa9\x50\x54\x60\xc3\xd0\x7f\x2f\x28\x4a\x14\x29\x91\x92\x2d\xa7\x8d\x97\x28\xbc\xaf\xe7\x8e\xf7\xc5\xd3\x0d\x42\x08\x61\x9a\xe2\x15\xc2\x7b\xa5\x8a\x55\x92\xbc\x96\x82\x3f\x94\xdb\x3d\xe4\xe4\x3f\x21\x77\x49\x2a\x49\xa6\x1e\x1e\xbf\x24\xe6\xec\x16\xdf\x1b\xa1\x3b\xf3\xff\x02\xc9\x14\xca\xad\xa4\x85\xa2\x82\x6b\xe9\x6f\x42\x02\x32\x2c\x28\x07\x45\x5a\x15\x3d\x77\x46\x39\xd5\xcc\x25\x5e\x21\x83\xb8\x21\x18\xb6\xaf\x52\x92\xa3\x47\x68\x88\xea\x58\x80\x56\x4e\x1a\xf2\xbd\x4f\xcc\x29\x7f\x52\x90\x6b\x7d\xff\x0f\x48\xb4\x3d\x3f\x21\x7c\x27\x21\xd3\x2a\x6e\x31\xaa\x2d\x53\xdd\xf3\xe3\x42\x94\x54\xd1\x77\x78\xe2\x0a\x76\x20\xe3\x20\x68\xcb\x30\x86\x41\xf3\x2a\xc7\x2b\xf4\x78\x8e\xfe\xef\x90\x91\x8a\xa9\xc7\xb1\x1d\xc2\xd8\x2f\x0d\x75\xed\xc1\x4e\x9c\xc8\x25\x43\xac\xa8\xbe\xd7\xcc\xa9\xd1\xa9\x21\xa0\x1a\xbd\x04\x61\x94\x34\x2f\x18\xfc\x3e\x16\x50\x8e\x4d\x03\x6f\x1c\x58\xdb\x48\x23\xbc\x11\x82\x01\xe1\xfa\xd3\x3a\x8e\x30\xaf\x18\x33\x7f\xf3\x8d\x39\x11\x9b\x57\xd8\x2a\xfd\x55\x2a\x49\xf9\x0e\xc7\xec\x37\xd4\x25\xf7\xec\x5c\x66\xc7\xd7\x99\xaa\xcf\x4f\x89\x8a\xd3\xb7\x0a\x3a\xaa\x92\x15\xf4\x30\x6f\x1c\xb0\xd6\x46\xe7\x98\x39\x2d\xa4\x28\x40\x2a\x3a\x88\x9e\x29\xba\x88\x37\x2d\xca\x60\x38\xfa\xba\x5b\x20\xac\xa8\x62\xb0\x4c\xd4\xaf\xda\x45\x0a\xba\x5c\x3b\xb9\xc7\x79\xc5\x14\x2d\x18\x34\x19\x1c\x51\xdb\x25\x4d\xb4\x7e\x06\x14\x38\x6c\x59\x55\xd2\x77\xf8\x69\x59\xfc\x7b\x73\xed\x93\x43\xcb\x32\x6d\x3c\x28\xdc\x1b\x9a\xd3\x62\xab\xc2\x27\xf7\x41\xc9\x08\x2b\x23\x08\xad\x13\x57\x21\x9c\xd3\x72\x0d\x42\x72\xf8\x01\x7c\xa7\xf6\x83\xce\x39\xd7\x82\x3c\x1f\x2f\xd6\x60\x1b\xa2\xdf\x35\x89\x52\x20\xe7\x73\x74\xe0\x66\x26\x64\x4e\xb4\x97\x58\xc2\x0e\x0e\xe1\x60\x92\x34\x6d\xa0\x10\xd6\xb5\x83\x61\x27\xe6\x47\xd3\x89\xbd\x63\xfd\x3b\x8d\x03\x3d\x6c\x42\x2d\x5b\x70\xee\xe8\xdf\x4b\xf4\x66\x4e\xe1\x01\x45\x17\x80\x74\xad\x4f\xc3\xf3\xae\xc6\x1d\xc6\xd7\xc2\xce\xc9\xe1\x29\x30\x86\x2f\x4a\xa6\x4b\x15\x84\x73\xc9\x6f\xfd\x7f\xa5\x6e\x9e\xbd\xf1\xb0\xd4\xdd\x45\x5a\xc2\x3e\x4b\x78\xab\xa8\x84\x74\x4a\x91\x3b\x92\x23\x05\xf2\x1c\x1e\x7b\xf3\x09\xf8\xcf\xab\x24\xb6\x60\xa2\xe8\x4c\x9f\x75\x77\xaa\x8c\xe6\x01\x45\x36\x86\xcf\xc3\x63\x3a\xea\xd4\x8d\x7e\x06\xac\x14\x0a\xe0\x29\xf0\xed\x07\x22\x1a\x65\xda\x44\xae\xa2\x73\x1a\xe6\x90\x69\xa2\x8c\x46\xb2\x2f\xde\x49\x38\x08\xed\xfe\xfd\x41\xaf\x9f\xa9\x55\xd7\xdd\x22\x8d\xfa\x45\x63\xc5\x0f\x80\xf3\xb4\x08\xd6\x79\x30\x9e\x93\xee\x59\xa6\xd0\x4b\xee\x22\xe3\x33\xc1\x3a\x27\x68\x36\x78\x7e\x87\x0a\x06\xd5\x2e\x20\xd3\xaf\x15\xfb\xd8\x3b\x73\x14\xbb\x92\xed\x05\x5d\x2e\x29\x38\x2c\x94\xe4\x42\x45\x5e\xd3\xb5\x7d\xdf\x47\xca\x38\xb4\x5c\xaf\xfb\x7d\xdd\x6d\xf4\xa1\x2d\x77\xdd\x2f\xce\x6d\xc4\x7b\x8b\x4e\x67\xa9\x6f\xfe\x04\x00\x00\xff\xff\xb1\xd1\x27\x78\x05\x11\x00\x00") - -func jsonschemaDraft04JsonBytes() ([]byte, error) { - return bindataRead( - _jsonschemaDraft04Json, - "jsonschema-draft-04.json", - ) -} - -func jsonschemaDraft04Json() (*asset, error) { - bytes, err := jsonschemaDraft04JsonBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "jsonschema-draft-04.json", size: 4357, mode: os.FileMode(0640), modTime: time.Unix(1568963823, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe1, 0x48, 0x9d, 0xb, 0x47, 0x55, 0xf0, 0x27, 0x93, 0x30, 0x25, 0x91, 0xd3, 0xfc, 0xb8, 0xf0, 0x7b, 0x68, 0x93, 0xa8, 0x2a, 0x94, 0xf2, 0x48, 0x95, 0xf8, 0xe4, 0xed, 0xf1, 0x1b, 0x82, 0xe2}} - return a, nil -} - -var _v2SchemaJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5d\x4f\x93\xdb\x36\xb2\xbf\xfb\x53\xa0\x14\x57\xd9\xae\xd8\x92\xe3\xf7\x2e\xcf\x97\xd4\xbc\xd8\x49\x66\x37\x5e\x4f\x79\x26\xbb\x87\x78\x5c\x05\x91\x2d\x09\x09\x09\x30\x00\x38\x33\x5a\xef\x7c\xf7\x2d\xf0\x9f\x08\x02\x20\x41\x8a\xd2\xc8\x0e\x0f\xa9\x78\x28\xa0\xd1\xdd\x68\x34\x7e\xdd\xf8\xf7\xf9\x11\x42\x33\x49\x64\x04\xb3\xd7\x68\x76\x86\xfe\x76\xf9\xfe\x1f\xe8\x32\xd8\x40\x8c\xd1\x8a\x71\x74\x79\x8b\xd7\x6b\xe0\xe8\xd5\xfc\x25\x3a\xbb\x38\x9f\xcf\x9e\xab\x0a\x24\x54\xa5\x37\x52\x26\xaf\x17\x0b\x91\x17\x99\x13\xb6\xb8\x79\xb5\x10\x59\xdd\xf9\xef\x82\xd1\x6f\xf2\xc2\x8f\xf3\x4f\xb5\x1a\xea\xc7\x17\x45\x41\xc6\xd7\x8b\x90\xe3\x95\x7c\xf1\xf2\x7f\x8b\xca\x45\x3d\xb9\x4d\x32\xa6\xd8\xf2\x77\x08\x64\xfe\x8d\xc3\x9f\x29\xe1\xa0\x9a\xff\xed\x11\x42\x08\xcd\x8a\xd6\xb3\x9f\x15\x67\x74\xc5\xca\x7f\x27\x58\x6e\xc4\xec\x11\x42\xd7\x59\x5d\x1c\x86\x44\x12\x46\x71\x74\xc1\x59\x02\x5c\x12\x10\xb3\xd7\x68\x85\x23\x01\x59\x81\x04\x4b\x09\x9c\x6a\xbf\x7e\xce\x49\x7d\xba\x7b\x51\xfd\xa1\x44\xe2\xb0\x52\xac\x7d\xb3\x08\x61\x45\x68\x46\x56\x2c\x6e\x80\x86\x8c\xbf\xbd\x93\x40\x05\x61\x74\x96\x95\xbe\x7f\x84\xd0\x7d\x4e\xde\x42\xb7\xe4\xbe\x46\xbb\x14\x5b\x48\x4e\xe8\xba\x90\x05\xa1\x19\xd0\x34\xae\xc4\xce\xbe\xbc\x9a\xbf\x9c\x15\x7f\x5d\x57\xc5\x42\x10\x01\x27\x89\xe2\x48\x51\xb9\xda\x40\xd5\x87\x37\xc0\x15\x5f\x88\xad\x90\xdc\x10\x81\x42\x16\xa4\x31\x50\x39\x2f\x38\xad\xab\xb0\x53\xd8\xac\x94\x56\x6f\xc3\x84\xf4\x11\xa4\x50\xb3\xfa\xe9\xd3\x6f\x9f\x3e\xdf\x2f\xd0\xeb\x8f\x1f\x3f\x7e\xbc\xfe\xf6\xe9\xf7\xaf\x5f\x7f\xfc\x18\x7e\xfb\xec\xfb\xc7\xb3\x36\x79\x54\x43\xe8\x29\xc5\x31\x20\xc6\x11\x49\x9e\xe5\x12\x41\x66\xa0\xe8\xed\x1d\x8e\x93\x08\x5e\xa3\x27\x3b\xc3\x7c\xa2\x73\xba\xc4\x02\x2e\xb0\xdc\xf4\xe5\x76\xd1\xca\x96\xa2\x8a\x94\xcd\x21\xc9\x6c\xec\x2c\x70\x42\x9e\x34\x74\x9d\x19\x7c\xcd\x20\x9c\xea\x2e\x0a\xfe\x42\x84\xd4\x29\x04\x8c\x8a\xb4\x41\xa2\xc1\xdc\x19\x8a\x88\x90\x4a\x49\xef\xce\xdf\xbd\x45\x4a\x52\x81\x70\x10\x40\x22\x21\x44\xcb\x6d\xc5\xec\x4e\x3c\x1c\x45\xef\x57\x9a\xb5\x7d\xae\xfe\xe5\xe4\x31\x86\x90\xe0\xab\x6d\x02\x3b\x2e\xcb\x11\x90\xd9\xa8\xc6\x77\xc2\x59\x98\x06\xfd\xf9\x2e\x78\x45\x01\xa6\xa8\xa0\x71\x5c\xbe\x33\xa7\xd2\xd9\x5f\x95\xef\xd9\xd5\xac\xfd\xdc\x5d\xbf\x5e\xb8\xd1\x3e\xc7\x31\x48\xe0\x5e\x4c\x14\x65\xdf\xb8\xa8\x71\x10\x09\xa3\xc2\xc7\x02\xcb\xa2\x4e\x5a\x02\x82\x94\x13\xb9\xf5\x30\xe6\xb2\xa4\xb5\xfe\x9b\x3e\x7a\xb2\x55\xd2\xa8\x4a\xbc\x16\xb6\x71\x8e\x39\xc7\xdb\x9d\xe1\x10\x09\x71\xbd\x9c\xb3\x41\x89\xd7\xa5\x89\xdc\x57\xb5\x53\x4a\xfe\x4c\xe1\xbc\xa0\x21\x79\x0a\x1a\x0f\x70\xa7\x5c\x08\x8e\xde\xb0\xc0\x43\x24\xad\x74\x63\x0e\xb1\xd9\x90\xe1\xb0\x2d\x13\xa7\x6d\x78\xfd\x04\x14\x38\x8e\x90\xaa\xce\x63\xac\x3e\x23\xbc\x64\xa9\xb4\xf8\x03\x63\xde\xcd\xbe\x16\x13\x4a\x55\xac\x82\x12\xc6\xac\xd4\x35\xf7\x22\xd4\x3a\xff\x22\x73\x0e\x6e\x51\xa0\x75\x1e\xae\x8f\xe8\x5d\xc7\x59\xe6\xe4\x9a\x18\x8d\xd6\x1c\x53\x84\x4d\xb7\x67\x28\x37\x09\x84\x69\x88\x12\x0e\x01\x11\x80\x32\xa2\xf5\xb9\xaa\xc6\xd9\x73\x53\xab\xfb\xb4\x2e\x20\xc6\x54\x92\xa0\x9a\xf3\x69\x1a\x2f\x81\x77\x37\xae\x53\x1a\xce\x40\xc4\xa8\x82\x1c\xb5\xef\xda\x24\x7d\xb9\x61\x69\x14\xa2\x25\xa0\x90\xac\x56\xc0\x81\x4a\xb4\xe2\x2c\xce\x4a\x64\x7a\x9a\x23\xf4\x13\x91\x3f\xa7\x4b\xf4\x63\x84\x6f\x18\x87\x10\xbd\xc3\xfc\x8f\x90\xdd\x52\x44\x04\xc2\x51\xc4\x6e\x21\x74\x48\x21\x81\xc7\xe2\xfd\xea\x12\xf8\x0d\x09\xf6\xe9\x47\x35\xaf\x67\xc4\x14\xf7\x22\x27\x97\xe1\xe2\x76\x2d\x06\x8c\x4a\x1c\x48\x3f\x73\x2d\x0b\x5b\x29\x45\x24\x00\x2a\x0c\x11\xec\x94\xca\xc2\xa6\xc1\x37\x21\x43\x83\x3b\x5f\x97\xf1\x43\x5e\x53\x73\x19\xa5\x36\xd8\x2d\x05\x2e\x34\x0b\xeb\x39\xfc\x1d\x63\x51\x01\xbd\x3d\xbb\x90\x84\x40\x25\x59\x6d\x09\x5d\xa3\x1c\x37\xe6\x5c\x16\x9a\x40\x09\x70\xc1\xe8\x82\xf1\x35\xa6\xe4\xdf\x99\x5c\x8e\x9e\x4d\x79\xb4\x27\x2f\xbf\x7e\xf8\x05\x25\x8c\x50\xa9\x98\x29\x90\x62\x60\xea\x75\xae\x13\xca\xbf\x2b\x1a\x29\x27\x76\xd6\x20\xc6\x64\x5f\xe6\x32\x1a\x08\x87\x21\x07\x21\xbc\xb4\xe4\xe0\x32\x67\xa6\xcd\xf3\x1e\xcd\xd9\x6b\xb6\x6f\x8e\x27\xa7\xed\xdb\xe7\xbc\xcc\x1a\x07\xce\x6f\x87\x33\xf0\xba\x51\x17\x22\x66\x78\x79\x8e\xce\xe5\x13\x81\x80\x06\x2c\xe5\x78\x0d\xa1\xb2\xb8\x54\xa8\x79\x09\xbd\xbf\x3c\x47\x01\x8b\x13\x2c\xc9\x32\xaa\xaa\x1d\xd5\xee\xab\x36\xbd\x6c\xfd\x54\x6c\xc8\x08\x01\x3c\xbd\xe7\x07\x88\xb0\x24\x37\x79\x90\x28\x4a\x1d\x10\x1a\x92\x1b\x12\xa6\x38\x42\x40\xc3\x4c\x43\x62\x8e\xae\x36\xb0\x45\x71\x2a\xa4\x9a\x23\x79\x59\xb1\xa8\xf2\xa4\x0c\x60\x9f\xcc\x8d\x40\xf5\x80\xca\xa8\x99\xc3\xa7\x85\x1f\x31\x25\xa9\x82\xc5\x6d\xbd\xd8\x36\x76\x7c\x02\x28\x97\xf6\x1d\x74\x3b\x11\x7e\x91\xae\x32\xf8\x6c\xf4\xe6\x7b\x9a\xa5\x1f\x62\xc6\x21\xcf\x9a\xe5\xed\x8b\x02\xf3\x2c\x33\x33\xdf\x00\xca\xc9\x09\xb4\x04\xf5\xa5\x08\xd7\xc3\x02\x18\x66\xf1\xab\x1e\x83\x37\x4c\xcd\x12\xc1\x1d\x50\xf6\xaa\xbd\xfe\xe2\x73\x48\x38\x08\xa0\x32\x9b\x18\x44\x86\x0b\x6a\xc1\xaa\x26\x96\x2d\x96\x3c\xa0\x54\x65\x73\xe3\x08\xb5\x8b\x99\xbd\x82\xbc\x9e\xc2\xe8\x53\x46\x83\x3f\x33\x54\x2b\x5b\xad\x92\x79\xd9\x8f\x5d\x93\x98\xf2\xe6\xc6\x1c\xe6\x9a\x9e\xfc\x43\x82\x31\x66\x8e\x53\x77\xfe\x90\xe7\xf3\xf6\xe9\x62\x23\x3f\x10\x93\x18\xae\x72\x1a\x9d\xf9\x48\xcb\xcc\x5a\x65\xc7\x4a\x04\xf0\xf3\xd5\xd5\x05\x8a\x41\x08\xbc\x86\x86\x43\x51\x6c\xe0\x46\x57\xf6\x44\x40\x0d\xfb\xff\xa2\xc3\x7c\x3d\x39\x84\xdc\x09\x22\x64\x4f\x12\xd9\xba\xaa\xf6\xe3\xbd\x56\xdd\x91\x25\x6a\x14\x9c\x89\x34\x8e\x31\xdf\xee\x15\x7e\x2f\x39\x81\x15\x2a\x28\x95\x66\x51\xf5\xfd\x83\xc5\xfe\x15\x07\xcf\xf7\x08\xee\x1d\x8e\xb6\xc5\x52\xcc\x8c\x5a\x93\x66\xc5\xd8\x79\x38\x46\xd6\xa7\x88\x37\xc9\x2e\xe3\xd2\xa5\x7b\x4b\x3a\xdc\xa1\xdc\x9e\x29\xf1\x8c\x8a\x99\x16\x47\x8d\xd4\x78\x8b\xf6\x1c\xe9\x71\x54\x1b\x69\xa8\x4a\x93\x37\xe5\xb2\x2c\x4f\x0c\x92\xab\xa0\x73\x32\x72\x59\xd3\xf0\x2d\x8d\xed\xca\x37\x16\x19\x9e\xdb\x1c\xab\x17\x49\xc3\x0f\x37\xdc\x88\xb1\xb4\xd4\x42\xcb\x58\x5e\x6a\x52\x0b\x15\x10\x0a\xb0\x04\xe7\xf8\x58\x32\x16\x01\xa6\xcd\x01\xb2\xc2\x69\x24\x35\x38\x6f\x30\x6a\xae\x1b\xb4\x71\xaa\xad\x1d\xa0\xd6\x20\x2d\x8b\x3c\xc6\x82\x62\x27\x34\x6d\x15\x84\x7b\x43\xb1\x35\x78\xa6\x24\x77\x28\xc1\x6e\xfc\xe9\x48\x74\xf4\x15\xe3\xe1\x84\x42\x88\x40\x7a\x26\x49\x3b\x48\xb1\xa4\x19\x8e\x0c\xa7\xb5\x01\x6c\x0c\x97\x61\x8a\xc2\x32\xd8\x8c\x44\x69\x24\xbf\x65\x1d\x74\xd6\xe5\x44\xef\xec\x48\x5e\xb7\x8a\xa3\x29\x8e\x41\x64\xce\x1f\x88\xdc\x00\x47\x4b\x40\x98\x6e\xd1\x0d\x8e\x48\x98\x63\x5c\x21\xb1\x4c\x05\x0a\x58\x98\xc5\x6d\x4f\x0a\x77\x53\x4f\x8b\xc4\x44\x1f\xb2\xdf\x8d\x3b\xea\x9f\xfe\xf6\xf2\xc5\xff\x5d\x7f\xfe\x9f\xfb\x67\x8f\xff\xf3\xe9\x69\xd1\xfe\xb3\xc7\xfd\x3c\xf8\x3f\x71\x94\x82\x23\xd1\x72\x00\xb7\x42\x99\x6c\xc0\x60\x7b\x0f\x79\xea\xa8\x53\x4b\x56\x31\xfa\x0b\x52\x9f\x96\xdb\xcd\x2f\xd7\x67\xcd\x04\x19\x85\xfe\xdb\x02\x9a\x59\x03\xad\x63\x3c\xea\xff\x2e\x18\xfd\x00\xd9\xe2\x56\x60\x59\x93\xb9\xb6\xb2\x3e\x3c\x2c\xab\x0f\xa7\xb2\x89\x43\xc7\xf6\xd5\xce\x2e\xad\xa6\xa9\xed\xa6\xc6\x5a\xb4\xa6\x67\xdf\x8c\x26\x7b\x50\x5a\x91\x08\x2e\x6d\xd4\x3a\xc1\x9d\xf2\xdb\xde\x1e\xb2\x2c\x6c\xa5\x64\xc9\x16\xb4\x90\xaa\x4a\xb7\x0c\xde\x13\xc3\x2a\x9a\x11\x9b\x7a\x1b\x3d\x95\x97\x37\x31\x6b\x69\x7e\x34\xc0\x67\x1f\x66\x19\x49\xef\xf1\x25\xf5\xac\x0e\xea\x0a\x28\x8d\x4d\x7e\xd9\x57\x4b\x49\xe5\xc6\xb3\x25\xfd\xe6\x57\x42\x25\xac\xcd\xcf\x36\x74\x8e\xca\x24\x47\xe7\x80\xa8\x92\x72\xbd\x3d\x84\x2d\x65\xe2\x82\x1a\x9c\xc4\x44\x92\x1b\x10\x79\x8a\xc4\x4a\x2f\x60\x51\x04\x81\xaa\xf0\xa3\x95\x27\xd7\x12\x7b\xa3\x96\x03\x45\x96\xc1\x8a\x07\xc9\xb2\xb0\x95\x52\x8c\xef\x48\x9c\xc6\x7e\x94\xca\xc2\x0e\x07\x12\x44\xa9\x20\x37\xf0\xae\x0f\x49\xa3\x96\x9d\x4b\x42\x7b\x70\x59\x14\xee\xe0\xb2\x0f\x49\xa3\x96\x4b\x97\xbf\x00\x5d\x4b\x4f\xfc\xbb\x2b\xee\x92\xb9\x17\xb5\xaa\xb8\x0b\x97\x17\x9b\x43\xfd\xd6\xc2\xb2\xc2\x2e\x29\xcf\xfd\x87\x4a\x55\xda\x25\x63\x1f\x5a\x65\x69\x2b\x2d\x3d\x67\xe9\x41\xae\x5e\xc1\x6e\x2b\xd4\xdb\x3e\xa8\xd3\x26\xd2\x48\x92\x24\xca\x61\x86\x8f\x8c\xbb\xf2\x8e\x91\xdf\x1f\x06\x19\x33\xf3\x03\x4d\xba\xcd\xe2\x2d\xfb\x69\xe9\x16\x15\x13\xd5\x56\x85\x4e\x3c\x5b\x8a\xbf\x25\x72\x83\xee\x5e\x20\x22\xf2\xc8\xaa\x7b\xdb\x8e\xe4\x29\x58\xca\x38\xb7\x3f\x2e\x59\xb8\xbd\xa8\x16\x16\xf7\xdb\x79\x51\x9f\x5a\xb4\x8d\x87\x3a\x6e\xbc\x3e\xc5\xb4\xcd\x58\xf9\xf5\x3c\xb9\x6f\x49\xaf\x57\xc1\xfa\x1c\x5d\x6d\x88\x8a\x8b\xd3\x28\xcc\xb7\xef\x10\x8a\x4a\x74\xa9\x4a\xa7\x62\xbf\x0d\x76\x23\x6f\x59\xd9\x31\xee\x40\x11\xfb\x28\xec\x8d\x22\x1c\x13\x5a\x64\x94\x23\x16\x60\xbb\xd2\x7c\xa0\x98\xb2\xe5\x6e\xbc\x54\x33\xe0\x3e\xb9\x52\x17\xdb\xb7\x1b\xc8\x12\x20\x8c\x23\xca\x64\x7e\x78\xa3\x62\x5b\x75\x56\xd9\x9e\x2a\x91\x27\xb0\x70\x34\x1f\x90\x89\xb5\x86\x73\x7e\x71\xda\x1e\xfb\x3a\x72\xdc\x5e\x79\x88\xcb\x74\x79\xd9\x64\xe4\xd4\xc2\x9e\xce\xb1\xfe\x85\x5a\xc0\xe9\x0c\x34\x3d\xd0\x43\xce\xa1\x36\x39\xd5\xa1\x4e\xf5\xf8\xb1\xa9\x23\x08\x75\x84\xac\x53\x6c\x3a\xc5\xa6\x53\x6c\x3a\xc5\xa6\x7f\xc5\xd8\xf4\x51\xfd\xff\x25\x4e\xfa\x33\x05\xbe\x9d\x60\xd2\x04\x93\x6a\x5f\x33\x9b\x98\x50\xd2\xe1\x50\x52\xc6\xcc\xdb\x38\x91\xdb\xe6\xaa\xa2\x8f\xa1\x6a\xa6\xd4\xc6\x56\xd6\x8c\x40\x02\x68\x48\xe8\x1a\xe1\x9a\xd9\x2e\xb7\x05\xc3\x34\xda\x2a\xbb\xcd\x12\x36\x98\x22\x50\x4c\xa1\x1b\xc5\xd5\x84\xf0\xbe\x24\x84\xf7\x2f\x22\x37\xef\x94\xd7\x9f\xa0\xde\x04\xf5\x26\xa8\x37\x41\x3d\x64\x40\x3d\xe5\xf2\xde\x60\x89\x27\xb4\x37\xa1\xbd\xda\xd7\xd2\x2c\x26\xc0\x37\x01\x3e\x1b\xef\x5f\x06\xe0\x6b\x7c\x5c\x91\x08\x26\x10\x38\x81\xc0\x09\x04\x76\x4a\x3d\x81\xc0\xbf\x12\x08\x4c\xb0\xdc\x7c\x99\x00\xd0\x75\x70\xb4\xf8\x5a\x7c\xea\xde\x3e\x39\x08\x30\x5a\x27\x35\xed\xb4\x65\xad\x69\x74\x10\x88\x79\xe2\x30\x52\x19\xd6\x04\x21\xa7\x95\xd5\x0e\x03\xf8\xda\x20\xd7\x84\xb4\x26\xa4\x35\x21\xad\x09\x69\x21\x03\x69\x51\x46\xff\xff\x18\x9b\x54\xed\x87\x47\x06\x9d\x4e\x73\x6e\x9a\xb3\xa9\xce\x83\x5e\x4b\xc6\x71\x20\x45\xd7\x72\xf5\x40\x72\x0e\x34\x6c\xf4\x6c\xf3\xba\x5e\x4b\x97\x0e\x52\xb8\xbe\x8b\x79\xa0\x10\x86\xa1\x75\xb0\x6f\xec\xc8\xf4\x3d\x4d\x7b\x86\xc2\x02\x31\x12\x51\xbf\x07\x94\xad\x10\xd6\x2e\x79\xcf\xe9\x1c\xf5\x1e\x31\x23\x5c\x18\xfb\x9c\xfb\x70\xe0\x62\xbd\xf7\xb5\x94\xcf\xf3\xf6\xfa\xc5\x4e\x9c\x85\x76\x1d\xae\x37\xbc\xde\xa3\x41\xcb\x29\xd0\x5e\x70\x67\x50\x93\x6d\x98\xa8\xd3\x67\x0f\x68\xb1\xeb\x38\x47\x07\x10\x1b\xd2\xe2\x18\x68\x6d\x40\xbb\xa3\x40\xba\x21\xf2\x8e\x81\xfb\xf6\x92\x77\x2f\x70\xe8\xdb\xb2\x36\xbf\x30\x91\xc5\x21\xe7\x45\xcc\x34\x0c\x48\x8e\xd0\xf2\x9b\x7c\x3c\xbd\x1c\x04\x3e\x07\xe8\x7c\x2f\x84\x7a\x48\x4d\x1f\xba\xe1\x76\x45\x7b\x60\xe0\x01\xca\xee\x04\xca\x31\xbe\x73\x5f\xa3\x70\x0c\xad\x1f\xa5\xf5\x76\xd5\xbb\xd2\x7e\xfb\x30\x90\xcf\xfa\x67\x7a\xe6\xc3\x37\x42\x19\xe2\xc9\x9c\x61\x4c\xe7\xd1\x77\x55\x86\x6e\x8f\x7b\x85\x42\x33\xa3\xaa\x57\xae\xfd\xd5\xcc\x9c\x56\x68\xe2\xde\x0e\xa8\x2c\xa9\xb0\x7d\xf0\x54\x2d\x80\xf2\x48\x39\x3d\x98\x1a\x6d\x0b\x9d\xba\x53\xfb\xce\xf8\xd1\x7e\xbb\x60\x4f\x06\xf5\xce\xda\xab\xeb\xca\xcb\xd5\xac\x20\xda\x72\x3b\xa2\x4b\x38\xd7\xb5\x89\xbe\x42\xd9\xb9\x73\xc4\x0c\x6d\xb7\xd9\xf8\x8d\xbd\x3e\x9c\xf5\x53\x68\x48\x14\x36\x8f\x09\xc5\x92\xf1\x21\xd1\x09\x07\x1c\xbe\xa7\x91\xf3\x6a\xc8\xc1\x57\xb0\xdd\xc5\xc6\x1d\xad\x76\x1d\xa8\x82\x0e\x4c\x38\xfe\xa5\x8c\xc5\x0a\x40\x5d\xa1\xbb\x98\xd1\xfb\x74\x61\xed\x1a\x98\xaf\x3c\x8c\x1e\xe3\xc2\x92\x29\x74\x3e\x99\xd0\xf9\x41\x50\xd0\x38\x4b\x57\x7e\x5b\x7a\x0e\xe6\xce\x4e\xd7\x19\x35\x57\xbb\x3c\x3c\xd2\x5e\x4f\x4b\x4c\xf7\x0f\x4d\x2b\x91\x5d\x94\xa6\x95\xc8\x69\x25\x72\x5a\x89\x7c\xb8\x95\xc8\x07\x80\x8c\xda\x9c\x64\x7b\xb7\x71\xdf\x57\x12\x4b\x9a\x1f\x72\x0c\x13\x03\xad\x3c\xd5\x4e\xde\x8e\x57\x13\x6d\x34\x86\xcf\x97\xe6\xa4\x68\xc4\xb0\xf6\xc9\xc2\xeb\x8d\x0b\xd7\xcd\xfe\xba\xa6\xf5\x30\xeb\x30\x33\xbe\xc7\x56\x27\xab\x08\xd9\x6d\xbb\x09\xee\x7c\x2d\xcf\xee\x87\x38\xac\xc8\xdd\x90\x9a\x58\x4a\x4e\x96\xa9\x79\x79\xf3\xde\x20\xf0\x96\xe3\x24\x19\xeb\xba\xf2\x53\x19\xab\x12\xaf\x47\xb3\xa0\x3e\xef\x9b\x8d\x6d\x6d\x7b\xde\x3b\x3b\x1a\xc0\x3f\x95\x7e\xed\x78\xfb\x76\xb8\xaf\xb3\xdd\xc5\xeb\x95\xed\x5a\x62\x41\x82\xb3\x54\x6e\x80\x4a\x92\x6f\x36\xbd\x34\xae\xde\x6f\xa4\xc0\xbc\x08\xe3\x84\xfc\x1d\xb6\xe3\xd0\x62\x38\x95\x9b\x57\xe7\x71\x12\x91\x80\xc8\x31\x69\x5e\x60\x21\x6e\x19\x0f\xc7\xa4\x79\x96\x28\x3e\x47\x54\x65\x41\x36\x08\x40\x88\x1f\x58\x08\x56\xaa\xd5\xbf\xaf\xad\x96\xd7\xd6\xcf\x87\xf5\x34\x0f\x71\x93\x6e\x26\xed\x98\x5b\x9f\x4f\xcf\x95\x34\xc6\xd7\x11\xfa\xb0\x81\x22\x1a\xdb\xdf\x8e\xdc\xc3\xb9\xf8\xdd\x5d\x3c\x74\xe6\xea\xb7\x8b\xbf\xf5\x6e\xb3\x46\x2e\x64\xf4\xab\x3c\x4e\xcf\x36\x1d\xfe\xfa\xb8\x36\xba\x8a\xd8\xad\xf6\xc6\x41\x2a\x37\x8c\x17\x0f\xda\xfe\xda\xe7\x65\xbc\x71\x2c\x36\x57\x8a\x47\x12\x4c\xf1\xbd\x77\x6b\xa4\x50\x7e\x77\x7b\x22\x60\x89\xef\xcd\xf5\xb9\x0c\x97\x79\x0d\x2b\x35\x43\xcb\x3d\x24\xf1\x78\xfc\xf8\xcb\x1f\x15\x06\xe2\x78\xd8\x51\x21\xd9\x1f\xf0\xf5\x8f\x86\xa4\x50\xfa\xb1\x47\x43\xa5\xdd\x69\x14\xe8\xa3\xc0\x86\x91\xa7\x81\x50\xb4\x7c\xc0\x81\x80\x77\x7a\x9f\xc6\xc2\xa9\x8c\x05\x33\xb0\x3b\x31\xa4\xf4\xd7\x1b\x26\x55\x97\x7c\x65\xf8\x69\x1a\x84\x8e\x41\x78\xd9\xec\xc5\x11\x16\x1e\x74\x91\xf5\x56\xf5\x57\x49\x47\x5c\x92\xa9\x1e\x99\x36\xf4\xdb\xb1\x0e\xd3\x78\x02\xb0\x9b\x25\xcb\xe9\xe9\x1d\x0d\x44\x01\x42\x08\x91\x64\xd9\xdd\x37\x08\x17\xef\xf9\xe5\x0f\xbd\x46\x91\xf5\xf9\x89\x92\x37\xdd\x89\x59\x44\x1f\x9c\xee\x34\x1e\xbe\x47\x83\x32\x72\x8e\x37\xdf\xac\x69\x38\xef\x75\xb0\xda\xdb\xac\x83\x94\x2f\x39\xa6\x62\x05\x1c\x25\x9c\x49\x16\xb0\xa8\x3c\xc7\x7e\x76\x71\x3e\x6f\xb5\x24\xe7\xe8\xb7\xb9\xc7\x6c\x43\x92\xee\x21\xd4\x17\xa1\x7f\xba\x35\xfe\xae\x39\xbc\xde\xba\x69\xd9\x8e\xe1\x62\xde\x64\x7d\x16\x88\x1b\xed\x29\x11\xfd\x4f\xa9\xff\x99\x90\xc4\xf6\xf4\xf9\x6e\xe9\x28\x23\xd7\xca\xe5\xee\xee\x9f\x63\xb1\x5b\xfb\x10\xd7\x2f\x1d\xf2\xe3\xbf\xb9\xb5\x6f\xa4\x6d\x7d\x25\x79\xfb\x24\x31\xea\x56\xbe\x5d\x53\xcd\x2d\x36\xa3\x6d\xdf\xab\x1c\xb8\x6d\x6f\xc0\x98\xa7\xdd\xaa\x86\x8c\x1d\x39\xa3\x9d\x70\x2b\x9b\x68\xd9\xfd\x33\xfe\xa9\xb6\x4a\x2e\x63\x0f\xcf\x68\x27\xd9\x4c\xb9\x46\x6d\xcb\xbe\xa1\xa8\xd6\x5f\xc6\xd6\x9f\xf1\x4f\xf4\xd4\xb4\x78\xd0\xd6\xf4\x13\x3c\x3b\xac\xd0\xdc\x90\x34\xda\xc9\xb4\x9a\x1a\x8d\xbd\x93\x87\xd4\xe2\x21\x1b\xb3\x2b\xd1\xbe\xe7\x69\xd4\x53\x67\xd5\x40\xa0\xe3\x19\x3f\x6d\x1a\xbc\x0e\x86\x3c\x10\xb4\x3d\x2a\xcd\x78\x32\xe6\xab\xbd\x36\xc9\xf4\x3a\x58\xae\xc3\xf4\x47\xea\xbf\xfb\x47\xff\x0d\x00\x00\xff\xff\xd2\x32\x5a\x28\x38\x9d\x00\x00") - -func v2SchemaJsonBytes() ([]byte, error) { - return bindataRead( - _v2SchemaJson, - "v2/schema.json", - ) -} - -func v2SchemaJson() (*asset, error) { - bytes, err := v2SchemaJsonBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "v2/schema.json", size: 40248, mode: os.FileMode(0640), modTime: time.Unix(1568964748, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xab, 0x88, 0x5e, 0xf, 0xbf, 0x17, 0x74, 0x0, 0xb2, 0x5a, 0x7f, 0xbc, 0x58, 0xcd, 0xc, 0x25, 0x73, 0xd5, 0x29, 0x1c, 0x7a, 0xd0, 0xce, 0x79, 0xd4, 0x89, 0x31, 0x27, 0x90, 0xf2, 0xff, 0xe6}} - return a, nil -} - -// Asset loads and returns the asset for the given name. -// It returns an error if the asset could not be found or -// could not be loaded. -func Asset(name string) ([]byte, error) { - canonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[canonicalName]; ok { - a, err := f() - if err != nil { - return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) - } - return a.bytes, nil - } - return nil, fmt.Errorf("Asset %s not found", name) -} - -// AssetString returns the asset contents as a string (instead of a []byte). -func AssetString(name string) (string, error) { - data, err := Asset(name) - return string(data), err -} - -// MustAsset is like Asset but panics when Asset would return an error. -// It simplifies safe initialization of global variables. -func MustAsset(name string) []byte { - a, err := Asset(name) - if err != nil { - panic("asset: Asset(" + name + "): " + err.Error()) - } - - return a -} - -// MustAssetString is like AssetString but panics when Asset would return an -// error. It simplifies safe initialization of global variables. -func MustAssetString(name string) string { - return string(MustAsset(name)) -} - -// AssetInfo loads and returns the asset info for the given name. -// It returns an error if the asset could not be found or -// could not be loaded. -func AssetInfo(name string) (os.FileInfo, error) { - canonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[canonicalName]; ok { - a, err := f() - if err != nil { - return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) - } - return a.info, nil - } - return nil, fmt.Errorf("AssetInfo %s not found", name) -} - -// AssetDigest returns the digest of the file with the given name. It returns an -// error if the asset could not be found or the digest could not be loaded. -func AssetDigest(name string) ([sha256.Size]byte, error) { - canonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[canonicalName]; ok { - a, err := f() - if err != nil { - return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err) - } - return a.digest, nil - } - return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name) -} - -// Digests returns a map of all known files and their checksums. -func Digests() (map[string][sha256.Size]byte, error) { - mp := make(map[string][sha256.Size]byte, len(_bindata)) - for name := range _bindata { - a, err := _bindata[name]() - if err != nil { - return nil, err - } - mp[name] = a.digest - } - return mp, nil -} - -// AssetNames returns the names of the assets. -func AssetNames() []string { - names := make([]string, 0, len(_bindata)) - for name := range _bindata { - names = append(names, name) - } - return names -} - -// _bindata is a table, holding each asset generator, mapped to its name. -var _bindata = map[string]func() (*asset, error){ - "jsonschema-draft-04.json": jsonschemaDraft04Json, - - "v2/schema.json": v2SchemaJson, -} - -// AssetDir returns the file names below a certain -// directory embedded in the file by go-bindata. -// For example if you run go-bindata on data/... and data contains the -// following hierarchy: -// data/ -// foo.txt -// img/ -// a.png -// b.png -// then AssetDir("data") would return []string{"foo.txt", "img"}, -// AssetDir("data/img") would return []string{"a.png", "b.png"}, -// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and -// AssetDir("") will return []string{"data"}. -func AssetDir(name string) ([]string, error) { - node := _bintree - if len(name) != 0 { - canonicalName := strings.Replace(name, "\\", "/", -1) - pathList := strings.Split(canonicalName, "/") - for _, p := range pathList { - node = node.Children[p] - if node == nil { - return nil, fmt.Errorf("Asset %s not found", name) - } - } - } - if node.Func != nil { - return nil, fmt.Errorf("Asset %s not found", name) - } - rv := make([]string, 0, len(node.Children)) - for childName := range node.Children { - rv = append(rv, childName) - } - return rv, nil -} - -type bintree struct { - Func func() (*asset, error) - Children map[string]*bintree -} - -var _bintree = &bintree{nil, map[string]*bintree{ - "jsonschema-draft-04.json": &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 - } - return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) -} - -// RestoreAssets restores an asset under the given directory recursively. -func RestoreAssets(dir, name string) error { - children, err := AssetDir(name) - // File - if err != nil { - return RestoreAsset(dir, name) - } - // Dir - for _, child := range children { - err = RestoreAssets(dir, filepath.Join(name, child)) - if err != nil { - return err - } - } - return nil -} - -func _filePath(dir, name string) string { - canonicalName := strings.Replace(name, "\\", "/", -1) - return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) -} diff --git a/vendor/github.com/go-openapi/spec/cache.go b/vendor/github.com/go-openapi/spec/cache.go deleted file mode 100644 index 3fada0d..0000000 --- a/vendor/github.com/go-openapi/spec/cache.go +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import "sync" - -// ResolutionCache a cache for resolving urls -type ResolutionCache interface { - Get(string) (interface{}, bool) - Set(string, interface{}) -} - -type simpleCache struct { - lock sync.RWMutex - store map[string]interface{} -} - -// Get retrieves a cached URI -func (s *simpleCache) Get(uri string) (interface{}, bool) { - debugLog("getting %q from resolution cache", uri) - s.lock.RLock() - v, ok := s.store[uri] - debugLog("got %q from resolution cache: %t", uri, ok) - - s.lock.RUnlock() - return v, ok -} - -// Set caches a URI -func (s *simpleCache) Set(uri string, data interface{}) { - s.lock.Lock() - s.store[uri] = data - s.lock.Unlock() -} - -var resCache ResolutionCache - -func init() { - resCache = initResolutionCache() -} - -// initResolutionCache initializes the URI resolution cache -func initResolutionCache() ResolutionCache { - return &simpleCache{store: map[string]interface{}{ - "http://swagger.io/v2/schema.json": MustLoadSwagger20Schema(), - "http://json-schema.org/draft-04/schema": MustLoadJSONSchemaDraft04(), - }} -} diff --git a/vendor/github.com/go-openapi/spec/contact_info.go b/vendor/github.com/go-openapi/spec/contact_info.go deleted file mode 100644 index f9bf42e..0000000 --- a/vendor/github.com/go-openapi/spec/contact_info.go +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - - "github.com/go-openapi/swag" -) - -// ContactInfo contact information for the exposed API. -// -// For more information: http://goo.gl/8us55a#contactObject -type ContactInfo struct { - ContactInfoProps - VendorExtensible -} - -type ContactInfoProps struct { - Name string `json:"name,omitempty"` - URL string `json:"url,omitempty"` - Email string `json:"email,omitempty"` -} - -func (c *ContactInfo) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &c.ContactInfoProps); err != nil { - return err - } - return json.Unmarshal(data, &c.VendorExtensible) -} - -func (c ContactInfo) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(c.ContactInfoProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(c.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2), nil -} diff --git a/vendor/github.com/go-openapi/spec/debug.go b/vendor/github.com/go-openapi/spec/debug.go deleted file mode 100644 index 389c528..0000000 --- a/vendor/github.com/go-openapi/spec/debug.go +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "fmt" - "log" - "os" - "path/filepath" - "runtime" -) - -var ( - // Debug is true when the SWAGGER_DEBUG env var is not empty. - // It enables a more verbose logging of this package. - Debug = os.Getenv("SWAGGER_DEBUG") != "" - // specLogger is a debug logger for this package - specLogger *log.Logger -) - -func init() { - debugOptions() -} - -func debugOptions() { - specLogger = log.New(os.Stdout, "spec:", log.LstdFlags) -} - -func debugLog(msg string, args ...interface{}) { - // A private, trivial trace logger, based on go-openapi/spec/expander.go:debugLog() - if Debug { - _, file1, pos1, _ := runtime.Caller(1) - specLogger.Printf("%s:%d: %s", filepath.Base(file1), pos1, fmt.Sprintf(msg, args...)) - } -} diff --git a/vendor/github.com/go-openapi/spec/expander.go b/vendor/github.com/go-openapi/spec/expander.go deleted file mode 100644 index 043720d..0000000 --- a/vendor/github.com/go-openapi/spec/expander.go +++ /dev/null @@ -1,651 +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" -) - -// ExpandOptions provides options for spec expand -type ExpandOptions struct { - RelativeBase string - SkipSchemas bool - ContinueOnError bool - AbsoluteCircularRef bool -} - -// 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, 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 parameter reference against a context root -func ResolveParameter(root interface{}, ref Ref) (*Parameter, error) { - return ResolveParameterWithBase(root, ref, nil) -} - -// ResolveParameterWithBase resolves a parameter reference against a context root and base path -func ResolveParameterWithBase(root interface{}, ref Ref, opts *ExpandOptions) (*Parameter, error) { - resolver, err := defaultSchemaLoader(root, opts, nil, 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, 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 parameter items reference against a context root and base path. -// -// NOTE: stricly speaking, this construct is not supported by Swagger 2.0. -// Similarly, $ref are forbidden in response headers. -func ResolveItems(root interface{}, ref Ref, opts *ExpandOptions) (*Items, error) { - resolver, err := defaultSchemaLoader(root, opts, nil, 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, 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 -} - -// ExpandSpec expands the references in a swagger spec -func ExpandSpec(spec *Swagger, options *ExpandOptions) error { - resolver, err := defaultSchemaLoader(spec, options, nil, nil) - // Just in case this ever returns an error. - if resolver.shouldStopOnError(err) { - 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("#/definitions/%s", key)}, resolver, specBasePath); resolver.shouldStopOnError(err) { - return err - } - if def != nil { - spec.Definitions[key] = *def - } - } - } - - for key := range spec.Parameters { - parameter := spec.Parameters[key] - if err := expandParameterOrResponse(¶meter, resolver, specBasePath); resolver.shouldStopOnError(err) { - return err - } - spec.Parameters[key] = parameter - } - - for key := range spec.Responses { - response := spec.Responses[key] - if err := expandParameterOrResponse(&response, resolver, specBasePath); resolver.shouldStopOnError(err) { - return err - } - spec.Responses[key] = response - } - - if spec.Paths != nil { - for key := range spec.Paths.Paths { - path := spec.Paths.Paths[key] - if err := expandPathItem(&path, resolver, specBasePath); resolver.shouldStopOnError(err) { - return err - } - spec.Paths.Paths[key] = path - } - } - - return nil -} - -// baseForRoot loads in the cache the root document and produces a fake "root" base path entry -// for further $ref resolution -func baseForRoot(root interface{}, cache ResolutionCache) string { - // cache the root document to resolve $ref's - const rootBase = "root" - if root != nil { - base, _ := absPath(rootBase) - normalizedBase := normalizeAbsPath(base) - debugLog("setting root doc in cache at: %s", normalizedBase) - if cache == nil { - cache = resCache - } - cache.Set(normalizedBase, root) - return rootBase - } - return "" -} - -// ExpandSchema expands the refs in the schema object with reference to the root object -// go-openapi/validate uses this function -// notice that it is impossible to reference a json schema in a different file other than root -func ExpandSchema(schema *Schema, root interface{}, cache ResolutionCache) error { - opts := &ExpandOptions{ - // when a root is specified, cache the root as an in-memory document for $ref retrieval - RelativeBase: baseForRoot(root, cache), - SkipSchemas: false, - ContinueOnError: false, - // when no base path is specified, remaining $ref (circular) are rendered with an absolute path - AbsoluteCircularRef: true, - } - 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, nil) - 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 -} - -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 != "" { - debugLog("schema has ID: %s", 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) - } - - 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() - - if resolver.isCircular(normalizedRef, basePath, parentRefs...) { - // this means there is a cycle in the recursion tree: return the Ref - // - circular refs cannot be expanded. We leave them as ref. - // - denormalization means that a new local file ref is set relative to the original basePath - debugLog("shortcut circular ref: basePath: %s, normalizedPath: %s, normalized ref: %s", - basePath, normalizedBasePath, normalizedRef.String()) - if !resolver.options.AbsoluteCircularRef { - target.Ref = *denormalizeFileRef(normalizedRef, normalizedBasePath, resolver.context.basePath) - } else { - target.Ref = *normalizedRef - } - return &target, nil - } - - debugLog("basePath: %s: calling Resolve with target: %#v", basePath, target) - if err := resolver.Resolve(&target.Ref, &t, basePath); resolver.shouldStopOnError(err) { - return nil, err - } - - if t != nil { - parentRefs = append(parentRefs, normalizedRef.String()) - var err error - transitiveResolver, err := resolver.transitiveResolver(basePath, target.Ref) - if transitiveResolver.shouldStopOnError(err) { - return nil, err - } - - basePath = resolver.updateBasePath(transitiveResolver, normalizedBasePath) - - return expandSchema(*t, parentRefs, transitiveResolver, basePath) - } - } - - t, err := expandItems(target, parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - target = *t - } - - for i := range target.AllOf { - t, err := expandSchema(target.AllOf[i], parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - target.AllOf[i] = *t - } - for i := range target.AnyOf { - t, err := expandSchema(target.AnyOf[i], parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - target.AnyOf[i] = *t - } - for i := range target.OneOf { - t, err := expandSchema(target.OneOf[i], parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - target.OneOf[i] = *t - } - } - if target.Not != nil { - t, err := expandSchema(*target.Not, parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - *target.Not = *t - } - } - for k := range target.Properties { - t, err := expandSchema(target.Properties[k], parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - target.Properties[k] = *t - } - } - if target.AdditionalProperties != nil && target.AdditionalProperties.Schema != nil { - t, err := expandSchema(*target.AdditionalProperties.Schema, parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - *target.AdditionalProperties.Schema = *t - } - } - for k := range target.PatternProperties { - t, err := expandSchema(target.PatternProperties[k], parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - target.PatternProperties[k] = *t - } - } - for k := range target.Dependencies { - if target.Dependencies[k].Schema != nil { - t, err := expandSchema(*target.Dependencies[k].Schema, parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - *target.Dependencies[k].Schema = *t - } - } - } - if target.AdditionalItems != nil && target.AdditionalItems.Schema != nil { - t, err := expandSchema(*target.AdditionalItems.Schema, parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - *target.AdditionalItems.Schema = *t - } - } - for k := range target.Definitions { - t, err := expandSchema(target.Definitions[k], parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - target.Definitions[k] = *t - } - } - return &target, nil -} - -func expandPathItem(pathItem *PathItem, resolver *schemaLoader, basePath string) error { - if pathItem == nil { - return nil - } - - parentRefs := []string{} - if err := resolver.deref(pathItem, parentRefs, basePath); resolver.shouldStopOnError(err) { - return err - } - if pathItem.Ref.String() != "" { - transitiveResolver, err := resolver.transitiveResolver(basePath, pathItem.Ref) - if transitiveResolver.shouldStopOnError(err) { - return err - } - basePath = transitiveResolver.updateBasePath(resolver, basePath) - resolver = transitiveResolver - } - pathItem.Ref = Ref{} - - for idx := range pathItem.Parameters { - if err := expandParameterOrResponse(&(pathItem.Parameters[idx]), resolver, basePath); resolver.shouldStopOnError(err) { - return err - } - } - ops := []*Operation{ - pathItem.Get, - pathItem.Head, - pathItem.Options, - pathItem.Put, - pathItem.Post, - pathItem.Patch, - pathItem.Delete, - } - for _, op := range ops { - if err := expandOperation(op, resolver, basePath); resolver.shouldStopOnError(err) { - return err - } - } - return nil -} - -func expandOperation(op *Operation, resolver *schemaLoader, basePath string) error { - if op == nil { - return nil - } - - for i := range op.Parameters { - param := op.Parameters[i] - if err := expandParameterOrResponse(¶m, resolver, basePath); resolver.shouldStopOnError(err) { - return err - } - op.Parameters[i] = param - } - - if op.Responses != nil { - responses := op.Responses - if err := expandParameterOrResponse(responses.Default, resolver, basePath); resolver.shouldStopOnError(err) { - return err - } - for code := range responses.StatusCodeResponses { - response := responses.StatusCodeResponses[code] - if err := expandParameterOrResponse(&response, resolver, basePath); resolver.shouldStopOnError(err) { - return err - } - responses.StatusCodeResponses[code] = response - } - } - return nil -} - -// ExpandResponseWithRoot expands a response based on a root document, not a fetchable document -func ExpandResponseWithRoot(response *Response, root interface{}, cache ResolutionCache) error { - opts := &ExpandOptions{ - RelativeBase: baseForRoot(root, cache), - SkipSchemas: false, - ContinueOnError: false, - // when no base path is specified, remaining $ref (circular) are rendered with an absolute path - AbsoluteCircularRef: true, - } - resolver, err := defaultSchemaLoader(root, opts, nil, nil) - if err != nil { - return err - } - - return expandParameterOrResponse(response, resolver, opts.RelativeBase) -} - -// 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 { - var specBasePath string - if basePath != "" { - specBasePath, _ = absPath(basePath) - } - opts := &ExpandOptions{ - RelativeBase: specBasePath, - } - resolver, err := defaultSchemaLoader(nil, opts, nil, nil) - if err != nil { - return err - } - - return expandParameterOrResponse(response, resolver, opts.RelativeBase) -} - -// ExpandParameterWithRoot expands a parameter based on a root document, not a fetchable document -func ExpandParameterWithRoot(parameter *Parameter, root interface{}, cache ResolutionCache) error { - opts := &ExpandOptions{ - RelativeBase: baseForRoot(root, cache), - SkipSchemas: false, - ContinueOnError: false, - // when no base path is specified, remaining $ref (circular) are rendered with an absolute path - AbsoluteCircularRef: true, - } - resolver, err := defaultSchemaLoader(root, opts, nil, nil) - if err != nil { - return err - } - - return expandParameterOrResponse(parameter, resolver, opts.RelativeBase) -} - -// ExpandParameter expands a parameter based on a basepath. -// This is the exported version of expandParameter -// all refs inside parameter will be resolved relative to basePath -func ExpandParameter(parameter *Parameter, basePath string) error { - var specBasePath string - if basePath != "" { - specBasePath, _ = absPath(basePath) - } - opts := &ExpandOptions{ - RelativeBase: specBasePath, - } - resolver, err := defaultSchemaLoader(nil, opts, nil, nil) - if err != nil { - return err - } - - return expandParameterOrResponse(parameter, resolver, opts.RelativeBase) -} - -func getRefAndSchema(input interface{}) (*Ref, *Schema, error) { - var ref *Ref - var sch *Schema - switch refable := input.(type) { - case *Parameter: - if refable == nil { - return nil, nil, nil - } - ref = &refable.Ref - sch = refable.Schema - case *Response: - if refable == nil { - return nil, nil, nil - } - ref = &refable.Ref - sch = refable.Schema - default: - return nil, nil, fmt.Errorf("expand: unsupported type %T. Input should be of type *Parameter or *Response", input) - } - return ref, sch, nil -} - -func expandParameterOrResponse(input interface{}, resolver *schemaLoader, basePath string) error { - ref, _, err := getRefAndSchema(input) - if err != nil { - return err - } - if ref == nil { - return nil - } - parentRefs := []string{} - if err := resolver.deref(input, parentRefs, basePath); resolver.shouldStopOnError(err) { - return err - } - ref, sch, _ := getRefAndSchema(input) - if ref.String() != "" { - transitiveResolver, err := resolver.transitiveResolver(basePath, *ref) - if transitiveResolver.shouldStopOnError(err) { - return err - } - basePath = resolver.updateBasePath(transitiveResolver, basePath) - resolver = transitiveResolver - } - - if sch != nil && sch.Ref.String() != "" { - // schema expanded to a $ref in another root - var ern error - sch.Ref, ern = NewRef(normalizePaths(sch.Ref.String(), ref.RemoteURI())) - if ern != nil { - return ern - } - } - if ref != nil { - *ref = Ref{} - } - - if !resolver.options.SkipSchemas && sch != nil { - s, err := expandSchema(*sch, parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return err - } - *sch = *s - } - return nil -} diff --git a/vendor/github.com/go-openapi/spec/external_docs.go b/vendor/github.com/go-openapi/spec/external_docs.go deleted file mode 100644 index 88add91..0000000 --- a/vendor/github.com/go-openapi/spec/external_docs.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -// ExternalDocumentation allows referencing an external resource for -// extended documentation. -// -// For more information: http://goo.gl/8us55a#externalDocumentationObject -type ExternalDocumentation struct { - Description string `json:"description,omitempty"` - URL string `json:"url,omitempty"` -} diff --git a/vendor/github.com/go-openapi/spec/go.mod b/vendor/github.com/go-openapi/spec/go.mod deleted file mode 100644 index 14e5f2d..0000000 --- a/vendor/github.com/go-openapi/spec/go.mod +++ /dev/null @@ -1,12 +0,0 @@ -module github.com/go-openapi/spec - -require ( - github.com/go-openapi/jsonpointer v0.19.3 - github.com/go-openapi/jsonreference v0.19.2 - github.com/go-openapi/swag v0.19.5 - github.com/stretchr/testify v1.3.0 - golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 // indirect - gopkg.in/yaml.v2 v2.2.4 -) - -go 1.13 diff --git a/vendor/github.com/go-openapi/spec/go.sum b/vendor/github.com/go-openapi/spec/go.sum deleted file mode 100644 index c209ff9..0000000 --- a/vendor/github.com/go-openapi/spec/go.sum +++ /dev/null @@ -1,49 +0,0 @@ -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-openapi/jsonpointer v0.19.2 h1:A9+F4Dc/MCNB5jibxf6rRvOvR/iFgQdyNx9eIhnGqq0= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.2 h1:o20suLFB4Ri0tuzpWtyHlh7E7HnkqTNLq6aR6WVNS1w= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/swag v0.19.2 h1:jvO6bCMBEilGwMfHhrd61zIID4oIFdwb76V17SM88dE= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63 h1:nTT4s92Dgz2HlrB2NaMgvlfqHH39OgMhA7z3PK7PGD4= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/go-openapi/spec/header.go b/vendor/github.com/go-openapi/spec/header.go deleted file mode 100644 index 39efe45..0000000 --- a/vendor/github.com/go-openapi/spec/header.go +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "strings" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -const ( - jsonArray = "array" -) - -// HeaderProps describes a response header -type HeaderProps struct { - Description string `json:"description,omitempty"` -} - -// Header describes a header for a response of the API -// -// For more information: http://goo.gl/8us55a#headerObject -type Header struct { - CommonValidations - SimpleSchema - VendorExtensible - HeaderProps -} - -// ResponseHeader creates a new header instance for use in a response -func ResponseHeader() *Header { - return new(Header) -} - -// WithDescription sets the description on this response, allows for chaining -func (h *Header) WithDescription(description string) *Header { - h.Description = description - return h -} - -// Typed a fluent builder method for the type of parameter -func (h *Header) Typed(tpe, format string) *Header { - h.Type = tpe - h.Format = format - return h -} - -// CollectionOf a fluent builder method for an array item -func (h *Header) CollectionOf(items *Items, format string) *Header { - h.Type = jsonArray - h.Items = items - h.CollectionFormat = format - return h -} - -// WithDefault sets the default value on this item -func (h *Header) WithDefault(defaultValue interface{}) *Header { - h.Default = defaultValue - return h -} - -// WithMaxLength sets a max length value -func (h *Header) WithMaxLength(max int64) *Header { - h.MaxLength = &max - return h -} - -// WithMinLength sets a min length value -func (h *Header) WithMinLength(min int64) *Header { - h.MinLength = &min - return h -} - -// WithPattern sets a pattern value -func (h *Header) WithPattern(pattern string) *Header { - h.Pattern = pattern - return h -} - -// WithMultipleOf sets a multiple of value -func (h *Header) WithMultipleOf(number float64) *Header { - h.MultipleOf = &number - return h -} - -// WithMaximum sets a maximum number value -func (h *Header) WithMaximum(max float64, exclusive bool) *Header { - h.Maximum = &max - h.ExclusiveMaximum = exclusive - return h -} - -// WithMinimum sets a minimum number value -func (h *Header) WithMinimum(min float64, exclusive bool) *Header { - h.Minimum = &min - h.ExclusiveMinimum = exclusive - return h -} - -// WithEnum sets a the enum values (replace) -func (h *Header) WithEnum(values ...interface{}) *Header { - h.Enum = append([]interface{}{}, values...) - return h -} - -// WithMaxItems sets the max items -func (h *Header) WithMaxItems(size int64) *Header { - h.MaxItems = &size - return h -} - -// WithMinItems sets the min items -func (h *Header) WithMinItems(size int64) *Header { - h.MinItems = &size - return h -} - -// UniqueValues dictates that this array can only have unique items -func (h *Header) UniqueValues() *Header { - h.UniqueItems = true - return h -} - -// AllowDuplicates this array can have duplicates -func (h *Header) AllowDuplicates() *Header { - h.UniqueItems = false - return h -} - -// MarshalJSON marshal this to JSON -func (h Header) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(h.CommonValidations) - if err != nil { - return nil, err - } - b2, err := json.Marshal(h.SimpleSchema) - if err != nil { - return nil, err - } - b3, err := json.Marshal(h.HeaderProps) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2, b3), nil -} - -// UnmarshalJSON unmarshals this header from JSON -func (h *Header) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &h.CommonValidations); err != nil { - return err - } - if err := json.Unmarshal(data, &h.SimpleSchema); err != nil { - return err - } - if err := json.Unmarshal(data, &h.VendorExtensible); err != nil { - return err - } - return json.Unmarshal(data, &h.HeaderProps) -} - -// JSONLookup look up a value by the json property name -func (h Header) JSONLookup(token string) (interface{}, error) { - if ex, ok := h.Extensions[token]; ok { - return &ex, nil - } - - r, _, err := jsonpointer.GetForToken(h.CommonValidations, token) - if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { - return nil, err - } - if r != nil { - return r, nil - } - r, _, err = jsonpointer.GetForToken(h.SimpleSchema, token) - if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { - return nil, err - } - if r != nil { - return r, nil - } - r, _, err = jsonpointer.GetForToken(h.HeaderProps, token) - return r, err -} diff --git a/vendor/github.com/go-openapi/spec/info.go b/vendor/github.com/go-openapi/spec/info.go deleted file mode 100644 index c458b49..0000000 --- a/vendor/github.com/go-openapi/spec/info.go +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package 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, isSlice := v.([]interface{}) - if !isSlice { - return nil, false - } - var strs []string - for _, iface := range arr { - str, isString := iface.(string) - if !isString { - return nil, false - } - strs = append(strs, str) - } - return strs, ok - } - return nil, false -} - -// VendorExtensible composition block. -type VendorExtensible struct { - Extensions Extensions -} - -// AddExtension adds an extension to this extensible object -func (v *VendorExtensible) AddExtension(key string, value interface{}) { - if value == nil { - return - } - if v.Extensions == nil { - v.Extensions = make(map[string]interface{}) - } - v.Extensions.Add(key, value) -} - -// MarshalJSON marshals the extensions to json -func (v VendorExtensible) MarshalJSON() ([]byte, error) { - toser := make(map[string]interface{}) - for k, v := range v.Extensions { - lk := strings.ToLower(k) - if strings.HasPrefix(lk, "x-") { - toser[k] = v - } - } - return json.Marshal(toser) -} - -// UnmarshalJSON for this extensible object -func (v *VendorExtensible) UnmarshalJSON(data []byte) error { - var d map[string]interface{} - if err := json.Unmarshal(data, &d); err != nil { - return err - } - for k, vv := range d { - lk := strings.ToLower(k) - if strings.HasPrefix(lk, "x-") { - if v.Extensions == nil { - v.Extensions = map[string]interface{}{} - } - v.Extensions[k] = vv - } - } - return nil -} - -// InfoProps the properties for an info definition -type InfoProps struct { - Description string `json:"description,omitempty"` - Title string `json:"title,omitempty"` - TermsOfService string `json:"termsOfService,omitempty"` - Contact *ContactInfo `json:"contact,omitempty"` - License *License `json:"license,omitempty"` - Version string `json:"version,omitempty"` -} - -// Info object provides metadata about the API. -// The metadata can be used by the clients if needed, and can be presented in the Swagger-UI for convenience. -// -// For more information: http://goo.gl/8us55a#infoObject -type Info struct { - VendorExtensible - InfoProps -} - -// JSONLookup look up a value by the json property name -func (i Info) JSONLookup(token string) (interface{}, error) { - if ex, ok := i.Extensions[token]; ok { - return &ex, nil - } - r, _, err := jsonpointer.GetForToken(i.InfoProps, token) - return r, err -} - -// MarshalJSON marshal this to JSON -func (i Info) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(i.InfoProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(i.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2), nil -} - -// UnmarshalJSON marshal this from JSON -func (i *Info) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &i.InfoProps); err != nil { - return err - } - return json.Unmarshal(data, &i.VendorExtensible) -} diff --git a/vendor/github.com/go-openapi/spec/items.go b/vendor/github.com/go-openapi/spec/items.go deleted file mode 100644 index 365d163..0000000 --- a/vendor/github.com/go-openapi/spec/items.go +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "strings" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -const ( - jsonRef = "$ref" -) - -// SimpleSchema describe swagger simple schemas for parameters and headers -type SimpleSchema struct { - Type string `json:"type,omitempty"` - Nullable bool `json:"nullable,omitempty"` - Format string `json:"format,omitempty"` - Items *Items `json:"items,omitempty"` - CollectionFormat string `json:"collectionFormat,omitempty"` - Default interface{} `json:"default,omitempty"` - Example interface{} `json:"example,omitempty"` -} - -// TypeName return the type (or format) of a simple schema -func (s *SimpleSchema) TypeName() string { - if s.Format != "" { - return s.Format - } - return s.Type -} - -// ItemsTypeName yields the type of items in a simple schema array -func (s *SimpleSchema) ItemsTypeName() string { - if s.Items == nil { - return "" - } - return s.Items.TypeName() -} - -// CommonValidations describe common JSON-schema validations -type CommonValidations struct { - Maximum *float64 `json:"maximum,omitempty"` - ExclusiveMaximum bool `json:"exclusiveMaximum,omitempty"` - Minimum *float64 `json:"minimum,omitempty"` - ExclusiveMinimum bool `json:"exclusiveMinimum,omitempty"` - MaxLength *int64 `json:"maxLength,omitempty"` - MinLength *int64 `json:"minLength,omitempty"` - Pattern string `json:"pattern,omitempty"` - MaxItems *int64 `json:"maxItems,omitempty"` - MinItems *int64 `json:"minItems,omitempty"` - UniqueItems bool `json:"uniqueItems,omitempty"` - MultipleOf *float64 `json:"multipleOf,omitempty"` - Enum []interface{} `json:"enum,omitempty"` -} - -// Items a limited subset of JSON-Schema's items object. -// It is used by parameter definitions that are not located in "body". -// -// For more information: http://goo.gl/8us55a#items-object -type Items struct { - Refable - CommonValidations - SimpleSchema - VendorExtensible -} - -// NewItems creates a new instance of items -func NewItems() *Items { - return &Items{} -} - -// Typed a fluent builder method for the type of item -func (i *Items) Typed(tpe, format string) *Items { - i.Type = tpe - i.Format = format - return i -} - -// AsNullable flags this schema as nullable. -func (i *Items) AsNullable() *Items { - i.Nullable = true - return i -} - -// CollectionOf a fluent builder method for an array item -func (i *Items) CollectionOf(items *Items, format string) *Items { - i.Type = jsonArray - i.Items = items - i.CollectionFormat = format - return i -} - -// WithDefault sets the default value on this item -func (i *Items) WithDefault(defaultValue interface{}) *Items { - i.Default = defaultValue - return i -} - -// WithMaxLength sets a max length value -func (i *Items) WithMaxLength(max int64) *Items { - i.MaxLength = &max - return i -} - -// WithMinLength sets a min length value -func (i *Items) WithMinLength(min int64) *Items { - i.MinLength = &min - return i -} - -// WithPattern sets a pattern value -func (i *Items) WithPattern(pattern string) *Items { - i.Pattern = pattern - return i -} - -// WithMultipleOf sets a multiple of value -func (i *Items) WithMultipleOf(number float64) *Items { - i.MultipleOf = &number - return i -} - -// WithMaximum sets a maximum number value -func (i *Items) WithMaximum(max float64, exclusive bool) *Items { - i.Maximum = &max - i.ExclusiveMaximum = exclusive - return i -} - -// WithMinimum sets a minimum number value -func (i *Items) WithMinimum(min float64, exclusive bool) *Items { - i.Minimum = &min - i.ExclusiveMinimum = exclusive - return i -} - -// WithEnum sets a the enum values (replace) -func (i *Items) WithEnum(values ...interface{}) *Items { - i.Enum = append([]interface{}{}, values...) - return i -} - -// WithMaxItems sets the max items -func (i *Items) WithMaxItems(size int64) *Items { - i.MaxItems = &size - return i -} - -// WithMinItems sets the min items -func (i *Items) WithMinItems(size int64) *Items { - i.MinItems = &size - return i -} - -// UniqueValues dictates that this array can only have unique items -func (i *Items) UniqueValues() *Items { - i.UniqueItems = true - return i -} - -// AllowDuplicates this array can have duplicates -func (i *Items) AllowDuplicates() *Items { - i.UniqueItems = false - return i -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (i *Items) UnmarshalJSON(data []byte) error { - var validations CommonValidations - if err := json.Unmarshal(data, &validations); err != nil { - return err - } - var ref Refable - if err := json.Unmarshal(data, &ref); err != nil { - return err - } - var simpleSchema SimpleSchema - if err := json.Unmarshal(data, &simpleSchema); err != nil { - return err - } - var vendorExtensible VendorExtensible - if err := json.Unmarshal(data, &vendorExtensible); err != nil { - return err - } - i.Refable = ref - i.CommonValidations = validations - i.SimpleSchema = simpleSchema - i.VendorExtensible = vendorExtensible - return nil -} - -// MarshalJSON converts this items object to JSON -func (i Items) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(i.CommonValidations) - if err != nil { - return nil, err - } - b2, err := json.Marshal(i.SimpleSchema) - if err != nil { - return nil, err - } - b3, err := json.Marshal(i.Refable) - if err != nil { - return nil, err - } - b4, err := json.Marshal(i.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b4, b3, b1, b2), nil -} - -// JSONLookup look up a value by the json property name -func (i Items) JSONLookup(token string) (interface{}, error) { - if token == jsonRef { - return &i.Ref, nil - } - - r, _, err := jsonpointer.GetForToken(i.CommonValidations, token) - if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { - return nil, err - } - if r != nil { - return r, nil - } - r, _, err = jsonpointer.GetForToken(i.SimpleSchema, token) - return r, err -} diff --git a/vendor/github.com/go-openapi/spec/license.go b/vendor/github.com/go-openapi/spec/license.go deleted file mode 100644 index e1529b4..0000000 --- a/vendor/github.com/go-openapi/spec/license.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - - "github.com/go-openapi/swag" -) - -// License information for the exposed API. -// -// For more information: http://goo.gl/8us55a#licenseObject -type License struct { - LicenseProps - VendorExtensible -} - -type LicenseProps struct { - Name string `json:"name,omitempty"` - URL string `json:"url,omitempty"` -} - -func (l *License) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &l.LicenseProps); err != nil { - return err - } - return json.Unmarshal(data, &l.VendorExtensible) -} - -func (l License) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(l.LicenseProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(l.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2), nil -} diff --git a/vendor/github.com/go-openapi/spec/normalizer.go b/vendor/github.com/go-openapi/spec/normalizer.go deleted file mode 100644 index b8957e7..0000000 --- a/vendor/github.com/go-openapi/spec/normalizer.go +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "fmt" - "net/url" - "os" - "path" - "path/filepath" - "strings" -) - -// 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) || filepath.IsAbs(refPath) { - // refPath is actually absolute - if refURL.Host != "" { - return refPath - } - parts := strings.Split(refPath, "#") - result := filepath.FromSlash(parts[0]) - if len(parts) == 2 { - result += "#" + parts[1] - } - return result - } - - // 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() -} - -// denormalizePaths returns to simplest notation on file $ref, -// i.e. strips the absolute path and sets a path relative to the base path. -// -// This is currently used when we rewrite ref after a circular ref has been detected -func denormalizeFileRef(ref *Ref, relativeBase, originalRelativeBase string) *Ref { - debugLog("denormalizeFileRef for: %s", ref.String()) - - if ref.String() == "" || ref.IsRoot() || ref.HasFragmentOnly { - return ref - } - // strip relativeBase from URI - relativeBaseURL, _ := url.Parse(relativeBase) - relativeBaseURL.Fragment = "" - - if relativeBaseURL.IsAbs() && strings.HasPrefix(ref.String(), relativeBase) { - // this should work for absolute URI (e.g. http://...): we have an exact match, just trim prefix - r, _ := NewRef(strings.TrimPrefix(ref.String(), relativeBase)) - return &r - } - - if relativeBaseURL.IsAbs() { - // other absolute URL get unchanged (i.e. with a non-empty scheme) - return ref - } - - // for relative file URIs: - originalRelativeBaseURL, _ := url.Parse(originalRelativeBase) - originalRelativeBaseURL.Fragment = "" - if strings.HasPrefix(ref.String(), originalRelativeBaseURL.String()) { - // the resulting ref is in the expanded spec: return a local ref - r, _ := NewRef(strings.TrimPrefix(ref.String(), originalRelativeBaseURL.String())) - return &r - } - - // check if we may set a relative path, considering the original base path for this spec. - // Example: - // spec is located at /mypath/spec.json - // my normalized ref points to: /mypath/item.json#/target - // expected result: item.json#/target - parts := strings.Split(ref.String(), "#") - relativePath, err := filepath.Rel(path.Dir(originalRelativeBaseURL.String()), parts[0]) - if err != nil { - // there is no common ancestor (e.g. different drives on windows) - // leaves the ref unchanged - return ref - } - if len(parts) == 2 { - relativePath += "#" + parts[1] - } - r, _ := NewRef(relativePath) - return &r -} - -// 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 - } - - debugLog("normalizing %s against %s", ref.String(), relativeBase) - - s := normalizePaths(ref.String(), relativeBase) - r, _ := NewRef(s) - return &r -} - -// 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 -} diff --git a/vendor/github.com/go-openapi/spec/operation.go b/vendor/github.com/go-openapi/spec/operation.go deleted file mode 100644 index b1ebd59..0000000 --- a/vendor/github.com/go-openapi/spec/operation.go +++ /dev/null @@ -1,398 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "bytes" - "encoding/gob" - "encoding/json" - "sort" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -func init() { - //gob.Register(map[string][]interface{}{}) - gob.Register(map[string]interface{}{}) - gob.Register([]interface{}{}) -} - -// OperationProps describes an operation -// -// NOTES: -// - schemes, when present must be from [http, https, ws, wss]: see validate -// - Security is handled as a special case: see MarshalJSON function -type OperationProps struct { - Description string `json:"description,omitempty"` - Consumes []string `json:"consumes,omitempty"` - Produces []string `json:"produces,omitempty"` - Schemes []string `json:"schemes,omitempty"` - Tags []string `json:"tags,omitempty"` - Summary string `json:"summary,omitempty"` - ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` - ID string `json:"operationId,omitempty"` - Deprecated bool `json:"deprecated,omitempty"` - Security []map[string][]string `json:"security,omitempty"` - Parameters []Parameter `json:"parameters,omitempty"` - Responses *Responses `json:"responses,omitempty"` -} - -// MarshalJSON takes care of serializing operation properties to JSON -// -// We use a custom marhaller here to handle a special cases related to -// the Security field. We need to preserve zero length slice -// while omitting the field when the value is nil/unset. -func (op OperationProps) MarshalJSON() ([]byte, error) { - type Alias OperationProps - if op.Security == nil { - return json.Marshal(&struct { - Security []map[string][]string `json:"security,omitempty"` - *Alias - }{ - Security: op.Security, - Alias: (*Alias)(&op), - }) - } - return json.Marshal(&struct { - Security []map[string][]string `json:"security"` - *Alias - }{ - Security: op.Security, - Alias: (*Alias)(&op), - }) -} - -// Operation describes a single API operation on a path. -// -// For more information: http://goo.gl/8us55a#operationObject -type Operation struct { - VendorExtensible - OperationProps -} - -// SuccessResponse gets a success response model -func (o *Operation) SuccessResponse() (*Response, int, bool) { - if o.Responses == nil { - return nil, 0, false - } - - responseCodes := make([]int, 0, len(o.Responses.StatusCodeResponses)) - for k := range o.Responses.StatusCodeResponses { - if k >= 200 && k < 300 { - responseCodes = append(responseCodes, k) - } - } - if len(responseCodes) > 0 { - sort.Ints(responseCodes) - v := o.Responses.StatusCodeResponses[responseCodes[0]] - return &v, responseCodes[0], true - } - - return o.Responses.Default, 0, false -} - -// JSONLookup look up a value by the json property name -func (o Operation) JSONLookup(token string) (interface{}, error) { - if ex, ok := o.Extensions[token]; ok { - return &ex, nil - } - r, _, err := jsonpointer.GetForToken(o.OperationProps, token) - return r, err -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (o *Operation) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &o.OperationProps); err != nil { - return err - } - return json.Unmarshal(data, &o.VendorExtensible) -} - -// MarshalJSON converts this items object to JSON -func (o Operation) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(o.OperationProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(o.VendorExtensible) - if err != nil { - return nil, err - } - concated := swag.ConcatJSON(b1, b2) - return concated, nil -} - -// NewOperation creates a new operation instance. -// It expects an ID as parameter but not passing an ID is also valid. -func NewOperation(id string) *Operation { - op := new(Operation) - op.ID = id - return op -} - -// WithID sets the ID property on this operation, allows for chaining. -func (o *Operation) WithID(id string) *Operation { - o.ID = id - return o -} - -// WithDescription sets the description on this operation, allows for chaining -func (o *Operation) WithDescription(description string) *Operation { - o.Description = description - return o -} - -// WithSummary sets the summary on this operation, allows for chaining -func (o *Operation) WithSummary(summary string) *Operation { - o.Summary = summary - return o -} - -// WithExternalDocs sets/removes the external docs for/from this operation. -// When you pass empty strings as params the external documents will be removed. -// When you pass non-empty string as one value then those values will be used on the external docs object. -// So when you pass a non-empty description, you should also pass the url and vice versa. -func (o *Operation) WithExternalDocs(description, url string) *Operation { - if description == "" && url == "" { - o.ExternalDocs = nil - return o - } - - if o.ExternalDocs == nil { - o.ExternalDocs = &ExternalDocumentation{} - } - o.ExternalDocs.Description = description - o.ExternalDocs.URL = url - return o -} - -// Deprecate marks the operation as deprecated -func (o *Operation) Deprecate() *Operation { - o.Deprecated = true - return o -} - -// Undeprecate marks the operation as not deprected -func (o *Operation) Undeprecate() *Operation { - o.Deprecated = false - return o -} - -// WithConsumes adds media types for incoming body values -func (o *Operation) WithConsumes(mediaTypes ...string) *Operation { - o.Consumes = append(o.Consumes, mediaTypes...) - return o -} - -// WithProduces adds media types for outgoing body values -func (o *Operation) WithProduces(mediaTypes ...string) *Operation { - o.Produces = append(o.Produces, mediaTypes...) - return o -} - -// WithTags adds tags for this operation -func (o *Operation) WithTags(tags ...string) *Operation { - o.Tags = append(o.Tags, tags...) - return o -} - -// AddParam adds a parameter to this operation, when a parameter for that location -// and with that name already exists it will be replaced -func (o *Operation) AddParam(param *Parameter) *Operation { - if param == nil { - return o - } - - for i, p := range o.Parameters { - if p.Name == param.Name && p.In == param.In { - params := append(o.Parameters[:i], *param) - params = append(params, o.Parameters[i+1:]...) - o.Parameters = params - return o - } - } - - o.Parameters = append(o.Parameters, *param) - return o -} - -// RemoveParam removes a parameter from the operation -func (o *Operation) RemoveParam(name, in string) *Operation { - for i, p := range o.Parameters { - if p.Name == name && p.In == in { - o.Parameters = append(o.Parameters[:i], o.Parameters[i+1:]...) - return o - } - } - return o -} - -// SecuredWith adds a security scope to this operation. -func (o *Operation) SecuredWith(name string, scopes ...string) *Operation { - o.Security = append(o.Security, map[string][]string{name: scopes}) - return o -} - -// WithDefaultResponse adds a default response to the operation. -// Passing a nil value will remove the response -func (o *Operation) WithDefaultResponse(response *Response) *Operation { - return o.RespondsWith(0, response) -} - -// RespondsWith adds a status code response to the operation. -// When the code is 0 the value of the response will be used as default response value. -// When the value of the response is nil it will be removed from the operation -func (o *Operation) RespondsWith(code int, response *Response) *Operation { - if o.Responses == nil { - o.Responses = new(Responses) - } - if code == 0 { - o.Responses.Default = response - return o - } - if response == nil { - delete(o.Responses.StatusCodeResponses, code) - return o - } - if o.Responses.StatusCodeResponses == nil { - o.Responses.StatusCodeResponses = make(map[int]Response) - } - o.Responses.StatusCodeResponses[code] = *response - return o -} - -type opsAlias OperationProps - -type gobAlias struct { - Security []map[string]struct { - List []string - Pad bool - } - Alias *opsAlias - SecurityIsEmpty bool -} - -// GobEncode provides a safe gob encoder for Operation, including empty security requirements -func (o Operation) GobEncode() ([]byte, error) { - raw := struct { - Ext VendorExtensible - Props OperationProps - }{ - Ext: o.VendorExtensible, - Props: o.OperationProps, - } - var b bytes.Buffer - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err -} - -// GobDecode provides a safe gob decoder for Operation, including empty security requirements -func (o *Operation) GobDecode(b []byte) error { - var raw struct { - Ext VendorExtensible - Props OperationProps - } - - buf := bytes.NewBuffer(b) - err := gob.NewDecoder(buf).Decode(&raw) - if err != nil { - return err - } - o.VendorExtensible = raw.Ext - o.OperationProps = raw.Props - return nil -} - -// GobEncode provides a safe gob encoder for Operation, including empty security requirements -func (op OperationProps) GobEncode() ([]byte, error) { - raw := gobAlias{ - Alias: (*opsAlias)(&op), - } - - var b bytes.Buffer - if op.Security == nil { - // nil security requirement - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err - } - - if len(op.Security) == 0 { - // empty, but non-nil security requirement - raw.SecurityIsEmpty = true - raw.Alias.Security = nil - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err - } - - raw.Security = make([]map[string]struct { - List []string - Pad bool - }, 0, len(op.Security)) - for _, req := range op.Security { - v := make(map[string]struct { - List []string - Pad bool - }, len(req)) - for k, val := range req { - v[k] = struct { - List []string - Pad bool - }{ - List: val, - } - } - raw.Security = append(raw.Security, v) - } - - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err -} - -// GobDecode provides a safe gob decoder for Operation, including empty security requirements -func (op *OperationProps) GobDecode(b []byte) error { - var raw gobAlias - - buf := bytes.NewBuffer(b) - err := gob.NewDecoder(buf).Decode(&raw) - if err != nil { - return err - } - if raw.Alias == nil { - return nil - } - - switch { - case raw.SecurityIsEmpty: - // empty, but non-nil security requirement - raw.Alias.Security = []map[string][]string{} - case len(raw.Alias.Security) == 0: - // nil security requirement - raw.Alias.Security = nil - default: - raw.Alias.Security = make([]map[string][]string, 0, len(raw.Security)) - for _, req := range raw.Security { - v := make(map[string][]string, len(req)) - for k, val := range req { - v[k] = make([]string, 0, len(val.List)) - v[k] = append(v[k], val.List...) - } - raw.Alias.Security = append(raw.Alias.Security, v) - } - } - - *op = *(*OperationProps)(raw.Alias) - return nil -} diff --git a/vendor/github.com/go-openapi/spec/parameter.go b/vendor/github.com/go-openapi/spec/parameter.go deleted file mode 100644 index cecdff5..0000000 --- a/vendor/github.com/go-openapi/spec/parameter.go +++ /dev/null @@ -1,321 +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: jsonArray, 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 -} - -// ParamProps describes the specific attributes of an operation parameter -// -// NOTE: -// - Schema is defined when "in" == "body": see validate -// - AllowEmptyValue is allowed where "in" == "query" || "formData" -type ParamProps struct { - Description string `json:"description,omitempty"` - Name string `json:"name,omitempty"` - In string `json:"in,omitempty"` - Required bool `json:"required,omitempty"` - Schema *Schema `json:"schema,omitempty"` - AllowEmptyValue bool `json:"allowEmptyValue,omitempty"` -} - -// Parameter a unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). -// -// There are five possible parameter types. -// * Path - Used together with [Path Templating](#pathTemplating), where the parameter value is actually part -// of the operation's URL. This does not include the host or base path of the API. For example, in `/items/{itemId}`, -// the path parameter is `itemId`. -// * Query - Parameters that are appended to the URL. For example, in `/items?id=###`, the query parameter is `id`. -// * Header - Custom headers that are expected as part of the request. -// * Body - The payload that's appended to the HTTP request. Since there can only be one payload, there can only be -// _one_ body parameter. The name of the body parameter has no effect on the parameter itself and is used for -// documentation purposes only. Since Form parameters are also in the payload, body and form parameters cannot exist -// together for the same operation. -// * Form - Used to describe the payload of an HTTP request when either `application/x-www-form-urlencoded` or -// `multipart/form-data` are used as the content type of the request (in Swagger's definition, -// the [`consumes`](#operationConsumes) property of an operation). This is the only parameter type that can be used -// to send files, thus supporting the `file` type. Since form parameters are sent in the payload, they cannot be -// declared together with a body parameter for the same operation. Form parameters have a different format based on -// the content-type used (for further details, consult http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4). -// * `application/x-www-form-urlencoded` - Similar to the format of Query parameters but as a payload. -// For example, `foo=1&bar=swagger` - both `foo` and `bar` are form parameters. This is normally used for simple -// parameters that are being transferred. -// * `multipart/form-data` - each parameter takes a section in the payload with an internal header. -// For example, for the header `Content-Disposition: form-data; name="submit-name"` the name of the parameter is -// `submit-name`. This type of form parameters is more commonly used for file transfers. -// -// For more information: http://goo.gl/8us55a#parameterObject -type Parameter struct { - Refable - CommonValidations - SimpleSchema - VendorExtensible - ParamProps -} - -// JSONLookup look up a value by the json property name -func (p Parameter) JSONLookup(token string) (interface{}, error) { - if ex, ok := p.Extensions[token]; ok { - return &ex, nil - } - if token == jsonRef { - return &p.Ref, nil - } - - r, _, err := jsonpointer.GetForToken(p.CommonValidations, token) - if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { - return nil, err - } - if r != nil { - return r, nil - } - r, _, err = jsonpointer.GetForToken(p.SimpleSchema, token) - if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { - return nil, err - } - if r != nil { - return r, nil - } - r, _, err = jsonpointer.GetForToken(p.ParamProps, token) - return r, err -} - -// WithDescription a fluent builder method for the description of the parameter -func (p *Parameter) WithDescription(description string) *Parameter { - p.Description = description - return p -} - -// Named a fluent builder method to override the name of the parameter -func (p *Parameter) Named(name string) *Parameter { - p.Name = name - return p -} - -// WithLocation a fluent builder method to override the location of the parameter -func (p *Parameter) WithLocation(in string) *Parameter { - p.In = in - return p -} - -// Typed a fluent builder method for the type of the parameter value -func (p *Parameter) Typed(tpe, format string) *Parameter { - p.Type = tpe - p.Format = format - return p -} - -// CollectionOf a fluent builder method for an array parameter -func (p *Parameter) CollectionOf(items *Items, format string) *Parameter { - p.Type = jsonArray - p.Items = items - p.CollectionFormat = format - return p -} - -// WithDefault sets the default value on this parameter -func (p *Parameter) WithDefault(defaultValue interface{}) *Parameter { - p.AsOptional() // with default implies optional - p.Default = defaultValue - return p -} - -// AllowsEmptyValues flags this parameter as being ok with empty values -func (p *Parameter) AllowsEmptyValues() *Parameter { - p.AllowEmptyValue = true - return p -} - -// NoEmptyValues flags this parameter as not liking empty values -func (p *Parameter) NoEmptyValues() *Parameter { - p.AllowEmptyValue = false - return p -} - -// AsOptional flags this parameter as optional -func (p *Parameter) AsOptional() *Parameter { - p.Required = false - return p -} - -// AsRequired flags this parameter as required -func (p *Parameter) AsRequired() *Parameter { - if p.Default != nil { // with a default required makes no sense - return p - } - p.Required = true - return p -} - -// WithMaxLength sets a max length value -func (p *Parameter) WithMaxLength(max int64) *Parameter { - p.MaxLength = &max - return p -} - -// WithMinLength sets a min length value -func (p *Parameter) WithMinLength(min int64) *Parameter { - p.MinLength = &min - return p -} - -// WithPattern sets a pattern value -func (p *Parameter) WithPattern(pattern string) *Parameter { - p.Pattern = pattern - return p -} - -// WithMultipleOf sets a multiple of value -func (p *Parameter) WithMultipleOf(number float64) *Parameter { - p.MultipleOf = &number - return p -} - -// WithMaximum sets a maximum number value -func (p *Parameter) WithMaximum(max float64, exclusive bool) *Parameter { - p.Maximum = &max - p.ExclusiveMaximum = exclusive - return p -} - -// WithMinimum sets a minimum number value -func (p *Parameter) WithMinimum(min float64, exclusive bool) *Parameter { - p.Minimum = &min - p.ExclusiveMinimum = exclusive - return p -} - -// WithEnum sets a the enum values (replace) -func (p *Parameter) WithEnum(values ...interface{}) *Parameter { - p.Enum = append([]interface{}{}, values...) - return p -} - -// WithMaxItems sets the max items -func (p *Parameter) WithMaxItems(size int64) *Parameter { - p.MaxItems = &size - return p -} - -// WithMinItems sets the min items -func (p *Parameter) WithMinItems(size int64) *Parameter { - p.MinItems = &size - return p -} - -// UniqueValues dictates that this array can only have unique items -func (p *Parameter) UniqueValues() *Parameter { - p.UniqueItems = true - return p -} - -// AllowDuplicates this array can have duplicates -func (p *Parameter) AllowDuplicates() *Parameter { - p.UniqueItems = false - return p -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (p *Parameter) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &p.CommonValidations); err != nil { - return err - } - if err := json.Unmarshal(data, &p.Refable); err != nil { - return err - } - if err := json.Unmarshal(data, &p.SimpleSchema); err != nil { - return err - } - if err := json.Unmarshal(data, &p.VendorExtensible); err != nil { - return err - } - return json.Unmarshal(data, &p.ParamProps) -} - -// MarshalJSON converts this items object to JSON -func (p Parameter) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(p.CommonValidations) - if err != nil { - return nil, err - } - b2, err := json.Marshal(p.SimpleSchema) - if err != nil { - return nil, err - } - b3, err := json.Marshal(p.Refable) - if err != nil { - return nil, err - } - b4, err := json.Marshal(p.VendorExtensible) - if err != nil { - return nil, err - } - b5, err := json.Marshal(p.ParamProps) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b3, b1, b2, b4, b5), nil -} diff --git a/vendor/github.com/go-openapi/spec/path_item.go b/vendor/github.com/go-openapi/spec/path_item.go deleted file mode 100644 index 68fc8e9..0000000 --- a/vendor/github.com/go-openapi/spec/path_item.go +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -// PathItemProps the path item specific properties -type PathItemProps struct { - Get *Operation `json:"get,omitempty"` - Put *Operation `json:"put,omitempty"` - Post *Operation `json:"post,omitempty"` - Delete *Operation `json:"delete,omitempty"` - Options *Operation `json:"options,omitempty"` - Head *Operation `json:"head,omitempty"` - Patch *Operation `json:"patch,omitempty"` - Parameters []Parameter `json:"parameters,omitempty"` -} - -// PathItem describes the operations available on a single path. -// A Path Item may be empty, due to [ACL constraints](http://goo.gl/8us55a#securityFiltering). -// The path itself is still exposed to the documentation viewer but they will -// not know which operations and parameters are available. -// -// For more information: http://goo.gl/8us55a#pathItemObject -type PathItem struct { - Refable - VendorExtensible - PathItemProps -} - -// JSONLookup look up a value by the json property name -func (p PathItem) JSONLookup(token string) (interface{}, error) { - if ex, ok := p.Extensions[token]; ok { - return &ex, nil - } - if token == jsonRef { - return &p.Ref, nil - } - r, _, err := jsonpointer.GetForToken(p.PathItemProps, token) - return r, err -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (p *PathItem) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &p.Refable); err != nil { - return err - } - if err := json.Unmarshal(data, &p.VendorExtensible); err != nil { - return err - } - return json.Unmarshal(data, &p.PathItemProps) -} - -// MarshalJSON converts this items object to JSON -func (p PathItem) MarshalJSON() ([]byte, error) { - b3, err := json.Marshal(p.Refable) - if err != nil { - return nil, err - } - b4, err := json.Marshal(p.VendorExtensible) - if err != nil { - return nil, err - } - b5, err := json.Marshal(p.PathItemProps) - if err != nil { - return nil, err - } - concated := swag.ConcatJSON(b3, b4, b5) - return concated, nil -} diff --git a/vendor/github.com/go-openapi/spec/paths.go b/vendor/github.com/go-openapi/spec/paths.go deleted file mode 100644 index 9dc82a2..0000000 --- a/vendor/github.com/go-openapi/spec/paths.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "fmt" - "strings" - - "github.com/go-openapi/swag" -) - -// Paths holds the relative paths to the individual endpoints. -// The path is appended to the [`basePath`](http://goo.gl/8us55a#swaggerBasePath) in order -// to construct the full URL. -// The Paths may be empty, due to [ACL constraints](http://goo.gl/8us55a#securityFiltering). -// -// For more information: http://goo.gl/8us55a#pathsObject -type Paths struct { - VendorExtensible - Paths map[string]PathItem `json:"-"` // custom serializer to flatten this, each entry must start with "/" -} - -// JSONLookup look up a value by the json property name -func (p Paths) JSONLookup(token string) (interface{}, error) { - if pi, ok := p.Paths[token]; ok { - return &pi, nil - } - if ex, ok := p.Extensions[token]; ok { - return &ex, nil - } - return nil, fmt.Errorf("object has no field %q", token) -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (p *Paths) UnmarshalJSON(data []byte) error { - var res map[string]json.RawMessage - if err := json.Unmarshal(data, &res); err != nil { - return err - } - for k, v := range res { - if strings.HasPrefix(strings.ToLower(k), "x-") { - if p.Extensions == nil { - p.Extensions = make(map[string]interface{}) - } - var d interface{} - if err := json.Unmarshal(v, &d); err != nil { - return err - } - p.Extensions[k] = d - } - if strings.HasPrefix(k, "/") { - if p.Paths == nil { - p.Paths = make(map[string]PathItem) - } - var pi PathItem - if err := json.Unmarshal(v, &pi); err != nil { - return err - } - p.Paths[k] = pi - } - } - return nil -} - -// MarshalJSON converts this items object to JSON -func (p Paths) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(p.VendorExtensible) - if err != nil { - return nil, err - } - - pths := make(map[string]PathItem) - for k, v := range p.Paths { - if strings.HasPrefix(k, "/") { - pths[k] = v - } - } - b2, err := json.Marshal(pths) - if err != nil { - return nil, err - } - concated := swag.ConcatJSON(b1, b2) - return concated, nil -} diff --git a/vendor/github.com/go-openapi/spec/ref.go b/vendor/github.com/go-openapi/spec/ref.go deleted file mode 100644 index 1f31a9e..0000000 --- a/vendor/github.com/go-openapi/spec/ref.go +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "bytes" - "encoding/gob" - "encoding/json" - "net/http" - "os" - "path/filepath" - - "github.com/go-openapi/jsonreference" -) - -// Refable is a struct for things that accept a $ref property -type Refable struct { - Ref Ref -} - -// MarshalJSON marshals the ref to json -func (r Refable) MarshalJSON() ([]byte, error) { - return r.Ref.MarshalJSON() -} - -// UnmarshalJSON unmarshalss the ref from json -func (r *Refable) UnmarshalJSON(d []byte) error { - return json.Unmarshal(d, &r.Ref) -} - -// Ref represents a json reference that is potentially resolved -type Ref struct { - jsonreference.Ref -} - -// RemoteURI gets the remote uri part of the ref -func (r *Ref) RemoteURI() string { - if r.String() == "" { - return 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 { - //#nosec - rr, err := http.Get(v) - if err != nil { - return false - } - defer rr.Body.Close() - - return rr.StatusCode/100 == 2 - } - - if !(r.HasFileScheme || r.HasFullFilePath || r.HasURLPathOnly) { - return false - } - - // check for local file - pth := v - if r.HasURLPathOnly { - base := "." - if len(basepaths) > 0 { - base = filepath.Dir(filepath.Join(basepaths...)) - } - p, e := filepath.Abs(filepath.ToSlash(filepath.Join(base, pth))) - if e != nil { - return false - } - pth = p - } - - fi, err := os.Stat(filepath.ToSlash(pth)) - if err != nil { - return false - } - - return !fi.IsDir() -} - -// Inherits creates a new reference from a parent and a child -// If the child cannot inherit from the parent, an error is returned -func (r *Ref) Inherits(child Ref) (*Ref, error) { - ref, err := r.Ref.Inherits(child.Ref) - if err != nil { - return nil, err - } - return &Ref{Ref: *ref}, nil -} - -// NewRef creates a new instance of a ref object -// returns an error when the reference uri is an invalid uri -func NewRef(refURI string) (Ref, error) { - ref, err := jsonreference.New(refURI) - if err != nil { - return Ref{}, err - } - return Ref{Ref: ref}, nil -} - -// MustCreateRef creates a ref object but panics when refURI is invalid. -// Use the NewRef method for a version that returns an error. -func MustCreateRef(refURI string) Ref { - return Ref{Ref: jsonreference.MustCreateRef(refURI)} -} - -// MarshalJSON marshals this ref into a JSON object -func (r Ref) MarshalJSON() ([]byte, error) { - str := r.String() - if str == "" { - if r.IsRoot() { - return []byte(`{"$ref":""}`), nil - } - return []byte("{}"), nil - } - v := map[string]interface{}{"$ref": str} - return json.Marshal(v) -} - -// UnmarshalJSON unmarshals this ref from a JSON object -func (r *Ref) UnmarshalJSON(d []byte) error { - var v map[string]interface{} - if err := json.Unmarshal(d, &v); err != nil { - return err - } - return r.fromMap(v) -} - -// GobEncode provides a safe gob encoder for Ref -func (r Ref) GobEncode() ([]byte, error) { - var b bytes.Buffer - raw, err := r.MarshalJSON() - if err != nil { - return nil, err - } - err = gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err -} - -// GobDecode provides a safe gob decoder for Ref -func (r *Ref) GobDecode(b []byte) error { - var raw []byte - buf := bytes.NewBuffer(b) - err := gob.NewDecoder(buf).Decode(&raw) - if err != nil { - return err - } - return json.Unmarshal(raw, r) -} - -func (r *Ref) fromMap(v map[string]interface{}) error { - if v == nil { - return nil - } - - if vv, ok := v["$ref"]; ok { - if str, ok := vv.(string); ok { - ref, err := jsonreference.New(str) - if err != nil { - return err - } - *r = Ref{Ref: ref} - } - } - - return nil -} diff --git a/vendor/github.com/go-openapi/spec/response.go b/vendor/github.com/go-openapi/spec/response.go deleted file mode 100644 index 27729c1..0000000 --- a/vendor/github.com/go-openapi/spec/response.go +++ /dev/null @@ -1,131 +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 (r Response) JSONLookup(token string) (interface{}, error) { - if ex, ok := r.Extensions[token]; ok { - return &ex, nil - } - if token == "$ref" { - return &r.Ref, nil - } - ptr, _, err := jsonpointer.GetForToken(r.ResponseProps, token) - return ptr, err -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (r *Response) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &r.ResponseProps); err != nil { - return err - } - if err := json.Unmarshal(data, &r.Refable); err != nil { - return err - } - return json.Unmarshal(data, &r.VendorExtensible) -} - -// MarshalJSON converts this items object to JSON -func (r Response) MarshalJSON() ([]byte, error) { - 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/vendor/github.com/go-openapi/spec/responses.go b/vendor/github.com/go-openapi/spec/responses.go deleted file mode 100644 index 4efb6f8..0000000 --- a/vendor/github.com/go-openapi/spec/responses.go +++ /dev/null @@ -1,127 +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 -} - -// ResponsesProps describes all responses for an operation. -// It tells what is the default response and maps all responses with a -// HTTP status code. -type ResponsesProps struct { - Default *Response - StatusCodeResponses map[int]Response -} - -// MarshalJSON marshals responses as JSON -func (r ResponsesProps) MarshalJSON() ([]byte, error) { - toser := map[string]Response{} - if r.Default != nil { - toser["default"] = *r.Default - } - for k, v := range r.StatusCodeResponses { - toser[strconv.Itoa(k)] = v - } - return json.Marshal(toser) -} - -// UnmarshalJSON unmarshals responses from JSON -func (r *ResponsesProps) UnmarshalJSON(data []byte) error { - var res map[string]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/vendor/github.com/go-openapi/spec/schema.go b/vendor/github.com/go-openapi/spec/schema.go deleted file mode 100644 index 37858ec..0000000 --- a/vendor/github.com/go-openapi/spec/schema.go +++ /dev/null @@ -1,596 +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 -} - -// SchemaProps describes a JSON schema (draft 4) -type SchemaProps struct { - ID string `json:"id,omitempty"` - Ref Ref `json:"-"` - Schema SchemaURL `json:"-"` - Description string `json:"description,omitempty"` - Type StringOrArray `json:"type,omitempty"` - Nullable bool `json:"nullable,omitempty"` - Format string `json:"format,omitempty"` - Title string `json:"title,omitempty"` - Default interface{} `json:"default,omitempty"` - Maximum *float64 `json:"maximum,omitempty"` - ExclusiveMaximum bool `json:"exclusiveMaximum,omitempty"` - Minimum *float64 `json:"minimum,omitempty"` - ExclusiveMinimum bool `json:"exclusiveMinimum,omitempty"` - MaxLength *int64 `json:"maxLength,omitempty"` - MinLength *int64 `json:"minLength,omitempty"` - Pattern string `json:"pattern,omitempty"` - MaxItems *int64 `json:"maxItems,omitempty"` - MinItems *int64 `json:"minItems,omitempty"` - UniqueItems bool `json:"uniqueItems,omitempty"` - MultipleOf *float64 `json:"multipleOf,omitempty"` - Enum []interface{} `json:"enum,omitempty"` - MaxProperties *int64 `json:"maxProperties,omitempty"` - MinProperties *int64 `json:"minProperties,omitempty"` - Required []string `json:"required,omitempty"` - Items *SchemaOrArray `json:"items,omitempty"` - AllOf []Schema `json:"allOf,omitempty"` - OneOf []Schema `json:"oneOf,omitempty"` - AnyOf []Schema `json:"anyOf,omitempty"` - Not *Schema `json:"not,omitempty"` - Properties 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"` -} - -// SwaggerSchemaProps are additional properties supported by swagger schemas, but not JSON-schema (draft 4) -type SwaggerSchemaProps struct { - Discriminator string `json:"discriminator,omitempty"` - ReadOnly bool `json:"readOnly,omitempty"` - XML *XMLObject `json:"xml,omitempty"` - ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` - Example interface{} `json:"example,omitempty"` -} - -// Schema the schema object allows the definition of input and output data types. -// These types can be objects, but also primitives and arrays. -// This object is based on the [JSON Schema Specification Draft 4](http://json-schema.org/) -// and uses a predefined subset of it. -// On top of this subset, there are extensions provided by this specification to allow for more complete documentation. -// -// For more information: http://goo.gl/8us55a#schemaObject -type Schema struct { - VendorExtensible - SchemaProps - SwaggerSchemaProps - ExtraProps map[string]interface{} `json:"-"` -} - -// JSONLookup implements an interface to customize json pointer lookup -func (s Schema) JSONLookup(token string) (interface{}, error) { - if ex, ok := s.Extensions[token]; ok { - return &ex, nil - } - - if ex, ok := s.ExtraProps[token]; ok { - return &ex, nil - } - - r, _, err := jsonpointer.GetForToken(s.SchemaProps, token) - if r != nil || (err != nil && !strings.HasPrefix(err.Error(), "object has no field")) { - return r, err - } - r, _, err = jsonpointer.GetForToken(s.SwaggerSchemaProps, token) - return r, err -} - -// WithID sets the id for this schema, allows for chaining -func (s *Schema) WithID(id string) *Schema { - s.ID = id - return s -} - -// WithTitle sets the title for this schema, allows for chaining -func (s *Schema) WithTitle(title string) *Schema { - s.Title = title - return s -} - -// WithDescription sets the description for this schema, allows for chaining -func (s *Schema) WithDescription(description string) *Schema { - s.Description = description - return s -} - -// WithProperties sets the properties for this schema -func (s *Schema) WithProperties(schemas map[string]Schema) *Schema { - s.Properties = schemas - return s -} - -// SetProperty sets a property on this schema -func (s *Schema) SetProperty(name string, schema Schema) *Schema { - if s.Properties == nil { - s.Properties = make(map[string]Schema) - } - s.Properties[name] = schema - return s -} - -// WithAllOf sets the all of property -func (s *Schema) WithAllOf(schemas ...Schema) *Schema { - s.AllOf = schemas - return s -} - -// WithMaxProperties sets the max number of properties an object can have -func (s *Schema) WithMaxProperties(max int64) *Schema { - s.MaxProperties = &max - return s -} - -// WithMinProperties sets the min number of properties an object must have -func (s *Schema) WithMinProperties(min int64) *Schema { - s.MinProperties = &min - return s -} - -// Typed sets the type of this schema for a single value item -func (s *Schema) Typed(tpe, format string) *Schema { - s.Type = []string{tpe} - s.Format = format - return s -} - -// AddType adds a type with potential format to the types for this schema -func (s *Schema) AddType(tpe, format string) *Schema { - s.Type = append(s.Type, tpe) - if format != "" { - s.Format = format - } - return s -} - -// AsNullable flags this schema as nullable. -func (s *Schema) AsNullable() *Schema { - s.Nullable = true - return s -} - -// CollectionOf a fluent builder method for an array parameter -func (s *Schema) CollectionOf(items Schema) *Schema { - s.Type = []string{jsonArray} - s.Items = &SchemaOrArray{Schema: &items} - return s -} - -// WithDefault sets the default value on this parameter -func (s *Schema) WithDefault(defaultValue interface{}) *Schema { - s.Default = defaultValue - return s -} - -// WithRequired flags this parameter as required -func (s *Schema) WithRequired(items ...string) *Schema { - s.Required = items - return s -} - -// AddRequired adds field names to the required properties array -func (s *Schema) AddRequired(items ...string) *Schema { - s.Required = append(s.Required, items...) - return s -} - -// WithMaxLength sets a max length value -func (s *Schema) WithMaxLength(max int64) *Schema { - s.MaxLength = &max - return s -} - -// WithMinLength sets a min length value -func (s *Schema) WithMinLength(min int64) *Schema { - s.MinLength = &min - return s -} - -// WithPattern sets a pattern value -func (s *Schema) WithPattern(pattern string) *Schema { - s.Pattern = pattern - return s -} - -// WithMultipleOf sets a multiple of value -func (s *Schema) WithMultipleOf(number float64) *Schema { - s.MultipleOf = &number - return s -} - -// WithMaximum sets a maximum number value -func (s *Schema) WithMaximum(max float64, exclusive bool) *Schema { - s.Maximum = &max - s.ExclusiveMaximum = exclusive - return s -} - -// WithMinimum sets a minimum number value -func (s *Schema) WithMinimum(min float64, exclusive bool) *Schema { - s.Minimum = &min - s.ExclusiveMinimum = exclusive - return s -} - -// WithEnum sets a the enum values (replace) -func (s *Schema) WithEnum(values ...interface{}) *Schema { - s.Enum = append([]interface{}{}, values...) - return s -} - -// WithMaxItems sets the max items -func (s *Schema) WithMaxItems(size int64) *Schema { - s.MaxItems = &size - return s -} - -// WithMinItems sets the min items -func (s *Schema) WithMinItems(size int64) *Schema { - s.MinItems = &size - return s -} - -// UniqueValues dictates that this array can only have unique items -func (s *Schema) UniqueValues() *Schema { - s.UniqueItems = true - return s -} - -// AllowDuplicates this array can have duplicates -func (s *Schema) AllowDuplicates() *Schema { - s.UniqueItems = false - return s -} - -// AddToAllOf adds a schema to the allOf property -func (s *Schema) AddToAllOf(schemas ...Schema) *Schema { - s.AllOf = append(s.AllOf, schemas...) - return s -} - -// WithDiscriminator sets the name of the discriminator field -func (s *Schema) WithDiscriminator(discriminator string) *Schema { - s.Discriminator = discriminator - return s -} - -// AsReadOnly flags this schema as readonly -func (s *Schema) AsReadOnly() *Schema { - s.ReadOnly = true - return s -} - -// AsWritable flags this schema as writeable (not read-only) -func (s *Schema) AsWritable() *Schema { - s.ReadOnly = false - return s -} - -// WithExample sets the example for this schema -func (s *Schema) WithExample(example interface{}) *Schema { - s.Example = example - return s -} - -// WithExternalDocs sets/removes the external docs for/from this schema. -// When you pass empty strings as params the external documents will be removed. -// When you pass non-empty string as one value then those values will be used on the external docs object. -// So when you pass a non-empty description, you should also pass the url and vice versa. -func (s *Schema) WithExternalDocs(description, url string) *Schema { - if description == "" && url == "" { - s.ExternalDocs = nil - return s - } - - if s.ExternalDocs == nil { - s.ExternalDocs = &ExternalDocumentation{} - } - s.ExternalDocs.Description = description - s.ExternalDocs.URL = url - return s -} - -// WithXMLName sets the xml name for the object -func (s *Schema) WithXMLName(name string) *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Name = name - return s -} - -// WithXMLNamespace sets the xml namespace for the object -func (s *Schema) WithXMLNamespace(namespace string) *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Namespace = namespace - return s -} - -// WithXMLPrefix sets the xml prefix for the object -func (s *Schema) WithXMLPrefix(prefix string) *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Prefix = prefix - return s -} - -// AsXMLAttribute flags this object as xml attribute -func (s *Schema) AsXMLAttribute() *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Attribute = true - return s -} - -// AsXMLElement flags this object as an xml node -func (s *Schema) AsXMLElement() *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Attribute = false - return s -} - -// AsWrappedXML flags this object as wrapped, this is mostly useful for array types -func (s *Schema) AsWrappedXML() *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Wrapped = true - return s -} - -// AsUnwrappedXML flags this object as an xml node -func (s *Schema) AsUnwrappedXML() *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Wrapped = false - return s -} - -// MarshalJSON marshal this to JSON -func (s Schema) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(s.SchemaProps) - if err != nil { - return nil, fmt.Errorf("schema props %v", err) - } - b2, err := json.Marshal(s.VendorExtensible) - if err != nil { - return nil, fmt.Errorf("vendor props %v", err) - } - b3, err := s.Ref.MarshalJSON() - if err != nil { - return nil, fmt.Errorf("ref prop %v", err) - } - b4, err := s.Schema.MarshalJSON() - if err != nil { - return nil, fmt.Errorf("schema prop %v", err) - } - b5, err := json.Marshal(s.SwaggerSchemaProps) - if err != nil { - return nil, fmt.Errorf("common validations %v", err) - } - var b6 []byte - if s.ExtraProps != nil { - jj, err := json.Marshal(s.ExtraProps) - if err != nil { - return nil, fmt.Errorf("extra props %v", err) - } - b6 = jj - } - return swag.ConcatJSON(b1, b2, b3, b4, b5, b6), nil -} - -// UnmarshalJSON marshal this from JSON -func (s *Schema) UnmarshalJSON(data []byte) error { - props := struct { - SchemaProps - SwaggerSchemaProps - }{} - if err := json.Unmarshal(data, &props); err != nil { - return err - } - - sch := Schema{ - SchemaProps: props.SchemaProps, - SwaggerSchemaProps: props.SwaggerSchemaProps, - } - - var d map[string]interface{} - if err := json.Unmarshal(data, &d); err != nil { - return err - } - - _ = sch.Ref.fromMap(d) - _ = sch.Schema.fromMap(d) - - delete(d, "$ref") - delete(d, "$schema") - for _, pn := range swag.DefaultJSONNameProvider.GetJSONNames(s) { - delete(d, pn) - } - - for k, vv := range d { - lk := strings.ToLower(k) - if strings.HasPrefix(lk, "x-") { - if sch.Extensions == nil { - sch.Extensions = map[string]interface{}{} - } - sch.Extensions[k] = vv - continue - } - if sch.ExtraProps == nil { - sch.ExtraProps = map[string]interface{}{} - } - sch.ExtraProps[k] = vv - } - - *s = sch - - return nil -} diff --git a/vendor/github.com/go-openapi/spec/schema_loader.go b/vendor/github.com/go-openapi/spec/schema_loader.go deleted file mode 100644 index 961d477..0000000 --- a/vendor/github.com/go-openapi/spec/schema_loader.go +++ /dev/null @@ -1,271 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "fmt" - "log" - "net/url" - "reflect" - "strings" - - "github.com/go-openapi/swag" -) - -// PathLoader 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 - } -} - -// resolverContext allows to share a context during spec processing. -// At the moment, it just holds the index of circular references found. -type resolverContext struct { - // circulars holds all visited circular references, which allows shortcuts. - // NOTE: this is not just a performance improvement: it is required to figure out - // circular references which participate several cycles. - // This structure is privately instantiated and needs not be locked against - // concurrent access, unless we chose to implement a parallel spec walking. - circulars map[string]bool - basePath string -} - -func newResolverContext(originalBasePath string) *resolverContext { - return &resolverContext{ - circulars: make(map[string]bool), - basePath: originalBasePath, // keep the root base path in context - } -} - -type schemaLoader struct { - root interface{} - options *ExpandOptions - cache ResolutionCache - context *resolverContext - loadDoc func(string) (json.RawMessage, error) -} - -func (r *schemaLoader) transitiveResolver(basePath string, ref Ref) (*schemaLoader, error) { - if ref.IsRoot() || ref.HasFragmentOnly { - return r, nil - } - - baseRef, _ := NewRef(basePath) - currentRef := normalizeFileRef(&ref, basePath) - if strings.HasPrefix(currentRef.String(), baseRef.String()) { - return r, nil - } - - // Set a new root to resolve against - rootURL := currentRef.GetURL() - rootURL.Fragment = "" - root, _ := r.cache.Get(rootURL.String()) - - // shallow copy of resolver options to set a new RelativeBase when - // traversing multiple documents - newOptions := r.options - newOptions.RelativeBase = rootURL.String() - debugLog("setting new root: %s", newOptions.RelativeBase) - return defaultSchemaLoader(root, newOptions, r.cache, r.context) -} - -func (r *schemaLoader) updateBasePath(transitive *schemaLoader, basePath string) string { - if transitive != r { - debugLog("got a new resolver") - if transitive.options != nil && transitive.options.RelativeBase != "" { - basePath, _ = absPath(transitive.options.RelativeBase) - debugLog("new basePath = %s", basePath) - } - } - return basePath -} - -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, erb := NewRef(basePath); erb == 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 - } - } - return swag.DynamicJSONToStruct(res, target) -} - -func (r *schemaLoader) load(refURL *url.URL) (interface{}, url.URL, bool, error) { - debugLog("loading schema from url: %s", refURL) - toFetch := *refURL - toFetch.Fragment = "" - - normalized := normalizeAbsPath(toFetch.String()) - - data, fromCache := r.cache.Get(normalized) - if !fromCache { - b, err := r.loadDoc(normalized) - if err != nil { - debugLog("unable to load the document: %v", err) - return nil, url.URL{}, false, err - } - - if err := json.Unmarshal(b, &data); err != nil { - return nil, url.URL{}, false, err - } - r.cache.Set(normalized, data) - } - - return data, toFetch, fromCache, nil -} - -// isCircular detects cycles in sequences of $ref. -// It relies on a private context (which needs not be locked). -func (r *schemaLoader) isCircular(ref *Ref, basePath string, parentRefs ...string) (foundCycle bool) { - normalizedRef := normalizePaths(ref.String(), basePath) - if _, ok := r.context.circulars[normalizedRef]; ok { - // circular $ref has been already detected in another explored cycle - foundCycle = true - return - } - foundCycle = swag.ContainsStringsCI(parentRefs, normalizedRef) - if foundCycle { - r.context.circulars[normalizedRef] = true - } - return -} - -// Resolve resolves a reference against basePath and stores the result in target -// Resolve is not in charge of following references, it only resolves ref by following its URL -// if the schema 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) -} - -func (r *schemaLoader) deref(input interface{}, parentRefs []string, basePath string) error { - var ref *Ref - switch refable := input.(type) { - case *Schema: - ref = &refable.Ref - case *Parameter: - ref = &refable.Ref - case *Response: - ref = &refable.Ref - case *PathItem: - ref = &refable.Ref - default: - return fmt.Errorf("deref: unsupported type %T", input) - } - - curRef := ref.String() - if curRef != "" { - normalizedRef := normalizeFileRef(ref, basePath) - normalizedBasePath := normalizedRef.RemoteURI() - - if r.isCircular(normalizedRef, basePath, parentRefs...) { - return nil - } - - if err := r.resolveRef(ref, input, basePath); r.shouldStopOnError(err) { - return err - } - - // NOTE(fredbi): removed basePath check => needs more testing - if ref.String() != "" && ref.String() != curRef { - parentRefs = append(parentRefs, normalizedRef.String()) - return r.deref(input, parentRefs, normalizedBasePath) - } - } - - return nil -} - -func (r *schemaLoader) shouldStopOnError(err error) bool { - if err != nil && !r.options.ContinueOnError { - return true - } - - if err != nil { - log.Println(err) - } - - return false -} - -func defaultSchemaLoader( - root interface{}, - expandOptions *ExpandOptions, - cache ResolutionCache, - context *resolverContext) (*schemaLoader, error) { - - if cache == nil { - cache = resCache - } - if expandOptions == nil { - expandOptions = &ExpandOptions{} - } - absBase, _ := absPath(expandOptions.RelativeBase) - if context == nil { - context = newResolverContext(absBase) - } - return &schemaLoader{ - root: root, - options: expandOptions, - cache: cache, - context: context, - loadDoc: func(path string) (json.RawMessage, error) { - debugLog("fetching document at %q", path) - return PathLoader(path) - }, - }, nil -} diff --git a/vendor/github.com/go-openapi/spec/security_scheme.go b/vendor/github.com/go-openapi/spec/security_scheme.go deleted file mode 100644 index fe35384..0000000 --- a/vendor/github.com/go-openapi/spec/security_scheme.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -const ( - basic = "basic" - apiKey = "apiKey" - oauth2 = "oauth2" - implicit = "implicit" - password = "password" - application = "application" - accessCode = "accessCode" -) - -// BasicAuth creates a basic auth security scheme -func BasicAuth() *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{Type: basic}} -} - -// APIKeyAuth creates an api key auth security scheme -func APIKeyAuth(fieldName, valueSource string) *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{Type: apiKey, Name: fieldName, In: valueSource}} -} - -// OAuth2Implicit creates an implicit flow oauth2 security scheme -func OAuth2Implicit(authorizationURL string) *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ - Type: oauth2, - Flow: implicit, - AuthorizationURL: authorizationURL, - }} -} - -// OAuth2Password creates a password flow oauth2 security scheme -func OAuth2Password(tokenURL string) *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ - Type: oauth2, - Flow: password, - TokenURL: tokenURL, - }} -} - -// OAuth2Application creates an application flow oauth2 security scheme -func OAuth2Application(tokenURL string) *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ - Type: oauth2, - Flow: application, - TokenURL: tokenURL, - }} -} - -// OAuth2AccessToken creates an access token flow oauth2 security scheme -func OAuth2AccessToken(authorizationURL, tokenURL string) *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ - Type: oauth2, - Flow: accessCode, - AuthorizationURL: authorizationURL, - TokenURL: tokenURL, - }} -} - -// SecuritySchemeProps describes a swagger security scheme in the securityDefinitions section -type SecuritySchemeProps struct { - Description string `json:"description,omitempty"` - Type string `json:"type"` - Name string `json:"name,omitempty"` // api key - In string `json:"in,omitempty"` // api key - Flow string `json:"flow,omitempty"` // oauth2 - AuthorizationURL string `json:"authorizationUrl,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 - } - return json.Unmarshal(data, &s.VendorExtensible) -} diff --git a/vendor/github.com/go-openapi/spec/spec.go b/vendor/github.com/go-openapi/spec/spec.go deleted file mode 100644 index 0bb045b..0000000 --- a/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/vendor/github.com/go-openapi/spec/swagger.go b/vendor/github.com/go-openapi/spec/swagger.go deleted file mode 100644 index 44722ff..0000000 --- a/vendor/github.com/go-openapi/spec/swagger.go +++ /dev/null @@ -1,448 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "bytes" - "encoding/gob" - "encoding/json" - "fmt" - "strconv" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -// Swagger this is the root document object for the API specification. -// It combines what previously was the Resource Listing and API Declaration (version 1.2 and earlier) -// together into one document. -// -// For more information: http://goo.gl/8us55a#swagger-object- -type Swagger struct { - VendorExtensible - SwaggerProps -} - -// JSONLookup look up a value by the json property name -func (s Swagger) JSONLookup(token string) (interface{}, error) { - if ex, ok := s.Extensions[token]; ok { - return &ex, nil - } - r, _, err := jsonpointer.GetForToken(s.SwaggerProps, token) - return r, err -} - -// MarshalJSON marshals this swagger structure to json -func (s Swagger) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(s.SwaggerProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(s.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2), nil -} - -// UnmarshalJSON unmarshals a swagger spec from json -func (s *Swagger) UnmarshalJSON(data []byte) error { - var sw Swagger - if err := json.Unmarshal(data, &sw.SwaggerProps); err != nil { - return err - } - if err := json.Unmarshal(data, &sw.VendorExtensible); err != nil { - return err - } - *s = sw - return nil -} - -// GobEncode provides a safe gob encoder for Swagger, including extensions -func (s Swagger) GobEncode() ([]byte, error) { - var b bytes.Buffer - raw := struct { - Props SwaggerProps - Ext VendorExtensible - }{ - Props: s.SwaggerProps, - Ext: s.VendorExtensible, - } - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err -} - -// GobDecode provides a safe gob decoder for Swagger, including extensions -func (s *Swagger) GobDecode(b []byte) error { - var raw struct { - Props SwaggerProps - Ext VendorExtensible - } - buf := bytes.NewBuffer(b) - err := gob.NewDecoder(buf).Decode(&raw) - if err != nil { - return err - } - s.SwaggerProps = raw.Props - s.VendorExtensible = raw.Ext - return nil -} - -// SwaggerProps captures the top-level properties of an Api specification -// -// NOTE: validation rules -// - the scheme, when present must be from [http, https, ws, wss] -// - BasePath must start with a leading "/" -// - Paths is required -type SwaggerProps struct { - ID string `json:"id,omitempty"` - Consumes []string `json:"consumes,omitempty"` - Produces []string `json:"produces,omitempty"` - Schemes []string `json:"schemes,omitempty"` - Swagger string `json:"swagger,omitempty"` - Info *Info `json:"info,omitempty"` - Host string `json:"host,omitempty"` - BasePath string `json:"basePath,omitempty"` - Paths *Paths `json:"paths"` - Definitions Definitions `json:"definitions,omitempty"` - Parameters map[string]Parameter `json:"parameters,omitempty"` - Responses map[string]Response `json:"responses,omitempty"` - SecurityDefinitions SecurityDefinitions `json:"securityDefinitions,omitempty"` - Security []map[string][]string `json:"security,omitempty"` - Tags []Tag `json:"tags,omitempty"` - ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` -} - -type swaggerPropsAlias SwaggerProps - -type gobSwaggerPropsAlias struct { - Security []map[string]struct { - List []string - Pad bool - } - Alias *swaggerPropsAlias - SecurityIsEmpty bool -} - -// GobEncode provides a safe gob encoder for SwaggerProps, including empty security requirements -func (o SwaggerProps) GobEncode() ([]byte, error) { - raw := gobSwaggerPropsAlias{ - Alias: (*swaggerPropsAlias)(&o), - } - - var b bytes.Buffer - if o.Security == nil { - // nil security requirement - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err - } - - if len(o.Security) == 0 { - // empty, but non-nil security requirement - raw.SecurityIsEmpty = true - raw.Alias.Security = nil - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err - } - - raw.Security = make([]map[string]struct { - List []string - Pad bool - }, 0, len(o.Security)) - for _, req := range o.Security { - v := make(map[string]struct { - List []string - Pad bool - }, len(req)) - for k, val := range req { - v[k] = struct { - List []string - Pad bool - }{ - List: val, - } - } - raw.Security = append(raw.Security, v) - } - - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err -} - -// GobDecode provides a safe gob decoder for SwaggerProps, including empty security requirements -func (o *SwaggerProps) GobDecode(b []byte) error { - var raw gobSwaggerPropsAlias - - buf := bytes.NewBuffer(b) - err := gob.NewDecoder(buf).Decode(&raw) - if err != nil { - return err - } - if raw.Alias == nil { - return nil - } - - switch { - case raw.SecurityIsEmpty: - // empty, but non-nil security requirement - raw.Alias.Security = []map[string][]string{} - case len(raw.Alias.Security) == 0: - // nil security requirement - raw.Alias.Security = nil - default: - raw.Alias.Security = make([]map[string][]string, 0, len(raw.Security)) - for _, req := range raw.Security { - v := make(map[string][]string, len(req)) - for k, val := range req { - v[k] = make([]string, 0, len(val.List)) - v[k] = append(v[k], val.List...) - } - raw.Alias.Security = append(raw.Alias.Security, v) - } - } - - *o = *(*SwaggerProps)(raw.Alias) - return nil -} - -// Dependencies represent a dependencies property -type Dependencies map[string]SchemaOrStringArray - -// SchemaOrBool represents a schema or boolean value, is biased towards true for the boolean property -type SchemaOrBool struct { - Allows bool - Schema *Schema -} - -// JSONLookup implements an interface to customize json pointer lookup -func (s SchemaOrBool) JSONLookup(token string) (interface{}, error) { - if token == "allows" { - return s.Allows, nil - } - r, _, err := jsonpointer.GetForToken(s.Schema, token) - return r, err -} - -var jsTrue = []byte("true") -var jsFalse = []byte("false") - -// MarshalJSON convert this object to JSON -func (s SchemaOrBool) MarshalJSON() ([]byte, error) { - if s.Schema != nil { - return json.Marshal(s.Schema) - } - - if s.Schema == nil && !s.Allows { - return jsFalse, nil - } - return jsTrue, nil -} - -// UnmarshalJSON converts this bool or schema object from a JSON structure -func (s *SchemaOrBool) UnmarshalJSON(data []byte) error { - var nw SchemaOrBool - if len(data) >= 4 { - if data[0] == '{' { - var sch Schema - if err := json.Unmarshal(data, &sch); err != nil { - return err - } - nw.Schema = &sch - } - nw.Allows = !(data[0] == 'f' && data[1] == 'a' && data[2] == 'l' && data[3] == 's' && data[4] == 'e') - } - *s = nw - return nil -} - -// SchemaOrStringArray represents a schema or a string array -type SchemaOrStringArray struct { - Schema *Schema - Property []string -} - -// JSONLookup implements an interface to customize json pointer lookup -func (s SchemaOrStringArray) JSONLookup(token string) (interface{}, error) { - r, _, err := jsonpointer.GetForToken(s.Schema, token) - return r, err -} - -// MarshalJSON converts this schema object or array into JSON structure -func (s SchemaOrStringArray) MarshalJSON() ([]byte, error) { - if len(s.Property) > 0 { - return json.Marshal(s.Property) - } - if s.Schema != nil { - return json.Marshal(s.Schema) - } - return []byte("null"), nil -} - -// UnmarshalJSON converts this schema object or array from a JSON structure -func (s *SchemaOrStringArray) UnmarshalJSON(data []byte) error { - var first byte - if len(data) > 1 { - first = data[0] - } - var nw SchemaOrStringArray - if first == '{' { - var sch Schema - if err := json.Unmarshal(data, &sch); err != nil { - return err - } - nw.Schema = &sch - } - if first == '[' { - if err := json.Unmarshal(data, &nw.Property); err != nil { - return err - } - } - *s = nw - return nil -} - -// Definitions contains the models explicitly defined in this spec -// An object to hold data types that can be consumed and produced by operations. -// These data types can be primitives, arrays or models. -// -// For more information: http://goo.gl/8us55a#definitionsObject -type Definitions map[string]Schema - -// SecurityDefinitions a declaration of the security schemes available to be used in the specification. -// This does not enforce the security schemes on the operations and only serves to provide -// the relevant details for each scheme. -// -// For more information: http://goo.gl/8us55a#securityDefinitionsObject -type SecurityDefinitions map[string]*SecurityScheme - -// StringOrArray represents a value that can either be a string -// or an array of strings. Mainly here for serialization purposes -type StringOrArray []string - -// Contains returns true when the value is contained in the slice -func (s StringOrArray) Contains(value string) bool { - for _, str := range s { - if str == value { - return true - } - } - return false -} - -// JSONLookup implements an interface to customize json pointer lookup -func (s SchemaOrArray) JSONLookup(token string) (interface{}, error) { - if _, err := strconv.Atoi(token); err == nil { - r, _, err := jsonpointer.GetForToken(s.Schemas, token) - return r, err - } - r, _, err := jsonpointer.GetForToken(s.Schema, token) - return r, err -} - -// UnmarshalJSON unmarshals this string or array object from a JSON array or JSON string -func (s *StringOrArray) UnmarshalJSON(data []byte) error { - var first byte - if len(data) > 1 { - first = data[0] - } - - if first == '[' { - var parsed []string - if err := json.Unmarshal(data, &parsed); err != nil { - return err - } - *s = StringOrArray(parsed) - return nil - } - - var single interface{} - if err := json.Unmarshal(data, &single); err != nil { - return err - } - if single == nil { - return nil - } - switch v := single.(type) { - case string: - *s = StringOrArray([]string{v}) - return nil - default: - return fmt.Errorf("only string or array is allowed, not %T", single) - } -} - -// MarshalJSON converts this string or array to a JSON array or JSON string -func (s StringOrArray) MarshalJSON() ([]byte, error) { - if len(s) == 1 { - return json.Marshal([]string(s)[0]) - } - return json.Marshal([]string(s)) -} - -// SchemaOrArray represents a value that can either be a Schema -// or an array of Schema. Mainly here for serialization purposes -type SchemaOrArray struct { - Schema *Schema - Schemas []Schema -} - -// Len returns the number of schemas in this property -func (s SchemaOrArray) Len() int { - if s.Schema != nil { - return 1 - } - return len(s.Schemas) -} - -// ContainsType returns true when one of the schemas is of the specified type -func (s *SchemaOrArray) ContainsType(name string) bool { - if s.Schema != nil { - return s.Schema.Type != nil && s.Schema.Type.Contains(name) - } - return false -} - -// MarshalJSON converts this schema object or array into JSON structure -func (s SchemaOrArray) MarshalJSON() ([]byte, error) { - if len(s.Schemas) > 0 { - return json.Marshal(s.Schemas) - } - return json.Marshal(s.Schema) -} - -// UnmarshalJSON converts this schema object or array from a JSON structure -func (s *SchemaOrArray) UnmarshalJSON(data []byte) error { - var nw SchemaOrArray - var first byte - if len(data) > 1 { - first = data[0] - } - if first == '{' { - var sch Schema - if err := json.Unmarshal(data, &sch); err != nil { - return err - } - nw.Schema = &sch - } - if first == '[' { - if err := json.Unmarshal(data, &nw.Schemas); err != nil { - return err - } - } - *s = nw - return nil -} - -// vim:set ft=go noet sts=2 sw=2 ts=2: diff --git a/vendor/github.com/go-openapi/spec/tag.go b/vendor/github.com/go-openapi/spec/tag.go deleted file mode 100644 index faa3d3d..0000000 --- a/vendor/github.com/go-openapi/spec/tag.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -// TagProps describe a tag entry in the top level tags section of a swagger spec -type TagProps struct { - Description string `json:"description,omitempty"` - Name string `json:"name,omitempty"` - ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` -} - -// NewTag creates a new tag -func NewTag(name, description string, externalDocs *ExternalDocumentation) Tag { - return Tag{TagProps: TagProps{Description: description, Name: name, ExternalDocs: externalDocs}} -} - -// Tag allows adding meta data to a single tag that is used by the -// [Operation Object](http://goo.gl/8us55a#operationObject). -// It is not mandatory to have a Tag Object per tag used there. -// -// For more information: http://goo.gl/8us55a#tagObject -type Tag struct { - VendorExtensible - TagProps -} - -// JSONLookup implements an interface to customize json pointer lookup -func (t Tag) JSONLookup(token string) (interface{}, error) { - if ex, ok := t.Extensions[token]; ok { - return &ex, nil - } - - r, _, err := jsonpointer.GetForToken(t.TagProps, token) - return r, err -} - -// MarshalJSON marshal this to JSON -func (t Tag) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(t.TagProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(t.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2), nil -} - -// UnmarshalJSON marshal this from JSON -func (t *Tag) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &t.TagProps); err != nil { - return err - } - return json.Unmarshal(data, &t.VendorExtensible) -} diff --git a/vendor/github.com/go-openapi/spec/unused.go b/vendor/github.com/go-openapi/spec/unused.go deleted file mode 100644 index aa12b56..0000000 --- a/vendor/github.com/go-openapi/spec/unused.go +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -/* - -import ( - "net/url" - "os" - "path" - "path/filepath" - - "github.com/go-openapi/jsonpointer" -) - - // Some currently unused functions and definitions that - // used to be part of the expander. - - // Moved here for the record and possible future reuse - -var ( - idPtr, _ = jsonpointer.New("/id") - refPtr, _ = jsonpointer.New("/$ref") -) - -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 -} - -// 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() -} -*/ - -// 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 -// } diff --git a/vendor/github.com/go-openapi/spec/xml_object.go b/vendor/github.com/go-openapi/spec/xml_object.go deleted file mode 100644 index 945a467..0000000 --- a/vendor/github.com/go-openapi/spec/xml_object.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -// XMLObject a metadata object that allows for more fine-tuned XML model definitions. -// -// For more information: http://goo.gl/8us55a#xmlObject -type XMLObject struct { - Name string `json:"name,omitempty"` - Namespace string `json:"namespace,omitempty"` - Prefix string `json:"prefix,omitempty"` - Attribute bool `json:"attribute,omitempty"` - Wrapped bool `json:"wrapped,omitempty"` -} - -// WithName sets the xml name for the object -func (x *XMLObject) WithName(name string) *XMLObject { - x.Name = name - return x -} - -// WithNamespace sets the xml namespace for the object -func (x *XMLObject) WithNamespace(namespace string) *XMLObject { - x.Namespace = namespace - return x -} - -// WithPrefix sets the xml prefix for the object -func (x *XMLObject) WithPrefix(prefix string) *XMLObject { - x.Prefix = prefix - return x -} - -// AsAttribute flags this object as xml attribute -func (x *XMLObject) AsAttribute() *XMLObject { - x.Attribute = true - return x -} - -// AsElement flags this object as an xml node -func (x *XMLObject) AsElement() *XMLObject { - x.Attribute = false - return x -} - -// AsWrapped flags this object as wrapped, this is mostly useful for array types -func (x *XMLObject) AsWrapped() *XMLObject { - x.Wrapped = true - return x -} - -// AsUnwrapped flags this object as an xml node -func (x *XMLObject) AsUnwrapped() *XMLObject { - x.Wrapped = false - return x -} diff --git a/vendor/github.com/go-openapi/swag/.editorconfig b/vendor/github.com/go-openapi/swag/.editorconfig deleted file mode 100644 index 3152da6..0000000 --- a/vendor/github.com/go-openapi/swag/.editorconfig +++ /dev/null @@ -1,26 +0,0 @@ -# top-most EditorConfig file -root = true - -# Unix-style newlines with a newline ending every file -[*] -end_of_line = lf -insert_final_newline = true -indent_style = space -indent_size = 2 -trim_trailing_whitespace = true - -# Set default charset -[*.{js,py,go,scala,rb,java,html,css,less,sass,md}] -charset = utf-8 - -# Tab indentation (no size specified) -[*.go] -indent_style = tab - -[*.md] -trim_trailing_whitespace = false - -# Matches the exact files either package.json or .travis.yml -[{package.json,.travis.yml}] -indent_style = space -indent_size = 2 diff --git a/vendor/github.com/go-openapi/swag/.gitignore b/vendor/github.com/go-openapi/swag/.gitignore deleted file mode 100644 index d69b53a..0000000 --- a/vendor/github.com/go-openapi/swag/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -secrets.yml -vendor -Godeps -.idea diff --git a/vendor/github.com/go-openapi/swag/.golangci.yml b/vendor/github.com/go-openapi/swag/.golangci.yml deleted file mode 100644 index 625c3d6..0000000 --- a/vendor/github.com/go-openapi/swag/.golangci.yml +++ /dev/null @@ -1,22 +0,0 @@ -linters-settings: - govet: - check-shadowing: true - golint: - min-confidence: 0 - gocyclo: - min-complexity: 25 - maligned: - suggest-new: true - dupl: - threshold: 100 - goconst: - min-len: 3 - min-occurrences: 2 - -linters: - enable-all: true - disable: - - maligned - - lll - - gochecknoinits - - gochecknoglobals diff --git a/vendor/github.com/go-openapi/swag/.travis.yml b/vendor/github.com/go-openapi/swag/.travis.yml deleted file mode 100644 index f1a3f80..0000000 --- a/vendor/github.com/go-openapi/swag/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -after_success: -- bash <(curl -s https://codecov.io/bash) -go: -- 1.13.x -- 1.14.x -install: -- GO111MODULE=off go get -u gotest.tools/gotestsum -language: go -notifications: - slack: - secure: QUWvCkBBK09GF7YtEvHHVt70JOkdlNBG0nIKu/5qc4/nW5HP8I2w0SEf/XR2je0eED1Qe3L/AfMCWwrEj+IUZc3l4v+ju8X8R3Lomhme0Eb0jd1MTMCuPcBT47YCj0M7RON7vXtbFfm1hFJ/jLe5+9FXz0hpXsR24PJc5ZIi/ogNwkaPqG4BmndzecpSh0vc2FJPZUD9LT0I09REY/vXR0oQAalLkW0asGD5taHZTUZq/kBpsNxaAFrLM23i4mUcf33M5fjLpvx5LRICrX/57XpBrDh2TooBU6Qj3CgoY0uPRYUmSNxbVx1czNzl2JtEpb5yjoxfVPQeg0BvQM00G8LJINISR+ohrjhkZmAqchDupAX+yFrxTtORa78CtnIL6z/aTNlgwwVD8kvL/1pFA/JWYmKDmz93mV/+6wubGzNSQCstzjkFA4/iZEKewKUoRIAi/fxyscP6L/rCpmY/4llZZvrnyTqVbt6URWpopUpH4rwYqreXAtJxJsfBJIeSmUIiDIOMGkCTvyTEW3fWGmGoqWtSHLoaWDyAIGb7azb+KvfpWtEcoPFWfSWU+LGee0A/YsUhBl7ADB9A0CJEuR8q4BPpKpfLwPKSiKSAXL7zDkyjExyhtgqbSl2jS+rKIHOZNL8JkCcTP2MKMVd563C5rC5FMKqu3S9m2b6380E= -script: -- gotestsum -f short-verbose -- -race -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/vendor/github.com/go-openapi/swag/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/swag/CODE_OF_CONDUCT.md deleted file mode 100644 index 9322b06..0000000 --- a/vendor/github.com/go-openapi/swag/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at ivan+abuse@flanders.co.nz. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/github.com/go-openapi/swag/LICENSE b/vendor/github.com/go-openapi/swag/LICENSE deleted file mode 100644 index d645695..0000000 --- a/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/vendor/github.com/go-openapi/swag/README.md b/vendor/github.com/go-openapi/swag/README.md deleted file mode 100644 index eb60ae8..0000000 --- a/vendor/github.com/go-openapi/swag/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# Swag [![Build Status](https://travis-ci.org/go-openapi/swag.svg?branch=master)](https://travis-ci.org/go-openapi/swag) [![codecov](https://codecov.io/gh/go-openapi/swag/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/swag) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) - -[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/swag/master/LICENSE) -[![GoDoc](https://godoc.org/github.com/go-openapi/swag?status.svg)](http://godoc.org/github.com/go-openapi/swag) -[![GolangCI](https://golangci.com/badges/github.com/go-openapi/swag.svg)](https://golangci.com) -[![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/swag)](https://goreportcard.com/report/github.com/go-openapi/swag) - -Contains a bunch of helper functions for go-openapi and go-swagger projects. - -You may also use it standalone for your projects. - -* convert between value and pointers for builtin types -* convert from string to builtin types (wraps strconv) -* fast json concatenation -* search in path -* load from file or http -* name mangling - - -This repo has only few dependencies outside of the standard library: - -* YAML utilities depend on gopkg.in/yaml.v2 diff --git a/vendor/github.com/go-openapi/swag/convert.go b/vendor/github.com/go-openapi/swag/convert.go deleted file mode 100644 index fc085ae..0000000 --- a/vendor/github.com/go-openapi/swag/convert.go +++ /dev/null @@ -1,208 +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 - epsilon float64 = 1e-9 -) - -// 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 - } - fa := math.Abs(f) - g := float64(uint64(f)) - ga := math.Abs(g) - - diff := math.Abs(f - g) - - // more info: https://floating-point-gui.de/errors/comparison/#look-out-for-edge-cases - switch { - case f == g: // best case - return true - case f == float64(int64(f)) || f == float64(uint64(f)): // optimistic case - return true - case f == 0 || g == 0 || diff < math.SmallestNonzeroFloat64: // very close to 0 values - return diff < (epsilon * math.SmallestNonzeroFloat64) - } - // check the relative error - return diff/math.Min(fa+ga, math.MaxFloat64) < epsilon -} - -var evaluatesAsTrue map[string]struct{} - -func init() { - evaluatesAsTrue = map[string]struct{}{ - "true": {}, - "1": {}, - "yes": {}, - "ok": {}, - "y": {}, - "on": {}, - "selected": {}, - "checked": {}, - "t": {}, - "enabled": {}, - } -} - -// 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 an int8 -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 an 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 an 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 an int64 -func ConvertInt64(str string) (int64, error) { - return strconv.ParseInt(str, 10, 64) -} - -// ConvertUint8 turn a string into an 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 an 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 an 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 an 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/vendor/github.com/go-openapi/swag/convert_types.go b/vendor/github.com/go-openapi/swag/convert_types.go deleted file mode 100644 index bfba823..0000000 --- a/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 int32 value passed in. -func Int32(v int32) *int32 { - return &v -} - -// Int32Value returns the value of the int32 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 int32 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 pointer to of the uint value passed in. -func Uint(v uint) *uint { - return &v -} - -// UintValue returns the value of the uint pointer passed in or -// 0 if the pointer is nil. -func UintValue(v *uint) uint { - if v != nil { - return *v - } - return 0 -} - -// UintSlice converts a slice of uint values into a slice of -// uint pointers -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 pointers into 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 into a string -// map of uint pointers -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 pointers into 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 pointer to of the uint32 value passed in. -func Uint32(v uint32) *uint32 { - return &v -} - -// Uint32Value returns the value of the uint32 pointer passed in or -// 0 if the pointer is nil. -func Uint32Value(v *uint32) uint32 { - if v != nil { - return *v - } - return 0 -} - -// Uint32Slice converts a slice of uint32 values into a slice of -// uint32 pointers -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 pointers into 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 into a string -// map of uint32 pointers -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 pointers into 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 pointer to of the uint64 value passed in. -func Uint64(v uint64) *uint64 { - return &v -} - -// Uint64Value returns the value of the uint64 pointer passed in or -// 0 if the pointer is nil. -func Uint64Value(v *uint64) uint64 { - if v != nil { - return *v - } - return 0 -} - -// Uint64Slice converts a slice of uint64 values into a slice of -// uint64 pointers -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 pointers into 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 into a string -// map of uint64 pointers -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 pointers into 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/vendor/github.com/go-openapi/swag/doc.go b/vendor/github.com/go-openapi/swag/doc.go deleted file mode 100644 index 8d2c8c5..0000000 --- a/vendor/github.com/go-openapi/swag/doc.go +++ /dev/null @@ -1,32 +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 contains a bunch of helper functions for go-openapi and go-swagger projects. - -You may also use it standalone for your projects. - - * convert between value and pointers for builtin types - * convert from string to builtin types (wraps strconv) - * fast json concatenation - * search in path - * load from file or http - * name mangling - - -This repo has only few dependencies outside of the standard library: - - * YAML utilities depend on gopkg.in/yaml.v2 -*/ -package swag diff --git a/vendor/github.com/go-openapi/swag/go.mod b/vendor/github.com/go-openapi/swag/go.mod deleted file mode 100644 index 4aef463..0000000 --- a/vendor/github.com/go-openapi/swag/go.mod +++ /dev/null @@ -1,16 +0,0 @@ -module github.com/go-openapi/swag - -require ( - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/kr/pretty v0.1.0 // indirect - github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63 - github.com/stretchr/testify v1.3.0 - gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect - gopkg.in/yaml.v2 v2.2.4 -) - -replace github.com/golang/lint => golang.org/x/lint v0.0.0-20190409202823-959b441ac422 - -replace sourcegraph.com/sourcegraph/go-diff => github.com/sourcegraph/go-diff v0.5.1 - -go 1.13 diff --git a/vendor/github.com/go-openapi/swag/go.sum b/vendor/github.com/go-openapi/swag/go.sum deleted file mode 100644 index e8a80ba..0000000 --- a/vendor/github.com/go-openapi/swag/go.sum +++ /dev/null @@ -1,20 +0,0 @@ -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63 h1:nTT4s92Dgz2HlrB2NaMgvlfqHH39OgMhA7z3PK7PGD4= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/go-openapi/swag/json.go b/vendor/github.com/go-openapi/swag/json.go deleted file mode 100644 index 7e9902c..0000000 --- a/vendor/github.com/go-openapi/swag/json.go +++ /dev/null @@ -1,312 +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" -) - -// nullJSON represents a JSON object with null type -var nullJSON = []byte("null") - -// DefaultJSONNameProvider the default cache for types -var DefaultJSONNameProvider = NewNameProvider() - -const comma = byte(',') - -var closers map[byte]byte - -func init() { - 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 marshaler -// 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 unmarshaler -// so it takes the fastest option available -func ReadJSON(data []byte, value interface{}) error { - trimmedData := bytes.Trim(data, "\x00") - if d, ok := value.(ejUnmarshaler); ok { - jl := &jlexer.Lexer{Data: trimmedData} - d.UnmarshalEasyJSON(jl) - return jl.Error() - } - if d, ok := value.(json.Unmarshaler); ok { - return d.UnmarshalJSON(trimmedData) - } - return json.Unmarshal(trimmedData, 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 - } - return ReadJSON(b, target) -} - -// ConcatJSON concatenates multiple json objects efficiently -func ConcatJSON(blobs ...[]byte) []byte { - if len(blobs) == 0 { - return nil - } - - last := len(blobs) - 1 - for blobs[last] == nil || bytes.Equal(blobs[last], nullJSON) { - // strips trailing null objects - last-- - if last < 0 { - // there was nothing but "null"s or nil... - return nil - } - } - if last == 0 { - return blobs[0] - } - - var opening, closing byte - var idx, a int - buf := bytes.NewBuffer(nil) - - for i, b := range blobs[:last+1] { - if b == nil || bytes.Equal(b, nullJSON) { - // a null object is in the list: skip it - continue - } - 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 capable 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) - } - - res := make([]string, 0, len(names.jsonNames)) - 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/vendor/github.com/go-openapi/swag/loading.go b/vendor/github.com/go-openapi/swag/loading.go deleted file mode 100644 index 70f4fb3..0000000 --- a/vendor/github.com/go-openapi/swag/loading.go +++ /dev/null @@ -1,80 +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) { - upth, err := pathUnescape(pth) - if err != nil { - return nil, err - } - return local(filepath.FromSlash(upth)) - } -} - -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/vendor/github.com/go-openapi/swag/name_lexem.go b/vendor/github.com/go-openapi/swag/name_lexem.go deleted file mode 100644 index aa7f6a9..0000000 --- a/vendor/github.com/go-openapi/swag/name_lexem.go +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package swag - -import "unicode" - -type ( - nameLexem interface { - GetUnsafeGoName() string - GetOriginal() string - IsInitialism() bool - } - - initialismNameLexem struct { - original string - matchedInitialism string - } - - casualNameLexem struct { - original string - } -) - -func newInitialismNameLexem(original, matchedInitialism string) *initialismNameLexem { - return &initialismNameLexem{ - original: original, - matchedInitialism: matchedInitialism, - } -} - -func newCasualNameLexem(original string) *casualNameLexem { - return &casualNameLexem{ - original: original, - } -} - -func (l *initialismNameLexem) GetUnsafeGoName() string { - return l.matchedInitialism -} - -func (l *casualNameLexem) GetUnsafeGoName() string { - var first rune - var rest string - for i, orig := range l.original { - if i == 0 { - first = orig - continue - } - if i > 0 { - rest = l.original[i:] - break - } - } - if len(l.original) > 1 { - return string(unicode.ToUpper(first)) + lower(rest) - } - - return l.original -} - -func (l *initialismNameLexem) GetOriginal() string { - return l.original -} - -func (l *casualNameLexem) GetOriginal() string { - return l.original -} - -func (l *initialismNameLexem) IsInitialism() bool { - return true -} - -func (l *casualNameLexem) IsInitialism() bool { - return false -} diff --git a/vendor/github.com/go-openapi/swag/net.go b/vendor/github.com/go-openapi/swag/net.go deleted file mode 100644 index 821235f..0000000 --- a/vendor/github.com/go-openapi/swag/net.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package 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/vendor/github.com/go-openapi/swag/path.go b/vendor/github.com/go-openapi/swag/path.go deleted file mode 100644 index 941bd01..0000000 --- a/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/vendor/github.com/go-openapi/swag/post_go18.go b/vendor/github.com/go-openapi/swag/post_go18.go deleted file mode 100644 index c2e686d..0000000 --- a/vendor/github.com/go-openapi/swag/post_go18.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. - -// +build go1.8 - -package swag - -import "net/url" - -func pathUnescape(path string) (string, error) { - return url.PathUnescape(path) -} diff --git a/vendor/github.com/go-openapi/swag/post_go19.go b/vendor/github.com/go-openapi/swag/post_go19.go deleted file mode 100644 index eb2f2d8..0000000 --- a/vendor/github.com/go-openapi/swag/post_go19.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// +build go1.9 - -package swag - -import ( - "sort" - "sync" -) - -// indexOfInitialisms is a thread-safe implementation of the sorted index of initialisms. -// Since go1.9, this may be implemented with sync.Map. -type indexOfInitialisms struct { - sortMutex *sync.Mutex - index *sync.Map -} - -func newIndexOfInitialisms() *indexOfInitialisms { - return &indexOfInitialisms{ - sortMutex: new(sync.Mutex), - index: new(sync.Map), - } -} - -func (m *indexOfInitialisms) load(initial map[string]bool) *indexOfInitialisms { - m.sortMutex.Lock() - defer m.sortMutex.Unlock() - for k, v := range initial { - m.index.Store(k, v) - } - return m -} - -func (m *indexOfInitialisms) isInitialism(key string) bool { - _, ok := m.index.Load(key) - return ok -} - -func (m *indexOfInitialisms) add(key string) *indexOfInitialisms { - m.index.Store(key, true) - return m -} - -func (m *indexOfInitialisms) sorted() (result []string) { - m.sortMutex.Lock() - defer m.sortMutex.Unlock() - m.index.Range(func(key, value interface{}) bool { - k := key.(string) - result = append(result, k) - return true - }) - sort.Sort(sort.Reverse(byInitialism(result))) - return -} diff --git a/vendor/github.com/go-openapi/swag/pre_go18.go b/vendor/github.com/go-openapi/swag/pre_go18.go deleted file mode 100644 index 6607f33..0000000 --- a/vendor/github.com/go-openapi/swag/pre_go18.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. - -// +build !go1.8 - -package swag - -import "net/url" - -func pathUnescape(path string) (string, error) { - return url.QueryUnescape(path) -} diff --git a/vendor/github.com/go-openapi/swag/pre_go19.go b/vendor/github.com/go-openapi/swag/pre_go19.go deleted file mode 100644 index 4bae187..0000000 --- a/vendor/github.com/go-openapi/swag/pre_go19.go +++ /dev/null @@ -1,69 +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. - -// +build !go1.9 - -package swag - -import ( - "sort" - "sync" -) - -// indexOfInitialisms is a thread-safe implementation of the sorted index of initialisms. -// Before go1.9, this may be implemented with a mutex on the map. -type indexOfInitialisms struct { - getMutex *sync.Mutex - index map[string]bool -} - -func newIndexOfInitialisms() *indexOfInitialisms { - return &indexOfInitialisms{ - getMutex: new(sync.Mutex), - index: make(map[string]bool, 50), - } -} - -func (m *indexOfInitialisms) load(initial map[string]bool) *indexOfInitialisms { - m.getMutex.Lock() - defer m.getMutex.Unlock() - for k, v := range initial { - m.index[k] = v - } - return m -} - -func (m *indexOfInitialisms) isInitialism(key string) bool { - m.getMutex.Lock() - defer m.getMutex.Unlock() - _, ok := m.index[key] - return ok -} - -func (m *indexOfInitialisms) add(key string) *indexOfInitialisms { - m.getMutex.Lock() - defer m.getMutex.Unlock() - m.index[key] = true - return m -} - -func (m *indexOfInitialisms) sorted() (result []string) { - m.getMutex.Lock() - defer m.getMutex.Unlock() - for k := range m.index { - result = append(result, k) - } - sort.Sort(sort.Reverse(byInitialism(result))) - return -} diff --git a/vendor/github.com/go-openapi/swag/split.go b/vendor/github.com/go-openapi/swag/split.go deleted file mode 100644 index a1825fb..0000000 --- a/vendor/github.com/go-openapi/swag/split.go +++ /dev/null @@ -1,262 +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 ( - "unicode" -) - -var nameReplaceTable = map[rune]string{ - '@': "At ", - '&': "And ", - '|': "Pipe ", - '$': "Dollar ", - '!': "Bang ", - '-': "", - '_': "", -} - -type ( - splitter struct { - postSplitInitialismCheck bool - initialisms []string - } - - splitterOption func(*splitter) *splitter -) - -// split calls the splitter; splitter provides more control and post options -func split(str string) []string { - lexems := newSplitter().split(str) - result := make([]string, 0, len(lexems)) - - for _, lexem := range lexems { - result = append(result, lexem.GetOriginal()) - } - - return result - -} - -func (s *splitter) split(str string) []nameLexem { - return s.toNameLexems(str) -} - -func newSplitter(options ...splitterOption) *splitter { - splitter := &splitter{ - postSplitInitialismCheck: false, - initialisms: initialisms, - } - - for _, option := range options { - splitter = option(splitter) - } - - return splitter -} - -// withPostSplitInitialismCheck allows to catch initialisms after main split process -func withPostSplitInitialismCheck(s *splitter) *splitter { - s.postSplitInitialismCheck = true - return s -} - -type ( - initialismMatch struct { - start, end int - body []rune - complete bool - } - initialismMatches []*initialismMatch -) - -func (s *splitter) toNameLexems(name string) []nameLexem { - nameRunes := []rune(name) - matches := s.gatherInitialismMatches(nameRunes) - return s.mapMatchesToNameLexems(nameRunes, matches) -} - -func (s *splitter) gatherInitialismMatches(nameRunes []rune) initialismMatches { - matches := make(initialismMatches, 0) - - for currentRunePosition, currentRune := range nameRunes { - newMatches := make(initialismMatches, 0, len(matches)) - - // check current initialism matches - for _, match := range matches { - if keepCompleteMatch := match.complete; keepCompleteMatch { - newMatches = append(newMatches, match) - continue - } - - // drop failed match - currentMatchRune := match.body[currentRunePosition-match.start] - if !s.initialismRuneEqual(currentMatchRune, currentRune) { - continue - } - - // try to complete ongoing match - if currentRunePosition-match.start == len(match.body)-1 { - // we are close; the next step is to check the symbol ahead - // if it is a small letter, then it is not the end of match - // but beginning of the next word - - if currentRunePosition < len(nameRunes)-1 { - nextRune := nameRunes[currentRunePosition+1] - if newWord := unicode.IsLower(nextRune); newWord { - // oh ok, it was the start of a new word - continue - } - } - - match.complete = true - match.end = currentRunePosition - } - - newMatches = append(newMatches, match) - } - - // check for new initialism matches - for _, initialism := range s.initialisms { - initialismRunes := []rune(initialism) - if s.initialismRuneEqual(initialismRunes[0], currentRune) { - newMatches = append(newMatches, &initialismMatch{ - start: currentRunePosition, - body: initialismRunes, - complete: false, - }) - } - } - - matches = newMatches - } - - return matches -} - -func (s *splitter) mapMatchesToNameLexems(nameRunes []rune, matches initialismMatches) []nameLexem { - nameLexems := make([]nameLexem, 0) - - var lastAcceptedMatch *initialismMatch - for _, match := range matches { - if !match.complete { - continue - } - - if firstMatch := lastAcceptedMatch == nil; firstMatch { - nameLexems = append(nameLexems, s.breakCasualString(nameRunes[:match.start])...) - nameLexems = append(nameLexems, s.breakInitialism(string(match.body))) - - lastAcceptedMatch = match - - continue - } - - if overlappedMatch := match.start <= lastAcceptedMatch.end; overlappedMatch { - continue - } - - middle := nameRunes[lastAcceptedMatch.end+1 : match.start] - nameLexems = append(nameLexems, s.breakCasualString(middle)...) - nameLexems = append(nameLexems, s.breakInitialism(string(match.body))) - - lastAcceptedMatch = match - } - - // we have not found any accepted matches - if lastAcceptedMatch == nil { - return s.breakCasualString(nameRunes) - } - - if lastAcceptedMatch.end+1 != len(nameRunes) { - rest := nameRunes[lastAcceptedMatch.end+1:] - nameLexems = append(nameLexems, s.breakCasualString(rest)...) - } - - return nameLexems -} - -func (s *splitter) initialismRuneEqual(a, b rune) bool { - return a == b -} - -func (s *splitter) breakInitialism(original string) nameLexem { - return newInitialismNameLexem(original, original) -} - -func (s *splitter) breakCasualString(str []rune) []nameLexem { - segments := make([]nameLexem, 0) - currentSegment := "" - - addCasualNameLexem := func(original string) { - segments = append(segments, newCasualNameLexem(original)) - } - - addInitialismNameLexem := func(original, match string) { - segments = append(segments, newInitialismNameLexem(original, match)) - } - - addNameLexem := func(original string) { - if s.postSplitInitialismCheck { - for _, initialism := range s.initialisms { - if upper(initialism) == upper(original) { - addInitialismNameLexem(original, initialism) - return - } - } - } - - addCasualNameLexem(original) - } - - for _, rn := range string(str) { - if replace, found := nameReplaceTable[rn]; found { - if currentSegment != "" { - addNameLexem(currentSegment) - currentSegment = "" - } - - if replace != "" { - addNameLexem(replace) - } - - continue - } - - if !unicode.In(rn, unicode.L, unicode.M, unicode.N, unicode.Pc) { - if currentSegment != "" { - addNameLexem(currentSegment) - currentSegment = "" - } - - continue - } - - if unicode.IsUpper(rn) { - if currentSegment != "" { - addNameLexem(currentSegment) - } - currentSegment = "" - } - - currentSegment += string(rn) - } - - if currentSegment != "" { - addNameLexem(currentSegment) - } - - return segments -} diff --git a/vendor/github.com/go-openapi/swag/util.go b/vendor/github.com/go-openapi/swag/util.go deleted file mode 100644 index 9eac16a..0000000 --- a/vendor/github.com/go-openapi/swag/util.go +++ /dev/null @@ -1,385 +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 ( - "reflect" - "strings" - "unicode" -) - -// commonInitialisms are common acronyms that are kept as whole uppercased words. -var commonInitialisms *indexOfInitialisms - -// initialisms is a slice of sorted initialisms -var initialisms []string - -var isInitialism func(string) bool - -// GoNamePrefixFunc sets an optional rule to prefix go names -// which do not start with a letter. -// -// e.g. to help converting "123" into "{prefix}123" -// -// The default is to prefix with "X" -var GoNamePrefixFunc func(string) string - -func init() { - // Taken from https://github.com/golang/lint/blob/3390df4df2787994aea98de825b964ac7944b817/lint.go#L732-L769 - var configuredInitialisms = 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, - "IPv4": true, - "IPv6": 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, - } - - // a thread-safe index of initialisms - commonInitialisms = newIndexOfInitialisms().load(configuredInitialisms) - initialisms = commonInitialisms.sorted() - - // a test function - isInitialism = commonInitialisms.isInitialism -} - -const ( - //collectionFormatComma = "csv" - collectionFormatSpace = "ssv" - collectionFormatTab = "tsv" - collectionFormatPipe = "pipes" - collectionFormatMulti = "multi" -) - -// JoinByFormat joins a string array by a known format (e.g. swagger's collectionFormat attribute): -// 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 collectionFormatSpace: - sep = " " - case collectionFormatTab: - sep = "\t" - case collectionFormatPipe: - sep = "|" - case collectionFormatMulti: - 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 collectionFormatSpace: - sep = " " - case collectionFormatTab: - sep = "\t" - case collectionFormatPipe: - sep = "|" - case collectionFormatMulti: - 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 byInitialism []string - -func (s byInitialism) Len() int { - return len(s) -} -func (s byInitialism) Swap(i, j int) { - s[i], s[j] = s[j], s[i] -} -func (s byInitialism) Less(i, j int) bool { - if len(s[i]) != len(s[j]) { - return len(s[i]) < len(s[j]) - } - - return strings.Compare(s[i], s[j]) > 0 -} - -// 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 []rune(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 { - in := split(name) - out := make([]string, 0, len(in)) - - for _, w := range in { - out = append(out, lower(w)) - } - - return strings.Join(out, "_") -} - -// ToCommandName lowercases and underscores a go type name -func ToCommandName(name string) string { - in := split(name) - out := make([]string, 0, len(in)) - - for _, w := range in { - 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 { - in := newSplitter(withPostSplitInitialismCheck).split(name) - out := make([]string, 0, len(in)) - - for _, w := range in { - if !w.IsInitialism() { - out = append(out, lower(w.GetOriginal())) - } else { - out = append(out, w.GetOriginal()) - } - } - - 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 { - in := newSplitter(withPostSplitInitialismCheck).split(name) - - out := make([]string, 0, len(in)) - for _, w := range in { - original := w.GetOriginal() - if !w.IsInitialism() { - out = append(out, Camelize(original)) - } else { - out = append(out, original) - } - } - return strings.Join(out, " ") -} - -// ToJSONName camelcases a name which can be underscored or pascal cased -func ToJSONName(name string) string { - in := split(name) - out := make([]string, 0, len(in)) - - for i, w := range in { - if i == 0 { - out = append(out, lower(w)) - continue - } - out = append(out, Camelize(w)) - } - return strings.Join(out, "") -} - -// ToVarName camelcases a name which can be underscored or pascal cased -func ToVarName(name string) string { - res := ToGoName(name) - if isInitialism(res) { - 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 { - lexems := newSplitter(withPostSplitInitialismCheck).split(name) - - result := "" - for _, lexem := range lexems { - goName := lexem.GetUnsafeGoName() - - // to support old behavior - if lexem.IsInitialism() { - goName = upper(goName) - } - result += goName - } - - if len(result) > 0 { - // Only prefix with X when the first character isn't an ascii letter - first := []rune(result)[0] - if !unicode.IsLetter(first) || (first > unicode.MaxASCII && !unicode.IsUpper(first)) { - if GoNamePrefixFunc == nil { - return "X" + result - } - result = GoNamePrefixFunc(name) + result - } - first = []rune(result)[0] - if unicode.IsLetter(first) && !unicode.IsUpper(first) { - result = string(append([]rune{unicode.ToUpper(first)}, []rune(result)[1:]...)) - } - } - - return result -} - -// ContainsStrings searches a slice of strings for a case-sensitive match -func ContainsStrings(coll []string, item string) bool { - for _, a := range coll { - if a == item { - return true - } - } - return false -} - -// 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 - commonInitialisms.add(upper(word)) - } - // sort again - initialisms = commonInitialisms.sorted() -} - -// CommandLineOptionsGroup represents a group of user-defined command line options -type CommandLineOptionsGroup struct { - ShortDescription string - LongDescription string - Options interface{} -} diff --git a/vendor/github.com/go-openapi/swag/yaml.go b/vendor/github.com/go-openapi/swag/yaml.go deleted file mode 100644 index ec96914..0000000 --- a/vendor/github.com/go-openapi/swag/yaml.go +++ /dev/null @@ -1,246 +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 -} - -// BytesToYAMLDoc converts a byte slice into a YAML document -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 -} - -// JSONMapSlice represent a JSON object, with the order of keys maintained -type JSONMapSlice []JSONMapItem - -// MarshalJSON renders a JSONMapSlice as JSON -func (s JSONMapSlice) MarshalJSON() ([]byte, error) { - w := &jwriter.Writer{Flags: jwriter.NilMapAsEmpty | jwriter.NilSliceAsEmpty} - s.MarshalEasyJSON(w) - return w.BuildBytes() -} - -// MarshalEasyJSON renders a JSONMapSlice as JSON, using easyJSON -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('}') -} - -// UnmarshalJSON makes a JSONMapSlice from JSON -func (s *JSONMapSlice) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - s.UnmarshalEasyJSON(&l) - return l.Error() -} - -// UnmarshalEasyJSON makes a JSONMapSlice from JSON, using easyJSON -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 -} - -// JSONMapItem represents the value of a key in a JSON object held by JSONMapSlice -type JSONMapItem struct { - Key string - Value interface{} -} - -// MarshalJSON renders a JSONMapItem as JSON -func (s JSONMapItem) MarshalJSON() ([]byte, error) { - w := &jwriter.Writer{Flags: jwriter.NilMapAsEmpty | jwriter.NilSliceAsEmpty} - s.MarshalEasyJSON(w) - return w.BuildBytes() -} - -// MarshalEasyJSON renders a JSONMapItem as JSON, using easyJSON -func (s JSONMapItem) MarshalEasyJSON(w *jwriter.Writer) { - w.String(s.Key) - w.RawByte(':') - w.Raw(WriteJSON(s.Value)) -} - -// UnmarshalJSON makes a JSONMapItem from JSON -func (s *JSONMapItem) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - s.UnmarshalEasyJSON(&l) - return l.Error() -} - -// UnmarshalEasyJSON makes a JSONMapItem from JSON, using easyJSON -func (s *JSONMapItem) UnmarshalEasyJSON(in *jlexer.Lexer) { - key := in.UnsafeString() - in.WantColon() - value := in.Interface() - in.WantComma() - s.Key = key - s.Value = value -} - -func transformData(input interface{}) (out interface{}, err error) { - format := func(t interface{}) (string, error) { - switch k := t.(type) { - case string: - return k, nil - case uint: - return strconv.FormatUint(uint64(k), 10), nil - case uint8: - return strconv.FormatUint(uint64(k), 10), nil - case uint16: - return strconv.FormatUint(uint64(k), 10), nil - case uint32: - return strconv.FormatUint(uint64(k), 10), nil - case uint64: - return strconv.FormatUint(k, 10), nil - case int: - return strconv.Itoa(k), nil - case int8: - return strconv.FormatInt(int64(k), 10), nil - case int16: - return strconv.FormatInt(int64(k), 10), nil - case int32: - return strconv.FormatInt(int64(k), 10), nil - case int64: - return strconv.FormatInt(k, 10), nil - default: - return "", fmt.Errorf("unexpected map key type, got: %T", k) - } - } - - switch in := input.(type) { - case yaml.MapSlice: - - o := make(JSONMapSlice, len(in)) - for i, mi := range in { - var nmi JSONMapItem - if nmi.Key, err = format(mi.Key); err != nil { - return nil, err - } - - v, ert := transformData(mi.Value) - if ert != nil { - return nil, ert - } - 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 - if nmi.Key, err = format(ke); err != nil { - return nil, err - } - - v, ert := transformData(va) - if ert != nil { - return nil, ert - } - 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 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/vendor/github.com/gogo/protobuf/proto/Makefile b/vendor/github.com/gogo/protobuf/proto/Makefile deleted file mode 100644 index 00d65f3..0000000 --- a/vendor/github.com/gogo/protobuf/proto/Makefile +++ /dev/null @@ -1,43 +0,0 @@ -# Go support for Protocol Buffers - Google's data interchange format -# -# Copyright 2010 The Go Authors. All rights reserved. -# https://github.com/golang/protobuf -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -install: - go install - -test: install generate-test-pbs - go test - - -generate-test-pbs: - make install - make -C test_proto - make -C proto3_proto - make diff --git a/vendor/github.com/golang/glog/README b/vendor/github.com/golang/glog/README deleted file mode 100644 index 387b4eb..0000000 --- a/vendor/github.com/golang/glog/README +++ /dev/null @@ -1,44 +0,0 @@ -glog -==== - -Leveled execution logs for Go. - -This is an efficient pure Go implementation of leveled logs in the -manner of the open source C++ package - https://github.com/google/glog - -By binding methods to booleans it is possible to use the log package -without paying the expense of evaluating the arguments to the log. -Through the -vmodule flag, the package also provides fine-grained -control over logging at the file level. - -The comment from glog.go introduces the ideas: - - Package glog implements logging analogous to the Google-internal - C++ INFO/ERROR/V setup. It provides functions Info, Warning, - Error, Fatal, plus formatting variants such as Infof. It - also provides V-style logging controlled by the -v and - -vmodule=file=2 flags. - - Basic examples: - - glog.Info("Prepare to repel boarders") - - glog.Fatalf("Initialization failed: %s", err) - - See the documentation for the V function for an explanation - of these examples: - - if glog.V(2) { - glog.Info("Starting transaction...") - } - - glog.V(2).Infoln("Processed", nItems, "elements") - - -The repository contains an open source version of the log package -used inside Google. The master copy of the source lives inside -Google, not here. The code in this repo is for export only and is not itself -under development. Feature requests will be ignored. - -Send bug reports to golang-nuts@googlegroups.com. diff --git a/vendor/github.com/golang/groupcache/lru/lru.go b/vendor/github.com/golang/groupcache/lru/lru.go index eac1c76..cdfe299 100644 --- a/vendor/github.com/golang/groupcache/lru/lru.go +++ b/vendor/github.com/golang/groupcache/lru/lru.go @@ -25,7 +25,7 @@ type Cache struct { // an item is evicted. Zero means no limit. MaxEntries int - // OnEvicted optionally specifies a callback function to be + // OnEvicted optionally specificies a callback function to be // executed when an entry is purged from the cache. OnEvicted func(key Key, value interface{}) @@ -119,15 +119,3 @@ func (c *Cache) Len() int { } return c.ll.Len() } - -// Clear purges all stored items from the cache. -func (c *Cache) Clear() { - if c.OnEvicted != nil { - for _, e := range c.cache { - kv := e.Value.(*entry) - c.OnEvicted(kv.key, kv.value) - } - } - c.ll = nil - c.cache = nil -} diff --git a/vendor/github.com/golang/protobuf/ptypes/any/any.proto b/vendor/github.com/golang/protobuf/ptypes/any/any.proto deleted file mode 100644 index c9be854..0000000 --- a/vendor/github.com/golang/protobuf/ptypes/any/any.proto +++ /dev/null @@ -1,155 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package google.protobuf; - -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; -option go_package = "github.com/golang/protobuf/ptypes/any"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "AnyProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; - -// `Any` contains an arbitrary serialized protocol buffer message along with a -// URL that describes the type of the serialized message. -// -// Protobuf library provides support to pack/unpack Any values in the form -// of utility functions or additional generated methods of the Any type. -// -// Example 1: Pack and unpack a message in C++. -// -// Foo foo = ...; -// Any any; -// any.PackFrom(foo); -// ... -// if (any.UnpackTo(&foo)) { -// ... -// } -// -// Example 2: Pack and unpack a message in Java. -// -// Foo foo = ...; -// Any any = Any.pack(foo); -// ... -// if (any.is(Foo.class)) { -// foo = any.unpack(Foo.class); -// } -// -// Example 3: Pack and unpack a message in Python. -// -// foo = Foo(...) -// any = Any() -// any.Pack(foo) -// ... -// if any.Is(Foo.DESCRIPTOR): -// any.Unpack(foo) -// ... -// -// Example 4: Pack and unpack a message in Go -// -// foo := &pb.Foo{...} -// any, err := ptypes.MarshalAny(foo) -// ... -// foo := &pb.Foo{} -// if err := ptypes.UnmarshalAny(any, foo); err != nil { -// ... -// } -// -// The pack methods provided by protobuf library will by default use -// 'type.googleapis.com/full.type.name' as the type URL and the unpack -// methods only use the fully qualified type name after the last '/' -// in the type URL, for example "foo.bar.com/x/y.z" will yield type -// name "y.z". -// -// -// JSON -// ==== -// The JSON representation of an `Any` value uses the regular -// representation of the deserialized, embedded message, with an -// additional field `@type` which contains the type URL. Example: -// -// package google.profile; -// message Person { -// string first_name = 1; -// string last_name = 2; -// } -// -// { -// "@type": "type.googleapis.com/google.profile.Person", -// "firstName": , -// "lastName": -// } -// -// If the embedded message type is well-known and has a custom JSON -// representation, that representation will be embedded adding a field -// `value` which holds the custom JSON in addition to the `@type` -// field. Example (for message [google.protobuf.Duration][]): -// -// { -// "@type": "type.googleapis.com/google.protobuf.Duration", -// "value": "1.212s" -// } -// -message Any { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - // - string type_url = 1; - - // Must be a valid serialized protocol buffer of the above specified type. - bytes value = 2; -} diff --git a/vendor/github.com/golang/protobuf/ptypes/duration/duration.proto b/vendor/github.com/golang/protobuf/ptypes/duration/duration.proto deleted file mode 100644 index 99cb102..0000000 --- a/vendor/github.com/golang/protobuf/ptypes/duration/duration.proto +++ /dev/null @@ -1,116 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package google.protobuf; - -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; -option cc_enable_arenas = true; -option go_package = "github.com/golang/protobuf/ptypes/duration"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "DurationProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; - -// A Duration represents a signed, fixed-length span of time represented -// as a count of seconds and fractions of seconds at nanosecond -// resolution. It is independent of any calendar and concepts like "day" -// or "month". It is related to Timestamp in that the difference between -// two Timestamp values is a Duration and it can be added or subtracted -// from a Timestamp. Range is approximately +-10,000 years. -// -// # Examples -// -// Example 1: Compute Duration from two Timestamps in pseudo code. -// -// Timestamp start = ...; -// Timestamp end = ...; -// Duration duration = ...; -// -// duration.seconds = end.seconds - start.seconds; -// duration.nanos = end.nanos - start.nanos; -// -// if (duration.seconds < 0 && duration.nanos > 0) { -// duration.seconds += 1; -// duration.nanos -= 1000000000; -// } else if (duration.seconds > 0 && duration.nanos < 0) { -// duration.seconds -= 1; -// duration.nanos += 1000000000; -// } -// -// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. -// -// Timestamp start = ...; -// Duration duration = ...; -// Timestamp end = ...; -// -// end.seconds = start.seconds + duration.seconds; -// end.nanos = start.nanos + duration.nanos; -// -// if (end.nanos < 0) { -// end.seconds -= 1; -// end.nanos += 1000000000; -// } else if (end.nanos >= 1000000000) { -// end.seconds += 1; -// end.nanos -= 1000000000; -// } -// -// Example 3: Compute Duration from datetime.timedelta in Python. -// -// td = datetime.timedelta(days=3, minutes=10) -// duration = Duration() -// duration.FromTimedelta(td) -// -// # JSON Mapping -// -// In JSON format, the Duration type is encoded as a string rather than an -// object, where the string ends in the suffix "s" (indicating seconds) and -// is preceded by the number of seconds, with nanoseconds expressed as -// fractional seconds. For example, 3 seconds with 0 nanoseconds should be -// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should -// be expressed in JSON format as "3.000000001s", and 3 seconds and 1 -// microsecond should be expressed in JSON format as "3.000001s". -// -// -message Duration { - // Signed seconds of the span of time. Must be from -315,576,000,000 - // to +315,576,000,000 inclusive. Note: these bounds are computed from: - // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - int64 seconds = 1; - - // Signed fractions of a second at nanosecond resolution of the span - // of time. Durations less than one second are represented with a 0 - // `seconds` field and a positive or negative `nanos` field. For durations - // of one second or more, a non-zero value for the `nanos` field must be - // of the same sign as the `seconds` field. Must be from -999,999,999 - // to +999,999,999 inclusive. - int32 nanos = 2; -} diff --git a/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto b/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto deleted file mode 100644 index cd35786..0000000 --- a/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto +++ /dev/null @@ -1,138 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package google.protobuf; - -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; -option cc_enable_arenas = true; -option go_package = "github.com/golang/protobuf/ptypes/timestamp"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "TimestampProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; - -// A Timestamp represents a point in time independent of any time zone or local -// calendar, encoded as a count of seconds and fractions of seconds at -// nanosecond resolution. The count is relative to an epoch at UTC midnight on -// January 1, 1970, in the proleptic Gregorian calendar which extends the -// Gregorian calendar backwards to year one. -// -// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap -// second table is needed for interpretation, using a [24-hour linear -// smear](https://developers.google.com/time/smear). -// -// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By -// restricting to that range, we ensure that we can convert to and from [RFC -// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. -// -// # Examples -// -// Example 1: Compute Timestamp from POSIX `time()`. -// -// Timestamp timestamp; -// timestamp.set_seconds(time(NULL)); -// timestamp.set_nanos(0); -// -// Example 2: Compute Timestamp from POSIX `gettimeofday()`. -// -// struct timeval tv; -// gettimeofday(&tv, NULL); -// -// Timestamp timestamp; -// timestamp.set_seconds(tv.tv_sec); -// timestamp.set_nanos(tv.tv_usec * 1000); -// -// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. -// -// FILETIME ft; -// GetSystemTimeAsFileTime(&ft); -// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; -// -// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z -// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. -// Timestamp timestamp; -// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); -// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); -// -// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. -// -// long millis = System.currentTimeMillis(); -// -// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) -// .setNanos((int) ((millis % 1000) * 1000000)).build(); -// -// -// Example 5: Compute Timestamp from current time in Python. -// -// timestamp = Timestamp() -// timestamp.GetCurrentTime() -// -// # JSON Mapping -// -// In JSON format, the Timestamp type is encoded as a string in the -// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the -// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" -// where {year} is always expressed using four digits while {month}, {day}, -// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional -// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), -// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone -// is required. A proto3 JSON serializer should always use UTC (as indicated by -// "Z") when printing the Timestamp type and a proto3 JSON parser should be -// able to accept both UTC and other timezones (as indicated by an offset). -// -// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past -// 01:30 UTC on January 15, 2017. -// -// In JavaScript, one can convert a Date object to this format using the -// standard -// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) -// method. In Python, a standard `datetime.datetime` object can be converted -// to this format using -// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with -// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use -// the Joda Time's [`ISODateTimeFormat.dateTime()`]( -// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D -// ) to obtain a formatter capable of generating timestamps in this format. -// -// -message Timestamp { - // Represents seconds of UTC time since Unix epoch - // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - // 9999-12-31T23:59:59Z inclusive. - int64 seconds = 1; - - // Non-negative fractions of a second at nanosecond resolution. Negative - // second values with fractions must still have non-negative nanos values - // that count forward in time. Must be from 0 to 999,999,999 - // inclusive. - int32 nanos = 2; -} diff --git a/vendor/github.com/google/go-cmp/cmp/compare.go b/vendor/github.com/google/go-cmp/cmp/compare.go index c9a63ce..2133562 100644 --- a/vendor/github.com/google/go-cmp/cmp/compare.go +++ b/vendor/github.com/google/go-cmp/cmp/compare.go @@ -22,8 +22,8 @@ // equality is determined by recursively comparing the primitive kinds on both // values, much like reflect.DeepEqual. Unlike reflect.DeepEqual, unexported // fields are not compared by default; they result in panics unless suppressed -// by using an Ignore option (see cmpopts.IgnoreUnexported) or explicitly -// compared using the Exporter option. +// by using an Ignore option (see cmpopts.IgnoreUnexported) or explicitly compared +// using the AllowUnexported option. package cmp import ( @@ -62,8 +62,8 @@ import ( // // Structs are equal if recursively calling Equal on all fields report equal. // If a struct contains unexported fields, Equal panics unless an Ignore option -// (e.g., cmpopts.IgnoreUnexported) ignores that field or the Exporter option -// explicitly permits comparing the unexported field. +// (e.g., cmpopts.IgnoreUnexported) ignores that field or the AllowUnexported +// option explicitly permits comparing the unexported field. // // Slices are equal if they are both nil or both non-nil, where recursively // calling Equal on all non-ignored slice or array elements report equal. @@ -80,11 +80,6 @@ import ( // Pointers and interfaces are equal if they are both nil or both non-nil, // where they have the same underlying concrete type and recursively // calling Equal on the underlying values reports equal. -// -// Before recursing into a pointer, slice element, or map, the current path -// is checked to detect whether the address has already been visited. -// If there is a cycle, then the pointed at values are considered equal -// only if both addresses were previously visited in the same path step. func Equal(x, y interface{}, opts ...Option) bool { vx := reflect.ValueOf(x) vy := reflect.ValueOf(y) @@ -142,7 +137,6 @@ type state struct { // Calling statelessCompare must not result in observable changes to these. result diff.Result // The current result of comparison curPath Path // The current path in the value tree - curPtrs pointerPath // The current set of visited pointers reporters []reporter // Optional reporters // recChecker checks for infinite cycles applying the same set of @@ -154,14 +148,13 @@ type state struct { dynChecker dynChecker // These fields, once set by processOption, will not change. - exporters []exporter // List of exporters for structs with unexported fields - opts Options // List of all fundamental and filter options + exporters map[reflect.Type]bool // Set of structs with unexported field visibility + opts Options // List of all fundamental and filter options } func newState(opts []Option) *state { // Always ensure a validator option exists to validate the inputs. s := &state{opts: Options{validator{}}} - s.curPtrs.Init() s.processOption(Options(opts)) return s } @@ -181,8 +174,13 @@ func (s *state) processOption(opt Option) { panic(fmt.Sprintf("cannot use an unfiltered option: %v", opt)) } s.opts = append(s.opts, opt) - case exporter: - s.exporters = append(s.exporters, opt) + case visibleStructs: + if s.exporters == nil { + s.exporters = make(map[reflect.Type]bool) + } + for t := range opt { + s.exporters[t] = true + } case reporter: s.reporters = append(s.reporters, opt) default: @@ -194,9 +192,9 @@ func (s *state) processOption(opt Option) { // This function is stateless in that it does not alter the current result, // or output to any registered reporters. func (s *state) statelessCompare(step PathStep) diff.Result { - // We do not save and restore curPath and curPtrs because all of the - // compareX methods should properly push and pop from them. - // It is an implementation bug if the contents of the paths differ from + // We do not save and restore the curPath because all of the compareX + // methods should properly push and pop from the path. + // It is an implementation bug if the contents of curPath differs from // when calling this function to when returning from it. oldResult, oldReporters := s.result, s.reporters @@ -218,17 +216,9 @@ func (s *state) compareAny(step PathStep) { } s.recChecker.Check(s.curPath) - // Cycle-detection for slice elements (see NOTE in compareSlice). + // Obtain the current type and values. t := step.Type() vx, vy := step.Values() - if si, ok := step.(SliceIndex); ok && si.isSlice && vx.IsValid() && vy.IsValid() { - px, py := vx.Addr(), vy.Addr() - if eq, visited := s.curPtrs.Push(px, py); visited { - s.report(eq, reportByCycle) - return - } - defer s.curPtrs.Pop(px, py) - } // Rule 1: Check whether an option applies on this node in the value tree. if s.tryOptions(t, vx, vy) { @@ -364,7 +354,6 @@ func sanitizeValue(v reflect.Value, t reflect.Type) reflect.Value { func (s *state) compareStruct(t reflect.Type, vx, vy reflect.Value) { var vax, vay reflect.Value // Addressable versions of vx and vy - var mayForce, mayForceInit bool step := StructField{&structField{}} for i := 0; i < t.NumField(); i++ { step.typ = t.Field(i).Type @@ -386,13 +375,7 @@ func (s *state) compareStruct(t reflect.Type, vx, vy reflect.Value) { vax = makeAddressable(vx) vay = makeAddressable(vy) } - if !mayForceInit { - for _, xf := range s.exporters { - mayForce = mayForce || xf(t) - } - mayForceInit = true - } - step.mayForce = mayForce + step.mayForce = s.exporters[t] step.pvx = vax step.pvy = vay step.field = t.Field(i) @@ -408,21 +391,9 @@ func (s *state) compareSlice(t reflect.Type, vx, vy reflect.Value) { return } - // NOTE: It is incorrect to call curPtrs.Push on the slice header pointer - // since slices represents a list of pointers, rather than a single pointer. - // The pointer checking logic must be handled on a per-element basis - // in compareAny. - // - // A slice header (see reflect.SliceHeader) in Go is a tuple of a starting - // pointer P, a length N, and a capacity C. Supposing each slice element has - // a memory size of M, then the slice is equivalent to the list of pointers: - // [P+i*M for i in range(N)] - // - // For example, v[:0] and v[:1] are slices with the same starting pointer, - // but they are clearly different values. Using the slice pointer alone - // violates the assumption that equal pointers implies equal values. + // TODO: Support cyclic data structures. - step := SliceIndex{&sliceIndex{pathStep: pathStep{typ: t.Elem()}, isSlice: isSlice}} + step := SliceIndex{&sliceIndex{pathStep: pathStep{typ: t.Elem()}}} withIndexes := func(ix, iy int) SliceIndex { if ix >= 0 { step.vx, step.xkey = vx.Index(ix), ix @@ -499,12 +470,7 @@ func (s *state) compareMap(t reflect.Type, vx, vy reflect.Value) { return } - // Cycle-detection for maps. - if eq, visited := s.curPtrs.Push(vx, vy); visited { - s.report(eq, reportByCycle) - return - } - defer s.curPtrs.Pop(vx, vy) + // TODO: Support cyclic data structures. // We combine and sort the two map keys so that we can perform the // comparisons in a deterministic order. @@ -541,12 +507,7 @@ func (s *state) comparePtr(t reflect.Type, vx, vy reflect.Value) { return } - // Cycle-detection for pointers. - if eq, visited := s.curPtrs.Push(vx, vy); visited { - s.report(eq, reportByCycle) - return - } - defer s.curPtrs.Pop(vx, vy) + // TODO: Support cyclic data structures. vx, vy = vx.Elem(), vy.Elem() s.compareAny(Indirect{&indirect{pathStep{t.Elem(), vx, vy}}}) diff --git a/vendor/github.com/google/go-cmp/cmp/export_panic.go b/vendor/github.com/google/go-cmp/cmp/export_panic.go index dd03235..abc3a1c 100644 --- a/vendor/github.com/google/go-cmp/cmp/export_panic.go +++ b/vendor/github.com/google/go-cmp/cmp/export_panic.go @@ -8,8 +8,8 @@ package cmp import "reflect" -const supportExporters = false +const supportAllowUnexported = false func retrieveUnexportedField(reflect.Value, reflect.StructField) reflect.Value { - panic("no support for forcibly accessing unexported fields") + panic("retrieveUnexportedField is not implemented") } diff --git a/vendor/github.com/google/go-cmp/cmp/export_unsafe.go b/vendor/github.com/google/go-cmp/cmp/export_unsafe.go index 57020e2..59d4ee9 100644 --- a/vendor/github.com/google/go-cmp/cmp/export_unsafe.go +++ b/vendor/github.com/google/go-cmp/cmp/export_unsafe.go @@ -11,7 +11,7 @@ import ( "unsafe" ) -const supportExporters = true +const supportAllowUnexported = true // retrieveUnexportedField uses unsafe to forcibly retrieve any field from // a struct such that the value has read-write permissions. @@ -19,7 +19,5 @@ const supportExporters = true // The parent struct, v, must be addressable, while f must be a StructField // describing the field to retrieve. func retrieveUnexportedField(v reflect.Value, f reflect.StructField) reflect.Value { - // See https://github.com/google/go-cmp/issues/167 for discussion of the - // following expression. - return reflect.NewAt(f.Type, unsafe.Pointer(uintptr(unsafe.Pointer(v.UnsafeAddr()))+f.Offset)).Elem() + return reflect.NewAt(f.Type, unsafe.Pointer(v.UnsafeAddr()+f.Offset)).Elem() } diff --git a/vendor/github.com/google/go-cmp/cmp/internal/value/sort.go b/vendor/github.com/google/go-cmp/cmp/internal/value/sort.go index 24fbae6..938f646 100644 --- a/vendor/github.com/google/go-cmp/cmp/internal/value/sort.go +++ b/vendor/github.com/google/go-cmp/cmp/internal/value/sort.go @@ -19,7 +19,7 @@ func SortKeys(vs []reflect.Value) []reflect.Value { } // Sort the map keys. - sort.SliceStable(vs, func(i, j int) bool { return isLess(vs[i], vs[j]) }) + sort.Slice(vs, func(i, j int) bool { return isLess(vs[i], vs[j]) }) // Deduplicate keys (fails for NaNs). vs2 := vs[:1] @@ -42,8 +42,6 @@ func isLess(x, y reflect.Value) bool { case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: return x.Uint() < y.Uint() case reflect.Float32, reflect.Float64: - // NOTE: This does not sort -0 as less than +0 - // since Go maps treat -0 and +0 as equal keys. fx, fy := x.Float(), y.Float() return fx < fy || math.IsNaN(fx) && !math.IsNaN(fy) case reflect.Complex64, reflect.Complex128: diff --git a/vendor/github.com/google/go-cmp/cmp/internal/value/zero.go b/vendor/github.com/google/go-cmp/cmp/internal/value/zero.go index 06a8ffd..d13a12c 100644 --- a/vendor/github.com/google/go-cmp/cmp/internal/value/zero.go +++ b/vendor/github.com/google/go-cmp/cmp/internal/value/zero.go @@ -4,10 +4,7 @@ package value -import ( - "math" - "reflect" -) +import "reflect" // IsZero reports whether v is the zero value. // This does not rely on Interface and so can be used on unexported fields. @@ -20,9 +17,9 @@ func IsZero(v reflect.Value) bool { case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: return v.Uint() == 0 case reflect.Float32, reflect.Float64: - return math.Float64bits(v.Float()) == 0 + return v.Float() == 0 case reflect.Complex64, reflect.Complex128: - return math.Float64bits(real(v.Complex())) == 0 && math.Float64bits(imag(v.Complex())) == 0 + return v.Complex() == 0 case reflect.String: return v.String() == "" case reflect.UnsafePointer: diff --git a/vendor/github.com/google/go-cmp/cmp/options.go b/vendor/github.com/google/go-cmp/cmp/options.go index abbd2a6..7934481 100644 --- a/vendor/github.com/google/go-cmp/cmp/options.go +++ b/vendor/github.com/google/go-cmp/cmp/options.go @@ -225,20 +225,8 @@ func (validator) apply(s *state, vx, vy reflect.Value) { // Unable to Interface implies unexported field without visibility access. if !vx.CanInterface() || !vy.CanInterface() { - const help = "consider using a custom Comparer; if you control the implementation of type, you can also consider using an Exporter, AllowUnexported, or cmpopts.IgnoreUnexported" - var name string - if t := s.curPath.Index(-2).Type(); t.Name() != "" { - // Named type with unexported fields. - name = fmt.Sprintf("%q.%v", t.PkgPath(), t.Name()) // e.g., "path/to/package".MyType - } else { - // Unnamed type with unexported fields. Derive PkgPath from field. - var pkgPath string - for i := 0; i < t.NumField() && pkgPath == ""; i++ { - pkgPath = t.Field(i).PkgPath - } - name = fmt.Sprintf("%q.(%v)", pkgPath, t.String()) // e.g., "path/to/package".(struct { a int }) - } - panic(fmt.Sprintf("cannot handle unexported field at %#v:\n\t%v\n%s", s.curPath, name, help)) + const help = "consider using a custom Comparer; if you control the implementation of type, you can also consider AllowUnexported or cmpopts.IgnoreUnexported" + panic(fmt.Sprintf("cannot handle unexported field: %#v\n%s", s.curPath, help)) } panic("not reachable") @@ -372,8 +360,9 @@ func (cm comparer) String() string { return fmt.Sprintf("Comparer(%s)", function.NameOf(cm.fnc)) } -// Exporter returns an Option that specifies whether Equal is allowed to -// introspect into the unexported fields of certain struct types. +// AllowUnexported returns an Option that forcibly allows operations on +// unexported fields in certain structs, which are specified by passing in a +// value of each struct type. // // Users of this option must understand that comparing on unexported fields // from external packages is not safe since changes in the internal @@ -397,24 +386,10 @@ func (cm comparer) String() string { // // In other cases, the cmpopts.IgnoreUnexported option can be used to ignore // all unexported fields on specified struct types. -func Exporter(f func(reflect.Type) bool) Option { - if !supportExporters { - panic("Exporter is not supported on purego builds") - } - return exporter(f) -} - -type exporter func(reflect.Type) bool - -func (exporter) filter(_ *state, _ reflect.Type, _, _ reflect.Value) applicableOption { - panic("not implemented") -} - -// AllowUnexported returns an Options that allows Equal to forcibly introspect -// unexported fields of the specified struct types. -// -// See Exporter for the proper use of this option. func AllowUnexported(types ...interface{}) Option { + if !supportAllowUnexported { + panic("AllowUnexported is not supported on purego builds, Google App Engine Standard, or GopherJS") + } m := make(map[reflect.Type]bool) for _, typ := range types { t := reflect.TypeOf(typ) @@ -423,7 +398,13 @@ func AllowUnexported(types ...interface{}) Option { } m[t] = true } - return exporter(func(t reflect.Type) bool { return m[t] }) + return visibleStructs(m) +} + +type visibleStructs map[reflect.Type]bool + +func (visibleStructs) filter(_ *state, _ reflect.Type, _, _ reflect.Value) applicableOption { + panic("not implemented") } // Result represents the comparison result for a single node and @@ -455,11 +436,6 @@ func (r Result) ByFunc() bool { return r.flags&reportByFunc != 0 } -// ByCycle reports whether a reference cycle was detected. -func (r Result) ByCycle() bool { - return r.flags&reportByCycle != 0 -} - type resultFlags uint const ( @@ -470,7 +446,6 @@ const ( reportByIgnore reportByMethod reportByFunc - reportByCycle ) // Reporter is an Option that can be passed to Equal. When Equal traverses diff --git a/vendor/github.com/google/go-cmp/cmp/path.go b/vendor/github.com/google/go-cmp/cmp/path.go index 509d6b8..96fffd2 100644 --- a/vendor/github.com/google/go-cmp/cmp/path.go +++ b/vendor/github.com/google/go-cmp/cmp/path.go @@ -10,8 +10,6 @@ import ( "strings" "unicode" "unicode/utf8" - - "github.com/google/go-cmp/cmp/internal/value" ) // Path is a list of PathSteps describing the sequence of operations to get @@ -43,7 +41,7 @@ type PathStep interface { // In some cases, one or both may be invalid or have restrictions: // • For StructField, both are not interface-able if the current field // is unexported and the struct type is not explicitly permitted by - // an Exporter to traverse unexported fields. + // AllowUnexported to traverse unexported fields. // • For SliceIndex, one may be invalid if an element is missing from // either the x or y slice. // • For MapIndex, one may be invalid if an entry is missing from @@ -209,7 +207,6 @@ type SliceIndex struct{ *sliceIndex } type sliceIndex struct { pathStep xkey, ykey int - isSlice bool // False for reflect.Array } func (si SliceIndex) Type() reflect.Type { return si.typ } @@ -304,72 +301,6 @@ func (tf Transform) Func() reflect.Value { return tf.trans.fnc } // The == operator can be used to detect the exact option used. func (tf Transform) Option() Option { return tf.trans } -// pointerPath represents a dual-stack of pointers encountered when -// recursively traversing the x and y values. This data structure supports -// detection of cycles and determining whether the cycles are equal. -// In Go, cycles can occur via pointers, slices, and maps. -// -// The pointerPath uses a map to represent a stack; where descension into a -// pointer pushes the address onto the stack, and ascension from a pointer -// pops the address from the stack. Thus, when traversing into a pointer from -// reflect.Ptr, reflect.Slice element, or reflect.Map, we can detect cycles -// by checking whether the pointer has already been visited. The cycle detection -// uses a seperate stack for the x and y values. -// -// If a cycle is detected we need to determine whether the two pointers -// should be considered equal. The definition of equality chosen by Equal -// requires two graphs to have the same structure. To determine this, both the -// x and y values must have a cycle where the previous pointers were also -// encountered together as a pair. -// -// Semantically, this is equivalent to augmenting Indirect, SliceIndex, and -// MapIndex with pointer information for the x and y values. -// Suppose px and py are two pointers to compare, we then search the -// Path for whether px was ever encountered in the Path history of x, and -// similarly so with py. If either side has a cycle, the comparison is only -// equal if both px and py have a cycle resulting from the same PathStep. -// -// Using a map as a stack is more performant as we can perform cycle detection -// in O(1) instead of O(N) where N is len(Path). -type pointerPath struct { - // mx is keyed by x pointers, where the value is the associated y pointer. - mx map[value.Pointer]value.Pointer - // my is keyed by y pointers, where the value is the associated x pointer. - my map[value.Pointer]value.Pointer -} - -func (p *pointerPath) Init() { - p.mx = make(map[value.Pointer]value.Pointer) - p.my = make(map[value.Pointer]value.Pointer) -} - -// Push indicates intent to descend into pointers vx and vy where -// visited reports whether either has been seen before. If visited before, -// equal reports whether both pointers were encountered together. -// Pop must be called if and only if the pointers were never visited. -// -// The pointers vx and vy must be a reflect.Ptr, reflect.Slice, or reflect.Map -// and be non-nil. -func (p pointerPath) Push(vx, vy reflect.Value) (equal, visited bool) { - px := value.PointerOf(vx) - py := value.PointerOf(vy) - _, ok1 := p.mx[px] - _, ok2 := p.my[py] - if ok1 || ok2 { - equal = p.mx[px] == py && p.my[py] == px // Pointers paired together - return equal, true - } - p.mx[px] = py - p.my[py] = px - return false, false -} - -// Pop ascends from pointers vx and vy. -func (p pointerPath) Pop(vx, vy reflect.Value) { - delete(p.mx, value.PointerOf(vx)) - delete(p.my, value.PointerOf(vy)) -} - // isExported reports whether the identifier is exported. func isExported(id string) bool { r, _ := utf8.DecodeRuneInString(id) diff --git a/vendor/github.com/google/go-cmp/cmp/report_compare.go b/vendor/github.com/google/go-cmp/cmp/report_compare.go index 17a05ee..05efb99 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_compare.go +++ b/vendor/github.com/google/go-cmp/cmp/report_compare.go @@ -168,7 +168,7 @@ func (opts formatOptions) formatDiffList(recs []reportRecord, k reflect.Kind) te var isZero bool switch opts.DiffMode { case diffIdentical: - isZero = value.IsZero(r.Value.ValueX) || value.IsZero(r.Value.ValueY) + isZero = value.IsZero(r.Value.ValueX) || value.IsZero(r.Value.ValueX) case diffRemoved: isZero = value.IsZero(r.Value.ValueX) case diffInserted: diff --git a/vendor/github.com/google/go-cmp/cmp/report_reflect.go b/vendor/github.com/google/go-cmp/cmp/report_reflect.go index 2761b62..5521c60 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_reflect.go +++ b/vendor/github.com/google/go-cmp/cmp/report_reflect.go @@ -208,6 +208,7 @@ func (opts formatOptions) FormatValue(v reflect.Value, m visitedPointers) (out t func formatMapKey(v reflect.Value) string { var opts formatOptions opts.TypeMode = elideType + opts.AvoidStringer = true opts.ShallowPointers = true s := opts.FormatValue(v, visitedPointers{}).String() return strings.TrimSpace(s) diff --git a/vendor/github.com/google/go-cmp/cmp/report_slices.go b/vendor/github.com/google/go-cmp/cmp/report_slices.go index eafcf2e..8cb3265 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_slices.go +++ b/vendor/github.com/google/go-cmp/cmp/report_slices.go @@ -90,7 +90,7 @@ func (opts formatOptions) FormatDiffSlice(v *valueNode) textNode { } if r == '\n' { if maxLineLen < i-lastLineIdx { - maxLineLen = i - lastLineIdx + lastLineIdx = i - lastLineIdx } lastLineIdx = i + 1 numLines++ @@ -322,7 +322,7 @@ func coalesceInterveningIdentical(groups []diffStats, windowSize int) []diffStat hadX, hadY := prev.NumRemoved > 0, prev.NumInserted > 0 hasX, hasY := next.NumRemoved > 0, next.NumInserted > 0 if ((hadX || hasX) && (hadY || hasY)) && curr.NumIdentical <= windowSize { - *prev = prev.Append(*curr).Append(*next) + *prev = (*prev).Append(*curr).Append(*next) groups = groups[:len(groups)-1] // Truncate off equal group continue } diff --git a/vendor/github.com/google/go-cmp/cmp/report_text.go b/vendor/github.com/google/go-cmp/cmp/report_text.go index 8b8fcab..80605d0 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_text.go +++ b/vendor/github.com/google/go-cmp/cmp/report_text.go @@ -19,11 +19,6 @@ var randBool = rand.New(rand.NewSource(time.Now().Unix())).Intn(2) == 0 type indentMode int func (n indentMode) appendIndent(b []byte, d diffMode) []byte { - // The output of Diff is documented as being unstable to provide future - // flexibility in changing the output for more humanly readable reports. - // This logic intentionally introduces instability to the exact output - // so that users can detect accidental reliance on stability early on, - // rather than much later when an actual change to the format occurs. if flags.Deterministic || randBool { // Use regular spaces (U+0020). switch d { @@ -365,7 +360,7 @@ func (s diffStats) String() string { // Pluralize the name (adjusting for some obscure English grammar rules). name := s.Name if sum > 1 { - name += "s" + name = name + "s" if strings.HasSuffix(name, "ys") { name = name[:len(name)-2] + "ies" // e.g., "entrys" => "entries" } diff --git a/vendor/github.com/google/gofuzz/.travis.yml b/vendor/github.com/google/gofuzz/.travis.yml deleted file mode 100644 index f8684d9..0000000 --- a/vendor/github.com/google/gofuzz/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: go - -go: - - 1.4 - - 1.3 - - 1.2 - - tip - -install: - - if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi - -script: - - go test -cover diff --git a/vendor/github.com/google/gofuzz/CONTRIBUTING.md b/vendor/github.com/google/gofuzz/CONTRIBUTING.md deleted file mode 100644 index 51cf5cd..0000000 --- a/vendor/github.com/google/gofuzz/CONTRIBUTING.md +++ /dev/null @@ -1,67 +0,0 @@ -# How to contribute # - -We'd love to accept your patches and contributions to this project. There are -a just a few small guidelines you need to follow. - - -## Contributor License Agreement ## - -Contributions to any Google project must be accompanied by a Contributor -License Agreement. This is not a copyright **assignment**, it simply gives -Google permission to use and redistribute your contributions as part of the -project. - - * If you are an individual writing original source code and you're sure you - own the intellectual property, then you'll need to sign an [individual - CLA][]. - - * If you work for a company that wants to allow you to contribute your work, - then you'll need to sign a [corporate CLA][]. - -You generally only need to submit a CLA once, so if you've already submitted -one (even if it was for a different project), you probably don't need to do it -again. - -[individual CLA]: https://developers.google.com/open-source/cla/individual -[corporate CLA]: https://developers.google.com/open-source/cla/corporate - - -## Submitting a patch ## - - 1. It's generally best to start by opening a new issue describing the bug or - feature you're intending to fix. Even if you think it's relatively minor, - it's helpful to know what people are working on. Mention in the initial - issue that you are planning to work on that bug or feature so that it can - be assigned to you. - - 1. Follow the normal process of [forking][] the project, and setup a new - branch to work in. It's important that each group of changes be done in - separate branches in order to ensure that a pull request only includes the - commits related to that bug or feature. - - 1. Go makes it very simple to ensure properly formatted code, so always run - `go fmt` on your code before committing it. You should also run - [golint][] over your code. As noted in the [golint readme][], it's not - strictly necessary that your code be completely "lint-free", but this will - help you find common style issues. - - 1. Any significant changes should almost always be accompanied by tests. The - project already has good test coverage, so look at some of the existing - tests if you're unsure how to go about it. [gocov][] and [gocov-html][] - are invaluable tools for seeing which parts of your code aren't being - exercised by your tests. - - 1. Do your best to have [well-formed commit messages][] for each change. - This provides consistency throughout the project, and ensures that commit - messages are able to be formatted properly by various git tools. - - 1. Finally, push the commits to your fork and submit a [pull request][]. - -[forking]: https://help.github.com/articles/fork-a-repo -[golint]: https://github.com/golang/lint -[golint readme]: https://github.com/golang/lint/blob/master/README -[gocov]: https://github.com/axw/gocov -[gocov-html]: https://github.com/matm/gocov-html -[well-formed commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html -[squash]: http://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits -[pull request]: https://help.github.com/articles/creating-a-pull-request diff --git a/vendor/github.com/google/gofuzz/README.md b/vendor/github.com/google/gofuzz/README.md deleted file mode 100644 index 64869af..0000000 --- a/vendor/github.com/google/gofuzz/README.md +++ /dev/null @@ -1,71 +0,0 @@ -gofuzz -====== - -gofuzz is a library for populating go objects with random values. - -[![GoDoc](https://godoc.org/github.com/google/gofuzz?status.png)](https://godoc.org/github.com/google/gofuzz) -[![Travis](https://travis-ci.org/google/gofuzz.svg?branch=master)](https://travis-ci.org/google/gofuzz) - -This is useful for testing: - -* Do your project's objects really serialize/unserialize correctly in all cases? -* Is there an incorrectly formatted object that will cause your project to panic? - -Import with ```import "github.com/google/gofuzz"``` - -You can use it on single variables: -```go -f := fuzz.New() -var myInt int -f.Fuzz(&myInt) // myInt gets a random value. -``` - -You can use it on maps: -```go -f := fuzz.New().NilChance(0).NumElements(1, 1) -var myMap map[ComplexKeyType]string -f.Fuzz(&myMap) // myMap will have exactly one element. -``` - -Customize the chance of getting a nil pointer: -```go -f := fuzz.New().NilChance(.5) -var fancyStruct struct { - A, B, C, D *string -} -f.Fuzz(&fancyStruct) // About half the pointers should be set. -``` - -You can even customize the randomization completely if needed: -```go -type MyEnum string -const ( - A MyEnum = "A" - B MyEnum = "B" -) -type MyInfo struct { - Type MyEnum - AInfo *string - BInfo *string -} - -f := fuzz.New().NilChance(0).Funcs( - func(e *MyInfo, c fuzz.Continue) { - switch c.Intn(2) { - case 0: - e.Type = A - c.Fuzz(&e.AInfo) - case 1: - e.Type = B - c.Fuzz(&e.BInfo) - } - }, -) - -var myObject MyInfo -f.Fuzz(&myObject) // Type will correspond to whether A or B info is set. -``` - -See more examples in ```example_test.go```. - -Happy testing! diff --git a/vendor/github.com/google/gofuzz/go.mod b/vendor/github.com/google/gofuzz/go.mod deleted file mode 100644 index 8ec4fe9..0000000 --- a/vendor/github.com/google/gofuzz/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/google/gofuzz - -go 1.12 diff --git a/vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.go b/vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.go index 4fd44c4..0e32451 100644 --- a/vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.go +++ b/vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.go @@ -7105,21 +7105,21 @@ func (m *Any) ToRawInfo() interface{} { // ToRawInfo returns a description of ApiKeySecurity suitable for JSON or YAML export. func (m *ApiKeySecurity) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } - // always include this required field. - info = append(info, yaml.MapItem{Key: "type", Value: m.Type}) - // always include this required field. - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) - // always include this required field. - info = append(info, yaml.MapItem{Key: "in", Value: m.In}) + if m.Type != "" { + info = append(info, yaml.MapItem{"type", m.Type}) + } + if m.Name != "" { + info = append(info, yaml.MapItem{"name", m.Name}) + } + if m.In != "" { + info = append(info, yaml.MapItem{"in", m.In}) + } if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info = append(info, yaml.MapItem{"description", m.Description}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} @@ -7129,17 +7129,15 @@ func (m *ApiKeySecurity) ToRawInfo() interface{} { // ToRawInfo returns a description of BasicAuthenticationSecurity suitable for JSON or YAML export. func (m *BasicAuthenticationSecurity) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info + if m.Type != "" { + info = append(info, yaml.MapItem{"type", m.Type}) } - // always include this required field. - info = append(info, yaml.MapItem{Key: "type", Value: m.Type}) if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info = append(info, yaml.MapItem{"description", m.Description}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} @@ -7149,25 +7147,25 @@ func (m *BasicAuthenticationSecurity) ToRawInfo() interface{} { // ToRawInfo returns a description of BodyParameter suitable for JSON or YAML export. func (m *BodyParameter) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info = append(info, yaml.MapItem{"description", m.Description}) + } + if m.Name != "" { + info = append(info, yaml.MapItem{"name", m.Name}) + } + if m.In != "" { + info = append(info, yaml.MapItem{"in", m.In}) } - // always include this required field. - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) - // always include this required field. - info = append(info, yaml.MapItem{Key: "in", Value: m.In}) if m.Required != false { - info = append(info, yaml.MapItem{Key: "required", Value: m.Required}) + info = append(info, yaml.MapItem{"required", m.Required}) + } + if m.Schema != nil { + info = append(info, yaml.MapItem{"schema", m.Schema.ToRawInfo()}) } - // always include this required field. - info = append(info, yaml.MapItem{Key: "schema", Value: m.Schema.ToRawInfo()}) // &{Name:schema Type:Schema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} @@ -7177,21 +7175,18 @@ func (m *BodyParameter) ToRawInfo() interface{} { // ToRawInfo returns a description of Contact suitable for JSON or YAML export. func (m *Contact) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info = append(info, yaml.MapItem{"name", m.Name}) } if m.Url != "" { - info = append(info, yaml.MapItem{Key: "url", Value: m.Url}) + info = append(info, yaml.MapItem{"url", m.Url}) } if m.Email != "" { - info = append(info, yaml.MapItem{Key: "email", Value: m.Email}) + info = append(info, yaml.MapItem{"email", m.Email}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} @@ -7201,12 +7196,9 @@ func (m *Contact) ToRawInfo() interface{} { // ToRawInfo returns a description of Default suitable for JSON or YAML export. func (m *Default) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:additionalProperties Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern: Implicit:false Description:} @@ -7216,12 +7208,9 @@ func (m *Default) ToRawInfo() interface{} { // ToRawInfo returns a description of Definitions suitable for JSON or YAML export. func (m *Definitions) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:additionalProperties Type:NamedSchema StringEnumValues:[] MapType:Schema Repeated:true Pattern: Implicit:true Description:} @@ -7231,42 +7220,42 @@ func (m *Definitions) ToRawInfo() interface{} { // ToRawInfo returns a description of Document suitable for JSON or YAML export. func (m *Document) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info + if m.Swagger != "" { + info = append(info, yaml.MapItem{"swagger", m.Swagger}) + } + if m.Info != nil { + info = append(info, yaml.MapItem{"info", m.Info.ToRawInfo()}) } - // always include this required field. - info = append(info, yaml.MapItem{Key: "swagger", Value: m.Swagger}) - // always include this required field. - info = append(info, yaml.MapItem{Key: "info", Value: m.Info.ToRawInfo()}) // &{Name:info Type:Info StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Host != "" { - info = append(info, yaml.MapItem{Key: "host", Value: m.Host}) + info = append(info, yaml.MapItem{"host", m.Host}) } if m.BasePath != "" { - info = append(info, yaml.MapItem{Key: "basePath", Value: m.BasePath}) + info = append(info, yaml.MapItem{"basePath", m.BasePath}) } if len(m.Schemes) != 0 { - info = append(info, yaml.MapItem{Key: "schemes", Value: m.Schemes}) + info = append(info, yaml.MapItem{"schemes", m.Schemes}) } if len(m.Consumes) != 0 { - info = append(info, yaml.MapItem{Key: "consumes", Value: m.Consumes}) + info = append(info, yaml.MapItem{"consumes", m.Consumes}) } if len(m.Produces) != 0 { - info = append(info, yaml.MapItem{Key: "produces", Value: m.Produces}) + info = append(info, yaml.MapItem{"produces", m.Produces}) + } + if m.Paths != nil { + info = append(info, yaml.MapItem{"paths", m.Paths.ToRawInfo()}) } - // always include this required field. - info = append(info, yaml.MapItem{Key: "paths", Value: m.Paths.ToRawInfo()}) // &{Name:paths Type:Paths StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Definitions != nil { - info = append(info, yaml.MapItem{Key: "definitions", Value: m.Definitions.ToRawInfo()}) + info = append(info, yaml.MapItem{"definitions", m.Definitions.ToRawInfo()}) } // &{Name:definitions Type:Definitions StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Parameters != nil { - info = append(info, yaml.MapItem{Key: "parameters", Value: m.Parameters.ToRawInfo()}) + info = append(info, yaml.MapItem{"parameters", m.Parameters.ToRawInfo()}) } // &{Name:parameters Type:ParameterDefinitions StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Responses != nil { - info = append(info, yaml.MapItem{Key: "responses", Value: m.Responses.ToRawInfo()}) + info = append(info, yaml.MapItem{"responses", m.Responses.ToRawInfo()}) } // &{Name:responses Type:ResponseDefinitions StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if len(m.Security) != 0 { @@ -7274,11 +7263,11 @@ func (m *Document) ToRawInfo() interface{} { for _, item := range m.Security { items = append(items, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "security", Value: items}) + info = append(info, yaml.MapItem{"security", items}) } // &{Name:security Type:SecurityRequirement StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.SecurityDefinitions != nil { - info = append(info, yaml.MapItem{Key: "securityDefinitions", Value: m.SecurityDefinitions.ToRawInfo()}) + info = append(info, yaml.MapItem{"securityDefinitions", m.SecurityDefinitions.ToRawInfo()}) } // &{Name:securityDefinitions Type:SecurityDefinitions StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if len(m.Tags) != 0 { @@ -7286,16 +7275,16 @@ func (m *Document) ToRawInfo() interface{} { for _, item := range m.Tags { items = append(items, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "tags", Value: items}) + info = append(info, yaml.MapItem{"tags", items}) } // &{Name:tags Type:Tag StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.ExternalDocs != nil { - info = append(info, yaml.MapItem{Key: "externalDocs", Value: m.ExternalDocs.ToRawInfo()}) + info = append(info, yaml.MapItem{"externalDocs", m.ExternalDocs.ToRawInfo()}) } // &{Name:externalDocs Type:ExternalDocs StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} @@ -7305,12 +7294,9 @@ func (m *Document) ToRawInfo() interface{} { // ToRawInfo returns a description of Examples suitable for JSON or YAML export. func (m *Examples) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:additionalProperties Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern: Implicit:true Description:} @@ -7320,17 +7306,15 @@ func (m *Examples) ToRawInfo() interface{} { // ToRawInfo returns a description of ExternalDocs suitable for JSON or YAML export. func (m *ExternalDocs) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info = append(info, yaml.MapItem{"description", m.Description}) + } + if m.Url != "" { + info = append(info, yaml.MapItem{"url", m.Url}) } - // always include this required field. - info = append(info, yaml.MapItem{Key: "url", Value: m.Url}) if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} @@ -7340,41 +7324,39 @@ func (m *ExternalDocs) ToRawInfo() interface{} { // ToRawInfo returns a description of FileSchema suitable for JSON or YAML export. func (m *FileSchema) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.Format != "" { - info = append(info, yaml.MapItem{Key: "format", Value: m.Format}) + info = append(info, yaml.MapItem{"format", m.Format}) } if m.Title != "" { - info = append(info, yaml.MapItem{Key: "title", Value: m.Title}) + info = append(info, yaml.MapItem{"title", m.Title}) } if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info = append(info, yaml.MapItem{"description", m.Description}) } if m.Default != nil { - info = append(info, yaml.MapItem{Key: "default", Value: m.Default.ToRawInfo()}) + info = append(info, yaml.MapItem{"default", m.Default.ToRawInfo()}) } // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if len(m.Required) != 0 { - info = append(info, yaml.MapItem{Key: "required", Value: m.Required}) + info = append(info, yaml.MapItem{"required", m.Required}) + } + if m.Type != "" { + info = append(info, yaml.MapItem{"type", m.Type}) } - // always include this required field. - info = append(info, yaml.MapItem{Key: "type", Value: m.Type}) if m.ReadOnly != false { - info = append(info, yaml.MapItem{Key: "readOnly", Value: m.ReadOnly}) + info = append(info, yaml.MapItem{"readOnly", m.ReadOnly}) } if m.ExternalDocs != nil { - info = append(info, yaml.MapItem{Key: "externalDocs", Value: m.ExternalDocs.ToRawInfo()}) + info = append(info, yaml.MapItem{"externalDocs", m.ExternalDocs.ToRawInfo()}) } // &{Name:externalDocs Type:ExternalDocs StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Example != nil { - info = append(info, yaml.MapItem{Key: "example", Value: m.Example.ToRawInfo()}) + info = append(info, yaml.MapItem{"example", m.Example.ToRawInfo()}) } // &{Name:example Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} @@ -7384,85 +7366,82 @@ func (m *FileSchema) ToRawInfo() interface{} { // ToRawInfo returns a description of FormDataParameterSubSchema suitable for JSON or YAML export. func (m *FormDataParameterSubSchema) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.Required != false { - info = append(info, yaml.MapItem{Key: "required", Value: m.Required}) + info = append(info, yaml.MapItem{"required", m.Required}) } if m.In != "" { - info = append(info, yaml.MapItem{Key: "in", Value: m.In}) + info = append(info, yaml.MapItem{"in", m.In}) } if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info = append(info, yaml.MapItem{"description", m.Description}) } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info = append(info, yaml.MapItem{"name", m.Name}) } if m.AllowEmptyValue != false { - info = append(info, yaml.MapItem{Key: "allowEmptyValue", Value: m.AllowEmptyValue}) + info = append(info, yaml.MapItem{"allowEmptyValue", m.AllowEmptyValue}) } if m.Type != "" { - info = append(info, yaml.MapItem{Key: "type", Value: m.Type}) + info = append(info, yaml.MapItem{"type", m.Type}) } if m.Format != "" { - info = append(info, yaml.MapItem{Key: "format", Value: m.Format}) + info = append(info, yaml.MapItem{"format", m.Format}) } if m.Items != nil { - info = append(info, yaml.MapItem{Key: "items", Value: m.Items.ToRawInfo()}) + info = append(info, yaml.MapItem{"items", m.Items.ToRawInfo()}) } // &{Name:items Type:PrimitivesItems StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.CollectionFormat != "" { - info = append(info, yaml.MapItem{Key: "collectionFormat", Value: m.CollectionFormat}) + info = append(info, yaml.MapItem{"collectionFormat", m.CollectionFormat}) } if m.Default != nil { - info = append(info, yaml.MapItem{Key: "default", Value: m.Default.ToRawInfo()}) + info = append(info, yaml.MapItem{"default", m.Default.ToRawInfo()}) } // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Maximum != 0.0 { - info = append(info, yaml.MapItem{Key: "maximum", Value: m.Maximum}) + info = append(info, yaml.MapItem{"maximum", m.Maximum}) } if m.ExclusiveMaximum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMaximum", Value: m.ExclusiveMaximum}) + info = append(info, yaml.MapItem{"exclusiveMaximum", m.ExclusiveMaximum}) } if m.Minimum != 0.0 { - info = append(info, yaml.MapItem{Key: "minimum", Value: m.Minimum}) + info = append(info, yaml.MapItem{"minimum", m.Minimum}) } if m.ExclusiveMinimum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMinimum", Value: m.ExclusiveMinimum}) + info = append(info, yaml.MapItem{"exclusiveMinimum", m.ExclusiveMinimum}) } if m.MaxLength != 0 { - info = append(info, yaml.MapItem{Key: "maxLength", Value: m.MaxLength}) + info = append(info, yaml.MapItem{"maxLength", m.MaxLength}) } if m.MinLength != 0 { - info = append(info, yaml.MapItem{Key: "minLength", Value: m.MinLength}) + info = append(info, yaml.MapItem{"minLength", m.MinLength}) } if m.Pattern != "" { - info = append(info, yaml.MapItem{Key: "pattern", Value: m.Pattern}) + info = append(info, yaml.MapItem{"pattern", m.Pattern}) } if m.MaxItems != 0 { - info = append(info, yaml.MapItem{Key: "maxItems", Value: m.MaxItems}) + info = append(info, yaml.MapItem{"maxItems", m.MaxItems}) } if m.MinItems != 0 { - info = append(info, yaml.MapItem{Key: "minItems", Value: m.MinItems}) + info = append(info, yaml.MapItem{"minItems", m.MinItems}) } if m.UniqueItems != false { - info = append(info, yaml.MapItem{Key: "uniqueItems", Value: m.UniqueItems}) + info = append(info, yaml.MapItem{"uniqueItems", m.UniqueItems}) } if len(m.Enum) != 0 { items := make([]interface{}, 0) for _, item := range m.Enum { items = append(items, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "enum", Value: items}) + info = append(info, yaml.MapItem{"enum", items}) } // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.MultipleOf != 0.0 { - info = append(info, yaml.MapItem{Key: "multipleOf", Value: m.MultipleOf}) + info = append(info, yaml.MapItem{"multipleOf", m.MultipleOf}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} @@ -7472,72 +7451,70 @@ func (m *FormDataParameterSubSchema) ToRawInfo() interface{} { // ToRawInfo returns a description of Header suitable for JSON or YAML export. func (m *Header) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info + if m.Type != "" { + info = append(info, yaml.MapItem{"type", m.Type}) } - // always include this required field. - info = append(info, yaml.MapItem{Key: "type", Value: m.Type}) if m.Format != "" { - info = append(info, yaml.MapItem{Key: "format", Value: m.Format}) + info = append(info, yaml.MapItem{"format", m.Format}) } if m.Items != nil { - info = append(info, yaml.MapItem{Key: "items", Value: m.Items.ToRawInfo()}) + info = append(info, yaml.MapItem{"items", m.Items.ToRawInfo()}) } // &{Name:items Type:PrimitivesItems StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.CollectionFormat != "" { - info = append(info, yaml.MapItem{Key: "collectionFormat", Value: m.CollectionFormat}) + info = append(info, yaml.MapItem{"collectionFormat", m.CollectionFormat}) } if m.Default != nil { - info = append(info, yaml.MapItem{Key: "default", Value: m.Default.ToRawInfo()}) + info = append(info, yaml.MapItem{"default", m.Default.ToRawInfo()}) } // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Maximum != 0.0 { - info = append(info, yaml.MapItem{Key: "maximum", Value: m.Maximum}) + info = append(info, yaml.MapItem{"maximum", m.Maximum}) } if m.ExclusiveMaximum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMaximum", Value: m.ExclusiveMaximum}) + info = append(info, yaml.MapItem{"exclusiveMaximum", m.ExclusiveMaximum}) } if m.Minimum != 0.0 { - info = append(info, yaml.MapItem{Key: "minimum", Value: m.Minimum}) + info = append(info, yaml.MapItem{"minimum", m.Minimum}) } if m.ExclusiveMinimum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMinimum", Value: m.ExclusiveMinimum}) + info = append(info, yaml.MapItem{"exclusiveMinimum", m.ExclusiveMinimum}) } if m.MaxLength != 0 { - info = append(info, yaml.MapItem{Key: "maxLength", Value: m.MaxLength}) + info = append(info, yaml.MapItem{"maxLength", m.MaxLength}) } if m.MinLength != 0 { - info = append(info, yaml.MapItem{Key: "minLength", Value: m.MinLength}) + info = append(info, yaml.MapItem{"minLength", m.MinLength}) } if m.Pattern != "" { - info = append(info, yaml.MapItem{Key: "pattern", Value: m.Pattern}) + info = append(info, yaml.MapItem{"pattern", m.Pattern}) } if m.MaxItems != 0 { - info = append(info, yaml.MapItem{Key: "maxItems", Value: m.MaxItems}) + info = append(info, yaml.MapItem{"maxItems", m.MaxItems}) } if m.MinItems != 0 { - info = append(info, yaml.MapItem{Key: "minItems", Value: m.MinItems}) + info = append(info, yaml.MapItem{"minItems", m.MinItems}) } if m.UniqueItems != false { - info = append(info, yaml.MapItem{Key: "uniqueItems", Value: m.UniqueItems}) + info = append(info, yaml.MapItem{"uniqueItems", m.UniqueItems}) } if len(m.Enum) != 0 { items := make([]interface{}, 0) for _, item := range m.Enum { items = append(items, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "enum", Value: items}) + info = append(info, yaml.MapItem{"enum", items}) } // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.MultipleOf != 0.0 { - info = append(info, yaml.MapItem{Key: "multipleOf", Value: m.MultipleOf}) + info = append(info, yaml.MapItem{"multipleOf", m.MultipleOf}) } if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info = append(info, yaml.MapItem{"description", m.Description}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} @@ -7547,82 +7524,79 @@ func (m *Header) ToRawInfo() interface{} { // ToRawInfo returns a description of HeaderParameterSubSchema suitable for JSON or YAML export. func (m *HeaderParameterSubSchema) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.Required != false { - info = append(info, yaml.MapItem{Key: "required", Value: m.Required}) + info = append(info, yaml.MapItem{"required", m.Required}) } if m.In != "" { - info = append(info, yaml.MapItem{Key: "in", Value: m.In}) + info = append(info, yaml.MapItem{"in", m.In}) } if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info = append(info, yaml.MapItem{"description", m.Description}) } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info = append(info, yaml.MapItem{"name", m.Name}) } if m.Type != "" { - info = append(info, yaml.MapItem{Key: "type", Value: m.Type}) + info = append(info, yaml.MapItem{"type", m.Type}) } if m.Format != "" { - info = append(info, yaml.MapItem{Key: "format", Value: m.Format}) + info = append(info, yaml.MapItem{"format", m.Format}) } if m.Items != nil { - info = append(info, yaml.MapItem{Key: "items", Value: m.Items.ToRawInfo()}) + info = append(info, yaml.MapItem{"items", m.Items.ToRawInfo()}) } // &{Name:items Type:PrimitivesItems StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.CollectionFormat != "" { - info = append(info, yaml.MapItem{Key: "collectionFormat", Value: m.CollectionFormat}) + info = append(info, yaml.MapItem{"collectionFormat", m.CollectionFormat}) } if m.Default != nil { - info = append(info, yaml.MapItem{Key: "default", Value: m.Default.ToRawInfo()}) + info = append(info, yaml.MapItem{"default", m.Default.ToRawInfo()}) } // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Maximum != 0.0 { - info = append(info, yaml.MapItem{Key: "maximum", Value: m.Maximum}) + info = append(info, yaml.MapItem{"maximum", m.Maximum}) } if m.ExclusiveMaximum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMaximum", Value: m.ExclusiveMaximum}) + info = append(info, yaml.MapItem{"exclusiveMaximum", m.ExclusiveMaximum}) } if m.Minimum != 0.0 { - info = append(info, yaml.MapItem{Key: "minimum", Value: m.Minimum}) + info = append(info, yaml.MapItem{"minimum", m.Minimum}) } if m.ExclusiveMinimum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMinimum", Value: m.ExclusiveMinimum}) + info = append(info, yaml.MapItem{"exclusiveMinimum", m.ExclusiveMinimum}) } if m.MaxLength != 0 { - info = append(info, yaml.MapItem{Key: "maxLength", Value: m.MaxLength}) + info = append(info, yaml.MapItem{"maxLength", m.MaxLength}) } if m.MinLength != 0 { - info = append(info, yaml.MapItem{Key: "minLength", Value: m.MinLength}) + info = append(info, yaml.MapItem{"minLength", m.MinLength}) } if m.Pattern != "" { - info = append(info, yaml.MapItem{Key: "pattern", Value: m.Pattern}) + info = append(info, yaml.MapItem{"pattern", m.Pattern}) } if m.MaxItems != 0 { - info = append(info, yaml.MapItem{Key: "maxItems", Value: m.MaxItems}) + info = append(info, yaml.MapItem{"maxItems", m.MaxItems}) } if m.MinItems != 0 { - info = append(info, yaml.MapItem{Key: "minItems", Value: m.MinItems}) + info = append(info, yaml.MapItem{"minItems", m.MinItems}) } if m.UniqueItems != false { - info = append(info, yaml.MapItem{Key: "uniqueItems", Value: m.UniqueItems}) + info = append(info, yaml.MapItem{"uniqueItems", m.UniqueItems}) } if len(m.Enum) != 0 { items := make([]interface{}, 0) for _, item := range m.Enum { items = append(items, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "enum", Value: items}) + info = append(info, yaml.MapItem{"enum", items}) } // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.MultipleOf != 0.0 { - info = append(info, yaml.MapItem{Key: "multipleOf", Value: m.MultipleOf}) + info = append(info, yaml.MapItem{"multipleOf", m.MultipleOf}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} @@ -7632,12 +7606,9 @@ func (m *HeaderParameterSubSchema) ToRawInfo() interface{} { // ToRawInfo returns a description of Headers suitable for JSON or YAML export. func (m *Headers) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:additionalProperties Type:NamedHeader StringEnumValues:[] MapType:Header Repeated:true Pattern: Implicit:true Description:} @@ -7647,30 +7618,29 @@ func (m *Headers) ToRawInfo() interface{} { // ToRawInfo returns a description of Info suitable for JSON or YAML export. func (m *Info) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info + if m.Title != "" { + info = append(info, yaml.MapItem{"title", m.Title}) + } + if m.Version != "" { + info = append(info, yaml.MapItem{"version", m.Version}) } - // always include this required field. - info = append(info, yaml.MapItem{Key: "title", Value: m.Title}) - // always include this required field. - info = append(info, yaml.MapItem{Key: "version", Value: m.Version}) if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info = append(info, yaml.MapItem{"description", m.Description}) } if m.TermsOfService != "" { - info = append(info, yaml.MapItem{Key: "termsOfService", Value: m.TermsOfService}) + info = append(info, yaml.MapItem{"termsOfService", m.TermsOfService}) } if m.Contact != nil { - info = append(info, yaml.MapItem{Key: "contact", Value: m.Contact.ToRawInfo()}) + info = append(info, yaml.MapItem{"contact", m.Contact.ToRawInfo()}) } // &{Name:contact Type:Contact StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.License != nil { - info = append(info, yaml.MapItem{Key: "license", Value: m.License.ToRawInfo()}) + info = append(info, yaml.MapItem{"license", m.License.ToRawInfo()}) } // &{Name:license Type:License StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} @@ -7680,15 +7650,12 @@ func (m *Info) ToRawInfo() interface{} { // ToRawInfo returns a description of ItemsItem suitable for JSON or YAML export. func (m *ItemsItem) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if len(m.Schema) != 0 { items := make([]interface{}, 0) for _, item := range m.Schema { items = append(items, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "schema", Value: items}) + info = append(info, yaml.MapItem{"schema", items}) } // &{Name:schema Type:Schema StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} return info @@ -7697,13 +7664,11 @@ func (m *ItemsItem) ToRawInfo() interface{} { // ToRawInfo returns a description of JsonReference suitable for JSON or YAML export. func (m *JsonReference) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info + if m.XRef != "" { + info = append(info, yaml.MapItem{"$ref", m.XRef}) } - // always include this required field. - info = append(info, yaml.MapItem{Key: "$ref", Value: m.XRef}) if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info = append(info, yaml.MapItem{"description", m.Description}) } return info } @@ -7711,17 +7676,15 @@ func (m *JsonReference) ToRawInfo() interface{} { // ToRawInfo returns a description of License suitable for JSON or YAML export. func (m *License) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info + if m.Name != "" { + info = append(info, yaml.MapItem{"name", m.Name}) } - // always include this required field. - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) if m.Url != "" { - info = append(info, yaml.MapItem{Key: "url", Value: m.Url}) + info = append(info, yaml.MapItem{"url", m.Url}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} @@ -7731,11 +7694,8 @@ func (m *License) ToRawInfo() interface{} { // ToRawInfo returns a description of NamedAny suitable for JSON or YAML export. func (m *NamedAny) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info = append(info, yaml.MapItem{"name", m.Name}) } // &{Name:value Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info @@ -7744,11 +7704,8 @@ func (m *NamedAny) ToRawInfo() interface{} { // ToRawInfo returns a description of NamedHeader suitable for JSON or YAML export. func (m *NamedHeader) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info = append(info, yaml.MapItem{"name", m.Name}) } // &{Name:value Type:Header StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info @@ -7757,11 +7714,8 @@ func (m *NamedHeader) ToRawInfo() interface{} { // ToRawInfo returns a description of NamedParameter suitable for JSON or YAML export. func (m *NamedParameter) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info = append(info, yaml.MapItem{"name", m.Name}) } // &{Name:value Type:Parameter StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info @@ -7770,11 +7724,8 @@ func (m *NamedParameter) ToRawInfo() interface{} { // ToRawInfo returns a description of NamedPathItem suitable for JSON or YAML export. func (m *NamedPathItem) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info = append(info, yaml.MapItem{"name", m.Name}) } // &{Name:value Type:PathItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info @@ -7783,11 +7734,8 @@ func (m *NamedPathItem) ToRawInfo() interface{} { // ToRawInfo returns a description of NamedResponse suitable for JSON or YAML export. func (m *NamedResponse) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info = append(info, yaml.MapItem{"name", m.Name}) } // &{Name:value Type:Response StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info @@ -7796,11 +7744,8 @@ func (m *NamedResponse) ToRawInfo() interface{} { // ToRawInfo returns a description of NamedResponseValue suitable for JSON or YAML export. func (m *NamedResponseValue) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info = append(info, yaml.MapItem{"name", m.Name}) } // &{Name:value Type:ResponseValue StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info @@ -7809,11 +7754,8 @@ func (m *NamedResponseValue) ToRawInfo() interface{} { // ToRawInfo returns a description of NamedSchema suitable for JSON or YAML export. func (m *NamedSchema) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info = append(info, yaml.MapItem{"name", m.Name}) } // &{Name:value Type:Schema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info @@ -7822,11 +7764,8 @@ func (m *NamedSchema) ToRawInfo() interface{} { // ToRawInfo returns a description of NamedSecurityDefinitionsItem suitable for JSON or YAML export. func (m *NamedSecurityDefinitionsItem) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info = append(info, yaml.MapItem{"name", m.Name}) } // &{Name:value Type:SecurityDefinitionsItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info @@ -7835,14 +7774,11 @@ func (m *NamedSecurityDefinitionsItem) ToRawInfo() interface{} { // ToRawInfo returns a description of NamedString suitable for JSON or YAML export. func (m *NamedString) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info = append(info, yaml.MapItem{"name", m.Name}) } if m.Value != "" { - info = append(info, yaml.MapItem{Key: "value", Value: m.Value}) + info = append(info, yaml.MapItem{"value", m.Value}) } return info } @@ -7850,11 +7786,8 @@ func (m *NamedString) ToRawInfo() interface{} { // ToRawInfo returns a description of NamedStringArray suitable for JSON or YAML export. func (m *NamedStringArray) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info = append(info, yaml.MapItem{"name", m.Name}) } // &{Name:value Type:StringArray StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info @@ -7890,27 +7823,28 @@ func (m *NonBodyParameter) ToRawInfo() interface{} { // ToRawInfo returns a description of Oauth2AccessCodeSecurity suitable for JSON or YAML export. func (m *Oauth2AccessCodeSecurity) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info + if m.Type != "" { + info = append(info, yaml.MapItem{"type", m.Type}) + } + if m.Flow != "" { + info = append(info, yaml.MapItem{"flow", m.Flow}) } - // always include this required field. - info = append(info, yaml.MapItem{Key: "type", Value: m.Type}) - // always include this required field. - info = append(info, yaml.MapItem{Key: "flow", Value: m.Flow}) if m.Scopes != nil { - info = append(info, yaml.MapItem{Key: "scopes", Value: m.Scopes.ToRawInfo()}) + info = append(info, yaml.MapItem{"scopes", m.Scopes.ToRawInfo()}) } // &{Name:scopes Type:Oauth2Scopes StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - // always include this required field. - info = append(info, yaml.MapItem{Key: "authorizationUrl", Value: m.AuthorizationUrl}) - // always include this required field. - info = append(info, yaml.MapItem{Key: "tokenUrl", Value: m.TokenUrl}) + if m.AuthorizationUrl != "" { + info = append(info, yaml.MapItem{"authorizationUrl", m.AuthorizationUrl}) + } + if m.TokenUrl != "" { + info = append(info, yaml.MapItem{"tokenUrl", m.TokenUrl}) + } if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info = append(info, yaml.MapItem{"description", m.Description}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} @@ -7920,25 +7854,25 @@ func (m *Oauth2AccessCodeSecurity) ToRawInfo() interface{} { // ToRawInfo returns a description of Oauth2ApplicationSecurity suitable for JSON or YAML export. func (m *Oauth2ApplicationSecurity) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info + if m.Type != "" { + info = append(info, yaml.MapItem{"type", m.Type}) + } + if m.Flow != "" { + info = append(info, yaml.MapItem{"flow", m.Flow}) } - // always include this required field. - info = append(info, yaml.MapItem{Key: "type", Value: m.Type}) - // always include this required field. - info = append(info, yaml.MapItem{Key: "flow", Value: m.Flow}) if m.Scopes != nil { - info = append(info, yaml.MapItem{Key: "scopes", Value: m.Scopes.ToRawInfo()}) + info = append(info, yaml.MapItem{"scopes", m.Scopes.ToRawInfo()}) } // &{Name:scopes Type:Oauth2Scopes StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - // always include this required field. - info = append(info, yaml.MapItem{Key: "tokenUrl", Value: m.TokenUrl}) + if m.TokenUrl != "" { + info = append(info, yaml.MapItem{"tokenUrl", m.TokenUrl}) + } if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info = append(info, yaml.MapItem{"description", m.Description}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} @@ -7948,25 +7882,25 @@ func (m *Oauth2ApplicationSecurity) ToRawInfo() interface{} { // ToRawInfo returns a description of Oauth2ImplicitSecurity suitable for JSON or YAML export. func (m *Oauth2ImplicitSecurity) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info + if m.Type != "" { + info = append(info, yaml.MapItem{"type", m.Type}) + } + if m.Flow != "" { + info = append(info, yaml.MapItem{"flow", m.Flow}) } - // always include this required field. - info = append(info, yaml.MapItem{Key: "type", Value: m.Type}) - // always include this required field. - info = append(info, yaml.MapItem{Key: "flow", Value: m.Flow}) if m.Scopes != nil { - info = append(info, yaml.MapItem{Key: "scopes", Value: m.Scopes.ToRawInfo()}) + info = append(info, yaml.MapItem{"scopes", m.Scopes.ToRawInfo()}) } // &{Name:scopes Type:Oauth2Scopes StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - // always include this required field. - info = append(info, yaml.MapItem{Key: "authorizationUrl", Value: m.AuthorizationUrl}) + if m.AuthorizationUrl != "" { + info = append(info, yaml.MapItem{"authorizationUrl", m.AuthorizationUrl}) + } if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info = append(info, yaml.MapItem{"description", m.Description}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} @@ -7976,25 +7910,25 @@ func (m *Oauth2ImplicitSecurity) ToRawInfo() interface{} { // ToRawInfo returns a description of Oauth2PasswordSecurity suitable for JSON or YAML export. func (m *Oauth2PasswordSecurity) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info + if m.Type != "" { + info = append(info, yaml.MapItem{"type", m.Type}) + } + if m.Flow != "" { + info = append(info, yaml.MapItem{"flow", m.Flow}) } - // always include this required field. - info = append(info, yaml.MapItem{Key: "type", Value: m.Type}) - // always include this required field. - info = append(info, yaml.MapItem{Key: "flow", Value: m.Flow}) if m.Scopes != nil { - info = append(info, yaml.MapItem{Key: "scopes", Value: m.Scopes.ToRawInfo()}) + info = append(info, yaml.MapItem{"scopes", m.Scopes.ToRawInfo()}) } // &{Name:scopes Type:Oauth2Scopes StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - // always include this required field. - info = append(info, yaml.MapItem{Key: "tokenUrl", Value: m.TokenUrl}) + if m.TokenUrl != "" { + info = append(info, yaml.MapItem{"tokenUrl", m.TokenUrl}) + } if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info = append(info, yaml.MapItem{"description", m.Description}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} @@ -8004,9 +7938,6 @@ func (m *Oauth2PasswordSecurity) ToRawInfo() interface{} { // ToRawInfo returns a description of Oauth2Scopes suitable for JSON or YAML export. func (m *Oauth2Scopes) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } // &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:} return info } @@ -8014,59 +7945,57 @@ func (m *Oauth2Scopes) ToRawInfo() interface{} { // ToRawInfo returns a description of Operation suitable for JSON or YAML export. func (m *Operation) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if len(m.Tags) != 0 { - info = append(info, yaml.MapItem{Key: "tags", Value: m.Tags}) + info = append(info, yaml.MapItem{"tags", m.Tags}) } if m.Summary != "" { - info = append(info, yaml.MapItem{Key: "summary", Value: m.Summary}) + info = append(info, yaml.MapItem{"summary", m.Summary}) } if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info = append(info, yaml.MapItem{"description", m.Description}) } if m.ExternalDocs != nil { - info = append(info, yaml.MapItem{Key: "externalDocs", Value: m.ExternalDocs.ToRawInfo()}) + info = append(info, yaml.MapItem{"externalDocs", m.ExternalDocs.ToRawInfo()}) } // &{Name:externalDocs Type:ExternalDocs StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.OperationId != "" { - info = append(info, yaml.MapItem{Key: "operationId", Value: m.OperationId}) + info = append(info, yaml.MapItem{"operationId", m.OperationId}) } if len(m.Produces) != 0 { - info = append(info, yaml.MapItem{Key: "produces", Value: m.Produces}) + info = append(info, yaml.MapItem{"produces", m.Produces}) } if len(m.Consumes) != 0 { - info = append(info, yaml.MapItem{Key: "consumes", Value: m.Consumes}) + info = append(info, yaml.MapItem{"consumes", m.Consumes}) } if len(m.Parameters) != 0 { items := make([]interface{}, 0) for _, item := range m.Parameters { items = append(items, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "parameters", Value: items}) + info = append(info, yaml.MapItem{"parameters", items}) } // &{Name:parameters Type:ParametersItem StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:The parameters needed to send a valid API call.} - // always include this required field. - info = append(info, yaml.MapItem{Key: "responses", Value: m.Responses.ToRawInfo()}) + if m.Responses != nil { + info = append(info, yaml.MapItem{"responses", m.Responses.ToRawInfo()}) + } // &{Name:responses Type:Responses StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if len(m.Schemes) != 0 { - info = append(info, yaml.MapItem{Key: "schemes", Value: m.Schemes}) + info = append(info, yaml.MapItem{"schemes", m.Schemes}) } if m.Deprecated != false { - info = append(info, yaml.MapItem{Key: "deprecated", Value: m.Deprecated}) + info = append(info, yaml.MapItem{"deprecated", m.Deprecated}) } if len(m.Security) != 0 { items := make([]interface{}, 0) for _, item := range m.Security { items = append(items, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "security", Value: items}) + info = append(info, yaml.MapItem{"security", items}) } // &{Name:security Type:SecurityRequirement StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} @@ -8093,12 +8022,9 @@ func (m *Parameter) ToRawInfo() interface{} { // ToRawInfo returns a description of ParameterDefinitions suitable for JSON or YAML export. func (m *ParameterDefinitions) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:additionalProperties Type:NamedParameter StringEnumValues:[] MapType:Parameter Repeated:true Pattern: Implicit:true Description:} @@ -8125,38 +8051,35 @@ func (m *ParametersItem) ToRawInfo() interface{} { // ToRawInfo returns a description of PathItem suitable for JSON or YAML export. func (m *PathItem) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.XRef != "" { - info = append(info, yaml.MapItem{Key: "$ref", Value: m.XRef}) + info = append(info, yaml.MapItem{"$ref", m.XRef}) } if m.Get != nil { - info = append(info, yaml.MapItem{Key: "get", Value: m.Get.ToRawInfo()}) + info = append(info, yaml.MapItem{"get", m.Get.ToRawInfo()}) } // &{Name:get Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Put != nil { - info = append(info, yaml.MapItem{Key: "put", Value: m.Put.ToRawInfo()}) + info = append(info, yaml.MapItem{"put", m.Put.ToRawInfo()}) } // &{Name:put Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Post != nil { - info = append(info, yaml.MapItem{Key: "post", Value: m.Post.ToRawInfo()}) + info = append(info, yaml.MapItem{"post", m.Post.ToRawInfo()}) } // &{Name:post Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Delete != nil { - info = append(info, yaml.MapItem{Key: "delete", Value: m.Delete.ToRawInfo()}) + info = append(info, yaml.MapItem{"delete", m.Delete.ToRawInfo()}) } // &{Name:delete Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Options != nil { - info = append(info, yaml.MapItem{Key: "options", Value: m.Options.ToRawInfo()}) + info = append(info, yaml.MapItem{"options", m.Options.ToRawInfo()}) } // &{Name:options Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Head != nil { - info = append(info, yaml.MapItem{Key: "head", Value: m.Head.ToRawInfo()}) + info = append(info, yaml.MapItem{"head", m.Head.ToRawInfo()}) } // &{Name:head Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Patch != nil { - info = append(info, yaml.MapItem{Key: "patch", Value: m.Patch.ToRawInfo()}) + info = append(info, yaml.MapItem{"patch", m.Patch.ToRawInfo()}) } // &{Name:patch Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if len(m.Parameters) != 0 { @@ -8164,12 +8087,12 @@ func (m *PathItem) ToRawInfo() interface{} { for _, item := range m.Parameters { items = append(items, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "parameters", Value: items}) + info = append(info, yaml.MapItem{"parameters", items}) } // &{Name:parameters Type:ParametersItem StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:The parameters needed to send a valid API call.} if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} @@ -8179,81 +8102,79 @@ func (m *PathItem) ToRawInfo() interface{} { // ToRawInfo returns a description of PathParameterSubSchema suitable for JSON or YAML export. func (m *PathParameterSubSchema) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info + if m.Required != false { + info = append(info, yaml.MapItem{"required", m.Required}) } - // always include this required field. - info = append(info, yaml.MapItem{Key: "required", Value: m.Required}) if m.In != "" { - info = append(info, yaml.MapItem{Key: "in", Value: m.In}) + info = append(info, yaml.MapItem{"in", m.In}) } if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info = append(info, yaml.MapItem{"description", m.Description}) } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info = append(info, yaml.MapItem{"name", m.Name}) } if m.Type != "" { - info = append(info, yaml.MapItem{Key: "type", Value: m.Type}) + info = append(info, yaml.MapItem{"type", m.Type}) } if m.Format != "" { - info = append(info, yaml.MapItem{Key: "format", Value: m.Format}) + info = append(info, yaml.MapItem{"format", m.Format}) } if m.Items != nil { - info = append(info, yaml.MapItem{Key: "items", Value: m.Items.ToRawInfo()}) + info = append(info, yaml.MapItem{"items", m.Items.ToRawInfo()}) } // &{Name:items Type:PrimitivesItems StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.CollectionFormat != "" { - info = append(info, yaml.MapItem{Key: "collectionFormat", Value: m.CollectionFormat}) + info = append(info, yaml.MapItem{"collectionFormat", m.CollectionFormat}) } if m.Default != nil { - info = append(info, yaml.MapItem{Key: "default", Value: m.Default.ToRawInfo()}) + info = append(info, yaml.MapItem{"default", m.Default.ToRawInfo()}) } // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Maximum != 0.0 { - info = append(info, yaml.MapItem{Key: "maximum", Value: m.Maximum}) + info = append(info, yaml.MapItem{"maximum", m.Maximum}) } if m.ExclusiveMaximum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMaximum", Value: m.ExclusiveMaximum}) + info = append(info, yaml.MapItem{"exclusiveMaximum", m.ExclusiveMaximum}) } if m.Minimum != 0.0 { - info = append(info, yaml.MapItem{Key: "minimum", Value: m.Minimum}) + info = append(info, yaml.MapItem{"minimum", m.Minimum}) } if m.ExclusiveMinimum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMinimum", Value: m.ExclusiveMinimum}) + info = append(info, yaml.MapItem{"exclusiveMinimum", m.ExclusiveMinimum}) } if m.MaxLength != 0 { - info = append(info, yaml.MapItem{Key: "maxLength", Value: m.MaxLength}) + info = append(info, yaml.MapItem{"maxLength", m.MaxLength}) } if m.MinLength != 0 { - info = append(info, yaml.MapItem{Key: "minLength", Value: m.MinLength}) + info = append(info, yaml.MapItem{"minLength", m.MinLength}) } if m.Pattern != "" { - info = append(info, yaml.MapItem{Key: "pattern", Value: m.Pattern}) + info = append(info, yaml.MapItem{"pattern", m.Pattern}) } if m.MaxItems != 0 { - info = append(info, yaml.MapItem{Key: "maxItems", Value: m.MaxItems}) + info = append(info, yaml.MapItem{"maxItems", m.MaxItems}) } if m.MinItems != 0 { - info = append(info, yaml.MapItem{Key: "minItems", Value: m.MinItems}) + info = append(info, yaml.MapItem{"minItems", m.MinItems}) } if m.UniqueItems != false { - info = append(info, yaml.MapItem{Key: "uniqueItems", Value: m.UniqueItems}) + info = append(info, yaml.MapItem{"uniqueItems", m.UniqueItems}) } if len(m.Enum) != 0 { items := make([]interface{}, 0) for _, item := range m.Enum { items = append(items, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "enum", Value: items}) + info = append(info, yaml.MapItem{"enum", items}) } // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.MultipleOf != 0.0 { - info = append(info, yaml.MapItem{Key: "multipleOf", Value: m.MultipleOf}) + info = append(info, yaml.MapItem{"multipleOf", m.MultipleOf}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} @@ -8263,18 +8184,15 @@ func (m *PathParameterSubSchema) ToRawInfo() interface{} { // ToRawInfo returns a description of Paths suitable for JSON or YAML export. func (m *Paths) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} if m.Path != nil { for _, item := range m.Path { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:Path Type:NamedPathItem StringEnumValues:[] MapType:PathItem Repeated:true Pattern:^/ Implicit:true Description:} @@ -8284,70 +8202,67 @@ func (m *Paths) ToRawInfo() interface{} { // ToRawInfo returns a description of PrimitivesItems suitable for JSON or YAML export. func (m *PrimitivesItems) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.Type != "" { - info = append(info, yaml.MapItem{Key: "type", Value: m.Type}) + info = append(info, yaml.MapItem{"type", m.Type}) } if m.Format != "" { - info = append(info, yaml.MapItem{Key: "format", Value: m.Format}) + info = append(info, yaml.MapItem{"format", m.Format}) } if m.Items != nil { - info = append(info, yaml.MapItem{Key: "items", Value: m.Items.ToRawInfo()}) + info = append(info, yaml.MapItem{"items", m.Items.ToRawInfo()}) } // &{Name:items Type:PrimitivesItems StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.CollectionFormat != "" { - info = append(info, yaml.MapItem{Key: "collectionFormat", Value: m.CollectionFormat}) + info = append(info, yaml.MapItem{"collectionFormat", m.CollectionFormat}) } if m.Default != nil { - info = append(info, yaml.MapItem{Key: "default", Value: m.Default.ToRawInfo()}) + info = append(info, yaml.MapItem{"default", m.Default.ToRawInfo()}) } // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Maximum != 0.0 { - info = append(info, yaml.MapItem{Key: "maximum", Value: m.Maximum}) + info = append(info, yaml.MapItem{"maximum", m.Maximum}) } if m.ExclusiveMaximum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMaximum", Value: m.ExclusiveMaximum}) + info = append(info, yaml.MapItem{"exclusiveMaximum", m.ExclusiveMaximum}) } if m.Minimum != 0.0 { - info = append(info, yaml.MapItem{Key: "minimum", Value: m.Minimum}) + info = append(info, yaml.MapItem{"minimum", m.Minimum}) } if m.ExclusiveMinimum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMinimum", Value: m.ExclusiveMinimum}) + info = append(info, yaml.MapItem{"exclusiveMinimum", m.ExclusiveMinimum}) } if m.MaxLength != 0 { - info = append(info, yaml.MapItem{Key: "maxLength", Value: m.MaxLength}) + info = append(info, yaml.MapItem{"maxLength", m.MaxLength}) } if m.MinLength != 0 { - info = append(info, yaml.MapItem{Key: "minLength", Value: m.MinLength}) + info = append(info, yaml.MapItem{"minLength", m.MinLength}) } if m.Pattern != "" { - info = append(info, yaml.MapItem{Key: "pattern", Value: m.Pattern}) + info = append(info, yaml.MapItem{"pattern", m.Pattern}) } if m.MaxItems != 0 { - info = append(info, yaml.MapItem{Key: "maxItems", Value: m.MaxItems}) + info = append(info, yaml.MapItem{"maxItems", m.MaxItems}) } if m.MinItems != 0 { - info = append(info, yaml.MapItem{Key: "minItems", Value: m.MinItems}) + info = append(info, yaml.MapItem{"minItems", m.MinItems}) } if m.UniqueItems != false { - info = append(info, yaml.MapItem{Key: "uniqueItems", Value: m.UniqueItems}) + info = append(info, yaml.MapItem{"uniqueItems", m.UniqueItems}) } if len(m.Enum) != 0 { items := make([]interface{}, 0) for _, item := range m.Enum { items = append(items, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "enum", Value: items}) + info = append(info, yaml.MapItem{"enum", items}) } // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.MultipleOf != 0.0 { - info = append(info, yaml.MapItem{Key: "multipleOf", Value: m.MultipleOf}) + info = append(info, yaml.MapItem{"multipleOf", m.MultipleOf}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} @@ -8357,12 +8272,9 @@ func (m *PrimitivesItems) ToRawInfo() interface{} { // ToRawInfo returns a description of Properties suitable for JSON or YAML export. func (m *Properties) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:additionalProperties Type:NamedSchema StringEnumValues:[] MapType:Schema Repeated:true Pattern: Implicit:true Description:} @@ -8372,85 +8284,82 @@ func (m *Properties) ToRawInfo() interface{} { // ToRawInfo returns a description of QueryParameterSubSchema suitable for JSON or YAML export. func (m *QueryParameterSubSchema) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.Required != false { - info = append(info, yaml.MapItem{Key: "required", Value: m.Required}) + info = append(info, yaml.MapItem{"required", m.Required}) } if m.In != "" { - info = append(info, yaml.MapItem{Key: "in", Value: m.In}) + info = append(info, yaml.MapItem{"in", m.In}) } if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info = append(info, yaml.MapItem{"description", m.Description}) } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info = append(info, yaml.MapItem{"name", m.Name}) } if m.AllowEmptyValue != false { - info = append(info, yaml.MapItem{Key: "allowEmptyValue", Value: m.AllowEmptyValue}) + info = append(info, yaml.MapItem{"allowEmptyValue", m.AllowEmptyValue}) } if m.Type != "" { - info = append(info, yaml.MapItem{Key: "type", Value: m.Type}) + info = append(info, yaml.MapItem{"type", m.Type}) } if m.Format != "" { - info = append(info, yaml.MapItem{Key: "format", Value: m.Format}) + info = append(info, yaml.MapItem{"format", m.Format}) } if m.Items != nil { - info = append(info, yaml.MapItem{Key: "items", Value: m.Items.ToRawInfo()}) + info = append(info, yaml.MapItem{"items", m.Items.ToRawInfo()}) } // &{Name:items Type:PrimitivesItems StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.CollectionFormat != "" { - info = append(info, yaml.MapItem{Key: "collectionFormat", Value: m.CollectionFormat}) + info = append(info, yaml.MapItem{"collectionFormat", m.CollectionFormat}) } if m.Default != nil { - info = append(info, yaml.MapItem{Key: "default", Value: m.Default.ToRawInfo()}) + info = append(info, yaml.MapItem{"default", m.Default.ToRawInfo()}) } // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Maximum != 0.0 { - info = append(info, yaml.MapItem{Key: "maximum", Value: m.Maximum}) + info = append(info, yaml.MapItem{"maximum", m.Maximum}) } if m.ExclusiveMaximum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMaximum", Value: m.ExclusiveMaximum}) + info = append(info, yaml.MapItem{"exclusiveMaximum", m.ExclusiveMaximum}) } if m.Minimum != 0.0 { - info = append(info, yaml.MapItem{Key: "minimum", Value: m.Minimum}) + info = append(info, yaml.MapItem{"minimum", m.Minimum}) } if m.ExclusiveMinimum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMinimum", Value: m.ExclusiveMinimum}) + info = append(info, yaml.MapItem{"exclusiveMinimum", m.ExclusiveMinimum}) } if m.MaxLength != 0 { - info = append(info, yaml.MapItem{Key: "maxLength", Value: m.MaxLength}) + info = append(info, yaml.MapItem{"maxLength", m.MaxLength}) } if m.MinLength != 0 { - info = append(info, yaml.MapItem{Key: "minLength", Value: m.MinLength}) + info = append(info, yaml.MapItem{"minLength", m.MinLength}) } if m.Pattern != "" { - info = append(info, yaml.MapItem{Key: "pattern", Value: m.Pattern}) + info = append(info, yaml.MapItem{"pattern", m.Pattern}) } if m.MaxItems != 0 { - info = append(info, yaml.MapItem{Key: "maxItems", Value: m.MaxItems}) + info = append(info, yaml.MapItem{"maxItems", m.MaxItems}) } if m.MinItems != 0 { - info = append(info, yaml.MapItem{Key: "minItems", Value: m.MinItems}) + info = append(info, yaml.MapItem{"minItems", m.MinItems}) } if m.UniqueItems != false { - info = append(info, yaml.MapItem{Key: "uniqueItems", Value: m.UniqueItems}) + info = append(info, yaml.MapItem{"uniqueItems", m.UniqueItems}) } if len(m.Enum) != 0 { items := make([]interface{}, 0) for _, item := range m.Enum { items = append(items, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "enum", Value: items}) + info = append(info, yaml.MapItem{"enum", items}) } // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.MultipleOf != 0.0 { - info = append(info, yaml.MapItem{Key: "multipleOf", Value: m.MultipleOf}) + info = append(info, yaml.MapItem{"multipleOf", m.MultipleOf}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} @@ -8460,26 +8369,24 @@ func (m *QueryParameterSubSchema) ToRawInfo() interface{} { // ToRawInfo returns a description of Response suitable for JSON or YAML export. func (m *Response) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info + if m.Description != "" { + info = append(info, yaml.MapItem{"description", m.Description}) } - // always include this required field. - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) if m.Schema != nil { - info = append(info, yaml.MapItem{Key: "schema", Value: m.Schema.ToRawInfo()}) + info = append(info, yaml.MapItem{"schema", m.Schema.ToRawInfo()}) } // &{Name:schema Type:SchemaItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Headers != nil { - info = append(info, yaml.MapItem{Key: "headers", Value: m.Headers.ToRawInfo()}) + info = append(info, yaml.MapItem{"headers", m.Headers.ToRawInfo()}) } // &{Name:headers Type:Headers StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Examples != nil { - info = append(info, yaml.MapItem{Key: "examples", Value: m.Examples.ToRawInfo()}) + info = append(info, yaml.MapItem{"examples", m.Examples.ToRawInfo()}) } // &{Name:examples Type:Examples StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} @@ -8489,12 +8396,9 @@ func (m *Response) ToRawInfo() interface{} { // ToRawInfo returns a description of ResponseDefinitions suitable for JSON or YAML export. func (m *ResponseDefinitions) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:additionalProperties Type:NamedResponse StringEnumValues:[] MapType:Response Repeated:true Pattern: Implicit:true Description:} @@ -8521,18 +8425,15 @@ func (m *ResponseValue) ToRawInfo() interface{} { // ToRawInfo returns a description of Responses suitable for JSON or YAML export. func (m *Responses) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.ResponseCode != nil { for _, item := range m.ResponseCode { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:ResponseCode Type:NamedResponseValue StringEnumValues:[] MapType:ResponseValue Repeated:true Pattern:^([0-9]{3})$|^(default)$ Implicit:true Description:} if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} @@ -8542,84 +8443,81 @@ func (m *Responses) ToRawInfo() interface{} { // ToRawInfo returns a description of Schema suitable for JSON or YAML export. func (m *Schema) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.XRef != "" { - info = append(info, yaml.MapItem{Key: "$ref", Value: m.XRef}) + info = append(info, yaml.MapItem{"$ref", m.XRef}) } if m.Format != "" { - info = append(info, yaml.MapItem{Key: "format", Value: m.Format}) + info = append(info, yaml.MapItem{"format", m.Format}) } if m.Title != "" { - info = append(info, yaml.MapItem{Key: "title", Value: m.Title}) + info = append(info, yaml.MapItem{"title", m.Title}) } if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info = append(info, yaml.MapItem{"description", m.Description}) } if m.Default != nil { - info = append(info, yaml.MapItem{Key: "default", Value: m.Default.ToRawInfo()}) + info = append(info, yaml.MapItem{"default", m.Default.ToRawInfo()}) } // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.MultipleOf != 0.0 { - info = append(info, yaml.MapItem{Key: "multipleOf", Value: m.MultipleOf}) + info = append(info, yaml.MapItem{"multipleOf", m.MultipleOf}) } if m.Maximum != 0.0 { - info = append(info, yaml.MapItem{Key: "maximum", Value: m.Maximum}) + info = append(info, yaml.MapItem{"maximum", m.Maximum}) } if m.ExclusiveMaximum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMaximum", Value: m.ExclusiveMaximum}) + info = append(info, yaml.MapItem{"exclusiveMaximum", m.ExclusiveMaximum}) } if m.Minimum != 0.0 { - info = append(info, yaml.MapItem{Key: "minimum", Value: m.Minimum}) + info = append(info, yaml.MapItem{"minimum", m.Minimum}) } if m.ExclusiveMinimum != false { - info = append(info, yaml.MapItem{Key: "exclusiveMinimum", Value: m.ExclusiveMinimum}) + info = append(info, yaml.MapItem{"exclusiveMinimum", m.ExclusiveMinimum}) } if m.MaxLength != 0 { - info = append(info, yaml.MapItem{Key: "maxLength", Value: m.MaxLength}) + info = append(info, yaml.MapItem{"maxLength", m.MaxLength}) } if m.MinLength != 0 { - info = append(info, yaml.MapItem{Key: "minLength", Value: m.MinLength}) + info = append(info, yaml.MapItem{"minLength", m.MinLength}) } if m.Pattern != "" { - info = append(info, yaml.MapItem{Key: "pattern", Value: m.Pattern}) + info = append(info, yaml.MapItem{"pattern", m.Pattern}) } if m.MaxItems != 0 { - info = append(info, yaml.MapItem{Key: "maxItems", Value: m.MaxItems}) + info = append(info, yaml.MapItem{"maxItems", m.MaxItems}) } if m.MinItems != 0 { - info = append(info, yaml.MapItem{Key: "minItems", Value: m.MinItems}) + info = append(info, yaml.MapItem{"minItems", m.MinItems}) } if m.UniqueItems != false { - info = append(info, yaml.MapItem{Key: "uniqueItems", Value: m.UniqueItems}) + info = append(info, yaml.MapItem{"uniqueItems", m.UniqueItems}) } if m.MaxProperties != 0 { - info = append(info, yaml.MapItem{Key: "maxProperties", Value: m.MaxProperties}) + info = append(info, yaml.MapItem{"maxProperties", m.MaxProperties}) } if m.MinProperties != 0 { - info = append(info, yaml.MapItem{Key: "minProperties", Value: m.MinProperties}) + info = append(info, yaml.MapItem{"minProperties", m.MinProperties}) } if len(m.Required) != 0 { - info = append(info, yaml.MapItem{Key: "required", Value: m.Required}) + info = append(info, yaml.MapItem{"required", m.Required}) } if len(m.Enum) != 0 { items := make([]interface{}, 0) for _, item := range m.Enum { items = append(items, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "enum", Value: items}) + info = append(info, yaml.MapItem{"enum", items}) } // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.AdditionalProperties != nil { - info = append(info, yaml.MapItem{Key: "additionalProperties", Value: m.AdditionalProperties.ToRawInfo()}) + info = append(info, yaml.MapItem{"additionalProperties", m.AdditionalProperties.ToRawInfo()}) } // &{Name:additionalProperties Type:AdditionalPropertiesItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Type != nil { if len(m.Type.Value) == 1 { - info = append(info, yaml.MapItem{Key: "type", Value: m.Type.Value[0]}) + info = append(info, yaml.MapItem{"type", m.Type.Value[0]}) } else { - info = append(info, yaml.MapItem{Key: "type", Value: m.Type.Value}) + info = append(info, yaml.MapItem{"type", m.Type.Value}) } } // &{Name:type Type:TypeItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} @@ -8628,7 +8526,7 @@ func (m *Schema) ToRawInfo() interface{} { for _, item := range m.Items.Schema { items = append(items, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "items", Value: items[0]}) + info = append(info, yaml.MapItem{"items", items[0]}) } // &{Name:items Type:ItemsItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if len(m.AllOf) != 0 { @@ -8636,34 +8534,34 @@ func (m *Schema) ToRawInfo() interface{} { for _, item := range m.AllOf { items = append(items, item.ToRawInfo()) } - info = append(info, yaml.MapItem{Key: "allOf", Value: items}) + info = append(info, yaml.MapItem{"allOf", items}) } // &{Name:allOf Type:Schema StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.Properties != nil { - info = append(info, yaml.MapItem{Key: "properties", Value: m.Properties.ToRawInfo()}) + info = append(info, yaml.MapItem{"properties", m.Properties.ToRawInfo()}) } // &{Name:properties Type:Properties StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Discriminator != "" { - info = append(info, yaml.MapItem{Key: "discriminator", Value: m.Discriminator}) + info = append(info, yaml.MapItem{"discriminator", m.Discriminator}) } if m.ReadOnly != false { - info = append(info, yaml.MapItem{Key: "readOnly", Value: m.ReadOnly}) + info = append(info, yaml.MapItem{"readOnly", m.ReadOnly}) } if m.Xml != nil { - info = append(info, yaml.MapItem{Key: "xml", Value: m.Xml.ToRawInfo()}) + info = append(info, yaml.MapItem{"xml", m.Xml.ToRawInfo()}) } // &{Name:xml Type:Xml StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.ExternalDocs != nil { - info = append(info, yaml.MapItem{Key: "externalDocs", Value: m.ExternalDocs.ToRawInfo()}) + info = append(info, yaml.MapItem{"externalDocs", m.ExternalDocs.ToRawInfo()}) } // &{Name:externalDocs Type:ExternalDocs StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Example != nil { - info = append(info, yaml.MapItem{Key: "example", Value: m.Example.ToRawInfo()}) + info = append(info, yaml.MapItem{"example", m.Example.ToRawInfo()}) } // &{Name:example Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} @@ -8690,12 +8588,9 @@ func (m *SchemaItem) ToRawInfo() interface{} { // ToRawInfo returns a description of SecurityDefinitions suitable for JSON or YAML export. func (m *SecurityDefinitions) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:additionalProperties Type:NamedSecurityDefinitionsItem StringEnumValues:[] MapType:SecurityDefinitionsItem Repeated:true Pattern: Implicit:true Description:} @@ -8742,12 +8637,9 @@ func (m *SecurityDefinitionsItem) ToRawInfo() interface{} { // ToRawInfo returns a description of SecurityRequirement suitable for JSON or YAML export. func (m *SecurityRequirement) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:additionalProperties Type:NamedStringArray StringEnumValues:[] MapType:StringArray Repeated:true Pattern: Implicit:true Description:} @@ -8762,21 +8654,19 @@ func (m *StringArray) ToRawInfo() interface{} { // ToRawInfo returns a description of Tag suitable for JSON or YAML export. func (m *Tag) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info + if m.Name != "" { + info = append(info, yaml.MapItem{"name", m.Name}) } - // always include this required field. - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) if m.Description != "" { - info = append(info, yaml.MapItem{Key: "description", Value: m.Description}) + info = append(info, yaml.MapItem{"description", m.Description}) } if m.ExternalDocs != nil { - info = append(info, yaml.MapItem{Key: "externalDocs", Value: m.ExternalDocs.ToRawInfo()}) + info = append(info, yaml.MapItem{"externalDocs", m.ExternalDocs.ToRawInfo()}) } // &{Name:externalDocs Type:ExternalDocs StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} @@ -8786,11 +8676,8 @@ func (m *Tag) ToRawInfo() interface{} { // ToRawInfo returns a description of TypeItem suitable for JSON or YAML export. func (m *TypeItem) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if len(m.Value) != 0 { - info = append(info, yaml.MapItem{Key: "value", Value: m.Value}) + info = append(info, yaml.MapItem{"value", m.Value}) } return info } @@ -8798,12 +8685,9 @@ func (m *TypeItem) ToRawInfo() interface{} { // ToRawInfo returns a description of VendorExtension suitable for JSON or YAML export. func (m *VendorExtension) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:additionalProperties Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern: Implicit:true Description:} @@ -8813,27 +8697,24 @@ func (m *VendorExtension) ToRawInfo() interface{} { // ToRawInfo returns a description of Xml suitable for JSON or YAML export. func (m *Xml) ToRawInfo() interface{} { info := yaml.MapSlice{} - if m == nil { - return info - } if m.Name != "" { - info = append(info, yaml.MapItem{Key: "name", Value: m.Name}) + info = append(info, yaml.MapItem{"name", m.Name}) } if m.Namespace != "" { - info = append(info, yaml.MapItem{Key: "namespace", Value: m.Namespace}) + info = append(info, yaml.MapItem{"namespace", m.Namespace}) } if m.Prefix != "" { - info = append(info, yaml.MapItem{Key: "prefix", Value: m.Prefix}) + info = append(info, yaml.MapItem{"prefix", m.Prefix}) } if m.Attribute != false { - info = append(info, yaml.MapItem{Key: "attribute", Value: m.Attribute}) + info = append(info, yaml.MapItem{"attribute", m.Attribute}) } if m.Wrapped != false { - info = append(info, yaml.MapItem{Key: "wrapped", Value: m.Wrapped}) + info = append(info, yaml.MapItem{"wrapped", m.Wrapped}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { - info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()}) + info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} diff --git a/vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.pb.go b/vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.pb.go index 5b87dcd..37da7df 100644 --- a/vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.pb.go +++ b/vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.pb.go @@ -1,14 +1,81 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. +// Code generated by protoc-gen-go. // source: OpenAPIv2/OpenAPIv2.proto - +// DO NOT EDIT! + +/* +Package openapi_v2 is a generated protocol buffer package. + +It is generated from these files: + OpenAPIv2/OpenAPIv2.proto + +It has these top-level messages: + AdditionalPropertiesItem + Any + ApiKeySecurity + BasicAuthenticationSecurity + BodyParameter + Contact + Default + Definitions + Document + Examples + ExternalDocs + FileSchema + FormDataParameterSubSchema + Header + HeaderParameterSubSchema + Headers + Info + ItemsItem + JsonReference + License + NamedAny + NamedHeader + NamedParameter + NamedPathItem + NamedResponse + NamedResponseValue + NamedSchema + NamedSecurityDefinitionsItem + NamedString + NamedStringArray + NonBodyParameter + Oauth2AccessCodeSecurity + Oauth2ApplicationSecurity + Oauth2ImplicitSecurity + Oauth2PasswordSecurity + Oauth2Scopes + Operation + Parameter + ParameterDefinitions + ParametersItem + PathItem + PathParameterSubSchema + Paths + PrimitivesItems + Properties + QueryParameterSubSchema + Response + ResponseDefinitions + ResponseValue + Responses + Schema + SchemaItem + SecurityDefinitions + SecurityDefinitionsItem + SecurityRequirement + StringArray + Tag + TypeItem + VendorExtension + Xml +*/ package openapi_v2 -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - any "github.com/golang/protobuf/ptypes/any" - math "math" -) +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import google_protobuf "github.com/golang/protobuf/ptypes/any" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -19,57 +86,32 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type AdditionalPropertiesItem struct { // Types that are valid to be assigned to Oneof: // *AdditionalPropertiesItem_Schema // *AdditionalPropertiesItem_Boolean - Oneof isAdditionalPropertiesItem_Oneof `protobuf_oneof:"oneof"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AdditionalPropertiesItem) Reset() { *m = AdditionalPropertiesItem{} } -func (m *AdditionalPropertiesItem) String() string { return proto.CompactTextString(m) } -func (*AdditionalPropertiesItem) ProtoMessage() {} -func (*AdditionalPropertiesItem) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{0} + Oneof isAdditionalPropertiesItem_Oneof `protobuf_oneof:"oneof"` } -func (m *AdditionalPropertiesItem) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AdditionalPropertiesItem.Unmarshal(m, b) -} -func (m *AdditionalPropertiesItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AdditionalPropertiesItem.Marshal(b, m, deterministic) -} -func (m *AdditionalPropertiesItem) XXX_Merge(src proto.Message) { - xxx_messageInfo_AdditionalPropertiesItem.Merge(m, src) -} -func (m *AdditionalPropertiesItem) XXX_Size() int { - return xxx_messageInfo_AdditionalPropertiesItem.Size(m) -} -func (m *AdditionalPropertiesItem) XXX_DiscardUnknown() { - xxx_messageInfo_AdditionalPropertiesItem.DiscardUnknown(m) -} - -var xxx_messageInfo_AdditionalPropertiesItem proto.InternalMessageInfo +func (m *AdditionalPropertiesItem) Reset() { *m = AdditionalPropertiesItem{} } +func (m *AdditionalPropertiesItem) String() string { return proto.CompactTextString(m) } +func (*AdditionalPropertiesItem) ProtoMessage() {} +func (*AdditionalPropertiesItem) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } type isAdditionalPropertiesItem_Oneof interface { isAdditionalPropertiesItem_Oneof() } type AdditionalPropertiesItem_Schema struct { - Schema *Schema `protobuf:"bytes,1,opt,name=schema,proto3,oneof"` + Schema *Schema `protobuf:"bytes,1,opt,name=schema,oneof"` } - type AdditionalPropertiesItem_Boolean struct { - Boolean bool `protobuf:"varint,2,opt,name=boolean,proto3,oneof"` + Boolean bool `protobuf:"varint,2,opt,name=boolean,oneof"` } -func (*AdditionalPropertiesItem_Schema) isAdditionalPropertiesItem_Oneof() {} - +func (*AdditionalPropertiesItem_Schema) isAdditionalPropertiesItem_Oneof() {} func (*AdditionalPropertiesItem_Boolean) isAdditionalPropertiesItem_Oneof() {} func (m *AdditionalPropertiesItem) GetOneof() isAdditionalPropertiesItem_Oneof { @@ -93,48 +135,90 @@ func (m *AdditionalPropertiesItem) GetBoolean() bool { return false } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*AdditionalPropertiesItem) XXX_OneofWrappers() []interface{} { - return []interface{}{ +// XXX_OneofFuncs is for the internal use of the proto package. +func (*AdditionalPropertiesItem) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _AdditionalPropertiesItem_OneofMarshaler, _AdditionalPropertiesItem_OneofUnmarshaler, _AdditionalPropertiesItem_OneofSizer, []interface{}{ (*AdditionalPropertiesItem_Schema)(nil), (*AdditionalPropertiesItem_Boolean)(nil), } } -type Any struct { - Value *any.Any `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - Yaml string `protobuf:"bytes,2,opt,name=yaml,proto3" json:"yaml,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func _AdditionalPropertiesItem_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*AdditionalPropertiesItem) + // oneof + switch x := m.Oneof.(type) { + case *AdditionalPropertiesItem_Schema: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Schema); err != nil { + return err + } + case *AdditionalPropertiesItem_Boolean: + t := uint64(0) + if x.Boolean { + t = 1 + } + b.EncodeVarint(2<<3 | proto.WireVarint) + b.EncodeVarint(t) + case nil: + default: + return fmt.Errorf("AdditionalPropertiesItem.Oneof has unexpected type %T", x) + } + return nil +} + +func _AdditionalPropertiesItem_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*AdditionalPropertiesItem) + switch tag { + case 1: // oneof.schema + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Schema) + err := b.DecodeMessage(msg) + m.Oneof = &AdditionalPropertiesItem_Schema{msg} + return true, err + case 2: // oneof.boolean + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Oneof = &AdditionalPropertiesItem_Boolean{x != 0} + return true, err + default: + return false, nil + } +} + +func _AdditionalPropertiesItem_OneofSizer(msg proto.Message) (n int) { + m := msg.(*AdditionalPropertiesItem) + // oneof + switch x := m.Oneof.(type) { + case *AdditionalPropertiesItem_Schema: + s := proto.Size(x.Schema) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *AdditionalPropertiesItem_Boolean: + n += proto.SizeVarint(2<<3 | proto.WireVarint) + n += 1 + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n } -func (m *Any) Reset() { *m = Any{} } -func (m *Any) String() string { return proto.CompactTextString(m) } -func (*Any) ProtoMessage() {} -func (*Any) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{1} -} - -func (m *Any) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Any.Unmarshal(m, b) -} -func (m *Any) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Any.Marshal(b, m, deterministic) -} -func (m *Any) XXX_Merge(src proto.Message) { - xxx_messageInfo_Any.Merge(m, src) -} -func (m *Any) XXX_Size() int { - return xxx_messageInfo_Any.Size(m) -} -func (m *Any) XXX_DiscardUnknown() { - xxx_messageInfo_Any.DiscardUnknown(m) +type Any struct { + Value *google_protobuf.Any `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` + Yaml string `protobuf:"bytes,2,opt,name=yaml" json:"yaml,omitempty"` } -var xxx_messageInfo_Any proto.InternalMessageInfo +func (m *Any) Reset() { *m = Any{} } +func (m *Any) String() string { return proto.CompactTextString(m) } +func (*Any) ProtoMessage() {} +func (*Any) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } -func (m *Any) GetValue() *any.Any { +func (m *Any) GetValue() *google_protobuf.Any { if m != nil { return m.Value } @@ -149,40 +233,17 @@ func (m *Any) GetYaml() string { } type ApiKeySecurity struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - In string `protobuf:"bytes,3,opt,name=in,proto3" json:"in,omitempty"` - Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,5,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ApiKeySecurity) Reset() { *m = ApiKeySecurity{} } -func (m *ApiKeySecurity) String() string { return proto.CompactTextString(m) } -func (*ApiKeySecurity) ProtoMessage() {} -func (*ApiKeySecurity) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{2} -} - -func (m *ApiKeySecurity) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ApiKeySecurity.Unmarshal(m, b) -} -func (m *ApiKeySecurity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ApiKeySecurity.Marshal(b, m, deterministic) -} -func (m *ApiKeySecurity) XXX_Merge(src proto.Message) { - xxx_messageInfo_ApiKeySecurity.Merge(m, src) -} -func (m *ApiKeySecurity) XXX_Size() int { - return xxx_messageInfo_ApiKeySecurity.Size(m) -} -func (m *ApiKeySecurity) XXX_DiscardUnknown() { - xxx_messageInfo_ApiKeySecurity.DiscardUnknown(m) + Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` + In string `protobuf:"bytes,3,opt,name=in" json:"in,omitempty"` + Description string `protobuf:"bytes,4,opt,name=description" json:"description,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,5,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } -var xxx_messageInfo_ApiKeySecurity proto.InternalMessageInfo +func (m *ApiKeySecurity) Reset() { *m = ApiKeySecurity{} } +func (m *ApiKeySecurity) String() string { return proto.CompactTextString(m) } +func (*ApiKeySecurity) ProtoMessage() {} +func (*ApiKeySecurity) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } func (m *ApiKeySecurity) GetType() string { if m != nil { @@ -220,38 +281,15 @@ func (m *ApiKeySecurity) GetVendorExtension() []*NamedAny { } type BasicAuthenticationSecurity struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,3,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BasicAuthenticationSecurity) Reset() { *m = BasicAuthenticationSecurity{} } -func (m *BasicAuthenticationSecurity) String() string { return proto.CompactTextString(m) } -func (*BasicAuthenticationSecurity) ProtoMessage() {} -func (*BasicAuthenticationSecurity) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{3} + Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,3,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } -func (m *BasicAuthenticationSecurity) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BasicAuthenticationSecurity.Unmarshal(m, b) -} -func (m *BasicAuthenticationSecurity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BasicAuthenticationSecurity.Marshal(b, m, deterministic) -} -func (m *BasicAuthenticationSecurity) XXX_Merge(src proto.Message) { - xxx_messageInfo_BasicAuthenticationSecurity.Merge(m, src) -} -func (m *BasicAuthenticationSecurity) XXX_Size() int { - return xxx_messageInfo_BasicAuthenticationSecurity.Size(m) -} -func (m *BasicAuthenticationSecurity) XXX_DiscardUnknown() { - xxx_messageInfo_BasicAuthenticationSecurity.DiscardUnknown(m) -} - -var xxx_messageInfo_BasicAuthenticationSecurity proto.InternalMessageInfo +func (m *BasicAuthenticationSecurity) Reset() { *m = BasicAuthenticationSecurity{} } +func (m *BasicAuthenticationSecurity) String() string { return proto.CompactTextString(m) } +func (*BasicAuthenticationSecurity) ProtoMessage() {} +func (*BasicAuthenticationSecurity) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } func (m *BasicAuthenticationSecurity) GetType() string { if m != nil { @@ -276,44 +314,21 @@ func (m *BasicAuthenticationSecurity) GetVendorExtension() []*NamedAny { type BodyParameter struct { // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. - Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` + Description string `protobuf:"bytes,1,opt,name=description" json:"description,omitempty"` // The name of the parameter. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` // Determines the location of the parameter. - In string `protobuf:"bytes,3,opt,name=in,proto3" json:"in,omitempty"` + In string `protobuf:"bytes,3,opt,name=in" json:"in,omitempty"` // Determines whether or not this parameter is required or optional. - Required bool `protobuf:"varint,4,opt,name=required,proto3" json:"required,omitempty"` - Schema *Schema `protobuf:"bytes,5,opt,name=schema,proto3" json:"schema,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Required bool `protobuf:"varint,4,opt,name=required" json:"required,omitempty"` + Schema *Schema `protobuf:"bytes,5,opt,name=schema" json:"schema,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } -func (m *BodyParameter) Reset() { *m = BodyParameter{} } -func (m *BodyParameter) String() string { return proto.CompactTextString(m) } -func (*BodyParameter) ProtoMessage() {} -func (*BodyParameter) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{4} -} - -func (m *BodyParameter) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BodyParameter.Unmarshal(m, b) -} -func (m *BodyParameter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BodyParameter.Marshal(b, m, deterministic) -} -func (m *BodyParameter) XXX_Merge(src proto.Message) { - xxx_messageInfo_BodyParameter.Merge(m, src) -} -func (m *BodyParameter) XXX_Size() int { - return xxx_messageInfo_BodyParameter.Size(m) -} -func (m *BodyParameter) XXX_DiscardUnknown() { - xxx_messageInfo_BodyParameter.DiscardUnknown(m) -} - -var xxx_messageInfo_BodyParameter proto.InternalMessageInfo +func (m *BodyParameter) Reset() { *m = BodyParameter{} } +func (m *BodyParameter) String() string { return proto.CompactTextString(m) } +func (*BodyParameter) ProtoMessage() {} +func (*BodyParameter) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } func (m *BodyParameter) GetDescription() string { if m != nil { @@ -360,41 +375,18 @@ func (m *BodyParameter) GetVendorExtension() []*NamedAny { // Contact information for the owners of the API. type Contact struct { // The identifying name of the contact person/organization. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // The URL pointing to the contact information. - Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` + Url string `protobuf:"bytes,2,opt,name=url" json:"url,omitempty"` // The email address of the contact person/organization. - Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,4,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Email string `protobuf:"bytes,3,opt,name=email" json:"email,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,4,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } -func (m *Contact) Reset() { *m = Contact{} } -func (m *Contact) String() string { return proto.CompactTextString(m) } -func (*Contact) ProtoMessage() {} -func (*Contact) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{5} -} - -func (m *Contact) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Contact.Unmarshal(m, b) -} -func (m *Contact) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Contact.Marshal(b, m, deterministic) -} -func (m *Contact) XXX_Merge(src proto.Message) { - xxx_messageInfo_Contact.Merge(m, src) -} -func (m *Contact) XXX_Size() int { - return xxx_messageInfo_Contact.Size(m) -} -func (m *Contact) XXX_DiscardUnknown() { - xxx_messageInfo_Contact.DiscardUnknown(m) -} - -var xxx_messageInfo_Contact proto.InternalMessageInfo +func (m *Contact) Reset() { *m = Contact{} } +func (m *Contact) String() string { return proto.CompactTextString(m) } +func (*Contact) ProtoMessage() {} +func (*Contact) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } func (m *Contact) GetName() string { if m != nil { @@ -425,36 +417,13 @@ func (m *Contact) GetVendorExtension() []*NamedAny { } type Default struct { - AdditionalProperties []*NamedAny `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Default) Reset() { *m = Default{} } -func (m *Default) String() string { return proto.CompactTextString(m) } -func (*Default) ProtoMessage() {} -func (*Default) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{6} -} - -func (m *Default) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Default.Unmarshal(m, b) -} -func (m *Default) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Default.Marshal(b, m, deterministic) -} -func (m *Default) XXX_Merge(src proto.Message) { - xxx_messageInfo_Default.Merge(m, src) -} -func (m *Default) XXX_Size() int { - return xxx_messageInfo_Default.Size(m) -} -func (m *Default) XXX_DiscardUnknown() { - xxx_messageInfo_Default.DiscardUnknown(m) + AdditionalProperties []*NamedAny `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties" json:"additional_properties,omitempty"` } -var xxx_messageInfo_Default proto.InternalMessageInfo +func (m *Default) Reset() { *m = Default{} } +func (m *Default) String() string { return proto.CompactTextString(m) } +func (*Default) ProtoMessage() {} +func (*Default) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } func (m *Default) GetAdditionalProperties() []*NamedAny { if m != nil { @@ -465,36 +434,13 @@ func (m *Default) GetAdditionalProperties() []*NamedAny { // One or more JSON objects describing the schemas being consumed and produced by the API. type Definitions struct { - AdditionalProperties []*NamedSchema `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Definitions) Reset() { *m = Definitions{} } -func (m *Definitions) String() string { return proto.CompactTextString(m) } -func (*Definitions) ProtoMessage() {} -func (*Definitions) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{7} + AdditionalProperties []*NamedSchema `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties" json:"additional_properties,omitempty"` } -func (m *Definitions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Definitions.Unmarshal(m, b) -} -func (m *Definitions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Definitions.Marshal(b, m, deterministic) -} -func (m *Definitions) XXX_Merge(src proto.Message) { - xxx_messageInfo_Definitions.Merge(m, src) -} -func (m *Definitions) XXX_Size() int { - return xxx_messageInfo_Definitions.Size(m) -} -func (m *Definitions) XXX_DiscardUnknown() { - xxx_messageInfo_Definitions.DiscardUnknown(m) -} - -var xxx_messageInfo_Definitions proto.InternalMessageInfo +func (m *Definitions) Reset() { *m = Definitions{} } +func (m *Definitions) String() string { return proto.CompactTextString(m) } +func (*Definitions) ProtoMessage() {} +func (*Definitions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } func (m *Definitions) GetAdditionalProperties() []*NamedSchema { if m != nil { @@ -505,56 +451,33 @@ func (m *Definitions) GetAdditionalProperties() []*NamedSchema { type Document struct { // The Swagger version of this document. - Swagger string `protobuf:"bytes,1,opt,name=swagger,proto3" json:"swagger,omitempty"` - Info *Info `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` + Swagger string `protobuf:"bytes,1,opt,name=swagger" json:"swagger,omitempty"` + Info *Info `protobuf:"bytes,2,opt,name=info" json:"info,omitempty"` // The host (name or ip) of the API. Example: 'swagger.io' - Host string `protobuf:"bytes,3,opt,name=host,proto3" json:"host,omitempty"` + Host string `protobuf:"bytes,3,opt,name=host" json:"host,omitempty"` // The base path to the API. Example: '/api'. - BasePath string `protobuf:"bytes,4,opt,name=base_path,json=basePath,proto3" json:"base_path,omitempty"` + BasePath string `protobuf:"bytes,4,opt,name=base_path,json=basePath" json:"base_path,omitempty"` // The transfer protocol of the API. - Schemes []string `protobuf:"bytes,5,rep,name=schemes,proto3" json:"schemes,omitempty"` + Schemes []string `protobuf:"bytes,5,rep,name=schemes" json:"schemes,omitempty"` // A list of MIME types accepted by the API. - Consumes []string `protobuf:"bytes,6,rep,name=consumes,proto3" json:"consumes,omitempty"` + Consumes []string `protobuf:"bytes,6,rep,name=consumes" json:"consumes,omitempty"` // A list of MIME types the API can produce. - Produces []string `protobuf:"bytes,7,rep,name=produces,proto3" json:"produces,omitempty"` - Paths *Paths `protobuf:"bytes,8,opt,name=paths,proto3" json:"paths,omitempty"` - Definitions *Definitions `protobuf:"bytes,9,opt,name=definitions,proto3" json:"definitions,omitempty"` - Parameters *ParameterDefinitions `protobuf:"bytes,10,opt,name=parameters,proto3" json:"parameters,omitempty"` - Responses *ResponseDefinitions `protobuf:"bytes,11,opt,name=responses,proto3" json:"responses,omitempty"` - Security []*SecurityRequirement `protobuf:"bytes,12,rep,name=security,proto3" json:"security,omitempty"` - SecurityDefinitions *SecurityDefinitions `protobuf:"bytes,13,opt,name=security_definitions,json=securityDefinitions,proto3" json:"security_definitions,omitempty"` - Tags []*Tag `protobuf:"bytes,14,rep,name=tags,proto3" json:"tags,omitempty"` - ExternalDocs *ExternalDocs `protobuf:"bytes,15,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,16,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Document) Reset() { *m = Document{} } -func (m *Document) String() string { return proto.CompactTextString(m) } -func (*Document) ProtoMessage() {} -func (*Document) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{8} -} - -func (m *Document) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Document.Unmarshal(m, b) -} -func (m *Document) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Document.Marshal(b, m, deterministic) -} -func (m *Document) XXX_Merge(src proto.Message) { - xxx_messageInfo_Document.Merge(m, src) -} -func (m *Document) XXX_Size() int { - return xxx_messageInfo_Document.Size(m) -} -func (m *Document) XXX_DiscardUnknown() { - xxx_messageInfo_Document.DiscardUnknown(m) -} - -var xxx_messageInfo_Document proto.InternalMessageInfo + Produces []string `protobuf:"bytes,7,rep,name=produces" json:"produces,omitempty"` + Paths *Paths `protobuf:"bytes,8,opt,name=paths" json:"paths,omitempty"` + Definitions *Definitions `protobuf:"bytes,9,opt,name=definitions" json:"definitions,omitempty"` + Parameters *ParameterDefinitions `protobuf:"bytes,10,opt,name=parameters" json:"parameters,omitempty"` + Responses *ResponseDefinitions `protobuf:"bytes,11,opt,name=responses" json:"responses,omitempty"` + Security []*SecurityRequirement `protobuf:"bytes,12,rep,name=security" json:"security,omitempty"` + SecurityDefinitions *SecurityDefinitions `protobuf:"bytes,13,opt,name=security_definitions,json=securityDefinitions" json:"security_definitions,omitempty"` + Tags []*Tag `protobuf:"bytes,14,rep,name=tags" json:"tags,omitempty"` + ExternalDocs *ExternalDocs `protobuf:"bytes,15,opt,name=external_docs,json=externalDocs" json:"external_docs,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,16,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` +} + +func (m *Document) Reset() { *m = Document{} } +func (m *Document) String() string { return proto.CompactTextString(m) } +func (*Document) ProtoMessage() {} +func (*Document) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } func (m *Document) GetSwagger() string { if m != nil { @@ -669,36 +592,13 @@ func (m *Document) GetVendorExtension() []*NamedAny { } type Examples struct { - AdditionalProperties []*NamedAny `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Examples) Reset() { *m = Examples{} } -func (m *Examples) String() string { return proto.CompactTextString(m) } -func (*Examples) ProtoMessage() {} -func (*Examples) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{9} -} - -func (m *Examples) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Examples.Unmarshal(m, b) -} -func (m *Examples) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Examples.Marshal(b, m, deterministic) -} -func (m *Examples) XXX_Merge(src proto.Message) { - xxx_messageInfo_Examples.Merge(m, src) -} -func (m *Examples) XXX_Size() int { - return xxx_messageInfo_Examples.Size(m) -} -func (m *Examples) XXX_DiscardUnknown() { - xxx_messageInfo_Examples.DiscardUnknown(m) + AdditionalProperties []*NamedAny `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties" json:"additional_properties,omitempty"` } -var xxx_messageInfo_Examples proto.InternalMessageInfo +func (m *Examples) Reset() { *m = Examples{} } +func (m *Examples) String() string { return proto.CompactTextString(m) } +func (*Examples) ProtoMessage() {} +func (*Examples) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } func (m *Examples) GetAdditionalProperties() []*NamedAny { if m != nil { @@ -709,38 +609,15 @@ func (m *Examples) GetAdditionalProperties() []*NamedAny { // information about external documentation type ExternalDocs struct { - Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` - Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,3,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ExternalDocs) Reset() { *m = ExternalDocs{} } -func (m *ExternalDocs) String() string { return proto.CompactTextString(m) } -func (*ExternalDocs) ProtoMessage() {} -func (*ExternalDocs) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{10} + Description string `protobuf:"bytes,1,opt,name=description" json:"description,omitempty"` + Url string `protobuf:"bytes,2,opt,name=url" json:"url,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,3,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } -func (m *ExternalDocs) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ExternalDocs.Unmarshal(m, b) -} -func (m *ExternalDocs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ExternalDocs.Marshal(b, m, deterministic) -} -func (m *ExternalDocs) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExternalDocs.Merge(m, src) -} -func (m *ExternalDocs) XXX_Size() int { - return xxx_messageInfo_ExternalDocs.Size(m) -} -func (m *ExternalDocs) XXX_DiscardUnknown() { - xxx_messageInfo_ExternalDocs.DiscardUnknown(m) -} - -var xxx_messageInfo_ExternalDocs proto.InternalMessageInfo +func (m *ExternalDocs) Reset() { *m = ExternalDocs{} } +func (m *ExternalDocs) String() string { return proto.CompactTextString(m) } +func (*ExternalDocs) ProtoMessage() {} +func (*ExternalDocs) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } func (m *ExternalDocs) GetDescription() string { if m != nil { @@ -765,45 +642,22 @@ func (m *ExternalDocs) GetVendorExtension() []*NamedAny { // A deterministic version of a JSON Schema object. type FileSchema struct { - Format string `protobuf:"bytes,1,opt,name=format,proto3" json:"format,omitempty"` - Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - Default *Any `protobuf:"bytes,4,opt,name=default,proto3" json:"default,omitempty"` - Required []string `protobuf:"bytes,5,rep,name=required,proto3" json:"required,omitempty"` - Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` - ReadOnly bool `protobuf:"varint,7,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"` - ExternalDocs *ExternalDocs `protobuf:"bytes,8,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` - Example *Any `protobuf:"bytes,9,opt,name=example,proto3" json:"example,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,10,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FileSchema) Reset() { *m = FileSchema{} } -func (m *FileSchema) String() string { return proto.CompactTextString(m) } -func (*FileSchema) ProtoMessage() {} -func (*FileSchema) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{11} -} - -func (m *FileSchema) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FileSchema.Unmarshal(m, b) -} -func (m *FileSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FileSchema.Marshal(b, m, deterministic) -} -func (m *FileSchema) XXX_Merge(src proto.Message) { - xxx_messageInfo_FileSchema.Merge(m, src) -} -func (m *FileSchema) XXX_Size() int { - return xxx_messageInfo_FileSchema.Size(m) -} -func (m *FileSchema) XXX_DiscardUnknown() { - xxx_messageInfo_FileSchema.DiscardUnknown(m) -} - -var xxx_messageInfo_FileSchema proto.InternalMessageInfo + Format string `protobuf:"bytes,1,opt,name=format" json:"format,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title" json:"title,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` + Default *Any `protobuf:"bytes,4,opt,name=default" json:"default,omitempty"` + Required []string `protobuf:"bytes,5,rep,name=required" json:"required,omitempty"` + Type string `protobuf:"bytes,6,opt,name=type" json:"type,omitempty"` + ReadOnly bool `protobuf:"varint,7,opt,name=read_only,json=readOnly" json:"read_only,omitempty"` + ExternalDocs *ExternalDocs `protobuf:"bytes,8,opt,name=external_docs,json=externalDocs" json:"external_docs,omitempty"` + Example *Any `protobuf:"bytes,9,opt,name=example" json:"example,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,10,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` +} + +func (m *FileSchema) Reset() { *m = FileSchema{} } +func (m *FileSchema) String() string { return proto.CompactTextString(m) } +func (*FileSchema) ProtoMessage() {} +func (*FileSchema) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } func (m *FileSchema) GetFormat() string { if m != nil { @@ -877,62 +731,39 @@ func (m *FileSchema) GetVendorExtension() []*NamedAny { type FormDataParameterSubSchema struct { // Determines whether or not this parameter is required or optional. - Required bool `protobuf:"varint,1,opt,name=required,proto3" json:"required,omitempty"` + Required bool `protobuf:"varint,1,opt,name=required" json:"required,omitempty"` // Determines the location of the parameter. - In string `protobuf:"bytes,2,opt,name=in,proto3" json:"in,omitempty"` + In string `protobuf:"bytes,2,opt,name=in" json:"in,omitempty"` // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` // The name of the parameter. - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` // allows sending a parameter by name only or with an empty value. - AllowEmptyValue bool `protobuf:"varint,5,opt,name=allow_empty_value,json=allowEmptyValue,proto3" json:"allow_empty_value,omitempty"` - Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` - Format string `protobuf:"bytes,7,opt,name=format,proto3" json:"format,omitempty"` - Items *PrimitivesItems `protobuf:"bytes,8,opt,name=items,proto3" json:"items,omitempty"` - CollectionFormat string `protobuf:"bytes,9,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` - Default *Any `protobuf:"bytes,10,opt,name=default,proto3" json:"default,omitempty"` - Maximum float64 `protobuf:"fixed64,11,opt,name=maximum,proto3" json:"maximum,omitempty"` - ExclusiveMaximum bool `protobuf:"varint,12,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` - Minimum float64 `protobuf:"fixed64,13,opt,name=minimum,proto3" json:"minimum,omitempty"` - ExclusiveMinimum bool `protobuf:"varint,14,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` - MaxLength int64 `protobuf:"varint,15,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` - MinLength int64 `protobuf:"varint,16,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` - Pattern string `protobuf:"bytes,17,opt,name=pattern,proto3" json:"pattern,omitempty"` - MaxItems int64 `protobuf:"varint,18,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` - MinItems int64 `protobuf:"varint,19,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` - UniqueItems bool `protobuf:"varint,20,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` - Enum []*Any `protobuf:"bytes,21,rep,name=enum,proto3" json:"enum,omitempty"` - MultipleOf float64 `protobuf:"fixed64,22,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,23,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FormDataParameterSubSchema) Reset() { *m = FormDataParameterSubSchema{} } -func (m *FormDataParameterSubSchema) String() string { return proto.CompactTextString(m) } -func (*FormDataParameterSubSchema) ProtoMessage() {} -func (*FormDataParameterSubSchema) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{12} -} - -func (m *FormDataParameterSubSchema) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FormDataParameterSubSchema.Unmarshal(m, b) -} -func (m *FormDataParameterSubSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FormDataParameterSubSchema.Marshal(b, m, deterministic) -} -func (m *FormDataParameterSubSchema) XXX_Merge(src proto.Message) { - xxx_messageInfo_FormDataParameterSubSchema.Merge(m, src) -} -func (m *FormDataParameterSubSchema) XXX_Size() int { - return xxx_messageInfo_FormDataParameterSubSchema.Size(m) -} -func (m *FormDataParameterSubSchema) XXX_DiscardUnknown() { - xxx_messageInfo_FormDataParameterSubSchema.DiscardUnknown(m) -} - -var xxx_messageInfo_FormDataParameterSubSchema proto.InternalMessageInfo + AllowEmptyValue bool `protobuf:"varint,5,opt,name=allow_empty_value,json=allowEmptyValue" json:"allow_empty_value,omitempty"` + Type string `protobuf:"bytes,6,opt,name=type" json:"type,omitempty"` + Format string `protobuf:"bytes,7,opt,name=format" json:"format,omitempty"` + Items *PrimitivesItems `protobuf:"bytes,8,opt,name=items" json:"items,omitempty"` + CollectionFormat string `protobuf:"bytes,9,opt,name=collection_format,json=collectionFormat" json:"collection_format,omitempty"` + Default *Any `protobuf:"bytes,10,opt,name=default" json:"default,omitempty"` + Maximum float64 `protobuf:"fixed64,11,opt,name=maximum" json:"maximum,omitempty"` + ExclusiveMaximum bool `protobuf:"varint,12,opt,name=exclusive_maximum,json=exclusiveMaximum" json:"exclusive_maximum,omitempty"` + Minimum float64 `protobuf:"fixed64,13,opt,name=minimum" json:"minimum,omitempty"` + ExclusiveMinimum bool `protobuf:"varint,14,opt,name=exclusive_minimum,json=exclusiveMinimum" json:"exclusive_minimum,omitempty"` + MaxLength int64 `protobuf:"varint,15,opt,name=max_length,json=maxLength" json:"max_length,omitempty"` + MinLength int64 `protobuf:"varint,16,opt,name=min_length,json=minLength" json:"min_length,omitempty"` + Pattern string `protobuf:"bytes,17,opt,name=pattern" json:"pattern,omitempty"` + MaxItems int64 `protobuf:"varint,18,opt,name=max_items,json=maxItems" json:"max_items,omitempty"` + MinItems int64 `protobuf:"varint,19,opt,name=min_items,json=minItems" json:"min_items,omitempty"` + UniqueItems bool `protobuf:"varint,20,opt,name=unique_items,json=uniqueItems" json:"unique_items,omitempty"` + Enum []*Any `protobuf:"bytes,21,rep,name=enum" json:"enum,omitempty"` + MultipleOf float64 `protobuf:"fixed64,22,opt,name=multiple_of,json=multipleOf" json:"multiple_of,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,23,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` +} + +func (m *FormDataParameterSubSchema) Reset() { *m = FormDataParameterSubSchema{} } +func (m *FormDataParameterSubSchema) String() string { return proto.CompactTextString(m) } +func (*FormDataParameterSubSchema) ProtoMessage() {} +func (*FormDataParameterSubSchema) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } func (m *FormDataParameterSubSchema) GetRequired() bool { if m != nil { @@ -1096,54 +927,31 @@ func (m *FormDataParameterSubSchema) GetVendorExtension() []*NamedAny { } type Header struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Format string `protobuf:"bytes,2,opt,name=format,proto3" json:"format,omitempty"` - Items *PrimitivesItems `protobuf:"bytes,3,opt,name=items,proto3" json:"items,omitempty"` - CollectionFormat string `protobuf:"bytes,4,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` - Default *Any `protobuf:"bytes,5,opt,name=default,proto3" json:"default,omitempty"` - Maximum float64 `protobuf:"fixed64,6,opt,name=maximum,proto3" json:"maximum,omitempty"` - ExclusiveMaximum bool `protobuf:"varint,7,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` - Minimum float64 `protobuf:"fixed64,8,opt,name=minimum,proto3" json:"minimum,omitempty"` - ExclusiveMinimum bool `protobuf:"varint,9,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` - MaxLength int64 `protobuf:"varint,10,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` - MinLength int64 `protobuf:"varint,11,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` - Pattern string `protobuf:"bytes,12,opt,name=pattern,proto3" json:"pattern,omitempty"` - MaxItems int64 `protobuf:"varint,13,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` - MinItems int64 `protobuf:"varint,14,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` - UniqueItems bool `protobuf:"varint,15,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` - Enum []*Any `protobuf:"bytes,16,rep,name=enum,proto3" json:"enum,omitempty"` - MultipleOf float64 `protobuf:"fixed64,17,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` - Description string `protobuf:"bytes,18,opt,name=description,proto3" json:"description,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,19,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Header) Reset() { *m = Header{} } -func (m *Header) String() string { return proto.CompactTextString(m) } -func (*Header) ProtoMessage() {} -func (*Header) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{13} -} - -func (m *Header) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Header.Unmarshal(m, b) -} -func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Header.Marshal(b, m, deterministic) -} -func (m *Header) XXX_Merge(src proto.Message) { - xxx_messageInfo_Header.Merge(m, src) -} -func (m *Header) XXX_Size() int { - return xxx_messageInfo_Header.Size(m) -} -func (m *Header) XXX_DiscardUnknown() { - xxx_messageInfo_Header.DiscardUnknown(m) -} - -var xxx_messageInfo_Header proto.InternalMessageInfo + Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"` + Format string `protobuf:"bytes,2,opt,name=format" json:"format,omitempty"` + Items *PrimitivesItems `protobuf:"bytes,3,opt,name=items" json:"items,omitempty"` + CollectionFormat string `protobuf:"bytes,4,opt,name=collection_format,json=collectionFormat" json:"collection_format,omitempty"` + Default *Any `protobuf:"bytes,5,opt,name=default" json:"default,omitempty"` + Maximum float64 `protobuf:"fixed64,6,opt,name=maximum" json:"maximum,omitempty"` + ExclusiveMaximum bool `protobuf:"varint,7,opt,name=exclusive_maximum,json=exclusiveMaximum" json:"exclusive_maximum,omitempty"` + Minimum float64 `protobuf:"fixed64,8,opt,name=minimum" json:"minimum,omitempty"` + ExclusiveMinimum bool `protobuf:"varint,9,opt,name=exclusive_minimum,json=exclusiveMinimum" json:"exclusive_minimum,omitempty"` + MaxLength int64 `protobuf:"varint,10,opt,name=max_length,json=maxLength" json:"max_length,omitempty"` + MinLength int64 `protobuf:"varint,11,opt,name=min_length,json=minLength" json:"min_length,omitempty"` + Pattern string `protobuf:"bytes,12,opt,name=pattern" json:"pattern,omitempty"` + MaxItems int64 `protobuf:"varint,13,opt,name=max_items,json=maxItems" json:"max_items,omitempty"` + MinItems int64 `protobuf:"varint,14,opt,name=min_items,json=minItems" json:"min_items,omitempty"` + UniqueItems bool `protobuf:"varint,15,opt,name=unique_items,json=uniqueItems" json:"unique_items,omitempty"` + Enum []*Any `protobuf:"bytes,16,rep,name=enum" json:"enum,omitempty"` + MultipleOf float64 `protobuf:"fixed64,17,opt,name=multiple_of,json=multipleOf" json:"multiple_of,omitempty"` + Description string `protobuf:"bytes,18,opt,name=description" json:"description,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,19,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` +} + +func (m *Header) Reset() { *m = Header{} } +func (m *Header) String() string { return proto.CompactTextString(m) } +func (*Header) ProtoMessage() {} +func (*Header) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } func (m *Header) GetType() string { if m != nil { @@ -1280,60 +1088,37 @@ func (m *Header) GetVendorExtension() []*NamedAny { type HeaderParameterSubSchema struct { // Determines whether or not this parameter is required or optional. - Required bool `protobuf:"varint,1,opt,name=required,proto3" json:"required,omitempty"` + Required bool `protobuf:"varint,1,opt,name=required" json:"required,omitempty"` // Determines the location of the parameter. - In string `protobuf:"bytes,2,opt,name=in,proto3" json:"in,omitempty"` + In string `protobuf:"bytes,2,opt,name=in" json:"in,omitempty"` // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` // The name of the parameter. - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` - Format string `protobuf:"bytes,6,opt,name=format,proto3" json:"format,omitempty"` - Items *PrimitivesItems `protobuf:"bytes,7,opt,name=items,proto3" json:"items,omitempty"` - CollectionFormat string `protobuf:"bytes,8,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` - Default *Any `protobuf:"bytes,9,opt,name=default,proto3" json:"default,omitempty"` - Maximum float64 `protobuf:"fixed64,10,opt,name=maximum,proto3" json:"maximum,omitempty"` - ExclusiveMaximum bool `protobuf:"varint,11,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` - Minimum float64 `protobuf:"fixed64,12,opt,name=minimum,proto3" json:"minimum,omitempty"` - ExclusiveMinimum bool `protobuf:"varint,13,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` - MaxLength int64 `protobuf:"varint,14,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` - MinLength int64 `protobuf:"varint,15,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` - Pattern string `protobuf:"bytes,16,opt,name=pattern,proto3" json:"pattern,omitempty"` - MaxItems int64 `protobuf:"varint,17,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` - MinItems int64 `protobuf:"varint,18,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` - UniqueItems bool `protobuf:"varint,19,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` - Enum []*Any `protobuf:"bytes,20,rep,name=enum,proto3" json:"enum,omitempty"` - MultipleOf float64 `protobuf:"fixed64,21,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,22,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HeaderParameterSubSchema) Reset() { *m = HeaderParameterSubSchema{} } -func (m *HeaderParameterSubSchema) String() string { return proto.CompactTextString(m) } -func (*HeaderParameterSubSchema) ProtoMessage() {} -func (*HeaderParameterSubSchema) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{14} -} - -func (m *HeaderParameterSubSchema) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HeaderParameterSubSchema.Unmarshal(m, b) -} -func (m *HeaderParameterSubSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HeaderParameterSubSchema.Marshal(b, m, deterministic) -} -func (m *HeaderParameterSubSchema) XXX_Merge(src proto.Message) { - xxx_messageInfo_HeaderParameterSubSchema.Merge(m, src) -} -func (m *HeaderParameterSubSchema) XXX_Size() int { - return xxx_messageInfo_HeaderParameterSubSchema.Size(m) -} -func (m *HeaderParameterSubSchema) XXX_DiscardUnknown() { - xxx_messageInfo_HeaderParameterSubSchema.DiscardUnknown(m) -} - -var xxx_messageInfo_HeaderParameterSubSchema proto.InternalMessageInfo + Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` + Type string `protobuf:"bytes,5,opt,name=type" json:"type,omitempty"` + Format string `protobuf:"bytes,6,opt,name=format" json:"format,omitempty"` + Items *PrimitivesItems `protobuf:"bytes,7,opt,name=items" json:"items,omitempty"` + CollectionFormat string `protobuf:"bytes,8,opt,name=collection_format,json=collectionFormat" json:"collection_format,omitempty"` + Default *Any `protobuf:"bytes,9,opt,name=default" json:"default,omitempty"` + Maximum float64 `protobuf:"fixed64,10,opt,name=maximum" json:"maximum,omitempty"` + ExclusiveMaximum bool `protobuf:"varint,11,opt,name=exclusive_maximum,json=exclusiveMaximum" json:"exclusive_maximum,omitempty"` + Minimum float64 `protobuf:"fixed64,12,opt,name=minimum" json:"minimum,omitempty"` + ExclusiveMinimum bool `protobuf:"varint,13,opt,name=exclusive_minimum,json=exclusiveMinimum" json:"exclusive_minimum,omitempty"` + MaxLength int64 `protobuf:"varint,14,opt,name=max_length,json=maxLength" json:"max_length,omitempty"` + MinLength int64 `protobuf:"varint,15,opt,name=min_length,json=minLength" json:"min_length,omitempty"` + Pattern string `protobuf:"bytes,16,opt,name=pattern" json:"pattern,omitempty"` + MaxItems int64 `protobuf:"varint,17,opt,name=max_items,json=maxItems" json:"max_items,omitempty"` + MinItems int64 `protobuf:"varint,18,opt,name=min_items,json=minItems" json:"min_items,omitempty"` + UniqueItems bool `protobuf:"varint,19,opt,name=unique_items,json=uniqueItems" json:"unique_items,omitempty"` + Enum []*Any `protobuf:"bytes,20,rep,name=enum" json:"enum,omitempty"` + MultipleOf float64 `protobuf:"fixed64,21,opt,name=multiple_of,json=multipleOf" json:"multiple_of,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,22,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` +} + +func (m *HeaderParameterSubSchema) Reset() { *m = HeaderParameterSubSchema{} } +func (m *HeaderParameterSubSchema) String() string { return proto.CompactTextString(m) } +func (*HeaderParameterSubSchema) ProtoMessage() {} +func (*HeaderParameterSubSchema) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } func (m *HeaderParameterSubSchema) GetRequired() bool { if m != nil { @@ -1490,36 +1275,13 @@ func (m *HeaderParameterSubSchema) GetVendorExtension() []*NamedAny { } type Headers struct { - AdditionalProperties []*NamedHeader `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Headers) Reset() { *m = Headers{} } -func (m *Headers) String() string { return proto.CompactTextString(m) } -func (*Headers) ProtoMessage() {} -func (*Headers) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{15} -} - -func (m *Headers) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Headers.Unmarshal(m, b) -} -func (m *Headers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Headers.Marshal(b, m, deterministic) -} -func (m *Headers) XXX_Merge(src proto.Message) { - xxx_messageInfo_Headers.Merge(m, src) -} -func (m *Headers) XXX_Size() int { - return xxx_messageInfo_Headers.Size(m) -} -func (m *Headers) XXX_DiscardUnknown() { - xxx_messageInfo_Headers.DiscardUnknown(m) + AdditionalProperties []*NamedHeader `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties" json:"additional_properties,omitempty"` } -var xxx_messageInfo_Headers proto.InternalMessageInfo +func (m *Headers) Reset() { *m = Headers{} } +func (m *Headers) String() string { return proto.CompactTextString(m) } +func (*Headers) ProtoMessage() {} +func (*Headers) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } func (m *Headers) GetAdditionalProperties() []*NamedHeader { if m != nil { @@ -1531,45 +1293,22 @@ func (m *Headers) GetAdditionalProperties() []*NamedHeader { // General information about the API. type Info struct { // A unique and precise title of the API. - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Title string `protobuf:"bytes,1,opt,name=title" json:"title,omitempty"` // A semantic version number of the API. - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` // A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed. - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` // The terms of service for the API. - TermsOfService string `protobuf:"bytes,4,opt,name=terms_of_service,json=termsOfService,proto3" json:"terms_of_service,omitempty"` - Contact *Contact `protobuf:"bytes,5,opt,name=contact,proto3" json:"contact,omitempty"` - License *License `protobuf:"bytes,6,opt,name=license,proto3" json:"license,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,7,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + TermsOfService string `protobuf:"bytes,4,opt,name=terms_of_service,json=termsOfService" json:"terms_of_service,omitempty"` + Contact *Contact `protobuf:"bytes,5,opt,name=contact" json:"contact,omitempty"` + License *License `protobuf:"bytes,6,opt,name=license" json:"license,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,7,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } -func (m *Info) Reset() { *m = Info{} } -func (m *Info) String() string { return proto.CompactTextString(m) } -func (*Info) ProtoMessage() {} -func (*Info) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{16} -} - -func (m *Info) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Info.Unmarshal(m, b) -} -func (m *Info) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Info.Marshal(b, m, deterministic) -} -func (m *Info) XXX_Merge(src proto.Message) { - xxx_messageInfo_Info.Merge(m, src) -} -func (m *Info) XXX_Size() int { - return xxx_messageInfo_Info.Size(m) -} -func (m *Info) XXX_DiscardUnknown() { - xxx_messageInfo_Info.DiscardUnknown(m) -} - -var xxx_messageInfo_Info proto.InternalMessageInfo +func (m *Info) Reset() { *m = Info{} } +func (m *Info) String() string { return proto.CompactTextString(m) } +func (*Info) ProtoMessage() {} +func (*Info) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } func (m *Info) GetTitle() string { if m != nil { @@ -1621,36 +1360,13 @@ func (m *Info) GetVendorExtension() []*NamedAny { } type ItemsItem struct { - Schema []*Schema `protobuf:"bytes,1,rep,name=schema,proto3" json:"schema,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Schema []*Schema `protobuf:"bytes,1,rep,name=schema" json:"schema,omitempty"` } -func (m *ItemsItem) Reset() { *m = ItemsItem{} } -func (m *ItemsItem) String() string { return proto.CompactTextString(m) } -func (*ItemsItem) ProtoMessage() {} -func (*ItemsItem) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{17} -} - -func (m *ItemsItem) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ItemsItem.Unmarshal(m, b) -} -func (m *ItemsItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ItemsItem.Marshal(b, m, deterministic) -} -func (m *ItemsItem) XXX_Merge(src proto.Message) { - xxx_messageInfo_ItemsItem.Merge(m, src) -} -func (m *ItemsItem) XXX_Size() int { - return xxx_messageInfo_ItemsItem.Size(m) -} -func (m *ItemsItem) XXX_DiscardUnknown() { - xxx_messageInfo_ItemsItem.DiscardUnknown(m) -} - -var xxx_messageInfo_ItemsItem proto.InternalMessageInfo +func (m *ItemsItem) Reset() { *m = ItemsItem{} } +func (m *ItemsItem) String() string { return proto.CompactTextString(m) } +func (*ItemsItem) ProtoMessage() {} +func (*ItemsItem) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } func (m *ItemsItem) GetSchema() []*Schema { if m != nil { @@ -1660,37 +1376,14 @@ func (m *ItemsItem) GetSchema() []*Schema { } type JsonReference struct { - XRef string `protobuf:"bytes,1,opt,name=_ref,json=Ref,proto3" json:"_ref,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + XRef string `protobuf:"bytes,1,opt,name=_ref,json=Ref" json:"_ref,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` } -func (m *JsonReference) Reset() { *m = JsonReference{} } -func (m *JsonReference) String() string { return proto.CompactTextString(m) } -func (*JsonReference) ProtoMessage() {} -func (*JsonReference) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{18} -} - -func (m *JsonReference) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_JsonReference.Unmarshal(m, b) -} -func (m *JsonReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_JsonReference.Marshal(b, m, deterministic) -} -func (m *JsonReference) XXX_Merge(src proto.Message) { - xxx_messageInfo_JsonReference.Merge(m, src) -} -func (m *JsonReference) XXX_Size() int { - return xxx_messageInfo_JsonReference.Size(m) -} -func (m *JsonReference) XXX_DiscardUnknown() { - xxx_messageInfo_JsonReference.DiscardUnknown(m) -} - -var xxx_messageInfo_JsonReference proto.InternalMessageInfo +func (m *JsonReference) Reset() { *m = JsonReference{} } +func (m *JsonReference) String() string { return proto.CompactTextString(m) } +func (*JsonReference) ProtoMessage() {} +func (*JsonReference) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } func (m *JsonReference) GetXRef() string { if m != nil { @@ -1708,39 +1401,16 @@ func (m *JsonReference) GetDescription() string { type License struct { // The name of the license type. It's encouraged to use an OSI compatible license. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // The URL pointing to the license. - Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,3,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *License) Reset() { *m = License{} } -func (m *License) String() string { return proto.CompactTextString(m) } -func (*License) ProtoMessage() {} -func (*License) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{19} -} - -func (m *License) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_License.Unmarshal(m, b) -} -func (m *License) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_License.Marshal(b, m, deterministic) -} -func (m *License) XXX_Merge(src proto.Message) { - xxx_messageInfo_License.Merge(m, src) -} -func (m *License) XXX_Size() int { - return xxx_messageInfo_License.Size(m) -} -func (m *License) XXX_DiscardUnknown() { - xxx_messageInfo_License.DiscardUnknown(m) + Url string `protobuf:"bytes,2,opt,name=url" json:"url,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,3,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } -var xxx_messageInfo_License proto.InternalMessageInfo +func (m *License) Reset() { *m = License{} } +func (m *License) String() string { return proto.CompactTextString(m) } +func (*License) ProtoMessage() {} +func (*License) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } func (m *License) GetName() string { if m != nil { @@ -1766,38 +1436,15 @@ func (m *License) GetVendorExtension() []*NamedAny { // Automatically-generated message used to represent maps of Any as ordered (name,value) pairs. type NamedAny struct { // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // Mapped value - Value *Any `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NamedAny) Reset() { *m = NamedAny{} } -func (m *NamedAny) String() string { return proto.CompactTextString(m) } -func (*NamedAny) ProtoMessage() {} -func (*NamedAny) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{20} + Value *Any `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` } -func (m *NamedAny) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NamedAny.Unmarshal(m, b) -} -func (m *NamedAny) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NamedAny.Marshal(b, m, deterministic) -} -func (m *NamedAny) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedAny.Merge(m, src) -} -func (m *NamedAny) XXX_Size() int { - return xxx_messageInfo_NamedAny.Size(m) -} -func (m *NamedAny) XXX_DiscardUnknown() { - xxx_messageInfo_NamedAny.DiscardUnknown(m) -} - -var xxx_messageInfo_NamedAny proto.InternalMessageInfo +func (m *NamedAny) Reset() { *m = NamedAny{} } +func (m *NamedAny) String() string { return proto.CompactTextString(m) } +func (*NamedAny) ProtoMessage() {} +func (*NamedAny) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } func (m *NamedAny) GetName() string { if m != nil { @@ -1816,38 +1463,15 @@ func (m *NamedAny) GetValue() *Any { // Automatically-generated message used to represent maps of Header as ordered (name,value) pairs. type NamedHeader struct { // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // Mapped value - Value *Header `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Value *Header `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` } -func (m *NamedHeader) Reset() { *m = NamedHeader{} } -func (m *NamedHeader) String() string { return proto.CompactTextString(m) } -func (*NamedHeader) ProtoMessage() {} -func (*NamedHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{21} -} - -func (m *NamedHeader) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NamedHeader.Unmarshal(m, b) -} -func (m *NamedHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NamedHeader.Marshal(b, m, deterministic) -} -func (m *NamedHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedHeader.Merge(m, src) -} -func (m *NamedHeader) XXX_Size() int { - return xxx_messageInfo_NamedHeader.Size(m) -} -func (m *NamedHeader) XXX_DiscardUnknown() { - xxx_messageInfo_NamedHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_NamedHeader proto.InternalMessageInfo +func (m *NamedHeader) Reset() { *m = NamedHeader{} } +func (m *NamedHeader) String() string { return proto.CompactTextString(m) } +func (*NamedHeader) ProtoMessage() {} +func (*NamedHeader) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } func (m *NamedHeader) GetName() string { if m != nil { @@ -1866,38 +1490,15 @@ func (m *NamedHeader) GetValue() *Header { // Automatically-generated message used to represent maps of Parameter as ordered (name,value) pairs. type NamedParameter struct { // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // Mapped value - Value *Parameter `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Value *Parameter `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` } -func (m *NamedParameter) Reset() { *m = NamedParameter{} } -func (m *NamedParameter) String() string { return proto.CompactTextString(m) } -func (*NamedParameter) ProtoMessage() {} -func (*NamedParameter) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{22} -} - -func (m *NamedParameter) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NamedParameter.Unmarshal(m, b) -} -func (m *NamedParameter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NamedParameter.Marshal(b, m, deterministic) -} -func (m *NamedParameter) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedParameter.Merge(m, src) -} -func (m *NamedParameter) XXX_Size() int { - return xxx_messageInfo_NamedParameter.Size(m) -} -func (m *NamedParameter) XXX_DiscardUnknown() { - xxx_messageInfo_NamedParameter.DiscardUnknown(m) -} - -var xxx_messageInfo_NamedParameter proto.InternalMessageInfo +func (m *NamedParameter) Reset() { *m = NamedParameter{} } +func (m *NamedParameter) String() string { return proto.CompactTextString(m) } +func (*NamedParameter) ProtoMessage() {} +func (*NamedParameter) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22} } func (m *NamedParameter) GetName() string { if m != nil { @@ -1916,38 +1517,15 @@ func (m *NamedParameter) GetValue() *Parameter { // Automatically-generated message used to represent maps of PathItem as ordered (name,value) pairs. type NamedPathItem struct { // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // Mapped value - Value *PathItem `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Value *PathItem `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` } -func (m *NamedPathItem) Reset() { *m = NamedPathItem{} } -func (m *NamedPathItem) String() string { return proto.CompactTextString(m) } -func (*NamedPathItem) ProtoMessage() {} -func (*NamedPathItem) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{23} -} - -func (m *NamedPathItem) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NamedPathItem.Unmarshal(m, b) -} -func (m *NamedPathItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NamedPathItem.Marshal(b, m, deterministic) -} -func (m *NamedPathItem) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedPathItem.Merge(m, src) -} -func (m *NamedPathItem) XXX_Size() int { - return xxx_messageInfo_NamedPathItem.Size(m) -} -func (m *NamedPathItem) XXX_DiscardUnknown() { - xxx_messageInfo_NamedPathItem.DiscardUnknown(m) -} - -var xxx_messageInfo_NamedPathItem proto.InternalMessageInfo +func (m *NamedPathItem) Reset() { *m = NamedPathItem{} } +func (m *NamedPathItem) String() string { return proto.CompactTextString(m) } +func (*NamedPathItem) ProtoMessage() {} +func (*NamedPathItem) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{23} } func (m *NamedPathItem) GetName() string { if m != nil { @@ -1966,38 +1544,15 @@ func (m *NamedPathItem) GetValue() *PathItem { // Automatically-generated message used to represent maps of Response as ordered (name,value) pairs. type NamedResponse struct { // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // Mapped value - Value *Response `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NamedResponse) Reset() { *m = NamedResponse{} } -func (m *NamedResponse) String() string { return proto.CompactTextString(m) } -func (*NamedResponse) ProtoMessage() {} -func (*NamedResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{24} + Value *Response `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` } -func (m *NamedResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NamedResponse.Unmarshal(m, b) -} -func (m *NamedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NamedResponse.Marshal(b, m, deterministic) -} -func (m *NamedResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedResponse.Merge(m, src) -} -func (m *NamedResponse) XXX_Size() int { - return xxx_messageInfo_NamedResponse.Size(m) -} -func (m *NamedResponse) XXX_DiscardUnknown() { - xxx_messageInfo_NamedResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_NamedResponse proto.InternalMessageInfo +func (m *NamedResponse) Reset() { *m = NamedResponse{} } +func (m *NamedResponse) String() string { return proto.CompactTextString(m) } +func (*NamedResponse) ProtoMessage() {} +func (*NamedResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{24} } func (m *NamedResponse) GetName() string { if m != nil { @@ -2016,38 +1571,15 @@ func (m *NamedResponse) GetValue() *Response { // Automatically-generated message used to represent maps of ResponseValue as ordered (name,value) pairs. type NamedResponseValue struct { // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // Mapped value - Value *ResponseValue `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Value *ResponseValue `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` } -func (m *NamedResponseValue) Reset() { *m = NamedResponseValue{} } -func (m *NamedResponseValue) String() string { return proto.CompactTextString(m) } -func (*NamedResponseValue) ProtoMessage() {} -func (*NamedResponseValue) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{25} -} - -func (m *NamedResponseValue) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NamedResponseValue.Unmarshal(m, b) -} -func (m *NamedResponseValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NamedResponseValue.Marshal(b, m, deterministic) -} -func (m *NamedResponseValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedResponseValue.Merge(m, src) -} -func (m *NamedResponseValue) XXX_Size() int { - return xxx_messageInfo_NamedResponseValue.Size(m) -} -func (m *NamedResponseValue) XXX_DiscardUnknown() { - xxx_messageInfo_NamedResponseValue.DiscardUnknown(m) -} - -var xxx_messageInfo_NamedResponseValue proto.InternalMessageInfo +func (m *NamedResponseValue) Reset() { *m = NamedResponseValue{} } +func (m *NamedResponseValue) String() string { return proto.CompactTextString(m) } +func (*NamedResponseValue) ProtoMessage() {} +func (*NamedResponseValue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{25} } func (m *NamedResponseValue) GetName() string { if m != nil { @@ -2066,38 +1598,15 @@ func (m *NamedResponseValue) GetValue() *ResponseValue { // Automatically-generated message used to represent maps of Schema as ordered (name,value) pairs. type NamedSchema struct { // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // Mapped value - Value *Schema `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NamedSchema) Reset() { *m = NamedSchema{} } -func (m *NamedSchema) String() string { return proto.CompactTextString(m) } -func (*NamedSchema) ProtoMessage() {} -func (*NamedSchema) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{26} -} - -func (m *NamedSchema) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NamedSchema.Unmarshal(m, b) -} -func (m *NamedSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NamedSchema.Marshal(b, m, deterministic) -} -func (m *NamedSchema) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedSchema.Merge(m, src) -} -func (m *NamedSchema) XXX_Size() int { - return xxx_messageInfo_NamedSchema.Size(m) -} -func (m *NamedSchema) XXX_DiscardUnknown() { - xxx_messageInfo_NamedSchema.DiscardUnknown(m) + Value *Schema `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` } -var xxx_messageInfo_NamedSchema proto.InternalMessageInfo +func (m *NamedSchema) Reset() { *m = NamedSchema{} } +func (m *NamedSchema) String() string { return proto.CompactTextString(m) } +func (*NamedSchema) ProtoMessage() {} +func (*NamedSchema) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26} } func (m *NamedSchema) GetName() string { if m != nil { @@ -2116,38 +1625,15 @@ func (m *NamedSchema) GetValue() *Schema { // Automatically-generated message used to represent maps of SecurityDefinitionsItem as ordered (name,value) pairs. type NamedSecurityDefinitionsItem struct { // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // Mapped value - Value *SecurityDefinitionsItem `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Value *SecurityDefinitionsItem `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` } -func (m *NamedSecurityDefinitionsItem) Reset() { *m = NamedSecurityDefinitionsItem{} } -func (m *NamedSecurityDefinitionsItem) String() string { return proto.CompactTextString(m) } -func (*NamedSecurityDefinitionsItem) ProtoMessage() {} -func (*NamedSecurityDefinitionsItem) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{27} -} - -func (m *NamedSecurityDefinitionsItem) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NamedSecurityDefinitionsItem.Unmarshal(m, b) -} -func (m *NamedSecurityDefinitionsItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NamedSecurityDefinitionsItem.Marshal(b, m, deterministic) -} -func (m *NamedSecurityDefinitionsItem) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedSecurityDefinitionsItem.Merge(m, src) -} -func (m *NamedSecurityDefinitionsItem) XXX_Size() int { - return xxx_messageInfo_NamedSecurityDefinitionsItem.Size(m) -} -func (m *NamedSecurityDefinitionsItem) XXX_DiscardUnknown() { - xxx_messageInfo_NamedSecurityDefinitionsItem.DiscardUnknown(m) -} - -var xxx_messageInfo_NamedSecurityDefinitionsItem proto.InternalMessageInfo +func (m *NamedSecurityDefinitionsItem) Reset() { *m = NamedSecurityDefinitionsItem{} } +func (m *NamedSecurityDefinitionsItem) String() string { return proto.CompactTextString(m) } +func (*NamedSecurityDefinitionsItem) ProtoMessage() {} +func (*NamedSecurityDefinitionsItem) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{27} } func (m *NamedSecurityDefinitionsItem) GetName() string { if m != nil { @@ -2166,38 +1652,15 @@ func (m *NamedSecurityDefinitionsItem) GetValue() *SecurityDefinitionsItem { // Automatically-generated message used to represent maps of string as ordered (name,value) pairs. type NamedString struct { // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // Mapped value - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NamedString) Reset() { *m = NamedString{} } -func (m *NamedString) String() string { return proto.CompactTextString(m) } -func (*NamedString) ProtoMessage() {} -func (*NamedString) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{28} -} - -func (m *NamedString) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NamedString.Unmarshal(m, b) -} -func (m *NamedString) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NamedString.Marshal(b, m, deterministic) -} -func (m *NamedString) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedString.Merge(m, src) -} -func (m *NamedString) XXX_Size() int { - return xxx_messageInfo_NamedString.Size(m) -} -func (m *NamedString) XXX_DiscardUnknown() { - xxx_messageInfo_NamedString.DiscardUnknown(m) + Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` } -var xxx_messageInfo_NamedString proto.InternalMessageInfo +func (m *NamedString) Reset() { *m = NamedString{} } +func (m *NamedString) String() string { return proto.CompactTextString(m) } +func (*NamedString) ProtoMessage() {} +func (*NamedString) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{28} } func (m *NamedString) GetName() string { if m != nil { @@ -2216,38 +1679,15 @@ func (m *NamedString) GetValue() string { // Automatically-generated message used to represent maps of StringArray as ordered (name,value) pairs. type NamedStringArray struct { // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // Mapped value - Value *StringArray `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NamedStringArray) Reset() { *m = NamedStringArray{} } -func (m *NamedStringArray) String() string { return proto.CompactTextString(m) } -func (*NamedStringArray) ProtoMessage() {} -func (*NamedStringArray) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{29} + Value *StringArray `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` } -func (m *NamedStringArray) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NamedStringArray.Unmarshal(m, b) -} -func (m *NamedStringArray) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NamedStringArray.Marshal(b, m, deterministic) -} -func (m *NamedStringArray) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamedStringArray.Merge(m, src) -} -func (m *NamedStringArray) XXX_Size() int { - return xxx_messageInfo_NamedStringArray.Size(m) -} -func (m *NamedStringArray) XXX_DiscardUnknown() { - xxx_messageInfo_NamedStringArray.DiscardUnknown(m) -} - -var xxx_messageInfo_NamedStringArray proto.InternalMessageInfo +func (m *NamedStringArray) Reset() { *m = NamedStringArray{} } +func (m *NamedStringArray) String() string { return proto.CompactTextString(m) } +func (*NamedStringArray) ProtoMessage() {} +func (*NamedStringArray) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{29} } func (m *NamedStringArray) GetName() string { if m != nil { @@ -2269,64 +1709,35 @@ type NonBodyParameter struct { // *NonBodyParameter_FormDataParameterSubSchema // *NonBodyParameter_QueryParameterSubSchema // *NonBodyParameter_PathParameterSubSchema - Oneof isNonBodyParameter_Oneof `protobuf_oneof:"oneof"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NonBodyParameter) Reset() { *m = NonBodyParameter{} } -func (m *NonBodyParameter) String() string { return proto.CompactTextString(m) } -func (*NonBodyParameter) ProtoMessage() {} -func (*NonBodyParameter) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{30} -} - -func (m *NonBodyParameter) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NonBodyParameter.Unmarshal(m, b) -} -func (m *NonBodyParameter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NonBodyParameter.Marshal(b, m, deterministic) -} -func (m *NonBodyParameter) XXX_Merge(src proto.Message) { - xxx_messageInfo_NonBodyParameter.Merge(m, src) -} -func (m *NonBodyParameter) XXX_Size() int { - return xxx_messageInfo_NonBodyParameter.Size(m) -} -func (m *NonBodyParameter) XXX_DiscardUnknown() { - xxx_messageInfo_NonBodyParameter.DiscardUnknown(m) + Oneof isNonBodyParameter_Oneof `protobuf_oneof:"oneof"` } -var xxx_messageInfo_NonBodyParameter proto.InternalMessageInfo +func (m *NonBodyParameter) Reset() { *m = NonBodyParameter{} } +func (m *NonBodyParameter) String() string { return proto.CompactTextString(m) } +func (*NonBodyParameter) ProtoMessage() {} +func (*NonBodyParameter) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{30} } type isNonBodyParameter_Oneof interface { isNonBodyParameter_Oneof() } type NonBodyParameter_HeaderParameterSubSchema struct { - HeaderParameterSubSchema *HeaderParameterSubSchema `protobuf:"bytes,1,opt,name=header_parameter_sub_schema,json=headerParameterSubSchema,proto3,oneof"` + HeaderParameterSubSchema *HeaderParameterSubSchema `protobuf:"bytes,1,opt,name=header_parameter_sub_schema,json=headerParameterSubSchema,oneof"` } - type NonBodyParameter_FormDataParameterSubSchema struct { - FormDataParameterSubSchema *FormDataParameterSubSchema `protobuf:"bytes,2,opt,name=form_data_parameter_sub_schema,json=formDataParameterSubSchema,proto3,oneof"` + FormDataParameterSubSchema *FormDataParameterSubSchema `protobuf:"bytes,2,opt,name=form_data_parameter_sub_schema,json=formDataParameterSubSchema,oneof"` } - type NonBodyParameter_QueryParameterSubSchema struct { - QueryParameterSubSchema *QueryParameterSubSchema `protobuf:"bytes,3,opt,name=query_parameter_sub_schema,json=queryParameterSubSchema,proto3,oneof"` + QueryParameterSubSchema *QueryParameterSubSchema `protobuf:"bytes,3,opt,name=query_parameter_sub_schema,json=queryParameterSubSchema,oneof"` } - type NonBodyParameter_PathParameterSubSchema struct { - PathParameterSubSchema *PathParameterSubSchema `protobuf:"bytes,4,opt,name=path_parameter_sub_schema,json=pathParameterSubSchema,proto3,oneof"` + PathParameterSubSchema *PathParameterSubSchema `protobuf:"bytes,4,opt,name=path_parameter_sub_schema,json=pathParameterSubSchema,oneof"` } -func (*NonBodyParameter_HeaderParameterSubSchema) isNonBodyParameter_Oneof() {} - +func (*NonBodyParameter_HeaderParameterSubSchema) isNonBodyParameter_Oneof() {} func (*NonBodyParameter_FormDataParameterSubSchema) isNonBodyParameter_Oneof() {} - -func (*NonBodyParameter_QueryParameterSubSchema) isNonBodyParameter_Oneof() {} - -func (*NonBodyParameter_PathParameterSubSchema) isNonBodyParameter_Oneof() {} +func (*NonBodyParameter_QueryParameterSubSchema) isNonBodyParameter_Oneof() {} +func (*NonBodyParameter_PathParameterSubSchema) isNonBodyParameter_Oneof() {} func (m *NonBodyParameter) GetOneof() isNonBodyParameter_Oneof { if m != nil { @@ -2363,9 +1774,9 @@ func (m *NonBodyParameter) GetPathParameterSubSchema() *PathParameterSubSchema { return nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*NonBodyParameter) XXX_OneofWrappers() []interface{} { - return []interface{}{ +// XXX_OneofFuncs is for the internal use of the proto package. +func (*NonBodyParameter) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _NonBodyParameter_OneofMarshaler, _NonBodyParameter_OneofUnmarshaler, _NonBodyParameter_OneofSizer, []interface{}{ (*NonBodyParameter_HeaderParameterSubSchema)(nil), (*NonBodyParameter_FormDataParameterSubSchema)(nil), (*NonBodyParameter_QueryParameterSubSchema)(nil), @@ -2373,43 +1784,122 @@ func (*NonBodyParameter) XXX_OneofWrappers() []interface{} { } } -type Oauth2AccessCodeSecurity struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"` - Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"` - AuthorizationUrl string `protobuf:"bytes,4,opt,name=authorization_url,json=authorizationUrl,proto3" json:"authorization_url,omitempty"` - TokenUrl string `protobuf:"bytes,5,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"` - Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,7,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func _NonBodyParameter_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*NonBodyParameter) + // oneof + switch x := m.Oneof.(type) { + case *NonBodyParameter_HeaderParameterSubSchema: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.HeaderParameterSubSchema); err != nil { + return err + } + case *NonBodyParameter_FormDataParameterSubSchema: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.FormDataParameterSubSchema); err != nil { + return err + } + case *NonBodyParameter_QueryParameterSubSchema: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.QueryParameterSubSchema); err != nil { + return err + } + case *NonBodyParameter_PathParameterSubSchema: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.PathParameterSubSchema); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("NonBodyParameter.Oneof has unexpected type %T", x) + } + return nil +} + +func _NonBodyParameter_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*NonBodyParameter) + switch tag { + case 1: // oneof.header_parameter_sub_schema + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(HeaderParameterSubSchema) + err := b.DecodeMessage(msg) + m.Oneof = &NonBodyParameter_HeaderParameterSubSchema{msg} + return true, err + case 2: // oneof.form_data_parameter_sub_schema + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(FormDataParameterSubSchema) + err := b.DecodeMessage(msg) + m.Oneof = &NonBodyParameter_FormDataParameterSubSchema{msg} + return true, err + case 3: // oneof.query_parameter_sub_schema + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(QueryParameterSubSchema) + err := b.DecodeMessage(msg) + m.Oneof = &NonBodyParameter_QueryParameterSubSchema{msg} + return true, err + case 4: // oneof.path_parameter_sub_schema + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PathParameterSubSchema) + err := b.DecodeMessage(msg) + m.Oneof = &NonBodyParameter_PathParameterSubSchema{msg} + return true, err + default: + return false, nil + } +} + +func _NonBodyParameter_OneofSizer(msg proto.Message) (n int) { + m := msg.(*NonBodyParameter) + // oneof + switch x := m.Oneof.(type) { + case *NonBodyParameter_HeaderParameterSubSchema: + s := proto.Size(x.HeaderParameterSubSchema) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *NonBodyParameter_FormDataParameterSubSchema: + s := proto.Size(x.FormDataParameterSubSchema) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *NonBodyParameter_QueryParameterSubSchema: + s := proto.Size(x.QueryParameterSubSchema) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *NonBodyParameter_PathParameterSubSchema: + s := proto.Size(x.PathParameterSubSchema) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n } -func (m *Oauth2AccessCodeSecurity) Reset() { *m = Oauth2AccessCodeSecurity{} } -func (m *Oauth2AccessCodeSecurity) String() string { return proto.CompactTextString(m) } -func (*Oauth2AccessCodeSecurity) ProtoMessage() {} -func (*Oauth2AccessCodeSecurity) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{31} -} - -func (m *Oauth2AccessCodeSecurity) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Oauth2AccessCodeSecurity.Unmarshal(m, b) -} -func (m *Oauth2AccessCodeSecurity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Oauth2AccessCodeSecurity.Marshal(b, m, deterministic) -} -func (m *Oauth2AccessCodeSecurity) XXX_Merge(src proto.Message) { - xxx_messageInfo_Oauth2AccessCodeSecurity.Merge(m, src) -} -func (m *Oauth2AccessCodeSecurity) XXX_Size() int { - return xxx_messageInfo_Oauth2AccessCodeSecurity.Size(m) -} -func (m *Oauth2AccessCodeSecurity) XXX_DiscardUnknown() { - xxx_messageInfo_Oauth2AccessCodeSecurity.DiscardUnknown(m) +type Oauth2AccessCodeSecurity struct { + Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"` + Flow string `protobuf:"bytes,2,opt,name=flow" json:"flow,omitempty"` + Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes" json:"scopes,omitempty"` + AuthorizationUrl string `protobuf:"bytes,4,opt,name=authorization_url,json=authorizationUrl" json:"authorization_url,omitempty"` + TokenUrl string `protobuf:"bytes,5,opt,name=token_url,json=tokenUrl" json:"token_url,omitempty"` + Description string `protobuf:"bytes,6,opt,name=description" json:"description,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,7,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } -var xxx_messageInfo_Oauth2AccessCodeSecurity proto.InternalMessageInfo +func (m *Oauth2AccessCodeSecurity) Reset() { *m = Oauth2AccessCodeSecurity{} } +func (m *Oauth2AccessCodeSecurity) String() string { return proto.CompactTextString(m) } +func (*Oauth2AccessCodeSecurity) ProtoMessage() {} +func (*Oauth2AccessCodeSecurity) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{31} } func (m *Oauth2AccessCodeSecurity) GetType() string { if m != nil { @@ -2461,41 +1951,18 @@ func (m *Oauth2AccessCodeSecurity) GetVendorExtension() []*NamedAny { } type Oauth2ApplicationSecurity struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"` - Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"` - TokenUrl string `protobuf:"bytes,4,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"` - Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"` + Flow string `protobuf:"bytes,2,opt,name=flow" json:"flow,omitempty"` + Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes" json:"scopes,omitempty"` + TokenUrl string `protobuf:"bytes,4,opt,name=token_url,json=tokenUrl" json:"token_url,omitempty"` + Description string `protobuf:"bytes,5,opt,name=description" json:"description,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } -func (m *Oauth2ApplicationSecurity) Reset() { *m = Oauth2ApplicationSecurity{} } -func (m *Oauth2ApplicationSecurity) String() string { return proto.CompactTextString(m) } -func (*Oauth2ApplicationSecurity) ProtoMessage() {} -func (*Oauth2ApplicationSecurity) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{32} -} - -func (m *Oauth2ApplicationSecurity) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Oauth2ApplicationSecurity.Unmarshal(m, b) -} -func (m *Oauth2ApplicationSecurity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Oauth2ApplicationSecurity.Marshal(b, m, deterministic) -} -func (m *Oauth2ApplicationSecurity) XXX_Merge(src proto.Message) { - xxx_messageInfo_Oauth2ApplicationSecurity.Merge(m, src) -} -func (m *Oauth2ApplicationSecurity) XXX_Size() int { - return xxx_messageInfo_Oauth2ApplicationSecurity.Size(m) -} -func (m *Oauth2ApplicationSecurity) XXX_DiscardUnknown() { - xxx_messageInfo_Oauth2ApplicationSecurity.DiscardUnknown(m) -} - -var xxx_messageInfo_Oauth2ApplicationSecurity proto.InternalMessageInfo +func (m *Oauth2ApplicationSecurity) Reset() { *m = Oauth2ApplicationSecurity{} } +func (m *Oauth2ApplicationSecurity) String() string { return proto.CompactTextString(m) } +func (*Oauth2ApplicationSecurity) ProtoMessage() {} +func (*Oauth2ApplicationSecurity) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{32} } func (m *Oauth2ApplicationSecurity) GetType() string { if m != nil { @@ -2540,41 +2007,18 @@ func (m *Oauth2ApplicationSecurity) GetVendorExtension() []*NamedAny { } type Oauth2ImplicitSecurity struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"` - Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"` - AuthorizationUrl string `protobuf:"bytes,4,opt,name=authorization_url,json=authorizationUrl,proto3" json:"authorization_url,omitempty"` - Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Oauth2ImplicitSecurity) Reset() { *m = Oauth2ImplicitSecurity{} } -func (m *Oauth2ImplicitSecurity) String() string { return proto.CompactTextString(m) } -func (*Oauth2ImplicitSecurity) ProtoMessage() {} -func (*Oauth2ImplicitSecurity) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{33} -} - -func (m *Oauth2ImplicitSecurity) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Oauth2ImplicitSecurity.Unmarshal(m, b) -} -func (m *Oauth2ImplicitSecurity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Oauth2ImplicitSecurity.Marshal(b, m, deterministic) -} -func (m *Oauth2ImplicitSecurity) XXX_Merge(src proto.Message) { - xxx_messageInfo_Oauth2ImplicitSecurity.Merge(m, src) -} -func (m *Oauth2ImplicitSecurity) XXX_Size() int { - return xxx_messageInfo_Oauth2ImplicitSecurity.Size(m) -} -func (m *Oauth2ImplicitSecurity) XXX_DiscardUnknown() { - xxx_messageInfo_Oauth2ImplicitSecurity.DiscardUnknown(m) + Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"` + Flow string `protobuf:"bytes,2,opt,name=flow" json:"flow,omitempty"` + Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes" json:"scopes,omitempty"` + AuthorizationUrl string `protobuf:"bytes,4,opt,name=authorization_url,json=authorizationUrl" json:"authorization_url,omitempty"` + Description string `protobuf:"bytes,5,opt,name=description" json:"description,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } -var xxx_messageInfo_Oauth2ImplicitSecurity proto.InternalMessageInfo +func (m *Oauth2ImplicitSecurity) Reset() { *m = Oauth2ImplicitSecurity{} } +func (m *Oauth2ImplicitSecurity) String() string { return proto.CompactTextString(m) } +func (*Oauth2ImplicitSecurity) ProtoMessage() {} +func (*Oauth2ImplicitSecurity) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{33} } func (m *Oauth2ImplicitSecurity) GetType() string { if m != nil { @@ -2619,41 +2063,18 @@ func (m *Oauth2ImplicitSecurity) GetVendorExtension() []*NamedAny { } type Oauth2PasswordSecurity struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"` - Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"` - TokenUrl string `protobuf:"bytes,4,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"` - Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Oauth2PasswordSecurity) Reset() { *m = Oauth2PasswordSecurity{} } -func (m *Oauth2PasswordSecurity) String() string { return proto.CompactTextString(m) } -func (*Oauth2PasswordSecurity) ProtoMessage() {} -func (*Oauth2PasswordSecurity) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{34} + Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"` + Flow string `protobuf:"bytes,2,opt,name=flow" json:"flow,omitempty"` + Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes" json:"scopes,omitempty"` + TokenUrl string `protobuf:"bytes,4,opt,name=token_url,json=tokenUrl" json:"token_url,omitempty"` + Description string `protobuf:"bytes,5,opt,name=description" json:"description,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } -func (m *Oauth2PasswordSecurity) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Oauth2PasswordSecurity.Unmarshal(m, b) -} -func (m *Oauth2PasswordSecurity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Oauth2PasswordSecurity.Marshal(b, m, deterministic) -} -func (m *Oauth2PasswordSecurity) XXX_Merge(src proto.Message) { - xxx_messageInfo_Oauth2PasswordSecurity.Merge(m, src) -} -func (m *Oauth2PasswordSecurity) XXX_Size() int { - return xxx_messageInfo_Oauth2PasswordSecurity.Size(m) -} -func (m *Oauth2PasswordSecurity) XXX_DiscardUnknown() { - xxx_messageInfo_Oauth2PasswordSecurity.DiscardUnknown(m) -} - -var xxx_messageInfo_Oauth2PasswordSecurity proto.InternalMessageInfo +func (m *Oauth2PasswordSecurity) Reset() { *m = Oauth2PasswordSecurity{} } +func (m *Oauth2PasswordSecurity) String() string { return proto.CompactTextString(m) } +func (*Oauth2PasswordSecurity) ProtoMessage() {} +func (*Oauth2PasswordSecurity) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{34} } func (m *Oauth2PasswordSecurity) GetType() string { if m != nil { @@ -2698,36 +2119,13 @@ func (m *Oauth2PasswordSecurity) GetVendorExtension() []*NamedAny { } type Oauth2Scopes struct { - AdditionalProperties []*NamedString `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + AdditionalProperties []*NamedString `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties" json:"additional_properties,omitempty"` } -func (m *Oauth2Scopes) Reset() { *m = Oauth2Scopes{} } -func (m *Oauth2Scopes) String() string { return proto.CompactTextString(m) } -func (*Oauth2Scopes) ProtoMessage() {} -func (*Oauth2Scopes) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{35} -} - -func (m *Oauth2Scopes) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Oauth2Scopes.Unmarshal(m, b) -} -func (m *Oauth2Scopes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Oauth2Scopes.Marshal(b, m, deterministic) -} -func (m *Oauth2Scopes) XXX_Merge(src proto.Message) { - xxx_messageInfo_Oauth2Scopes.Merge(m, src) -} -func (m *Oauth2Scopes) XXX_Size() int { - return xxx_messageInfo_Oauth2Scopes.Size(m) -} -func (m *Oauth2Scopes) XXX_DiscardUnknown() { - xxx_messageInfo_Oauth2Scopes.DiscardUnknown(m) -} - -var xxx_messageInfo_Oauth2Scopes proto.InternalMessageInfo +func (m *Oauth2Scopes) Reset() { *m = Oauth2Scopes{} } +func (m *Oauth2Scopes) String() string { return proto.CompactTextString(m) } +func (*Oauth2Scopes) ProtoMessage() {} +func (*Oauth2Scopes) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{35} } func (m *Oauth2Scopes) GetAdditionalProperties() []*NamedString { if m != nil { @@ -2737,55 +2135,32 @@ func (m *Oauth2Scopes) GetAdditionalProperties() []*NamedString { } type Operation struct { - Tags []string `protobuf:"bytes,1,rep,name=tags,proto3" json:"tags,omitempty"` + Tags []string `protobuf:"bytes,1,rep,name=tags" json:"tags,omitempty"` // A brief summary of the operation. - Summary string `protobuf:"bytes,2,opt,name=summary,proto3" json:"summary,omitempty"` + Summary string `protobuf:"bytes,2,opt,name=summary" json:"summary,omitempty"` // A longer description of the operation, GitHub Flavored Markdown is allowed. - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - ExternalDocs *ExternalDocs `protobuf:"bytes,4,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` + ExternalDocs *ExternalDocs `protobuf:"bytes,4,opt,name=external_docs,json=externalDocs" json:"external_docs,omitempty"` // A unique identifier of the operation. - OperationId string `protobuf:"bytes,5,opt,name=operation_id,json=operationId,proto3" json:"operation_id,omitempty"` + OperationId string `protobuf:"bytes,5,opt,name=operation_id,json=operationId" json:"operation_id,omitempty"` // A list of MIME types the API can produce. - Produces []string `protobuf:"bytes,6,rep,name=produces,proto3" json:"produces,omitempty"` + Produces []string `protobuf:"bytes,6,rep,name=produces" json:"produces,omitempty"` // A list of MIME types the API can consume. - Consumes []string `protobuf:"bytes,7,rep,name=consumes,proto3" json:"consumes,omitempty"` + Consumes []string `protobuf:"bytes,7,rep,name=consumes" json:"consumes,omitempty"` // The parameters needed to send a valid API call. - Parameters []*ParametersItem `protobuf:"bytes,8,rep,name=parameters,proto3" json:"parameters,omitempty"` - Responses *Responses `protobuf:"bytes,9,opt,name=responses,proto3" json:"responses,omitempty"` + Parameters []*ParametersItem `protobuf:"bytes,8,rep,name=parameters" json:"parameters,omitempty"` + Responses *Responses `protobuf:"bytes,9,opt,name=responses" json:"responses,omitempty"` // The transfer protocol of the API. - Schemes []string `protobuf:"bytes,10,rep,name=schemes,proto3" json:"schemes,omitempty"` - Deprecated bool `protobuf:"varint,11,opt,name=deprecated,proto3" json:"deprecated,omitempty"` - Security []*SecurityRequirement `protobuf:"bytes,12,rep,name=security,proto3" json:"security,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,13,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Operation) Reset() { *m = Operation{} } -func (m *Operation) String() string { return proto.CompactTextString(m) } -func (*Operation) ProtoMessage() {} -func (*Operation) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{36} -} - -func (m *Operation) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Operation.Unmarshal(m, b) -} -func (m *Operation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Operation.Marshal(b, m, deterministic) -} -func (m *Operation) XXX_Merge(src proto.Message) { - xxx_messageInfo_Operation.Merge(m, src) -} -func (m *Operation) XXX_Size() int { - return xxx_messageInfo_Operation.Size(m) -} -func (m *Operation) XXX_DiscardUnknown() { - xxx_messageInfo_Operation.DiscardUnknown(m) + Schemes []string `protobuf:"bytes,10,rep,name=schemes" json:"schemes,omitempty"` + Deprecated bool `protobuf:"varint,11,opt,name=deprecated" json:"deprecated,omitempty"` + Security []*SecurityRequirement `protobuf:"bytes,12,rep,name=security" json:"security,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,13,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } -var xxx_messageInfo_Operation proto.InternalMessageInfo +func (m *Operation) Reset() { *m = Operation{} } +func (m *Operation) String() string { return proto.CompactTextString(m) } +func (*Operation) ProtoMessage() {} +func (*Operation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{36} } func (m *Operation) GetTags() []string { if m != nil { @@ -2882,51 +2257,26 @@ type Parameter struct { // Types that are valid to be assigned to Oneof: // *Parameter_BodyParameter // *Parameter_NonBodyParameter - Oneof isParameter_Oneof `protobuf_oneof:"oneof"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Oneof isParameter_Oneof `protobuf_oneof:"oneof"` } -func (m *Parameter) Reset() { *m = Parameter{} } -func (m *Parameter) String() string { return proto.CompactTextString(m) } -func (*Parameter) ProtoMessage() {} -func (*Parameter) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{37} -} - -func (m *Parameter) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Parameter.Unmarshal(m, b) -} -func (m *Parameter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Parameter.Marshal(b, m, deterministic) -} -func (m *Parameter) XXX_Merge(src proto.Message) { - xxx_messageInfo_Parameter.Merge(m, src) -} -func (m *Parameter) XXX_Size() int { - return xxx_messageInfo_Parameter.Size(m) -} -func (m *Parameter) XXX_DiscardUnknown() { - xxx_messageInfo_Parameter.DiscardUnknown(m) -} - -var xxx_messageInfo_Parameter proto.InternalMessageInfo +func (m *Parameter) Reset() { *m = Parameter{} } +func (m *Parameter) String() string { return proto.CompactTextString(m) } +func (*Parameter) ProtoMessage() {} +func (*Parameter) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{37} } type isParameter_Oneof interface { isParameter_Oneof() } type Parameter_BodyParameter struct { - BodyParameter *BodyParameter `protobuf:"bytes,1,opt,name=body_parameter,json=bodyParameter,proto3,oneof"` + BodyParameter *BodyParameter `protobuf:"bytes,1,opt,name=body_parameter,json=bodyParameter,oneof"` } - type Parameter_NonBodyParameter struct { - NonBodyParameter *NonBodyParameter `protobuf:"bytes,2,opt,name=non_body_parameter,json=nonBodyParameter,proto3,oneof"` + NonBodyParameter *NonBodyParameter `protobuf:"bytes,2,opt,name=non_body_parameter,json=nonBodyParameter,oneof"` } -func (*Parameter_BodyParameter) isParameter_Oneof() {} - +func (*Parameter_BodyParameter) isParameter_Oneof() {} func (*Parameter_NonBodyParameter) isParameter_Oneof() {} func (m *Parameter) GetOneof() isParameter_Oneof { @@ -2950,46 +2300,89 @@ func (m *Parameter) GetNonBodyParameter() *NonBodyParameter { return nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Parameter) XXX_OneofWrappers() []interface{} { - return []interface{}{ +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Parameter) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Parameter_OneofMarshaler, _Parameter_OneofUnmarshaler, _Parameter_OneofSizer, []interface{}{ (*Parameter_BodyParameter)(nil), (*Parameter_NonBodyParameter)(nil), } } -// One or more JSON representations for parameters -type ParameterDefinitions struct { - AdditionalProperties []*NamedParameter `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func _Parameter_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Parameter) + // oneof + switch x := m.Oneof.(type) { + case *Parameter_BodyParameter: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BodyParameter); err != nil { + return err + } + case *Parameter_NonBodyParameter: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.NonBodyParameter); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Parameter.Oneof has unexpected type %T", x) + } + return nil +} + +func _Parameter_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Parameter) + switch tag { + case 1: // oneof.body_parameter + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BodyParameter) + err := b.DecodeMessage(msg) + m.Oneof = &Parameter_BodyParameter{msg} + return true, err + case 2: // oneof.non_body_parameter + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(NonBodyParameter) + err := b.DecodeMessage(msg) + m.Oneof = &Parameter_NonBodyParameter{msg} + return true, err + default: + return false, nil + } +} + +func _Parameter_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Parameter) + // oneof + switch x := m.Oneof.(type) { + case *Parameter_BodyParameter: + s := proto.Size(x.BodyParameter) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Parameter_NonBodyParameter: + s := proto.Size(x.NonBodyParameter) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n } -func (m *ParameterDefinitions) Reset() { *m = ParameterDefinitions{} } -func (m *ParameterDefinitions) String() string { return proto.CompactTextString(m) } -func (*ParameterDefinitions) ProtoMessage() {} -func (*ParameterDefinitions) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{38} -} - -func (m *ParameterDefinitions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ParameterDefinitions.Unmarshal(m, b) -} -func (m *ParameterDefinitions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ParameterDefinitions.Marshal(b, m, deterministic) -} -func (m *ParameterDefinitions) XXX_Merge(src proto.Message) { - xxx_messageInfo_ParameterDefinitions.Merge(m, src) -} -func (m *ParameterDefinitions) XXX_Size() int { - return xxx_messageInfo_ParameterDefinitions.Size(m) -} -func (m *ParameterDefinitions) XXX_DiscardUnknown() { - xxx_messageInfo_ParameterDefinitions.DiscardUnknown(m) +// One or more JSON representations for parameters +type ParameterDefinitions struct { + AdditionalProperties []*NamedParameter `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties" json:"additional_properties,omitempty"` } -var xxx_messageInfo_ParameterDefinitions proto.InternalMessageInfo +func (m *ParameterDefinitions) Reset() { *m = ParameterDefinitions{} } +func (m *ParameterDefinitions) String() string { return proto.CompactTextString(m) } +func (*ParameterDefinitions) ProtoMessage() {} +func (*ParameterDefinitions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{38} } func (m *ParameterDefinitions) GetAdditionalProperties() []*NamedParameter { if m != nil { @@ -3002,51 +2395,26 @@ type ParametersItem struct { // Types that are valid to be assigned to Oneof: // *ParametersItem_Parameter // *ParametersItem_JsonReference - Oneof isParametersItem_Oneof `protobuf_oneof:"oneof"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ParametersItem) Reset() { *m = ParametersItem{} } -func (m *ParametersItem) String() string { return proto.CompactTextString(m) } -func (*ParametersItem) ProtoMessage() {} -func (*ParametersItem) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{39} -} - -func (m *ParametersItem) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ParametersItem.Unmarshal(m, b) -} -func (m *ParametersItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ParametersItem.Marshal(b, m, deterministic) -} -func (m *ParametersItem) XXX_Merge(src proto.Message) { - xxx_messageInfo_ParametersItem.Merge(m, src) -} -func (m *ParametersItem) XXX_Size() int { - return xxx_messageInfo_ParametersItem.Size(m) -} -func (m *ParametersItem) XXX_DiscardUnknown() { - xxx_messageInfo_ParametersItem.DiscardUnknown(m) + Oneof isParametersItem_Oneof `protobuf_oneof:"oneof"` } -var xxx_messageInfo_ParametersItem proto.InternalMessageInfo +func (m *ParametersItem) Reset() { *m = ParametersItem{} } +func (m *ParametersItem) String() string { return proto.CompactTextString(m) } +func (*ParametersItem) ProtoMessage() {} +func (*ParametersItem) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{39} } type isParametersItem_Oneof interface { isParametersItem_Oneof() } type ParametersItem_Parameter struct { - Parameter *Parameter `protobuf:"bytes,1,opt,name=parameter,proto3,oneof"` + Parameter *Parameter `protobuf:"bytes,1,opt,name=parameter,oneof"` } - type ParametersItem_JsonReference struct { - JsonReference *JsonReference `protobuf:"bytes,2,opt,name=json_reference,json=jsonReference,proto3,oneof"` + JsonReference *JsonReference `protobuf:"bytes,2,opt,name=json_reference,json=jsonReference,oneof"` } -func (*ParametersItem_Parameter) isParametersItem_Oneof() {} - +func (*ParametersItem_Parameter) isParametersItem_Oneof() {} func (*ParametersItem_JsonReference) isParametersItem_Oneof() {} func (m *ParametersItem) GetOneof() isParametersItem_Oneof { @@ -3070,55 +2438,98 @@ func (m *ParametersItem) GetJsonReference() *JsonReference { return nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*ParametersItem) XXX_OneofWrappers() []interface{} { - return []interface{}{ +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ParametersItem) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ParametersItem_OneofMarshaler, _ParametersItem_OneofUnmarshaler, _ParametersItem_OneofSizer, []interface{}{ (*ParametersItem_Parameter)(nil), (*ParametersItem_JsonReference)(nil), } } -type PathItem struct { - XRef string `protobuf:"bytes,1,opt,name=_ref,json=Ref,proto3" json:"_ref,omitempty"` - Get *Operation `protobuf:"bytes,2,opt,name=get,proto3" json:"get,omitempty"` - Put *Operation `protobuf:"bytes,3,opt,name=put,proto3" json:"put,omitempty"` - Post *Operation `protobuf:"bytes,4,opt,name=post,proto3" json:"post,omitempty"` - Delete *Operation `protobuf:"bytes,5,opt,name=delete,proto3" json:"delete,omitempty"` - Options *Operation `protobuf:"bytes,6,opt,name=options,proto3" json:"options,omitempty"` - Head *Operation `protobuf:"bytes,7,opt,name=head,proto3" json:"head,omitempty"` - Patch *Operation `protobuf:"bytes,8,opt,name=patch,proto3" json:"patch,omitempty"` - // The parameters needed to send a valid API call. - Parameters []*ParametersItem `protobuf:"bytes,9,rep,name=parameters,proto3" json:"parameters,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,10,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func _ParametersItem_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ParametersItem) + // oneof + switch x := m.Oneof.(type) { + case *ParametersItem_Parameter: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Parameter); err != nil { + return err + } + case *ParametersItem_JsonReference: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.JsonReference); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("ParametersItem.Oneof has unexpected type %T", x) + } + return nil +} + +func _ParametersItem_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ParametersItem) + switch tag { + case 1: // oneof.parameter + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Parameter) + err := b.DecodeMessage(msg) + m.Oneof = &ParametersItem_Parameter{msg} + return true, err + case 2: // oneof.json_reference + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(JsonReference) + err := b.DecodeMessage(msg) + m.Oneof = &ParametersItem_JsonReference{msg} + return true, err + default: + return false, nil + } +} + +func _ParametersItem_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ParametersItem) + // oneof + switch x := m.Oneof.(type) { + case *ParametersItem_Parameter: + s := proto.Size(x.Parameter) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *ParametersItem_JsonReference: + s := proto.Size(x.JsonReference) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n } -func (m *PathItem) Reset() { *m = PathItem{} } -func (m *PathItem) String() string { return proto.CompactTextString(m) } -func (*PathItem) ProtoMessage() {} -func (*PathItem) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{40} -} - -func (m *PathItem) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PathItem.Unmarshal(m, b) -} -func (m *PathItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PathItem.Marshal(b, m, deterministic) -} -func (m *PathItem) XXX_Merge(src proto.Message) { - xxx_messageInfo_PathItem.Merge(m, src) -} -func (m *PathItem) XXX_Size() int { - return xxx_messageInfo_PathItem.Size(m) -} -func (m *PathItem) XXX_DiscardUnknown() { - xxx_messageInfo_PathItem.DiscardUnknown(m) +type PathItem struct { + XRef string `protobuf:"bytes,1,opt,name=_ref,json=Ref" json:"_ref,omitempty"` + Get *Operation `protobuf:"bytes,2,opt,name=get" json:"get,omitempty"` + Put *Operation `protobuf:"bytes,3,opt,name=put" json:"put,omitempty"` + Post *Operation `protobuf:"bytes,4,opt,name=post" json:"post,omitempty"` + Delete *Operation `protobuf:"bytes,5,opt,name=delete" json:"delete,omitempty"` + Options *Operation `protobuf:"bytes,6,opt,name=options" json:"options,omitempty"` + Head *Operation `protobuf:"bytes,7,opt,name=head" json:"head,omitempty"` + Patch *Operation `protobuf:"bytes,8,opt,name=patch" json:"patch,omitempty"` + // The parameters needed to send a valid API call. + Parameters []*ParametersItem `protobuf:"bytes,9,rep,name=parameters" json:"parameters,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,10,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } -var xxx_messageInfo_PathItem proto.InternalMessageInfo +func (m *PathItem) Reset() { *m = PathItem{} } +func (m *PathItem) String() string { return proto.CompactTextString(m) } +func (*PathItem) ProtoMessage() {} +func (*PathItem) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{40} } func (m *PathItem) GetXRef() string { if m != nil { @@ -3192,60 +2603,37 @@ func (m *PathItem) GetVendorExtension() []*NamedAny { type PathParameterSubSchema struct { // Determines whether or not this parameter is required or optional. - Required bool `protobuf:"varint,1,opt,name=required,proto3" json:"required,omitempty"` + Required bool `protobuf:"varint,1,opt,name=required" json:"required,omitempty"` // Determines the location of the parameter. - In string `protobuf:"bytes,2,opt,name=in,proto3" json:"in,omitempty"` + In string `protobuf:"bytes,2,opt,name=in" json:"in,omitempty"` // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` // The name of the parameter. - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` - Format string `protobuf:"bytes,6,opt,name=format,proto3" json:"format,omitempty"` - Items *PrimitivesItems `protobuf:"bytes,7,opt,name=items,proto3" json:"items,omitempty"` - CollectionFormat string `protobuf:"bytes,8,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` - Default *Any `protobuf:"bytes,9,opt,name=default,proto3" json:"default,omitempty"` - Maximum float64 `protobuf:"fixed64,10,opt,name=maximum,proto3" json:"maximum,omitempty"` - ExclusiveMaximum bool `protobuf:"varint,11,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` - Minimum float64 `protobuf:"fixed64,12,opt,name=minimum,proto3" json:"minimum,omitempty"` - ExclusiveMinimum bool `protobuf:"varint,13,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` - MaxLength int64 `protobuf:"varint,14,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` - MinLength int64 `protobuf:"varint,15,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` - Pattern string `protobuf:"bytes,16,opt,name=pattern,proto3" json:"pattern,omitempty"` - MaxItems int64 `protobuf:"varint,17,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` - MinItems int64 `protobuf:"varint,18,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` - UniqueItems bool `protobuf:"varint,19,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` - Enum []*Any `protobuf:"bytes,20,rep,name=enum,proto3" json:"enum,omitempty"` - MultipleOf float64 `protobuf:"fixed64,21,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,22,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PathParameterSubSchema) Reset() { *m = PathParameterSubSchema{} } -func (m *PathParameterSubSchema) String() string { return proto.CompactTextString(m) } -func (*PathParameterSubSchema) ProtoMessage() {} -func (*PathParameterSubSchema) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{41} -} - -func (m *PathParameterSubSchema) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PathParameterSubSchema.Unmarshal(m, b) -} -func (m *PathParameterSubSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PathParameterSubSchema.Marshal(b, m, deterministic) -} -func (m *PathParameterSubSchema) XXX_Merge(src proto.Message) { - xxx_messageInfo_PathParameterSubSchema.Merge(m, src) -} -func (m *PathParameterSubSchema) XXX_Size() int { - return xxx_messageInfo_PathParameterSubSchema.Size(m) -} -func (m *PathParameterSubSchema) XXX_DiscardUnknown() { - xxx_messageInfo_PathParameterSubSchema.DiscardUnknown(m) -} - -var xxx_messageInfo_PathParameterSubSchema proto.InternalMessageInfo + Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` + Type string `protobuf:"bytes,5,opt,name=type" json:"type,omitempty"` + Format string `protobuf:"bytes,6,opt,name=format" json:"format,omitempty"` + Items *PrimitivesItems `protobuf:"bytes,7,opt,name=items" json:"items,omitempty"` + CollectionFormat string `protobuf:"bytes,8,opt,name=collection_format,json=collectionFormat" json:"collection_format,omitempty"` + Default *Any `protobuf:"bytes,9,opt,name=default" json:"default,omitempty"` + Maximum float64 `protobuf:"fixed64,10,opt,name=maximum" json:"maximum,omitempty"` + ExclusiveMaximum bool `protobuf:"varint,11,opt,name=exclusive_maximum,json=exclusiveMaximum" json:"exclusive_maximum,omitempty"` + Minimum float64 `protobuf:"fixed64,12,opt,name=minimum" json:"minimum,omitempty"` + ExclusiveMinimum bool `protobuf:"varint,13,opt,name=exclusive_minimum,json=exclusiveMinimum" json:"exclusive_minimum,omitempty"` + MaxLength int64 `protobuf:"varint,14,opt,name=max_length,json=maxLength" json:"max_length,omitempty"` + MinLength int64 `protobuf:"varint,15,opt,name=min_length,json=minLength" json:"min_length,omitempty"` + Pattern string `protobuf:"bytes,16,opt,name=pattern" json:"pattern,omitempty"` + MaxItems int64 `protobuf:"varint,17,opt,name=max_items,json=maxItems" json:"max_items,omitempty"` + MinItems int64 `protobuf:"varint,18,opt,name=min_items,json=minItems" json:"min_items,omitempty"` + UniqueItems bool `protobuf:"varint,19,opt,name=unique_items,json=uniqueItems" json:"unique_items,omitempty"` + Enum []*Any `protobuf:"bytes,20,rep,name=enum" json:"enum,omitempty"` + MultipleOf float64 `protobuf:"fixed64,21,opt,name=multiple_of,json=multipleOf" json:"multiple_of,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,22,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` +} + +func (m *PathParameterSubSchema) Reset() { *m = PathParameterSubSchema{} } +func (m *PathParameterSubSchema) String() string { return proto.CompactTextString(m) } +func (*PathParameterSubSchema) ProtoMessage() {} +func (*PathParameterSubSchema) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{41} } func (m *PathParameterSubSchema) GetRequired() bool { if m != nil { @@ -3403,37 +2791,14 @@ func (m *PathParameterSubSchema) GetVendorExtension() []*NamedAny { // Relative paths to the individual endpoints. They must be relative to the 'basePath'. type Paths struct { - VendorExtension []*NamedAny `protobuf:"bytes,1,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - Path []*NamedPathItem `protobuf:"bytes,2,rep,name=path,proto3" json:"path,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Paths) Reset() { *m = Paths{} } -func (m *Paths) String() string { return proto.CompactTextString(m) } -func (*Paths) ProtoMessage() {} -func (*Paths) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{42} -} - -func (m *Paths) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Paths.Unmarshal(m, b) -} -func (m *Paths) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Paths.Marshal(b, m, deterministic) -} -func (m *Paths) XXX_Merge(src proto.Message) { - xxx_messageInfo_Paths.Merge(m, src) -} -func (m *Paths) XXX_Size() int { - return xxx_messageInfo_Paths.Size(m) -} -func (m *Paths) XXX_DiscardUnknown() { - xxx_messageInfo_Paths.DiscardUnknown(m) + VendorExtension []*NamedAny `protobuf:"bytes,1,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` + Path []*NamedPathItem `protobuf:"bytes,2,rep,name=path" json:"path,omitempty"` } -var xxx_messageInfo_Paths proto.InternalMessageInfo +func (m *Paths) Reset() { *m = Paths{} } +func (m *Paths) String() string { return proto.CompactTextString(m) } +func (*Paths) ProtoMessage() {} +func (*Paths) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{42} } func (m *Paths) GetVendorExtension() []*NamedAny { if m != nil { @@ -3450,53 +2815,30 @@ func (m *Paths) GetPath() []*NamedPathItem { } type PrimitivesItems struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Format string `protobuf:"bytes,2,opt,name=format,proto3" json:"format,omitempty"` - Items *PrimitivesItems `protobuf:"bytes,3,opt,name=items,proto3" json:"items,omitempty"` - CollectionFormat string `protobuf:"bytes,4,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` - Default *Any `protobuf:"bytes,5,opt,name=default,proto3" json:"default,omitempty"` - Maximum float64 `protobuf:"fixed64,6,opt,name=maximum,proto3" json:"maximum,omitempty"` - ExclusiveMaximum bool `protobuf:"varint,7,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` - Minimum float64 `protobuf:"fixed64,8,opt,name=minimum,proto3" json:"minimum,omitempty"` - ExclusiveMinimum bool `protobuf:"varint,9,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` - MaxLength int64 `protobuf:"varint,10,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` - MinLength int64 `protobuf:"varint,11,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` - Pattern string `protobuf:"bytes,12,opt,name=pattern,proto3" json:"pattern,omitempty"` - MaxItems int64 `protobuf:"varint,13,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` - MinItems int64 `protobuf:"varint,14,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` - UniqueItems bool `protobuf:"varint,15,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` - Enum []*Any `protobuf:"bytes,16,rep,name=enum,proto3" json:"enum,omitempty"` - MultipleOf float64 `protobuf:"fixed64,17,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,18,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PrimitivesItems) Reset() { *m = PrimitivesItems{} } -func (m *PrimitivesItems) String() string { return proto.CompactTextString(m) } -func (*PrimitivesItems) ProtoMessage() {} -func (*PrimitivesItems) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{43} -} - -func (m *PrimitivesItems) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PrimitivesItems.Unmarshal(m, b) -} -func (m *PrimitivesItems) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PrimitivesItems.Marshal(b, m, deterministic) -} -func (m *PrimitivesItems) XXX_Merge(src proto.Message) { - xxx_messageInfo_PrimitivesItems.Merge(m, src) -} -func (m *PrimitivesItems) XXX_Size() int { - return xxx_messageInfo_PrimitivesItems.Size(m) -} -func (m *PrimitivesItems) XXX_DiscardUnknown() { - xxx_messageInfo_PrimitivesItems.DiscardUnknown(m) -} - -var xxx_messageInfo_PrimitivesItems proto.InternalMessageInfo + Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"` + Format string `protobuf:"bytes,2,opt,name=format" json:"format,omitempty"` + Items *PrimitivesItems `protobuf:"bytes,3,opt,name=items" json:"items,omitempty"` + CollectionFormat string `protobuf:"bytes,4,opt,name=collection_format,json=collectionFormat" json:"collection_format,omitempty"` + Default *Any `protobuf:"bytes,5,opt,name=default" json:"default,omitempty"` + Maximum float64 `protobuf:"fixed64,6,opt,name=maximum" json:"maximum,omitempty"` + ExclusiveMaximum bool `protobuf:"varint,7,opt,name=exclusive_maximum,json=exclusiveMaximum" json:"exclusive_maximum,omitempty"` + Minimum float64 `protobuf:"fixed64,8,opt,name=minimum" json:"minimum,omitempty"` + ExclusiveMinimum bool `protobuf:"varint,9,opt,name=exclusive_minimum,json=exclusiveMinimum" json:"exclusive_minimum,omitempty"` + MaxLength int64 `protobuf:"varint,10,opt,name=max_length,json=maxLength" json:"max_length,omitempty"` + MinLength int64 `protobuf:"varint,11,opt,name=min_length,json=minLength" json:"min_length,omitempty"` + Pattern string `protobuf:"bytes,12,opt,name=pattern" json:"pattern,omitempty"` + MaxItems int64 `protobuf:"varint,13,opt,name=max_items,json=maxItems" json:"max_items,omitempty"` + MinItems int64 `protobuf:"varint,14,opt,name=min_items,json=minItems" json:"min_items,omitempty"` + UniqueItems bool `protobuf:"varint,15,opt,name=unique_items,json=uniqueItems" json:"unique_items,omitempty"` + Enum []*Any `protobuf:"bytes,16,rep,name=enum" json:"enum,omitempty"` + MultipleOf float64 `protobuf:"fixed64,17,opt,name=multiple_of,json=multipleOf" json:"multiple_of,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,18,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` +} + +func (m *PrimitivesItems) Reset() { *m = PrimitivesItems{} } +func (m *PrimitivesItems) String() string { return proto.CompactTextString(m) } +func (*PrimitivesItems) ProtoMessage() {} +func (*PrimitivesItems) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{43} } func (m *PrimitivesItems) GetType() string { if m != nil { @@ -3625,36 +2967,13 @@ func (m *PrimitivesItems) GetVendorExtension() []*NamedAny { } type Properties struct { - AdditionalProperties []*NamedSchema `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Properties) Reset() { *m = Properties{} } -func (m *Properties) String() string { return proto.CompactTextString(m) } -func (*Properties) ProtoMessage() {} -func (*Properties) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{44} -} - -func (m *Properties) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Properties.Unmarshal(m, b) -} -func (m *Properties) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Properties.Marshal(b, m, deterministic) -} -func (m *Properties) XXX_Merge(src proto.Message) { - xxx_messageInfo_Properties.Merge(m, src) -} -func (m *Properties) XXX_Size() int { - return xxx_messageInfo_Properties.Size(m) -} -func (m *Properties) XXX_DiscardUnknown() { - xxx_messageInfo_Properties.DiscardUnknown(m) + AdditionalProperties []*NamedSchema `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties" json:"additional_properties,omitempty"` } -var xxx_messageInfo_Properties proto.InternalMessageInfo +func (m *Properties) Reset() { *m = Properties{} } +func (m *Properties) String() string { return proto.CompactTextString(m) } +func (*Properties) ProtoMessage() {} +func (*Properties) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{44} } func (m *Properties) GetAdditionalProperties() []*NamedSchema { if m != nil { @@ -3665,62 +2984,39 @@ func (m *Properties) GetAdditionalProperties() []*NamedSchema { type QueryParameterSubSchema struct { // Determines whether or not this parameter is required or optional. - Required bool `protobuf:"varint,1,opt,name=required,proto3" json:"required,omitempty"` + Required bool `protobuf:"varint,1,opt,name=required" json:"required,omitempty"` // Determines the location of the parameter. - In string `protobuf:"bytes,2,opt,name=in,proto3" json:"in,omitempty"` + In string `protobuf:"bytes,2,opt,name=in" json:"in,omitempty"` // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` // The name of the parameter. - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` // allows sending a parameter by name only or with an empty value. - AllowEmptyValue bool `protobuf:"varint,5,opt,name=allow_empty_value,json=allowEmptyValue,proto3" json:"allow_empty_value,omitempty"` - Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` - Format string `protobuf:"bytes,7,opt,name=format,proto3" json:"format,omitempty"` - Items *PrimitivesItems `protobuf:"bytes,8,opt,name=items,proto3" json:"items,omitempty"` - CollectionFormat string `protobuf:"bytes,9,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` - Default *Any `protobuf:"bytes,10,opt,name=default,proto3" json:"default,omitempty"` - Maximum float64 `protobuf:"fixed64,11,opt,name=maximum,proto3" json:"maximum,omitempty"` - ExclusiveMaximum bool `protobuf:"varint,12,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` - Minimum float64 `protobuf:"fixed64,13,opt,name=minimum,proto3" json:"minimum,omitempty"` - ExclusiveMinimum bool `protobuf:"varint,14,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` - MaxLength int64 `protobuf:"varint,15,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` - MinLength int64 `protobuf:"varint,16,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` - Pattern string `protobuf:"bytes,17,opt,name=pattern,proto3" json:"pattern,omitempty"` - MaxItems int64 `protobuf:"varint,18,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` - MinItems int64 `protobuf:"varint,19,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` - UniqueItems bool `protobuf:"varint,20,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` - Enum []*Any `protobuf:"bytes,21,rep,name=enum,proto3" json:"enum,omitempty"` - MultipleOf float64 `protobuf:"fixed64,22,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,23,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryParameterSubSchema) Reset() { *m = QueryParameterSubSchema{} } -func (m *QueryParameterSubSchema) String() string { return proto.CompactTextString(m) } -func (*QueryParameterSubSchema) ProtoMessage() {} -func (*QueryParameterSubSchema) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{45} -} - -func (m *QueryParameterSubSchema) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryParameterSubSchema.Unmarshal(m, b) -} -func (m *QueryParameterSubSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryParameterSubSchema.Marshal(b, m, deterministic) -} -func (m *QueryParameterSubSchema) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParameterSubSchema.Merge(m, src) -} -func (m *QueryParameterSubSchema) XXX_Size() int { - return xxx_messageInfo_QueryParameterSubSchema.Size(m) -} -func (m *QueryParameterSubSchema) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParameterSubSchema.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParameterSubSchema proto.InternalMessageInfo + AllowEmptyValue bool `protobuf:"varint,5,opt,name=allow_empty_value,json=allowEmptyValue" json:"allow_empty_value,omitempty"` + Type string `protobuf:"bytes,6,opt,name=type" json:"type,omitempty"` + Format string `protobuf:"bytes,7,opt,name=format" json:"format,omitempty"` + Items *PrimitivesItems `protobuf:"bytes,8,opt,name=items" json:"items,omitempty"` + CollectionFormat string `protobuf:"bytes,9,opt,name=collection_format,json=collectionFormat" json:"collection_format,omitempty"` + Default *Any `protobuf:"bytes,10,opt,name=default" json:"default,omitempty"` + Maximum float64 `protobuf:"fixed64,11,opt,name=maximum" json:"maximum,omitempty"` + ExclusiveMaximum bool `protobuf:"varint,12,opt,name=exclusive_maximum,json=exclusiveMaximum" json:"exclusive_maximum,omitempty"` + Minimum float64 `protobuf:"fixed64,13,opt,name=minimum" json:"minimum,omitempty"` + ExclusiveMinimum bool `protobuf:"varint,14,opt,name=exclusive_minimum,json=exclusiveMinimum" json:"exclusive_minimum,omitempty"` + MaxLength int64 `protobuf:"varint,15,opt,name=max_length,json=maxLength" json:"max_length,omitempty"` + MinLength int64 `protobuf:"varint,16,opt,name=min_length,json=minLength" json:"min_length,omitempty"` + Pattern string `protobuf:"bytes,17,opt,name=pattern" json:"pattern,omitempty"` + MaxItems int64 `protobuf:"varint,18,opt,name=max_items,json=maxItems" json:"max_items,omitempty"` + MinItems int64 `protobuf:"varint,19,opt,name=min_items,json=minItems" json:"min_items,omitempty"` + UniqueItems bool `protobuf:"varint,20,opt,name=unique_items,json=uniqueItems" json:"unique_items,omitempty"` + Enum []*Any `protobuf:"bytes,21,rep,name=enum" json:"enum,omitempty"` + MultipleOf float64 `protobuf:"fixed64,22,opt,name=multiple_of,json=multipleOf" json:"multiple_of,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,23,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` +} + +func (m *QueryParameterSubSchema) Reset() { *m = QueryParameterSubSchema{} } +func (m *QueryParameterSubSchema) String() string { return proto.CompactTextString(m) } +func (*QueryParameterSubSchema) ProtoMessage() {} +func (*QueryParameterSubSchema) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{45} } func (m *QueryParameterSubSchema) GetRequired() bool { if m != nil { @@ -3884,40 +3180,17 @@ func (m *QueryParameterSubSchema) GetVendorExtension() []*NamedAny { } type Response struct { - Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` - Schema *SchemaItem `protobuf:"bytes,2,opt,name=schema,proto3" json:"schema,omitempty"` - Headers *Headers `protobuf:"bytes,3,opt,name=headers,proto3" json:"headers,omitempty"` - Examples *Examples `protobuf:"bytes,4,opt,name=examples,proto3" json:"examples,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,5,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Response) Reset() { *m = Response{} } -func (m *Response) String() string { return proto.CompactTextString(m) } -func (*Response) ProtoMessage() {} -func (*Response) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{46} -} - -func (m *Response) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Response.Unmarshal(m, b) -} -func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Response.Marshal(b, m, deterministic) -} -func (m *Response) XXX_Merge(src proto.Message) { - xxx_messageInfo_Response.Merge(m, src) -} -func (m *Response) XXX_Size() int { - return xxx_messageInfo_Response.Size(m) -} -func (m *Response) XXX_DiscardUnknown() { - xxx_messageInfo_Response.DiscardUnknown(m) + Description string `protobuf:"bytes,1,opt,name=description" json:"description,omitempty"` + Schema *SchemaItem `protobuf:"bytes,2,opt,name=schema" json:"schema,omitempty"` + Headers *Headers `protobuf:"bytes,3,opt,name=headers" json:"headers,omitempty"` + Examples *Examples `protobuf:"bytes,4,opt,name=examples" json:"examples,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,5,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } -var xxx_messageInfo_Response proto.InternalMessageInfo +func (m *Response) Reset() { *m = Response{} } +func (m *Response) String() string { return proto.CompactTextString(m) } +func (*Response) ProtoMessage() {} +func (*Response) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{46} } func (m *Response) GetDescription() string { if m != nil { @@ -3956,36 +3229,13 @@ func (m *Response) GetVendorExtension() []*NamedAny { // One or more JSON representations for parameters type ResponseDefinitions struct { - AdditionalProperties []*NamedResponse `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + AdditionalProperties []*NamedResponse `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties" json:"additional_properties,omitempty"` } -func (m *ResponseDefinitions) Reset() { *m = ResponseDefinitions{} } -func (m *ResponseDefinitions) String() string { return proto.CompactTextString(m) } -func (*ResponseDefinitions) ProtoMessage() {} -func (*ResponseDefinitions) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{47} -} - -func (m *ResponseDefinitions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ResponseDefinitions.Unmarshal(m, b) -} -func (m *ResponseDefinitions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ResponseDefinitions.Marshal(b, m, deterministic) -} -func (m *ResponseDefinitions) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseDefinitions.Merge(m, src) -} -func (m *ResponseDefinitions) XXX_Size() int { - return xxx_messageInfo_ResponseDefinitions.Size(m) -} -func (m *ResponseDefinitions) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseDefinitions.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseDefinitions proto.InternalMessageInfo +func (m *ResponseDefinitions) Reset() { *m = ResponseDefinitions{} } +func (m *ResponseDefinitions) String() string { return proto.CompactTextString(m) } +func (*ResponseDefinitions) ProtoMessage() {} +func (*ResponseDefinitions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{47} } func (m *ResponseDefinitions) GetAdditionalProperties() []*NamedResponse { if m != nil { @@ -3998,51 +3248,26 @@ type ResponseValue struct { // Types that are valid to be assigned to Oneof: // *ResponseValue_Response // *ResponseValue_JsonReference - Oneof isResponseValue_Oneof `protobuf_oneof:"oneof"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Oneof isResponseValue_Oneof `protobuf_oneof:"oneof"` } -func (m *ResponseValue) Reset() { *m = ResponseValue{} } -func (m *ResponseValue) String() string { return proto.CompactTextString(m) } -func (*ResponseValue) ProtoMessage() {} -func (*ResponseValue) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{48} -} - -func (m *ResponseValue) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ResponseValue.Unmarshal(m, b) -} -func (m *ResponseValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ResponseValue.Marshal(b, m, deterministic) -} -func (m *ResponseValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseValue.Merge(m, src) -} -func (m *ResponseValue) XXX_Size() int { - return xxx_messageInfo_ResponseValue.Size(m) -} -func (m *ResponseValue) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseValue.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseValue proto.InternalMessageInfo +func (m *ResponseValue) Reset() { *m = ResponseValue{} } +func (m *ResponseValue) String() string { return proto.CompactTextString(m) } +func (*ResponseValue) ProtoMessage() {} +func (*ResponseValue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{48} } type isResponseValue_Oneof interface { isResponseValue_Oneof() } type ResponseValue_Response struct { - Response *Response `protobuf:"bytes,1,opt,name=response,proto3,oneof"` + Response *Response `protobuf:"bytes,1,opt,name=response,oneof"` } - type ResponseValue_JsonReference struct { - JsonReference *JsonReference `protobuf:"bytes,2,opt,name=json_reference,json=jsonReference,proto3,oneof"` + JsonReference *JsonReference `protobuf:"bytes,2,opt,name=json_reference,json=jsonReference,oneof"` } -func (*ResponseValue_Response) isResponseValue_Oneof() {} - +func (*ResponseValue_Response) isResponseValue_Oneof() {} func (*ResponseValue_JsonReference) isResponseValue_Oneof() {} func (m *ResponseValue) GetOneof() isResponseValue_Oneof { @@ -4066,47 +3291,90 @@ func (m *ResponseValue) GetJsonReference() *JsonReference { return nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*ResponseValue) XXX_OneofWrappers() []interface{} { - return []interface{}{ +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ResponseValue) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ResponseValue_OneofMarshaler, _ResponseValue_OneofUnmarshaler, _ResponseValue_OneofSizer, []interface{}{ (*ResponseValue_Response)(nil), (*ResponseValue_JsonReference)(nil), } } -// Response objects names can either be any valid HTTP status code or 'default'. -type Responses struct { - ResponseCode []*NamedResponseValue `protobuf:"bytes,1,rep,name=response_code,json=responseCode,proto3" json:"response_code,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,2,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Responses) Reset() { *m = Responses{} } -func (m *Responses) String() string { return proto.CompactTextString(m) } -func (*Responses) ProtoMessage() {} -func (*Responses) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{49} +func _ResponseValue_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ResponseValue) + // oneof + switch x := m.Oneof.(type) { + case *ResponseValue_Response: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Response); err != nil { + return err + } + case *ResponseValue_JsonReference: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.JsonReference); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("ResponseValue.Oneof has unexpected type %T", x) + } + return nil +} + +func _ResponseValue_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ResponseValue) + switch tag { + case 1: // oneof.response + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Response) + err := b.DecodeMessage(msg) + m.Oneof = &ResponseValue_Response{msg} + return true, err + case 2: // oneof.json_reference + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(JsonReference) + err := b.DecodeMessage(msg) + m.Oneof = &ResponseValue_JsonReference{msg} + return true, err + default: + return false, nil + } +} + +func _ResponseValue_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ResponseValue) + // oneof + switch x := m.Oneof.(type) { + case *ResponseValue_Response: + s := proto.Size(x.Response) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *ResponseValue_JsonReference: + s := proto.Size(x.JsonReference) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n } -func (m *Responses) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Responses.Unmarshal(m, b) -} -func (m *Responses) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Responses.Marshal(b, m, deterministic) -} -func (m *Responses) XXX_Merge(src proto.Message) { - xxx_messageInfo_Responses.Merge(m, src) -} -func (m *Responses) XXX_Size() int { - return xxx_messageInfo_Responses.Size(m) -} -func (m *Responses) XXX_DiscardUnknown() { - xxx_messageInfo_Responses.DiscardUnknown(m) +// Response objects names can either be any valid HTTP status code or 'default'. +type Responses struct { + ResponseCode []*NamedResponseValue `protobuf:"bytes,1,rep,name=response_code,json=responseCode" json:"response_code,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,2,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } -var xxx_messageInfo_Responses proto.InternalMessageInfo +func (m *Responses) Reset() { *m = Responses{} } +func (m *Responses) String() string { return proto.CompactTextString(m) } +func (*Responses) ProtoMessage() {} +func (*Responses) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{49} } func (m *Responses) GetResponseCode() []*NamedResponseValue { if m != nil { @@ -4124,66 +3392,43 @@ func (m *Responses) GetVendorExtension() []*NamedAny { // A deterministic version of a JSON Schema object. type Schema struct { - XRef string `protobuf:"bytes,1,opt,name=_ref,json=Ref,proto3" json:"_ref,omitempty"` - Format string `protobuf:"bytes,2,opt,name=format,proto3" json:"format,omitempty"` - Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` - Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` - Default *Any `protobuf:"bytes,5,opt,name=default,proto3" json:"default,omitempty"` - MultipleOf float64 `protobuf:"fixed64,6,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` - Maximum float64 `protobuf:"fixed64,7,opt,name=maximum,proto3" json:"maximum,omitempty"` - ExclusiveMaximum bool `protobuf:"varint,8,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` - Minimum float64 `protobuf:"fixed64,9,opt,name=minimum,proto3" json:"minimum,omitempty"` - ExclusiveMinimum bool `protobuf:"varint,10,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` - MaxLength int64 `protobuf:"varint,11,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` - MinLength int64 `protobuf:"varint,12,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` - Pattern string `protobuf:"bytes,13,opt,name=pattern,proto3" json:"pattern,omitempty"` - MaxItems int64 `protobuf:"varint,14,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` - MinItems int64 `protobuf:"varint,15,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` - UniqueItems bool `protobuf:"varint,16,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` - MaxProperties int64 `protobuf:"varint,17,opt,name=max_properties,json=maxProperties,proto3" json:"max_properties,omitempty"` - MinProperties int64 `protobuf:"varint,18,opt,name=min_properties,json=minProperties,proto3" json:"min_properties,omitempty"` - Required []string `protobuf:"bytes,19,rep,name=required,proto3" json:"required,omitempty"` - Enum []*Any `protobuf:"bytes,20,rep,name=enum,proto3" json:"enum,omitempty"` - AdditionalProperties *AdditionalPropertiesItem `protobuf:"bytes,21,opt,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` - Type *TypeItem `protobuf:"bytes,22,opt,name=type,proto3" json:"type,omitempty"` - Items *ItemsItem `protobuf:"bytes,23,opt,name=items,proto3" json:"items,omitempty"` - AllOf []*Schema `protobuf:"bytes,24,rep,name=all_of,json=allOf,proto3" json:"all_of,omitempty"` - Properties *Properties `protobuf:"bytes,25,opt,name=properties,proto3" json:"properties,omitempty"` - Discriminator string `protobuf:"bytes,26,opt,name=discriminator,proto3" json:"discriminator,omitempty"` - ReadOnly bool `protobuf:"varint,27,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"` - Xml *Xml `protobuf:"bytes,28,opt,name=xml,proto3" json:"xml,omitempty"` - ExternalDocs *ExternalDocs `protobuf:"bytes,29,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` - Example *Any `protobuf:"bytes,30,opt,name=example,proto3" json:"example,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,31,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Schema) Reset() { *m = Schema{} } -func (m *Schema) String() string { return proto.CompactTextString(m) } -func (*Schema) ProtoMessage() {} -func (*Schema) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{50} -} - -func (m *Schema) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Schema.Unmarshal(m, b) -} -func (m *Schema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Schema.Marshal(b, m, deterministic) -} -func (m *Schema) XXX_Merge(src proto.Message) { - xxx_messageInfo_Schema.Merge(m, src) -} -func (m *Schema) XXX_Size() int { - return xxx_messageInfo_Schema.Size(m) -} -func (m *Schema) XXX_DiscardUnknown() { - xxx_messageInfo_Schema.DiscardUnknown(m) -} - -var xxx_messageInfo_Schema proto.InternalMessageInfo + XRef string `protobuf:"bytes,1,opt,name=_ref,json=Ref" json:"_ref,omitempty"` + Format string `protobuf:"bytes,2,opt,name=format" json:"format,omitempty"` + Title string `protobuf:"bytes,3,opt,name=title" json:"title,omitempty"` + Description string `protobuf:"bytes,4,opt,name=description" json:"description,omitempty"` + Default *Any `protobuf:"bytes,5,opt,name=default" json:"default,omitempty"` + MultipleOf float64 `protobuf:"fixed64,6,opt,name=multiple_of,json=multipleOf" json:"multiple_of,omitempty"` + Maximum float64 `protobuf:"fixed64,7,opt,name=maximum" json:"maximum,omitempty"` + ExclusiveMaximum bool `protobuf:"varint,8,opt,name=exclusive_maximum,json=exclusiveMaximum" json:"exclusive_maximum,omitempty"` + Minimum float64 `protobuf:"fixed64,9,opt,name=minimum" json:"minimum,omitempty"` + ExclusiveMinimum bool `protobuf:"varint,10,opt,name=exclusive_minimum,json=exclusiveMinimum" json:"exclusive_minimum,omitempty"` + MaxLength int64 `protobuf:"varint,11,opt,name=max_length,json=maxLength" json:"max_length,omitempty"` + MinLength int64 `protobuf:"varint,12,opt,name=min_length,json=minLength" json:"min_length,omitempty"` + Pattern string `protobuf:"bytes,13,opt,name=pattern" json:"pattern,omitempty"` + MaxItems int64 `protobuf:"varint,14,opt,name=max_items,json=maxItems" json:"max_items,omitempty"` + MinItems int64 `protobuf:"varint,15,opt,name=min_items,json=minItems" json:"min_items,omitempty"` + UniqueItems bool `protobuf:"varint,16,opt,name=unique_items,json=uniqueItems" json:"unique_items,omitempty"` + MaxProperties int64 `protobuf:"varint,17,opt,name=max_properties,json=maxProperties" json:"max_properties,omitempty"` + MinProperties int64 `protobuf:"varint,18,opt,name=min_properties,json=minProperties" json:"min_properties,omitempty"` + Required []string `protobuf:"bytes,19,rep,name=required" json:"required,omitempty"` + Enum []*Any `protobuf:"bytes,20,rep,name=enum" json:"enum,omitempty"` + AdditionalProperties *AdditionalPropertiesItem `protobuf:"bytes,21,opt,name=additional_properties,json=additionalProperties" json:"additional_properties,omitempty"` + Type *TypeItem `protobuf:"bytes,22,opt,name=type" json:"type,omitempty"` + Items *ItemsItem `protobuf:"bytes,23,opt,name=items" json:"items,omitempty"` + AllOf []*Schema `protobuf:"bytes,24,rep,name=all_of,json=allOf" json:"all_of,omitempty"` + Properties *Properties `protobuf:"bytes,25,opt,name=properties" json:"properties,omitempty"` + Discriminator string `protobuf:"bytes,26,opt,name=discriminator" json:"discriminator,omitempty"` + ReadOnly bool `protobuf:"varint,27,opt,name=read_only,json=readOnly" json:"read_only,omitempty"` + Xml *Xml `protobuf:"bytes,28,opt,name=xml" json:"xml,omitempty"` + ExternalDocs *ExternalDocs `protobuf:"bytes,29,opt,name=external_docs,json=externalDocs" json:"external_docs,omitempty"` + Example *Any `protobuf:"bytes,30,opt,name=example" json:"example,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,31,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` +} + +func (m *Schema) Reset() { *m = Schema{} } +func (m *Schema) String() string { return proto.CompactTextString(m) } +func (*Schema) ProtoMessage() {} +func (*Schema) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{50} } func (m *Schema) GetXRef() string { if m != nil { @@ -4406,51 +3651,26 @@ type SchemaItem struct { // Types that are valid to be assigned to Oneof: // *SchemaItem_Schema // *SchemaItem_FileSchema - Oneof isSchemaItem_Oneof `protobuf_oneof:"oneof"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Oneof isSchemaItem_Oneof `protobuf_oneof:"oneof"` } -func (m *SchemaItem) Reset() { *m = SchemaItem{} } -func (m *SchemaItem) String() string { return proto.CompactTextString(m) } -func (*SchemaItem) ProtoMessage() {} -func (*SchemaItem) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{51} -} - -func (m *SchemaItem) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SchemaItem.Unmarshal(m, b) -} -func (m *SchemaItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SchemaItem.Marshal(b, m, deterministic) -} -func (m *SchemaItem) XXX_Merge(src proto.Message) { - xxx_messageInfo_SchemaItem.Merge(m, src) -} -func (m *SchemaItem) XXX_Size() int { - return xxx_messageInfo_SchemaItem.Size(m) -} -func (m *SchemaItem) XXX_DiscardUnknown() { - xxx_messageInfo_SchemaItem.DiscardUnknown(m) -} - -var xxx_messageInfo_SchemaItem proto.InternalMessageInfo +func (m *SchemaItem) Reset() { *m = SchemaItem{} } +func (m *SchemaItem) String() string { return proto.CompactTextString(m) } +func (*SchemaItem) ProtoMessage() {} +func (*SchemaItem) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{51} } type isSchemaItem_Oneof interface { isSchemaItem_Oneof() } type SchemaItem_Schema struct { - Schema *Schema `protobuf:"bytes,1,opt,name=schema,proto3,oneof"` + Schema *Schema `protobuf:"bytes,1,opt,name=schema,oneof"` } - type SchemaItem_FileSchema struct { - FileSchema *FileSchema `protobuf:"bytes,2,opt,name=file_schema,json=fileSchema,proto3,oneof"` + FileSchema *FileSchema `protobuf:"bytes,2,opt,name=file_schema,json=fileSchema,oneof"` } -func (*SchemaItem_Schema) isSchemaItem_Oneof() {} - +func (*SchemaItem_Schema) isSchemaItem_Oneof() {} func (*SchemaItem_FileSchema) isSchemaItem_Oneof() {} func (m *SchemaItem) GetOneof() isSchemaItem_Oneof { @@ -4474,45 +3694,88 @@ func (m *SchemaItem) GetFileSchema() *FileSchema { return nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*SchemaItem) XXX_OneofWrappers() []interface{} { - return []interface{}{ +// XXX_OneofFuncs is for the internal use of the proto package. +func (*SchemaItem) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _SchemaItem_OneofMarshaler, _SchemaItem_OneofUnmarshaler, _SchemaItem_OneofSizer, []interface{}{ (*SchemaItem_Schema)(nil), (*SchemaItem_FileSchema)(nil), } } -type SecurityDefinitions struct { - AdditionalProperties []*NamedSecurityDefinitionsItem `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SecurityDefinitions) Reset() { *m = SecurityDefinitions{} } -func (m *SecurityDefinitions) String() string { return proto.CompactTextString(m) } -func (*SecurityDefinitions) ProtoMessage() {} -func (*SecurityDefinitions) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{52} +func _SchemaItem_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*SchemaItem) + // oneof + switch x := m.Oneof.(type) { + case *SchemaItem_Schema: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Schema); err != nil { + return err + } + case *SchemaItem_FileSchema: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.FileSchema); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("SchemaItem.Oneof has unexpected type %T", x) + } + return nil +} + +func _SchemaItem_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*SchemaItem) + switch tag { + case 1: // oneof.schema + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Schema) + err := b.DecodeMessage(msg) + m.Oneof = &SchemaItem_Schema{msg} + return true, err + case 2: // oneof.file_schema + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(FileSchema) + err := b.DecodeMessage(msg) + m.Oneof = &SchemaItem_FileSchema{msg} + return true, err + default: + return false, nil + } +} + +func _SchemaItem_OneofSizer(msg proto.Message) (n int) { + m := msg.(*SchemaItem) + // oneof + switch x := m.Oneof.(type) { + case *SchemaItem_Schema: + s := proto.Size(x.Schema) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *SchemaItem_FileSchema: + s := proto.Size(x.FileSchema) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n } -func (m *SecurityDefinitions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SecurityDefinitions.Unmarshal(m, b) -} -func (m *SecurityDefinitions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SecurityDefinitions.Marshal(b, m, deterministic) -} -func (m *SecurityDefinitions) XXX_Merge(src proto.Message) { - xxx_messageInfo_SecurityDefinitions.Merge(m, src) -} -func (m *SecurityDefinitions) XXX_Size() int { - return xxx_messageInfo_SecurityDefinitions.Size(m) -} -func (m *SecurityDefinitions) XXX_DiscardUnknown() { - xxx_messageInfo_SecurityDefinitions.DiscardUnknown(m) +type SecurityDefinitions struct { + AdditionalProperties []*NamedSecurityDefinitionsItem `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties" json:"additional_properties,omitempty"` } -var xxx_messageInfo_SecurityDefinitions proto.InternalMessageInfo +func (m *SecurityDefinitions) Reset() { *m = SecurityDefinitions{} } +func (m *SecurityDefinitions) String() string { return proto.CompactTextString(m) } +func (*SecurityDefinitions) ProtoMessage() {} +func (*SecurityDefinitions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{52} } func (m *SecurityDefinitions) GetAdditionalProperties() []*NamedSecurityDefinitionsItem { if m != nil { @@ -4529,76 +3792,43 @@ type SecurityDefinitionsItem struct { // *SecurityDefinitionsItem_Oauth2PasswordSecurity // *SecurityDefinitionsItem_Oauth2ApplicationSecurity // *SecurityDefinitionsItem_Oauth2AccessCodeSecurity - Oneof isSecurityDefinitionsItem_Oneof `protobuf_oneof:"oneof"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SecurityDefinitionsItem) Reset() { *m = SecurityDefinitionsItem{} } -func (m *SecurityDefinitionsItem) String() string { return proto.CompactTextString(m) } -func (*SecurityDefinitionsItem) ProtoMessage() {} -func (*SecurityDefinitionsItem) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{53} + Oneof isSecurityDefinitionsItem_Oneof `protobuf_oneof:"oneof"` } -func (m *SecurityDefinitionsItem) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SecurityDefinitionsItem.Unmarshal(m, b) -} -func (m *SecurityDefinitionsItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SecurityDefinitionsItem.Marshal(b, m, deterministic) -} -func (m *SecurityDefinitionsItem) XXX_Merge(src proto.Message) { - xxx_messageInfo_SecurityDefinitionsItem.Merge(m, src) -} -func (m *SecurityDefinitionsItem) XXX_Size() int { - return xxx_messageInfo_SecurityDefinitionsItem.Size(m) -} -func (m *SecurityDefinitionsItem) XXX_DiscardUnknown() { - xxx_messageInfo_SecurityDefinitionsItem.DiscardUnknown(m) -} - -var xxx_messageInfo_SecurityDefinitionsItem proto.InternalMessageInfo +func (m *SecurityDefinitionsItem) Reset() { *m = SecurityDefinitionsItem{} } +func (m *SecurityDefinitionsItem) String() string { return proto.CompactTextString(m) } +func (*SecurityDefinitionsItem) ProtoMessage() {} +func (*SecurityDefinitionsItem) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{53} } type isSecurityDefinitionsItem_Oneof interface { isSecurityDefinitionsItem_Oneof() } type SecurityDefinitionsItem_BasicAuthenticationSecurity struct { - BasicAuthenticationSecurity *BasicAuthenticationSecurity `protobuf:"bytes,1,opt,name=basic_authentication_security,json=basicAuthenticationSecurity,proto3,oneof"` + BasicAuthenticationSecurity *BasicAuthenticationSecurity `protobuf:"bytes,1,opt,name=basic_authentication_security,json=basicAuthenticationSecurity,oneof"` } - type SecurityDefinitionsItem_ApiKeySecurity struct { - ApiKeySecurity *ApiKeySecurity `protobuf:"bytes,2,opt,name=api_key_security,json=apiKeySecurity,proto3,oneof"` + ApiKeySecurity *ApiKeySecurity `protobuf:"bytes,2,opt,name=api_key_security,json=apiKeySecurity,oneof"` } - type SecurityDefinitionsItem_Oauth2ImplicitSecurity struct { - Oauth2ImplicitSecurity *Oauth2ImplicitSecurity `protobuf:"bytes,3,opt,name=oauth2_implicit_security,json=oauth2ImplicitSecurity,proto3,oneof"` + Oauth2ImplicitSecurity *Oauth2ImplicitSecurity `protobuf:"bytes,3,opt,name=oauth2_implicit_security,json=oauth2ImplicitSecurity,oneof"` } - type SecurityDefinitionsItem_Oauth2PasswordSecurity struct { - Oauth2PasswordSecurity *Oauth2PasswordSecurity `protobuf:"bytes,4,opt,name=oauth2_password_security,json=oauth2PasswordSecurity,proto3,oneof"` + Oauth2PasswordSecurity *Oauth2PasswordSecurity `protobuf:"bytes,4,opt,name=oauth2_password_security,json=oauth2PasswordSecurity,oneof"` } - type SecurityDefinitionsItem_Oauth2ApplicationSecurity struct { - Oauth2ApplicationSecurity *Oauth2ApplicationSecurity `protobuf:"bytes,5,opt,name=oauth2_application_security,json=oauth2ApplicationSecurity,proto3,oneof"` + Oauth2ApplicationSecurity *Oauth2ApplicationSecurity `protobuf:"bytes,5,opt,name=oauth2_application_security,json=oauth2ApplicationSecurity,oneof"` } - type SecurityDefinitionsItem_Oauth2AccessCodeSecurity struct { - Oauth2AccessCodeSecurity *Oauth2AccessCodeSecurity `protobuf:"bytes,6,opt,name=oauth2_access_code_security,json=oauth2AccessCodeSecurity,proto3,oneof"` + Oauth2AccessCodeSecurity *Oauth2AccessCodeSecurity `protobuf:"bytes,6,opt,name=oauth2_access_code_security,json=oauth2AccessCodeSecurity,oneof"` } func (*SecurityDefinitionsItem_BasicAuthenticationSecurity) isSecurityDefinitionsItem_Oneof() {} - -func (*SecurityDefinitionsItem_ApiKeySecurity) isSecurityDefinitionsItem_Oneof() {} - -func (*SecurityDefinitionsItem_Oauth2ImplicitSecurity) isSecurityDefinitionsItem_Oneof() {} - -func (*SecurityDefinitionsItem_Oauth2PasswordSecurity) isSecurityDefinitionsItem_Oneof() {} - -func (*SecurityDefinitionsItem_Oauth2ApplicationSecurity) isSecurityDefinitionsItem_Oneof() {} - -func (*SecurityDefinitionsItem_Oauth2AccessCodeSecurity) isSecurityDefinitionsItem_Oneof() {} +func (*SecurityDefinitionsItem_ApiKeySecurity) isSecurityDefinitionsItem_Oneof() {} +func (*SecurityDefinitionsItem_Oauth2ImplicitSecurity) isSecurityDefinitionsItem_Oneof() {} +func (*SecurityDefinitionsItem_Oauth2PasswordSecurity) isSecurityDefinitionsItem_Oneof() {} +func (*SecurityDefinitionsItem_Oauth2ApplicationSecurity) isSecurityDefinitionsItem_Oneof() {} +func (*SecurityDefinitionsItem_Oauth2AccessCodeSecurity) isSecurityDefinitionsItem_Oneof() {} func (m *SecurityDefinitionsItem) GetOneof() isSecurityDefinitionsItem_Oneof { if m != nil { @@ -4649,9 +3879,9 @@ func (m *SecurityDefinitionsItem) GetOauth2AccessCodeSecurity() *Oauth2AccessCod return nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*SecurityDefinitionsItem) XXX_OneofWrappers() []interface{} { - return []interface{}{ +// XXX_OneofFuncs is for the internal use of the proto package. +func (*SecurityDefinitionsItem) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _SecurityDefinitionsItem_OneofMarshaler, _SecurityDefinitionsItem_OneofUnmarshaler, _SecurityDefinitionsItem_OneofSizer, []interface{}{ (*SecurityDefinitionsItem_BasicAuthenticationSecurity)(nil), (*SecurityDefinitionsItem_ApiKeySecurity)(nil), (*SecurityDefinitionsItem_Oauth2ImplicitSecurity)(nil), @@ -4661,37 +3891,152 @@ func (*SecurityDefinitionsItem) XXX_OneofWrappers() []interface{} { } } -type SecurityRequirement struct { - AdditionalProperties []*NamedStringArray `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SecurityRequirement) Reset() { *m = SecurityRequirement{} } -func (m *SecurityRequirement) String() string { return proto.CompactTextString(m) } -func (*SecurityRequirement) ProtoMessage() {} -func (*SecurityRequirement) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{54} +func _SecurityDefinitionsItem_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*SecurityDefinitionsItem) + // oneof + switch x := m.Oneof.(type) { + case *SecurityDefinitionsItem_BasicAuthenticationSecurity: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BasicAuthenticationSecurity); err != nil { + return err + } + case *SecurityDefinitionsItem_ApiKeySecurity: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ApiKeySecurity); err != nil { + return err + } + case *SecurityDefinitionsItem_Oauth2ImplicitSecurity: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Oauth2ImplicitSecurity); err != nil { + return err + } + case *SecurityDefinitionsItem_Oauth2PasswordSecurity: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Oauth2PasswordSecurity); err != nil { + return err + } + case *SecurityDefinitionsItem_Oauth2ApplicationSecurity: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Oauth2ApplicationSecurity); err != nil { + return err + } + case *SecurityDefinitionsItem_Oauth2AccessCodeSecurity: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Oauth2AccessCodeSecurity); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("SecurityDefinitionsItem.Oneof has unexpected type %T", x) + } + return nil +} + +func _SecurityDefinitionsItem_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*SecurityDefinitionsItem) + switch tag { + case 1: // oneof.basic_authentication_security + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BasicAuthenticationSecurity) + err := b.DecodeMessage(msg) + m.Oneof = &SecurityDefinitionsItem_BasicAuthenticationSecurity{msg} + return true, err + case 2: // oneof.api_key_security + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ApiKeySecurity) + err := b.DecodeMessage(msg) + m.Oneof = &SecurityDefinitionsItem_ApiKeySecurity{msg} + return true, err + case 3: // oneof.oauth2_implicit_security + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Oauth2ImplicitSecurity) + err := b.DecodeMessage(msg) + m.Oneof = &SecurityDefinitionsItem_Oauth2ImplicitSecurity{msg} + return true, err + case 4: // oneof.oauth2_password_security + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Oauth2PasswordSecurity) + err := b.DecodeMessage(msg) + m.Oneof = &SecurityDefinitionsItem_Oauth2PasswordSecurity{msg} + return true, err + case 5: // oneof.oauth2_application_security + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Oauth2ApplicationSecurity) + err := b.DecodeMessage(msg) + m.Oneof = &SecurityDefinitionsItem_Oauth2ApplicationSecurity{msg} + return true, err + case 6: // oneof.oauth2_access_code_security + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Oauth2AccessCodeSecurity) + err := b.DecodeMessage(msg) + m.Oneof = &SecurityDefinitionsItem_Oauth2AccessCodeSecurity{msg} + return true, err + default: + return false, nil + } +} + +func _SecurityDefinitionsItem_OneofSizer(msg proto.Message) (n int) { + m := msg.(*SecurityDefinitionsItem) + // oneof + switch x := m.Oneof.(type) { + case *SecurityDefinitionsItem_BasicAuthenticationSecurity: + s := proto.Size(x.BasicAuthenticationSecurity) + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *SecurityDefinitionsItem_ApiKeySecurity: + s := proto.Size(x.ApiKeySecurity) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *SecurityDefinitionsItem_Oauth2ImplicitSecurity: + s := proto.Size(x.Oauth2ImplicitSecurity) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *SecurityDefinitionsItem_Oauth2PasswordSecurity: + s := proto.Size(x.Oauth2PasswordSecurity) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *SecurityDefinitionsItem_Oauth2ApplicationSecurity: + s := proto.Size(x.Oauth2ApplicationSecurity) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *SecurityDefinitionsItem_Oauth2AccessCodeSecurity: + s := proto.Size(x.Oauth2AccessCodeSecurity) + n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n } -func (m *SecurityRequirement) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SecurityRequirement.Unmarshal(m, b) -} -func (m *SecurityRequirement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SecurityRequirement.Marshal(b, m, deterministic) -} -func (m *SecurityRequirement) XXX_Merge(src proto.Message) { - xxx_messageInfo_SecurityRequirement.Merge(m, src) -} -func (m *SecurityRequirement) XXX_Size() int { - return xxx_messageInfo_SecurityRequirement.Size(m) -} -func (m *SecurityRequirement) XXX_DiscardUnknown() { - xxx_messageInfo_SecurityRequirement.DiscardUnknown(m) +type SecurityRequirement struct { + AdditionalProperties []*NamedStringArray `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties" json:"additional_properties,omitempty"` } -var xxx_messageInfo_SecurityRequirement proto.InternalMessageInfo +func (m *SecurityRequirement) Reset() { *m = SecurityRequirement{} } +func (m *SecurityRequirement) String() string { return proto.CompactTextString(m) } +func (*SecurityRequirement) ProtoMessage() {} +func (*SecurityRequirement) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{54} } func (m *SecurityRequirement) GetAdditionalProperties() []*NamedStringArray { if m != nil { @@ -4701,36 +4046,13 @@ func (m *SecurityRequirement) GetAdditionalProperties() []*NamedStringArray { } type StringArray struct { - Value []string `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StringArray) Reset() { *m = StringArray{} } -func (m *StringArray) String() string { return proto.CompactTextString(m) } -func (*StringArray) ProtoMessage() {} -func (*StringArray) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{55} -} - -func (m *StringArray) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StringArray.Unmarshal(m, b) -} -func (m *StringArray) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StringArray.Marshal(b, m, deterministic) -} -func (m *StringArray) XXX_Merge(src proto.Message) { - xxx_messageInfo_StringArray.Merge(m, src) -} -func (m *StringArray) XXX_Size() int { - return xxx_messageInfo_StringArray.Size(m) -} -func (m *StringArray) XXX_DiscardUnknown() { - xxx_messageInfo_StringArray.DiscardUnknown(m) + Value []string `protobuf:"bytes,1,rep,name=value" json:"value,omitempty"` } -var xxx_messageInfo_StringArray proto.InternalMessageInfo +func (m *StringArray) Reset() { *m = StringArray{} } +func (m *StringArray) String() string { return proto.CompactTextString(m) } +func (*StringArray) ProtoMessage() {} +func (*StringArray) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{55} } func (m *StringArray) GetValue() []string { if m != nil { @@ -4740,39 +4062,16 @@ func (m *StringArray) GetValue() []string { } type Tag struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - ExternalDocs *ExternalDocs `protobuf:"bytes,3,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,4,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` + ExternalDocs *ExternalDocs `protobuf:"bytes,3,opt,name=external_docs,json=externalDocs" json:"external_docs,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,4,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } -func (m *Tag) Reset() { *m = Tag{} } -func (m *Tag) String() string { return proto.CompactTextString(m) } -func (*Tag) ProtoMessage() {} -func (*Tag) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{56} -} - -func (m *Tag) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Tag.Unmarshal(m, b) -} -func (m *Tag) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Tag.Marshal(b, m, deterministic) -} -func (m *Tag) XXX_Merge(src proto.Message) { - xxx_messageInfo_Tag.Merge(m, src) -} -func (m *Tag) XXX_Size() int { - return xxx_messageInfo_Tag.Size(m) -} -func (m *Tag) XXX_DiscardUnknown() { - xxx_messageInfo_Tag.DiscardUnknown(m) -} - -var xxx_messageInfo_Tag proto.InternalMessageInfo +func (m *Tag) Reset() { *m = Tag{} } +func (m *Tag) String() string { return proto.CompactTextString(m) } +func (*Tag) ProtoMessage() {} +func (*Tag) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{56} } func (m *Tag) GetName() string { if m != nil { @@ -4803,36 +4102,13 @@ func (m *Tag) GetVendorExtension() []*NamedAny { } type TypeItem struct { - Value []string `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TypeItem) Reset() { *m = TypeItem{} } -func (m *TypeItem) String() string { return proto.CompactTextString(m) } -func (*TypeItem) ProtoMessage() {} -func (*TypeItem) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{57} -} - -func (m *TypeItem) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TypeItem.Unmarshal(m, b) -} -func (m *TypeItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TypeItem.Marshal(b, m, deterministic) -} -func (m *TypeItem) XXX_Merge(src proto.Message) { - xxx_messageInfo_TypeItem.Merge(m, src) -} -func (m *TypeItem) XXX_Size() int { - return xxx_messageInfo_TypeItem.Size(m) -} -func (m *TypeItem) XXX_DiscardUnknown() { - xxx_messageInfo_TypeItem.DiscardUnknown(m) + Value []string `protobuf:"bytes,1,rep,name=value" json:"value,omitempty"` } -var xxx_messageInfo_TypeItem proto.InternalMessageInfo +func (m *TypeItem) Reset() { *m = TypeItem{} } +func (m *TypeItem) String() string { return proto.CompactTextString(m) } +func (*TypeItem) ProtoMessage() {} +func (*TypeItem) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{57} } func (m *TypeItem) GetValue() []string { if m != nil { @@ -4843,36 +4119,13 @@ func (m *TypeItem) GetValue() []string { // Any property starting with x- is valid. type VendorExtension struct { - AdditionalProperties []*NamedAny `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VendorExtension) Reset() { *m = VendorExtension{} } -func (m *VendorExtension) String() string { return proto.CompactTextString(m) } -func (*VendorExtension) ProtoMessage() {} -func (*VendorExtension) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{58} + AdditionalProperties []*NamedAny `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties" json:"additional_properties,omitempty"` } -func (m *VendorExtension) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VendorExtension.Unmarshal(m, b) -} -func (m *VendorExtension) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VendorExtension.Marshal(b, m, deterministic) -} -func (m *VendorExtension) XXX_Merge(src proto.Message) { - xxx_messageInfo_VendorExtension.Merge(m, src) -} -func (m *VendorExtension) XXX_Size() int { - return xxx_messageInfo_VendorExtension.Size(m) -} -func (m *VendorExtension) XXX_DiscardUnknown() { - xxx_messageInfo_VendorExtension.DiscardUnknown(m) -} - -var xxx_messageInfo_VendorExtension proto.InternalMessageInfo +func (m *VendorExtension) Reset() { *m = VendorExtension{} } +func (m *VendorExtension) String() string { return proto.CompactTextString(m) } +func (*VendorExtension) ProtoMessage() {} +func (*VendorExtension) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{58} } func (m *VendorExtension) GetAdditionalProperties() []*NamedAny { if m != nil { @@ -4882,41 +4135,18 @@ func (m *VendorExtension) GetAdditionalProperties() []*NamedAny { } type Xml struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` - Prefix string `protobuf:"bytes,3,opt,name=prefix,proto3" json:"prefix,omitempty"` - Attribute bool `protobuf:"varint,4,opt,name=attribute,proto3" json:"attribute,omitempty"` - Wrapped bool `protobuf:"varint,5,opt,name=wrapped,proto3" json:"wrapped,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Xml) Reset() { *m = Xml{} } -func (m *Xml) String() string { return proto.CompactTextString(m) } -func (*Xml) ProtoMessage() {} -func (*Xml) Descriptor() ([]byte, []int) { - return fileDescriptor_336adc04ae589d92, []int{59} -} - -func (m *Xml) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Xml.Unmarshal(m, b) -} -func (m *Xml) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Xml.Marshal(b, m, deterministic) -} -func (m *Xml) XXX_Merge(src proto.Message) { - xxx_messageInfo_Xml.Merge(m, src) -} -func (m *Xml) XXX_Size() int { - return xxx_messageInfo_Xml.Size(m) -} -func (m *Xml) XXX_DiscardUnknown() { - xxx_messageInfo_Xml.DiscardUnknown(m) + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace" json:"namespace,omitempty"` + Prefix string `protobuf:"bytes,3,opt,name=prefix" json:"prefix,omitempty"` + Attribute bool `protobuf:"varint,4,opt,name=attribute" json:"attribute,omitempty"` + Wrapped bool `protobuf:"varint,5,opt,name=wrapped" json:"wrapped,omitempty"` + VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } -var xxx_messageInfo_Xml proto.InternalMessageInfo +func (m *Xml) Reset() { *m = Xml{} } +func (m *Xml) String() string { return proto.CompactTextString(m) } +func (*Xml) ProtoMessage() {} +func (*Xml) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{59} } func (m *Xml) GetName() string { if m != nil { @@ -5023,203 +4253,204 @@ func init() { proto.RegisterType((*Xml)(nil), "openapi.v2.Xml") } -func init() { proto.RegisterFile("OpenAPIv2/OpenAPIv2.proto", fileDescriptor_336adc04ae589d92) } - -var fileDescriptor_336adc04ae589d92 = []byte{ - // 3108 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xec, 0x1b, 0x4d, 0x73, 0x1c, 0x57, - 0x31, 0xab, 0xfd, 0xee, 0xd5, 0xae, 0x56, 0x23, 0x59, 0x5e, 0x49, 0x8e, 0xe3, 0x28, 0x5f, 0x8e, - 0x43, 0xe4, 0xa0, 0x14, 0xa4, 0x02, 0x45, 0x81, 0x1c, 0xdb, 0x15, 0x13, 0x13, 0x29, 0x23, 0x27, - 0x10, 0x08, 0x4c, 0x8d, 0x76, 0xdf, 0x4a, 0x93, 0xec, 0xce, 0xac, 0x67, 0x66, 0x65, 0x89, 0x03, - 0x07, 0xa8, 0xe2, 0x0c, 0x54, 0xce, 0x54, 0xc1, 0x81, 0xa2, 0x2a, 0x07, 0x4e, 0x9c, 0xf8, 0x03, - 0xdc, 0xf8, 0x07, 0x9c, 0xe1, 0x4a, 0x15, 0x27, 0x8a, 0x8f, 0x7e, 0x5f, 0xf3, 0xf9, 0x66, 0x76, - 0xc7, 0x72, 0x01, 0x05, 0x3a, 0xed, 0xce, 0xeb, 0x7e, 0xfd, 0xfa, 0xf5, 0x74, 0xf7, 0xeb, 0x8f, - 0x37, 0xb0, 0xbe, 0x37, 0x21, 0xf6, 0xee, 0xfe, 0xbd, 0x93, 0x9d, 0x9b, 0xc1, 0xbf, 0xed, 0x89, - 0xeb, 0xf8, 0x8e, 0x06, 0x0e, 0x0e, 0x98, 0x13, 0x6b, 0xfb, 0x64, 0x67, 0x63, 0xfd, 0xc8, 0x71, - 0x8e, 0x46, 0xe4, 0x26, 0x83, 0x1c, 0x4e, 0x87, 0x37, 0x4d, 0xfb, 0x8c, 0xa3, 0x6d, 0x8d, 0xa1, - 0xb7, 0x3b, 0x18, 0x58, 0xbe, 0xe5, 0xd8, 0xe6, 0x68, 0xdf, 0xc5, 0x49, 0xae, 0x6f, 0x11, 0xef, - 0x9e, 0x4f, 0xc6, 0xda, 0xe7, 0xa0, 0xe6, 0xf5, 0x8f, 0xc9, 0xd8, 0xec, 0x95, 0xae, 0x95, 0xae, - 0xb7, 0x76, 0xb4, 0xed, 0x90, 0xe6, 0xf6, 0x01, 0x83, 0xbc, 0xfd, 0x94, 0x2e, 0x70, 0xb4, 0x0d, - 0xa8, 0x1f, 0x3a, 0xce, 0x88, 0x98, 0x76, 0x6f, 0x01, 0xd1, 0x1b, 0x08, 0x92, 0x03, 0xb7, 0xea, - 0x50, 0x75, 0x6c, 0xe2, 0x0c, 0xb7, 0xee, 0x40, 0x79, 0xd7, 0x3e, 0xd3, 0x6e, 0x40, 0xf5, 0xc4, - 0x1c, 0x4d, 0x89, 0x20, 0xbc, 0xba, 0xcd, 0x19, 0xdc, 0x96, 0x0c, 0x6e, 0x23, 0x92, 0xce, 0x51, - 0x34, 0x0d, 0x2a, 0x67, 0xe6, 0x78, 0xc4, 0x88, 0x36, 0x75, 0xf6, 0x7f, 0xeb, 0xb3, 0x12, 0x74, - 0x76, 0x27, 0xd6, 0x3b, 0xe4, 0xec, 0x80, 0xf4, 0xa7, 0xae, 0xe5, 0x9f, 0x51, 0x34, 0xff, 0x6c, - 0xc2, 0x29, 0x22, 0x1a, 0xfd, 0x4f, 0xc7, 0x6c, 0x73, 0x4c, 0xe4, 0x54, 0xfa, 0x5f, 0xeb, 0xc0, - 0x82, 0x65, 0xf7, 0xca, 0x6c, 0x04, 0xff, 0x69, 0xd7, 0xa0, 0x35, 0x20, 0x5e, 0xdf, 0xb5, 0x26, - 0x54, 0x06, 0xbd, 0x0a, 0x03, 0x44, 0x87, 0xb4, 0xaf, 0x42, 0xf7, 0x84, 0xd8, 0x03, 0xc7, 0x35, - 0xc8, 0xa9, 0x4f, 0x6c, 0x8f, 0xa2, 0x55, 0xaf, 0x95, 0x19, 0xdf, 0x11, 0x81, 0xbc, 0x8b, 0xd4, - 0x07, 0x94, 0xef, 0x25, 0x8e, 0x7d, 0x47, 0x22, 0x6f, 0x7d, 0x5a, 0x82, 0xcd, 0x5b, 0xa6, 0x67, - 0xf5, 0x77, 0xa7, 0xfe, 0x31, 0xb1, 0x7d, 0xab, 0x6f, 0x52, 0xc2, 0xb9, 0xac, 0x27, 0xd8, 0x5a, - 0x98, 0x8f, 0xad, 0x72, 0x11, 0xb6, 0xfe, 0x58, 0x82, 0xf6, 0x2d, 0x67, 0x70, 0xb6, 0x6f, 0xba, - 0x88, 0xe3, 0x13, 0x37, 0xb9, 0x68, 0x29, 0xbd, 0xe8, 0x3c, 0x12, 0xdd, 0x80, 0x86, 0x4b, 0x1e, - 0x4e, 0x2d, 0x97, 0x0c, 0x98, 0x38, 0x1b, 0x7a, 0xf0, 0x8c, 0x2f, 0x5e, 0xaa, 0x54, 0x35, 0x4b, - 0xa5, 0x02, 0x85, 0x52, 0x6d, 0xb0, 0x56, 0x64, 0x83, 0x3f, 0x2e, 0x41, 0xfd, 0x2d, 0xc7, 0xf6, - 0xcd, 0xbe, 0x1f, 0x30, 0x5e, 0x8a, 0x30, 0xde, 0x85, 0xf2, 0xd4, 0x95, 0x8a, 0x45, 0xff, 0x6a, - 0xab, 0x50, 0xc5, 0x95, 0xad, 0x91, 0xd8, 0x0d, 0x7f, 0x50, 0x32, 0x52, 0x29, 0xc2, 0xc8, 0x03, - 0xa8, 0xdf, 0x26, 0x43, 0x73, 0x3a, 0xf2, 0xb5, 0x7b, 0x70, 0xc9, 0x0c, 0xec, 0xcd, 0x98, 0x04, - 0x06, 0x87, 0x8c, 0x65, 0x13, 0x5c, 0x35, 0x15, 0x26, 0xba, 0xf5, 0x1d, 0x68, 0x21, 0x55, 0xcb, - 0x66, 0x10, 0x4f, 0xbb, 0x9f, 0x4f, 0xf9, 0x72, 0x8a, 0xb2, 0x10, 0xb7, 0x9a, 0xf8, 0x9f, 0xaa, - 0xd0, 0xb8, 0xed, 0xf4, 0xa7, 0x63, 0xd4, 0x57, 0xad, 0x07, 0x75, 0xef, 0x91, 0x79, 0x74, 0x44, - 0x5c, 0x21, 0x3f, 0xf9, 0xa8, 0x3d, 0x0f, 0x15, 0xcb, 0x1e, 0x3a, 0x4c, 0x86, 0xad, 0x9d, 0x6e, - 0x74, 0x8d, 0x7b, 0x38, 0xae, 0x33, 0x28, 0x15, 0xfe, 0xb1, 0xe3, 0xf9, 0x42, 0xaa, 0xec, 0xbf, - 0xb6, 0x09, 0xcd, 0x43, 0xd3, 0x23, 0xc6, 0xc4, 0xf4, 0x8f, 0x85, 0xd5, 0x35, 0xe8, 0xc0, 0x3e, - 0x3e, 0xb3, 0x05, 0x29, 0x77, 0xc8, 0x3d, 0xb5, 0x34, 0xba, 0x20, 0x7f, 0xa4, 0xca, 0xd5, 0xc7, - 0xdd, 0x4e, 0x29, 0xa8, 0xc6, 0x40, 0xc1, 0x33, 0x85, 0xe1, 0xb6, 0x07, 0xd3, 0x3e, 0xc2, 0xea, - 0x1c, 0x26, 0x9f, 0xb5, 0x97, 0xa0, 0x4a, 0x57, 0xf2, 0x7a, 0x0d, 0xc6, 0xe9, 0x72, 0x94, 0x53, - 0xba, 0xa4, 0xa7, 0x73, 0xb8, 0xf6, 0x26, 0xb5, 0x81, 0x40, 0xaa, 0xbd, 0x26, 0x43, 0x8f, 0x09, - 0x2f, 0x22, 0x74, 0x3d, 0x8a, 0xab, 0x7d, 0x0d, 0x60, 0x22, 0x6d, 0xc9, 0xeb, 0x01, 0x9b, 0x79, - 0x2d, 0xbe, 0x90, 0x80, 0x46, 0x49, 0x44, 0xe6, 0x68, 0x5f, 0x81, 0xa6, 0x4b, 0xbc, 0x09, 0x0e, - 0xe3, 0x16, 0x5a, 0x8c, 0xc0, 0x33, 0x51, 0x02, 0xba, 0x00, 0x46, 0xe7, 0x87, 0x33, 0xb4, 0x2f, - 0x43, 0xc3, 0x13, 0x4e, 0xa5, 0xb7, 0xc8, 0xde, 0x7a, 0x6c, 0xb6, 0x74, 0x38, 0x3a, 0xb7, 0x46, - 0xfa, 0x6a, 0xf5, 0x60, 0x82, 0xa6, 0xc3, 0xaa, 0xfc, 0x6f, 0x44, 0x25, 0xd0, 0x4e, 0xb3, 0x21, - 0x09, 0x45, 0xd9, 0x58, 0xf1, 0xd2, 0x83, 0xda, 0x73, 0xe8, 0xd9, 0xcc, 0x23, 0xaf, 0xd7, 0x61, - 0xcc, 0x2c, 0x45, 0x69, 0x3c, 0x30, 0x8f, 0x74, 0x06, 0xc4, 0x4d, 0xb7, 0xa9, 0x5d, 0xb9, 0x54, - 0x6d, 0x07, 0x4e, 0xdf, 0xeb, 0x2d, 0xb1, 0x15, 0x7b, 0x51, 0xec, 0x3b, 0x02, 0x01, 0x55, 0xd2, - 0xd3, 0x17, 0x49, 0xe4, 0x49, 0x69, 0x9d, 0xdd, 0x22, 0xd6, 0xf9, 0x3e, 0x34, 0xee, 0x9c, 0x9a, - 0xe3, 0xc9, 0x08, 0x25, 0xf8, 0x04, 0xcd, 0xf3, 0x47, 0x25, 0x58, 0x8c, 0xb2, 0x3d, 0x87, 0x77, - 0x4d, 0x3b, 0xa4, 0x73, 0x3b, 0xf9, 0x7f, 0x2e, 0x00, 0xdc, 0xb5, 0x46, 0x84, 0x1b, 0xbb, 0xb6, - 0x06, 0xb5, 0xa1, 0xe3, 0x8e, 0x4d, 0x5f, 0x2c, 0x2f, 0x9e, 0xa8, 0xe3, 0xf3, 0x2d, 0x7f, 0x24, - 0x1d, 0x3b, 0x7f, 0x48, 0x72, 0x5c, 0x4e, 0x73, 0xfc, 0x32, 0xd4, 0x07, 0xdc, 0xb3, 0x31, 0x1b, - 0x4e, 0xbc, 0x63, 0xca, 0x91, 0x84, 0xc7, 0x8e, 0x05, 0x6e, 0xd4, 0xe1, 0xb1, 0x20, 0x4f, 0xc0, - 0x5a, 0xe4, 0x04, 0xdc, 0xa4, 0xb6, 0x60, 0x0e, 0x0c, 0xc7, 0x1e, 0x9d, 0xa1, 0x39, 0x8b, 0x73, - 0xc4, 0x1c, 0xec, 0xe1, 0x73, 0x5a, 0x67, 0x1a, 0x85, 0x74, 0x06, 0xd9, 0x26, 0xfc, 0x95, 0x0b, - 0x03, 0x4f, 0xb3, 0x2d, 0xe0, 0xca, 0x37, 0x00, 0x45, 0xde, 0xc0, 0x67, 0x35, 0xd8, 0xb8, 0x8b, - 0x52, 0xbe, 0x6d, 0xfa, 0x66, 0xe0, 0x00, 0x0e, 0xa6, 0x87, 0x07, 0x32, 0x6c, 0x0a, 0xc5, 0x52, - 0x4a, 0x9c, 0x96, 0xfc, 0x64, 0x5d, 0xc8, 0x8a, 0x55, 0xca, 0xd9, 0xe7, 0x73, 0x25, 0x72, 0xcc, - 0xdd, 0x80, 0x65, 0x73, 0x34, 0x72, 0x1e, 0x19, 0x64, 0x3c, 0x41, 0xdb, 0xe6, 0x81, 0x57, 0x95, - 0x2d, 0xb5, 0xc4, 0x00, 0x77, 0xe8, 0xf8, 0x07, 0x32, 0xd8, 0x4a, 0xbd, 0x88, 0x50, 0x67, 0xea, - 0x31, 0x9d, 0xf9, 0x3c, 0x54, 0x2d, 0x0c, 0x13, 0xa5, 0xec, 0x37, 0x63, 0x9e, 0xce, 0xb5, 0xc6, - 0x68, 0x12, 0x27, 0x3c, 0x92, 0x44, 0xe7, 0xca, 0x30, 0xb5, 0x57, 0x60, 0xb9, 0xef, 0x8c, 0x46, - 0xa4, 0x4f, 0x99, 0x35, 0x04, 0xd5, 0x26, 0xa3, 0xda, 0x0d, 0x01, 0x77, 0x39, 0xfd, 0x88, 0x6e, - 0xc1, 0x0c, 0xdd, 0xc2, 0xf3, 0x62, 0x6c, 0x9e, 0x5a, 0xe3, 0xe9, 0x98, 0x79, 0xcd, 0x92, 0x2e, - 0x1f, 0xe9, 0x8a, 0xe4, 0xb4, 0x3f, 0x9a, 0x7a, 0xc8, 0x8b, 0x21, 0x71, 0x16, 0xd9, 0xe6, 0xbb, - 0x01, 0xe0, 0x1b, 0x02, 0x99, 0x92, 0x41, 0xdf, 0x45, 0x51, 0xda, 0x82, 0x0c, 0x7f, 0x4c, 0x90, - 0x11, 0x38, 0x9d, 0x24, 0x19, 0x81, 0xfc, 0x34, 0x00, 0xae, 0x64, 0x8c, 0x88, 0x7d, 0x84, 0x67, - 0x1b, 0xf5, 0x66, 0x65, 0xbd, 0x89, 0x23, 0xf7, 0xd9, 0x00, 0x03, 0x5b, 0xb6, 0x04, 0x77, 0x05, - 0xd8, 0xb2, 0x05, 0x18, 0x99, 0xc0, 0x93, 0x88, 0x2a, 0x6b, 0x6f, 0x99, 0x1f, 0xb6, 0xe2, 0x91, - 0x5a, 0x04, 0xa5, 0xcb, 0x85, 0xae, 0xb1, 0x79, 0x0d, 0x1c, 0x60, 0x12, 0x66, 0x40, 0xa4, 0xca, - 0x81, 0x2b, 0x02, 0x68, 0xd9, 0x1c, 0xf8, 0x2c, 0x2c, 0x4e, 0x6d, 0xeb, 0xe1, 0x94, 0x08, 0xf8, - 0x2a, 0xe3, 0xbc, 0xc5, 0xc7, 0x38, 0x0a, 0xba, 0x6a, 0x62, 0xe3, 0xa6, 0x2e, 0xa5, 0x5d, 0x35, - 0x15, 0x35, 0x03, 0x6a, 0xcf, 0x40, 0x6b, 0x8c, 0xf2, 0xb6, 0xd0, 0x30, 0x0c, 0x67, 0xd8, 0x5b, - 0x63, 0x42, 0x02, 0x39, 0xb4, 0x37, 0x54, 0x5a, 0xcb, 0xe5, 0x42, 0xd6, 0x52, 0x85, 0xda, 0xdb, - 0x68, 0xe5, 0x18, 0x5b, 0xa8, 0xc2, 0xe2, 0x50, 0x17, 0x17, 0xd4, 0xba, 0x58, 0x3e, 0x9f, 0x2e, - 0x56, 0x66, 0xeb, 0x62, 0x75, 0x7e, 0x5d, 0xac, 0xcd, 0xa1, 0x8b, 0xf5, 0xd9, 0xba, 0xd8, 0x98, - 0x43, 0x17, 0x9b, 0x73, 0xe9, 0x22, 0xe4, 0xeb, 0x62, 0x2b, 0x47, 0x17, 0x17, 0x73, 0x74, 0xb1, - 0x9d, 0xa7, 0x8b, 0x9d, 0x19, 0xba, 0xb8, 0x94, 0xad, 0x8b, 0xdd, 0x02, 0xba, 0xb8, 0x9c, 0xd2, - 0xc5, 0x84, 0xb7, 0xd4, 0xe6, 0x4b, 0xa1, 0x56, 0x8a, 0x68, 0xeb, 0xdf, 0xab, 0xd0, 0xe3, 0xda, - 0xfa, 0x1f, 0xf1, 0xec, 0xd2, 0x42, 0xaa, 0x4a, 0x0b, 0xa9, 0xa9, 0x2d, 0xa4, 0x7e, 0x3e, 0x0b, - 0x69, 0xcc, 0xb6, 0x90, 0xe6, 0xfc, 0x16, 0x02, 0x73, 0x58, 0x48, 0x6b, 0xb6, 0x85, 0x2c, 0xce, - 0x61, 0x21, 0xed, 0xb9, 0x2c, 0xa4, 0x93, 0x6f, 0x21, 0x4b, 0x39, 0x16, 0xd2, 0xcd, 0xb1, 0x90, - 0xe5, 0x3c, 0x0b, 0xd1, 0x66, 0x58, 0xc8, 0x4a, 0xb6, 0x85, 0xac, 0x16, 0xb0, 0x90, 0x4b, 0x73, - 0x79, 0xeb, 0xb5, 0x22, 0xfa, 0xff, 0x4d, 0xa8, 0x73, 0xf5, 0x7f, 0x8c, 0xf4, 0x93, 0x4f, 0xcc, - 0x08, 0x9e, 0x7f, 0xb1, 0x00, 0x15, 0x9a, 0x40, 0x86, 0x81, 0x69, 0x29, 0x1a, 0x98, 0xa2, 0xd4, - 0x4f, 0x70, 0xd1, 0xb0, 0x32, 0x22, 0x1f, 0xe7, 0x30, 0xa4, 0xeb, 0xd0, 0xc5, 0xf7, 0x33, 0xf6, - 0x50, 0x24, 0x86, 0x47, 0xdc, 0x13, 0xab, 0x2f, 0x8d, 0xaa, 0xc3, 0xc6, 0xf7, 0x86, 0x07, 0x7c, - 0x54, 0x7b, 0x15, 0xea, 0x7d, 0x5e, 0x3e, 0x10, 0x4e, 0x7f, 0x25, 0xba, 0x09, 0x51, 0x59, 0xd0, - 0x25, 0x0e, 0x45, 0x1f, 0xe1, 0x34, 0xcc, 0xc4, 0x98, 0xe9, 0x25, 0xd0, 0xef, 0x73, 0x90, 0x2e, - 0x71, 0x94, 0xc2, 0xaf, 0x17, 0x11, 0xfe, 0x1b, 0xd0, 0x64, 0xca, 0xc0, 0x6a, 0x75, 0x37, 0x22, - 0xb5, 0xba, 0x72, 0x7e, 0x61, 0x65, 0xeb, 0x36, 0xb4, 0xbf, 0xee, 0x39, 0xb6, 0x4e, 0x86, 0xc4, - 0x25, 0x36, 0x6e, 0x74, 0x19, 0x2a, 0x86, 0x4b, 0x86, 0x42, 0xc6, 0x65, 0x04, 0xcc, 0xae, 0x3f, - 0x6d, 0x4d, 0xa0, 0x2e, 0xf6, 0x34, 0x67, 0x71, 0xe5, 0xdc, 0xb9, 0xcc, 0x1d, 0x68, 0x48, 0xa0, - 0x72, 0xc9, 0x17, 0x64, 0x55, 0x71, 0x41, 0xed, 0x80, 0x38, 0x74, 0xeb, 0x1d, 0x68, 0x45, 0x14, - 0x50, 0x49, 0xe9, 0x7a, 0x9c, 0x52, 0x4c, 0x98, 0x42, 0x6f, 0x05, 0xb1, 0xf7, 0xa0, 0xc3, 0x88, - 0x85, 0x45, 0x34, 0x15, 0xbd, 0x57, 0xe2, 0xf4, 0x2e, 0x29, 0x8b, 0x02, 0x92, 0xe4, 0x1e, 0xb4, - 0x05, 0x49, 0xff, 0x98, 0xbd, 0x5b, 0x15, 0xc5, 0x1b, 0x71, 0x8a, 0xab, 0xc9, 0x7a, 0x06, 0x9d, - 0x98, 0x24, 0x28, 0xab, 0x07, 0x85, 0x09, 0xca, 0x89, 0x92, 0xe0, 0x87, 0xa0, 0xc5, 0x08, 0x06, - 0xb9, 0x43, 0x8a, 0xea, 0xcd, 0x38, 0xd5, 0x75, 0x15, 0x55, 0x36, 0x3b, 0xf9, 0x72, 0xc4, 0x19, - 0x5a, 0xf4, 0xe5, 0x08, 0x4d, 0x17, 0xc4, 0xc6, 0x70, 0x85, 0x13, 0x4b, 0x97, 0x26, 0x32, 0x05, - 0xfb, 0x66, 0x9c, 0xfa, 0x73, 0x33, 0xea, 0x1e, 0x51, 0x39, 0xbf, 0x21, 0x79, 0xf7, 0x5d, 0xcb, - 0x3e, 0x52, 0x52, 0x5f, 0x8d, 0x52, 0x6f, 0xca, 0x89, 0xef, 0x43, 0x37, 0x32, 0x71, 0xd7, 0x75, - 0x4d, 0xb5, 0x82, 0xbf, 0x1a, 0xe7, 0x2d, 0xe6, 0x53, 0x23, 0x73, 0x25, 0xd9, 0xdf, 0x96, 0x91, - 0xae, 0x63, 0xc7, 0x6b, 0xbc, 0x04, 0x36, 0x8f, 0x99, 0x06, 0x1b, 0x41, 0xdd, 0xc9, 0xf0, 0xa6, - 0x87, 0x46, 0xac, 0xd2, 0xff, 0x7c, 0x5a, 0xe1, 0xd3, 0x01, 0xce, 0xdb, 0x4f, 0xe9, 0xbd, 0xe3, - 0xac, 0xe0, 0x67, 0x04, 0x57, 0x69, 0xc0, 0x60, 0x0c, 0x30, 0xeb, 0x55, 0xaf, 0xc4, 0xf7, 0xf0, - 0x62, 0x74, 0xa5, 0xec, 0x34, 0x19, 0xd7, 0xda, 0x18, 0x66, 0x27, 0xd1, 0x87, 0xb0, 0x81, 0x47, - 0xa3, 0x7b, 0xa6, 0x5e, 0xa9, 0x9c, 0x7e, 0x93, 0xef, 0x51, 0x6c, 0xe5, 0x32, 0x97, 0x1f, 0xaa, - 0x41, 0x9a, 0x01, 0xeb, 0xb4, 0x42, 0xa8, 0x5e, 0x82, 0x17, 0x3f, 0xb6, 0x92, 0x56, 0xa8, 0x5c, - 0x61, 0x6d, 0xa2, 0x84, 0x84, 0x4d, 0x12, 0x3c, 0xfc, 0x7a, 0x7b, 0xe6, 0xd4, 0x3f, 0xde, 0xd9, - 0xed, 0xf7, 0x89, 0xe7, 0xbd, 0xe5, 0x0c, 0xc8, 0xac, 0x3e, 0xc7, 0x10, 0xf3, 0x78, 0x59, 0x95, - 0xa7, 0xff, 0xb5, 0xd7, 0xe8, 0x81, 0x80, 0xec, 0xc8, 0x94, 0x28, 0x56, 0x1a, 0xe1, 0xd4, 0x0f, - 0x18, 0x5c, 0x17, 0x78, 0x34, 0x6a, 0xa2, 0xc3, 0x8e, 0x6b, 0x7d, 0x9f, 0xf5, 0x27, 0x0c, 0xea, - 0xbf, 0x45, 0x42, 0x14, 0x03, 0xbc, 0x8f, 0xce, 0x1c, 0x03, 0x18, 0xdf, 0xf9, 0x84, 0x70, 0x24, - 0x1e, 0x7f, 0x36, 0xd8, 0x00, 0x05, 0x26, 0x0e, 0x8f, 0xda, 0x7c, 0x91, 0x77, 0xa1, 0xc3, 0xef, - 0xaf, 0x25, 0x58, 0x17, 0x32, 0x9a, 0x4c, 0x46, 0xf3, 0x74, 0x54, 0x9e, 0x8c, 0x90, 0x62, 0xfb, - 0xae, 0xe4, 0xef, 0xbb, 0x3a, 0xdf, 0xbe, 0x0b, 0xf5, 0x34, 0x7e, 0xb8, 0x00, 0x6b, 0x9c, 0xb1, - 0x7b, 0x63, 0xba, 0x6f, 0xcb, 0xff, 0x6f, 0xd3, 0x8c, 0x7f, 0x83, 0x10, 0xfe, 0x52, 0x92, 0x42, - 0xd8, 0x37, 0x3d, 0xef, 0x91, 0xe3, 0x0e, 0xfe, 0x0f, 0xde, 0xfc, 0x47, 0xb0, 0x18, 0xe5, 0xeb, - 0x31, 0xfa, 0x3d, 0xec, 0x84, 0xc8, 0x08, 0xb8, 0x7f, 0x5e, 0x81, 0xe6, 0x1e, 0x3e, 0x98, 0x32, - 0xd9, 0x64, 0x75, 0xfb, 0x12, 0xab, 0xd3, 0xf2, 0x32, 0x3d, 0xed, 0xc9, 0x4c, 0xc7, 0x63, 0xd3, - 0x3d, 0x93, 0x31, 0xb7, 0x78, 0x9c, 0x23, 0xe6, 0x4e, 0x95, 0x6b, 0x2b, 0x85, 0xca, 0xb5, 0x98, - 0x10, 0x39, 0x92, 0x37, 0xc3, 0x1a, 0x48, 0xf1, 0x06, 0x63, 0xf7, 0x06, 0xb1, 0xde, 0x4f, 0x2d, - 0xd1, 0xfb, 0x89, 0xf6, 0x8c, 0xea, 0x89, 0x9e, 0xd1, 0x97, 0x62, 0x3d, 0x9b, 0x06, 0x13, 0xdd, - 0x86, 0x32, 0x3c, 0xe3, 0x47, 0x7d, 0xb4, 0x5b, 0xf3, 0x7a, 0xb4, 0x5b, 0xd3, 0x4c, 0x47, 0x76, - 0x32, 0xc0, 0x89, 0xf5, 0x68, 0x22, 0xad, 0x2d, 0x88, 0xb7, 0xb6, 0xae, 0x02, 0x0c, 0xc8, 0xc4, - 0x25, 0xe8, 0xcb, 0xc8, 0x40, 0x64, 0xbd, 0x91, 0x91, 0xf3, 0x75, 0x77, 0x54, 0xea, 0xd7, 0x2e, - 0xa2, 0x7e, 0xbf, 0x2a, 0x41, 0x33, 0x8c, 0x22, 0x6e, 0x41, 0xe7, 0x10, 0xc3, 0x8a, 0xf0, 0x30, - 0x14, 0x81, 0x43, 0x2c, 0xc0, 0x8b, 0x05, 0x1e, 0x78, 0xf0, 0xb5, 0x0f, 0x63, 0x91, 0xc8, 0x7d, - 0xd0, 0x6c, 0x7c, 0x9f, 0x09, 0x3a, 0x3c, 0x2c, 0xb8, 0x12, 0x63, 0x2a, 0x11, 0xc3, 0x20, 0xa9, - 0xae, 0x9d, 0x18, 0x0b, 0x4f, 0xcf, 0x23, 0x58, 0x55, 0xf5, 0xd9, 0xb4, 0xbd, 0x7c, 0x7b, 0xd9, - 0x48, 0x89, 0x21, 0x0c, 0xcc, 0xd5, 0x26, 0xf3, 0x69, 0x09, 0x3a, 0x71, 0xed, 0xd0, 0xbe, 0x00, - 0xcd, 0xa4, 0x44, 0xd4, 0xb1, 0x3e, 0x6e, 0x21, 0xc4, 0xa4, 0xd2, 0xfc, 0x18, 0x13, 0x32, 0x9a, - 0x83, 0xf1, 0x8c, 0x4c, 0x15, 0x2e, 0xc7, 0x52, 0x36, 0x2a, 0xcd, 0x8f, 0xa3, 0x03, 0xe1, 0xfe, - 0xff, 0x50, 0x86, 0x46, 0x90, 0x3a, 0x28, 0x32, 0xbb, 0x97, 0xa0, 0x7c, 0x44, 0x7c, 0x55, 0x26, - 0x12, 0xd8, 0xbf, 0x4e, 0x31, 0x28, 0xe2, 0x64, 0xea, 0x0b, 0xff, 0x98, 0x85, 0x88, 0x18, 0xda, - 0xcb, 0x50, 0x99, 0xd0, 0xf6, 0x6e, 0x25, 0x0f, 0x93, 0xa1, 0x60, 0x04, 0x5b, 0x1b, 0x90, 0x11, - 0x6e, 0x5a, 0x64, 0xd4, 0x19, 0xc8, 0x02, 0x09, 0xd3, 0x87, 0xba, 0x33, 0xe1, 0x6d, 0xc8, 0x5a, - 0x1e, 0xbe, 0xc4, 0xa2, 0xac, 0xd0, 0x90, 0x54, 0x14, 0xb9, 0xb2, 0x58, 0xa1, 0x28, 0x34, 0x27, - 0xc3, 0x40, 0xac, 0x7f, 0x2c, 0xda, 0x17, 0x19, 0xb8, 0x1c, 0x27, 0xe1, 0x26, 0x9a, 0x85, 0xdc, - 0xc4, 0xb9, 0x3b, 0x48, 0x7f, 0xab, 0xc2, 0x9a, 0x3a, 0x9a, 0xbc, 0xa8, 0x31, 0x5e, 0xd4, 0x18, - 0xff, 0xd7, 0x6b, 0x8c, 0x8f, 0xa0, 0xca, 0x2e, 0x68, 0x28, 0x29, 0x95, 0x0a, 0x50, 0x42, 0xe7, - 0x53, 0x61, 0xb7, 0x4d, 0x16, 0xd8, 0xa4, 0x75, 0x85, 0xc3, 0x17, 0x75, 0x13, 0x86, 0xb6, 0xf5, - 0xb3, 0x2a, 0x2c, 0x25, 0xb4, 0xf6, 0xa2, 0x27, 0x75, 0xd1, 0x93, 0x3a, 0x57, 0x4f, 0x4a, 0xa5, - 0xc3, 0x5a, 0x11, 0x6b, 0xf8, 0x36, 0x40, 0x18, 0x82, 0x3c, 0xe1, 0x3b, 0x5f, 0xbf, 0xae, 0xc1, - 0xe5, 0x8c, 0xc2, 0xc8, 0xc5, 0x35, 0x85, 0x8b, 0x6b, 0x0a, 0x17, 0xd7, 0x14, 0x42, 0x33, 0xfc, - 0x47, 0x09, 0x1a, 0x41, 0x39, 0x7d, 0xf6, 0xc5, 0xae, 0xed, 0xa0, 0x3b, 0xc3, 0xc3, 0xee, 0xb5, - 0x74, 0xcd, 0x9a, 0x1d, 0x3c, 0xf2, 0xea, 0xeb, 0xab, 0x50, 0xe7, 0x95, 0x55, 0x79, 0x78, 0xac, - 0xa4, 0x0b, 0xb2, 0x9e, 0x2e, 0x71, 0xb4, 0xd7, 0xa0, 0x21, 0xae, 0x2b, 0xc9, 0xcc, 0x7a, 0x35, - 0x9e, 0x59, 0x73, 0x98, 0x1e, 0x60, 0x9d, 0xff, 0x4e, 0x33, 0x81, 0x15, 0xc5, 0x65, 0x44, 0xed, - 0xdd, 0x7c, 0x87, 0x94, 0x3e, 0x73, 0x83, 0xd6, 0x82, 0xda, 0x25, 0xfd, 0xa4, 0x04, 0xed, 0x78, - 0x97, 0x61, 0x87, 0x3a, 0x22, 0x3e, 0x10, 0xdc, 0x1e, 0x57, 0xe4, 0xdc, 0x98, 0x20, 0x05, 0x78, - 0x4f, 0x36, 0xbf, 0xfa, 0x29, 0x26, 0xc2, 0x41, 0x66, 0xaf, 0xbd, 0x05, 0x6d, 0xb9, 0x8c, 0xd1, - 0x77, 0x06, 0x44, 0x6c, 0xf4, 0x6a, 0xe6, 0x46, 0x79, 0xb7, 0x63, 0x51, 0x4e, 0xa2, 0xb5, 0x5d, - 0xe5, 0xdb, 0x58, 0x28, 0xf2, 0x36, 0x7e, 0xd3, 0x84, 0x9a, 0x70, 0xd4, 0x8a, 0x8c, 0x2f, 0x2b, - 0x40, 0x09, 0x7a, 0xab, 0xe5, 0x9c, 0x4b, 0x7f, 0x95, 0xdc, 0x4b, 0x7f, 0xb3, 0x02, 0x8f, 0x84, - 0x25, 0xd6, 0x52, 0x96, 0x18, 0x71, 0x89, 0xf5, 0x39, 0x5c, 0x62, 0x63, 0xb6, 0x4b, 0x6c, 0xce, - 0xe1, 0x12, 0x61, 0x2e, 0x97, 0xd8, 0xca, 0x77, 0x89, 0x8b, 0x39, 0x2e, 0xb1, 0x9d, 0xe3, 0x12, - 0x3b, 0x79, 0x2e, 0x71, 0x69, 0x86, 0x4b, 0xec, 0xa6, 0x5d, 0xe2, 0x0b, 0xd0, 0xa1, 0xc4, 0x23, - 0xc6, 0xc6, 0x33, 0x81, 0x36, 0x8e, 0x46, 0x62, 0x05, 0x8a, 0x86, 0xcb, 0x44, 0xd0, 0x34, 0x81, - 0x66, 0xd9, 0x11, 0xb4, 0xe8, 0x41, 0xbf, 0x92, 0xb8, 0xa6, 0x39, 0x57, 0x46, 0xf0, 0x61, 0x96, - 0x0b, 0xb8, 0x94, 0x6e, 0x2d, 0x65, 0x7d, 0x7a, 0xa2, 0xf6, 0x06, 0xda, 0x75, 0x71, 0xec, 0xaf, - 0xa5, 0xed, 0xfe, 0x01, 0x8e, 0xf3, 0xd8, 0x9d, 0x05, 0x03, 0xaf, 0xc8, 0x43, 0xff, 0x72, 0x3a, - 0xb9, 0x0f, 0x9a, 0xe6, 0xf2, 0xb8, 0x7f, 0x19, 0x6a, 0x18, 0x60, 0x50, 0xfd, 0xec, 0x65, 0xf6, - 0xce, 0xab, 0x88, 0x81, 0xea, 0xfa, 0x45, 0x80, 0xc8, 0x8e, 0xd6, 0xd3, 0xce, 0x3c, 0xe4, 0x56, - 0x8f, 0x60, 0x6a, 0xcf, 0x43, 0x7b, 0x60, 0x51, 0x0b, 0x42, 0x61, 0x9b, 0xbe, 0xe3, 0xf6, 0x36, - 0x98, 0x82, 0xc4, 0x07, 0xe3, 0x57, 0x5e, 0x37, 0x13, 0x57, 0x5e, 0x9f, 0x85, 0xf2, 0xe9, 0x78, - 0xd4, 0xbb, 0x92, 0xb6, 0xb8, 0x6f, 0x8d, 0x47, 0x3a, 0x85, 0xa5, 0xcb, 0xac, 0x4f, 0x3f, 0xee, - 0xad, 0xd8, 0xab, 0x8f, 0x71, 0x2b, 0xf6, 0x99, 0x22, 0x1e, 0xeb, 0x07, 0x00, 0xe1, 0xb9, 0x57, - 0xf0, 0x4b, 0xa3, 0x37, 0xa1, 0x35, 0xb4, 0xd0, 0xa1, 0x64, 0x1f, 0xa9, 0xe1, 0x8d, 0x67, 0x9c, - 0x06, 0xc3, 0xe0, 0x29, 0xf4, 0xe2, 0x3e, 0xac, 0x28, 0xba, 0xb9, 0xda, 0x77, 0xf3, 0xcf, 0xaf, - 0xeb, 0xe9, 0x80, 0x3a, 0xa3, 0x25, 0xac, 0x3e, 0xce, 0xfe, 0x5c, 0x81, 0xcb, 0x59, 0xcd, 0xe8, - 0x31, 0x3c, 0x7d, 0x48, 0x3f, 0x12, 0x32, 0xcc, 0xd8, 0x57, 0x42, 0x46, 0x50, 0xf3, 0xe5, 0xa2, - 0x79, 0x29, 0x56, 0x61, 0xcd, 0xfe, 0xaa, 0x08, 0x37, 0xbe, 0x79, 0x98, 0xf3, 0xd1, 0xd1, 0x5d, - 0xe8, 0x22, 0x11, 0xe3, 0x13, 0x72, 0x16, 0xae, 0xc0, 0x25, 0x19, 0xab, 0x6b, 0xc5, 0xbf, 0xb2, - 0x42, 0xa2, 0x1d, 0x33, 0xfe, 0xdd, 0xd5, 0xf7, 0xa0, 0xe7, 0xb0, 0xb6, 0x84, 0x61, 0x89, 0x86, - 0x54, 0x48, 0xaf, 0x9c, 0xee, 0x8a, 0xaa, 0x7b, 0x57, 0xb4, 0x2b, 0xea, 0xa8, 0xbb, 0x5a, 0x21, - 0xfd, 0x89, 0xe8, 0xf5, 0x84, 0xf4, 0x2b, 0x59, 0xf4, 0x93, 0x6d, 0xa1, 0x90, 0x7e, 0xaa, 0x61, - 0x74, 0x04, 0x9b, 0x82, 0xbe, 0x19, 0x36, 0x12, 0xc3, 0x25, 0xf8, 0x01, 0xf7, 0x42, 0x7a, 0x09, - 0x45, 0xdb, 0x11, 0x57, 0x59, 0x77, 0x32, 0x7b, 0x92, 0x24, 0x5c, 0x88, 0x75, 0x75, 0x59, 0xb8, - 0x10, 0x2e, 0x54, 0x4b, 0x7b, 0xc7, 0xac, 0x1e, 0x30, 0x6d, 0xbc, 0x3b, 0x19, 0xb0, 0x50, 0xc3, - 0x8f, 0x43, 0x0d, 0x8f, 0xb4, 0x04, 0xb4, 0xf7, 0xf2, 0x35, 0xfc, 0x4a, 0x46, 0xdb, 0x88, 0x5f, - 0x2c, 0x50, 0x6b, 0xf5, 0x73, 0xd0, 0x8a, 0xde, 0x5c, 0x58, 0x0d, 0x3f, 0xee, 0x2b, 0x87, 0x77, - 0x1c, 0x7e, 0x57, 0x82, 0xf2, 0x03, 0x53, 0x7d, 0x2b, 0x62, 0xf6, 0xc7, 0x6e, 0x29, 0xcf, 0x56, - 0x3e, 0xf7, 0x37, 0x22, 0x85, 0xbe, 0xe0, 0xba, 0x06, 0x0d, 0x79, 0xc2, 0x64, 0xec, 0xef, 0x23, - 0x58, 0xfa, 0x20, 0x51, 0x6f, 0x7a, 0x82, 0x1f, 0x93, 0xfc, 0x1e, 0xa5, 0x87, 0x6e, 0x5e, 0x29, - 0xbd, 0x2b, 0xd0, 0xa4, 0xbf, 0xde, 0xc4, 0xec, 0xcb, 0x7b, 0x25, 0xe1, 0x00, 0x0d, 0xfe, 0x26, - 0x18, 0x0f, 0x5a, 0xa7, 0x22, 0xca, 0x13, 0x4f, 0x74, 0x16, 0x06, 0x27, 0xae, 0x75, 0x38, 0xf5, - 0x89, 0xf8, 0x4c, 0x2f, 0x1c, 0xa0, 0xa1, 0xcc, 0x23, 0x17, 0x0d, 0x82, 0x0c, 0x44, 0x0a, 0x2e, - 0x1f, 0xcf, 0xdd, 0xc7, 0xbc, 0xf5, 0x22, 0x74, 0x1c, 0xf7, 0x48, 0xe2, 0x1a, 0x27, 0x3b, 0xb7, - 0x16, 0xc5, 0xb7, 0xab, 0xfb, 0xf4, 0xeb, 0xcf, 0xfd, 0xd2, 0x2f, 0x17, 0xca, 0x7b, 0xbb, 0x07, - 0x87, 0x35, 0xf6, 0x31, 0xe8, 0xeb, 0xff, 0x0a, 0x00, 0x00, 0xff, 0xff, 0xd4, 0x0a, 0xef, 0xca, - 0xe4, 0x3a, 0x00, 0x00, +func init() { proto.RegisterFile("OpenAPIv2/OpenAPIv2.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 3129 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xec, 0x3b, 0x4b, 0x73, 0x1c, 0x57, + 0xd5, 0xf3, 0x7e, 0x1c, 0x69, 0x46, 0xa3, 0x96, 0x2c, 0xb7, 0x24, 0xc7, 0x71, 0xe4, 0x3c, 0x6c, + 0xe7, 0xb3, 0x9c, 0x4f, 0x29, 0x48, 0x05, 0x2a, 0x05, 0xf2, 0xab, 0xc6, 0xc4, 0x44, 0x4a, 0xcb, + 0x0e, 0x09, 0x04, 0xba, 0xae, 0x66, 0xee, 0x48, 0x9d, 0x74, 0xf7, 0x6d, 0x77, 0xf7, 0xc8, 0x1a, + 0x16, 0x2c, 0xa0, 0x8a, 0x35, 0x50, 0x59, 0x53, 0x15, 0x16, 0x14, 0x55, 0x59, 0xb0, 0x62, 0xc5, + 0x1f, 0x60, 0xc7, 0x3f, 0x60, 0x0d, 0x5b, 0xaa, 0x58, 0x51, 0x3c, 0xea, 0xbe, 0xfa, 0x31, 0x7d, + 0x7b, 0x1e, 0x96, 0x0b, 0x28, 0xd0, 0x6a, 0xe6, 0xde, 0x73, 0xee, 0xb9, 0xa7, 0x4f, 0x9f, 0xd7, + 0x3d, 0xe7, 0x36, 0xac, 0xef, 0x79, 0xd8, 0xdd, 0xdd, 0x7f, 0x70, 0xb2, 0x73, 0x2b, 0xfa, 0xb7, + 0xed, 0xf9, 0x24, 0x24, 0x1a, 0x10, 0x0f, 0xbb, 0xc8, 0xb3, 0xb6, 0x4f, 0x76, 0x36, 0xd6, 0x8f, + 0x08, 0x39, 0xb2, 0xf1, 0x2d, 0x06, 0x39, 0x1c, 0x0e, 0x6e, 0x21, 0x77, 0xc4, 0xd1, 0xb6, 0x1c, + 0xd0, 0x77, 0xfb, 0x7d, 0x2b, 0xb4, 0x88, 0x8b, 0xec, 0x7d, 0x9f, 0x78, 0xd8, 0x0f, 0x2d, 0x1c, + 0x3c, 0x08, 0xb1, 0xa3, 0xfd, 0x1f, 0xd4, 0x82, 0xde, 0x31, 0x76, 0x90, 0x5e, 0xbc, 0x52, 0xbc, + 0xb6, 0xb0, 0xa3, 0x6d, 0xc7, 0x34, 0xb7, 0x0f, 0x18, 0xa4, 0x5b, 0x30, 0x04, 0x8e, 0xb6, 0x01, + 0xf5, 0x43, 0x42, 0x6c, 0x8c, 0x5c, 0xbd, 0x74, 0xa5, 0x78, 0xad, 0xd1, 0x2d, 0x18, 0x72, 0xe2, + 0x76, 0x1d, 0xaa, 0xc4, 0xc5, 0x64, 0xb0, 0x75, 0x0f, 0xca, 0xbb, 0xee, 0x48, 0xbb, 0x01, 0xd5, + 0x13, 0x64, 0x0f, 0xb1, 0x20, 0xbc, 0xba, 0xcd, 0x19, 0xdc, 0x96, 0x0c, 0x6e, 0xef, 0xba, 0x23, + 0x83, 0xa3, 0x68, 0x1a, 0x54, 0x46, 0xc8, 0xb1, 0x19, 0xd1, 0xa6, 0xc1, 0xfe, 0x6f, 0x7d, 0x51, + 0x84, 0xf6, 0xae, 0x67, 0xbd, 0x8b, 0x47, 0x07, 0xb8, 0x37, 0xf4, 0xad, 0x70, 0x44, 0xd1, 0xc2, + 0x91, 0xc7, 0x29, 0x36, 0x0d, 0xf6, 0x9f, 0xce, 0xb9, 0xc8, 0xc1, 0x72, 0x29, 0xfd, 0xaf, 0xb5, + 0xa1, 0x64, 0xb9, 0x7a, 0x99, 0xcd, 0x94, 0x2c, 0x57, 0xbb, 0x02, 0x0b, 0x7d, 0x1c, 0xf4, 0x7c, + 0xcb, 0xa3, 0x32, 0xd0, 0x2b, 0x0c, 0x90, 0x9c, 0xd2, 0xbe, 0x06, 0x9d, 0x13, 0xec, 0xf6, 0x89, + 0x6f, 0xe2, 0xd3, 0x10, 0xbb, 0x01, 0x45, 0xab, 0x5e, 0x29, 0x33, 0xbe, 0x13, 0x02, 0x79, 0x0f, + 0x39, 0xb8, 0x4f, 0xf9, 0x5e, 0xe2, 0xd8, 0xf7, 0x24, 0xf2, 0xd6, 0x67, 0x45, 0xd8, 0xbc, 0x8d, + 0x02, 0xab, 0xb7, 0x3b, 0x0c, 0x8f, 0xb1, 0x1b, 0x5a, 0x3d, 0x44, 0x09, 0x4f, 0x64, 0x7d, 0x8c, + 0xad, 0xd2, 0x6c, 0x6c, 0x95, 0xe7, 0x61, 0xeb, 0x0f, 0x45, 0x68, 0xdd, 0x26, 0xfd, 0xd1, 0x3e, + 0xf2, 0x91, 0x83, 0x43, 0xec, 0x8f, 0x6f, 0x5a, 0xcc, 0x6e, 0x3a, 0x8b, 0x44, 0x37, 0xa0, 0xe1, + 0xe3, 0x27, 0x43, 0xcb, 0xc7, 0x7d, 0x26, 0xce, 0x86, 0x11, 0x8d, 0xb5, 0x1b, 0x91, 0x4a, 0x55, + 0xf3, 0x54, 0x2a, 0x52, 0x28, 0xd5, 0x03, 0xd6, 0xe6, 0x79, 0xc0, 0x1f, 0x17, 0xa1, 0x7e, 0x87, + 0xb8, 0x21, 0xea, 0x85, 0x11, 0xe3, 0xc5, 0x04, 0xe3, 0x1d, 0x28, 0x0f, 0x7d, 0xa9, 0x58, 0xf4, + 0xaf, 0xb6, 0x0a, 0x55, 0xec, 0x20, 0xcb, 0x16, 0x4f, 0xc3, 0x07, 0x4a, 0x46, 0x2a, 0xf3, 0x30, + 0xf2, 0x08, 0xea, 0x77, 0xf1, 0x00, 0x0d, 0xed, 0x50, 0x7b, 0x00, 0x17, 0x50, 0x64, 0x6f, 0xa6, + 0x17, 0x19, 0x9c, 0x5e, 0x9c, 0x40, 0x70, 0x15, 0x29, 0x4c, 0x74, 0xeb, 0x3b, 0xb0, 0x70, 0x17, + 0x0f, 0x2c, 0x97, 0x41, 0x02, 0xed, 0xe1, 0x64, 0xca, 0x17, 0x33, 0x94, 0x85, 0xb8, 0xd5, 0xc4, + 0xff, 0x58, 0x85, 0xc6, 0x5d, 0xd2, 0x1b, 0x3a, 0xd8, 0x0d, 0x35, 0x1d, 0xea, 0xc1, 0x53, 0x74, + 0x74, 0x84, 0x7d, 0x21, 0x3f, 0x39, 0xd4, 0x5e, 0x86, 0x8a, 0xe5, 0x0e, 0x08, 0x93, 0xe1, 0xc2, + 0x4e, 0x27, 0xb9, 0xc7, 0x03, 0x77, 0x40, 0x0c, 0x06, 0xa5, 0xc2, 0x3f, 0x26, 0x41, 0x28, 0xa4, + 0xca, 0xfe, 0x6b, 0x9b, 0xd0, 0x3c, 0x44, 0x01, 0x36, 0x3d, 0x14, 0x1e, 0x0b, 0xab, 0x6b, 0xd0, + 0x89, 0x7d, 0x14, 0x1e, 0xb3, 0x0d, 0x29, 0x77, 0x38, 0x60, 0x96, 0x46, 0x37, 0xe4, 0x43, 0xaa, + 0x5c, 0x3d, 0xe2, 0x06, 0x43, 0x0a, 0xaa, 0x31, 0x50, 0x34, 0xa6, 0x30, 0xcf, 0x27, 0xfd, 0x61, + 0x0f, 0x07, 0x7a, 0x9d, 0xc3, 0xe4, 0x58, 0x7b, 0x0d, 0xaa, 0x74, 0xa7, 0x40, 0x6f, 0x30, 0x4e, + 0x97, 0x93, 0x9c, 0xd2, 0x2d, 0x03, 0x83, 0xc3, 0xb5, 0xb7, 0xa9, 0x0d, 0x44, 0x52, 0xd5, 0x9b, + 0x0c, 0x3d, 0x25, 0xbc, 0x84, 0xd0, 0x8d, 0x24, 0xae, 0xf6, 0x75, 0x00, 0x4f, 0xda, 0x52, 0xa0, + 0x03, 0x5b, 0x79, 0x25, 0xbd, 0x91, 0x80, 0x26, 0x49, 0x24, 0xd6, 0x68, 0xef, 0x40, 0xd3, 0xc7, + 0x81, 0x47, 0xdc, 0x00, 0x07, 0xfa, 0x02, 0x23, 0xf0, 0x62, 0x92, 0x80, 0x21, 0x80, 0xc9, 0xf5, + 0xf1, 0x0a, 0xed, 0xab, 0xd0, 0x08, 0x84, 0x53, 0xd1, 0x17, 0xd9, 0x5b, 0x4f, 0xad, 0x96, 0x0e, + 0xc7, 0xe0, 0xd6, 0x48, 0x5f, 0xad, 0x11, 0x2d, 0xd0, 0x0c, 0x58, 0x95, 0xff, 0xcd, 0xa4, 0x04, + 0x5a, 0x59, 0x36, 0x24, 0xa1, 0x24, 0x1b, 0x2b, 0x41, 0x76, 0x52, 0xbb, 0x0a, 0x95, 0x10, 0x1d, + 0x05, 0x7a, 0x9b, 0x31, 0xb3, 0x94, 0xa4, 0xf1, 0x08, 0x1d, 0x19, 0x0c, 0xa8, 0xbd, 0x03, 0x2d, + 0x6a, 0x57, 0x3e, 0x55, 0xdb, 0x3e, 0xe9, 0x05, 0xfa, 0x12, 0xdb, 0x51, 0x4f, 0x62, 0xdf, 0x13, + 0x08, 0x77, 0x49, 0x2f, 0x30, 0x16, 0x71, 0x62, 0xa4, 0xb4, 0xce, 0xce, 0x3c, 0xd6, 0xf9, 0x18, + 0x1a, 0xf7, 0x4e, 0x91, 0xe3, 0xd9, 0x38, 0x78, 0x9e, 0xe6, 0xf9, 0xa3, 0x22, 0x2c, 0x26, 0xd9, + 0x9e, 0xc1, 0xbb, 0x66, 0x1d, 0xd2, 0x99, 0x9d, 0xfc, 0x3f, 0x4a, 0x00, 0xf7, 0x2d, 0x1b, 0x73, + 0x63, 0xd7, 0xd6, 0xa0, 0x36, 0x20, 0xbe, 0x83, 0x42, 0xb1, 0xbd, 0x18, 0x51, 0xc7, 0x17, 0x5a, + 0xa1, 0x2d, 0x1d, 0x3b, 0x1f, 0x8c, 0x73, 0x5c, 0xce, 0x72, 0x7c, 0x1d, 0xea, 0x7d, 0xee, 0xd9, + 0x98, 0x0d, 0x8f, 0xbd, 0x63, 0xca, 0x91, 0x84, 0xa7, 0xc2, 0x02, 0x37, 0xea, 0x38, 0x2c, 0xc8, + 0x08, 0x58, 0x4b, 0x44, 0xc0, 0x4d, 0x6a, 0x0b, 0xa8, 0x6f, 0x12, 0xd7, 0x1e, 0xe9, 0x75, 0x19, + 0x47, 0x50, 0x7f, 0xcf, 0xb5, 0x47, 0x59, 0x9d, 0x69, 0xcc, 0xa5, 0x33, 0xd7, 0xa1, 0x8e, 0xf9, + 0x2b, 0x17, 0x06, 0x9e, 0x65, 0x5b, 0xc0, 0x95, 0x6f, 0x00, 0xe6, 0x79, 0x03, 0x5f, 0xd4, 0x60, + 0xe3, 0x3e, 0xf1, 0x9d, 0xbb, 0x28, 0x44, 0x91, 0x03, 0x38, 0x18, 0x1e, 0x1e, 0xc8, 0xb4, 0x29, + 0x16, 0x4b, 0x71, 0x2c, 0x5a, 0xf2, 0xc8, 0x5a, 0xca, 0xcb, 0x55, 0xca, 0xf9, 0xf1, 0xb9, 0x92, + 0x08, 0x73, 0x37, 0x60, 0x19, 0xd9, 0x36, 0x79, 0x6a, 0x62, 0xc7, 0x0b, 0x47, 0x26, 0x4f, 0xbc, + 0xaa, 0x6c, 0xab, 0x25, 0x06, 0xb8, 0x47, 0xe7, 0x3f, 0x90, 0xc9, 0x56, 0xe6, 0x45, 0xc4, 0x3a, + 0x53, 0x4f, 0xe9, 0xcc, 0xff, 0x43, 0xd5, 0x0a, 0xb1, 0x23, 0x65, 0xbf, 0x99, 0xf2, 0x74, 0xbe, + 0xe5, 0x58, 0xa1, 0x75, 0xc2, 0x33, 0xc9, 0xc0, 0xe0, 0x98, 0xda, 0xeb, 0xb0, 0xdc, 0x23, 0xb6, + 0x8d, 0x7b, 0x94, 0x59, 0x53, 0x50, 0x6d, 0x32, 0xaa, 0x9d, 0x18, 0x70, 0x9f, 0xd3, 0x4f, 0xe8, + 0x16, 0x4c, 0xd1, 0x2d, 0x1d, 0xea, 0x0e, 0x3a, 0xb5, 0x9c, 0xa1, 0xc3, 0xbc, 0x66, 0xd1, 0x90, + 0x43, 0xba, 0x23, 0x3e, 0xed, 0xd9, 0xc3, 0xc0, 0x3a, 0xc1, 0xa6, 0xc4, 0x59, 0x64, 0x0f, 0xdf, + 0x89, 0x00, 0xdf, 0x14, 0xc8, 0x94, 0x8c, 0xe5, 0x32, 0x94, 0x96, 0x20, 0xc3, 0x87, 0x63, 0x64, + 0x04, 0x4e, 0x7b, 0x9c, 0x8c, 0x40, 0x7e, 0x01, 0xc0, 0x41, 0xa7, 0xa6, 0x8d, 0xdd, 0xa3, 0xf0, + 0x98, 0x79, 0xb3, 0xb2, 0xd1, 0x74, 0xd0, 0xe9, 0x43, 0x36, 0xc1, 0xc0, 0x96, 0x2b, 0xc1, 0x1d, + 0x01, 0xb6, 0x5c, 0x01, 0xd6, 0xa1, 0xee, 0xa1, 0x90, 0x2a, 0xab, 0xbe, 0xcc, 0x83, 0xad, 0x18, + 0x52, 0x8b, 0xa0, 0x74, 0xb9, 0xd0, 0x35, 0xb6, 0xae, 0xe1, 0xa0, 0x53, 0x26, 0x61, 0x06, 0xb4, + 0x5c, 0x01, 0x5c, 0x11, 0x40, 0xcb, 0xe5, 0xc0, 0x97, 0x60, 0x71, 0xe8, 0x5a, 0x4f, 0x86, 0x58, + 0xc0, 0x57, 0x19, 0xe7, 0x0b, 0x7c, 0x8e, 0xa3, 0x5c, 0x85, 0x0a, 0x76, 0x87, 0x8e, 0x7e, 0x21, + 0xeb, 0xaa, 0xa9, 0xa8, 0x19, 0x50, 0x7b, 0x11, 0x16, 0x9c, 0xa1, 0x1d, 0x5a, 0x9e, 0x8d, 0x4d, + 0x32, 0xd0, 0xd7, 0x98, 0x90, 0x40, 0x4e, 0xed, 0x0d, 0x94, 0xd6, 0x72, 0x71, 0x2e, 0x6b, 0xa9, + 0x42, 0xad, 0x8b, 0x51, 0x1f, 0xfb, 0xca, 0xb4, 0x38, 0xd6, 0xc5, 0x92, 0x5a, 0x17, 0xcb, 0x67, + 0xd3, 0xc5, 0xca, 0x74, 0x5d, 0xac, 0xce, 0xae, 0x8b, 0xb5, 0x19, 0x74, 0xb1, 0x3e, 0x5d, 0x17, + 0x1b, 0x33, 0xe8, 0x62, 0x73, 0x26, 0x5d, 0x84, 0xc9, 0xba, 0xb8, 0x30, 0x41, 0x17, 0x17, 0x27, + 0xe8, 0x62, 0x6b, 0x92, 0x2e, 0xb6, 0xa7, 0xe8, 0xe2, 0x52, 0xbe, 0x2e, 0x76, 0xe6, 0xd0, 0xc5, + 0xe5, 0x8c, 0x2e, 0x8e, 0x79, 0x4b, 0x6d, 0xb6, 0x23, 0xd4, 0xca, 0x3c, 0xda, 0xfa, 0xb7, 0x2a, + 0xe8, 0x5c, 0x5b, 0xff, 0x2d, 0x9e, 0x5d, 0x5a, 0x48, 0x55, 0x69, 0x21, 0x35, 0xb5, 0x85, 0xd4, + 0xcf, 0x66, 0x21, 0x8d, 0xe9, 0x16, 0xd2, 0x9c, 0xdd, 0x42, 0x60, 0x06, 0x0b, 0x59, 0x98, 0x6e, + 0x21, 0x8b, 0x33, 0x58, 0x48, 0x6b, 0x26, 0x0b, 0x69, 0x4f, 0xb6, 0x90, 0xa5, 0x09, 0x16, 0xd2, + 0x99, 0x60, 0x21, 0xcb, 0x93, 0x2c, 0x44, 0x9b, 0x62, 0x21, 0x2b, 0xf9, 0x16, 0xb2, 0x3a, 0x87, + 0x85, 0x5c, 0x98, 0xc9, 0x5b, 0xaf, 0xcd, 0xa3, 0xff, 0xdf, 0x82, 0x3a, 0x57, 0xff, 0x67, 0x38, + 0x7e, 0xf2, 0x85, 0x39, 0xc9, 0xf3, 0xe7, 0x25, 0xa8, 0xd0, 0x03, 0x64, 0x9c, 0x98, 0x16, 0x93, + 0x89, 0xa9, 0x0e, 0xf5, 0x13, 0xec, 0x07, 0x71, 0x65, 0x44, 0x0e, 0x67, 0x30, 0xa4, 0x6b, 0xd0, + 0x09, 0xb1, 0xef, 0x04, 0x26, 0x19, 0x98, 0x01, 0xf6, 0x4f, 0xac, 0x9e, 0x34, 0xaa, 0x36, 0x9b, + 0xdf, 0x1b, 0x1c, 0xf0, 0x59, 0xed, 0x26, 0xd4, 0x7b, 0xbc, 0x7c, 0x20, 0x9c, 0xfe, 0x4a, 0xf2, + 0x21, 0x44, 0x65, 0xc1, 0x90, 0x38, 0x14, 0xdd, 0xb6, 0x7a, 0xd8, 0x0d, 0x78, 0xfa, 0x34, 0x86, + 0xfe, 0x90, 0x83, 0x0c, 0x89, 0xa3, 0x14, 0x7e, 0x7d, 0x1e, 0xe1, 0xbf, 0x05, 0x4d, 0xa6, 0x0c, + 0xac, 0x56, 0x77, 0x23, 0x51, 0xab, 0x2b, 0x4f, 0x2e, 0xac, 0x6c, 0xdd, 0x85, 0xd6, 0x37, 0x02, + 0xe2, 0x1a, 0x78, 0x80, 0x7d, 0xec, 0xf6, 0xb0, 0xb6, 0x0c, 0x15, 0xd3, 0xc7, 0x03, 0x21, 0xe3, + 0xb2, 0x81, 0x07, 0xd3, 0xeb, 0x4f, 0x5b, 0x1e, 0xd4, 0xc5, 0x33, 0xcd, 0x58, 0x5c, 0x39, 0xf3, + 0x59, 0xe6, 0x1e, 0x34, 0x24, 0x50, 0xb9, 0xe5, 0x2b, 0xb2, 0xaa, 0x58, 0x52, 0x3b, 0x20, 0x0e, + 0xdd, 0x7a, 0x17, 0x16, 0x12, 0x0a, 0xa8, 0xa4, 0x74, 0x2d, 0x4d, 0x29, 0x25, 0x4c, 0xa1, 0xb7, + 0x82, 0xd8, 0xfb, 0xd0, 0x66, 0xc4, 0xe2, 0x22, 0x9a, 0x8a, 0xde, 0xeb, 0x69, 0x7a, 0x17, 0x94, + 0x45, 0x01, 0x49, 0x72, 0x0f, 0x5a, 0x82, 0x64, 0x78, 0xcc, 0xde, 0xad, 0x8a, 0xe2, 0x8d, 0x34, + 0xc5, 0xd5, 0xf1, 0x7a, 0x06, 0x5d, 0x38, 0x4e, 0x50, 0x56, 0x0f, 0xe6, 0x26, 0x28, 0x17, 0x4a, + 0x82, 0x1f, 0x81, 0x96, 0x22, 0x18, 0x9d, 0x1d, 0x32, 0x54, 0x6f, 0xa5, 0xa9, 0xae, 0xab, 0xa8, + 0xb2, 0xd5, 0xe3, 0x2f, 0x47, 0xc4, 0xd0, 0x79, 0x5f, 0x8e, 0xd0, 0x74, 0x41, 0xcc, 0x81, 0x4b, + 0x9c, 0x58, 0xb6, 0x34, 0x91, 0x2b, 0xd8, 0xb7, 0xd3, 0xd4, 0xaf, 0x4e, 0xa9, 0x7b, 0x24, 0xe5, + 0xfc, 0x96, 0xe4, 0x3d, 0xf4, 0x2d, 0xf7, 0x48, 0x49, 0x7d, 0x35, 0x49, 0xbd, 0x29, 0x17, 0x3e, + 0x86, 0x4e, 0x62, 0xe1, 0xae, 0xef, 0x23, 0xb5, 0x82, 0xdf, 0x4c, 0xf3, 0x96, 0xf2, 0xa9, 0x89, + 0xb5, 0x92, 0xec, 0x6f, 0xca, 0xd0, 0x79, 0x8f, 0xb8, 0xe9, 0x1a, 0x2f, 0x86, 0xcd, 0x63, 0xa6, + 0xc1, 0x66, 0x54, 0x77, 0x32, 0x83, 0xe1, 0xa1, 0x99, 0xaa, 0xf4, 0xbf, 0x9c, 0x55, 0xf8, 0x6c, + 0x82, 0xd3, 0x2d, 0x18, 0xfa, 0x71, 0x5e, 0xf2, 0x63, 0xc3, 0x65, 0x9a, 0x30, 0x98, 0x7d, 0x14, + 0x22, 0xf5, 0x4e, 0xfc, 0x19, 0x5e, 0x4d, 0xee, 0x94, 0x7f, 0x4c, 0xee, 0x16, 0x8c, 0x8d, 0x41, + 0xfe, 0x21, 0xfa, 0x10, 0x36, 0x9e, 0x0c, 0xb1, 0x3f, 0x52, 0xef, 0x54, 0xce, 0xbe, 0xc9, 0xf7, + 0x29, 0xb6, 0x72, 0x9b, 0x8b, 0x4f, 0xd4, 0x20, 0xcd, 0x84, 0x75, 0x0f, 0x85, 0xc7, 0xea, 0x2d, + 0x78, 0xf1, 0x63, 0x6b, 0xdc, 0x0a, 0x95, 0x3b, 0xac, 0x79, 0x4a, 0x48, 0xdc, 0x24, 0xf9, 0xbc, + 0x04, 0xfa, 0x1e, 0x1a, 0x86, 0xc7, 0x3b, 0xbb, 0xbd, 0x1e, 0x0e, 0x82, 0x3b, 0xa4, 0x8f, 0xa7, + 0xf5, 0x39, 0x06, 0x36, 0x79, 0x2a, 0xab, 0xf2, 0xf4, 0xbf, 0xf6, 0x06, 0x0d, 0x08, 0xc4, 0xc3, + 0xf2, 0x48, 0x94, 0x2a, 0x8d, 0x70, 0xea, 0x07, 0x0c, 0x6e, 0x08, 0x3c, 0x9a, 0x35, 0xd1, 0x69, + 0xe2, 0x5b, 0xdf, 0x67, 0xfd, 0x09, 0x93, 0xfa, 0x6f, 0x71, 0x20, 0x4a, 0x01, 0x1e, 0xfb, 0x36, + 0x4d, 0x60, 0x42, 0xf2, 0x29, 0xe6, 0x48, 0x3c, 0xff, 0x6c, 0xb0, 0x09, 0x0a, 0x1c, 0x0b, 0x1e, + 0xb5, 0xd9, 0x32, 0xef, 0xb9, 0x82, 0xdf, 0x5f, 0x8a, 0xb0, 0x2e, 0x64, 0xe4, 0x79, 0xf6, 0x2c, + 0x1d, 0x95, 0xe7, 0x23, 0xa4, 0xd4, 0x73, 0x57, 0x26, 0x3f, 0x77, 0x75, 0xb6, 0xe7, 0x9e, 0xab, + 0xa7, 0xf1, 0xc3, 0x12, 0xac, 0x71, 0xc6, 0x1e, 0x38, 0xf4, 0xb9, 0xad, 0xf0, 0x3f, 0x4d, 0x33, + 0xfe, 0x05, 0x42, 0xf8, 0x73, 0x51, 0x0a, 0x61, 0x1f, 0x05, 0xc1, 0x53, 0xe2, 0xf7, 0xff, 0x07, + 0xde, 0xfc, 0xc7, 0xb0, 0x98, 0xe4, 0xeb, 0x19, 0xfa, 0x3d, 0x2c, 0x42, 0xe4, 0x24, 0xdc, 0x3f, + 0xaf, 0x40, 0x73, 0xcf, 0xc3, 0x3e, 0x92, 0x87, 0x4d, 0x56, 0xb7, 0x2f, 0xb2, 0x3a, 0x2d, 0x2f, + 0xd3, 0xeb, 0x50, 0x0f, 0x86, 0x8e, 0x83, 0xfc, 0x91, 0xcc, 0xb9, 0xc5, 0x70, 0x86, 0x9c, 0x3b, + 0x53, 0xae, 0xad, 0xcc, 0x55, 0xae, 0x7d, 0x09, 0x16, 0x89, 0xe4, 0xcd, 0xb4, 0xfa, 0x52, 0xbc, + 0xd1, 0xdc, 0x83, 0x7e, 0xaa, 0xf7, 0x53, 0x1b, 0xeb, 0xfd, 0x24, 0x7b, 0x46, 0xf5, 0xb1, 0x9e, + 0xd1, 0x57, 0x52, 0x3d, 0x9b, 0x06, 0x13, 0xdd, 0x86, 0x32, 0x3d, 0xe3, 0xa1, 0x3e, 0xd9, 0xad, + 0x79, 0x33, 0xd9, 0xad, 0x69, 0x66, 0x33, 0x3b, 0x99, 0xe0, 0xa4, 0x7a, 0x34, 0x89, 0xd6, 0x16, + 0xa4, 0x5b, 0x5b, 0x97, 0x01, 0xfa, 0xd8, 0xf3, 0x71, 0x0f, 0x85, 0xb8, 0x2f, 0x4e, 0xbd, 0x89, + 0x99, 0xb3, 0x75, 0x77, 0x54, 0xea, 0xd7, 0x9a, 0x47, 0xfd, 0x7e, 0x59, 0x84, 0x66, 0x9c, 0x45, + 0xdc, 0x86, 0xf6, 0x21, 0xe9, 0x27, 0xe2, 0xad, 0x48, 0x1c, 0x52, 0x09, 0x5e, 0x2a, 0xf1, 0xe8, + 0x16, 0x8c, 0xd6, 0x61, 0x2a, 0x13, 0x79, 0x08, 0x9a, 0x4b, 0x5c, 0x73, 0x8c, 0x0e, 0x4f, 0x0b, + 0x2e, 0xa5, 0x98, 0x1a, 0xcb, 0x61, 0xba, 0x05, 0xa3, 0xe3, 0x8e, 0xcd, 0xc5, 0xd1, 0xf3, 0x08, + 0x56, 0x55, 0x7d, 0x36, 0x6d, 0x6f, 0xb2, 0xbd, 0x6c, 0x64, 0xc4, 0x10, 0x27, 0xe6, 0x6a, 0x93, + 0xf9, 0xac, 0x08, 0xed, 0xb4, 0x76, 0x68, 0x5f, 0x82, 0xe6, 0xb8, 0x44, 0xd4, 0xb9, 0x7e, 0xb7, + 0x60, 0xc4, 0x98, 0x54, 0x9a, 0x9f, 0x04, 0xc4, 0xa5, 0x67, 0x30, 0x7e, 0x22, 0x53, 0xa5, 0xcb, + 0xa9, 0x23, 0x1b, 0x95, 0xe6, 0x27, 0xc9, 0x89, 0xf8, 0xf9, 0x7f, 0x5f, 0x86, 0x46, 0x74, 0x74, + 0x50, 0x9c, 0xec, 0x5e, 0x83, 0xf2, 0x11, 0x0e, 0x55, 0x27, 0x91, 0xc8, 0xfe, 0x0d, 0x8a, 0x41, + 0x11, 0xbd, 0x61, 0x28, 0xfc, 0x63, 0x1e, 0xa2, 0x37, 0x0c, 0xb5, 0xeb, 0x50, 0xf1, 0x48, 0x20, + 0x3b, 0x40, 0x39, 0x98, 0x0c, 0x45, 0xbb, 0x09, 0xb5, 0x3e, 0xb6, 0x71, 0x88, 0xc5, 0x89, 0x3a, + 0x07, 0x59, 0x20, 0x69, 0xb7, 0xa0, 0x4e, 0x3c, 0xde, 0x86, 0xac, 0x4d, 0xc2, 0x97, 0x58, 0x94, + 0x15, 0x9a, 0x92, 0x8a, 0x22, 0x57, 0x1e, 0x2b, 0x14, 0x85, 0x9e, 0xc9, 0x3c, 0x14, 0xf6, 0x8e, + 0x45, 0xfb, 0x22, 0x07, 0x97, 0xe3, 0x8c, 0xb9, 0x89, 0xe6, 0x5c, 0x6e, 0xe2, 0xcc, 0x1d, 0xa4, + 0xbf, 0x56, 0x61, 0x4d, 0x9d, 0x4d, 0x9e, 0xd7, 0x18, 0xcf, 0x6b, 0x8c, 0xff, 0xed, 0x35, 0xc6, + 0xa7, 0x50, 0x65, 0x17, 0x34, 0x94, 0x94, 0x8a, 0x73, 0x50, 0xd2, 0x6e, 0x42, 0x85, 0xdd, 0x36, + 0x29, 0xb1, 0x45, 0xeb, 0x0a, 0x87, 0x2f, 0xea, 0x26, 0x0c, 0x6d, 0xeb, 0x67, 0x55, 0x58, 0x1a, + 0xd3, 0xda, 0xf3, 0x9e, 0xd4, 0x79, 0x4f, 0xea, 0x4c, 0x3d, 0x29, 0x95, 0x0e, 0x6b, 0xf3, 0x58, + 0xc3, 0xb7, 0x01, 0xe2, 0x14, 0xe4, 0x39, 0xdf, 0xf9, 0xfa, 0x55, 0x0d, 0x2e, 0xe6, 0x14, 0x46, + 0xce, 0xaf, 0x29, 0x9c, 0x5f, 0x53, 0x38, 0xbf, 0xa6, 0x10, 0x9b, 0xe1, 0xdf, 0x8b, 0xd0, 0x88, + 0xca, 0xe9, 0xd3, 0x2f, 0x76, 0x6d, 0x47, 0xdd, 0x19, 0x9e, 0x76, 0xaf, 0x65, 0x6b, 0xd6, 0x2c, + 0xf0, 0xc8, 0xab, 0xaf, 0x37, 0xa1, 0xce, 0x2b, 0xab, 0x32, 0x78, 0xac, 0x64, 0x0b, 0xb2, 0x81, + 0x21, 0x71, 0xb4, 0x37, 0xa0, 0x21, 0xae, 0x2b, 0xc9, 0x93, 0xf5, 0x6a, 0xfa, 0x64, 0xcd, 0x61, + 0x46, 0x84, 0x75, 0xf6, 0x3b, 0xcd, 0x18, 0x56, 0x14, 0x97, 0x11, 0xb5, 0xf7, 0x26, 0x3b, 0xa4, + 0x6c, 0xcc, 0x8d, 0x5a, 0x0b, 0x6a, 0x97, 0xf4, 0x93, 0x22, 0xb4, 0xd2, 0x5d, 0x86, 0x1d, 0xea, + 0x88, 0xf8, 0x44, 0x74, 0x7b, 0x5c, 0x71, 0xe6, 0xee, 0x16, 0x8c, 0x08, 0xef, 0xf9, 0x9e, 0xaf, + 0x7e, 0x5a, 0x84, 0x66, 0x74, 0xb2, 0xd7, 0xee, 0x40, 0x4b, 0x6e, 0x63, 0xf6, 0x48, 0x1f, 0x8b, + 0x07, 0xbd, 0x9c, 0xfb, 0xa0, 0xbc, 0xdb, 0xb1, 0x28, 0x17, 0xdd, 0x21, 0x7d, 0x75, 0x2b, 0xb0, + 0x34, 0xcf, 0xdb, 0xf8, 0x75, 0x13, 0x6a, 0xc2, 0x51, 0x2b, 0x4e, 0x7c, 0x79, 0x09, 0x4a, 0xd4, + 0x5b, 0x2d, 0x4f, 0xb8, 0xf4, 0x57, 0x99, 0x78, 0xe9, 0x6f, 0x5a, 0xe2, 0x31, 0x66, 0x89, 0xb5, + 0x8c, 0x25, 0x26, 0x5c, 0x62, 0x7d, 0x06, 0x97, 0xd8, 0x98, 0xee, 0x12, 0x9b, 0x33, 0xb8, 0x44, + 0x98, 0xc9, 0x25, 0x2e, 0x4c, 0x76, 0x89, 0x8b, 0x13, 0x5c, 0x62, 0x6b, 0x82, 0x4b, 0x6c, 0x4f, + 0x72, 0x89, 0x4b, 0x53, 0x5c, 0x62, 0x27, 0xeb, 0x12, 0x5f, 0x81, 0x36, 0x25, 0x9e, 0x30, 0x36, + 0x7e, 0x12, 0x68, 0x39, 0xe8, 0x34, 0x91, 0x2b, 0x50, 0x34, 0xcb, 0x4d, 0xa2, 0x69, 0x02, 0xcd, + 0x72, 0x13, 0x68, 0xc9, 0x40, 0xbf, 0x32, 0x76, 0x4d, 0x73, 0xa6, 0x13, 0xc1, 0x47, 0x79, 0x2e, + 0xe0, 0x42, 0xb6, 0xb5, 0x94, 0xf7, 0xe9, 0x89, 0xda, 0x1b, 0x68, 0xd7, 0x44, 0xd8, 0x5f, 0xcb, + 0xda, 0xfd, 0xa3, 0x91, 0x87, 0x79, 0xee, 0xce, 0x92, 0x81, 0xd7, 0x65, 0xd0, 0xbf, 0x98, 0x3d, + 0xdc, 0x47, 0x4d, 0x73, 0x19, 0xee, 0xaf, 0x43, 0x0d, 0xd9, 0x36, 0xd5, 0x4f, 0x3d, 0xb7, 0x77, + 0x5e, 0x45, 0xb6, 0xbd, 0x37, 0xd0, 0xbe, 0x0c, 0x90, 0x78, 0xa2, 0xf5, 0xac, 0x33, 0x8f, 0xb9, + 0x35, 0x12, 0x98, 0xda, 0xcb, 0xd0, 0xea, 0x5b, 0xd4, 0x82, 0x1c, 0xcb, 0x45, 0x21, 0xf1, 0xf5, + 0x0d, 0xa6, 0x20, 0xe9, 0xc9, 0xf4, 0x95, 0xd7, 0xcd, 0xb1, 0x2b, 0xaf, 0x2f, 0x41, 0xf9, 0xd4, + 0xb1, 0xf5, 0x4b, 0x59, 0x8b, 0xfb, 0xd0, 0xb1, 0x0d, 0x0a, 0xcb, 0x96, 0x59, 0x5f, 0x78, 0xd6, + 0x5b, 0xb1, 0x97, 0x9f, 0xe1, 0x56, 0xec, 0x8b, 0xf3, 0x78, 0xac, 0x1f, 0x00, 0xc4, 0x71, 0x6f, + 0xce, 0x2f, 0x8d, 0xde, 0x86, 0x85, 0x81, 0x65, 0x63, 0x33, 0x3f, 0xa4, 0xc6, 0x37, 0x9e, 0xbb, + 0x05, 0x03, 0x06, 0xd1, 0x28, 0xf6, 0xe2, 0x21, 0xac, 0x28, 0xba, 0xb9, 0xda, 0x77, 0x27, 0xc7, + 0xaf, 0x6b, 0xd9, 0x84, 0x3a, 0xa7, 0x25, 0xac, 0x0e, 0x67, 0x7f, 0xaa, 0xc0, 0xc5, 0xbc, 0x66, + 0xb4, 0x03, 0x2f, 0x1c, 0xa2, 0xc0, 0xea, 0x99, 0x28, 0xf5, 0x95, 0x90, 0x19, 0xd5, 0x7c, 0xb9, + 0x68, 0x5e, 0x4b, 0x55, 0x58, 0xf3, 0xbf, 0x2a, 0xea, 0x16, 0x8c, 0xcd, 0xc3, 0x09, 0x1f, 0x1d, + 0xdd, 0x87, 0x0e, 0xf2, 0x2c, 0xf3, 0x53, 0x3c, 0x8a, 0x77, 0xe0, 0x92, 0x4c, 0xd5, 0xb5, 0xd2, + 0x5f, 0x59, 0x75, 0x0b, 0x46, 0x1b, 0xa5, 0xbf, 0xbb, 0xfa, 0x1e, 0xe8, 0x84, 0xb5, 0x25, 0x4c, + 0x4b, 0x34, 0xa4, 0x62, 0x7a, 0xe5, 0x6c, 0x57, 0x54, 0xdd, 0xbb, 0xea, 0x16, 0x8c, 0x35, 0xa2, + 0xee, 0x6a, 0xc5, 0xf4, 0x3d, 0xd1, 0xeb, 0x89, 0xe9, 0x57, 0xf2, 0xe8, 0x8f, 0xb7, 0x85, 0x62, + 0xfa, 0x99, 0x86, 0xd1, 0x11, 0x6c, 0x0a, 0xfa, 0x28, 0x6e, 0x24, 0xc6, 0x5b, 0xf0, 0x00, 0xf7, + 0x4a, 0x76, 0x0b, 0x45, 0xdb, 0xb1, 0x5b, 0x30, 0xd6, 0x49, 0x6e, 0x4f, 0x12, 0xc7, 0x1b, 0xb1, + 0xae, 0x2e, 0x4b, 0x17, 0xe2, 0x8d, 0x6a, 0x59, 0xef, 0x98, 0xd7, 0x03, 0xee, 0x16, 0x0c, 0x21, + 0x93, 0x2c, 0x2c, 0xd6, 0xf0, 0xe3, 0x58, 0xc3, 0x13, 0x2d, 0x01, 0xed, 0xfd, 0xc9, 0x1a, 0x7e, + 0x29, 0xa7, 0x6d, 0xc4, 0x2f, 0x16, 0xa8, 0xb5, 0xfa, 0x2a, 0x2c, 0x24, 0x6f, 0x2e, 0xac, 0xc6, + 0x1f, 0xf7, 0x95, 0xe3, 0x3b, 0x0e, 0xbf, 0x2d, 0x42, 0xf9, 0x11, 0x52, 0xdf, 0x8a, 0x98, 0xfe, + 0xb1, 0x5b, 0xc6, 0xb3, 0x95, 0xcf, 0xfc, 0x8d, 0xc8, 0x5c, 0x5f, 0x70, 0x5d, 0x81, 0x86, 0x8c, + 0x30, 0x39, 0xcf, 0xf7, 0x31, 0x2c, 0x7d, 0x30, 0x56, 0x6f, 0x7a, 0x8e, 0x1f, 0x93, 0xfc, 0xae, + 0x08, 0xe5, 0x0f, 0x1d, 0x5b, 0x29, 0xbd, 0x4b, 0xd0, 0xa4, 0xbf, 0x81, 0x87, 0x7a, 0xf2, 0x5e, + 0x49, 0x3c, 0x41, 0x93, 0x3f, 0xcf, 0xc7, 0x03, 0xeb, 0x54, 0x64, 0x79, 0x62, 0x44, 0x57, 0xa1, + 0x30, 0xf4, 0xad, 0xc3, 0x61, 0x88, 0xc5, 0x67, 0x7a, 0xf1, 0x04, 0x4d, 0x65, 0x9e, 0xfa, 0xc8, + 0xf3, 0x70, 0x5f, 0x1c, 0xc1, 0xe5, 0xf0, 0xcc, 0x7d, 0xcc, 0xdb, 0xaf, 0x42, 0x9b, 0xf8, 0x47, + 0x12, 0xd7, 0x3c, 0xd9, 0xb9, 0xbd, 0x28, 0xbe, 0x5d, 0xdd, 0xf7, 0x49, 0x48, 0xf6, 0x8b, 0xbf, + 0x28, 0x95, 0xf7, 0x76, 0x0f, 0x0e, 0x6b, 0xec, 0x63, 0xd0, 0x37, 0xff, 0x19, 0x00, 0x00, 0xff, + 0xff, 0xd4, 0x0a, 0xef, 0xca, 0xe4, 0x3a, 0x00, 0x00, } diff --git a/vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.proto b/vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.proto deleted file mode 100644 index 557c880..0000000 --- a/vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.proto +++ /dev/null @@ -1,663 +0,0 @@ -// Copyright 2017 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// THIS FILE IS AUTOMATICALLY GENERATED. - -syntax = "proto3"; - -package openapi.v2; - -import "google/protobuf/any.proto"; - -// This option lets the proto compiler generate Java code inside the package -// name (see below) instead of inside an outer class. It creates a simpler -// developer experience by reducing one-level of name nesting and be -// consistent with most programming languages that don't support outer classes. -option java_multiple_files = true; - -// The Java outer classname should be the filename in UpperCamelCase. This -// class is only used to hold proto descriptor, so developers don't need to -// work with it directly. -option java_outer_classname = "OpenAPIProto"; - -// The Java package name must be proto package name with proper prefix. -option java_package = "org.openapi_v2"; - -// A reasonable prefix for the Objective-C symbols generated from the package. -// It should at a minimum be 3 characters long, all uppercase, and convention -// is to use an abbreviation of the package name. Something short, but -// hopefully unique enough to not conflict with things that may come along in -// the future. 'GPB' is reserved for the protocol buffer implementation itself. -option objc_class_prefix = "OAS"; - -message AdditionalPropertiesItem { - oneof oneof { - Schema schema = 1; - bool boolean = 2; - } -} - -message Any { - google.protobuf.Any value = 1; - string yaml = 2; -} - -message ApiKeySecurity { - string type = 1; - string name = 2; - string in = 3; - string description = 4; - repeated NamedAny vendor_extension = 5; -} - -message BasicAuthenticationSecurity { - string type = 1; - string description = 2; - repeated NamedAny vendor_extension = 3; -} - -message BodyParameter { - // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. - string description = 1; - // The name of the parameter. - string name = 2; - // Determines the location of the parameter. - string in = 3; - // Determines whether or not this parameter is required or optional. - bool required = 4; - Schema schema = 5; - repeated NamedAny vendor_extension = 6; -} - -// Contact information for the owners of the API. -message Contact { - // The identifying name of the contact person/organization. - string name = 1; - // The URL pointing to the contact information. - string url = 2; - // The email address of the contact person/organization. - string email = 3; - repeated NamedAny vendor_extension = 4; -} - -message Default { - repeated NamedAny additional_properties = 1; -} - -// One or more JSON objects describing the schemas being consumed and produced by the API. -message Definitions { - repeated NamedSchema additional_properties = 1; -} - -message Document { - // The Swagger version of this document. - string swagger = 1; - Info info = 2; - // The host (name or ip) of the API. Example: 'swagger.io' - string host = 3; - // The base path to the API. Example: '/api'. - string base_path = 4; - // The transfer protocol of the API. - repeated string schemes = 5; - // A list of MIME types accepted by the API. - repeated string consumes = 6; - // A list of MIME types the API can produce. - repeated string produces = 7; - Paths paths = 8; - Definitions definitions = 9; - ParameterDefinitions parameters = 10; - ResponseDefinitions responses = 11; - repeated SecurityRequirement security = 12; - SecurityDefinitions security_definitions = 13; - repeated Tag tags = 14; - ExternalDocs external_docs = 15; - repeated NamedAny vendor_extension = 16; -} - -message Examples { - repeated NamedAny additional_properties = 1; -} - -// information about external documentation -message ExternalDocs { - string description = 1; - string url = 2; - repeated NamedAny vendor_extension = 3; -} - -// A deterministic version of a JSON Schema object. -message FileSchema { - string format = 1; - string title = 2; - string description = 3; - Any default = 4; - repeated string required = 5; - string type = 6; - bool read_only = 7; - ExternalDocs external_docs = 8; - Any example = 9; - repeated NamedAny vendor_extension = 10; -} - -message FormDataParameterSubSchema { - // Determines whether or not this parameter is required or optional. - bool required = 1; - // Determines the location of the parameter. - string in = 2; - // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. - string description = 3; - // The name of the parameter. - string name = 4; - // allows sending a parameter by name only or with an empty value. - bool allow_empty_value = 5; - string type = 6; - string format = 7; - PrimitivesItems items = 8; - string collection_format = 9; - Any default = 10; - double maximum = 11; - bool exclusive_maximum = 12; - double minimum = 13; - bool exclusive_minimum = 14; - int64 max_length = 15; - int64 min_length = 16; - string pattern = 17; - int64 max_items = 18; - int64 min_items = 19; - bool unique_items = 20; - repeated Any enum = 21; - double multiple_of = 22; - repeated NamedAny vendor_extension = 23; -} - -message Header { - string type = 1; - string format = 2; - PrimitivesItems items = 3; - string collection_format = 4; - Any default = 5; - double maximum = 6; - bool exclusive_maximum = 7; - double minimum = 8; - bool exclusive_minimum = 9; - int64 max_length = 10; - int64 min_length = 11; - string pattern = 12; - int64 max_items = 13; - int64 min_items = 14; - bool unique_items = 15; - repeated Any enum = 16; - double multiple_of = 17; - string description = 18; - repeated NamedAny vendor_extension = 19; -} - -message HeaderParameterSubSchema { - // Determines whether or not this parameter is required or optional. - bool required = 1; - // Determines the location of the parameter. - string in = 2; - // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. - string description = 3; - // The name of the parameter. - string name = 4; - string type = 5; - string format = 6; - PrimitivesItems items = 7; - string collection_format = 8; - Any default = 9; - double maximum = 10; - bool exclusive_maximum = 11; - double minimum = 12; - bool exclusive_minimum = 13; - int64 max_length = 14; - int64 min_length = 15; - string pattern = 16; - int64 max_items = 17; - int64 min_items = 18; - bool unique_items = 19; - repeated Any enum = 20; - double multiple_of = 21; - repeated NamedAny vendor_extension = 22; -} - -message Headers { - repeated NamedHeader additional_properties = 1; -} - -// General information about the API. -message Info { - // A unique and precise title of the API. - string title = 1; - // A semantic version number of the API. - string version = 2; - // A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed. - string description = 3; - // The terms of service for the API. - string terms_of_service = 4; - Contact contact = 5; - License license = 6; - repeated NamedAny vendor_extension = 7; -} - -message ItemsItem { - repeated Schema schema = 1; -} - -message JsonReference { - string _ref = 1; - string description = 2; -} - -message License { - // The name of the license type. It's encouraged to use an OSI compatible license. - string name = 1; - // The URL pointing to the license. - string url = 2; - repeated NamedAny vendor_extension = 3; -} - -// Automatically-generated message used to represent maps of Any as ordered (name,value) pairs. -message NamedAny { - // Map key - string name = 1; - // Mapped value - Any value = 2; -} - -// Automatically-generated message used to represent maps of Header as ordered (name,value) pairs. -message NamedHeader { - // Map key - string name = 1; - // Mapped value - Header value = 2; -} - -// Automatically-generated message used to represent maps of Parameter as ordered (name,value) pairs. -message NamedParameter { - // Map key - string name = 1; - // Mapped value - Parameter value = 2; -} - -// Automatically-generated message used to represent maps of PathItem as ordered (name,value) pairs. -message NamedPathItem { - // Map key - string name = 1; - // Mapped value - PathItem value = 2; -} - -// Automatically-generated message used to represent maps of Response as ordered (name,value) pairs. -message NamedResponse { - // Map key - string name = 1; - // Mapped value - Response value = 2; -} - -// Automatically-generated message used to represent maps of ResponseValue as ordered (name,value) pairs. -message NamedResponseValue { - // Map key - string name = 1; - // Mapped value - ResponseValue value = 2; -} - -// Automatically-generated message used to represent maps of Schema as ordered (name,value) pairs. -message NamedSchema { - // Map key - string name = 1; - // Mapped value - Schema value = 2; -} - -// Automatically-generated message used to represent maps of SecurityDefinitionsItem as ordered (name,value) pairs. -message NamedSecurityDefinitionsItem { - // Map key - string name = 1; - // Mapped value - SecurityDefinitionsItem value = 2; -} - -// Automatically-generated message used to represent maps of string as ordered (name,value) pairs. -message NamedString { - // Map key - string name = 1; - // Mapped value - string value = 2; -} - -// Automatically-generated message used to represent maps of StringArray as ordered (name,value) pairs. -message NamedStringArray { - // Map key - string name = 1; - // Mapped value - StringArray value = 2; -} - -message NonBodyParameter { - oneof oneof { - HeaderParameterSubSchema header_parameter_sub_schema = 1; - FormDataParameterSubSchema form_data_parameter_sub_schema = 2; - QueryParameterSubSchema query_parameter_sub_schema = 3; - PathParameterSubSchema path_parameter_sub_schema = 4; - } -} - -message Oauth2AccessCodeSecurity { - string type = 1; - string flow = 2; - Oauth2Scopes scopes = 3; - string authorization_url = 4; - string token_url = 5; - string description = 6; - repeated NamedAny vendor_extension = 7; -} - -message Oauth2ApplicationSecurity { - string type = 1; - string flow = 2; - Oauth2Scopes scopes = 3; - string token_url = 4; - string description = 5; - repeated NamedAny vendor_extension = 6; -} - -message Oauth2ImplicitSecurity { - string type = 1; - string flow = 2; - Oauth2Scopes scopes = 3; - string authorization_url = 4; - string description = 5; - repeated NamedAny vendor_extension = 6; -} - -message Oauth2PasswordSecurity { - string type = 1; - string flow = 2; - Oauth2Scopes scopes = 3; - string token_url = 4; - string description = 5; - repeated NamedAny vendor_extension = 6; -} - -message Oauth2Scopes { - repeated NamedString additional_properties = 1; -} - -message Operation { - repeated string tags = 1; - // A brief summary of the operation. - string summary = 2; - // A longer description of the operation, GitHub Flavored Markdown is allowed. - string description = 3; - ExternalDocs external_docs = 4; - // A unique identifier of the operation. - string operation_id = 5; - // A list of MIME types the API can produce. - repeated string produces = 6; - // A list of MIME types the API can consume. - repeated string consumes = 7; - // The parameters needed to send a valid API call. - repeated ParametersItem parameters = 8; - Responses responses = 9; - // The transfer protocol of the API. - repeated string schemes = 10; - bool deprecated = 11; - repeated SecurityRequirement security = 12; - repeated NamedAny vendor_extension = 13; -} - -message Parameter { - oneof oneof { - BodyParameter body_parameter = 1; - NonBodyParameter non_body_parameter = 2; - } -} - -// One or more JSON representations for parameters -message ParameterDefinitions { - repeated NamedParameter additional_properties = 1; -} - -message ParametersItem { - oneof oneof { - Parameter parameter = 1; - JsonReference json_reference = 2; - } -} - -message PathItem { - string _ref = 1; - Operation get = 2; - Operation put = 3; - Operation post = 4; - Operation delete = 5; - Operation options = 6; - Operation head = 7; - Operation patch = 8; - // The parameters needed to send a valid API call. - repeated ParametersItem parameters = 9; - repeated NamedAny vendor_extension = 10; -} - -message PathParameterSubSchema { - // Determines whether or not this parameter is required or optional. - bool required = 1; - // Determines the location of the parameter. - string in = 2; - // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. - string description = 3; - // The name of the parameter. - string name = 4; - string type = 5; - string format = 6; - PrimitivesItems items = 7; - string collection_format = 8; - Any default = 9; - double maximum = 10; - bool exclusive_maximum = 11; - double minimum = 12; - bool exclusive_minimum = 13; - int64 max_length = 14; - int64 min_length = 15; - string pattern = 16; - int64 max_items = 17; - int64 min_items = 18; - bool unique_items = 19; - repeated Any enum = 20; - double multiple_of = 21; - repeated NamedAny vendor_extension = 22; -} - -// Relative paths to the individual endpoints. They must be relative to the 'basePath'. -message Paths { - repeated NamedAny vendor_extension = 1; - repeated NamedPathItem path = 2; -} - -message PrimitivesItems { - string type = 1; - string format = 2; - PrimitivesItems items = 3; - string collection_format = 4; - Any default = 5; - double maximum = 6; - bool exclusive_maximum = 7; - double minimum = 8; - bool exclusive_minimum = 9; - int64 max_length = 10; - int64 min_length = 11; - string pattern = 12; - int64 max_items = 13; - int64 min_items = 14; - bool unique_items = 15; - repeated Any enum = 16; - double multiple_of = 17; - repeated NamedAny vendor_extension = 18; -} - -message Properties { - repeated NamedSchema additional_properties = 1; -} - -message QueryParameterSubSchema { - // Determines whether or not this parameter is required or optional. - bool required = 1; - // Determines the location of the parameter. - string in = 2; - // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. - string description = 3; - // The name of the parameter. - string name = 4; - // allows sending a parameter by name only or with an empty value. - bool allow_empty_value = 5; - string type = 6; - string format = 7; - PrimitivesItems items = 8; - string collection_format = 9; - Any default = 10; - double maximum = 11; - bool exclusive_maximum = 12; - double minimum = 13; - bool exclusive_minimum = 14; - int64 max_length = 15; - int64 min_length = 16; - string pattern = 17; - int64 max_items = 18; - int64 min_items = 19; - bool unique_items = 20; - repeated Any enum = 21; - double multiple_of = 22; - repeated NamedAny vendor_extension = 23; -} - -message Response { - string description = 1; - SchemaItem schema = 2; - Headers headers = 3; - Examples examples = 4; - repeated NamedAny vendor_extension = 5; -} - -// One or more JSON representations for parameters -message ResponseDefinitions { - repeated NamedResponse additional_properties = 1; -} - -message ResponseValue { - oneof oneof { - Response response = 1; - JsonReference json_reference = 2; - } -} - -// Response objects names can either be any valid HTTP status code or 'default'. -message Responses { - repeated NamedResponseValue response_code = 1; - repeated NamedAny vendor_extension = 2; -} - -// A deterministic version of a JSON Schema object. -message Schema { - string _ref = 1; - string format = 2; - string title = 3; - string description = 4; - Any default = 5; - double multiple_of = 6; - double maximum = 7; - bool exclusive_maximum = 8; - double minimum = 9; - bool exclusive_minimum = 10; - int64 max_length = 11; - int64 min_length = 12; - string pattern = 13; - int64 max_items = 14; - int64 min_items = 15; - bool unique_items = 16; - int64 max_properties = 17; - int64 min_properties = 18; - repeated string required = 19; - repeated Any enum = 20; - AdditionalPropertiesItem additional_properties = 21; - TypeItem type = 22; - ItemsItem items = 23; - repeated Schema all_of = 24; - Properties properties = 25; - string discriminator = 26; - bool read_only = 27; - Xml xml = 28; - ExternalDocs external_docs = 29; - Any example = 30; - repeated NamedAny vendor_extension = 31; -} - -message SchemaItem { - oneof oneof { - Schema schema = 1; - FileSchema file_schema = 2; - } -} - -message SecurityDefinitions { - repeated NamedSecurityDefinitionsItem additional_properties = 1; -} - -message SecurityDefinitionsItem { - oneof oneof { - BasicAuthenticationSecurity basic_authentication_security = 1; - ApiKeySecurity api_key_security = 2; - Oauth2ImplicitSecurity oauth2_implicit_security = 3; - Oauth2PasswordSecurity oauth2_password_security = 4; - Oauth2ApplicationSecurity oauth2_application_security = 5; - Oauth2AccessCodeSecurity oauth2_access_code_security = 6; - } -} - -message SecurityRequirement { - repeated NamedStringArray additional_properties = 1; -} - -message StringArray { - repeated string value = 1; -} - -message Tag { - string name = 1; - string description = 2; - ExternalDocs external_docs = 3; - repeated NamedAny vendor_extension = 4; -} - -message TypeItem { - repeated string value = 1; -} - -// Any property starting with x- is valid. -message VendorExtension { - repeated NamedAny additional_properties = 1; -} - -message Xml { - string name = 1; - string namespace = 2; - string prefix = 3; - bool attribute = 4; - bool wrapped = 5; - repeated NamedAny vendor_extension = 6; -} - diff --git a/vendor/github.com/googleapis/gnostic/OpenAPIv2/README.md b/vendor/github.com/googleapis/gnostic/OpenAPIv2/README.md deleted file mode 100644 index 836fb32..0000000 --- a/vendor/github.com/googleapis/gnostic/OpenAPIv2/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# OpenAPI v2 Protocol Buffer Models - -This directory contains a Protocol Buffer-language model -and related code for supporting OpenAPI v2. - -Gnostic applications and plugins can use OpenAPIv2.proto -to generate Protocol Buffer support code for their preferred languages. - -OpenAPIv2.go is used by Gnostic to read JSON and YAML OpenAPI -descriptions into the Protocol Buffer-based datastructures -generated from OpenAPIv2.proto. - -OpenAPIv2.proto and OpenAPIv2.go are generated by the Gnostic -compiler generator, and OpenAPIv2.pb.go is generated by -protoc, the Protocol Buffer compiler, and protoc-gen-go, the -Protocol Buffer Go code generation plugin. diff --git a/vendor/github.com/googleapis/gnostic/OpenAPIv2/openapi-2.0.json b/vendor/github.com/googleapis/gnostic/OpenAPIv2/openapi-2.0.json deleted file mode 100644 index 2815a26..0000000 --- a/vendor/github.com/googleapis/gnostic/OpenAPIv2/openapi-2.0.json +++ /dev/null @@ -1,1610 +0,0 @@ -{ - "title": "A JSON Schema for Swagger 2.0 API.", - "id": "http://swagger.io/v2/schema.json#", - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "required": [ - "swagger", - "info", - "paths" - ], - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "swagger": { - "type": "string", - "enum": [ - "2.0" - ], - "description": "The Swagger version of this document." - }, - "info": { - "$ref": "#/definitions/info" - }, - "host": { - "type": "string", - "pattern": "^[^{}/ :\\\\]+(?::\\d+)?$", - "description": "The host (name or ip) of the API. Example: 'swagger.io'" - }, - "basePath": { - "type": "string", - "pattern": "^/", - "description": "The base path to the API. Example: '/api'." - }, - "schemes": { - "$ref": "#/definitions/schemesList" - }, - "consumes": { - "description": "A list of MIME types accepted by the API.", - "allOf": [ - { - "$ref": "#/definitions/mediaTypeList" - } - ] - }, - "produces": { - "description": "A list of MIME types the API can produce.", - "allOf": [ - { - "$ref": "#/definitions/mediaTypeList" - } - ] - }, - "paths": { - "$ref": "#/definitions/paths" - }, - "definitions": { - "$ref": "#/definitions/definitions" - }, - "parameters": { - "$ref": "#/definitions/parameterDefinitions" - }, - "responses": { - "$ref": "#/definitions/responseDefinitions" - }, - "security": { - "$ref": "#/definitions/security" - }, - "securityDefinitions": { - "$ref": "#/definitions/securityDefinitions" - }, - "tags": { - "type": "array", - "items": { - "$ref": "#/definitions/tag" - }, - "uniqueItems": true - }, - "externalDocs": { - "$ref": "#/definitions/externalDocs" - } - }, - "definitions": { - "info": { - "type": "object", - "description": "General information about the API.", - "required": [ - "version", - "title" - ], - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "title": { - "type": "string", - "description": "A unique and precise title of the API." - }, - "version": { - "type": "string", - "description": "A semantic version number of the API." - }, - "description": { - "type": "string", - "description": "A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed." - }, - "termsOfService": { - "type": "string", - "description": "The terms of service for the API." - }, - "contact": { - "$ref": "#/definitions/contact" - }, - "license": { - "$ref": "#/definitions/license" - } - } - }, - "contact": { - "type": "object", - "description": "Contact information for the owners of the API.", - "additionalProperties": false, - "properties": { - "name": { - "type": "string", - "description": "The identifying name of the contact person/organization." - }, - "url": { - "type": "string", - "description": "The URL pointing to the contact information.", - "format": "uri" - }, - "email": { - "type": "string", - "description": "The email address of the contact person/organization.", - "format": "email" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "license": { - "type": "object", - "required": [ - "name" - ], - "additionalProperties": false, - "properties": { - "name": { - "type": "string", - "description": "The name of the license type. It's encouraged to use an OSI compatible license." - }, - "url": { - "type": "string", - "description": "The URL pointing to the license.", - "format": "uri" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "paths": { - "type": "object", - "description": "Relative paths to the individual endpoints. They must be relative to the 'basePath'.", - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - }, - "^/": { - "$ref": "#/definitions/pathItem" - } - }, - "additionalProperties": false - }, - "definitions": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/schema" - }, - "description": "One or more JSON objects describing the schemas being consumed and produced by the API." - }, - "parameterDefinitions": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/parameter" - }, - "description": "One or more JSON representations for parameters" - }, - "responseDefinitions": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/response" - }, - "description": "One or more JSON representations for parameters" - }, - "externalDocs": { - "type": "object", - "additionalProperties": false, - "description": "information about external documentation", - "required": [ - "url" - ], - "properties": { - "description": { - "type": "string" - }, - "url": { - "type": "string", - "format": "uri" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "examples": { - "type": "object", - "additionalProperties": true - }, - "mimeType": { - "type": "string", - "description": "The MIME type of the HTTP message." - }, - "operation": { - "type": "object", - "required": [ - "responses" - ], - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "uniqueItems": true - }, - "summary": { - "type": "string", - "description": "A brief summary of the operation." - }, - "description": { - "type": "string", - "description": "A longer description of the operation, GitHub Flavored Markdown is allowed." - }, - "externalDocs": { - "$ref": "#/definitions/externalDocs" - }, - "operationId": { - "type": "string", - "description": "A unique identifier of the operation." - }, - "produces": { - "description": "A list of MIME types the API can produce.", - "allOf": [ - { - "$ref": "#/definitions/mediaTypeList" - } - ] - }, - "consumes": { - "description": "A list of MIME types the API can consume.", - "allOf": [ - { - "$ref": "#/definitions/mediaTypeList" - } - ] - }, - "parameters": { - "$ref": "#/definitions/parametersList" - }, - "responses": { - "$ref": "#/definitions/responses" - }, - "schemes": { - "$ref": "#/definitions/schemesList" - }, - "deprecated": { - "type": "boolean", - "default": false - }, - "security": { - "$ref": "#/definitions/security" - } - } - }, - "pathItem": { - "type": "object", - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "$ref": { - "type": "string" - }, - "get": { - "$ref": "#/definitions/operation" - }, - "put": { - "$ref": "#/definitions/operation" - }, - "post": { - "$ref": "#/definitions/operation" - }, - "delete": { - "$ref": "#/definitions/operation" - }, - "options": { - "$ref": "#/definitions/operation" - }, - "head": { - "$ref": "#/definitions/operation" - }, - "patch": { - "$ref": "#/definitions/operation" - }, - "parameters": { - "$ref": "#/definitions/parametersList" - } - } - }, - "responses": { - "type": "object", - "description": "Response objects names can either be any valid HTTP status code or 'default'.", - "minProperties": 1, - "additionalProperties": false, - "patternProperties": { - "^([0-9]{3})$|^(default)$": { - "$ref": "#/definitions/responseValue" - }, - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "not": { - "type": "object", - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - } - }, - "responseValue": { - "oneOf": [ - { - "$ref": "#/definitions/response" - }, - { - "$ref": "#/definitions/jsonReference" - } - ] - }, - "response": { - "type": "object", - "required": [ - "description" - ], - "properties": { - "description": { - "type": "string" - }, - "schema": { - "oneOf": [ - { - "$ref": "#/definitions/schema" - }, - { - "$ref": "#/definitions/fileSchema" - } - ] - }, - "headers": { - "$ref": "#/definitions/headers" - }, - "examples": { - "$ref": "#/definitions/examples" - } - }, - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "headers": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/header" - } - }, - "header": { - "type": "object", - "additionalProperties": false, - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "string", - "number", - "integer", - "boolean", - "array" - ] - }, - "format": { - "type": "string" - }, - "items": { - "$ref": "#/definitions/primitivesItems" - }, - "collectionFormat": { - "$ref": "#/definitions/collectionFormat" - }, - "default": { - "$ref": "#/definitions/default" - }, - "maximum": { - "$ref": "#/definitions/maximum" - }, - "exclusiveMaximum": { - "$ref": "#/definitions/exclusiveMaximum" - }, - "minimum": { - "$ref": "#/definitions/minimum" - }, - "exclusiveMinimum": { - "$ref": "#/definitions/exclusiveMinimum" - }, - "maxLength": { - "$ref": "#/definitions/maxLength" - }, - "minLength": { - "$ref": "#/definitions/minLength" - }, - "pattern": { - "$ref": "#/definitions/pattern" - }, - "maxItems": { - "$ref": "#/definitions/maxItems" - }, - "minItems": { - "$ref": "#/definitions/minItems" - }, - "uniqueItems": { - "$ref": "#/definitions/uniqueItems" - }, - "enum": { - "$ref": "#/definitions/enum" - }, - "multipleOf": { - "$ref": "#/definitions/multipleOf" - }, - "description": { - "type": "string" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "vendorExtension": { - "description": "Any property starting with x- is valid.", - "additionalProperties": true, - "additionalItems": true - }, - "bodyParameter": { - "type": "object", - "required": [ - "name", - "in", - "schema" - ], - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "description": { - "type": "string", - "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." - }, - "name": { - "type": "string", - "description": "The name of the parameter." - }, - "in": { - "type": "string", - "description": "Determines the location of the parameter.", - "enum": [ - "body" - ] - }, - "required": { - "type": "boolean", - "description": "Determines whether or not this parameter is required or optional.", - "default": false - }, - "schema": { - "$ref": "#/definitions/schema" - } - }, - "additionalProperties": false - }, - "headerParameterSubSchema": { - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "required": { - "type": "boolean", - "description": "Determines whether or not this parameter is required or optional.", - "default": false - }, - "in": { - "type": "string", - "description": "Determines the location of the parameter.", - "enum": [ - "header" - ] - }, - "description": { - "type": "string", - "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." - }, - "name": { - "type": "string", - "description": "The name of the parameter." - }, - "type": { - "type": "string", - "enum": [ - "string", - "number", - "boolean", - "integer", - "array" - ] - }, - "format": { - "type": "string" - }, - "items": { - "$ref": "#/definitions/primitivesItems" - }, - "collectionFormat": { - "$ref": "#/definitions/collectionFormat" - }, - "default": { - "$ref": "#/definitions/default" - }, - "maximum": { - "$ref": "#/definitions/maximum" - }, - "exclusiveMaximum": { - "$ref": "#/definitions/exclusiveMaximum" - }, - "minimum": { - "$ref": "#/definitions/minimum" - }, - "exclusiveMinimum": { - "$ref": "#/definitions/exclusiveMinimum" - }, - "maxLength": { - "$ref": "#/definitions/maxLength" - }, - "minLength": { - "$ref": "#/definitions/minLength" - }, - "pattern": { - "$ref": "#/definitions/pattern" - }, - "maxItems": { - "$ref": "#/definitions/maxItems" - }, - "minItems": { - "$ref": "#/definitions/minItems" - }, - "uniqueItems": { - "$ref": "#/definitions/uniqueItems" - }, - "enum": { - "$ref": "#/definitions/enum" - }, - "multipleOf": { - "$ref": "#/definitions/multipleOf" - } - } - }, - "queryParameterSubSchema": { - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "required": { - "type": "boolean", - "description": "Determines whether or not this parameter is required or optional.", - "default": false - }, - "in": { - "type": "string", - "description": "Determines the location of the parameter.", - "enum": [ - "query" - ] - }, - "description": { - "type": "string", - "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." - }, - "name": { - "type": "string", - "description": "The name of the parameter." - }, - "allowEmptyValue": { - "type": "boolean", - "default": false, - "description": "allows sending a parameter by name only or with an empty value." - }, - "type": { - "type": "string", - "enum": [ - "string", - "number", - "boolean", - "integer", - "array" - ] - }, - "format": { - "type": "string" - }, - "items": { - "$ref": "#/definitions/primitivesItems" - }, - "collectionFormat": { - "$ref": "#/definitions/collectionFormatWithMulti" - }, - "default": { - "$ref": "#/definitions/default" - }, - "maximum": { - "$ref": "#/definitions/maximum" - }, - "exclusiveMaximum": { - "$ref": "#/definitions/exclusiveMaximum" - }, - "minimum": { - "$ref": "#/definitions/minimum" - }, - "exclusiveMinimum": { - "$ref": "#/definitions/exclusiveMinimum" - }, - "maxLength": { - "$ref": "#/definitions/maxLength" - }, - "minLength": { - "$ref": "#/definitions/minLength" - }, - "pattern": { - "$ref": "#/definitions/pattern" - }, - "maxItems": { - "$ref": "#/definitions/maxItems" - }, - "minItems": { - "$ref": "#/definitions/minItems" - }, - "uniqueItems": { - "$ref": "#/definitions/uniqueItems" - }, - "enum": { - "$ref": "#/definitions/enum" - }, - "multipleOf": { - "$ref": "#/definitions/multipleOf" - } - } - }, - "formDataParameterSubSchema": { - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "required": { - "type": "boolean", - "description": "Determines whether or not this parameter is required or optional.", - "default": false - }, - "in": { - "type": "string", - "description": "Determines the location of the parameter.", - "enum": [ - "formData" - ] - }, - "description": { - "type": "string", - "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." - }, - "name": { - "type": "string", - "description": "The name of the parameter." - }, - "allowEmptyValue": { - "type": "boolean", - "default": false, - "description": "allows sending a parameter by name only or with an empty value." - }, - "type": { - "type": "string", - "enum": [ - "string", - "number", - "boolean", - "integer", - "array", - "file" - ] - }, - "format": { - "type": "string" - }, - "items": { - "$ref": "#/definitions/primitivesItems" - }, - "collectionFormat": { - "$ref": "#/definitions/collectionFormatWithMulti" - }, - "default": { - "$ref": "#/definitions/default" - }, - "maximum": { - "$ref": "#/definitions/maximum" - }, - "exclusiveMaximum": { - "$ref": "#/definitions/exclusiveMaximum" - }, - "minimum": { - "$ref": "#/definitions/minimum" - }, - "exclusiveMinimum": { - "$ref": "#/definitions/exclusiveMinimum" - }, - "maxLength": { - "$ref": "#/definitions/maxLength" - }, - "minLength": { - "$ref": "#/definitions/minLength" - }, - "pattern": { - "$ref": "#/definitions/pattern" - }, - "maxItems": { - "$ref": "#/definitions/maxItems" - }, - "minItems": { - "$ref": "#/definitions/minItems" - }, - "uniqueItems": { - "$ref": "#/definitions/uniqueItems" - }, - "enum": { - "$ref": "#/definitions/enum" - }, - "multipleOf": { - "$ref": "#/definitions/multipleOf" - } - } - }, - "pathParameterSubSchema": { - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "required": [ - "required" - ], - "properties": { - "required": { - "type": "boolean", - "enum": [ - true - ], - "description": "Determines whether or not this parameter is required or optional." - }, - "in": { - "type": "string", - "description": "Determines the location of the parameter.", - "enum": [ - "path" - ] - }, - "description": { - "type": "string", - "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." - }, - "name": { - "type": "string", - "description": "The name of the parameter." - }, - "type": { - "type": "string", - "enum": [ - "string", - "number", - "boolean", - "integer", - "array" - ] - }, - "format": { - "type": "string" - }, - "items": { - "$ref": "#/definitions/primitivesItems" - }, - "collectionFormat": { - "$ref": "#/definitions/collectionFormat" - }, - "default": { - "$ref": "#/definitions/default" - }, - "maximum": { - "$ref": "#/definitions/maximum" - }, - "exclusiveMaximum": { - "$ref": "#/definitions/exclusiveMaximum" - }, - "minimum": { - "$ref": "#/definitions/minimum" - }, - "exclusiveMinimum": { - "$ref": "#/definitions/exclusiveMinimum" - }, - "maxLength": { - "$ref": "#/definitions/maxLength" - }, - "minLength": { - "$ref": "#/definitions/minLength" - }, - "pattern": { - "$ref": "#/definitions/pattern" - }, - "maxItems": { - "$ref": "#/definitions/maxItems" - }, - "minItems": { - "$ref": "#/definitions/minItems" - }, - "uniqueItems": { - "$ref": "#/definitions/uniqueItems" - }, - "enum": { - "$ref": "#/definitions/enum" - }, - "multipleOf": { - "$ref": "#/definitions/multipleOf" - } - } - }, - "nonBodyParameter": { - "type": "object", - "required": [ - "name", - "in", - "type" - ], - "oneOf": [ - { - "$ref": "#/definitions/headerParameterSubSchema" - }, - { - "$ref": "#/definitions/formDataParameterSubSchema" - }, - { - "$ref": "#/definitions/queryParameterSubSchema" - }, - { - "$ref": "#/definitions/pathParameterSubSchema" - } - ] - }, - "parameter": { - "oneOf": [ - { - "$ref": "#/definitions/bodyParameter" - }, - { - "$ref": "#/definitions/nonBodyParameter" - } - ] - }, - "schema": { - "type": "object", - "description": "A deterministic version of a JSON Schema object.", - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "$ref": { - "type": "string" - }, - "format": { - "type": "string" - }, - "title": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/title" - }, - "description": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/description" - }, - "default": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/default" - }, - "multipleOf": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/multipleOf" - }, - "maximum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/maximum" - }, - "exclusiveMaximum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum" - }, - "minimum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/minimum" - }, - "exclusiveMinimum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum" - }, - "maxLength": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger" - }, - "minLength": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0" - }, - "pattern": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/pattern" - }, - "maxItems": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger" - }, - "minItems": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0" - }, - "uniqueItems": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/uniqueItems" - }, - "maxProperties": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger" - }, - "minProperties": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0" - }, - "required": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray" - }, - "enum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/enum" - }, - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/definitions/schema" - }, - { - "type": "boolean" - } - ], - "default": {} - }, - "type": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/type" - }, - "items": { - "anyOf": [ - { - "$ref": "#/definitions/schema" - }, - { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/schema" - } - } - ], - "default": {} - }, - "allOf": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/schema" - } - }, - "properties": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/schema" - }, - "default": {} - }, - "discriminator": { - "type": "string" - }, - "readOnly": { - "type": "boolean", - "default": false - }, - "xml": { - "$ref": "#/definitions/xml" - }, - "externalDocs": { - "$ref": "#/definitions/externalDocs" - }, - "example": {} - }, - "additionalProperties": false - }, - "fileSchema": { - "type": "object", - "description": "A deterministic version of a JSON Schema object.", - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "required": [ - "type" - ], - "properties": { - "format": { - "type": "string" - }, - "title": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/title" - }, - "description": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/description" - }, - "default": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/default" - }, - "required": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray" - }, - "type": { - "type": "string", - "enum": [ - "file" - ] - }, - "readOnly": { - "type": "boolean", - "default": false - }, - "externalDocs": { - "$ref": "#/definitions/externalDocs" - }, - "example": {} - }, - "additionalProperties": false - }, - "primitivesItems": { - "type": "object", - "additionalProperties": false, - "properties": { - "type": { - "type": "string", - "enum": [ - "string", - "number", - "integer", - "boolean", - "array" - ] - }, - "format": { - "type": "string" - }, - "items": { - "$ref": "#/definitions/primitivesItems" - }, - "collectionFormat": { - "$ref": "#/definitions/collectionFormat" - }, - "default": { - "$ref": "#/definitions/default" - }, - "maximum": { - "$ref": "#/definitions/maximum" - }, - "exclusiveMaximum": { - "$ref": "#/definitions/exclusiveMaximum" - }, - "minimum": { - "$ref": "#/definitions/minimum" - }, - "exclusiveMinimum": { - "$ref": "#/definitions/exclusiveMinimum" - }, - "maxLength": { - "$ref": "#/definitions/maxLength" - }, - "minLength": { - "$ref": "#/definitions/minLength" - }, - "pattern": { - "$ref": "#/definitions/pattern" - }, - "maxItems": { - "$ref": "#/definitions/maxItems" - }, - "minItems": { - "$ref": "#/definitions/minItems" - }, - "uniqueItems": { - "$ref": "#/definitions/uniqueItems" - }, - "enum": { - "$ref": "#/definitions/enum" - }, - "multipleOf": { - "$ref": "#/definitions/multipleOf" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "security": { - "type": "array", - "items": { - "$ref": "#/definitions/securityRequirement" - }, - "uniqueItems": true - }, - "securityRequirement": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - }, - "uniqueItems": true - } - }, - "xml": { - "type": "object", - "additionalProperties": false, - "properties": { - "name": { - "type": "string" - }, - "namespace": { - "type": "string" - }, - "prefix": { - "type": "string" - }, - "attribute": { - "type": "boolean", - "default": false - }, - "wrapped": { - "type": "boolean", - "default": false - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "tag": { - "type": "object", - "additionalProperties": false, - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "externalDocs": { - "$ref": "#/definitions/externalDocs" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "securityDefinitions": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/definitions/basicAuthenticationSecurity" - }, - { - "$ref": "#/definitions/apiKeySecurity" - }, - { - "$ref": "#/definitions/oauth2ImplicitSecurity" - }, - { - "$ref": "#/definitions/oauth2PasswordSecurity" - }, - { - "$ref": "#/definitions/oauth2ApplicationSecurity" - }, - { - "$ref": "#/definitions/oauth2AccessCodeSecurity" - } - ] - } - }, - "basicAuthenticationSecurity": { - "type": "object", - "additionalProperties": false, - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "basic" - ] - }, - "description": { - "type": "string" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "apiKeySecurity": { - "type": "object", - "additionalProperties": false, - "required": [ - "type", - "name", - "in" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "apiKey" - ] - }, - "name": { - "type": "string" - }, - "in": { - "type": "string", - "enum": [ - "header", - "query" - ] - }, - "description": { - "type": "string" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "oauth2ImplicitSecurity": { - "type": "object", - "additionalProperties": false, - "required": [ - "type", - "flow", - "authorizationUrl" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "oauth2" - ] - }, - "flow": { - "type": "string", - "enum": [ - "implicit" - ] - }, - "scopes": { - "$ref": "#/definitions/oauth2Scopes" - }, - "authorizationUrl": { - "type": "string", - "format": "uri" - }, - "description": { - "type": "string" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "oauth2PasswordSecurity": { - "type": "object", - "additionalProperties": false, - "required": [ - "type", - "flow", - "tokenUrl" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "oauth2" - ] - }, - "flow": { - "type": "string", - "enum": [ - "password" - ] - }, - "scopes": { - "$ref": "#/definitions/oauth2Scopes" - }, - "tokenUrl": { - "type": "string", - "format": "uri" - }, - "description": { - "type": "string" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "oauth2ApplicationSecurity": { - "type": "object", - "additionalProperties": false, - "required": [ - "type", - "flow", - "tokenUrl" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "oauth2" - ] - }, - "flow": { - "type": "string", - "enum": [ - "application" - ] - }, - "scopes": { - "$ref": "#/definitions/oauth2Scopes" - }, - "tokenUrl": { - "type": "string", - "format": "uri" - }, - "description": { - "type": "string" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "oauth2AccessCodeSecurity": { - "type": "object", - "additionalProperties": false, - "required": [ - "type", - "flow", - "authorizationUrl", - "tokenUrl" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "oauth2" - ] - }, - "flow": { - "type": "string", - "enum": [ - "accessCode" - ] - }, - "scopes": { - "$ref": "#/definitions/oauth2Scopes" - }, - "authorizationUrl": { - "type": "string", - "format": "uri" - }, - "tokenUrl": { - "type": "string", - "format": "uri" - }, - "description": { - "type": "string" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "oauth2Scopes": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "mediaTypeList": { - "type": "array", - "items": { - "$ref": "#/definitions/mimeType" - }, - "uniqueItems": true - }, - "parametersList": { - "type": "array", - "description": "The parameters needed to send a valid API call.", - "additionalItems": false, - "items": { - "oneOf": [ - { - "$ref": "#/definitions/parameter" - }, - { - "$ref": "#/definitions/jsonReference" - } - ] - }, - "uniqueItems": true - }, - "schemesList": { - "type": "array", - "description": "The transfer protocol of the API.", - "items": { - "type": "string", - "enum": [ - "http", - "https", - "ws", - "wss" - ] - }, - "uniqueItems": true - }, - "collectionFormat": { - "type": "string", - "enum": [ - "csv", - "ssv", - "tsv", - "pipes" - ], - "default": "csv" - }, - "collectionFormatWithMulti": { - "type": "string", - "enum": [ - "csv", - "ssv", - "tsv", - "pipes", - "multi" - ], - "default": "csv" - }, - "title": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/title" - }, - "description": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/description" - }, - "default": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/default" - }, - "multipleOf": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/multipleOf" - }, - "maximum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/maximum" - }, - "exclusiveMaximum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum" - }, - "minimum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/minimum" - }, - "exclusiveMinimum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum" - }, - "maxLength": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger" - }, - "minLength": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0" - }, - "pattern": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/pattern" - }, - "maxItems": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger" - }, - "minItems": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0" - }, - "uniqueItems": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/uniqueItems" - }, - "enum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/enum" - }, - "jsonReference": { - "type": "object", - "required": [ - "$ref" - ], - "additionalProperties": false, - "properties": { - "$ref": { - "type": "string" - }, - "description": { - "type": "string" - } - } - } - } -} diff --git a/vendor/github.com/googleapis/gnostic/compiler/README.md b/vendor/github.com/googleapis/gnostic/compiler/README.md deleted file mode 100644 index 848b16c..0000000 --- a/vendor/github.com/googleapis/gnostic/compiler/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Compiler support code - -This directory contains compiler support code used by Gnostic and Gnostic extensions. \ No newline at end of file diff --git a/vendor/github.com/googleapis/gnostic/compiler/reader.go b/vendor/github.com/googleapis/gnostic/compiler/reader.go index 25affd0..604a46a 100644 --- a/vendor/github.com/googleapis/gnostic/compiler/reader.go +++ b/vendor/github.com/googleapis/gnostic/compiler/reader.go @@ -15,16 +15,14 @@ package compiler import ( - "errors" "fmt" + "gopkg.in/yaml.v2" "io/ioutil" "log" "net/http" "net/url" "path/filepath" "strings" - - yaml "gopkg.in/yaml.v2" ) var fileCache map[string][]byte @@ -32,8 +30,6 @@ var infoCache map[string]interface{} var count int64 var verboseReader = false -var fileCacheEnable = true -var infoCacheEnable = true func initializeFileCache() { if fileCache == nil { @@ -47,67 +43,24 @@ func initializeInfoCache() { } } -func DisableFileCache() { - fileCacheEnable = false -} - -func DisableInfoCache() { - infoCacheEnable = false -} - -func RemoveFromFileCache(fileurl string) { - if !fileCacheEnable { - return - } - initializeFileCache() - delete(fileCache, fileurl) -} - -func RemoveFromInfoCache(filename string) { - if !infoCacheEnable { - return - } - initializeInfoCache() - delete(infoCache, filename) -} - -func GetInfoCache() map[string]interface{} { - if infoCache == nil { - initializeInfoCache() - } - return infoCache -} - -func ClearInfoCache() { - infoCache = make(map[string]interface{}) -} - // FetchFile gets a specified file from the local filesystem or a remote location. func FetchFile(fileurl string) ([]byte, error) { - var bytes []byte initializeFileCache() - if fileCacheEnable { - bytes, ok := fileCache[fileurl] - if ok { - if verboseReader { - log.Printf("Cache hit %s", fileurl) - } - return bytes, nil - } + bytes, ok := fileCache[fileurl] + if ok { if verboseReader { - log.Printf("Fetching %s", fileurl) + log.Printf("Cache hit %s", fileurl) } + return bytes, nil } + log.Printf("Fetching %s", fileurl) response, err := http.Get(fileurl) if err != nil { return nil, err } defer response.Body.Close() - if response.StatusCode != 200 { - return nil, errors.New(fmt.Sprintf("Error downloading %s: %s", fileurl, response.Status)) - } bytes, err = ioutil.ReadAll(response.Body) - if fileCacheEnable && err == nil { + if err == nil { fileCache[fileurl] = bytes } return bytes, err @@ -136,33 +89,29 @@ func ReadBytesForFile(filename string) ([]byte, error) { // ReadInfoFromBytes unmarshals a file as a yaml.MapSlice. func ReadInfoFromBytes(filename string, bytes []byte) (interface{}, error) { initializeInfoCache() - if infoCacheEnable { - cachedInfo, ok := infoCache[filename] - if ok { - if verboseReader { - log.Printf("Cache hit info for file %s", filename) - } - return cachedInfo, nil - } + cachedInfo, ok := infoCache[filename] + if ok { if verboseReader { - log.Printf("Reading info for file %s", filename) + log.Printf("Cache hit info for file %s", filename) } + return cachedInfo, nil + } + if verboseReader { + log.Printf("Reading info for file %s", filename) } var info yaml.MapSlice err := yaml.Unmarshal(bytes, &info) if err != nil { return nil, err } - if infoCacheEnable && len(filename) > 0 { - infoCache[filename] = info - } + infoCache[filename] = info return info, nil } // ReadInfoForRef reads a file and return the fragment needed to resolve a $ref. func ReadInfoForRef(basefile string, ref string) (interface{}, error) { initializeInfoCache() - if infoCacheEnable { + { info, ok := infoCache[ref] if ok { if verboseReader { @@ -170,20 +119,16 @@ func ReadInfoForRef(basefile string, ref string) (interface{}, error) { } return info, nil } - if verboseReader { - log.Printf("Reading info for ref %s#%s", basefile, ref) - } + } + if verboseReader { + log.Printf("Reading info for ref %s#%s", basefile, ref) } count = count + 1 basedir, _ := filepath.Split(basefile) parts := strings.Split(ref, "#") var filename string if parts[0] != "" { - filename = parts[0] - if _, err := url.ParseRequestURI(parts[0]); err != nil { - // It is not an URL, so the file is local - filename = basedir + parts[0] - } + filename = basedir + parts[0] } else { filename = basefile } @@ -217,8 +162,6 @@ func ReadInfoForRef(basefile string, ref string) (interface{}, error) { } } } - if infoCacheEnable { - infoCache[ref] = info - } + infoCache[ref] = info return info, nil } diff --git a/vendor/github.com/googleapis/gnostic/extensions/README.md b/vendor/github.com/googleapis/gnostic/extensions/README.md deleted file mode 100644 index ff1c2eb..0000000 --- a/vendor/github.com/googleapis/gnostic/extensions/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Extensions - -This directory contains support code for building Gnostic extensions and associated examples. - -Extensions are used to compile vendor or specification extensions into protocol buffer structures. diff --git a/vendor/github.com/googleapis/gnostic/extensions/extension.pb.go b/vendor/github.com/googleapis/gnostic/extensions/extension.pb.go index 055a34e..b14f1f9 100644 --- a/vendor/github.com/googleapis/gnostic/extensions/extension.pb.go +++ b/vendor/github.com/googleapis/gnostic/extensions/extension.pb.go @@ -1,14 +1,25 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: extensions/extension.proto - +// Code generated by protoc-gen-go. +// source: extension.proto +// DO NOT EDIT! + +/* +Package openapiextension_v1 is a generated protocol buffer package. + +It is generated from these files: + extension.proto + +It has these top-level messages: + Version + ExtensionHandlerRequest + ExtensionHandlerResponse + Wrapper +*/ package openapiextension_v1 -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - any "github.com/golang/protobuf/ptypes/any" - math "math" -) +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import google_protobuf "github.com/golang/protobuf/ptypes/any" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -19,45 +30,22 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package // The version number of OpenAPI compiler. type Version struct { - Major int32 `protobuf:"varint,1,opt,name=major,proto3" json:"major,omitempty"` - Minor int32 `protobuf:"varint,2,opt,name=minor,proto3" json:"minor,omitempty"` - Patch int32 `protobuf:"varint,3,opt,name=patch,proto3" json:"patch,omitempty"` + Major int32 `protobuf:"varint,1,opt,name=major" json:"major,omitempty"` + Minor int32 `protobuf:"varint,2,opt,name=minor" json:"minor,omitempty"` + Patch int32 `protobuf:"varint,3,opt,name=patch" json:"patch,omitempty"` // A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should // be empty for mainline stable releases. - Suffix string `protobuf:"bytes,4,opt,name=suffix,proto3" json:"suffix,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Version) Reset() { *m = Version{} } -func (m *Version) String() string { return proto.CompactTextString(m) } -func (*Version) ProtoMessage() {} -func (*Version) Descriptor() ([]byte, []int) { - return fileDescriptor_661e47e790f76671, []int{0} -} - -func (m *Version) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Version.Unmarshal(m, b) -} -func (m *Version) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Version.Marshal(b, m, deterministic) -} -func (m *Version) XXX_Merge(src proto.Message) { - xxx_messageInfo_Version.Merge(m, src) -} -func (m *Version) XXX_Size() int { - return xxx_messageInfo_Version.Size(m) -} -func (m *Version) XXX_DiscardUnknown() { - xxx_messageInfo_Version.DiscardUnknown(m) + Suffix string `protobuf:"bytes,4,opt,name=suffix" json:"suffix,omitempty"` } -var xxx_messageInfo_Version proto.InternalMessageInfo +func (m *Version) Reset() { *m = Version{} } +func (m *Version) String() string { return proto.CompactTextString(m) } +func (*Version) ProtoMessage() {} +func (*Version) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } func (m *Version) GetMajor() int32 { if m != nil { @@ -90,39 +78,16 @@ func (m *Version) GetSuffix() string { // An encoded Request is written to the ExtensionHandler's stdin. type ExtensionHandlerRequest struct { // The OpenAPI descriptions that were explicitly listed on the command line. - // The specifications will appear in the order they are specified to gnostic. - Wrapper *Wrapper `protobuf:"bytes,1,opt,name=wrapper,proto3" json:"wrapper,omitempty"` + // The specifications will appear in the order they are specified to openapic. + Wrapper *Wrapper `protobuf:"bytes,1,opt,name=wrapper" json:"wrapper,omitempty"` // The version number of openapi compiler. - CompilerVersion *Version `protobuf:"bytes,3,opt,name=compiler_version,json=compilerVersion,proto3" json:"compiler_version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ExtensionHandlerRequest) Reset() { *m = ExtensionHandlerRequest{} } -func (m *ExtensionHandlerRequest) String() string { return proto.CompactTextString(m) } -func (*ExtensionHandlerRequest) ProtoMessage() {} -func (*ExtensionHandlerRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_661e47e790f76671, []int{1} -} - -func (m *ExtensionHandlerRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ExtensionHandlerRequest.Unmarshal(m, b) -} -func (m *ExtensionHandlerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ExtensionHandlerRequest.Marshal(b, m, deterministic) -} -func (m *ExtensionHandlerRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExtensionHandlerRequest.Merge(m, src) -} -func (m *ExtensionHandlerRequest) XXX_Size() int { - return xxx_messageInfo_ExtensionHandlerRequest.Size(m) -} -func (m *ExtensionHandlerRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ExtensionHandlerRequest.DiscardUnknown(m) + CompilerVersion *Version `protobuf:"bytes,3,opt,name=compiler_version,json=compilerVersion" json:"compiler_version,omitempty"` } -var xxx_messageInfo_ExtensionHandlerRequest proto.InternalMessageInfo +func (m *ExtensionHandlerRequest) Reset() { *m = ExtensionHandlerRequest{} } +func (m *ExtensionHandlerRequest) String() string { return proto.CompactTextString(m) } +func (*ExtensionHandlerRequest) ProtoMessage() {} +func (*ExtensionHandlerRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } func (m *ExtensionHandlerRequest) GetWrapper() *Wrapper { if m != nil { @@ -141,7 +106,7 @@ func (m *ExtensionHandlerRequest) GetCompilerVersion() *Version { // The extensions writes an encoded ExtensionHandlerResponse to stdout. type ExtensionHandlerResponse struct { // true if the extension is handled by the extension handler; false otherwise - Handled bool `protobuf:"varint,1,opt,name=handled,proto3" json:"handled,omitempty"` + Handled bool `protobuf:"varint,1,opt,name=handled" json:"handled,omitempty"` // Error message. If non-empty, the extension handling failed. // The extension handler process should exit with status code zero // even if it reports an error in this way. @@ -151,38 +116,15 @@ type ExtensionHandlerResponse struct { // itself -- such as the input Document being unparseable -- should be // reported by writing a message to stderr and exiting with a non-zero // status code. - Error []string `protobuf:"bytes,2,rep,name=error,proto3" json:"error,omitempty"` + Error []string `protobuf:"bytes,2,rep,name=error" json:"error,omitempty"` // text output - Value *any.Any `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Value *google_protobuf.Any `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"` } -func (m *ExtensionHandlerResponse) Reset() { *m = ExtensionHandlerResponse{} } -func (m *ExtensionHandlerResponse) String() string { return proto.CompactTextString(m) } -func (*ExtensionHandlerResponse) ProtoMessage() {} -func (*ExtensionHandlerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_661e47e790f76671, []int{2} -} - -func (m *ExtensionHandlerResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ExtensionHandlerResponse.Unmarshal(m, b) -} -func (m *ExtensionHandlerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ExtensionHandlerResponse.Marshal(b, m, deterministic) -} -func (m *ExtensionHandlerResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExtensionHandlerResponse.Merge(m, src) -} -func (m *ExtensionHandlerResponse) XXX_Size() int { - return xxx_messageInfo_ExtensionHandlerResponse.Size(m) -} -func (m *ExtensionHandlerResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ExtensionHandlerResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ExtensionHandlerResponse proto.InternalMessageInfo +func (m *ExtensionHandlerResponse) Reset() { *m = ExtensionHandlerResponse{} } +func (m *ExtensionHandlerResponse) String() string { return proto.CompactTextString(m) } +func (*ExtensionHandlerResponse) ProtoMessage() {} +func (*ExtensionHandlerResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } func (m *ExtensionHandlerResponse) GetHandled() bool { if m != nil { @@ -198,7 +140,7 @@ func (m *ExtensionHandlerResponse) GetError() []string { return nil } -func (m *ExtensionHandlerResponse) GetValue() *any.Any { +func (m *ExtensionHandlerResponse) GetValue() *google_protobuf.Any { if m != nil { return m.Value } @@ -207,40 +149,17 @@ func (m *ExtensionHandlerResponse) GetValue() *any.Any { type Wrapper struct { // version of the OpenAPI specification in which this extension was written. - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + Version string `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"` // Name of the extension - ExtensionName string `protobuf:"bytes,2,opt,name=extension_name,json=extensionName,proto3" json:"extension_name,omitempty"` + ExtensionName string `protobuf:"bytes,2,opt,name=extension_name,json=extensionName" json:"extension_name,omitempty"` // Must be a valid yaml for the proto - Yaml string `protobuf:"bytes,3,opt,name=yaml,proto3" json:"yaml,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Yaml string `protobuf:"bytes,3,opt,name=yaml" json:"yaml,omitempty"` } -func (m *Wrapper) Reset() { *m = Wrapper{} } -func (m *Wrapper) String() string { return proto.CompactTextString(m) } -func (*Wrapper) ProtoMessage() {} -func (*Wrapper) Descriptor() ([]byte, []int) { - return fileDescriptor_661e47e790f76671, []int{3} -} - -func (m *Wrapper) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Wrapper.Unmarshal(m, b) -} -func (m *Wrapper) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Wrapper.Marshal(b, m, deterministic) -} -func (m *Wrapper) XXX_Merge(src proto.Message) { - xxx_messageInfo_Wrapper.Merge(m, src) -} -func (m *Wrapper) XXX_Size() int { - return xxx_messageInfo_Wrapper.Size(m) -} -func (m *Wrapper) XXX_DiscardUnknown() { - xxx_messageInfo_Wrapper.DiscardUnknown(m) -} - -var xxx_messageInfo_Wrapper proto.InternalMessageInfo +func (m *Wrapper) Reset() { *m = Wrapper{} } +func (m *Wrapper) String() string { return proto.CompactTextString(m) } +func (*Wrapper) ProtoMessage() {} +func (*Wrapper) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } func (m *Wrapper) GetVersion() string { if m != nil { @@ -270,31 +189,31 @@ func init() { proto.RegisterType((*Wrapper)(nil), "openapiextension.v1.Wrapper") } -func init() { proto.RegisterFile("extensions/extension.proto", fileDescriptor_661e47e790f76671) } - -var fileDescriptor_661e47e790f76671 = []byte{ - // 360 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x74, 0x91, 0xdf, 0x4b, 0xeb, 0x30, - 0x1c, 0xc5, 0xe9, 0x7e, 0xf5, 0xee, 0x7b, 0xb9, 0xbb, 0x12, 0x87, 0xd6, 0xe1, 0x83, 0x14, 0x04, - 0x11, 0xe9, 0x98, 0x82, 0xef, 0x1b, 0x0c, 0xf5, 0xc5, 0x8d, 0x3c, 0xcc, 0x37, 0x47, 0xd6, 0x65, - 0x5d, 0xa5, 0x4d, 0x62, 0xfa, 0xc3, 0xed, 0x5f, 0xf1, 0xd1, 0xbf, 0xd4, 0x34, 0x69, 0xeb, 0x83, - 0xfa, 0x96, 0xf3, 0xe1, 0x34, 0x39, 0xe7, 0x14, 0x06, 0x74, 0x97, 0x52, 0x96, 0x84, 0x9c, 0x25, - 0xc3, 0xfa, 0xe8, 0x09, 0xc9, 0x53, 0x8e, 0x0e, 0xb9, 0xa0, 0x8c, 0x88, 0xf0, 0x8b, 0xe7, 0xa3, - 0xc1, 0x49, 0xc0, 0x79, 0x10, 0xd1, 0xa1, 0xb6, 0xac, 0xb2, 0xcd, 0x90, 0xb0, 0xbd, 0xf1, 0xbb, - 0x3e, 0xd8, 0x0b, 0x2a, 0x0b, 0x23, 0xea, 0x43, 0x3b, 0x26, 0x2f, 0x5c, 0x3a, 0xd6, 0x99, 0x75, - 0xd1, 0xc6, 0x46, 0x68, 0x1a, 0x32, 0x45, 0x1b, 0x25, 0x2d, 0x44, 0x41, 0x05, 0x49, 0xfd, 0xad, - 0xd3, 0x34, 0x54, 0x0b, 0x74, 0x04, 0x9d, 0x24, 0xdb, 0x6c, 0xc2, 0x9d, 0xd3, 0x52, 0xb8, 0x8b, - 0x4b, 0xe5, 0xbe, 0x5b, 0x70, 0x3c, 0xad, 0x02, 0xdd, 0x13, 0xb6, 0x8e, 0xa8, 0xc4, 0xf4, 0x35, - 0xa3, 0x49, 0x8a, 0x6e, 0xc1, 0x7e, 0x93, 0x44, 0x08, 0x6a, 0xde, 0xfd, 0x7b, 0x7d, 0xea, 0xfd, - 0x50, 0xc1, 0x7b, 0x32, 0x1e, 0x5c, 0x99, 0xd1, 0x1d, 0x1c, 0xf8, 0x3c, 0x16, 0xa1, 0xba, 0x6a, - 0x99, 0x9b, 0x06, 0x3a, 0xcc, 0x6f, 0x17, 0x94, 0x2d, 0xf1, 0xff, 0xea, 0xab, 0x12, 0xb8, 0x39, - 0x38, 0xdf, 0xb3, 0x25, 0x42, 0x8d, 0x4b, 0x91, 0x03, 0xf6, 0x56, 0xa3, 0xb5, 0x0e, 0xf7, 0x07, - 0x57, 0xb2, 0x18, 0x80, 0x4a, 0xa9, 0x67, 0x69, 0xaa, 0xa6, 0x46, 0xa0, 0x4b, 0x68, 0xe7, 0x24, - 0xca, 0x68, 0x99, 0xa4, 0xef, 0x99, 0xe1, 0xbd, 0x6a, 0x78, 0x6f, 0xcc, 0xf6, 0xd8, 0x58, 0xdc, - 0x67, 0xb0, 0xcb, 0x52, 0xc5, 0x33, 0x55, 0x05, 0x4b, 0x0f, 0x57, 0x49, 0x74, 0x0e, 0xbd, 0xba, - 0xc5, 0x92, 0x91, 0x98, 0xea, 0xdf, 0xd0, 0xc5, 0xff, 0x6a, 0xfa, 0xa8, 0x20, 0x42, 0xd0, 0xda, - 0x93, 0x38, 0xd2, 0xcf, 0x76, 0xb1, 0x3e, 0x4f, 0xae, 0xa0, 0xc7, 0x65, 0xe0, 0x05, 0x8c, 0x27, - 0x69, 0xe8, 0xab, 0x09, 0x26, 0x68, 0xa6, 0x76, 0x19, 0xcf, 0x1f, 0xea, 0xba, 0x8b, 0xd1, 0xdc, - 0xfa, 0x68, 0x34, 0x67, 0xe3, 0xe9, 0xaa, 0xa3, 0x23, 0xde, 0x7c, 0x06, 0x00, 0x00, 0xff, 0xff, - 0xeb, 0xf3, 0xfa, 0x65, 0x5c, 0x02, 0x00, 0x00, +func init() { proto.RegisterFile("extension.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 355 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x74, 0x91, 0x4d, 0x4b, 0xf3, 0x40, + 0x1c, 0xc4, 0x49, 0xdf, 0xf2, 0x64, 0x1f, 0xb4, 0xb2, 0x16, 0x8d, 0xe2, 0xa1, 0x04, 0x84, 0x22, + 0xb8, 0xa5, 0x0a, 0xde, 0x5b, 0x28, 0xea, 0xc5, 0x96, 0x3d, 0xd4, 0x9b, 0x65, 0x9b, 0xfe, 0xdb, + 0x46, 0x92, 0xdd, 0x75, 0xf3, 0x62, 0xfb, 0x55, 0x3c, 0xfa, 0x49, 0x25, 0xbb, 0xd9, 0x7a, 0x50, + 0x6f, 0x99, 0x1f, 0x93, 0xfc, 0x67, 0x26, 0xa8, 0x0d, 0xdb, 0x0c, 0x78, 0x1a, 0x09, 0x4e, 0xa4, + 0x12, 0x99, 0xc0, 0xc7, 0x42, 0x02, 0x67, 0x32, 0xfa, 0xe6, 0xc5, 0xe0, 0xfc, 0x6c, 0x2d, 0xc4, + 0x3a, 0x86, 0xbe, 0xb6, 0x2c, 0xf2, 0x55, 0x9f, 0xf1, 0x9d, 0xf1, 0x07, 0x21, 0x72, 0x67, 0xa0, + 0x4a, 0x23, 0xee, 0xa0, 0x66, 0xc2, 0x5e, 0x85, 0xf2, 0x9d, 0xae, 0xd3, 0x6b, 0x52, 0x23, 0x34, + 0x8d, 0xb8, 0x50, 0x7e, 0xad, 0xa2, 0xa5, 0x28, 0xa9, 0x64, 0x59, 0xb8, 0xf1, 0xeb, 0x86, 0x6a, + 0x81, 0x4f, 0x50, 0x2b, 0xcd, 0x57, 0xab, 0x68, 0xeb, 0x37, 0xba, 0x4e, 0xcf, 0xa3, 0x95, 0x0a, + 0x3e, 0x1c, 0x74, 0x3a, 0xb6, 0x81, 0x1e, 0x18, 0x5f, 0xc6, 0xa0, 0x28, 0xbc, 0xe5, 0x90, 0x66, + 0xf8, 0x0e, 0xb9, 0xef, 0x8a, 0x49, 0x09, 0xe6, 0xee, 0xff, 0x9b, 0x0b, 0xf2, 0x4b, 0x05, 0xf2, + 0x6c, 0x3c, 0xd4, 0x9a, 0xf1, 0x3d, 0x3a, 0x0a, 0x45, 0x22, 0xa3, 0x18, 0xd4, 0xbc, 0x30, 0x0d, + 0x74, 0x98, 0xbf, 0x3e, 0x50, 0xb5, 0xa4, 0x6d, 0xfb, 0x56, 0x05, 0x82, 0x02, 0xf9, 0x3f, 0xb3, + 0xa5, 0x52, 0xf0, 0x14, 0xb0, 0x8f, 0xdc, 0x8d, 0x46, 0x4b, 0x1d, 0xee, 0x1f, 0xb5, 0xb2, 0x1c, + 0x00, 0x94, 0xd2, 0xb3, 0xd4, 0x7b, 0x1e, 0x35, 0x02, 0x5f, 0xa1, 0x66, 0xc1, 0xe2, 0x1c, 0xaa, + 0x24, 0x1d, 0x62, 0x86, 0x27, 0x76, 0x78, 0x32, 0xe4, 0x3b, 0x6a, 0x2c, 0xc1, 0x0b, 0x72, 0xab, + 0x52, 0xe5, 0x19, 0x5b, 0xc1, 0xd1, 0xc3, 0x59, 0x89, 0x2f, 0xd1, 0xe1, 0xbe, 0xc5, 0x9c, 0xb3, + 0x04, 0xf4, 0x6f, 0xf0, 0xe8, 0xc1, 0x9e, 0x3e, 0xb1, 0x04, 0x30, 0x46, 0x8d, 0x1d, 0x4b, 0x62, + 0x7d, 0xd6, 0xa3, 0xfa, 0x79, 0x74, 0x8d, 0xda, 0x42, 0xad, 0xed, 0x16, 0x21, 0x29, 0x06, 0x23, + 0x3c, 0x91, 0xc0, 0x87, 0xd3, 0xc7, 0x7d, 0xdf, 0xd9, 0x60, 0xea, 0x7c, 0xd6, 0xea, 0x93, 0xe1, + 0x78, 0xd1, 0xd2, 0x19, 0x6f, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0xfc, 0x56, 0x40, 0x4d, 0x52, + 0x02, 0x00, 0x00, } diff --git a/vendor/github.com/googleapis/gnostic/extensions/extension.proto b/vendor/github.com/googleapis/gnostic/extensions/extension.proto deleted file mode 100644 index 04856f9..0000000 --- a/vendor/github.com/googleapis/gnostic/extensions/extension.proto +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2017 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -import "google/protobuf/any.proto"; -package openapiextension.v1; - -// This option lets the proto compiler generate Java code inside the package -// name (see below) instead of inside an outer class. It creates a simpler -// developer experience by reducing one-level of name nesting and be -// consistent with most programming languages that don't support outer classes. -option java_multiple_files = true; - -// The Java outer classname should be the filename in UpperCamelCase. This -// class is only used to hold proto descriptor, so developers don't need to -// work with it directly. -option java_outer_classname = "OpenAPIExtensionV1"; - -// The Java package name must be proto package name with proper prefix. -option java_package = "org.gnostic.v1"; - -// A reasonable prefix for the Objective-C symbols generated from the package. -// It should at a minimum be 3 characters long, all uppercase, and convention -// is to use an abbreviation of the package name. Something short, but -// hopefully unique enough to not conflict with things that may come along in -// the future. 'GPB' is reserved for the protocol buffer implementation itself. -// -option objc_class_prefix = "OAE"; // "OpenAPI Extension" - -// The version number of OpenAPI compiler. -message Version { - int32 major = 1; - int32 minor = 2; - int32 patch = 3; - // A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should - // be empty for mainline stable releases. - string suffix = 4; -} - -// An encoded Request is written to the ExtensionHandler's stdin. -message ExtensionHandlerRequest { - - // The OpenAPI descriptions that were explicitly listed on the command line. - // The specifications will appear in the order they are specified to gnostic. - Wrapper wrapper = 1; - - // The version number of openapi compiler. - Version compiler_version = 3; -} - -// The extensions writes an encoded ExtensionHandlerResponse to stdout. -message ExtensionHandlerResponse { - - // true if the extension is handled by the extension handler; false otherwise - bool handled = 1; - - // Error message. If non-empty, the extension handling failed. - // The extension handler process should exit with status code zero - // even if it reports an error in this way. - // - // This should be used to indicate errors which prevent the extension from - // operating as intended. Errors which indicate a problem in gnostic - // itself -- such as the input Document being unparseable -- should be - // reported by writing a message to stderr and exiting with a non-zero - // status code. - repeated string error = 2; - - // text output - google.protobuf.Any value = 3; -} - -message Wrapper { - // version of the OpenAPI specification in which this extension was written. - string version = 1; - - // Name of the extension - string extension_name = 2; - - // Must be a valid yaml for the proto - string yaml = 3; -} diff --git a/vendor/github.com/hashicorp/golang-lru/.gitignore b/vendor/github.com/hashicorp/golang-lru/.gitignore deleted file mode 100644 index 8365624..0000000 --- a/vendor/github.com/hashicorp/golang-lru/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test diff --git a/vendor/github.com/hashicorp/golang-lru/README.md b/vendor/github.com/hashicorp/golang-lru/README.md deleted file mode 100644 index 33e58cf..0000000 --- a/vendor/github.com/hashicorp/golang-lru/README.md +++ /dev/null @@ -1,25 +0,0 @@ -golang-lru -========== - -This provides the `lru` package which implements a fixed-size -thread safe LRU cache. It is based on the cache in Groupcache. - -Documentation -============= - -Full docs are available on [Godoc](http://godoc.org/github.com/hashicorp/golang-lru) - -Example -======= - -Using the LRU is very simple: - -```go -l, _ := New(128) -for i := 0; i < 256; i++ { - l.Add(i, nil) -} -if l.Len() != 128 { - panic(fmt.Sprintf("bad len: %v", l.Len())) -} -``` diff --git a/vendor/github.com/hashicorp/golang-lru/go.mod b/vendor/github.com/hashicorp/golang-lru/go.mod deleted file mode 100644 index 8ad8826..0000000 --- a/vendor/github.com/hashicorp/golang-lru/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/hashicorp/golang-lru - -go 1.12 diff --git a/vendor/github.com/hashicorp/golang-lru/lru.go b/vendor/github.com/hashicorp/golang-lru/lru.go index 4e5e9d8..1cbe04b 100644 --- a/vendor/github.com/hashicorp/golang-lru/lru.go +++ b/vendor/github.com/hashicorp/golang-lru/lru.go @@ -37,7 +37,7 @@ func (c *Cache) Purge() { c.lock.Unlock() } -// Add adds a value to the cache. Returns true if an eviction occurred. +// Add adds a value to the cache. Returns true if an eviction occurred. func (c *Cache) Add(key, value interface{}) (evicted bool) { c.lock.Lock() evicted = c.lru.Add(key, value) @@ -71,8 +71,8 @@ func (c *Cache) Peek(key interface{}) (value interface{}, ok bool) { return value, ok } -// ContainsOrAdd checks if a key is in the cache without updating the -// recent-ness or deleting it for being stale, and if not, adds the value. +// ContainsOrAdd checks if a key is in the cache without updating the +// recent-ness or deleting it for being stale, and if not, adds the value. // Returns whether found and whether an eviction occurred. func (c *Cache) ContainsOrAdd(key, value interface{}) (ok, evicted bool) { c.lock.Lock() @@ -85,52 +85,18 @@ func (c *Cache) ContainsOrAdd(key, value interface{}) (ok, evicted bool) { return false, evicted } -// PeekOrAdd checks if a key is in the cache without updating the -// recent-ness or deleting it for being stale, and if not, adds the value. -// Returns whether found and whether an eviction occurred. -func (c *Cache) PeekOrAdd(key, value interface{}) (previous interface{}, ok, evicted bool) { - c.lock.Lock() - defer c.lock.Unlock() - - previous, ok = c.lru.Peek(key) - if ok { - return previous, true, false - } - - evicted = c.lru.Add(key, value) - return nil, false, evicted -} - // Remove removes the provided key from the cache. -func (c *Cache) Remove(key interface{}) (present bool) { +func (c *Cache) Remove(key interface{}) { c.lock.Lock() - present = c.lru.Remove(key) + c.lru.Remove(key) c.lock.Unlock() - return -} - -// Resize changes the cache size. -func (c *Cache) Resize(size int) (evicted int) { - c.lock.Lock() - evicted = c.lru.Resize(size) - c.lock.Unlock() - return evicted } // RemoveOldest removes the oldest item from the cache. -func (c *Cache) RemoveOldest() (key interface{}, value interface{}, ok bool) { - c.lock.Lock() - key, value, ok = c.lru.RemoveOldest() - c.lock.Unlock() - return -} - -// GetOldest returns the oldest entry -func (c *Cache) GetOldest() (key interface{}, value interface{}, ok bool) { +func (c *Cache) RemoveOldest() { c.lock.Lock() - key, value, ok = c.lru.GetOldest() + c.lru.RemoveOldest() c.lock.Unlock() - return } // Keys returns a slice of the keys in the cache, from oldest to newest. diff --git a/vendor/github.com/hashicorp/golang-lru/simplelru/lru.go b/vendor/github.com/hashicorp/golang-lru/simplelru/lru.go index a86c853..5673773 100644 --- a/vendor/github.com/hashicorp/golang-lru/simplelru/lru.go +++ b/vendor/github.com/hashicorp/golang-lru/simplelru/lru.go @@ -73,9 +73,6 @@ func (c *LRU) Add(key, value interface{}) (evicted bool) { func (c *LRU) Get(key interface{}) (value interface{}, ok bool) { if ent, ok := c.items[key]; ok { c.evictList.MoveToFront(ent) - if ent.Value.(*entry) == nil { - return nil, false - } return ent.Value.(*entry).value, true } return @@ -145,19 +142,6 @@ func (c *LRU) Len() int { return c.evictList.Len() } -// Resize changes the cache size. -func (c *LRU) Resize(size int) (evicted int) { - diff := c.Len() - size - if diff < 0 { - diff = 0 - } - for i := 0; i < diff; i++ { - c.removeOldest() - } - c.size = size - return diff -} - // removeOldest removes the oldest item from the cache. func (c *LRU) removeOldest() { ent := c.evictList.Back() diff --git a/vendor/github.com/hashicorp/golang-lru/simplelru/lru_interface.go b/vendor/github.com/hashicorp/golang-lru/simplelru/lru_interface.go index 92d7093..74c7077 100644 --- a/vendor/github.com/hashicorp/golang-lru/simplelru/lru_interface.go +++ b/vendor/github.com/hashicorp/golang-lru/simplelru/lru_interface.go @@ -10,7 +10,7 @@ type LRUCache interface { // updates the "recently used"-ness of the key. #value, isFound Get(key interface{}) (value interface{}, ok bool) - // Checks if a key exists in cache without updating the recent-ness. + // Check if a key exsists in cache without updating the recent-ness. Contains(key interface{}) (ok bool) // Returns key's value without updating the "recently used"-ness of the key. @@ -31,9 +31,6 @@ type LRUCache interface { // Returns the number of items in the cache. Len() int - // Clears all cache entries. + // Clear all cache entries Purge() - - // Resizes cache, returning number evicted - Resize(int) int } diff --git a/vendor/github.com/imdario/mergo/.gitignore b/vendor/github.com/imdario/mergo/.gitignore deleted file mode 100644 index 529c341..0000000 --- a/vendor/github.com/imdario/mergo/.gitignore +++ /dev/null @@ -1,33 +0,0 @@ -#### joe made this: http://goel.io/joe - -#### go #### -# Binaries for programs and plugins -*.exe -*.dll -*.so -*.dylib - -# Test binary, build with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 -.glide/ - -#### vim #### -# Swap -[._]*.s[a-v][a-z] -[._]*.sw[a-p] -[._]s[a-v][a-z] -[._]sw[a-p] - -# Session -Session.vim - -# Temporary -.netrwhist -*~ -# Auto-generated tag files -tags diff --git a/vendor/github.com/imdario/mergo/.travis.yml b/vendor/github.com/imdario/mergo/.travis.yml deleted file mode 100644 index dad2972..0000000 --- a/vendor/github.com/imdario/mergo/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: go -install: - - go get -t - - go get golang.org/x/tools/cmd/cover - - go get github.com/mattn/goveralls -script: - - go test -race -v ./... -after_script: - - $HOME/gopath/bin/goveralls -service=travis-ci -repotoken $COVERALLS_TOKEN diff --git a/vendor/github.com/imdario/mergo/CODE_OF_CONDUCT.md b/vendor/github.com/imdario/mergo/CODE_OF_CONDUCT.md deleted file mode 100644 index 469b449..0000000 --- a/vendor/github.com/imdario/mergo/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,46 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at i@dario.im. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/github.com/imdario/mergo/README.md b/vendor/github.com/imdario/mergo/README.md deleted file mode 100644 index 02fc81e..0000000 --- a/vendor/github.com/imdario/mergo/README.md +++ /dev/null @@ -1,238 +0,0 @@ -# Mergo - -A helper to merge structs and maps in Golang. Useful for configuration default values, avoiding messy if-statements. - -Also a lovely [comune](http://en.wikipedia.org/wiki/Mergo) (municipality) in the Province of Ancona in the Italian region of Marche. - -## Status - -It is ready for production use. [It is used in several projects by Docker, Google, The Linux Foundation, VMWare, Shopify, etc](https://github.com/imdario/mergo#mergo-in-the-wild). - -[![GoDoc][3]][4] -[![GoCard][5]][6] -[![Build Status][1]][2] -[![Coverage Status][7]][8] -[![Sourcegraph][9]][10] -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fimdario%2Fmergo.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fimdario%2Fmergo?ref=badge_shield) - -[1]: https://travis-ci.org/imdario/mergo.png -[2]: https://travis-ci.org/imdario/mergo -[3]: https://godoc.org/github.com/imdario/mergo?status.svg -[4]: https://godoc.org/github.com/imdario/mergo -[5]: https://goreportcard.com/badge/imdario/mergo -[6]: https://goreportcard.com/report/github.com/imdario/mergo -[7]: https://coveralls.io/repos/github/imdario/mergo/badge.svg?branch=master -[8]: https://coveralls.io/github/imdario/mergo?branch=master -[9]: https://sourcegraph.com/github.com/imdario/mergo/-/badge.svg -[10]: https://sourcegraph.com/github.com/imdario/mergo?badge - -### Latest release - -[Release v0.3.7](https://github.com/imdario/mergo/releases/tag/v0.3.7). - -### Important note - -Please keep in mind that in [0.3.2](//github.com/imdario/mergo/releases/tag/0.3.2) Mergo changed `Merge()`and `Map()` signatures to support [transformers](#transformers). An optional/variadic argument has been added, so it won't break existing code. - -If you were using Mergo **before** April 6th 2015, please check your project works as intended after updating your local copy with ```go get -u github.com/imdario/mergo```. I apologize for any issue caused by its previous behavior and any future bug that Mergo could cause (I hope it won't!) in existing projects after the change (release 0.2.0). - -### Donations - -If Mergo is useful to you, consider buying me a coffee, a beer or making a monthly donation so I can keep building great free software. :heart_eyes: - -Buy Me a Coffee at ko-fi.com -[![Beerpay](https://beerpay.io/imdario/mergo/badge.svg)](https://beerpay.io/imdario/mergo) -[![Beerpay](https://beerpay.io/imdario/mergo/make-wish.svg)](https://beerpay.io/imdario/mergo) -Donate using Liberapay - -### Mergo in the wild - -- [moby/moby](https://github.com/moby/moby) -- [kubernetes/kubernetes](https://github.com/kubernetes/kubernetes) -- [vmware/dispatch](https://github.com/vmware/dispatch) -- [Shopify/themekit](https://github.com/Shopify/themekit) -- [imdario/zas](https://github.com/imdario/zas) -- [matcornic/hermes](https://github.com/matcornic/hermes) -- [OpenBazaar/openbazaar-go](https://github.com/OpenBazaar/openbazaar-go) -- [kataras/iris](https://github.com/kataras/iris) -- [michaelsauter/crane](https://github.com/michaelsauter/crane) -- [go-task/task](https://github.com/go-task/task) -- [sensu/uchiwa](https://github.com/sensu/uchiwa) -- [ory/hydra](https://github.com/ory/hydra) -- [sisatech/vcli](https://github.com/sisatech/vcli) -- [dairycart/dairycart](https://github.com/dairycart/dairycart) -- [projectcalico/felix](https://github.com/projectcalico/felix) -- [resin-os/balena](https://github.com/resin-os/balena) -- [go-kivik/kivik](https://github.com/go-kivik/kivik) -- [Telefonica/govice](https://github.com/Telefonica/govice) -- [supergiant/supergiant](supergiant/supergiant) -- [SergeyTsalkov/brooce](https://github.com/SergeyTsalkov/brooce) -- [soniah/dnsmadeeasy](https://github.com/soniah/dnsmadeeasy) -- [ohsu-comp-bio/funnel](https://github.com/ohsu-comp-bio/funnel) -- [EagerIO/Stout](https://github.com/EagerIO/Stout) -- [lynndylanhurley/defsynth-api](https://github.com/lynndylanhurley/defsynth-api) -- [russross/canvasassignments](https://github.com/russross/canvasassignments) -- [rdegges/cryptly-api](https://github.com/rdegges/cryptly-api) -- [casualjim/exeggutor](https://github.com/casualjim/exeggutor) -- [divshot/gitling](https://github.com/divshot/gitling) -- [RWJMurphy/gorl](https://github.com/RWJMurphy/gorl) -- [andrerocker/deploy42](https://github.com/andrerocker/deploy42) -- [elwinar/rambler](https://github.com/elwinar/rambler) -- [tmaiaroto/gopartman](https://github.com/tmaiaroto/gopartman) -- [jfbus/impressionist](https://github.com/jfbus/impressionist) -- [Jmeyering/zealot](https://github.com/Jmeyering/zealot) -- [godep-migrator/rigger-host](https://github.com/godep-migrator/rigger-host) -- [Dronevery/MultiwaySwitch-Go](https://github.com/Dronevery/MultiwaySwitch-Go) -- [thoas/picfit](https://github.com/thoas/picfit) -- [mantasmatelis/whooplist-server](https://github.com/mantasmatelis/whooplist-server) -- [jnuthong/item_search](https://github.com/jnuthong/item_search) -- [bukalapak/snowboard](https://github.com/bukalapak/snowboard) - -## Installation - - go get github.com/imdario/mergo - - // use in your .go code - import ( - "github.com/imdario/mergo" - ) - -## Usage - -You can only merge same-type structs with exported fields initialized as zero value of their type and same-types maps. Mergo won't merge unexported (private) fields but will do recursively any exported one. It won't merge empty structs value as [they are not considered zero values](https://golang.org/ref/spec#The_zero_value) either. Also maps will be merged recursively except for structs inside maps (because they are not addressable using Go reflection). - -```go -if err := mergo.Merge(&dst, src); err != nil { - // ... -} -``` - -Also, you can merge overwriting values using the transformer `WithOverride`. - -```go -if err := mergo.Merge(&dst, src, mergo.WithOverride); err != nil { - // ... -} -``` - -Additionally, you can map a `map[string]interface{}` to a struct (and otherwise, from struct to map), following the same restrictions as in `Merge()`. Keys are capitalized to find each corresponding exported field. - -```go -if err := mergo.Map(&dst, srcMap); err != nil { - // ... -} -``` - -Warning: if you map a struct to map, it won't do it recursively. Don't expect Mergo to map struct members of your struct as `map[string]interface{}`. They will be just assigned as values. - -More information and examples in [godoc documentation](http://godoc.org/github.com/imdario/mergo). - -### Nice example - -```go -package main - -import ( - "fmt" - "github.com/imdario/mergo" -) - -type Foo struct { - A string - B int64 -} - -func main() { - src := Foo{ - A: "one", - B: 2, - } - dest := Foo{ - A: "two", - } - mergo.Merge(&dest, src) - fmt.Println(dest) - // Will print - // {two 2} -} -``` - -Note: if test are failing due missing package, please execute: - - go get gopkg.in/yaml.v2 - -### Transformers - -Transformers allow to merge specific types differently than in the default behavior. In other words, now you can customize how some types are merged. For example, `time.Time` is a struct; it doesn't have zero value but IsZero can return true because it has fields with zero value. How can we merge a non-zero `time.Time`? - -```go -package main - -import ( - "fmt" - "github.com/imdario/mergo" - "reflect" - "time" -) - -type timeTransfomer struct { -} - -func (t timeTransfomer) Transformer(typ reflect.Type) func(dst, src reflect.Value) error { - if typ == reflect.TypeOf(time.Time{}) { - return func(dst, src reflect.Value) error { - if dst.CanSet() { - isZero := dst.MethodByName("IsZero") - result := isZero.Call([]reflect.Value{}) - if result[0].Bool() { - dst.Set(src) - } - } - return nil - } - } - return nil -} - -type Snapshot struct { - Time time.Time - // ... -} - -func main() { - src := Snapshot{time.Now()} - dest := Snapshot{} - mergo.Merge(&dest, src, mergo.WithTransformers(timeTransfomer{})) - fmt.Println(dest) - // Will print - // { 2018-01-12 01:15:00 +0000 UTC m=+0.000000001 } -} -``` - - -## Contact me - -If I can help you, you have an idea or you are using Mergo in your projects, don't hesitate to drop me a line (or a pull request): [@im_dario](https://twitter.com/im_dario) - -## About - -Written by [Dario Castañé](http://dario.im). - -## Top Contributors - -[![0](https://sourcerer.io/fame/imdario/imdario/mergo/images/0)](https://sourcerer.io/fame/imdario/imdario/mergo/links/0) -[![1](https://sourcerer.io/fame/imdario/imdario/mergo/images/1)](https://sourcerer.io/fame/imdario/imdario/mergo/links/1) -[![2](https://sourcerer.io/fame/imdario/imdario/mergo/images/2)](https://sourcerer.io/fame/imdario/imdario/mergo/links/2) -[![3](https://sourcerer.io/fame/imdario/imdario/mergo/images/3)](https://sourcerer.io/fame/imdario/imdario/mergo/links/3) -[![4](https://sourcerer.io/fame/imdario/imdario/mergo/images/4)](https://sourcerer.io/fame/imdario/imdario/mergo/links/4) -[![5](https://sourcerer.io/fame/imdario/imdario/mergo/images/5)](https://sourcerer.io/fame/imdario/imdario/mergo/links/5) -[![6](https://sourcerer.io/fame/imdario/imdario/mergo/images/6)](https://sourcerer.io/fame/imdario/imdario/mergo/links/6) -[![7](https://sourcerer.io/fame/imdario/imdario/mergo/images/7)](https://sourcerer.io/fame/imdario/imdario/mergo/links/7) - - -## License - -[BSD 3-Clause](http://opensource.org/licenses/BSD-3-Clause) license, as [Go language](http://golang.org/LICENSE). - - -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fimdario%2Fmergo.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fimdario%2Fmergo?ref=badge_large) diff --git a/vendor/github.com/imdario/mergo/map.go b/vendor/github.com/imdario/mergo/map.go index 3f5afa8..6ea38e6 100644 --- a/vendor/github.com/imdario/mergo/map.go +++ b/vendor/github.com/imdario/mergo/map.go @@ -72,7 +72,6 @@ func deepMap(dst, src reflect.Value, visited map[uintptr]*visit, depth int, conf case reflect.Struct: srcMap := src.Interface().(map[string]interface{}) for key := range srcMap { - config.overwriteWithEmptyValue = true srcValue := srcMap[key] fieldName := changeInitialCase(key, unicode.ToUpper) dstElement := dst.FieldByName(fieldName) diff --git a/vendor/github.com/imdario/mergo/merge.go b/vendor/github.com/imdario/mergo/merge.go index 3fb6c64..706b220 100644 --- a/vendor/github.com/imdario/mergo/merge.go +++ b/vendor/github.com/imdario/mergo/merge.go @@ -9,7 +9,6 @@ package mergo import ( - "fmt" "reflect" ) @@ -26,12 +25,9 @@ func hasExportedField(dst reflect.Value) (exported bool) { } type Config struct { - Overwrite bool - AppendSlice bool - TypeCheck bool - Transformers Transformers - overwriteWithEmptyValue bool - overwriteSliceWithEmptyValue bool + Overwrite bool + AppendSlice bool + Transformers Transformers } type Transformers interface { @@ -43,10 +39,6 @@ type Transformers interface { // short circuiting on recursive types. func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, config *Config) (err error) { overwrite := config.Overwrite - typeCheck := config.TypeCheck - overwriteWithEmptySrc := config.overwriteWithEmptyValue - overwriteSliceWithEmptySrc := config.overwriteSliceWithEmptyValue - config.overwriteWithEmptyValue = false if !src.IsValid() { return @@ -81,7 +73,7 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co } } } else { - if dst.CanSet() && (!isEmptyValue(src) || overwriteWithEmptySrc) && (overwrite || isEmptyValue(dst)) { + if dst.CanSet() && !isEmptyValue(src) && (overwrite || isEmptyValue(dst)) { dst.Set(src) } } @@ -132,25 +124,19 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co dstSlice = reflect.ValueOf(dstElement.Interface()) } - if (!isEmptyValue(src) || overwriteWithEmptySrc || overwriteSliceWithEmptySrc) && (overwrite || isEmptyValue(dst)) && !config.AppendSlice { - if typeCheck && srcSlice.Type() != dstSlice.Type() { - return fmt.Errorf("cannot override two slices with different type (%s, %s)", srcSlice.Type(), dstSlice.Type()) - } + if !isEmptyValue(src) && (overwrite || isEmptyValue(dst)) && !config.AppendSlice { dstSlice = srcSlice } else if config.AppendSlice { - if srcSlice.Type() != dstSlice.Type() { - return fmt.Errorf("cannot append two slices with different type (%s, %s)", srcSlice.Type(), dstSlice.Type()) - } dstSlice = reflect.AppendSlice(dstSlice, srcSlice) } dst.SetMapIndex(key, dstSlice) } } - if dstElement.IsValid() && !isEmptyValue(dstElement) && (reflect.TypeOf(srcElement.Interface()).Kind() == reflect.Map || reflect.TypeOf(srcElement.Interface()).Kind() == reflect.Slice) { + if dstElement.IsValid() && reflect.TypeOf(srcElement.Interface()).Kind() == reflect.Map { continue } - if srcElement.IsValid() && ((srcElement.Kind() != reflect.Ptr && overwrite) || !dstElement.IsValid() || isEmptyValue(dstElement)) { + if srcElement.IsValid() && (overwrite || (!dstElement.IsValid() || isEmptyValue(dstElement))) { if dst.IsNil() { dst.Set(reflect.MakeMap(dst.Type())) } @@ -161,12 +147,9 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co if !dst.CanSet() { break } - if (!isEmptyValue(src) || overwriteWithEmptySrc || overwriteSliceWithEmptySrc) && (overwrite || isEmptyValue(dst)) && !config.AppendSlice { + if !isEmptyValue(src) && (overwrite || isEmptyValue(dst)) && !config.AppendSlice { dst.Set(src) } else if config.AppendSlice { - if src.Type() != dst.Type() { - return fmt.Errorf("cannot append two slice with different type (%s, %s)", src.Type(), dst.Type()) - } dst.Set(reflect.AppendSlice(dst, src)) } case reflect.Ptr: @@ -175,18 +158,8 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co if src.IsNil() { break } - - if dst.Kind() != reflect.Ptr && src.Type().AssignableTo(dst.Type()) { - if dst.IsNil() || overwrite { - if dst.CanSet() && (overwrite || isEmptyValue(dst)) { - dst.Set(src) - } - } - break - } - if src.Kind() != reflect.Interface { - if dst.IsNil() || (src.Kind() != reflect.Ptr && overwrite) { + if dst.IsNil() || overwrite { if dst.CanSet() && (overwrite || isEmptyValue(dst)) { dst.Set(src) } @@ -211,11 +184,10 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co return } default: - if dst.CanSet() && (!isEmptyValue(src) || overwriteWithEmptySrc) && (overwrite || isEmptyValue(dst)) { + if dst.CanSet() && !isEmptyValue(src) && (overwrite || isEmptyValue(dst)) { dst.Set(src) } } - return } @@ -227,7 +199,7 @@ func Merge(dst, src interface{}, opts ...func(*Config)) error { return merge(dst, src, opts...) } -// MergeWithOverwrite will do the same as Merge except that non-empty dst attributes will be overridden by +// MergeWithOverwrite will do the same as Merge except that non-empty dst attributes will be overriden by // non-empty src attribute values. // Deprecated: use Merge(…) with WithOverride func MergeWithOverwrite(dst, src interface{}, opts ...func(*Config)) error { @@ -246,21 +218,11 @@ func WithOverride(config *Config) { config.Overwrite = true } -// WithOverride will make merge override empty dst slice with empty src slice. -func WithOverrideEmptySlice(config *Config) { - config.overwriteSliceWithEmptyValue = true -} - -// WithAppendSlice will make merge append slices instead of overwriting it. +// WithAppendSlice will make merge append slices instead of overwriting it func WithAppendSlice(config *Config) { config.AppendSlice = true } -// WithTypeCheck will make merge check types while overwriting it (must be used with WithOverride). -func WithTypeCheck(config *Config) { - config.TypeCheck = true -} - func merge(dst, src interface{}, opts ...func(*Config)) error { var ( vDst, vSrc reflect.Value diff --git a/vendor/github.com/json-iterator/go/.codecov.yml b/vendor/github.com/json-iterator/go/.codecov.yml deleted file mode 100644 index 955dc0b..0000000 --- a/vendor/github.com/json-iterator/go/.codecov.yml +++ /dev/null @@ -1,3 +0,0 @@ -ignore: - - "output_tests/.*" - diff --git a/vendor/github.com/json-iterator/go/.gitignore b/vendor/github.com/json-iterator/go/.gitignore deleted file mode 100644 index 1555653..0000000 --- a/vendor/github.com/json-iterator/go/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/vendor -/bug_test.go -/coverage.txt -/.idea diff --git a/vendor/github.com/json-iterator/go/.travis.yml b/vendor/github.com/json-iterator/go/.travis.yml deleted file mode 100644 index 449e67c..0000000 --- a/vendor/github.com/json-iterator/go/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: go - -go: - - 1.8.x - - 1.x - -before_install: - - go get -t -v ./... - -script: - - ./test.sh - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/vendor/github.com/json-iterator/go/Gopkg.toml b/vendor/github.com/json-iterator/go/Gopkg.toml deleted file mode 100644 index 313a0f8..0000000 --- a/vendor/github.com/json-iterator/go/Gopkg.toml +++ /dev/null @@ -1,26 +0,0 @@ -# Gopkg.toml example -# -# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md -# for detailed Gopkg.toml documentation. -# -# required = ["github.com/user/thing/cmd/thing"] -# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] -# -# [[constraint]] -# name = "github.com/user/project" -# version = "1.0.0" -# -# [[constraint]] -# name = "github.com/user/project2" -# branch = "dev" -# source = "github.com/myfork/project2" -# -# [[override]] -# name = "github.com/x/y" -# version = "2.4.0" - -ignored = ["github.com/davecgh/go-spew*","github.com/google/gofuzz*","github.com/stretchr/testify*"] - -[[constraint]] - name = "github.com/modern-go/reflect2" - version = "1.0.1" diff --git a/vendor/github.com/json-iterator/go/README.md b/vendor/github.com/json-iterator/go/README.md deleted file mode 100644 index 50d56ff..0000000 --- a/vendor/github.com/json-iterator/go/README.md +++ /dev/null @@ -1,87 +0,0 @@ -[![Sourcegraph](https://sourcegraph.com/github.com/json-iterator/go/-/badge.svg)](https://sourcegraph.com/github.com/json-iterator/go?badge) -[![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/json-iterator/go) -[![Build Status](https://travis-ci.org/json-iterator/go.svg?branch=master)](https://travis-ci.org/json-iterator/go) -[![codecov](https://codecov.io/gh/json-iterator/go/branch/master/graph/badge.svg)](https://codecov.io/gh/json-iterator/go) -[![rcard](https://goreportcard.com/badge/github.com/json-iterator/go)](https://goreportcard.com/report/github.com/json-iterator/go) -[![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat-square)](https://raw.githubusercontent.com/json-iterator/go/master/LICENSE) -[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/json-iterator/Lobby) - -A high-performance 100% compatible drop-in replacement of "encoding/json" - -You can also use thrift like JSON using [thrift-iterator](https://github.com/thrift-iterator/go) - -# Benchmark - -![benchmark](http://jsoniter.com/benchmarks/go-benchmark.png) - -Source code: https://github.com/json-iterator/go-benchmark/blob/master/src/github.com/json-iterator/go-benchmark/benchmark_medium_payload_test.go - -Raw Result (easyjson requires static code generation) - -| | ns/op | allocation bytes | allocation times | -| --- | --- | --- | --- | -| std decode | 35510 ns/op | 1960 B/op | 99 allocs/op | -| easyjson decode | 8499 ns/op | 160 B/op | 4 allocs/op | -| jsoniter decode | 5623 ns/op | 160 B/op | 3 allocs/op | -| std encode | 2213 ns/op | 712 B/op | 5 allocs/op | -| easyjson encode | 883 ns/op | 576 B/op | 3 allocs/op | -| jsoniter encode | 837 ns/op | 384 B/op | 4 allocs/op | - -Always benchmark with your own workload. -The result depends heavily on the data input. - -# Usage - -100% compatibility with standard lib - -Replace - -```go -import "encoding/json" -json.Marshal(&data) -``` - -with - -```go -import "github.com/json-iterator/go" - -var json = jsoniter.ConfigCompatibleWithStandardLibrary -json.Marshal(&data) -``` - -Replace - -```go -import "encoding/json" -json.Unmarshal(input, &data) -``` - -with - -```go -import "github.com/json-iterator/go" - -var json = jsoniter.ConfigCompatibleWithStandardLibrary -json.Unmarshal(input, &data) -``` - -[More documentation](http://jsoniter.com/migrate-from-go-std.html) - -# How to get - -``` -go get github.com/json-iterator/go -``` - -# Contribution Welcomed ! - -Contributors - -* [thockin](https://github.com/thockin) -* [mattn](https://github.com/mattn) -* [cch123](https://github.com/cch123) -* [Oleg Shaldybin](https://github.com/olegshaldybin) -* [Jason Toffaletti](https://github.com/toffaletti) - -Report issue or pull request, or email taowen@gmail.com, or [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/json-iterator/Lobby) diff --git a/vendor/github.com/json-iterator/go/build.sh b/vendor/github.com/json-iterator/go/build.sh deleted file mode 100755 index b45ef68..0000000 --- a/vendor/github.com/json-iterator/go/build.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -e -set -x - -if [ ! -d /tmp/build-golang/src/github.com/json-iterator ]; then - mkdir -p /tmp/build-golang/src/github.com/json-iterator - ln -s $PWD /tmp/build-golang/src/github.com/json-iterator/go -fi -export GOPATH=/tmp/build-golang -go get -u github.com/golang/dep/cmd/dep -cd /tmp/build-golang/src/github.com/json-iterator/go -exec $GOPATH/bin/dep ensure -update diff --git a/vendor/github.com/json-iterator/go/fuzzy_mode_convert_table.md b/vendor/github.com/json-iterator/go/fuzzy_mode_convert_table.md deleted file mode 100644 index 3095662..0000000 --- a/vendor/github.com/json-iterator/go/fuzzy_mode_convert_table.md +++ /dev/null @@ -1,7 +0,0 @@ -| json type \ dest type | bool | int | uint | float |string| -| --- | --- | --- | --- |--|--| -| number | positive => true
negative => true
zero => false| 23.2 => 23
-32.1 => -32| 12.1 => 12
-12.1 => 0|as normal|same as origin| -| string | empty string => false
string "0" => false
other strings => true | "123.32" => 123
"-123.4" => -123
"123.23xxxw" => 123
"abcde12" => 0
"-32.1" => -32| 13.2 => 13
-1.1 => 0 |12.1 => 12.1
-12.3 => -12.3
12.4xxa => 12.4
+1.1e2 =>110 |same as origin| -| bool | true => true
false => false| true => 1
false => 0 | true => 1
false => 0 |true => 1
false => 0|true => "true"
false => "false"| -| object | true | 0 | 0 |0|originnal json| -| array | empty array => false
nonempty array => true| [] => 0
[1,2] => 1 | [] => 0
[1,2] => 1 |[] => 0
[1,2] => 1|original json| \ No newline at end of file diff --git a/vendor/github.com/json-iterator/go/go.mod b/vendor/github.com/json-iterator/go/go.mod deleted file mode 100644 index e05c42f..0000000 --- a/vendor/github.com/json-iterator/go/go.mod +++ /dev/null @@ -1,11 +0,0 @@ -module github.com/json-iterator/go - -go 1.12 - -require ( - github.com/davecgh/go-spew v1.1.1 - github.com/google/gofuzz v1.0.0 - github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 - github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 - github.com/stretchr/testify v1.3.0 -) diff --git a/vendor/github.com/json-iterator/go/go.sum b/vendor/github.com/json-iterator/go/go.sum deleted file mode 100644 index d778b5a..0000000 --- a/vendor/github.com/json-iterator/go/go.sum +++ /dev/null @@ -1,14 +0,0 @@ -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= diff --git a/vendor/github.com/json-iterator/go/reflect_extension.go b/vendor/github.com/json-iterator/go/reflect_extension.go index 80320cd..e27e8d1 100644 --- a/vendor/github.com/json-iterator/go/reflect_extension.go +++ b/vendor/github.com/json-iterator/go/reflect_extension.go @@ -341,7 +341,7 @@ func describeStruct(ctx *ctx, typ reflect2.Type) *StructDescriptor { if ctx.onlyTaggedField && !hastag && !field.Anonymous() { continue } - if tag == "-" || field.Name() == "_" { + if tag == "-" { continue } tagParts := strings.Split(tag, ",") diff --git a/vendor/github.com/json-iterator/go/reflect_map.go b/vendor/github.com/json-iterator/go/reflect_map.go index 9e2b623..08e9a39 100644 --- a/vendor/github.com/json-iterator/go/reflect_map.go +++ b/vendor/github.com/json-iterator/go/reflect_map.go @@ -290,17 +290,16 @@ func (encoder *sortKeysMapEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteObjectStart() mapIter := encoder.mapType.UnsafeIterate(ptr) subStream := stream.cfg.BorrowStream(nil) - subStream.Attachment = stream.Attachment subIter := stream.cfg.BorrowIterator(nil) keyValues := encodedKeyValues{} for mapIter.HasNext() { + subStream.buf = make([]byte, 0, 64) key, elem := mapIter.UnsafeNext() - subStreamIndex := subStream.Buffered() encoder.keyEncoder.Encode(key, subStream) if subStream.Error != nil && subStream.Error != io.EOF && stream.Error == nil { stream.Error = subStream.Error } - encodedKey := subStream.Buffer()[subStreamIndex:] + encodedKey := subStream.Buffer() subIter.ResetBytes(encodedKey) decodedKey := subIter.ReadString() if stream.indention > 0 { @@ -311,7 +310,7 @@ func (encoder *sortKeysMapEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { encoder.elemEncoder.Encode(elem, subStream) keyValues = append(keyValues, encodedKV{ key: decodedKey, - keyValue: subStream.Buffer()[subStreamIndex:], + keyValue: subStream.Buffer(), }) } sort.Sort(keyValues) @@ -321,9 +320,6 @@ func (encoder *sortKeysMapEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { } stream.Write(keyValue.keyValue) } - if subStream.Error != nil && stream.Error == nil { - stream.Error = subStream.Error - } stream.WriteObjectEnd() stream.cfg.ReturnStream(subStream) stream.cfg.ReturnIterator(subIter) diff --git a/vendor/github.com/json-iterator/go/reflect_struct_encoder.go b/vendor/github.com/json-iterator/go/reflect_struct_encoder.go index 152e3ef..d0759cf 100644 --- a/vendor/github.com/json-iterator/go/reflect_struct_encoder.go +++ b/vendor/github.com/json-iterator/go/reflect_struct_encoder.go @@ -200,7 +200,6 @@ type stringModeStringEncoder struct { func (encoder *stringModeStringEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { tempStream := encoder.cfg.BorrowStream(nil) - tempStream.Attachment = stream.Attachment defer encoder.cfg.ReturnStream(tempStream) encoder.elemEncoder.Encode(ptr, tempStream) stream.WriteString(string(tempStream.Buffer())) diff --git a/vendor/github.com/json-iterator/go/test.sh b/vendor/github.com/json-iterator/go/test.sh deleted file mode 100755 index f4e7c0b..0000000 --- a/vendor/github.com/json-iterator/go/test.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -set -e -echo "" > coverage.txt - -for d in $(go list ./... | grep -v vendor); do - go test -coverprofile=profile.out -coverpkg=github.com/json-iterator/go $d - if [ -f profile.out ]; then - cat profile.out >> coverage.txt - rm profile.out - fi -done diff --git a/vendor/github.com/konsorten/go-windows-terminal-sequences/README.md b/vendor/github.com/konsorten/go-windows-terminal-sequences/README.md deleted file mode 100644 index 195333e..0000000 --- a/vendor/github.com/konsorten/go-windows-terminal-sequences/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# Windows Terminal Sequences - -This library allow for enabling Windows terminal color support for Go. - -See [Console Virtual Terminal Sequences](https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences) for details. - -## Usage - -```go -import ( - "syscall" - - sequences "github.com/konsorten/go-windows-terminal-sequences" -) - -func main() { - sequences.EnableVirtualTerminalProcessing(syscall.Stdout, true) -} - -``` - -## Authors - -The tool is sponsored by the [marvin + konsorten GmbH](http://www.konsorten.de). - -We thank all the authors who provided code to this library: - -* Felix Kollmann -* Nicolas Perraut - -## License - -(The MIT License) - -Copyright (c) 2018 marvin + konsorten GmbH (open-source@konsorten.de) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/konsorten/go-windows-terminal-sequences/go.mod b/vendor/github.com/konsorten/go-windows-terminal-sequences/go.mod deleted file mode 100644 index 716c613..0000000 --- a/vendor/github.com/konsorten/go-windows-terminal-sequences/go.mod +++ /dev/null @@ -1 +0,0 @@ -module github.com/konsorten/go-windows-terminal-sequences diff --git a/vendor/github.com/kubeflow/common/LICENSE b/vendor/github.com/kubeflow/common/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/vendor/github.com/kubeflow/common/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/kubeflow/common/pkg/apis/common/v1/constants.go b/vendor/github.com/kubeflow/common/pkg/apis/common/v1/constants.go deleted file mode 100644 index 8ea6304..0000000 --- a/vendor/github.com/kubeflow/common/pkg/apis/common/v1/constants.go +++ /dev/null @@ -1,18 +0,0 @@ -package v1 - -const ( - // ReplicaIndexLabel represents the label key for the replica-index, e.g. the value is 0, 1, 2.. etc - ReplicaIndexLabel = "replica-index" - - // ReplicaTypeLabel represents the label key for the replica-type, e.g. the value is ps , worker etc. - ReplicaTypeLabel = "replica-type" - - // GroupNameLabel represents the label key for group name, e.g. the value is kubeflow.org - GroupNameLabel = "group-name" - - // JobNameLabel represents the label key for the job name, the value is job name - JobNameLabel = "job-name" - - // JobRoleLabel represents the label key for the job role, e.g. the value is master - JobRoleLabel = "job-role" -) diff --git a/vendor/github.com/kubeflow/common/pkg/apis/common/v1/doc.go b/vendor/github.com/kubeflow/common/pkg/apis/common/v1/doc.go deleted file mode 100644 index 9649a4e..0000000 --- a/vendor/github.com/kubeflow/common/pkg/apis/common/v1/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2018 The Kubeflow Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// +k8s:deepcopy-gen=package,register -// +k8s:defaulter-gen=TypeMeta - -// Package v1 is the v1 version of the API. -// +groupName=kubeflow.org -package v1 diff --git a/vendor/github.com/kubeflow/common/pkg/apis/common/v1/interface.go b/vendor/github.com/kubeflow/common/pkg/apis/common/v1/interface.go deleted file mode 100644 index dc75a5c..0000000 --- a/vendor/github.com/kubeflow/common/pkg/apis/common/v1/interface.go +++ /dev/null @@ -1,74 +0,0 @@ -package v1 - -import ( - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// ControllerInterface defines the Interface to be implemented by custom operators. e.g. tf-operator needs to implement this interface -type ControllerInterface interface { - // Returns the Controller name - ControllerName() string - - // Returns the GroupVersionKind of the API - GetAPIGroupVersionKind() schema.GroupVersionKind - - // Returns the GroupVersion of the API - GetAPIGroupVersion() schema.GroupVersion - - // Returns the Group Name(value) in the labels of the job - GetGroupNameLabelValue() string - - // Returns the Job from Informer Cache - GetJobFromInformerCache(namespace, name string) (metav1.Object, error) - - // Returns the Job from API server - GetJobFromAPIClient(namespace, name string) (metav1.Object, error) - - // GetPodsForJob returns the pods managed by the job. This can be achieved by selecting pods using label key "job-name" - // i.e. all pods created by the job will come with label "job-name" = - GetPodsForJob(job interface{}) ([]*v1.Pod, error) - - // GetServicesForJob returns the services managed by the job. This can be achieved by selecting services using label key "job-name" - // i.e. all services created by the job will come with label "job-name" = - GetServicesForJob(job interface{}) ([]*v1.Service, error) - - // DeleteJob deletes the job - DeleteJob(job interface{}) error - - // UpdateJobStatus updates the job status and job conditions - UpdateJobStatus(job interface{}, replicas map[ReplicaType]*ReplicaSpec, jobStatus *JobStatus) error - - // UpdateJobStatusInApiServer updates the job status in API server - UpdateJobStatusInApiServer(job interface{}, jobStatus *JobStatus) error - - // CreateService creates the service - CreateService(job interface{}, service *v1.Service) error - - // DeleteService deletes the service - DeleteService(job interface{}, name string, namespace string) error - - // CreatePod creates the pod - CreatePod(job interface{}, pod *v1.Pod) error - - // DeletePod deletes the pod - DeletePod(job interface{}, pod *v1.Pod) error - - // SetClusterSpec sets the cluster spec for the pod - SetClusterSpec(job interface{}, podTemplate *v1.PodTemplateSpec, rtype, index string) error - - // Returns the default container name in pod - GetDefaultContainerName() string - - // Get the default container port name - GetDefaultContainerPortName() string - - // Get the default container port number - GetDefaultContainerPortNumber() int32 - - // Returns if this replica type with index specified is a master role. - // MasterRole pod will have "job-role=master" set in its label - IsMasterRole(replicas map[ReplicaType]*ReplicaSpec, rtype ReplicaType, index int) bool -} - diff --git a/vendor/github.com/kubeflow/common/pkg/apis/common/v1/openapi_generated.go b/vendor/github.com/kubeflow/common/pkg/apis/common/v1/openapi_generated.go deleted file mode 100644 index e2bc82b..0000000 --- a/vendor/github.com/kubeflow/common/pkg/apis/common/v1/openapi_generated.go +++ /dev/null @@ -1,12950 +0,0 @@ -// +build !ignore_autogenerated - -// Copyright 2020 The Kubeflow Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by openapi-gen. DO NOT EDIT. - -// This file was autogenerated by openapi-gen. Do not edit it manually! - -package v1 - -import ( - spec "github.com/go-openapi/spec" - resource "k8s.io/apimachinery/pkg/api/resource" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - intstr "k8s.io/apimachinery/pkg/util/intstr" - common "k8s.io/kube-openapi/pkg/common" -) - -func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { - return map[string]common.OpenAPIDefinition{ - "github.com/kubeflow/common/pkg/apis/common/v1.JobCondition": schema_pkg_apis_common_v1_JobCondition(ref), - "github.com/kubeflow/common/pkg/apis/common/v1.JobStatus": schema_pkg_apis_common_v1_JobStatus(ref), - "github.com/kubeflow/common/pkg/apis/common/v1.ReplicaSpec": schema_pkg_apis_common_v1_ReplicaSpec(ref), - "github.com/kubeflow/common/pkg/apis/common/v1.ReplicaStatus": schema_pkg_apis_common_v1_ReplicaStatus(ref), - "github.com/kubeflow/common/pkg/apis/common/v1.RunPolicy": schema_pkg_apis_common_v1_RunPolicy(ref), - "github.com/kubeflow/common/pkg/apis/common/v1.SchedulingPolicy": schema_pkg_apis_common_v1_SchedulingPolicy(ref), - "k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource": schema_k8sio_api_core_v1_AWSElasticBlockStoreVolumeSource(ref), - "k8s.io/api/core/v1.Affinity": schema_k8sio_api_core_v1_Affinity(ref), - "k8s.io/api/core/v1.AttachedVolume": schema_k8sio_api_core_v1_AttachedVolume(ref), - "k8s.io/api/core/v1.AvoidPods": schema_k8sio_api_core_v1_AvoidPods(ref), - "k8s.io/api/core/v1.AzureDiskVolumeSource": schema_k8sio_api_core_v1_AzureDiskVolumeSource(ref), - "k8s.io/api/core/v1.AzureFilePersistentVolumeSource": schema_k8sio_api_core_v1_AzureFilePersistentVolumeSource(ref), - "k8s.io/api/core/v1.AzureFileVolumeSource": schema_k8sio_api_core_v1_AzureFileVolumeSource(ref), - "k8s.io/api/core/v1.Binding": schema_k8sio_api_core_v1_Binding(ref), - "k8s.io/api/core/v1.CSIPersistentVolumeSource": schema_k8sio_api_core_v1_CSIPersistentVolumeSource(ref), - "k8s.io/api/core/v1.CSIVolumeSource": schema_k8sio_api_core_v1_CSIVolumeSource(ref), - "k8s.io/api/core/v1.Capabilities": schema_k8sio_api_core_v1_Capabilities(ref), - "k8s.io/api/core/v1.CephFSPersistentVolumeSource": schema_k8sio_api_core_v1_CephFSPersistentVolumeSource(ref), - "k8s.io/api/core/v1.CephFSVolumeSource": schema_k8sio_api_core_v1_CephFSVolumeSource(ref), - "k8s.io/api/core/v1.CinderPersistentVolumeSource": schema_k8sio_api_core_v1_CinderPersistentVolumeSource(ref), - "k8s.io/api/core/v1.CinderVolumeSource": schema_k8sio_api_core_v1_CinderVolumeSource(ref), - "k8s.io/api/core/v1.ClientIPConfig": schema_k8sio_api_core_v1_ClientIPConfig(ref), - "k8s.io/api/core/v1.ComponentCondition": schema_k8sio_api_core_v1_ComponentCondition(ref), - "k8s.io/api/core/v1.ComponentStatus": schema_k8sio_api_core_v1_ComponentStatus(ref), - "k8s.io/api/core/v1.ComponentStatusList": schema_k8sio_api_core_v1_ComponentStatusList(ref), - "k8s.io/api/core/v1.ConfigMap": schema_k8sio_api_core_v1_ConfigMap(ref), - "k8s.io/api/core/v1.ConfigMapEnvSource": schema_k8sio_api_core_v1_ConfigMapEnvSource(ref), - "k8s.io/api/core/v1.ConfigMapKeySelector": schema_k8sio_api_core_v1_ConfigMapKeySelector(ref), - "k8s.io/api/core/v1.ConfigMapList": schema_k8sio_api_core_v1_ConfigMapList(ref), - "k8s.io/api/core/v1.ConfigMapNodeConfigSource": schema_k8sio_api_core_v1_ConfigMapNodeConfigSource(ref), - "k8s.io/api/core/v1.ConfigMapProjection": schema_k8sio_api_core_v1_ConfigMapProjection(ref), - "k8s.io/api/core/v1.ConfigMapVolumeSource": schema_k8sio_api_core_v1_ConfigMapVolumeSource(ref), - "k8s.io/api/core/v1.Container": schema_k8sio_api_core_v1_Container(ref), - "k8s.io/api/core/v1.ContainerImage": schema_k8sio_api_core_v1_ContainerImage(ref), - "k8s.io/api/core/v1.ContainerPort": schema_k8sio_api_core_v1_ContainerPort(ref), - "k8s.io/api/core/v1.ContainerState": schema_k8sio_api_core_v1_ContainerState(ref), - "k8s.io/api/core/v1.ContainerStateRunning": schema_k8sio_api_core_v1_ContainerStateRunning(ref), - "k8s.io/api/core/v1.ContainerStateTerminated": schema_k8sio_api_core_v1_ContainerStateTerminated(ref), - "k8s.io/api/core/v1.ContainerStateWaiting": schema_k8sio_api_core_v1_ContainerStateWaiting(ref), - "k8s.io/api/core/v1.ContainerStatus": schema_k8sio_api_core_v1_ContainerStatus(ref), - "k8s.io/api/core/v1.DaemonEndpoint": schema_k8sio_api_core_v1_DaemonEndpoint(ref), - "k8s.io/api/core/v1.DownwardAPIProjection": schema_k8sio_api_core_v1_DownwardAPIProjection(ref), - "k8s.io/api/core/v1.DownwardAPIVolumeFile": schema_k8sio_api_core_v1_DownwardAPIVolumeFile(ref), - "k8s.io/api/core/v1.DownwardAPIVolumeSource": schema_k8sio_api_core_v1_DownwardAPIVolumeSource(ref), - "k8s.io/api/core/v1.EmptyDirVolumeSource": schema_k8sio_api_core_v1_EmptyDirVolumeSource(ref), - "k8s.io/api/core/v1.EndpointAddress": schema_k8sio_api_core_v1_EndpointAddress(ref), - "k8s.io/api/core/v1.EndpointPort": schema_k8sio_api_core_v1_EndpointPort(ref), - "k8s.io/api/core/v1.EndpointSubset": schema_k8sio_api_core_v1_EndpointSubset(ref), - "k8s.io/api/core/v1.Endpoints": schema_k8sio_api_core_v1_Endpoints(ref), - "k8s.io/api/core/v1.EndpointsList": schema_k8sio_api_core_v1_EndpointsList(ref), - "k8s.io/api/core/v1.EnvFromSource": schema_k8sio_api_core_v1_EnvFromSource(ref), - "k8s.io/api/core/v1.EnvVar": schema_k8sio_api_core_v1_EnvVar(ref), - "k8s.io/api/core/v1.EnvVarSource": schema_k8sio_api_core_v1_EnvVarSource(ref), - "k8s.io/api/core/v1.Event": schema_k8sio_api_core_v1_Event(ref), - "k8s.io/api/core/v1.EventList": schema_k8sio_api_core_v1_EventList(ref), - "k8s.io/api/core/v1.EventSeries": schema_k8sio_api_core_v1_EventSeries(ref), - "k8s.io/api/core/v1.EventSource": schema_k8sio_api_core_v1_EventSource(ref), - "k8s.io/api/core/v1.ExecAction": schema_k8sio_api_core_v1_ExecAction(ref), - "k8s.io/api/core/v1.FCVolumeSource": schema_k8sio_api_core_v1_FCVolumeSource(ref), - "k8s.io/api/core/v1.FlexPersistentVolumeSource": schema_k8sio_api_core_v1_FlexPersistentVolumeSource(ref), - "k8s.io/api/core/v1.FlexVolumeSource": schema_k8sio_api_core_v1_FlexVolumeSource(ref), - "k8s.io/api/core/v1.FlockerVolumeSource": schema_k8sio_api_core_v1_FlockerVolumeSource(ref), - "k8s.io/api/core/v1.GCEPersistentDiskVolumeSource": schema_k8sio_api_core_v1_GCEPersistentDiskVolumeSource(ref), - "k8s.io/api/core/v1.GitRepoVolumeSource": schema_k8sio_api_core_v1_GitRepoVolumeSource(ref), - "k8s.io/api/core/v1.GlusterfsPersistentVolumeSource": schema_k8sio_api_core_v1_GlusterfsPersistentVolumeSource(ref), - "k8s.io/api/core/v1.GlusterfsVolumeSource": schema_k8sio_api_core_v1_GlusterfsVolumeSource(ref), - "k8s.io/api/core/v1.HTTPGetAction": schema_k8sio_api_core_v1_HTTPGetAction(ref), - "k8s.io/api/core/v1.HTTPHeader": schema_k8sio_api_core_v1_HTTPHeader(ref), - "k8s.io/api/core/v1.Handler": schema_k8sio_api_core_v1_Handler(ref), - "k8s.io/api/core/v1.HostAlias": schema_k8sio_api_core_v1_HostAlias(ref), - "k8s.io/api/core/v1.HostPathVolumeSource": schema_k8sio_api_core_v1_HostPathVolumeSource(ref), - "k8s.io/api/core/v1.ISCSIPersistentVolumeSource": schema_k8sio_api_core_v1_ISCSIPersistentVolumeSource(ref), - "k8s.io/api/core/v1.ISCSIVolumeSource": schema_k8sio_api_core_v1_ISCSIVolumeSource(ref), - "k8s.io/api/core/v1.KeyToPath": schema_k8sio_api_core_v1_KeyToPath(ref), - "k8s.io/api/core/v1.Lifecycle": schema_k8sio_api_core_v1_Lifecycle(ref), - "k8s.io/api/core/v1.LimitRange": schema_k8sio_api_core_v1_LimitRange(ref), - "k8s.io/api/core/v1.LimitRangeItem": schema_k8sio_api_core_v1_LimitRangeItem(ref), - "k8s.io/api/core/v1.LimitRangeList": schema_k8sio_api_core_v1_LimitRangeList(ref), - "k8s.io/api/core/v1.LimitRangeSpec": schema_k8sio_api_core_v1_LimitRangeSpec(ref), - "k8s.io/api/core/v1.List": schema_k8sio_api_core_v1_List(ref), - "k8s.io/api/core/v1.LoadBalancerIngress": schema_k8sio_api_core_v1_LoadBalancerIngress(ref), - "k8s.io/api/core/v1.LoadBalancerStatus": schema_k8sio_api_core_v1_LoadBalancerStatus(ref), - "k8s.io/api/core/v1.LocalObjectReference": schema_k8sio_api_core_v1_LocalObjectReference(ref), - "k8s.io/api/core/v1.LocalVolumeSource": schema_k8sio_api_core_v1_LocalVolumeSource(ref), - "k8s.io/api/core/v1.NFSVolumeSource": schema_k8sio_api_core_v1_NFSVolumeSource(ref), - "k8s.io/api/core/v1.Namespace": schema_k8sio_api_core_v1_Namespace(ref), - "k8s.io/api/core/v1.NamespaceList": schema_k8sio_api_core_v1_NamespaceList(ref), - "k8s.io/api/core/v1.NamespaceSpec": schema_k8sio_api_core_v1_NamespaceSpec(ref), - "k8s.io/api/core/v1.NamespaceStatus": schema_k8sio_api_core_v1_NamespaceStatus(ref), - "k8s.io/api/core/v1.Node": schema_k8sio_api_core_v1_Node(ref), - "k8s.io/api/core/v1.NodeAddress": schema_k8sio_api_core_v1_NodeAddress(ref), - "k8s.io/api/core/v1.NodeAffinity": schema_k8sio_api_core_v1_NodeAffinity(ref), - "k8s.io/api/core/v1.NodeCondition": schema_k8sio_api_core_v1_NodeCondition(ref), - "k8s.io/api/core/v1.NodeConfigSource": schema_k8sio_api_core_v1_NodeConfigSource(ref), - "k8s.io/api/core/v1.NodeConfigStatus": schema_k8sio_api_core_v1_NodeConfigStatus(ref), - "k8s.io/api/core/v1.NodeDaemonEndpoints": schema_k8sio_api_core_v1_NodeDaemonEndpoints(ref), - "k8s.io/api/core/v1.NodeList": schema_k8sio_api_core_v1_NodeList(ref), - "k8s.io/api/core/v1.NodeProxyOptions": schema_k8sio_api_core_v1_NodeProxyOptions(ref), - "k8s.io/api/core/v1.NodeResources": schema_k8sio_api_core_v1_NodeResources(ref), - "k8s.io/api/core/v1.NodeSelector": schema_k8sio_api_core_v1_NodeSelector(ref), - "k8s.io/api/core/v1.NodeSelectorRequirement": schema_k8sio_api_core_v1_NodeSelectorRequirement(ref), - "k8s.io/api/core/v1.NodeSelectorTerm": schema_k8sio_api_core_v1_NodeSelectorTerm(ref), - "k8s.io/api/core/v1.NodeSpec": schema_k8sio_api_core_v1_NodeSpec(ref), - "k8s.io/api/core/v1.NodeStatus": schema_k8sio_api_core_v1_NodeStatus(ref), - "k8s.io/api/core/v1.NodeSystemInfo": schema_k8sio_api_core_v1_NodeSystemInfo(ref), - "k8s.io/api/core/v1.ObjectFieldSelector": schema_k8sio_api_core_v1_ObjectFieldSelector(ref), - "k8s.io/api/core/v1.ObjectReference": schema_k8sio_api_core_v1_ObjectReference(ref), - "k8s.io/api/core/v1.PersistentVolume": schema_k8sio_api_core_v1_PersistentVolume(ref), - "k8s.io/api/core/v1.PersistentVolumeClaim": schema_k8sio_api_core_v1_PersistentVolumeClaim(ref), - "k8s.io/api/core/v1.PersistentVolumeClaimCondition": schema_k8sio_api_core_v1_PersistentVolumeClaimCondition(ref), - "k8s.io/api/core/v1.PersistentVolumeClaimList": schema_k8sio_api_core_v1_PersistentVolumeClaimList(ref), - "k8s.io/api/core/v1.PersistentVolumeClaimSpec": schema_k8sio_api_core_v1_PersistentVolumeClaimSpec(ref), - "k8s.io/api/core/v1.PersistentVolumeClaimStatus": schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref), - "k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource": schema_k8sio_api_core_v1_PersistentVolumeClaimVolumeSource(ref), - "k8s.io/api/core/v1.PersistentVolumeList": schema_k8sio_api_core_v1_PersistentVolumeList(ref), - "k8s.io/api/core/v1.PersistentVolumeSource": schema_k8sio_api_core_v1_PersistentVolumeSource(ref), - "k8s.io/api/core/v1.PersistentVolumeSpec": schema_k8sio_api_core_v1_PersistentVolumeSpec(ref), - "k8s.io/api/core/v1.PersistentVolumeStatus": schema_k8sio_api_core_v1_PersistentVolumeStatus(ref), - "k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource": schema_k8sio_api_core_v1_PhotonPersistentDiskVolumeSource(ref), - "k8s.io/api/core/v1.Pod": schema_k8sio_api_core_v1_Pod(ref), - "k8s.io/api/core/v1.PodAffinity": schema_k8sio_api_core_v1_PodAffinity(ref), - "k8s.io/api/core/v1.PodAffinityTerm": schema_k8sio_api_core_v1_PodAffinityTerm(ref), - "k8s.io/api/core/v1.PodAntiAffinity": schema_k8sio_api_core_v1_PodAntiAffinity(ref), - "k8s.io/api/core/v1.PodAttachOptions": schema_k8sio_api_core_v1_PodAttachOptions(ref), - "k8s.io/api/core/v1.PodCondition": schema_k8sio_api_core_v1_PodCondition(ref), - "k8s.io/api/core/v1.PodDNSConfig": schema_k8sio_api_core_v1_PodDNSConfig(ref), - "k8s.io/api/core/v1.PodDNSConfigOption": schema_k8sio_api_core_v1_PodDNSConfigOption(ref), - "k8s.io/api/core/v1.PodExecOptions": schema_k8sio_api_core_v1_PodExecOptions(ref), - "k8s.io/api/core/v1.PodList": schema_k8sio_api_core_v1_PodList(ref), - "k8s.io/api/core/v1.PodLogOptions": schema_k8sio_api_core_v1_PodLogOptions(ref), - "k8s.io/api/core/v1.PodPortForwardOptions": schema_k8sio_api_core_v1_PodPortForwardOptions(ref), - "k8s.io/api/core/v1.PodProxyOptions": schema_k8sio_api_core_v1_PodProxyOptions(ref), - "k8s.io/api/core/v1.PodReadinessGate": schema_k8sio_api_core_v1_PodReadinessGate(ref), - "k8s.io/api/core/v1.PodSecurityContext": schema_k8sio_api_core_v1_PodSecurityContext(ref), - "k8s.io/api/core/v1.PodSignature": schema_k8sio_api_core_v1_PodSignature(ref), - "k8s.io/api/core/v1.PodSpec": schema_k8sio_api_core_v1_PodSpec(ref), - "k8s.io/api/core/v1.PodStatus": schema_k8sio_api_core_v1_PodStatus(ref), - "k8s.io/api/core/v1.PodStatusResult": schema_k8sio_api_core_v1_PodStatusResult(ref), - "k8s.io/api/core/v1.PodTemplate": schema_k8sio_api_core_v1_PodTemplate(ref), - "k8s.io/api/core/v1.PodTemplateList": schema_k8sio_api_core_v1_PodTemplateList(ref), - "k8s.io/api/core/v1.PodTemplateSpec": schema_k8sio_api_core_v1_PodTemplateSpec(ref), - "k8s.io/api/core/v1.PortworxVolumeSource": schema_k8sio_api_core_v1_PortworxVolumeSource(ref), - "k8s.io/api/core/v1.PreferAvoidPodsEntry": schema_k8sio_api_core_v1_PreferAvoidPodsEntry(ref), - "k8s.io/api/core/v1.PreferredSchedulingTerm": schema_k8sio_api_core_v1_PreferredSchedulingTerm(ref), - "k8s.io/api/core/v1.Probe": schema_k8sio_api_core_v1_Probe(ref), - "k8s.io/api/core/v1.ProjectedVolumeSource": schema_k8sio_api_core_v1_ProjectedVolumeSource(ref), - "k8s.io/api/core/v1.QuobyteVolumeSource": schema_k8sio_api_core_v1_QuobyteVolumeSource(ref), - "k8s.io/api/core/v1.RBDPersistentVolumeSource": schema_k8sio_api_core_v1_RBDPersistentVolumeSource(ref), - "k8s.io/api/core/v1.RBDVolumeSource": schema_k8sio_api_core_v1_RBDVolumeSource(ref), - "k8s.io/api/core/v1.RangeAllocation": schema_k8sio_api_core_v1_RangeAllocation(ref), - "k8s.io/api/core/v1.ReplicationController": schema_k8sio_api_core_v1_ReplicationController(ref), - "k8s.io/api/core/v1.ReplicationControllerCondition": schema_k8sio_api_core_v1_ReplicationControllerCondition(ref), - "k8s.io/api/core/v1.ReplicationControllerList": schema_k8sio_api_core_v1_ReplicationControllerList(ref), - "k8s.io/api/core/v1.ReplicationControllerSpec": schema_k8sio_api_core_v1_ReplicationControllerSpec(ref), - "k8s.io/api/core/v1.ReplicationControllerStatus": schema_k8sio_api_core_v1_ReplicationControllerStatus(ref), - "k8s.io/api/core/v1.ResourceFieldSelector": schema_k8sio_api_core_v1_ResourceFieldSelector(ref), - "k8s.io/api/core/v1.ResourceQuota": schema_k8sio_api_core_v1_ResourceQuota(ref), - "k8s.io/api/core/v1.ResourceQuotaList": schema_k8sio_api_core_v1_ResourceQuotaList(ref), - "k8s.io/api/core/v1.ResourceQuotaSpec": schema_k8sio_api_core_v1_ResourceQuotaSpec(ref), - "k8s.io/api/core/v1.ResourceQuotaStatus": schema_k8sio_api_core_v1_ResourceQuotaStatus(ref), - "k8s.io/api/core/v1.ResourceRequirements": schema_k8sio_api_core_v1_ResourceRequirements(ref), - "k8s.io/api/core/v1.SELinuxOptions": schema_k8sio_api_core_v1_SELinuxOptions(ref), - "k8s.io/api/core/v1.ScaleIOPersistentVolumeSource": schema_k8sio_api_core_v1_ScaleIOPersistentVolumeSource(ref), - "k8s.io/api/core/v1.ScaleIOVolumeSource": schema_k8sio_api_core_v1_ScaleIOVolumeSource(ref), - "k8s.io/api/core/v1.ScopeSelector": schema_k8sio_api_core_v1_ScopeSelector(ref), - "k8s.io/api/core/v1.ScopedResourceSelectorRequirement": schema_k8sio_api_core_v1_ScopedResourceSelectorRequirement(ref), - "k8s.io/api/core/v1.Secret": schema_k8sio_api_core_v1_Secret(ref), - "k8s.io/api/core/v1.SecretEnvSource": schema_k8sio_api_core_v1_SecretEnvSource(ref), - "k8s.io/api/core/v1.SecretKeySelector": schema_k8sio_api_core_v1_SecretKeySelector(ref), - "k8s.io/api/core/v1.SecretList": schema_k8sio_api_core_v1_SecretList(ref), - "k8s.io/api/core/v1.SecretProjection": schema_k8sio_api_core_v1_SecretProjection(ref), - "k8s.io/api/core/v1.SecretReference": schema_k8sio_api_core_v1_SecretReference(ref), - "k8s.io/api/core/v1.SecretVolumeSource": schema_k8sio_api_core_v1_SecretVolumeSource(ref), - "k8s.io/api/core/v1.SecurityContext": schema_k8sio_api_core_v1_SecurityContext(ref), - "k8s.io/api/core/v1.SerializedReference": schema_k8sio_api_core_v1_SerializedReference(ref), - "k8s.io/api/core/v1.Service": schema_k8sio_api_core_v1_Service(ref), - "k8s.io/api/core/v1.ServiceAccount": schema_k8sio_api_core_v1_ServiceAccount(ref), - "k8s.io/api/core/v1.ServiceAccountList": schema_k8sio_api_core_v1_ServiceAccountList(ref), - "k8s.io/api/core/v1.ServiceAccountTokenProjection": schema_k8sio_api_core_v1_ServiceAccountTokenProjection(ref), - "k8s.io/api/core/v1.ServiceList": schema_k8sio_api_core_v1_ServiceList(ref), - "k8s.io/api/core/v1.ServicePort": schema_k8sio_api_core_v1_ServicePort(ref), - "k8s.io/api/core/v1.ServiceProxyOptions": schema_k8sio_api_core_v1_ServiceProxyOptions(ref), - "k8s.io/api/core/v1.ServiceSpec": schema_k8sio_api_core_v1_ServiceSpec(ref), - "k8s.io/api/core/v1.ServiceStatus": schema_k8sio_api_core_v1_ServiceStatus(ref), - "k8s.io/api/core/v1.SessionAffinityConfig": schema_k8sio_api_core_v1_SessionAffinityConfig(ref), - "k8s.io/api/core/v1.StorageOSPersistentVolumeSource": schema_k8sio_api_core_v1_StorageOSPersistentVolumeSource(ref), - "k8s.io/api/core/v1.StorageOSVolumeSource": schema_k8sio_api_core_v1_StorageOSVolumeSource(ref), - "k8s.io/api/core/v1.Sysctl": schema_k8sio_api_core_v1_Sysctl(ref), - "k8s.io/api/core/v1.TCPSocketAction": schema_k8sio_api_core_v1_TCPSocketAction(ref), - "k8s.io/api/core/v1.Taint": schema_k8sio_api_core_v1_Taint(ref), - "k8s.io/api/core/v1.Toleration": schema_k8sio_api_core_v1_Toleration(ref), - "k8s.io/api/core/v1.TopologySelectorLabelRequirement": schema_k8sio_api_core_v1_TopologySelectorLabelRequirement(ref), - "k8s.io/api/core/v1.TopologySelectorTerm": schema_k8sio_api_core_v1_TopologySelectorTerm(ref), - "k8s.io/api/core/v1.TypedLocalObjectReference": schema_k8sio_api_core_v1_TypedLocalObjectReference(ref), - "k8s.io/api/core/v1.Volume": schema_k8sio_api_core_v1_Volume(ref), - "k8s.io/api/core/v1.VolumeDevice": schema_k8sio_api_core_v1_VolumeDevice(ref), - "k8s.io/api/core/v1.VolumeMount": schema_k8sio_api_core_v1_VolumeMount(ref), - "k8s.io/api/core/v1.VolumeNodeAffinity": schema_k8sio_api_core_v1_VolumeNodeAffinity(ref), - "k8s.io/api/core/v1.VolumeProjection": schema_k8sio_api_core_v1_VolumeProjection(ref), - "k8s.io/api/core/v1.VolumeSource": schema_k8sio_api_core_v1_VolumeSource(ref), - "k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource": schema_k8sio_api_core_v1_VsphereVirtualDiskVolumeSource(ref), - "k8s.io/api/core/v1.WeightedPodAffinityTerm": schema_k8sio_api_core_v1_WeightedPodAffinityTerm(ref), - "k8s.io/api/core/v1.WindowsSecurityContextOptions": schema_k8sio_api_core_v1_WindowsSecurityContextOptions(ref), - "k8s.io/apimachinery/pkg/api/resource.Quantity": schema_apimachinery_pkg_api_resource_Quantity(ref), - "k8s.io/apimachinery/pkg/api/resource.int64Amount": schema_apimachinery_pkg_api_resource_int64Amount(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup": schema_pkg_apis_meta_v1_APIGroup(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroupList": schema_pkg_apis_meta_v1_APIGroupList(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIResource": schema_pkg_apis_meta_v1_APIResource(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIResourceList": schema_pkg_apis_meta_v1_APIResourceList(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIVersions": schema_pkg_apis_meta_v1_APIVersions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.CreateOptions": schema_pkg_apis_meta_v1_CreateOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.DeleteOptions": schema_pkg_apis_meta_v1_DeleteOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Duration": schema_pkg_apis_meta_v1_Duration(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ExportOptions": schema_pkg_apis_meta_v1_ExportOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Fields": schema_pkg_apis_meta_v1_Fields(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GetOptions": schema_pkg_apis_meta_v1_GetOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupKind": schema_pkg_apis_meta_v1_GroupKind(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupResource": schema_pkg_apis_meta_v1_GroupResource(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersion": schema_pkg_apis_meta_v1_GroupVersion(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery": schema_pkg_apis_meta_v1_GroupVersionForDiscovery(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionKind": schema_pkg_apis_meta_v1_GroupVersionKind(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionResource": schema_pkg_apis_meta_v1_GroupVersionResource(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Initializer": schema_pkg_apis_meta_v1_Initializer(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Initializers": schema_pkg_apis_meta_v1_Initializers(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.InternalEvent": schema_pkg_apis_meta_v1_InternalEvent(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector": schema_pkg_apis_meta_v1_LabelSelector(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement": schema_pkg_apis_meta_v1_LabelSelectorRequirement(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.List": schema_pkg_apis_meta_v1_List(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta": schema_pkg_apis_meta_v1_ListMeta(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ListOptions": schema_pkg_apis_meta_v1_ListOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry": schema_pkg_apis_meta_v1_ManagedFieldsEntry(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime": schema_pkg_apis_meta_v1_MicroTime(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta": schema_pkg_apis_meta_v1_ObjectMeta(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference": schema_pkg_apis_meta_v1_OwnerReference(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata": schema_pkg_apis_meta_v1_PartialObjectMetadata(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadataList": schema_pkg_apis_meta_v1_PartialObjectMetadataList(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Patch": schema_pkg_apis_meta_v1_Patch(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.PatchOptions": schema_pkg_apis_meta_v1_PatchOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions": schema_pkg_apis_meta_v1_Preconditions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.RootPaths": schema_pkg_apis_meta_v1_RootPaths(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR": schema_pkg_apis_meta_v1_ServerAddressByClientCIDR(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Status": schema_pkg_apis_meta_v1_Status(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause": schema_pkg_apis_meta_v1_StatusCause(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails": schema_pkg_apis_meta_v1_StatusDetails(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Table": schema_pkg_apis_meta_v1_Table(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition": schema_pkg_apis_meta_v1_TableColumnDefinition(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TableOptions": schema_pkg_apis_meta_v1_TableOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TableRow": schema_pkg_apis_meta_v1_TableRow(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition": schema_pkg_apis_meta_v1_TableRowCondition(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Time": schema_pkg_apis_meta_v1_Time(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Timestamp": schema_pkg_apis_meta_v1_Timestamp(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta": schema_pkg_apis_meta_v1_TypeMeta(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.UpdateOptions": schema_pkg_apis_meta_v1_UpdateOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.WatchEvent": schema_pkg_apis_meta_v1_WatchEvent(ref), - "k8s.io/apimachinery/pkg/runtime.RawExtension": schema_k8sio_apimachinery_pkg_runtime_RawExtension(ref), - "k8s.io/apimachinery/pkg/runtime.TypeMeta": schema_k8sio_apimachinery_pkg_runtime_TypeMeta(ref), - "k8s.io/apimachinery/pkg/runtime.Unknown": schema_k8sio_apimachinery_pkg_runtime_Unknown(ref), - "k8s.io/apimachinery/pkg/util/intstr.IntOrString": schema_apimachinery_pkg_util_intstr_IntOrString(ref), - "k8s.io/apimachinery/pkg/version.Info": schema_k8sio_apimachinery_pkg_version_Info(ref), - } -} - -func schema_pkg_apis_common_v1_JobCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "JobCondition describes the state of the job at a certain point.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type of job condition.", - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status of the condition, one of True, False, Unknown.", - Type: []string{"string"}, - Format: "", - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "The reason for the condition's last transition.", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "A human readable message indicating details about the transition.", - Type: []string{"string"}, - Format: "", - }, - }, - "lastUpdateTime": { - SchemaProps: spec.SchemaProps{ - Description: "The last time this condition was updated.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "lastTransitionTime": { - SchemaProps: spec.SchemaProps{ - Description: "Last time the condition transitioned from one status to another.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - }, - Required: []string{"type", "status"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_pkg_apis_common_v1_JobStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "JobStatus represents the current observed state of the training Job.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "conditions": { - SchemaProps: spec.SchemaProps{ - Description: "Conditions is an array of current observed job conditions.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/kubeflow/common/pkg/apis/common/v1.JobCondition"), - }, - }, - }, - }, - }, - "replicaStatuses": { - SchemaProps: spec.SchemaProps{ - Description: "ReplicaStatuses is map of ReplicaType and ReplicaStatus, specifies the status of each replica.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/kubeflow/common/pkg/apis/common/v1.ReplicaStatus"), - }, - }, - }, - }, - }, - "startTime": { - SchemaProps: spec.SchemaProps{ - Description: "Represents time when the job was acknowledged by the job controller. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "completionTime": { - SchemaProps: spec.SchemaProps{ - Description: "Represents time when the job was completed. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "lastReconcileTime": { - SchemaProps: spec.SchemaProps{ - Description: "Represents last time when the job was reconciled. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - }, - Required: []string{"conditions", "replicaStatuses"}, - }, - }, - Dependencies: []string{ - "github.com/kubeflow/common/pkg/apis/common/v1.JobCondition", "github.com/kubeflow/common/pkg/apis/common/v1.ReplicaStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_pkg_apis_common_v1_ReplicaSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReplicaSpec is a description of the replica", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "replicas": { - SchemaProps: spec.SchemaProps{ - Description: "Replicas is the desired number of replicas of the given template. If unspecified, defaults to 1.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "template": { - SchemaProps: spec.SchemaProps{ - Description: "Template is the object that describes the pod that will be created for this replica. RestartPolicy in PodTemplateSpec will be overide by RestartPolicy in ReplicaSpec", - Ref: ref("k8s.io/api/core/v1.PodTemplateSpec"), - }, - }, - "restartPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "Restart policy for all replicas within the job. One of Always, OnFailure, Never and ExitCode. Default to Never.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PodTemplateSpec"}, - } -} - -func schema_pkg_apis_common_v1_ReplicaStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReplicaStatus represents the current observed state of the replica.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "active": { - SchemaProps: spec.SchemaProps{ - Description: "The number of actively running pods.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "succeeded": { - SchemaProps: spec.SchemaProps{ - Description: "The number of pods which reached phase Succeeded.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "failed": { - SchemaProps: spec.SchemaProps{ - Description: "The number of pods which reached phase Failed.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_common_v1_RunPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RunPolicy encapsulates various runtime policies of the distributed training job, for example how to clean up resources and how long the job can stay active.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "cleanPodPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "CleanPodPolicy defines the policy to kill pods after the job completes. Default to Running.", - Type: []string{"string"}, - Format: "", - }, - }, - "ttlSecondsAfterFinished": { - SchemaProps: spec.SchemaProps{ - Description: "TTLSecondsAfterFinished is the TTL to clean up jobs. It may take extra ReconcilePeriod seconds for the cleanup, since reconcile gets called periodically. Default to infinite.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "activeDeadlineSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies the duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "backoffLimit": { - SchemaProps: spec.SchemaProps{ - Description: "Optional number of retries before marking this job failed.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "schedulingPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "SchedulingPolicy defines the policy related to scheduling, e.g. gang-scheduling", - Ref: ref("github.com/kubeflow/common/pkg/apis/common/v1.SchedulingPolicy"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/kubeflow/common/pkg/apis/common/v1.SchedulingPolicy"}, - } -} - -func schema_pkg_apis_common_v1_SchedulingPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SchedulingPolicy encapsulates various scheduling policies of the distributed training job, for example `minAvailable` for gang-scheduling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "minAvailable": { - SchemaProps: spec.SchemaProps{ - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_api_core_v1_AWSElasticBlockStoreVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a Persistent Disk resource in AWS.\n\nAn AWS EBS disk must exist before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "volumeID": { - SchemaProps: spec.SchemaProps{ - Description: "Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", - Type: []string{"string"}, - Format: "", - }, - }, - "partition": { - SchemaProps: spec.SchemaProps{ - Description: "The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty).", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Specify \"true\" to force and set the ReadOnly property in VolumeMounts to \"true\". If omitted, the default is \"false\". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"volumeID"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_Affinity(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Affinity is a group of affinity scheduling rules.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "nodeAffinity": { - SchemaProps: spec.SchemaProps{ - Description: "Describes node affinity scheduling rules for the pod.", - Ref: ref("k8s.io/api/core/v1.NodeAffinity"), - }, - }, - "podAffinity": { - SchemaProps: spec.SchemaProps{ - Description: "Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).", - Ref: ref("k8s.io/api/core/v1.PodAffinity"), - }, - }, - "podAntiAffinity": { - SchemaProps: spec.SchemaProps{ - Description: "Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).", - Ref: ref("k8s.io/api/core/v1.PodAntiAffinity"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.NodeAffinity", "k8s.io/api/core/v1.PodAffinity", "k8s.io/api/core/v1.PodAntiAffinity"}, - } -} - -func schema_k8sio_api_core_v1_AttachedVolume(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "AttachedVolume describes a volume attached to a node", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the attached volume", - Type: []string{"string"}, - Format: "", - }, - }, - "devicePath": { - SchemaProps: spec.SchemaProps{ - Description: "DevicePath represents the device path where the volume should be available", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name", "devicePath"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_AvoidPods(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "AvoidPods describes pods that should avoid this node. This is the value for a Node annotation with key scheduler.alpha.kubernetes.io/preferAvoidPods and will eventually become a field of NodeStatus.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "preferAvoidPods": { - SchemaProps: spec.SchemaProps{ - Description: "Bounded-sized list of signatures of pods that should avoid this node, sorted in timestamp order from oldest to newest. Size of the slice is unspecified.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.PreferAvoidPodsEntry"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PreferAvoidPodsEntry"}, - } -} - -func schema_k8sio_api_core_v1_AzureDiskVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "diskName": { - SchemaProps: spec.SchemaProps{ - Description: "The Name of the data disk in the blob storage", - Type: []string{"string"}, - Format: "", - }, - }, - "diskURI": { - SchemaProps: spec.SchemaProps{ - Description: "The URI the data disk in the blob storage", - Type: []string{"string"}, - Format: "", - }, - }, - "cachingMode": { - SchemaProps: spec.SchemaProps{ - Description: "Host Caching mode: None, Read Only, Read Write.", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Expected values Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"diskName", "diskURI"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_AzureFilePersistentVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "secretName": { - SchemaProps: spec.SchemaProps{ - Description: "the name of secret that contains Azure Storage Account Name and Key", - Type: []string{"string"}, - Format: "", - }, - }, - "shareName": { - SchemaProps: spec.SchemaProps{ - Description: "Share Name", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "secretNamespace": { - SchemaProps: spec.SchemaProps{ - Description: "the namespace of the secret that contains Azure Storage Account Name and Key default is the same as the Pod", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"secretName", "shareName"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_AzureFileVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "secretName": { - SchemaProps: spec.SchemaProps{ - Description: "the name of secret that contains Azure Storage Account Name and Key", - Type: []string{"string"}, - Format: "", - }, - }, - "shareName": { - SchemaProps: spec.SchemaProps{ - Description: "Share Name", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"secretName", "shareName"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_Binding(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Binding ties one object to another; for example, a pod is bound to a node by a scheduler. Deprecated in 1.7, please use the bindings subresource of pods instead.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "target": { - SchemaProps: spec.SchemaProps{ - Description: "The target object that you want to bind to the standard object.", - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, - }, - Required: []string{"target"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_CSIPersistentVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents storage that is managed by an external CSI volume driver (Beta feature)", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "driver": { - SchemaProps: spec.SchemaProps{ - Description: "Driver is the name of the driver to use for this volume. Required.", - Type: []string{"string"}, - Format: "", - }, - }, - "volumeHandle": { - SchemaProps: spec.SchemaProps{ - Description: "VolumeHandle is the unique volume name returned by the CSI volume plugin’s CreateVolume to refer to the volume on all subsequent calls. Required.", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: The value to pass to ControllerPublishVolumeRequest. Defaults to false (read/write).", - Type: []string{"boolean"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\".", - Type: []string{"string"}, - Format: "", - }, - }, - "volumeAttributes": { - SchemaProps: spec.SchemaProps{ - Description: "Attributes of the volume to publish.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "controllerPublishSecretRef": { - SchemaProps: spec.SchemaProps{ - Description: "ControllerPublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerPublishVolume and ControllerUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.", - Ref: ref("k8s.io/api/core/v1.SecretReference"), - }, - }, - "nodeStageSecretRef": { - SchemaProps: spec.SchemaProps{ - Description: "NodeStageSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodeStageVolume and NodeStageVolume and NodeUnstageVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.", - Ref: ref("k8s.io/api/core/v1.SecretReference"), - }, - }, - "nodePublishSecretRef": { - SchemaProps: spec.SchemaProps{ - Description: "NodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.", - Ref: ref("k8s.io/api/core/v1.SecretReference"), - }, - }, - "controllerExpandSecretRef": { - SchemaProps: spec.SchemaProps{ - Description: "ControllerExpandSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerExpandVolume call. This is an alpha field and requires enabling ExpandCSIVolumes feature gate. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.", - Ref: ref("k8s.io/api/core/v1.SecretReference"), - }, - }, - }, - Required: []string{"driver", "volumeHandle"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.SecretReference"}, - } -} - -func schema_k8sio_api_core_v1_CSIVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a source location of a volume to mount, managed by an external CSI driver", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "driver": { - SchemaProps: spec.SchemaProps{ - Description: "Driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster.", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies a read-only configuration for the volume. Defaults to false (read/write).", - Type: []string{"boolean"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Ex. \"ext4\", \"xfs\", \"ntfs\". If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply.", - Type: []string{"string"}, - Format: "", - }, - }, - "volumeAttributes": { - SchemaProps: spec.SchemaProps{ - Description: "VolumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "nodePublishSecretRef": { - SchemaProps: spec.SchemaProps{ - Description: "NodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secret references are passed.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - }, - Required: []string{"driver"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - -func schema_k8sio_api_core_v1_Capabilities(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Adds and removes POSIX capabilities from running containers.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "add": { - SchemaProps: spec.SchemaProps{ - Description: "Added capabilities", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "drop": { - SchemaProps: spec.SchemaProps{ - Description: "Removed capabilities", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_api_core_v1_CephFSPersistentVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "monitors": { - SchemaProps: spec.SchemaProps{ - Description: "Required: Monitors is a collection of Ceph monitors More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Used as the mounted root, rather than the full Ceph tree, default is /", - Type: []string{"string"}, - Format: "", - }, - }, - "user": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: User is the rados user name, default is admin More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it", - Type: []string{"string"}, - Format: "", - }, - }, - "secretFile": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it", - Type: []string{"string"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it", - Ref: ref("k8s.io/api/core/v1.SecretReference"), - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"monitors"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.SecretReference"}, - } -} - -func schema_k8sio_api_core_v1_CephFSVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "monitors": { - SchemaProps: spec.SchemaProps{ - Description: "Required: Monitors is a collection of Ceph monitors More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Used as the mounted root, rather than the full Ceph tree, default is /", - Type: []string{"string"}, - Format: "", - }, - }, - "user": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: User is the rados user name, default is admin More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it", - Type: []string{"string"}, - Format: "", - }, - }, - "secretFile": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it", - Type: []string{"string"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"monitors"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - -func schema_k8sio_api_core_v1_CinderPersistentVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "volumeID": { - SchemaProps: spec.SchemaProps{ - Description: "volume id used to identify the volume in cinder More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md", - Type: []string{"boolean"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: points to a secret object containing parameters used to connect to OpenStack.", - Ref: ref("k8s.io/api/core/v1.SecretReference"), - }, - }, - }, - Required: []string{"volumeID"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.SecretReference"}, - } -} - -func schema_k8sio_api_core_v1_CinderVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "volumeID": { - SchemaProps: spec.SchemaProps{ - Description: "volume id used to identify the volume in cinder More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md", - Type: []string{"boolean"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: points to a secret object containing parameters used to connect to OpenStack.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - }, - Required: []string{"volumeID"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - -func schema_k8sio_api_core_v1_ClientIPConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ClientIPConfig represents the configurations of Client IP based session affinity.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "timeoutSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "timeoutSeconds specifies the seconds of ClientIP type session sticky time. The value must be >0 && <=86400(for 1 day) if ServiceAffinity == \"ClientIP\". Default value is 10800(for 3 hours).", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_api_core_v1_ComponentCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Information about the condition of a component.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type of condition for a component. Valid value: \"Healthy\"", - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status of the condition for a component. Valid values for \"Healthy\": \"True\", \"False\", or \"Unknown\".", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "Message about the condition for a component. For example, information about a health check.", - Type: []string{"string"}, - Format: "", - }, - }, - "error": { - SchemaProps: spec.SchemaProps{ - Description: "Condition error code for a component. For example, a health check error code.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type", "status"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_ComponentStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ComponentStatus (and ComponentStatusList) holds the cluster validation info.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "conditions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "type", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "List of component conditions observed", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ComponentCondition"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ComponentCondition", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_ComponentStatusList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Status of all the conditions for the component as a list of ComponentStatus objects.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of ComponentStatus objects.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ComponentStatus"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ComponentStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_ConfigMap(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ConfigMap holds configuration data for pods to consume.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "data": { - SchemaProps: spec.SchemaProps{ - Description: "Data contains the configuration data. Each key must consist of alphanumeric characters, '-', '_' or '.'. Values with non-UTF-8 byte sequences must use the BinaryData field. The keys stored in Data must not overlap with the keys in the BinaryData field, this is enforced during validation process.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "binaryData": { - SchemaProps: spec.SchemaProps{ - Description: "BinaryData contains the binary data. Each key must consist of alphanumeric characters, '-', '_' or '.'. BinaryData can contain byte sequences that are not in the UTF-8 range. The keys stored in BinaryData must not overlap with the ones in the Data field, this is enforced during validation process. Using this field will require 1.10+ apiserver and kubelet.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "byte", - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_ConfigMapEnvSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ConfigMapEnvSource selects a ConfigMap to populate the environment variables with.\n\nThe contents of the target ConfigMap's Data field will represent the key-value pairs as environment variables.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - Type: []string{"string"}, - Format: "", - }, - }, - "optional": { - SchemaProps: spec.SchemaProps{ - Description: "Specify whether the ConfigMap must be defined", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_api_core_v1_ConfigMapKeySelector(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Selects a key from a ConfigMap.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - Type: []string{"string"}, - Format: "", - }, - }, - "key": { - SchemaProps: spec.SchemaProps{ - Description: "The key to select.", - Type: []string{"string"}, - Format: "", - }, - }, - "optional": { - SchemaProps: spec.SchemaProps{ - Description: "Specify whether the ConfigMap or its key must be defined", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"key"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_ConfigMapList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ConfigMapList is a resource containing a list of ConfigMap objects.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "Items is the list of ConfigMaps.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ConfigMap"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ConfigMap", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_ConfigMapNodeConfigSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ConfigMapNodeConfigSource contains the information to reference a ConfigMap as a config source for the Node.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "namespace": { - SchemaProps: spec.SchemaProps{ - Description: "Namespace is the metadata.namespace of the referenced ConfigMap. This field is required in all cases.", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the metadata.name of the referenced ConfigMap. This field is required in all cases.", - Type: []string{"string"}, - Format: "", - }, - }, - "uid": { - SchemaProps: spec.SchemaProps{ - Description: "UID is the metadata.UID of the referenced ConfigMap. This field is forbidden in Node.Spec, and required in Node.Status.", - Type: []string{"string"}, - Format: "", - }, - }, - "resourceVersion": { - SchemaProps: spec.SchemaProps{ - Description: "ResourceVersion is the metadata.ResourceVersion of the referenced ConfigMap. This field is forbidden in Node.Spec, and required in Node.Status.", - Type: []string{"string"}, - Format: "", - }, - }, - "kubeletConfigKey": { - SchemaProps: spec.SchemaProps{ - Description: "KubeletConfigKey declares which key of the referenced ConfigMap corresponds to the KubeletConfiguration structure This field is required in all cases.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"namespace", "name", "kubeletConfigKey"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_ConfigMapProjection(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Adapts a ConfigMap into a projected volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - Type: []string{"string"}, - Format: "", - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.KeyToPath"), - }, - }, - }, - }, - }, - "optional": { - SchemaProps: spec.SchemaProps{ - Description: "Specify whether the ConfigMap or its keys must be defined", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.KeyToPath"}, - } -} - -func schema_k8sio_api_core_v1_ConfigMapVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Adapts a ConfigMap into a volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - Type: []string{"string"}, - Format: "", - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.KeyToPath"), - }, - }, - }, - }, - }, - "defaultMode": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "optional": { - SchemaProps: spec.SchemaProps{ - Description: "Specify whether the ConfigMap or its keys must be defined", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.KeyToPath"}, - } -} - -func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "A single application container that you want to run within a pod.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated.", - Type: []string{"string"}, - Format: "", - }, - }, - "image": { - SchemaProps: spec.SchemaProps{ - Description: "Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.", - Type: []string{"string"}, - Format: "", - }, - }, - "command": { - SchemaProps: spec.SchemaProps{ - Description: "Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "args": { - SchemaProps: spec.SchemaProps{ - Description: "Arguments to the entrypoint. The docker image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "workingDir": { - SchemaProps: spec.SchemaProps{ - Description: "Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.", - Type: []string{"string"}, - Format: "", - }, - }, - "ports": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "containerPort", - "protocol", - }, - "x-kubernetes-list-type": "map", - "x-kubernetes-patch-merge-key": "containerPort", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default \"0.0.0.0\" address inside a container will be accessible from the network. Cannot be updated.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ContainerPort"), - }, - }, - }, - }, - }, - "envFrom": { - SchemaProps: spec.SchemaProps{ - Description: "List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.EnvFromSource"), - }, - }, - }, - }, - }, - "env": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "List of environment variables to set in the container. Cannot be updated.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.EnvVar"), - }, - }, - }, - }, - }, - "resources": { - SchemaProps: spec.SchemaProps{ - Description: "Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/", - Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), - }, - }, - "volumeMounts": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "mountPath", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Pod volumes to mount into the container's filesystem. Cannot be updated.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.VolumeMount"), - }, - }, - }, - }, - }, - "volumeDevices": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "devicePath", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "volumeDevices is the list of block devices to be used by the container. This is a beta feature.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.VolumeDevice"), - }, - }, - }, - }, - }, - "livenessProbe": { - SchemaProps: spec.SchemaProps{ - Description: "Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", - Ref: ref("k8s.io/api/core/v1.Probe"), - }, - }, - "readinessProbe": { - SchemaProps: spec.SchemaProps{ - Description: "Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", - Ref: ref("k8s.io/api/core/v1.Probe"), - }, - }, - "lifecycle": { - SchemaProps: spec.SchemaProps{ - Description: "Actions that the management system should take in response to container lifecycle events. Cannot be updated.", - Ref: ref("k8s.io/api/core/v1.Lifecycle"), - }, - }, - "terminationMessagePath": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.", - Type: []string{"string"}, - Format: "", - }, - }, - "terminationMessagePolicy": { - SchemaProps: spec.SchemaProps{ - Description: "Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.", - Type: []string{"string"}, - Format: "", - }, - }, - "imagePullPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images", - Type: []string{"string"}, - Format: "", - }, - }, - "securityContext": { - SchemaProps: spec.SchemaProps{ - Description: "Security options the pod should run with. More info: https://kubernetes.io/docs/concepts/policy/security-context/ More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/", - Ref: ref("k8s.io/api/core/v1.SecurityContext"), - }, - }, - "stdin": { - SchemaProps: spec.SchemaProps{ - Description: "Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "stdinOnce": { - SchemaProps: spec.SchemaProps{ - Description: "Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false", - Type: []string{"boolean"}, - Format: "", - }, - }, - "tty": { - SchemaProps: spec.SchemaProps{ - Description: "Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ContainerPort", "k8s.io/api/core/v1.EnvFromSource", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.Lifecycle", "k8s.io/api/core/v1.Probe", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext", "k8s.io/api/core/v1.VolumeDevice", "k8s.io/api/core/v1.VolumeMount"}, - } -} - -func schema_k8sio_api_core_v1_ContainerImage(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Describe a container image", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "names": { - SchemaProps: spec.SchemaProps{ - Description: "Names by which this image is known. e.g. [\"k8s.gcr.io/hyperkube:v1.0.7\", \"dockerhub.io/google_containers/hyperkube:v1.0.7\"]", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "sizeBytes": { - SchemaProps: spec.SchemaProps{ - Description: "The size of the image in bytes.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - }, - Required: []string{"names"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_ContainerPort(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ContainerPort represents a network port in a single container.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.", - Type: []string{"string"}, - Format: "", - }, - }, - "hostPort": { - SchemaProps: spec.SchemaProps{ - Description: "Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "containerPort": { - SchemaProps: spec.SchemaProps{ - Description: "Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "protocol": { - SchemaProps: spec.SchemaProps{ - Description: "Protocol for port. Must be UDP, TCP, or SCTP. Defaults to \"TCP\".", - Type: []string{"string"}, - Format: "", - }, - }, - "hostIP": { - SchemaProps: spec.SchemaProps{ - Description: "What host IP to bind the external port to.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"containerPort"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_ContainerState(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ContainerState holds a possible state of container. Only one of its members may be specified. If none of them is specified, the default one is ContainerStateWaiting.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "waiting": { - SchemaProps: spec.SchemaProps{ - Description: "Details about a waiting container", - Ref: ref("k8s.io/api/core/v1.ContainerStateWaiting"), - }, - }, - "running": { - SchemaProps: spec.SchemaProps{ - Description: "Details about a running container", - Ref: ref("k8s.io/api/core/v1.ContainerStateRunning"), - }, - }, - "terminated": { - SchemaProps: spec.SchemaProps{ - Description: "Details about a terminated container", - Ref: ref("k8s.io/api/core/v1.ContainerStateTerminated"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ContainerStateRunning", "k8s.io/api/core/v1.ContainerStateTerminated", "k8s.io/api/core/v1.ContainerStateWaiting"}, - } -} - -func schema_k8sio_api_core_v1_ContainerStateRunning(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ContainerStateRunning is a running state of a container.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "startedAt": { - SchemaProps: spec.SchemaProps{ - Description: "Time at which the container was last (re-)started", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_k8sio_api_core_v1_ContainerStateTerminated(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ContainerStateTerminated is a terminated state of a container.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "exitCode": { - SchemaProps: spec.SchemaProps{ - Description: "Exit status from the last termination of the container", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "signal": { - SchemaProps: spec.SchemaProps{ - Description: "Signal from the last termination of the container", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "(brief) reason from the last termination of the container", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "Message regarding the last termination of the container", - Type: []string{"string"}, - Format: "", - }, - }, - "startedAt": { - SchemaProps: spec.SchemaProps{ - Description: "Time at which previous execution of the container started", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "finishedAt": { - SchemaProps: spec.SchemaProps{ - Description: "Time at which the container last terminated", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "containerID": { - SchemaProps: spec.SchemaProps{ - Description: "Container's ID in the format 'docker://'", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"exitCode"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_k8sio_api_core_v1_ContainerStateWaiting(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ContainerStateWaiting is a waiting state of a container.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "(brief) reason the container is not yet running.", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "Message regarding why the container is not yet running.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_api_core_v1_ContainerStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ContainerStatus contains details for the current status of this container.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "This must be a DNS_LABEL. Each container in a pod must have a unique name. Cannot be updated.", - Type: []string{"string"}, - Format: "", - }, - }, - "state": { - SchemaProps: spec.SchemaProps{ - Description: "Details about the container's current condition.", - Ref: ref("k8s.io/api/core/v1.ContainerState"), - }, - }, - "lastState": { - SchemaProps: spec.SchemaProps{ - Description: "Details about the container's last termination condition.", - Ref: ref("k8s.io/api/core/v1.ContainerState"), - }, - }, - "ready": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies whether the container has passed its readiness probe.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "restartCount": { - SchemaProps: spec.SchemaProps{ - Description: "The number of times the container has been restarted, currently based on the number of dead containers that have not yet been removed. Note that this is calculated from dead containers. But those containers are subject to garbage collection. This value will get capped at 5 by GC.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "image": { - SchemaProps: spec.SchemaProps{ - Description: "The image the container is running. More info: https://kubernetes.io/docs/concepts/containers/images", - Type: []string{"string"}, - Format: "", - }, - }, - "imageID": { - SchemaProps: spec.SchemaProps{ - Description: "ImageID of the container's image.", - Type: []string{"string"}, - Format: "", - }, - }, - "containerID": { - SchemaProps: spec.SchemaProps{ - Description: "Container's ID in the format 'docker://'.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name", "ready", "restartCount", "image", "imageID"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ContainerState"}, - } -} - -func schema_k8sio_api_core_v1_DaemonEndpoint(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "DaemonEndpoint contains information about a single Daemon endpoint.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "Port": { - SchemaProps: spec.SchemaProps{ - Description: "Port number of the given endpoint.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"Port"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_DownwardAPIProjection(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents downward API info for projecting into a projected volume. Note that this is identical to a downwardAPI volume source without the default mode.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "items": { - SchemaProps: spec.SchemaProps{ - Description: "Items is a list of DownwardAPIVolume file", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.DownwardAPIVolumeFile"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.DownwardAPIVolumeFile"}, - } -} - -func schema_k8sio_api_core_v1_DownwardAPIVolumeFile(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "DownwardAPIVolumeFile represents information to create the file containing the pod field", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'", - Type: []string{"string"}, - Format: "", - }, - }, - "fieldRef": { - SchemaProps: spec.SchemaProps{ - Description: "Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.", - Ref: ref("k8s.io/api/core/v1.ObjectFieldSelector"), - }, - }, - "resourceFieldRef": { - SchemaProps: spec.SchemaProps{ - Description: "Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.", - Ref: ref("k8s.io/api/core/v1.ResourceFieldSelector"), - }, - }, - "mode": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"path"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ObjectFieldSelector", "k8s.io/api/core/v1.ResourceFieldSelector"}, - } -} - -func schema_k8sio_api_core_v1_DownwardAPIVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "DownwardAPIVolumeSource represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "items": { - SchemaProps: spec.SchemaProps{ - Description: "Items is a list of downward API volume file", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.DownwardAPIVolumeFile"), - }, - }, - }, - }, - }, - "defaultMode": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.DownwardAPIVolumeFile"}, - } -} - -func schema_k8sio_api_core_v1_EmptyDirVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents an empty directory for a pod. Empty directory volumes support ownership management and SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "medium": { - SchemaProps: spec.SchemaProps{ - Description: "What type of storage medium should back this directory. The default is \"\" which means to use the node's default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir", - Type: []string{"string"}, - Format: "", - }, - }, - "sizeLimit": { - SchemaProps: spec.SchemaProps{ - Description: "Total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir", - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity"}, - } -} - -func schema_k8sio_api_core_v1_EndpointAddress(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EndpointAddress is a tuple that describes single IP address.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "ip": { - SchemaProps: spec.SchemaProps{ - Description: "The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), or link-local multicast ((224.0.0.0/24). IPv6 is also accepted but not fully supported on all platforms. Also, certain kubernetes components, like kube-proxy, are not IPv6 ready.", - Type: []string{"string"}, - Format: "", - }, - }, - "hostname": { - SchemaProps: spec.SchemaProps{ - Description: "The Hostname of this endpoint", - Type: []string{"string"}, - Format: "", - }, - }, - "nodeName": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Node hosting this endpoint. This can be used to determine endpoints local to a node.", - Type: []string{"string"}, - Format: "", - }, - }, - "targetRef": { - SchemaProps: spec.SchemaProps{ - Description: "Reference to object providing the endpoint.", - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, - }, - Required: []string{"ip"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ObjectReference"}, - } -} - -func schema_k8sio_api_core_v1_EndpointPort(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EndpointPort is a tuple that describes a single port.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "The name of this port (corresponds to ServicePort.Name). Must be a DNS_LABEL. Optional only if one port is defined.", - Type: []string{"string"}, - Format: "", - }, - }, - "port": { - SchemaProps: spec.SchemaProps{ - Description: "The port number of the endpoint.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "protocol": { - SchemaProps: spec.SchemaProps{ - Description: "The IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"port"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_EndpointSubset(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EndpointSubset is a group of addresses with a common set of ports. The expanded set of endpoints is the Cartesian product of Addresses x Ports. For example, given:\n {\n Addresses: [{\"ip\": \"10.10.1.1\"}, {\"ip\": \"10.10.2.2\"}],\n Ports: [{\"name\": \"a\", \"port\": 8675}, {\"name\": \"b\", \"port\": 309}]\n }\nThe resulting set of endpoints can be viewed as:\n a: [ 10.10.1.1:8675, 10.10.2.2:8675 ],\n b: [ 10.10.1.1:309, 10.10.2.2:309 ]", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "addresses": { - SchemaProps: spec.SchemaProps{ - Description: "IP addresses which offer the related ports that are marked as ready. These endpoints should be considered safe for load balancers and clients to utilize.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.EndpointAddress"), - }, - }, - }, - }, - }, - "notReadyAddresses": { - SchemaProps: spec.SchemaProps{ - Description: "IP addresses which offer the related ports but are not currently marked as ready because they have not yet finished starting, have recently failed a readiness check, or have recently failed a liveness check.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.EndpointAddress"), - }, - }, - }, - }, - }, - "ports": { - SchemaProps: spec.SchemaProps{ - Description: "Port numbers available on the related IP addresses.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.EndpointPort"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.EndpointAddress", "k8s.io/api/core/v1.EndpointPort"}, - } -} - -func schema_k8sio_api_core_v1_Endpoints(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Endpoints is a collection of endpoints that implement the actual service. Example:\n Name: \"mysvc\",\n Subsets: [\n {\n Addresses: [{\"ip\": \"10.10.1.1\"}, {\"ip\": \"10.10.2.2\"}],\n Ports: [{\"name\": \"a\", \"port\": 8675}, {\"name\": \"b\", \"port\": 309}]\n },\n {\n Addresses: [{\"ip\": \"10.10.3.3\"}],\n Ports: [{\"name\": \"a\", \"port\": 93}, {\"name\": \"b\", \"port\": 76}]\n },\n ]", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "subsets": { - SchemaProps: spec.SchemaProps{ - Description: "The set of all endpoints is the union of all subsets. Addresses are placed into subsets according to the IPs they share. A single address with multiple ports, some of which are ready and some of which are not (because they come from different containers) will result in the address being displayed in different subsets for the different ports. No address will appear in both Addresses and NotReadyAddresses in the same subset. Sets of addresses and ports that comprise a service.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.EndpointSubset"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.EndpointSubset", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_EndpointsList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EndpointsList is a list of endpoints.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of endpoints.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Endpoints"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.Endpoints", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_EnvFromSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EnvFromSource represents the source of a set of ConfigMaps", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "prefix": { - SchemaProps: spec.SchemaProps{ - Description: "An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.", - Type: []string{"string"}, - Format: "", - }, - }, - "configMapRef": { - SchemaProps: spec.SchemaProps{ - Description: "The ConfigMap to select from", - Ref: ref("k8s.io/api/core/v1.ConfigMapEnvSource"), - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "The Secret to select from", - Ref: ref("k8s.io/api/core/v1.SecretEnvSource"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ConfigMapEnvSource", "k8s.io/api/core/v1.SecretEnvSource"}, - } -} - -func schema_k8sio_api_core_v1_EnvVar(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EnvVar represents an environment variable present in a Container.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the environment variable. Must be a C_IDENTIFIER.", - Type: []string{"string"}, - Format: "", - }, - }, - "value": { - SchemaProps: spec.SchemaProps{ - Description: "Variable references $(VAR_NAME) are expanded using the previous defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to \"\".", - Type: []string{"string"}, - Format: "", - }, - }, - "valueFrom": { - SchemaProps: spec.SchemaProps{ - Description: "Source for the environment variable's value. Cannot be used if value is not empty.", - Ref: ref("k8s.io/api/core/v1.EnvVarSource"), - }, - }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.EnvVarSource"}, - } -} - -func schema_k8sio_api_core_v1_EnvVarSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EnvVarSource represents a source for the value of an EnvVar.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "fieldRef": { - SchemaProps: spec.SchemaProps{ - Description: "Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP.", - Ref: ref("k8s.io/api/core/v1.ObjectFieldSelector"), - }, - }, - "resourceFieldRef": { - SchemaProps: spec.SchemaProps{ - Description: "Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.", - Ref: ref("k8s.io/api/core/v1.ResourceFieldSelector"), - }, - }, - "configMapKeyRef": { - SchemaProps: spec.SchemaProps{ - Description: "Selects a key of a ConfigMap.", - Ref: ref("k8s.io/api/core/v1.ConfigMapKeySelector"), - }, - }, - "secretKeyRef": { - SchemaProps: spec.SchemaProps{ - Description: "Selects a key of a secret in the pod's namespace", - Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ConfigMapKeySelector", "k8s.io/api/core/v1.ObjectFieldSelector", "k8s.io/api/core/v1.ResourceFieldSelector", "k8s.io/api/core/v1.SecretKeySelector"}, - } -} - -func schema_k8sio_api_core_v1_Event(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Event is a report of an event somewhere in the cluster.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "involvedObject": { - SchemaProps: spec.SchemaProps{ - Description: "The object that this event is about.", - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "This should be a short, machine understandable string that gives the reason for the transition into the object's current status.", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "A human-readable description of the status of this operation.", - Type: []string{"string"}, - Format: "", - }, - }, - "source": { - SchemaProps: spec.SchemaProps{ - Description: "The component reporting this event. Should be a short machine understandable string.", - Ref: ref("k8s.io/api/core/v1.EventSource"), - }, - }, - "firstTimestamp": { - SchemaProps: spec.SchemaProps{ - Description: "The time at which the event was first recorded. (Time of server receipt is in TypeMeta.)", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "lastTimestamp": { - SchemaProps: spec.SchemaProps{ - Description: "The time at which the most recent occurrence of this event was recorded.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "count": { - SchemaProps: spec.SchemaProps{ - Description: "The number of times this event has occurred.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type of this event (Normal, Warning), new types could be added in the future", - Type: []string{"string"}, - Format: "", - }, - }, - "eventTime": { - SchemaProps: spec.SchemaProps{ - Description: "Time when this Event was first observed.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime"), - }, - }, - "series": { - SchemaProps: spec.SchemaProps{ - Description: "Data about the Event series this event represents or nil if it's a singleton Event.", - Ref: ref("k8s.io/api/core/v1.EventSeries"), - }, - }, - "action": { - SchemaProps: spec.SchemaProps{ - Description: "What action was taken/failed regarding to the Regarding object.", - Type: []string{"string"}, - Format: "", - }, - }, - "related": { - SchemaProps: spec.SchemaProps{ - Description: "Optional secondary object for more complex actions.", - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, - "reportingComponent": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`.", - Type: []string{"string"}, - Format: "", - }, - }, - "reportingInstance": { - SchemaProps: spec.SchemaProps{ - Description: "ID of the controller instance, e.g. `kubelet-xyzf`.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"metadata", "involvedObject"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.EventSeries", "k8s.io/api/core/v1.EventSource", "k8s.io/api/core/v1.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_k8sio_api_core_v1_EventList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EventList is a list of events.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of events", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Event"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.Event", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_EventSeries(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EventSeries contain information on series of events, i.e. thing that was/is happening continuously for some time.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "count": { - SchemaProps: spec.SchemaProps{ - Description: "Number of occurrences in this series up to the last heartbeat time", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "lastObservedTime": { - SchemaProps: spec.SchemaProps{ - Description: "Time of the last occurrence observed", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime"), - }, - }, - "state": { - SchemaProps: spec.SchemaProps{ - Description: "State of this Series: Ongoing or Finished Deprecated. Planned removal for 1.18", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime"}, - } -} - -func schema_k8sio_api_core_v1_EventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EventSource contains information for an event.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "component": { - SchemaProps: spec.SchemaProps{ - Description: "Component from which the event is generated.", - Type: []string{"string"}, - Format: "", - }, - }, - "host": { - SchemaProps: spec.SchemaProps{ - Description: "Node name on which the event is generated.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_api_core_v1_ExecAction(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ExecAction describes a \"run in container\" action.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "command": { - SchemaProps: spec.SchemaProps{ - Description: "Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_api_core_v1_FCVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as read/write once. Fibre Channel volumes support ownership management and SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "targetWWNs": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: FC target worldwide names (WWNs)", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "lun": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: FC target lun number", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "wwids": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_api_core_v1_FlexPersistentVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "FlexPersistentVolumeSource represents a generic persistent volume resource that is provisioned/attached using an exec based plugin.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "driver": { - SchemaProps: spec.SchemaProps{ - Description: "Driver is the name of the driver to use for this volume.", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default filesystem depends on FlexVolume script.", - Type: []string{"string"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: SecretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts.", - Ref: ref("k8s.io/api/core/v1.SecretReference"), - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "options": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Extra command options if any.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"driver"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.SecretReference"}, - } -} - -func schema_k8sio_api_core_v1_FlexVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "driver": { - SchemaProps: spec.SchemaProps{ - Description: "Driver is the name of the driver to use for this volume.", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default filesystem depends on FlexVolume script.", - Type: []string{"string"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: SecretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "options": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Extra command options if any.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"driver"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - -func schema_k8sio_api_core_v1_FlockerVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a Flocker volume mounted by the Flocker agent. One and only one of datasetName and datasetUUID should be set. Flocker volumes do not support ownership management or SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "datasetName": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated", - Type: []string{"string"}, - Format: "", - }, - }, - "datasetUUID": { - SchemaProps: spec.SchemaProps{ - Description: "UUID of the dataset. This is unique identifier of a Flocker dataset", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_api_core_v1_GCEPersistentDiskVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a Persistent Disk resource in Google Compute Engine.\n\nA GCE PD must exist before mounting to a container. The disk must also be in the same GCE project and zone as the kubelet. A GCE PD can only be mounted as read/write once or read-only many times. GCE PDs support ownership management and SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "pdName": { - SchemaProps: spec.SchemaProps{ - Description: "Unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", - Type: []string{"string"}, - Format: "", - }, - }, - "partition": { - SchemaProps: spec.SchemaProps{ - Description: "The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"pdName"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_GitRepoVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a volume that is populated with the contents of a git repository. Git repo volumes do not support ownership management. Git repo volumes support SELinux relabeling.\n\nDEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "repository": { - SchemaProps: spec.SchemaProps{ - Description: "Repository URL", - Type: []string{"string"}, - Format: "", - }, - }, - "revision": { - SchemaProps: spec.SchemaProps{ - Description: "Commit hash for the specified revision.", - Type: []string{"string"}, - Format: "", - }, - }, - "directory": { - SchemaProps: spec.SchemaProps{ - Description: "Target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"repository"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_GlusterfsPersistentVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "endpoints": { - SchemaProps: spec.SchemaProps{ - Description: "EndpointsName is the endpoint name that details Glusterfs topology. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod", - Type: []string{"string"}, - Format: "", - }, - }, - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Path is the Glusterfs volume path. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod", - Type: []string{"boolean"}, - Format: "", - }, - }, - "endpointsNamespace": { - SchemaProps: spec.SchemaProps{ - Description: "EndpointsNamespace is the namespace that contains Glusterfs endpoint. If this field is empty, the EndpointNamespace defaults to the same namespace as the bound PVC. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"endpoints", "path"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_GlusterfsVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "endpoints": { - SchemaProps: spec.SchemaProps{ - Description: "EndpointsName is the endpoint name that details Glusterfs topology. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod", - Type: []string{"string"}, - Format: "", - }, - }, - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Path is the Glusterfs volume path. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"endpoints", "path"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_HTTPGetAction(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HTTPGetAction describes an action based on HTTP Get requests.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Path to access on the HTTP server.", - Type: []string{"string"}, - Format: "", - }, - }, - "port": { - SchemaProps: spec.SchemaProps{ - Description: "Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.", - Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), - }, - }, - "host": { - SchemaProps: spec.SchemaProps{ - Description: "Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in httpHeaders instead.", - Type: []string{"string"}, - Format: "", - }, - }, - "scheme": { - SchemaProps: spec.SchemaProps{ - Description: "Scheme to use for connecting to the host. Defaults to HTTP.", - Type: []string{"string"}, - Format: "", - }, - }, - "httpHeaders": { - SchemaProps: spec.SchemaProps{ - Description: "Custom headers to set in the request. HTTP allows repeated headers.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.HTTPHeader"), - }, - }, - }, - }, - }, - }, - Required: []string{"port"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.HTTPHeader", "k8s.io/apimachinery/pkg/util/intstr.IntOrString"}, - } -} - -func schema_k8sio_api_core_v1_HTTPHeader(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HTTPHeader describes a custom header to be used in HTTP probes", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "The header field name", - Type: []string{"string"}, - Format: "", - }, - }, - "value": { - SchemaProps: spec.SchemaProps{ - Description: "The header field value", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name", "value"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_Handler(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Handler defines a specific action that should be taken", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "exec": { - SchemaProps: spec.SchemaProps{ - Description: "One and only one of the following should be specified. Exec specifies the action to take.", - Ref: ref("k8s.io/api/core/v1.ExecAction"), - }, - }, - "httpGet": { - SchemaProps: spec.SchemaProps{ - Description: "HTTPGet specifies the http request to perform.", - Ref: ref("k8s.io/api/core/v1.HTTPGetAction"), - }, - }, - "tcpSocket": { - SchemaProps: spec.SchemaProps{ - Description: "TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported", - Ref: ref("k8s.io/api/core/v1.TCPSocketAction"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ExecAction", "k8s.io/api/core/v1.HTTPGetAction", "k8s.io/api/core/v1.TCPSocketAction"}, - } -} - -func schema_k8sio_api_core_v1_HostAlias(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "ip": { - SchemaProps: spec.SchemaProps{ - Description: "IP address of the host file entry.", - Type: []string{"string"}, - Format: "", - }, - }, - "hostnames": { - SchemaProps: spec.SchemaProps{ - Description: "Hostnames for the above IP address.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_api_core_v1_HostPathVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a host path mapped into a pod. Host path volumes do not support ownership management or SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath", - Type: []string{"string"}, - Format: "", - }, - }, - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type for HostPath Volume Defaults to \"\" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"path"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_ISCSIPersistentVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ISCSIPersistentVolumeSource represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "targetPortal": { - SchemaProps: spec.SchemaProps{ - Description: "iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).", - Type: []string{"string"}, - Format: "", - }, - }, - "iqn": { - SchemaProps: spec.SchemaProps{ - Description: "Target iSCSI Qualified Name.", - Type: []string{"string"}, - Format: "", - }, - }, - "lun": { - SchemaProps: spec.SchemaProps{ - Description: "iSCSI Target Lun number.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "iscsiInterface": { - SchemaProps: spec.SchemaProps{ - Description: "iSCSI Interface Name that uses an iSCSI transport. Defaults to 'default' (tcp).", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "portals": { - SchemaProps: spec.SchemaProps{ - Description: "iSCSI Target Portal List. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "chapAuthDiscovery": { - SchemaProps: spec.SchemaProps{ - Description: "whether support iSCSI Discovery CHAP authentication", - Type: []string{"boolean"}, - Format: "", - }, - }, - "chapAuthSession": { - SchemaProps: spec.SchemaProps{ - Description: "whether support iSCSI Session CHAP authentication", - Type: []string{"boolean"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "CHAP Secret for iSCSI target and initiator authentication", - Ref: ref("k8s.io/api/core/v1.SecretReference"), - }, - }, - "initiatorName": { - SchemaProps: spec.SchemaProps{ - Description: "Custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface : will be created for the connection.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"targetPortal", "iqn", "lun"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.SecretReference"}, - } -} - -func schema_k8sio_api_core_v1_ISCSIVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "targetPortal": { - SchemaProps: spec.SchemaProps{ - Description: "iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).", - Type: []string{"string"}, - Format: "", - }, - }, - "iqn": { - SchemaProps: spec.SchemaProps{ - Description: "Target iSCSI Qualified Name.", - Type: []string{"string"}, - Format: "", - }, - }, - "lun": { - SchemaProps: spec.SchemaProps{ - Description: "iSCSI Target Lun number.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "iscsiInterface": { - SchemaProps: spec.SchemaProps{ - Description: "iSCSI Interface Name that uses an iSCSI transport. Defaults to 'default' (tcp).", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "portals": { - SchemaProps: spec.SchemaProps{ - Description: "iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "chapAuthDiscovery": { - SchemaProps: spec.SchemaProps{ - Description: "whether support iSCSI Discovery CHAP authentication", - Type: []string{"boolean"}, - Format: "", - }, - }, - "chapAuthSession": { - SchemaProps: spec.SchemaProps{ - Description: "whether support iSCSI Session CHAP authentication", - Type: []string{"boolean"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "CHAP Secret for iSCSI target and initiator authentication", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "initiatorName": { - SchemaProps: spec.SchemaProps{ - Description: "Custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface : will be created for the connection.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"targetPortal", "iqn", "lun"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - -func schema_k8sio_api_core_v1_KeyToPath(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Maps a string key to a path within a volume.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "key": { - SchemaProps: spec.SchemaProps{ - Description: "The key to project.", - Type: []string{"string"}, - Format: "", - }, - }, - "path": { - SchemaProps: spec.SchemaProps{ - Description: "The relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'.", - Type: []string{"string"}, - Format: "", - }, - }, - "mode": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"key", "path"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_Lifecycle(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "postStart": { - SchemaProps: spec.SchemaProps{ - Description: "PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks", - Ref: ref("k8s.io/api/core/v1.Handler"), - }, - }, - "preStop": { - SchemaProps: spec.SchemaProps{ - Description: "PreStop is called immediately before a container is terminated due to an API request or management event such as liveness probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The reason for termination is passed to the handler. The Pod's termination grace period countdown begins before the PreStop hooked is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod's termination grace period. Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks", - Ref: ref("k8s.io/api/core/v1.Handler"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.Handler"}, - } -} - -func schema_k8sio_api_core_v1_LimitRange(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "LimitRange sets resource usage limits for each kind of resource in a Namespace.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the limits enforced. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.LimitRangeSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LimitRangeSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_LimitRangeItem(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "LimitRangeItem defines a min/max usage limit for any resource that matches on kind.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type of resource that this limit applies to.", - Type: []string{"string"}, - Format: "", - }, - }, - "max": { - SchemaProps: spec.SchemaProps{ - Description: "Max usage constraints on this kind by resource name.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - "min": { - SchemaProps: spec.SchemaProps{ - Description: "Min usage constraints on this kind by resource name.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - "default": { - SchemaProps: spec.SchemaProps{ - Description: "Default resource requirement limit value by resource name if resource limit is omitted.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - "defaultRequest": { - SchemaProps: spec.SchemaProps{ - Description: "DefaultRequest is the default resource requirement request value by resource name if resource request is omitted.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - "maxLimitRequestRatio": { - SchemaProps: spec.SchemaProps{ - Description: "MaxLimitRequestRatio if specified, the named resource must have a request and limit that are both non-zero where limit divided by request is less than or equal to the enumerated value; this represents the max burst for the named resource.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity"}, - } -} - -func schema_k8sio_api_core_v1_LimitRangeList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "LimitRangeList is a list of LimitRange items.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "Items is a list of LimitRange objects. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LimitRange"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LimitRange", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_LimitRangeSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "LimitRangeSpec defines a min/max usage limit for resources that match on kind.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "limits": { - SchemaProps: spec.SchemaProps{ - Description: "Limits is the list of LimitRangeItem objects that are enforced.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LimitRangeItem"), - }, - }, - }, - }, - }, - }, - Required: []string{"limits"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LimitRangeItem"}, - } -} - -func schema_k8sio_api_core_v1_List(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "List holds a list of objects, which may not be known by the server.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of objects", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, - } -} - -func schema_k8sio_api_core_v1_LoadBalancerIngress(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "LoadBalancerIngress represents the status of a load-balancer ingress point: traffic intended for the service should be sent to an ingress point.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "ip": { - SchemaProps: spec.SchemaProps{ - Description: "IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balancers)", - Type: []string{"string"}, - Format: "", - }, - }, - "hostname": { - SchemaProps: spec.SchemaProps{ - Description: "Hostname is set for load-balancer ingress points that are DNS based (typically AWS load-balancers)", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_api_core_v1_LoadBalancerStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "LoadBalancerStatus represents the status of a load-balancer.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "ingress": { - SchemaProps: spec.SchemaProps{ - Description: "Ingress is a list containing ingress points for the load-balancer. Traffic intended for the service should be sent to these ingress points.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LoadBalancerIngress"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LoadBalancerIngress"}, - } -} - -func schema_k8sio_api_core_v1_LocalObjectReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_api_core_v1_LocalVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Local represents directly-attached storage with node affinity (Beta feature)", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "path": { - SchemaProps: spec.SchemaProps{ - Description: "The full path to the volume on the node. It can be either a directory or block device (disk, partition, ...).", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. It applies only when the Path is a block device. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default value is to auto-select a fileystem if unspecified.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"path"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_NFSVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not support ownership management or SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "server": { - SchemaProps: spec.SchemaProps{ - Description: "Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", - Type: []string{"string"}, - Format: "", - }, - }, - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "ReadOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"server", "path"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_Namespace(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Namespace provides a scope for Names. Use of multiple namespaces is optional.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the behavior of the Namespace. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.NamespaceSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status describes the current status of a Namespace. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.NamespaceStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.NamespaceSpec", "k8s.io/api/core/v1.NamespaceStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_NamespaceList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NamespaceList is a list of Namespaces.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "Items is the list of Namespace objects in the list. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Namespace"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.Namespace", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_NamespaceSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NamespaceSpec describes the attributes on a Namespace.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "finalizers": { - SchemaProps: spec.SchemaProps{ - Description: "Finalizers is an opaque list of values that must be empty to permanently remove object from storage. More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_api_core_v1_NamespaceStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NamespaceStatus is information about the current status of a Namespace.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "phase": { - SchemaProps: spec.SchemaProps{ - Description: "Phase is the current lifecycle phase of the namespace. More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_api_core_v1_Node(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Node is a worker node in Kubernetes. Each node will have a unique identifier in the cache (i.e. in etcd).", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the behavior of a node. https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.NodeSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Most recently observed status of the node. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.NodeStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.NodeSpec", "k8s.io/api/core/v1.NodeStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_NodeAddress(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NodeAddress contains information for the node's address.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Node address type, one of Hostname, ExternalIP or InternalIP.", - Type: []string{"string"}, - Format: "", - }, - }, - "address": { - SchemaProps: spec.SchemaProps{ - Description: "The node address.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type", "address"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_NodeAffinity(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Node affinity is a group of node affinity scheduling rules.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "requiredDuringSchedulingIgnoredDuringExecution": { - SchemaProps: spec.SchemaProps{ - Description: "If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node.", - Ref: ref("k8s.io/api/core/v1.NodeSelector"), - }, - }, - "preferredDuringSchedulingIgnoredDuringExecution": { - SchemaProps: spec.SchemaProps{ - Description: "The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.PreferredSchedulingTerm"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.NodeSelector", "k8s.io/api/core/v1.PreferredSchedulingTerm"}, - } -} - -func schema_k8sio_api_core_v1_NodeCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NodeCondition contains condition information for a node.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type of node condition.", - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status of the condition, one of True, False, Unknown.", - Type: []string{"string"}, - Format: "", - }, - }, - "lastHeartbeatTime": { - SchemaProps: spec.SchemaProps{ - Description: "Last time we got an update on a given condition.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "lastTransitionTime": { - SchemaProps: spec.SchemaProps{ - Description: "Last time the condition transit from one status to another.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "(brief) reason for the condition's last transition.", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "Human readable message indicating details about last transition.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type", "status"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_k8sio_api_core_v1_NodeConfigSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NodeConfigSource specifies a source of node configuration. Exactly one subfield (excluding metadata) must be non-nil.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "configMap": { - SchemaProps: spec.SchemaProps{ - Description: "ConfigMap is a reference to a Node's ConfigMap", - Ref: ref("k8s.io/api/core/v1.ConfigMapNodeConfigSource"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ConfigMapNodeConfigSource"}, - } -} - -func schema_k8sio_api_core_v1_NodeConfigStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NodeConfigStatus describes the status of the config assigned by Node.Spec.ConfigSource.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "assigned": { - SchemaProps: spec.SchemaProps{ - Description: "Assigned reports the checkpointed config the node will try to use. When Node.Spec.ConfigSource is updated, the node checkpoints the associated config payload to local disk, along with a record indicating intended config. The node refers to this record to choose its config checkpoint, and reports this record in Assigned. Assigned only updates in the status after the record has been checkpointed to disk. When the Kubelet is restarted, it tries to make the Assigned config the Active config by loading and validating the checkpointed payload identified by Assigned.", - Ref: ref("k8s.io/api/core/v1.NodeConfigSource"), - }, - }, - "active": { - SchemaProps: spec.SchemaProps{ - Description: "Active reports the checkpointed config the node is actively using. Active will represent either the current version of the Assigned config, or the current LastKnownGood config, depending on whether attempting to use the Assigned config results in an error.", - Ref: ref("k8s.io/api/core/v1.NodeConfigSource"), - }, - }, - "lastKnownGood": { - SchemaProps: spec.SchemaProps{ - Description: "LastKnownGood reports the checkpointed config the node will fall back to when it encounters an error attempting to use the Assigned config. The Assigned config becomes the LastKnownGood config when the node determines that the Assigned config is stable and correct. This is currently implemented as a 10-minute soak period starting when the local record of Assigned config is updated. If the Assigned config is Active at the end of this period, it becomes the LastKnownGood. Note that if Spec.ConfigSource is reset to nil (use local defaults), the LastKnownGood is also immediately reset to nil, because the local default config is always assumed good. You should not make assumptions about the node's method of determining config stability and correctness, as this may change or become configurable in the future.", - Ref: ref("k8s.io/api/core/v1.NodeConfigSource"), - }, - }, - "error": { - SchemaProps: spec.SchemaProps{ - Description: "Error describes any problems reconciling the Spec.ConfigSource to the Active config. Errors may occur, for example, attempting to checkpoint Spec.ConfigSource to the local Assigned record, attempting to checkpoint the payload associated with Spec.ConfigSource, attempting to load or validate the Assigned config, etc. Errors may occur at different points while syncing config. Earlier errors (e.g. download or checkpointing errors) will not result in a rollback to LastKnownGood, and may resolve across Kubelet retries. Later errors (e.g. loading or validating a checkpointed config) will result in a rollback to LastKnownGood. In the latter case, it is usually possible to resolve the error by fixing the config assigned in Spec.ConfigSource. You can find additional information for debugging by searching the error message in the Kubelet log. Error is a human-readable description of the error state; machines can check whether or not Error is empty, but should not rely on the stability of the Error text across Kubelet versions.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.NodeConfigSource"}, - } -} - -func schema_k8sio_api_core_v1_NodeDaemonEndpoints(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NodeDaemonEndpoints lists ports opened by daemons running on the Node.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kubeletEndpoint": { - SchemaProps: spec.SchemaProps{ - Description: "Endpoint on which Kubelet is listening.", - Ref: ref("k8s.io/api/core/v1.DaemonEndpoint"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.DaemonEndpoint"}, - } -} - -func schema_k8sio_api_core_v1_NodeList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NodeList is the whole list of all Nodes which have been registered with master.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of nodes", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Node"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.Node", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_NodeProxyOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NodeProxyOptions is the query options to a Node's proxy call.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Path is the URL path to use for the current proxy request to node.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_api_core_v1_NodeResources(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NodeResources is an object for conveying resource information about a node. see http://releases.k8s.io/HEAD/docs/design/resources.md for more details.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "Capacity": { - SchemaProps: spec.SchemaProps{ - Description: "Capacity represents the available resources of a node", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - }, - Required: []string{"Capacity"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity"}, - } -} - -func schema_k8sio_api_core_v1_NodeSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "nodeSelectorTerms": { - SchemaProps: spec.SchemaProps{ - Description: "Required. A list of node selector terms. The terms are ORed.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.NodeSelectorTerm"), - }, - }, - }, - }, - }, - }, - Required: []string{"nodeSelectorTerms"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.NodeSelectorTerm"}, - } -} - -func schema_k8sio_api_core_v1_NodeSelectorRequirement(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "key": { - SchemaProps: spec.SchemaProps{ - Description: "The label key that the selector applies to.", - Type: []string{"string"}, - Format: "", - }, - }, - "operator": { - SchemaProps: spec.SchemaProps{ - Description: "Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.", - Type: []string{"string"}, - Format: "", - }, - }, - "values": { - SchemaProps: spec.SchemaProps{ - Description: "An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"key", "operator"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_NodeSelectorTerm(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "matchExpressions": { - SchemaProps: spec.SchemaProps{ - Description: "A list of node selector requirements by node's labels.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.NodeSelectorRequirement"), - }, - }, - }, - }, - }, - "matchFields": { - SchemaProps: spec.SchemaProps{ - Description: "A list of node selector requirements by node's fields.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.NodeSelectorRequirement"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.NodeSelectorRequirement"}, - } -} - -func schema_k8sio_api_core_v1_NodeSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NodeSpec describes the attributes that a node is created with.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "podCIDR": { - SchemaProps: spec.SchemaProps{ - Description: "PodCIDR represents the pod IP range assigned to the node.", - Type: []string{"string"}, - Format: "", - }, - }, - "providerID": { - SchemaProps: spec.SchemaProps{ - Description: "ID of the node assigned by the cloud provider in the format: ://", - Type: []string{"string"}, - Format: "", - }, - }, - "unschedulable": { - SchemaProps: spec.SchemaProps{ - Description: "Unschedulable controls node schedulability of new pods. By default, node is schedulable. More info: https://kubernetes.io/docs/concepts/nodes/node/#manual-node-administration", - Type: []string{"boolean"}, - Format: "", - }, - }, - "taints": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, the node's taints.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Taint"), - }, - }, - }, - }, - }, - "configSource": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, the source to get node configuration from The DynamicKubeletConfig feature gate must be enabled for the Kubelet to use this field", - Ref: ref("k8s.io/api/core/v1.NodeConfigSource"), - }, - }, - "externalID": { - SchemaProps: spec.SchemaProps{ - Description: "Deprecated. Not all kubelets will set this field. Remove field after 1.13. see: https://issues.k8s.io/61966", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.NodeConfigSource", "k8s.io/api/core/v1.Taint"}, - } -} - -func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NodeStatus is information about the current status of a node.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "capacity": { - SchemaProps: spec.SchemaProps{ - Description: "Capacity represents the total resources of a node. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - "allocatable": { - SchemaProps: spec.SchemaProps{ - Description: "Allocatable represents the resources of a node that are available for scheduling. Defaults to Capacity.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - "phase": { - SchemaProps: spec.SchemaProps{ - Description: "NodePhase is the recently observed lifecycle phase of the node. More info: https://kubernetes.io/docs/concepts/nodes/node/#phase The field is never populated, and now is deprecated.", - Type: []string{"string"}, - Format: "", - }, - }, - "conditions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "type", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Conditions is an array of current observed node conditions. More info: https://kubernetes.io/docs/concepts/nodes/node/#condition", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.NodeCondition"), - }, - }, - }, - }, - }, - "addresses": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "type", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "List of addresses reachable to the node. Queried from cloud provider, if available. More info: https://kubernetes.io/docs/concepts/nodes/node/#addresses", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.NodeAddress"), - }, - }, - }, - }, - }, - "daemonEndpoints": { - SchemaProps: spec.SchemaProps{ - Description: "Endpoints of daemons running on the Node.", - Ref: ref("k8s.io/api/core/v1.NodeDaemonEndpoints"), - }, - }, - "nodeInfo": { - SchemaProps: spec.SchemaProps{ - Description: "Set of ids/uuids to uniquely identify the node. More info: https://kubernetes.io/docs/concepts/nodes/node/#info", - Ref: ref("k8s.io/api/core/v1.NodeSystemInfo"), - }, - }, - "images": { - SchemaProps: spec.SchemaProps{ - Description: "List of container images on this node", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ContainerImage"), - }, - }, - }, - }, - }, - "volumesInUse": { - SchemaProps: spec.SchemaProps{ - Description: "List of attachable volumes in use (mounted) by the node.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "volumesAttached": { - SchemaProps: spec.SchemaProps{ - Description: "List of volumes that are attached to the node.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.AttachedVolume"), - }, - }, - }, - }, - }, - "config": { - SchemaProps: spec.SchemaProps{ - Description: "Status of the config assigned to the node via the dynamic Kubelet config feature.", - Ref: ref("k8s.io/api/core/v1.NodeConfigStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.AttachedVolume", "k8s.io/api/core/v1.ContainerImage", "k8s.io/api/core/v1.NodeAddress", "k8s.io/api/core/v1.NodeCondition", "k8s.io/api/core/v1.NodeConfigStatus", "k8s.io/api/core/v1.NodeDaemonEndpoints", "k8s.io/api/core/v1.NodeSystemInfo", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, - } -} - -func schema_k8sio_api_core_v1_NodeSystemInfo(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NodeSystemInfo is a set of ids/uuids to uniquely identify the node.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "machineID": { - SchemaProps: spec.SchemaProps{ - Description: "MachineID reported by the node. For unique machine identification in the cluster this field is preferred. Learn more from man(5) machine-id: http://man7.org/linux/man-pages/man5/machine-id.5.html", - Type: []string{"string"}, - Format: "", - }, - }, - "systemUUID": { - SchemaProps: spec.SchemaProps{ - Description: "SystemUUID reported by the node. For unique machine identification MachineID is preferred. This field is specific to Red Hat hosts https://access.redhat.com/documentation/en-US/Red_Hat_Subscription_Management/1/html/RHSM/getting-system-uuid.html", - Type: []string{"string"}, - Format: "", - }, - }, - "bootID": { - SchemaProps: spec.SchemaProps{ - Description: "Boot ID reported by the node.", - Type: []string{"string"}, - Format: "", - }, - }, - "kernelVersion": { - SchemaProps: spec.SchemaProps{ - Description: "Kernel Version reported by the node from 'uname -r' (e.g. 3.16.0-0.bpo.4-amd64).", - Type: []string{"string"}, - Format: "", - }, - }, - "osImage": { - SchemaProps: spec.SchemaProps{ - Description: "OS Image reported by the node from /etc/os-release (e.g. Debian GNU/Linux 7 (wheezy)).", - Type: []string{"string"}, - Format: "", - }, - }, - "containerRuntimeVersion": { - SchemaProps: spec.SchemaProps{ - Description: "ContainerRuntime Version reported by the node through runtime remote API (e.g. docker://1.5.0).", - Type: []string{"string"}, - Format: "", - }, - }, - "kubeletVersion": { - SchemaProps: spec.SchemaProps{ - Description: "Kubelet Version reported by the node.", - Type: []string{"string"}, - Format: "", - }, - }, - "kubeProxyVersion": { - SchemaProps: spec.SchemaProps{ - Description: "KubeProxy Version reported by the node.", - Type: []string{"string"}, - Format: "", - }, - }, - "operatingSystem": { - SchemaProps: spec.SchemaProps{ - Description: "The Operating System reported by the node", - Type: []string{"string"}, - Format: "", - }, - }, - "architecture": { - SchemaProps: spec.SchemaProps{ - Description: "The Architecture reported by the node", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"machineID", "systemUUID", "bootID", "kernelVersion", "osImage", "containerRuntimeVersion", "kubeletVersion", "kubeProxyVersion", "operatingSystem", "architecture"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_ObjectFieldSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ObjectFieldSelector selects an APIVersioned field of an object.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "Version of the schema the FieldPath is written in terms of, defaults to \"v1\".", - Type: []string{"string"}, - Format: "", - }, - }, - "fieldPath": { - SchemaProps: spec.SchemaProps{ - Description: "Path of the field to select in the specified API version.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"fieldPath"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_ObjectReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ObjectReference contains enough information to let you inspect or modify the referred object.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Description: "Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - Type: []string{"string"}, - Format: "", - }, - }, - "uid": { - SchemaProps: spec.SchemaProps{ - Description: "UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "API version of the referent.", - Type: []string{"string"}, - Format: "", - }, - }, - "resourceVersion": { - SchemaProps: spec.SchemaProps{ - Description: "Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency", - Type: []string{"string"}, - Format: "", - }, - }, - "fieldPath": { - SchemaProps: spec.SchemaProps{ - Description: "If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: \"spec.containers{name}\" (where \"name\" refers to the name of the container that triggered the event) or if no container name is specified \"spec.containers[2]\" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_api_core_v1_PersistentVolume(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolume (PV) is a storage resource provisioned by an administrator. It is analogous to a node. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines a specification of a persistent volume owned by the cluster. Provisioned by an administrator. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistent-volumes", - Ref: ref("k8s.io/api/core/v1.PersistentVolumeSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status represents the current information/status for the persistent volume. Populated by the system. Read-only. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistent-volumes", - Ref: ref("k8s.io/api/core/v1.PersistentVolumeStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolumeSpec", "k8s.io/api/core/v1.PersistentVolumeStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_PersistentVolumeClaim(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeClaim is a user's request for and claim to a persistent volume", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the desired characteristics of a volume requested by a pod author. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims", - Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaimSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status represents the current information/status of a persistent volume claim. Read-only. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims", - Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaimStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "k8s.io/api/core/v1.PersistentVolumeClaimStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_PersistentVolumeClaimCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeClaimCondition contails details about state of pvc", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "lastProbeTime": { - SchemaProps: spec.SchemaProps{ - Description: "Last time we probed the condition.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "lastTransitionTime": { - SchemaProps: spec.SchemaProps{ - Description: "Last time the condition transitioned from one status to another.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "Unique, this should be a short, machine understandable string that gives the reason for condition's last transition. If it reports \"ResizeStarted\" that means the underlying persistent volume is being resized.", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "Human-readable message indicating details about last transition.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type", "status"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_k8sio_api_core_v1_PersistentVolumeClaimList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeClaimList is a list of PersistentVolumeClaim items.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "A list of persistent volume claims. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaim"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolumeClaim", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_PersistentVolumeClaimSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeClaimSpec describes the common attributes of storage devices and allows a Source for provider-specific attributes", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "accessModes": { - SchemaProps: spec.SchemaProps{ - Description: "AccessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "selector": { - SchemaProps: spec.SchemaProps{ - Description: "A label query over volumes to consider for binding.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"), - }, - }, - "resources": { - SchemaProps: spec.SchemaProps{ - Description: "Resources represents the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources", - Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), - }, - }, - "volumeName": { - SchemaProps: spec.SchemaProps{ - Description: "VolumeName is the binding reference to the PersistentVolume backing this claim.", - Type: []string{"string"}, - Format: "", - }, - }, - "storageClassName": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1", - Type: []string{"string"}, - Format: "", - }, - }, - "volumeMode": { - SchemaProps: spec.SchemaProps{ - Description: "volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. This is a beta feature.", - Type: []string{"string"}, - Format: "", - }, - }, - "dataSource": { - SchemaProps: spec.SchemaProps{ - Description: "This field requires the VolumeSnapshotDataSource alpha feature gate to be enabled and currently VolumeSnapshot is the only supported data source. If the provisioner can support VolumeSnapshot data source, it will create a new volume and data will be restored to the volume at the same time. If the provisioner does not support VolumeSnapshot data source, volume will not be created and the failure will be reported as an event. In the future, we plan to support more data source types and the behavior of the provisioner may change.", - Ref: ref("k8s.io/api/core/v1.TypedLocalObjectReference"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.TypedLocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"}, - } -} - -func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeClaimStatus is the current status of a persistent volume claim.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "phase": { - SchemaProps: spec.SchemaProps{ - Description: "Phase represents the current phase of PersistentVolumeClaim.", - Type: []string{"string"}, - Format: "", - }, - }, - "accessModes": { - SchemaProps: spec.SchemaProps{ - Description: "AccessModes contains the actual access modes the volume backing the PVC has. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "capacity": { - SchemaProps: spec.SchemaProps{ - Description: "Represents the actual resources of the underlying volume.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - "conditions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "type", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Current Condition of persistent volume claim. If underlying persistent volume is being resized then the Condition will be set to 'ResizeStarted'.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaimCondition"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolumeClaimCondition", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, - } -} - -func schema_k8sio_api_core_v1_PersistentVolumeClaimVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. This volume finds the bound PV and mounts that volume for the pod. A PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another type of volume that is owned by someone else (the system).", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "claimName": { - SchemaProps: spec.SchemaProps{ - Description: "ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Will force the ReadOnly setting in VolumeMounts. Default false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"claimName"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_PersistentVolumeList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeList is a list of PersistentVolume items.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of persistent volumes. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.PersistentVolume"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolume", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_PersistentVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeSource is similar to VolumeSource but meant for the administrator who creates PVs. Exactly one of its members must be set.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "gcePersistentDisk": { - SchemaProps: spec.SchemaProps{ - Description: "GCEPersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", - Ref: ref("k8s.io/api/core/v1.GCEPersistentDiskVolumeSource"), - }, - }, - "awsElasticBlockStore": { - SchemaProps: spec.SchemaProps{ - Description: "AWSElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", - Ref: ref("k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource"), - }, - }, - "hostPath": { - SchemaProps: spec.SchemaProps{ - Description: "HostPath represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath", - Ref: ref("k8s.io/api/core/v1.HostPathVolumeSource"), - }, - }, - "glusterfs": { - SchemaProps: spec.SchemaProps{ - Description: "Glusterfs represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md", - Ref: ref("k8s.io/api/core/v1.GlusterfsPersistentVolumeSource"), - }, - }, - "nfs": { - SchemaProps: spec.SchemaProps{ - Description: "NFS represents an NFS mount on the host. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", - Ref: ref("k8s.io/api/core/v1.NFSVolumeSource"), - }, - }, - "rbd": { - SchemaProps: spec.SchemaProps{ - Description: "RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md", - Ref: ref("k8s.io/api/core/v1.RBDPersistentVolumeSource"), - }, - }, - "iscsi": { - SchemaProps: spec.SchemaProps{ - Description: "ISCSI represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin.", - Ref: ref("k8s.io/api/core/v1.ISCSIPersistentVolumeSource"), - }, - }, - "cinder": { - SchemaProps: spec.SchemaProps{ - Description: "Cinder represents a cinder volume attached and mounted on kubelets host machine More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md", - Ref: ref("k8s.io/api/core/v1.CinderPersistentVolumeSource"), - }, - }, - "cephfs": { - SchemaProps: spec.SchemaProps{ - Description: "CephFS represents a Ceph FS mount on the host that shares a pod's lifetime", - Ref: ref("k8s.io/api/core/v1.CephFSPersistentVolumeSource"), - }, - }, - "fc": { - SchemaProps: spec.SchemaProps{ - Description: "FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.", - Ref: ref("k8s.io/api/core/v1.FCVolumeSource"), - }, - }, - "flocker": { - SchemaProps: spec.SchemaProps{ - Description: "Flocker represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running", - Ref: ref("k8s.io/api/core/v1.FlockerVolumeSource"), - }, - }, - "flexVolume": { - SchemaProps: spec.SchemaProps{ - Description: "FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.", - Ref: ref("k8s.io/api/core/v1.FlexPersistentVolumeSource"), - }, - }, - "azureFile": { - SchemaProps: spec.SchemaProps{ - Description: "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.", - Ref: ref("k8s.io/api/core/v1.AzureFilePersistentVolumeSource"), - }, - }, - "vsphereVolume": { - SchemaProps: spec.SchemaProps{ - Description: "VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine", - Ref: ref("k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource"), - }, - }, - "quobyte": { - SchemaProps: spec.SchemaProps{ - Description: "Quobyte represents a Quobyte mount on the host that shares a pod's lifetime", - Ref: ref("k8s.io/api/core/v1.QuobyteVolumeSource"), - }, - }, - "azureDisk": { - SchemaProps: spec.SchemaProps{ - Description: "AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.", - Ref: ref("k8s.io/api/core/v1.AzureDiskVolumeSource"), - }, - }, - "photonPersistentDisk": { - SchemaProps: spec.SchemaProps{ - Description: "PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine", - Ref: ref("k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource"), - }, - }, - "portworxVolume": { - SchemaProps: spec.SchemaProps{ - Description: "PortworxVolume represents a portworx volume attached and mounted on kubelets host machine", - Ref: ref("k8s.io/api/core/v1.PortworxVolumeSource"), - }, - }, - "scaleIO": { - SchemaProps: spec.SchemaProps{ - Description: "ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.", - Ref: ref("k8s.io/api/core/v1.ScaleIOPersistentVolumeSource"), - }, - }, - "local": { - SchemaProps: spec.SchemaProps{ - Description: "Local represents directly-attached storage with node affinity", - Ref: ref("k8s.io/api/core/v1.LocalVolumeSource"), - }, - }, - "storageos": { - SchemaProps: spec.SchemaProps{ - Description: "StorageOS represents a StorageOS volume that is attached to the kubelet's host machine and mounted into the pod More info: https://releases.k8s.io/HEAD/examples/volumes/storageos/README.md", - Ref: ref("k8s.io/api/core/v1.StorageOSPersistentVolumeSource"), - }, - }, - "csi": { - SchemaProps: spec.SchemaProps{ - Description: "CSI represents storage that is handled by an external CSI driver (Beta feature).", - Ref: ref("k8s.io/api/core/v1.CSIPersistentVolumeSource"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource", "k8s.io/api/core/v1.AzureDiskVolumeSource", "k8s.io/api/core/v1.AzureFilePersistentVolumeSource", "k8s.io/api/core/v1.CSIPersistentVolumeSource", "k8s.io/api/core/v1.CephFSPersistentVolumeSource", "k8s.io/api/core/v1.CinderPersistentVolumeSource", "k8s.io/api/core/v1.FCVolumeSource", "k8s.io/api/core/v1.FlexPersistentVolumeSource", "k8s.io/api/core/v1.FlockerVolumeSource", "k8s.io/api/core/v1.GCEPersistentDiskVolumeSource", "k8s.io/api/core/v1.GlusterfsPersistentVolumeSource", "k8s.io/api/core/v1.HostPathVolumeSource", "k8s.io/api/core/v1.ISCSIPersistentVolumeSource", "k8s.io/api/core/v1.LocalVolumeSource", "k8s.io/api/core/v1.NFSVolumeSource", "k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource", "k8s.io/api/core/v1.PortworxVolumeSource", "k8s.io/api/core/v1.QuobyteVolumeSource", "k8s.io/api/core/v1.RBDPersistentVolumeSource", "k8s.io/api/core/v1.ScaleIOPersistentVolumeSource", "k8s.io/api/core/v1.StorageOSPersistentVolumeSource", "k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource"}, - } -} - -func schema_k8sio_api_core_v1_PersistentVolumeSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeSpec is the specification of a persistent volume.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "capacity": { - SchemaProps: spec.SchemaProps{ - Description: "A description of the persistent volume's resources and capacity. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - "gcePersistentDisk": { - SchemaProps: spec.SchemaProps{ - Description: "GCEPersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", - Ref: ref("k8s.io/api/core/v1.GCEPersistentDiskVolumeSource"), - }, - }, - "awsElasticBlockStore": { - SchemaProps: spec.SchemaProps{ - Description: "AWSElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", - Ref: ref("k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource"), - }, - }, - "hostPath": { - SchemaProps: spec.SchemaProps{ - Description: "HostPath represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath", - Ref: ref("k8s.io/api/core/v1.HostPathVolumeSource"), - }, - }, - "glusterfs": { - SchemaProps: spec.SchemaProps{ - Description: "Glusterfs represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md", - Ref: ref("k8s.io/api/core/v1.GlusterfsPersistentVolumeSource"), - }, - }, - "nfs": { - SchemaProps: spec.SchemaProps{ - Description: "NFS represents an NFS mount on the host. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", - Ref: ref("k8s.io/api/core/v1.NFSVolumeSource"), - }, - }, - "rbd": { - SchemaProps: spec.SchemaProps{ - Description: "RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md", - Ref: ref("k8s.io/api/core/v1.RBDPersistentVolumeSource"), - }, - }, - "iscsi": { - SchemaProps: spec.SchemaProps{ - Description: "ISCSI represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin.", - Ref: ref("k8s.io/api/core/v1.ISCSIPersistentVolumeSource"), - }, - }, - "cinder": { - SchemaProps: spec.SchemaProps{ - Description: "Cinder represents a cinder volume attached and mounted on kubelets host machine More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md", - Ref: ref("k8s.io/api/core/v1.CinderPersistentVolumeSource"), - }, - }, - "cephfs": { - SchemaProps: spec.SchemaProps{ - Description: "CephFS represents a Ceph FS mount on the host that shares a pod's lifetime", - Ref: ref("k8s.io/api/core/v1.CephFSPersistentVolumeSource"), - }, - }, - "fc": { - SchemaProps: spec.SchemaProps{ - Description: "FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.", - Ref: ref("k8s.io/api/core/v1.FCVolumeSource"), - }, - }, - "flocker": { - SchemaProps: spec.SchemaProps{ - Description: "Flocker represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running", - Ref: ref("k8s.io/api/core/v1.FlockerVolumeSource"), - }, - }, - "flexVolume": { - SchemaProps: spec.SchemaProps{ - Description: "FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.", - Ref: ref("k8s.io/api/core/v1.FlexPersistentVolumeSource"), - }, - }, - "azureFile": { - SchemaProps: spec.SchemaProps{ - Description: "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.", - Ref: ref("k8s.io/api/core/v1.AzureFilePersistentVolumeSource"), - }, - }, - "vsphereVolume": { - SchemaProps: spec.SchemaProps{ - Description: "VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine", - Ref: ref("k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource"), - }, - }, - "quobyte": { - SchemaProps: spec.SchemaProps{ - Description: "Quobyte represents a Quobyte mount on the host that shares a pod's lifetime", - Ref: ref("k8s.io/api/core/v1.QuobyteVolumeSource"), - }, - }, - "azureDisk": { - SchemaProps: spec.SchemaProps{ - Description: "AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.", - Ref: ref("k8s.io/api/core/v1.AzureDiskVolumeSource"), - }, - }, - "photonPersistentDisk": { - SchemaProps: spec.SchemaProps{ - Description: "PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine", - Ref: ref("k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource"), - }, - }, - "portworxVolume": { - SchemaProps: spec.SchemaProps{ - Description: "PortworxVolume represents a portworx volume attached and mounted on kubelets host machine", - Ref: ref("k8s.io/api/core/v1.PortworxVolumeSource"), - }, - }, - "scaleIO": { - SchemaProps: spec.SchemaProps{ - Description: "ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.", - Ref: ref("k8s.io/api/core/v1.ScaleIOPersistentVolumeSource"), - }, - }, - "local": { - SchemaProps: spec.SchemaProps{ - Description: "Local represents directly-attached storage with node affinity", - Ref: ref("k8s.io/api/core/v1.LocalVolumeSource"), - }, - }, - "storageos": { - SchemaProps: spec.SchemaProps{ - Description: "StorageOS represents a StorageOS volume that is attached to the kubelet's host machine and mounted into the pod More info: https://releases.k8s.io/HEAD/examples/volumes/storageos/README.md", - Ref: ref("k8s.io/api/core/v1.StorageOSPersistentVolumeSource"), - }, - }, - "csi": { - SchemaProps: spec.SchemaProps{ - Description: "CSI represents storage that is handled by an external CSI driver (Beta feature).", - Ref: ref("k8s.io/api/core/v1.CSIPersistentVolumeSource"), - }, - }, - "accessModes": { - SchemaProps: spec.SchemaProps{ - Description: "AccessModes contains all ways the volume can be mounted. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "claimRef": { - SchemaProps: spec.SchemaProps{ - Description: "ClaimRef is part of a bi-directional binding between PersistentVolume and PersistentVolumeClaim. Expected to be non-nil when bound. claim.VolumeName is the authoritative bind between PV and PVC. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#binding", - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, - "persistentVolumeReclaimPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "What happens to a persistent volume when released from its claim. Valid options are Retain (default for manually created PersistentVolumes), Delete (default for dynamically provisioned PersistentVolumes), and Recycle (deprecated). Recycle must be supported by the volume plugin underlying this PersistentVolume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming", - Type: []string{"string"}, - Format: "", - }, - }, - "storageClassName": { - SchemaProps: spec.SchemaProps{ - Description: "Name of StorageClass to which this persistent volume belongs. Empty value means that this volume does not belong to any StorageClass.", - Type: []string{"string"}, - Format: "", - }, - }, - "mountOptions": { - SchemaProps: spec.SchemaProps{ - Description: "A list of mount options, e.g. [\"ro\", \"soft\"]. Not validated - mount will simply fail if one is invalid. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#mount-options", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "volumeMode": { - SchemaProps: spec.SchemaProps{ - Description: "volumeMode defines if a volume is intended to be used with a formatted filesystem or to remain in raw block state. Value of Filesystem is implied when not included in spec. This is a beta feature.", - Type: []string{"string"}, - Format: "", - }, - }, - "nodeAffinity": { - SchemaProps: spec.SchemaProps{ - Description: "NodeAffinity defines constraints that limit what nodes this volume can be accessed from. This field influences the scheduling of pods that use this volume.", - Ref: ref("k8s.io/api/core/v1.VolumeNodeAffinity"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource", "k8s.io/api/core/v1.AzureDiskVolumeSource", "k8s.io/api/core/v1.AzureFilePersistentVolumeSource", "k8s.io/api/core/v1.CSIPersistentVolumeSource", "k8s.io/api/core/v1.CephFSPersistentVolumeSource", "k8s.io/api/core/v1.CinderPersistentVolumeSource", "k8s.io/api/core/v1.FCVolumeSource", "k8s.io/api/core/v1.FlexPersistentVolumeSource", "k8s.io/api/core/v1.FlockerVolumeSource", "k8s.io/api/core/v1.GCEPersistentDiskVolumeSource", "k8s.io/api/core/v1.GlusterfsPersistentVolumeSource", "k8s.io/api/core/v1.HostPathVolumeSource", "k8s.io/api/core/v1.ISCSIPersistentVolumeSource", "k8s.io/api/core/v1.LocalVolumeSource", "k8s.io/api/core/v1.NFSVolumeSource", "k8s.io/api/core/v1.ObjectReference", "k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource", "k8s.io/api/core/v1.PortworxVolumeSource", "k8s.io/api/core/v1.QuobyteVolumeSource", "k8s.io/api/core/v1.RBDPersistentVolumeSource", "k8s.io/api/core/v1.ScaleIOPersistentVolumeSource", "k8s.io/api/core/v1.StorageOSPersistentVolumeSource", "k8s.io/api/core/v1.VolumeNodeAffinity", "k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, - } -} - -func schema_k8sio_api_core_v1_PersistentVolumeStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeStatus is the current status of a persistent volume.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "phase": { - SchemaProps: spec.SchemaProps{ - Description: "Phase indicates if a volume is available, bound to a claim, or released by a claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#phase", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "A human-readable message indicating details about why the volume is in this state.", - Type: []string{"string"}, - Format: "", - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "Reason is a brief CamelCase string that describes any failure and is meant for machine parsing and tidy display in the CLI.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_api_core_v1_PhotonPersistentDiskVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a Photon Controller persistent disk resource.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "pdID": { - SchemaProps: spec.SchemaProps{ - Description: "ID that identifies Photon Controller persistent disk", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"pdID"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_Pod(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Pod is a collection of containers that can run on a host. This resource is created by clients and scheduled onto hosts.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.PodSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Most recently observed status of the pod. This data may not be up to date. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.PodStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PodSpec", "k8s.io/api/core/v1.PodStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_PodAffinity(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Pod affinity is a group of inter pod affinity scheduling rules.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "requiredDuringSchedulingIgnoredDuringExecution": { - SchemaProps: spec.SchemaProps{ - Description: "If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.PodAffinityTerm"), - }, - }, - }, - }, - }, - "preferredDuringSchedulingIgnoredDuringExecution": { - SchemaProps: spec.SchemaProps{ - Description: "The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.WeightedPodAffinityTerm"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PodAffinityTerm", "k8s.io/api/core/v1.WeightedPodAffinityTerm"}, - } -} - -func schema_k8sio_api_core_v1_PodAffinityTerm(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "labelSelector": { - SchemaProps: spec.SchemaProps{ - Description: "A label query over a set of resources, in this case pods.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"), - }, - }, - "namespaces": { - SchemaProps: spec.SchemaProps{ - Description: "namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means \"this pod's namespace\"", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "topologyKey": { - SchemaProps: spec.SchemaProps{ - Description: "This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"topologyKey"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"}, - } -} - -func schema_k8sio_api_core_v1_PodAntiAffinity(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Pod anti affinity is a group of inter pod anti affinity scheduling rules.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "requiredDuringSchedulingIgnoredDuringExecution": { - SchemaProps: spec.SchemaProps{ - Description: "If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.PodAffinityTerm"), - }, - }, - }, - }, - }, - "preferredDuringSchedulingIgnoredDuringExecution": { - SchemaProps: spec.SchemaProps{ - Description: "The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.WeightedPodAffinityTerm"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PodAffinityTerm", "k8s.io/api/core/v1.WeightedPodAffinityTerm"}, - } -} - -func schema_k8sio_api_core_v1_PodAttachOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodAttachOptions is the query options to a Pod's remote attach call.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "stdin": { - SchemaProps: spec.SchemaProps{ - Description: "Stdin if true, redirects the standard input stream of the pod for this call. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "stdout": { - SchemaProps: spec.SchemaProps{ - Description: "Stdout if true indicates that stdout is to be redirected for the attach call. Defaults to true.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "stderr": { - SchemaProps: spec.SchemaProps{ - Description: "Stderr if true indicates that stderr is to be redirected for the attach call. Defaults to true.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "tty": { - SchemaProps: spec.SchemaProps{ - Description: "TTY if true indicates that a tty will be allocated for the attach call. This is passed through the container runtime so the tty is allocated on the worker node by the container runtime. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "container": { - SchemaProps: spec.SchemaProps{ - Description: "The container in which to execute the command. Defaults to only container if there is only one container in the pod.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_api_core_v1_PodCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodCondition contains details for the current condition of this pod.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type is the type of the condition. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions", - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status is the status of the condition. Can be True, False, Unknown. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions", - Type: []string{"string"}, - Format: "", - }, - }, - "lastProbeTime": { - SchemaProps: spec.SchemaProps{ - Description: "Last time we probed the condition.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "lastTransitionTime": { - SchemaProps: spec.SchemaProps{ - Description: "Last time the condition transitioned from one status to another.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "Unique, one-word, CamelCase reason for the condition's last transition.", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "Human-readable message indicating details about last transition.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type", "status"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_k8sio_api_core_v1_PodDNSConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "nameservers": { - SchemaProps: spec.SchemaProps{ - Description: "A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "searches": { - SchemaProps: spec.SchemaProps{ - Description: "A list of DNS search domains for host-name lookup. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "options": { - SchemaProps: spec.SchemaProps{ - Description: "A list of DNS resolver options. This will be merged with the base options generated from DNSPolicy. Duplicated entries will be removed. Resolution options given in Options will override those that appear in the base DNSPolicy.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.PodDNSConfigOption"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PodDNSConfigOption"}, - } -} - -func schema_k8sio_api_core_v1_PodDNSConfigOption(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodDNSConfigOption defines DNS resolver options of a pod.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Required.", - Type: []string{"string"}, - Format: "", - }, - }, - "value": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_api_core_v1_PodExecOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodExecOptions is the query options to a Pod's remote exec call.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "stdin": { - SchemaProps: spec.SchemaProps{ - Description: "Redirect the standard input stream of the pod for this call. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "stdout": { - SchemaProps: spec.SchemaProps{ - Description: "Redirect the standard output stream of the pod for this call. Defaults to true.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "stderr": { - SchemaProps: spec.SchemaProps{ - Description: "Redirect the standard error stream of the pod for this call. Defaults to true.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "tty": { - SchemaProps: spec.SchemaProps{ - Description: "TTY if true indicates that a tty will be allocated for the exec call. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "container": { - SchemaProps: spec.SchemaProps{ - Description: "Container in which to execute the command. Defaults to only container if there is only one container in the pod.", - Type: []string{"string"}, - Format: "", - }, - }, - "command": { - SchemaProps: spec.SchemaProps{ - Description: "Command is the remote command to execute. argv array. Not executed within a shell.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"command"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_PodList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodList is a list of Pods.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of pods. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Pod"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.Pod", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_PodLogOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodLogOptions is the query options for a Pod's logs REST call.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "container": { - SchemaProps: spec.SchemaProps{ - Description: "The container for which to stream logs. Defaults to only container if there is one container in the pod.", - Type: []string{"string"}, - Format: "", - }, - }, - "follow": { - SchemaProps: spec.SchemaProps{ - Description: "Follow the log stream of the pod. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "previous": { - SchemaProps: spec.SchemaProps{ - Description: "Return previous terminated container logs. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "sinceSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "A relative time in seconds before the current time from which to show logs. If this value precedes the time a pod was started, only logs since the pod start will be returned. If this value is in the future, no logs will be returned. Only one of sinceSeconds or sinceTime may be specified.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "sinceTime": { - SchemaProps: spec.SchemaProps{ - Description: "An RFC3339 timestamp from which to show logs. If this value precedes the time a pod was started, only logs since the pod start will be returned. If this value is in the future, no logs will be returned. Only one of sinceSeconds or sinceTime may be specified.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "timestamps": { - SchemaProps: spec.SchemaProps{ - Description: "If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line of log output. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "tailLines": { - SchemaProps: spec.SchemaProps{ - Description: "If set, the number of lines from the end of the logs to show. If not specified, logs are shown from the creation of the container or sinceSeconds or sinceTime", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "limitBytes": { - SchemaProps: spec.SchemaProps{ - Description: "If set, the number of bytes to read from the server before terminating the log output. This may not display a complete final line of logging, and may return slightly more or slightly less than the specified limit.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_k8sio_api_core_v1_PodPortForwardOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodPortForwardOptions is the query options to a Pod's port forward call when using WebSockets. The `port` query parameter must specify the port or ports (comma separated) to forward over. Port forwarding over SPDY does not use these options. It requires the port to be passed in the `port` header as part of request.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "ports": { - SchemaProps: spec.SchemaProps{ - Description: "List of ports to forward Required when using WebSockets", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_api_core_v1_PodProxyOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodProxyOptions is the query options to a Pod's proxy call.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Path is the URL path to use for the current proxy request to pod.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_api_core_v1_PodReadinessGate(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodReadinessGate contains the reference to a pod condition", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "conditionType": { - SchemaProps: spec.SchemaProps{ - Description: "ConditionType refers to a condition in the pod's condition list with matching type.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"conditionType"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_PodSecurityContext(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "seLinuxOptions": { - SchemaProps: spec.SchemaProps{ - Description: "The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.", - Ref: ref("k8s.io/api/core/v1.SELinuxOptions"), - }, - }, - "windowsOptions": { - SchemaProps: spec.SchemaProps{ - Description: "Windows security options.", - Ref: ref("k8s.io/api/core/v1.WindowsSecurityContextOptions"), - }, - }, - "runAsUser": { - SchemaProps: spec.SchemaProps{ - Description: "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "runAsGroup": { - SchemaProps: spec.SchemaProps{ - Description: "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "runAsNonRoot": { - SchemaProps: spec.SchemaProps{ - Description: "Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "supplementalGroups": { - SchemaProps: spec.SchemaProps{ - Description: "A list of groups applied to the first process run in each container, in addition to the container's primary GID. If unspecified, no groups will be added to any container.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"integer"}, - Format: "int64", - }, - }, - }, - }, - }, - "fsGroup": { - SchemaProps: spec.SchemaProps{ - Description: "A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:\n\n1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw----\n\nIf unset, the Kubelet will not modify the ownership and permissions of any volume.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "sysctls": { - SchemaProps: spec.SchemaProps{ - Description: "Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Sysctl"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.SELinuxOptions", "k8s.io/api/core/v1.Sysctl", "k8s.io/api/core/v1.WindowsSecurityContextOptions"}, - } -} - -func schema_k8sio_api_core_v1_PodSignature(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Describes the class of pods that should avoid this node. Exactly one field should be set.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "podController": { - SchemaProps: spec.SchemaProps{ - Description: "Reference to controller whose pods should avoid this node.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference"}, - } -} - -func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodSpec is a description of a pod.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "volumes": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge,retainKeys", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Volume"), - }, - }, - }, - }, - }, - "initContainers": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, or Liveness probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Container"), - }, - }, - }, - }, - }, - "containers": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Container"), - }, - }, - }, - }, - }, - "restartPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy", - Type: []string{"string"}, - Format: "", - }, - }, - "terminationGracePeriodSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "activeDeadlineSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "dnsPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "Set DNS policy for the pod. Defaults to \"ClusterFirst\". Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.", - Type: []string{"string"}, - Format: "", - }, - }, - "nodeSelector": { - SchemaProps: spec.SchemaProps{ - Description: "NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "serviceAccountName": { - SchemaProps: spec.SchemaProps{ - Description: "ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/", - Type: []string{"string"}, - Format: "", - }, - }, - "serviceAccount": { - SchemaProps: spec.SchemaProps{ - Description: "DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.", - Type: []string{"string"}, - Format: "", - }, - }, - "automountServiceAccountToken": { - SchemaProps: spec.SchemaProps{ - Description: "AutomountServiceAccountToken indicates whether a service account token should be automatically mounted.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "nodeName": { - SchemaProps: spec.SchemaProps{ - Description: "NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements.", - Type: []string{"string"}, - Format: "", - }, - }, - "hostNetwork": { - SchemaProps: spec.SchemaProps{ - Description: "Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "hostPID": { - SchemaProps: spec.SchemaProps{ - Description: "Use the host's pid namespace. Optional: Default to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "hostIPC": { - SchemaProps: spec.SchemaProps{ - Description: "Use the host's ipc namespace. Optional: Default to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "shareProcessNamespace": { - SchemaProps: spec.SchemaProps{ - Description: "Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false. This field is beta-level and may be disabled with the PodShareProcessNamespace feature.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "securityContext": { - SchemaProps: spec.SchemaProps{ - Description: "SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.", - Ref: ref("k8s.io/api/core/v1.PodSecurityContext"), - }, - }, - "imagePullSecrets": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - }, - }, - }, - "hostname": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.", - Type: []string{"string"}, - Format: "", - }, - }, - "subdomain": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, the fully qualified Pod hostname will be \"...svc.\". If not specified, the pod will not have a domainname at all.", - Type: []string{"string"}, - Format: "", - }, - }, - "affinity": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, the pod's scheduling constraints", - Ref: ref("k8s.io/api/core/v1.Affinity"), - }, - }, - "schedulerName": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler.", - Type: []string{"string"}, - Format: "", - }, - }, - "tolerations": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, the pod's tolerations.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Toleration"), - }, - }, - }, - }, - }, - "hostAliases": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "ip", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.HostAlias"), - }, - }, - }, - }, - }, - "priorityClassName": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, indicates the pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.", - Type: []string{"string"}, - Format: "", - }, - }, - "priority": { - SchemaProps: spec.SchemaProps{ - Description: "The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "dnsConfig": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy.", - Ref: ref("k8s.io/api/core/v1.PodDNSConfig"), - }, - }, - "readinessGates": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness gates have status equal to \"True\" More info: https://git.k8s.io/enhancements/keps/sig-network/0007-pod-ready%2B%2B.md", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.PodReadinessGate"), - }, - }, - }, - }, - }, - "runtimeClassName": { - SchemaProps: spec.SchemaProps{ - Description: "RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the \"legacy\" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md This is a beta feature as of Kubernetes v1.14.", - Type: []string{"string"}, - Format: "", - }, - }, - "enableServiceLinks": { - SchemaProps: spec.SchemaProps{ - Description: "EnableServiceLinks indicates whether information about services should be injected into pod's environment variables, matching the syntax of Docker links. Optional: Defaults to true.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "preemptionPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. This field is alpha-level and is only honored by servers that enable the NonPreemptingPriority feature.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"containers"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.Affinity", "k8s.io/api/core/v1.Container", "k8s.io/api/core/v1.HostAlias", "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PodDNSConfig", "k8s.io/api/core/v1.PodReadinessGate", "k8s.io/api/core/v1.PodSecurityContext", "k8s.io/api/core/v1.Toleration", "k8s.io/api/core/v1.Volume"}, - } -} - -func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodStatus represents information about the status of a pod. Status may trail the actual state of a system, especially if the node that hosts the pod cannot contact the control plane.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "phase": { - SchemaProps: spec.SchemaProps{ - Description: "The phase of a Pod is a simple, high-level summary of where the Pod is in its lifecycle. The conditions array, the reason and message fields, and the individual container status arrays contain more detail about the pod's status. There are five possible phase values:\n\nPending: The pod has been accepted by the Kubernetes system, but one or more of the container images has not been created. This includes time before being scheduled as well as time spent downloading images over the network, which could take a while. Running: The pod has been bound to a node, and all of the containers have been created. At least one container is still running, or is in the process of starting or restarting. Succeeded: All containers in the pod have terminated in success, and will not be restarted. Failed: All containers in the pod have terminated, and at least one container has terminated in failure. The container either exited with non-zero status or was terminated by the system. Unknown: For some reason the state of the pod could not be obtained, typically due to an error in communicating with the host of the pod.\n\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-phase", - Type: []string{"string"}, - Format: "", - }, - }, - "conditions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "type", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Current service state of pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.PodCondition"), - }, - }, - }, - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "A human readable message indicating details about why the pod is in this condition.", - Type: []string{"string"}, - Format: "", - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "A brief CamelCase message indicating details about why the pod is in this state. e.g. 'Evicted'", - Type: []string{"string"}, - Format: "", - }, - }, - "nominatedNodeName": { - SchemaProps: spec.SchemaProps{ - Description: "nominatedNodeName is set only when this pod preempts other pods on the node, but it cannot be scheduled right away as preemption victims receive their graceful termination periods. This field does not guarantee that the pod will be scheduled on this node. Scheduler may decide to place the pod elsewhere if other nodes become available sooner. Scheduler may also decide to give the resources on this node to a higher priority pod that is created after preemption. As a result, this field may be different than PodSpec.nodeName when the pod is scheduled.", - Type: []string{"string"}, - Format: "", - }, - }, - "hostIP": { - SchemaProps: spec.SchemaProps{ - Description: "IP address of the host to which the pod is assigned. Empty if not yet scheduled.", - Type: []string{"string"}, - Format: "", - }, - }, - "podIP": { - SchemaProps: spec.SchemaProps{ - Description: "IP address allocated to the pod. Routable at least within the cluster. Empty if not yet allocated.", - Type: []string{"string"}, - Format: "", - }, - }, - "startTime": { - SchemaProps: spec.SchemaProps{ - Description: "RFC 3339 date and time at which the object was acknowledged by the Kubelet. This is before the Kubelet pulled the container image(s) for the pod.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "initContainerStatuses": { - SchemaProps: spec.SchemaProps{ - Description: "The list has one entry per init container in the manifest. The most recent successful init container will have ready = true, the most recently started container will have startTime set. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ContainerStatus"), - }, - }, - }, - }, - }, - "containerStatuses": { - SchemaProps: spec.SchemaProps{ - Description: "The list has one entry per container in the manifest. Each entry is currently the output of `docker inspect`. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ContainerStatus"), - }, - }, - }, - }, - }, - "qosClass": { - SchemaProps: spec.SchemaProps{ - Description: "The Quality of Service (QOS) classification assigned to the pod based on resource requirements See PodQOSClass type for available QOS classes More info: https://git.k8s.io/community/contributors/design-proposals/node/resource-qos.md", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ContainerStatus", "k8s.io/api/core/v1.PodCondition", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_k8sio_api_core_v1_PodStatusResult(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Most recently observed status of the pod. This data may not be up to date. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.PodStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PodStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_PodTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodTemplate describes a template for creating copies of a predefined pod.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "template": { - SchemaProps: spec.SchemaProps{ - Description: "Template defines the pods that will be created from this pod template. https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.PodTemplateSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PodTemplateSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_PodTemplateList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodTemplateList is a list of PodTemplates.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of pod templates", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.PodTemplate"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PodTemplate", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_PodTemplateSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodTemplateSpec describes the data a pod should have when created from a template", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.PodSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PodSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_PortworxVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PortworxVolumeSource represents a Portworx volume resource.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "volumeID": { - SchemaProps: spec.SchemaProps{ - Description: "VolumeID uniquely identifies a Portworx volume", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "FSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\". Implicitly inferred to be \"ext4\" if unspecified.", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"volumeID"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_PreferAvoidPodsEntry(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Describes a class of pods that should avoid this node.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "podSignature": { - SchemaProps: spec.SchemaProps{ - Description: "The class of pods.", - Ref: ref("k8s.io/api/core/v1.PodSignature"), - }, - }, - "evictionTime": { - SchemaProps: spec.SchemaProps{ - Description: "Time at which this entry was added to the list.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "(brief) reason why this entry was added to the list.", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "Human readable message indicating why this entry was added to the list.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"podSignature"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PodSignature", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_k8sio_api_core_v1_PreferredSchedulingTerm(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "weight": { - SchemaProps: spec.SchemaProps{ - Description: "Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "preference": { - SchemaProps: spec.SchemaProps{ - Description: "A node selector term, associated with the corresponding weight.", - Ref: ref("k8s.io/api/core/v1.NodeSelectorTerm"), - }, - }, - }, - Required: []string{"weight", "preference"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.NodeSelectorTerm"}, - } -} - -func schema_k8sio_api_core_v1_Probe(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "exec": { - SchemaProps: spec.SchemaProps{ - Description: "One and only one of the following should be specified. Exec specifies the action to take.", - Ref: ref("k8s.io/api/core/v1.ExecAction"), - }, - }, - "httpGet": { - SchemaProps: spec.SchemaProps{ - Description: "HTTPGet specifies the http request to perform.", - Ref: ref("k8s.io/api/core/v1.HTTPGetAction"), - }, - }, - "tcpSocket": { - SchemaProps: spec.SchemaProps{ - Description: "TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported", - Ref: ref("k8s.io/api/core/v1.TCPSocketAction"), - }, - }, - "initialDelaySeconds": { - SchemaProps: spec.SchemaProps{ - Description: "Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "timeoutSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "periodSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "successThreshold": { - SchemaProps: spec.SchemaProps{ - Description: "Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness. Minimum value is 1.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "failureThreshold": { - SchemaProps: spec.SchemaProps{ - Description: "Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ExecAction", "k8s.io/api/core/v1.HTTPGetAction", "k8s.io/api/core/v1.TCPSocketAction"}, - } -} - -func schema_k8sio_api_core_v1_ProjectedVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a projected volume source", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "sources": { - SchemaProps: spec.SchemaProps{ - Description: "list of volume projections", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.VolumeProjection"), - }, - }, - }, - }, - }, - "defaultMode": { - SchemaProps: spec.SchemaProps{ - Description: "Mode bits to use on created files by default. Must be a value between 0 and 0777. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"sources"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.VolumeProjection"}, - } -} - -func schema_k8sio_api_core_v1_QuobyteVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do not support ownership management or SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "registry": { - SchemaProps: spec.SchemaProps{ - Description: "Registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes", - Type: []string{"string"}, - Format: "", - }, - }, - "volume": { - SchemaProps: spec.SchemaProps{ - Description: "Volume is a string that references an already created Quobyte volume by name.", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "ReadOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "user": { - SchemaProps: spec.SchemaProps{ - Description: "User to map volume access to Defaults to serivceaccount user", - Type: []string{"string"}, - Format: "", - }, - }, - "group": { - SchemaProps: spec.SchemaProps{ - Description: "Group to map volume access to Default is no group", - Type: []string{"string"}, - Format: "", - }, - }, - "tenant": { - SchemaProps: spec.SchemaProps{ - Description: "Tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"registry", "volume"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_RBDPersistentVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "monitors": { - SchemaProps: spec.SchemaProps{ - Description: "A collection of Ceph monitors. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "image": { - SchemaProps: spec.SchemaProps{ - Description: "The rados image name. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd", - Type: []string{"string"}, - Format: "", - }, - }, - "pool": { - SchemaProps: spec.SchemaProps{ - Description: "The rados pool name. Default is rbd. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", - Type: []string{"string"}, - Format: "", - }, - }, - "user": { - SchemaProps: spec.SchemaProps{ - Description: "The rados user name. Default is admin. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", - Type: []string{"string"}, - Format: "", - }, - }, - "keyring": { - SchemaProps: spec.SchemaProps{ - Description: "Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", - Type: []string{"string"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "SecretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", - Ref: ref("k8s.io/api/core/v1.SecretReference"), - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"monitors", "image"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.SecretReference"}, - } -} - -func schema_k8sio_api_core_v1_RBDVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "monitors": { - SchemaProps: spec.SchemaProps{ - Description: "A collection of Ceph monitors. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "image": { - SchemaProps: spec.SchemaProps{ - Description: "The rados image name. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd", - Type: []string{"string"}, - Format: "", - }, - }, - "pool": { - SchemaProps: spec.SchemaProps{ - Description: "The rados pool name. Default is rbd. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", - Type: []string{"string"}, - Format: "", - }, - }, - "user": { - SchemaProps: spec.SchemaProps{ - Description: "The rados user name. Default is admin. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", - Type: []string{"string"}, - Format: "", - }, - }, - "keyring": { - SchemaProps: spec.SchemaProps{ - Description: "Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", - Type: []string{"string"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "SecretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"monitors", "image"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - -func schema_k8sio_api_core_v1_RangeAllocation(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RangeAllocation is not a public type.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "range": { - SchemaProps: spec.SchemaProps{ - Description: "Range is string that identifies the range represented by 'data'.", - Type: []string{"string"}, - Format: "", - }, - }, - "data": { - SchemaProps: spec.SchemaProps{ - Description: "Data is a bit array containing all allocated addresses in the previous segment.", - Type: []string{"string"}, - Format: "byte", - }, - }, - }, - Required: []string{"range", "data"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_ReplicationController(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReplicationController represents the configuration of a replication controller.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "If the Labels of a ReplicationController are empty, they are defaulted to be the same as the Pod(s) that the replication controller manages. Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the specification of the desired behavior of the replication controller. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.ReplicationControllerSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status is the most recently observed status of the replication controller. This data may be out of date by some window of time. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.ReplicationControllerStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ReplicationControllerSpec", "k8s.io/api/core/v1.ReplicationControllerStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_ReplicationControllerCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReplicationControllerCondition describes the state of a replication controller at a certain point.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type of replication controller condition.", - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status of the condition, one of True, False, Unknown.", - Type: []string{"string"}, - Format: "", - }, - }, - "lastTransitionTime": { - SchemaProps: spec.SchemaProps{ - Description: "The last time the condition transitioned from one status to another.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "The reason for the condition's last transition.", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "A human readable message indicating details about the transition.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type", "status"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_k8sio_api_core_v1_ReplicationControllerList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReplicationControllerList is a collection of replication controllers.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of replication controllers. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ReplicationController"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ReplicationController", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_ReplicationControllerSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReplicationControllerSpec is the specification of a replication controller.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "replicas": { - SchemaProps: spec.SchemaProps{ - Description: "Replicas is the number of desired replicas. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "minReadySeconds": { - SchemaProps: spec.SchemaProps{ - Description: "Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "selector": { - SchemaProps: spec.SchemaProps{ - Description: "Selector is a label query over pods that should match the Replicas count. If Selector is empty, it is defaulted to the labels present on the Pod template. Label keys and values that must match in order to be controlled by this replication controller, if empty defaulted to labels on Pod template. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "template": { - SchemaProps: spec.SchemaProps{ - Description: "Template is the object that describes the pod that will be created if insufficient replicas are detected. This takes precedence over a TemplateRef. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template", - Ref: ref("k8s.io/api/core/v1.PodTemplateSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PodTemplateSpec"}, - } -} - -func schema_k8sio_api_core_v1_ReplicationControllerStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReplicationControllerStatus represents the current status of a replication controller.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "replicas": { - SchemaProps: spec.SchemaProps{ - Description: "Replicas is the most recently oberved number of replicas. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "fullyLabeledReplicas": { - SchemaProps: spec.SchemaProps{ - Description: "The number of pods that have labels matching the labels of the pod template of the replication controller.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "readyReplicas": { - SchemaProps: spec.SchemaProps{ - Description: "The number of ready replicas for this replication controller.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "availableReplicas": { - SchemaProps: spec.SchemaProps{ - Description: "The number of available replicas (ready for at least minReadySeconds) for this replication controller.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "observedGeneration": { - SchemaProps: spec.SchemaProps{ - Description: "ObservedGeneration reflects the generation of the most recently observed replication controller.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "conditions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "type", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Represents the latest available observations of a replication controller's current state.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ReplicationControllerCondition"), - }, - }, - }, - }, - }, - }, - Required: []string{"replicas"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ReplicationControllerCondition"}, - } -} - -func schema_k8sio_api_core_v1_ResourceFieldSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ResourceFieldSelector represents container resources (cpu, memory) and their output format", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "containerName": { - SchemaProps: spec.SchemaProps{ - Description: "Container name: required for volumes, optional for env vars", - Type: []string{"string"}, - Format: "", - }, - }, - "resource": { - SchemaProps: spec.SchemaProps{ - Description: "Required: resource to select", - Type: []string{"string"}, - Format: "", - }, - }, - "divisor": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies the output format of the exposed resources, defaults to \"1\"", - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - Required: []string{"resource"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity"}, - } -} - -func schema_k8sio_api_core_v1_ResourceQuota(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ResourceQuota sets aggregate quota restrictions enforced per namespace", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the desired quota. https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.ResourceQuotaSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status defines the actual enforced quota and its current usage. https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.ResourceQuotaStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ResourceQuotaSpec", "k8s.io/api/core/v1.ResourceQuotaStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_ResourceQuotaList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ResourceQuotaList is a list of ResourceQuota items.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "Items is a list of ResourceQuota objects. More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ResourceQuota"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ResourceQuota", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_ResourceQuotaSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ResourceQuotaSpec defines the desired hard limits to enforce for Quota.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "hard": { - SchemaProps: spec.SchemaProps{ - Description: "hard is the set of desired hard limits for each named resource. More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - "scopes": { - SchemaProps: spec.SchemaProps{ - Description: "A collection of filters that must match each object tracked by a quota. If not specified, the quota matches all objects.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "scopeSelector": { - SchemaProps: spec.SchemaProps{ - Description: "scopeSelector is also a collection of filters like scopes that must match each object tracked by a quota but expressed using ScopeSelectorOperator in combination with possible values. For a resource to match, both scopes AND scopeSelector (if specified in spec), must be matched.", - Ref: ref("k8s.io/api/core/v1.ScopeSelector"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ScopeSelector", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, - } -} - -func schema_k8sio_api_core_v1_ResourceQuotaStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ResourceQuotaStatus defines the enforced hard limits and observed use.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "hard": { - SchemaProps: spec.SchemaProps{ - Description: "Hard is the set of enforced hard limits for each named resource. More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - "used": { - SchemaProps: spec.SchemaProps{ - Description: "Used is the current observed total usage of the resource in the namespace.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity"}, - } -} - -func schema_k8sio_api_core_v1_ResourceRequirements(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ResourceRequirements describes the compute resource requirements.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "limits": { - SchemaProps: spec.SchemaProps{ - Description: "Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - "requests": { - SchemaProps: spec.SchemaProps{ - Description: "Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity"}, - } -} - -func schema_k8sio_api_core_v1_SELinuxOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SELinuxOptions are the labels to be applied to the container", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "user": { - SchemaProps: spec.SchemaProps{ - Description: "User is a SELinux user label that applies to the container.", - Type: []string{"string"}, - Format: "", - }, - }, - "role": { - SchemaProps: spec.SchemaProps{ - Description: "Role is a SELinux role label that applies to the container.", - Type: []string{"string"}, - Format: "", - }, - }, - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type is a SELinux type label that applies to the container.", - Type: []string{"string"}, - Format: "", - }, - }, - "level": { - SchemaProps: spec.SchemaProps{ - Description: "Level is SELinux level label that applies to the container.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_api_core_v1_ScaleIOPersistentVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ScaleIOPersistentVolumeSource represents a persistent ScaleIO volume", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "gateway": { - SchemaProps: spec.SchemaProps{ - Description: "The host address of the ScaleIO API Gateway.", - Type: []string{"string"}, - Format: "", - }, - }, - "system": { - SchemaProps: spec.SchemaProps{ - Description: "The name of the storage system as configured in ScaleIO.", - Type: []string{"string"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "SecretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail.", - Ref: ref("k8s.io/api/core/v1.SecretReference"), - }, - }, - "sslEnabled": { - SchemaProps: spec.SchemaProps{ - Description: "Flag to enable/disable SSL communication with Gateway, default false", - Type: []string{"boolean"}, - Format: "", - }, - }, - "protectionDomain": { - SchemaProps: spec.SchemaProps{ - Description: "The name of the ScaleIO Protection Domain for the configured storage.", - Type: []string{"string"}, - Format: "", - }, - }, - "storagePool": { - SchemaProps: spec.SchemaProps{ - Description: "The ScaleIO Storage Pool associated with the protection domain.", - Type: []string{"string"}, - Format: "", - }, - }, - "storageMode": { - SchemaProps: spec.SchemaProps{ - Description: "Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned.", - Type: []string{"string"}, - Format: "", - }, - }, - "volumeName": { - SchemaProps: spec.SchemaProps{ - Description: "The name of a volume already created in the ScaleIO system that is associated with this volume source.", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Default is \"xfs\"", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"gateway", "system", "secretRef"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.SecretReference"}, - } -} - -func schema_k8sio_api_core_v1_ScaleIOVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ScaleIOVolumeSource represents a persistent ScaleIO volume", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "gateway": { - SchemaProps: spec.SchemaProps{ - Description: "The host address of the ScaleIO API Gateway.", - Type: []string{"string"}, - Format: "", - }, - }, - "system": { - SchemaProps: spec.SchemaProps{ - Description: "The name of the storage system as configured in ScaleIO.", - Type: []string{"string"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "SecretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "sslEnabled": { - SchemaProps: spec.SchemaProps{ - Description: "Flag to enable/disable SSL communication with Gateway, default false", - Type: []string{"boolean"}, - Format: "", - }, - }, - "protectionDomain": { - SchemaProps: spec.SchemaProps{ - Description: "The name of the ScaleIO Protection Domain for the configured storage.", - Type: []string{"string"}, - Format: "", - }, - }, - "storagePool": { - SchemaProps: spec.SchemaProps{ - Description: "The ScaleIO Storage Pool associated with the protection domain.", - Type: []string{"string"}, - Format: "", - }, - }, - "storageMode": { - SchemaProps: spec.SchemaProps{ - Description: "Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned.", - Type: []string{"string"}, - Format: "", - }, - }, - "volumeName": { - SchemaProps: spec.SchemaProps{ - Description: "The name of a volume already created in the ScaleIO system that is associated with this volume source.", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Default is \"xfs\".", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"gateway", "system", "secretRef"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - -func schema_k8sio_api_core_v1_ScopeSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "A scope selector represents the AND of the selectors represented by the scoped-resource selector requirements.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "matchExpressions": { - SchemaProps: spec.SchemaProps{ - Description: "A list of scope selector requirements by scope of the resources.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ScopedResourceSelectorRequirement"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ScopedResourceSelectorRequirement"}, - } -} - -func schema_k8sio_api_core_v1_ScopedResourceSelectorRequirement(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "A scoped-resource selector requirement is a selector that contains values, a scope name, and an operator that relates the scope name and values.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "scopeName": { - SchemaProps: spec.SchemaProps{ - Description: "The name of the scope that the selector applies to.", - Type: []string{"string"}, - Format: "", - }, - }, - "operator": { - SchemaProps: spec.SchemaProps{ - Description: "Represents a scope's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist.", - Type: []string{"string"}, - Format: "", - }, - }, - "values": { - SchemaProps: spec.SchemaProps{ - Description: "An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"scopeName", "operator"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_Secret(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "data": { - SchemaProps: spec.SchemaProps{ - Description: "Data contains the secret data. Each key must consist of alphanumeric characters, '-', '_' or '.'. The serialized form of the secret data is a base64 encoded string, representing the arbitrary (possibly non-string) data value here. Described in https://tools.ietf.org/html/rfc4648#section-4", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "byte", - }, - }, - }, - }, - }, - "stringData": { - SchemaProps: spec.SchemaProps{ - Description: "stringData allows specifying non-binary secret data in string form. It is provided as a write-only convenience method. All keys and values are merged into the data field on write, overwriting any existing values. It is never output when reading from the API.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Used to facilitate programmatic handling of secret data.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_SecretEnvSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SecretEnvSource selects a Secret to populate the environment variables with.\n\nThe contents of the target Secret's Data field will represent the key-value pairs as environment variables.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - Type: []string{"string"}, - Format: "", - }, - }, - "optional": { - SchemaProps: spec.SchemaProps{ - Description: "Specify whether the Secret must be defined", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_api_core_v1_SecretKeySelector(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SecretKeySelector selects a key of a Secret.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - Type: []string{"string"}, - Format: "", - }, - }, - "key": { - SchemaProps: spec.SchemaProps{ - Description: "The key of the secret to select from. Must be a valid secret key.", - Type: []string{"string"}, - Format: "", - }, - }, - "optional": { - SchemaProps: spec.SchemaProps{ - Description: "Specify whether the Secret or its key must be defined", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"key"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_SecretList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SecretList is a list of Secret.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "Items is a list of secret objects. More info: https://kubernetes.io/docs/concepts/configuration/secret", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Secret"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.Secret", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_SecretProjection(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Adapts a secret into a projected volume.\n\nThe contents of the target Secret's Data field will be presented in a projected volume as files using the keys in the Data field as the file names. Note that this is identical to a secret volume source without the default mode.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - Type: []string{"string"}, - Format: "", - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.KeyToPath"), - }, - }, - }, - }, - }, - "optional": { - SchemaProps: spec.SchemaProps{ - Description: "Specify whether the Secret or its key must be defined", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.KeyToPath"}, - } -} - -func schema_k8sio_api_core_v1_SecretReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SecretReference represents a Secret Reference. It has enough information to retrieve secret in any namespace", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is unique within a namespace to reference a secret resource.", - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Description: "Namespace defines the space within which the secret name must be unique.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_api_core_v1_SecretVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Adapts a Secret into a volume.\n\nThe contents of the target Secret's Data field will be presented in a volume as files using the keys in the Data field as the file names. Secret volumes support ownership management and SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "secretName": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret", - Type: []string{"string"}, - Format: "", - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.KeyToPath"), - }, - }, - }, - }, - }, - "defaultMode": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "optional": { - SchemaProps: spec.SchemaProps{ - Description: "Specify whether the Secret or its keys must be defined", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.KeyToPath"}, - } -} - -func schema_k8sio_api_core_v1_SecurityContext(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SecurityContext holds security configuration that will be applied to a container. Some fields are present in both SecurityContext and PodSecurityContext. When both are set, the values in SecurityContext take precedence.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "capabilities": { - SchemaProps: spec.SchemaProps{ - Description: "The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime.", - Ref: ref("k8s.io/api/core/v1.Capabilities"), - }, - }, - "privileged": { - SchemaProps: spec.SchemaProps{ - Description: "Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "seLinuxOptions": { - SchemaProps: spec.SchemaProps{ - Description: "The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", - Ref: ref("k8s.io/api/core/v1.SELinuxOptions"), - }, - }, - "windowsOptions": { - SchemaProps: spec.SchemaProps{ - Description: "Windows security options.", - Ref: ref("k8s.io/api/core/v1.WindowsSecurityContextOptions"), - }, - }, - "runAsUser": { - SchemaProps: spec.SchemaProps{ - Description: "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "runAsGroup": { - SchemaProps: spec.SchemaProps{ - Description: "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "runAsNonRoot": { - SchemaProps: spec.SchemaProps{ - Description: "Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "readOnlyRootFilesystem": { - SchemaProps: spec.SchemaProps{ - Description: "Whether this container has a read-only root filesystem. Default is false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "allowPrivilegeEscalation": { - SchemaProps: spec.SchemaProps{ - Description: "AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN", - Type: []string{"boolean"}, - Format: "", - }, - }, - "procMount": { - SchemaProps: spec.SchemaProps{ - Description: "procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.Capabilities", "k8s.io/api/core/v1.SELinuxOptions", "k8s.io/api/core/v1.WindowsSecurityContextOptions"}, - } -} - -func schema_k8sio_api_core_v1_SerializedReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SerializedReference is a reference to serialized object.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "reference": { - SchemaProps: spec.SchemaProps{ - Description: "The reference to an object in the system.", - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ObjectReference"}, - } -} - -func schema_k8sio_api_core_v1_Service(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Service is a named abstraction of software service (for example, mysql) consisting of local port (for example 3306) that the proxy listens on, and the selector that determines which pods will answer requests sent through the proxy.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the behavior of a service. https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.ServiceSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Most recently observed status of the service. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.ServiceStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ServiceSpec", "k8s.io/api/core/v1.ServiceStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_ServiceAccount(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ServiceAccount binds together: * a name, understood by users, and perhaps by peripheral systems, for an identity * a principal that can be authenticated and authorized * a set of secrets", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "secrets": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Secrets is the list of secrets allowed to be used by pods running using this ServiceAccount. More info: https://kubernetes.io/docs/concepts/configuration/secret", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, - }, - }, - }, - "imagePullSecrets": { - SchemaProps: spec.SchemaProps{ - Description: "ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images in pods that reference this ServiceAccount. ImagePullSecrets are distinct from Secrets because Secrets can be mounted in the pod, but ImagePullSecrets are only accessed by the kubelet. More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - }, - }, - }, - "automountServiceAccountToken": { - SchemaProps: spec.SchemaProps{ - Description: "AutomountServiceAccountToken indicates whether pods running as this service account should have an API token automatically mounted. Can be overridden at the pod level.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_ServiceAccountList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ServiceAccountList is a list of ServiceAccount objects", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of ServiceAccounts. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ServiceAccount"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ServiceAccount", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_ServiceAccountTokenProjection(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ServiceAccountTokenProjection represents a projected service account token volume. This projection can be used to insert a service account token into the pods runtime filesystem for use against APIs (Kubernetes API Server or otherwise).", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "audience": { - SchemaProps: spec.SchemaProps{ - Description: "Audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the token. The audience defaults to the identifier of the apiserver.", - Type: []string{"string"}, - Format: "", - }, - }, - "expirationSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "ExpirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Path is the path relative to the mount point of the file to project the token into.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"path"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_ServiceList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ServiceList holds a list of services.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of services", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Service"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.Service", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_ServicePort(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ServicePort contains information on service's port.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "The name of this port within the service. This must be a DNS_LABEL. All ports within a ServiceSpec must have unique names. This maps to the 'Name' field in EndpointPort objects. Optional if only one ServicePort is defined on this service.", - Type: []string{"string"}, - Format: "", - }, - }, - "protocol": { - SchemaProps: spec.SchemaProps{ - Description: "The IP protocol for this port. Supports \"TCP\", \"UDP\", and \"SCTP\". Default is TCP.", - Type: []string{"string"}, - Format: "", - }, - }, - "port": { - SchemaProps: spec.SchemaProps{ - Description: "The port that will be exposed by this service.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "targetPort": { - SchemaProps: spec.SchemaProps{ - Description: "Number or name of the port to access on the pods targeted by the service. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. If this is a string, it will be looked up as a named port in the target Pod's container ports. If this is not specified, the value of the 'port' field is used (an identity map). This field is ignored for services with clusterIP=None, and should be omitted or set equal to the 'port' field. More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service", - Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), - }, - }, - "nodePort": { - SchemaProps: spec.SchemaProps{ - Description: "The port on each node on which this service is exposed when type=NodePort or LoadBalancer. Usually assigned by the system. If specified, it will be allocated to the service if unused or else creation of the service will fail. Default is to auto-allocate a port if the ServiceType of this Service requires one. More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"port"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/util/intstr.IntOrString"}, - } -} - -func schema_k8sio_api_core_v1_ServiceProxyOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ServiceProxyOptions is the query options to a Service's proxy call.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ServiceSpec describes the attributes that a user creates on a service.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "ports": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "port", - "protocol", - }, - "x-kubernetes-list-type": "map", - "x-kubernetes-patch-merge-key": "port", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "The list of ports that are exposed by this service. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ServicePort"), - }, - }, - }, - }, - }, - "selector": { - SchemaProps: spec.SchemaProps{ - Description: "Route service traffic to pods with label keys and values matching this selector. If empty or not present, the service is assumed to have an external process managing its endpoints, which Kubernetes will not modify. Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if type is ExternalName. More info: https://kubernetes.io/docs/concepts/services-networking/service/", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "clusterIP": { - SchemaProps: spec.SchemaProps{ - Description: "clusterIP is the IP address of the service and is usually assigned randomly by the master. If an address is specified manually and is not in use by others, it will be allocated to the service; otherwise, creation of the service will fail. This field can not be changed through updates. Valid values are \"None\", empty string (\"\"), or a valid IP address. \"None\" can be specified for headless services when proxying is not required. Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if type is ExternalName. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies", - Type: []string{"string"}, - Format: "", - }, - }, - "type": { - SchemaProps: spec.SchemaProps{ - Description: "type determines how the Service is exposed. Defaults to ClusterIP. Valid options are ExternalName, ClusterIP, NodePort, and LoadBalancer. \"ExternalName\" maps to the specified externalName. \"ClusterIP\" allocates a cluster-internal IP address for load-balancing to endpoints. Endpoints are determined by the selector or if that is not specified, by manual construction of an Endpoints object. If clusterIP is \"None\", no virtual IP is allocated and the endpoints are published as a set of endpoints rather than a stable IP. \"NodePort\" builds on ClusterIP and allocates a port on every node which routes to the clusterIP. \"LoadBalancer\" builds on NodePort and creates an external load-balancer (if supported in the current cloud) which routes to the clusterIP. More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types", - Type: []string{"string"}, - Format: "", - }, - }, - "externalIPs": { - SchemaProps: spec.SchemaProps{ - Description: "externalIPs is a list of IP addresses for which nodes in the cluster will also accept traffic for this service. These IPs are not managed by Kubernetes. The user is responsible for ensuring that traffic arrives at a node with this IP. A common example is external load-balancers that are not part of the Kubernetes system.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "sessionAffinity": { - SchemaProps: spec.SchemaProps{ - Description: "Supports \"ClientIP\" and \"None\". Used to maintain session affinity. Enable client IP based session affinity. Must be ClientIP or None. Defaults to None. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies", - Type: []string{"string"}, - Format: "", - }, - }, - "loadBalancerIP": { - SchemaProps: spec.SchemaProps{ - Description: "Only applies to Service Type: LoadBalancer LoadBalancer will get created with the IP specified in this field. This feature depends on whether the underlying cloud-provider supports specifying the loadBalancerIP when a load balancer is created. This field will be ignored if the cloud-provider does not support the feature.", - Type: []string{"string"}, - Format: "", - }, - }, - "loadBalancerSourceRanges": { - SchemaProps: spec.SchemaProps{ - Description: "If specified and supported by the platform, this will restrict traffic through the cloud-provider load-balancer will be restricted to the specified client IPs. This field will be ignored if the cloud-provider does not support the feature.\" More info: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "externalName": { - SchemaProps: spec.SchemaProps{ - Description: "externalName is the external reference that kubedns or equivalent will return as a CNAME record for this service. No proxying will be involved. Must be a valid RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) and requires Type to be ExternalName.", - Type: []string{"string"}, - Format: "", - }, - }, - "externalTrafficPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. \"Local\" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. \"Cluster\" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.", - Type: []string{"string"}, - Format: "", - }, - }, - "healthCheckNodePort": { - SchemaProps: spec.SchemaProps{ - Description: "healthCheckNodePort specifies the healthcheck nodePort for the service. If not specified, HealthCheckNodePort is created by the service api backend with the allocated nodePort. Will use user-specified nodePort value if specified by the client. Only effects when Type is set to LoadBalancer and ExternalTrafficPolicy is set to Local.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "publishNotReadyAddresses": { - SchemaProps: spec.SchemaProps{ - Description: "publishNotReadyAddresses, when set to true, indicates that DNS implementations must publish the notReadyAddresses of subsets for the Endpoints associated with the Service. The default value is false. The primary use case for setting this field is to use a StatefulSet's Headless Service to propagate SRV records for its Pods without respect to their readiness for purpose of peer discovery.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "sessionAffinityConfig": { - SchemaProps: spec.SchemaProps{ - Description: "sessionAffinityConfig contains the configurations of session affinity.", - Ref: ref("k8s.io/api/core/v1.SessionAffinityConfig"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ServicePort", "k8s.io/api/core/v1.SessionAffinityConfig"}, - } -} - -func schema_k8sio_api_core_v1_ServiceStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ServiceStatus represents the current status of a service.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "loadBalancer": { - SchemaProps: spec.SchemaProps{ - Description: "LoadBalancer contains the current status of the load-balancer, if one is present.", - Ref: ref("k8s.io/api/core/v1.LoadBalancerStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LoadBalancerStatus"}, - } -} - -func schema_k8sio_api_core_v1_SessionAffinityConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SessionAffinityConfig represents the configurations of session affinity.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "clientIP": { - SchemaProps: spec.SchemaProps{ - Description: "clientIP contains the configurations of Client IP based session affinity.", - Ref: ref("k8s.io/api/core/v1.ClientIPConfig"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ClientIPConfig"}, - } -} - -func schema_k8sio_api_core_v1_StorageOSPersistentVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a StorageOS persistent volume resource.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "volumeName": { - SchemaProps: spec.SchemaProps{ - Description: "VolumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace.", - Type: []string{"string"}, - Format: "", - }, - }, - "volumeNamespace": { - SchemaProps: spec.SchemaProps{ - Description: "VolumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to \"default\" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created.", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "SecretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted.", - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ObjectReference"}, - } -} - -func schema_k8sio_api_core_v1_StorageOSVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a StorageOS persistent volume resource.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "volumeName": { - SchemaProps: spec.SchemaProps{ - Description: "VolumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace.", - Type: []string{"string"}, - Format: "", - }, - }, - "volumeNamespace": { - SchemaProps: spec.SchemaProps{ - Description: "VolumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to \"default\" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created.", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "SecretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - -func schema_k8sio_api_core_v1_Sysctl(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Sysctl defines a kernel parameter to be set", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of a property to set", - Type: []string{"string"}, - Format: "", - }, - }, - "value": { - SchemaProps: spec.SchemaProps{ - Description: "Value of a property to set", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name", "value"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_TCPSocketAction(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TCPSocketAction describes an action based on opening a socket", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "port": { - SchemaProps: spec.SchemaProps{ - Description: "Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.", - Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), - }, - }, - "host": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Host name to connect to, defaults to the pod IP.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"port"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/util/intstr.IntOrString"}, - } -} - -func schema_k8sio_api_core_v1_Taint(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "The node this Taint is attached to has the \"effect\" on any pod that does not tolerate the Taint.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "key": { - SchemaProps: spec.SchemaProps{ - Description: "Required. The taint key to be applied to a node.", - Type: []string{"string"}, - Format: "", - }, - }, - "value": { - SchemaProps: spec.SchemaProps{ - Description: "Required. The taint value corresponding to the taint key.", - Type: []string{"string"}, - Format: "", - }, - }, - "effect": { - SchemaProps: spec.SchemaProps{ - Description: "Required. The effect of the taint on pods that do not tolerate the taint. Valid effects are NoSchedule, PreferNoSchedule and NoExecute.", - Type: []string{"string"}, - Format: "", - }, - }, - "timeAdded": { - SchemaProps: spec.SchemaProps{ - Description: "TimeAdded represents the time at which the taint was added. It is only written for NoExecute taints.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - }, - Required: []string{"key", "effect"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_k8sio_api_core_v1_Toleration(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator .", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "key": { - SchemaProps: spec.SchemaProps{ - Description: "Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.", - Type: []string{"string"}, - Format: "", - }, - }, - "operator": { - SchemaProps: spec.SchemaProps{ - Description: "Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.", - Type: []string{"string"}, - Format: "", - }, - }, - "value": { - SchemaProps: spec.SchemaProps{ - Description: "Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.", - Type: []string{"string"}, - Format: "", - }, - }, - "effect": { - SchemaProps: spec.SchemaProps{ - Description: "Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.", - Type: []string{"string"}, - Format: "", - }, - }, - "tolerationSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_api_core_v1_TopologySelectorLabelRequirement(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "A topology selector requirement is a selector that matches given label. This is an alpha feature and may change in the future.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "key": { - SchemaProps: spec.SchemaProps{ - Description: "The label key that the selector applies to.", - Type: []string{"string"}, - Format: "", - }, - }, - "values": { - SchemaProps: spec.SchemaProps{ - Description: "An array of string values. One value must match the label to be selected. Each entry in Values is ORed.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"key", "values"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_TopologySelectorTerm(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "A topology selector term represents the result of label queries. A null or empty topology selector term matches no objects. The requirements of them are ANDed. It provides a subset of functionality as NodeSelectorTerm. This is an alpha feature and may change in the future.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "matchLabelExpressions": { - SchemaProps: spec.SchemaProps{ - Description: "A list of topology selector requirements by labels.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.TopologySelectorLabelRequirement"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.TopologySelectorLabelRequirement"}, - } -} - -func schema_k8sio_api_core_v1_TypedLocalObjectReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TypedLocalObjectReference contains enough information to let you locate the typed referenced object inside the same namespace.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "apiGroup": { - SchemaProps: spec.SchemaProps{ - Description: "APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is the type of resource being referenced", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of resource being referenced", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"kind", "name"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_Volume(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Volume represents a named volume in a pod that may be accessed by any container in the pod.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Volume's name. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - Type: []string{"string"}, - Format: "", - }, - }, - "hostPath": { - SchemaProps: spec.SchemaProps{ - Description: "HostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath", - Ref: ref("k8s.io/api/core/v1.HostPathVolumeSource"), - }, - }, - "emptyDir": { - SchemaProps: spec.SchemaProps{ - Description: "EmptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir", - Ref: ref("k8s.io/api/core/v1.EmptyDirVolumeSource"), - }, - }, - "gcePersistentDisk": { - SchemaProps: spec.SchemaProps{ - Description: "GCEPersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", - Ref: ref("k8s.io/api/core/v1.GCEPersistentDiskVolumeSource"), - }, - }, - "awsElasticBlockStore": { - SchemaProps: spec.SchemaProps{ - Description: "AWSElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", - Ref: ref("k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource"), - }, - }, - "gitRepo": { - SchemaProps: spec.SchemaProps{ - Description: "GitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.", - Ref: ref("k8s.io/api/core/v1.GitRepoVolumeSource"), - }, - }, - "secret": { - SchemaProps: spec.SchemaProps{ - Description: "Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret", - Ref: ref("k8s.io/api/core/v1.SecretVolumeSource"), - }, - }, - "nfs": { - SchemaProps: spec.SchemaProps{ - Description: "NFS represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", - Ref: ref("k8s.io/api/core/v1.NFSVolumeSource"), - }, - }, - "iscsi": { - SchemaProps: spec.SchemaProps{ - Description: "ISCSI represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://releases.k8s.io/HEAD/examples/volumes/iscsi/README.md", - Ref: ref("k8s.io/api/core/v1.ISCSIVolumeSource"), - }, - }, - "glusterfs": { - SchemaProps: spec.SchemaProps{ - Description: "Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md", - Ref: ref("k8s.io/api/core/v1.GlusterfsVolumeSource"), - }, - }, - "persistentVolumeClaim": { - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims", - Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource"), - }, - }, - "rbd": { - SchemaProps: spec.SchemaProps{ - Description: "RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md", - Ref: ref("k8s.io/api/core/v1.RBDVolumeSource"), - }, - }, - "flexVolume": { - SchemaProps: spec.SchemaProps{ - Description: "FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.", - Ref: ref("k8s.io/api/core/v1.FlexVolumeSource"), - }, - }, - "cinder": { - SchemaProps: spec.SchemaProps{ - Description: "Cinder represents a cinder volume attached and mounted on kubelets host machine More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md", - Ref: ref("k8s.io/api/core/v1.CinderVolumeSource"), - }, - }, - "cephfs": { - SchemaProps: spec.SchemaProps{ - Description: "CephFS represents a Ceph FS mount on the host that shares a pod's lifetime", - Ref: ref("k8s.io/api/core/v1.CephFSVolumeSource"), - }, - }, - "flocker": { - SchemaProps: spec.SchemaProps{ - Description: "Flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running", - Ref: ref("k8s.io/api/core/v1.FlockerVolumeSource"), - }, - }, - "downwardAPI": { - SchemaProps: spec.SchemaProps{ - Description: "DownwardAPI represents downward API about the pod that should populate this volume", - Ref: ref("k8s.io/api/core/v1.DownwardAPIVolumeSource"), - }, - }, - "fc": { - SchemaProps: spec.SchemaProps{ - Description: "FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.", - Ref: ref("k8s.io/api/core/v1.FCVolumeSource"), - }, - }, - "azureFile": { - SchemaProps: spec.SchemaProps{ - Description: "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.", - Ref: ref("k8s.io/api/core/v1.AzureFileVolumeSource"), - }, - }, - "configMap": { - SchemaProps: spec.SchemaProps{ - Description: "ConfigMap represents a configMap that should populate this volume", - Ref: ref("k8s.io/api/core/v1.ConfigMapVolumeSource"), - }, - }, - "vsphereVolume": { - SchemaProps: spec.SchemaProps{ - Description: "VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine", - Ref: ref("k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource"), - }, - }, - "quobyte": { - SchemaProps: spec.SchemaProps{ - Description: "Quobyte represents a Quobyte mount on the host that shares a pod's lifetime", - Ref: ref("k8s.io/api/core/v1.QuobyteVolumeSource"), - }, - }, - "azureDisk": { - SchemaProps: spec.SchemaProps{ - Description: "AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.", - Ref: ref("k8s.io/api/core/v1.AzureDiskVolumeSource"), - }, - }, - "photonPersistentDisk": { - SchemaProps: spec.SchemaProps{ - Description: "PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine", - Ref: ref("k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource"), - }, - }, - "projected": { - SchemaProps: spec.SchemaProps{ - Description: "Items for all in one resources secrets, configmaps, and downward API", - Ref: ref("k8s.io/api/core/v1.ProjectedVolumeSource"), - }, - }, - "portworxVolume": { - SchemaProps: spec.SchemaProps{ - Description: "PortworxVolume represents a portworx volume attached and mounted on kubelets host machine", - Ref: ref("k8s.io/api/core/v1.PortworxVolumeSource"), - }, - }, - "scaleIO": { - SchemaProps: spec.SchemaProps{ - Description: "ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.", - Ref: ref("k8s.io/api/core/v1.ScaleIOVolumeSource"), - }, - }, - "storageos": { - SchemaProps: spec.SchemaProps{ - Description: "StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes.", - Ref: ref("k8s.io/api/core/v1.StorageOSVolumeSource"), - }, - }, - "csi": { - SchemaProps: spec.SchemaProps{ - Description: "CSI (Container Storage Interface) represents storage that is handled by an external CSI driver (Alpha feature).", - Ref: ref("k8s.io/api/core/v1.CSIVolumeSource"), - }, - }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource", "k8s.io/api/core/v1.AzureDiskVolumeSource", "k8s.io/api/core/v1.AzureFileVolumeSource", "k8s.io/api/core/v1.CSIVolumeSource", "k8s.io/api/core/v1.CephFSVolumeSource", "k8s.io/api/core/v1.CinderVolumeSource", "k8s.io/api/core/v1.ConfigMapVolumeSource", "k8s.io/api/core/v1.DownwardAPIVolumeSource", "k8s.io/api/core/v1.EmptyDirVolumeSource", "k8s.io/api/core/v1.FCVolumeSource", "k8s.io/api/core/v1.FlexVolumeSource", "k8s.io/api/core/v1.FlockerVolumeSource", "k8s.io/api/core/v1.GCEPersistentDiskVolumeSource", "k8s.io/api/core/v1.GitRepoVolumeSource", "k8s.io/api/core/v1.GlusterfsVolumeSource", "k8s.io/api/core/v1.HostPathVolumeSource", "k8s.io/api/core/v1.ISCSIVolumeSource", "k8s.io/api/core/v1.NFSVolumeSource", "k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource", "k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource", "k8s.io/api/core/v1.PortworxVolumeSource", "k8s.io/api/core/v1.ProjectedVolumeSource", "k8s.io/api/core/v1.QuobyteVolumeSource", "k8s.io/api/core/v1.RBDVolumeSource", "k8s.io/api/core/v1.ScaleIOVolumeSource", "k8s.io/api/core/v1.SecretVolumeSource", "k8s.io/api/core/v1.StorageOSVolumeSource", "k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource"}, - } -} - -func schema_k8sio_api_core_v1_VolumeDevice(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "volumeDevice describes a mapping of a raw block device within a container.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "name must match the name of a persistentVolumeClaim in the pod", - Type: []string{"string"}, - Format: "", - }, - }, - "devicePath": { - SchemaProps: spec.SchemaProps{ - Description: "devicePath is the path inside of the container that the device will be mapped to.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name", "devicePath"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_VolumeMount(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VolumeMount describes a mounting of a Volume within a container.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "This must match the Name of a Volume.", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "mountPath": { - SchemaProps: spec.SchemaProps{ - Description: "Path within the container at which the volume should be mounted. Must not contain ':'.", - Type: []string{"string"}, - Format: "", - }, - }, - "subPath": { - SchemaProps: spec.SchemaProps{ - Description: "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root).", - Type: []string{"string"}, - Format: "", - }, - }, - "mountPropagation": { - SchemaProps: spec.SchemaProps{ - Description: "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10.", - Type: []string{"string"}, - Format: "", - }, - }, - "subPathExpr": { - SchemaProps: spec.SchemaProps{ - Description: "Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive. This field is beta in 1.15.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name", "mountPath"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_VolumeNodeAffinity(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VolumeNodeAffinity defines constraints that limit what nodes this volume can be accessed from.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "required": { - SchemaProps: spec.SchemaProps{ - Description: "Required specifies hard node constraints that must be met.", - Ref: ref("k8s.io/api/core/v1.NodeSelector"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.NodeSelector"}, - } -} - -func schema_k8sio_api_core_v1_VolumeProjection(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Projection that may be projected along with other supported volume types", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "secret": { - SchemaProps: spec.SchemaProps{ - Description: "information about the secret data to project", - Ref: ref("k8s.io/api/core/v1.SecretProjection"), - }, - }, - "downwardAPI": { - SchemaProps: spec.SchemaProps{ - Description: "information about the downwardAPI data to project", - Ref: ref("k8s.io/api/core/v1.DownwardAPIProjection"), - }, - }, - "configMap": { - SchemaProps: spec.SchemaProps{ - Description: "information about the configMap data to project", - Ref: ref("k8s.io/api/core/v1.ConfigMapProjection"), - }, - }, - "serviceAccountToken": { - SchemaProps: spec.SchemaProps{ - Description: "information about the serviceAccountToken data to project", - Ref: ref("k8s.io/api/core/v1.ServiceAccountTokenProjection"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ConfigMapProjection", "k8s.io/api/core/v1.DownwardAPIProjection", "k8s.io/api/core/v1.SecretProjection", "k8s.io/api/core/v1.ServiceAccountTokenProjection"}, - } -} - -func schema_k8sio_api_core_v1_VolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents the source of a volume to mount. Only one of its members may be specified.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "hostPath": { - SchemaProps: spec.SchemaProps{ - Description: "HostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath", - Ref: ref("k8s.io/api/core/v1.HostPathVolumeSource"), - }, - }, - "emptyDir": { - SchemaProps: spec.SchemaProps{ - Description: "EmptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir", - Ref: ref("k8s.io/api/core/v1.EmptyDirVolumeSource"), - }, - }, - "gcePersistentDisk": { - SchemaProps: spec.SchemaProps{ - Description: "GCEPersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", - Ref: ref("k8s.io/api/core/v1.GCEPersistentDiskVolumeSource"), - }, - }, - "awsElasticBlockStore": { - SchemaProps: spec.SchemaProps{ - Description: "AWSElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", - Ref: ref("k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource"), - }, - }, - "gitRepo": { - SchemaProps: spec.SchemaProps{ - Description: "GitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.", - Ref: ref("k8s.io/api/core/v1.GitRepoVolumeSource"), - }, - }, - "secret": { - SchemaProps: spec.SchemaProps{ - Description: "Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret", - Ref: ref("k8s.io/api/core/v1.SecretVolumeSource"), - }, - }, - "nfs": { - SchemaProps: spec.SchemaProps{ - Description: "NFS represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", - Ref: ref("k8s.io/api/core/v1.NFSVolumeSource"), - }, - }, - "iscsi": { - SchemaProps: spec.SchemaProps{ - Description: "ISCSI represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://releases.k8s.io/HEAD/examples/volumes/iscsi/README.md", - Ref: ref("k8s.io/api/core/v1.ISCSIVolumeSource"), - }, - }, - "glusterfs": { - SchemaProps: spec.SchemaProps{ - Description: "Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md", - Ref: ref("k8s.io/api/core/v1.GlusterfsVolumeSource"), - }, - }, - "persistentVolumeClaim": { - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims", - Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource"), - }, - }, - "rbd": { - SchemaProps: spec.SchemaProps{ - Description: "RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md", - Ref: ref("k8s.io/api/core/v1.RBDVolumeSource"), - }, - }, - "flexVolume": { - SchemaProps: spec.SchemaProps{ - Description: "FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.", - Ref: ref("k8s.io/api/core/v1.FlexVolumeSource"), - }, - }, - "cinder": { - SchemaProps: spec.SchemaProps{ - Description: "Cinder represents a cinder volume attached and mounted on kubelets host machine More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md", - Ref: ref("k8s.io/api/core/v1.CinderVolumeSource"), - }, - }, - "cephfs": { - SchemaProps: spec.SchemaProps{ - Description: "CephFS represents a Ceph FS mount on the host that shares a pod's lifetime", - Ref: ref("k8s.io/api/core/v1.CephFSVolumeSource"), - }, - }, - "flocker": { - SchemaProps: spec.SchemaProps{ - Description: "Flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running", - Ref: ref("k8s.io/api/core/v1.FlockerVolumeSource"), - }, - }, - "downwardAPI": { - SchemaProps: spec.SchemaProps{ - Description: "DownwardAPI represents downward API about the pod that should populate this volume", - Ref: ref("k8s.io/api/core/v1.DownwardAPIVolumeSource"), - }, - }, - "fc": { - SchemaProps: spec.SchemaProps{ - Description: "FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.", - Ref: ref("k8s.io/api/core/v1.FCVolumeSource"), - }, - }, - "azureFile": { - SchemaProps: spec.SchemaProps{ - Description: "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.", - Ref: ref("k8s.io/api/core/v1.AzureFileVolumeSource"), - }, - }, - "configMap": { - SchemaProps: spec.SchemaProps{ - Description: "ConfigMap represents a configMap that should populate this volume", - Ref: ref("k8s.io/api/core/v1.ConfigMapVolumeSource"), - }, - }, - "vsphereVolume": { - SchemaProps: spec.SchemaProps{ - Description: "VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine", - Ref: ref("k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource"), - }, - }, - "quobyte": { - SchemaProps: spec.SchemaProps{ - Description: "Quobyte represents a Quobyte mount on the host that shares a pod's lifetime", - Ref: ref("k8s.io/api/core/v1.QuobyteVolumeSource"), - }, - }, - "azureDisk": { - SchemaProps: spec.SchemaProps{ - Description: "AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.", - Ref: ref("k8s.io/api/core/v1.AzureDiskVolumeSource"), - }, - }, - "photonPersistentDisk": { - SchemaProps: spec.SchemaProps{ - Description: "PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine", - Ref: ref("k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource"), - }, - }, - "projected": { - SchemaProps: spec.SchemaProps{ - Description: "Items for all in one resources secrets, configmaps, and downward API", - Ref: ref("k8s.io/api/core/v1.ProjectedVolumeSource"), - }, - }, - "portworxVolume": { - SchemaProps: spec.SchemaProps{ - Description: "PortworxVolume represents a portworx volume attached and mounted on kubelets host machine", - Ref: ref("k8s.io/api/core/v1.PortworxVolumeSource"), - }, - }, - "scaleIO": { - SchemaProps: spec.SchemaProps{ - Description: "ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.", - Ref: ref("k8s.io/api/core/v1.ScaleIOVolumeSource"), - }, - }, - "storageos": { - SchemaProps: spec.SchemaProps{ - Description: "StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes.", - Ref: ref("k8s.io/api/core/v1.StorageOSVolumeSource"), - }, - }, - "csi": { - SchemaProps: spec.SchemaProps{ - Description: "CSI (Container Storage Interface) represents storage that is handled by an external CSI driver (Alpha feature).", - Ref: ref("k8s.io/api/core/v1.CSIVolumeSource"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource", "k8s.io/api/core/v1.AzureDiskVolumeSource", "k8s.io/api/core/v1.AzureFileVolumeSource", "k8s.io/api/core/v1.CSIVolumeSource", "k8s.io/api/core/v1.CephFSVolumeSource", "k8s.io/api/core/v1.CinderVolumeSource", "k8s.io/api/core/v1.ConfigMapVolumeSource", "k8s.io/api/core/v1.DownwardAPIVolumeSource", "k8s.io/api/core/v1.EmptyDirVolumeSource", "k8s.io/api/core/v1.FCVolumeSource", "k8s.io/api/core/v1.FlexVolumeSource", "k8s.io/api/core/v1.FlockerVolumeSource", "k8s.io/api/core/v1.GCEPersistentDiskVolumeSource", "k8s.io/api/core/v1.GitRepoVolumeSource", "k8s.io/api/core/v1.GlusterfsVolumeSource", "k8s.io/api/core/v1.HostPathVolumeSource", "k8s.io/api/core/v1.ISCSIVolumeSource", "k8s.io/api/core/v1.NFSVolumeSource", "k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource", "k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource", "k8s.io/api/core/v1.PortworxVolumeSource", "k8s.io/api/core/v1.ProjectedVolumeSource", "k8s.io/api/core/v1.QuobyteVolumeSource", "k8s.io/api/core/v1.RBDVolumeSource", "k8s.io/api/core/v1.ScaleIOVolumeSource", "k8s.io/api/core/v1.SecretVolumeSource", "k8s.io/api/core/v1.StorageOSVolumeSource", "k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource"}, - } -} - -func schema_k8sio_api_core_v1_VsphereVirtualDiskVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a vSphere volume resource.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "volumePath": { - SchemaProps: spec.SchemaProps{ - Description: "Path that identifies vSphere volume vmdk", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", - Type: []string{"string"}, - Format: "", - }, - }, - "storagePolicyName": { - SchemaProps: spec.SchemaProps{ - Description: "Storage Policy Based Management (SPBM) profile name.", - Type: []string{"string"}, - Format: "", - }, - }, - "storagePolicyID": { - SchemaProps: spec.SchemaProps{ - Description: "Storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"volumePath"}, - }, - }, - } -} - -func schema_k8sio_api_core_v1_WeightedPodAffinityTerm(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "weight": { - SchemaProps: spec.SchemaProps{ - Description: "weight associated with matching the corresponding podAffinityTerm, in the range 1-100.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "podAffinityTerm": { - SchemaProps: spec.SchemaProps{ - Description: "Required. A pod affinity term, associated with the corresponding weight.", - Ref: ref("k8s.io/api/core/v1.PodAffinityTerm"), - }, - }, - }, - Required: []string{"weight", "podAffinityTerm"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PodAffinityTerm"}, - } -} - -func schema_k8sio_api_core_v1_WindowsSecurityContextOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "WindowsSecurityContextOptions contain Windows-specific options and credentials.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "gmsaCredentialSpecName": { - SchemaProps: spec.SchemaProps{ - Description: "GMSACredentialSpecName is the name of the GMSA credential spec to use. This field is alpha-level and is only honored by servers that enable the WindowsGMSA feature flag.", - Type: []string{"string"}, - Format: "", - }, - }, - "gmsaCredentialSpec": { - SchemaProps: spec.SchemaProps{ - Description: "GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. This field is alpha-level and is only honored by servers that enable the WindowsGMSA feature flag.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_apimachinery_pkg_api_resource_Quantity(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Quantity is a fixed-point representation of a number. It provides convenient marshaling/unmarshaling in JSON and YAML, in addition to String() and Int64() accessors.\n\nThe serialization format is:\n\n ::= \n (Note that may be empty, from the \"\" case in .)\n ::= 0 | 1 | ... | 9 ::= | ::= | . | . | . ::= \"+\" | \"-\" ::= | ::= | | ::= Ki | Mi | Gi | Ti | Pi | Ei\n (International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)\n ::= m | \"\" | k | M | G | T | P | E\n (Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\n ::= \"e\" | \"E\" \n\nNo matter which of the three exponent forms is used, no quantity may represent a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal places. Numbers larger or more precise will be capped or rounded up. (E.g.: 0.1m will rounded up to 1m.) This may be extended in the future if we require larger or smaller quantities.\n\nWhen a Quantity is parsed from a string, it will remember the type of suffix it had, and will use the same type again when it is serialized.\n\nBefore serializing, Quantity will be put in \"canonical form\". This means that Exponent/suffix will be adjusted up or down (with a corresponding increase or decrease in Mantissa) such that:\n a. No precision is lost\n b. No fractional digits will be emitted\n c. The exponent (or suffix) is as large as possible.\nThe sign will be omitted unless the number is negative.\n\nExamples:\n 1.5 will be serialized as \"1500m\"\n 1.5Gi will be serialized as \"1536Mi\"\n\nNote that the quantity will NEVER be internally represented by a floating point number. That is the whole point of this exercise.\n\nNon-canonical values will still parse as long as they are well formed, but will be re-emitted in their canonical form. (So always use canonical form, or don't diff.)\n\nThis format is intended to make it difficult to use these numbers without writing some sort of special handling code in the hopes that that will cause implementors to also use a fixed point implementation.", - Type: resource.Quantity{}.OpenAPISchemaType(), - Format: resource.Quantity{}.OpenAPISchemaFormat(), - }, - }, - } -} - -func schema_apimachinery_pkg_api_resource_int64Amount(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "int64Amount represents a fixed precision numerator and arbitrary scale exponent. It is faster than operations on inf.Dec for values that can be represented as int64.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "value": { - SchemaProps: spec.SchemaProps{ - Type: []string{"integer"}, - Format: "int64", - }, - }, - "scale": { - SchemaProps: spec.SchemaProps{ - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"value", "scale"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_APIGroup(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "APIGroup contains the name, the supported versions, and the preferred version of a group.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "name is the name of the group.", - Type: []string{"string"}, - Format: "", - }, - }, - "versions": { - SchemaProps: spec.SchemaProps{ - Description: "versions are the versions supported in this group.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery"), - }, - }, - }, - }, - }, - "preferredVersion": { - SchemaProps: spec.SchemaProps{ - Description: "preferredVersion is the version preferred by the API server, which probably is the storage version.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery"), - }, - }, - "serverAddressByClientCIDRs": { - SchemaProps: spec.SchemaProps{ - Description: "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR"), - }, - }, - }, - }, - }, - }, - Required: []string{"name", "versions"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery", "k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR"}, - } -} - -func schema_pkg_apis_meta_v1_APIGroupList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "APIGroupList is a list of APIGroup, to allow clients to discover the API at /apis.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "groups": { - SchemaProps: spec.SchemaProps{ - Description: "groups is a list of APIGroup.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup"), - }, - }, - }, - }, - }, - }, - Required: []string{"groups"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup"}, - } -} - -func schema_pkg_apis_meta_v1_APIResource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "APIResource specifies the name of a resource and whether it is namespaced.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "name is the plural name of the resource.", - Type: []string{"string"}, - Format: "", - }, - }, - "singularName": { - SchemaProps: spec.SchemaProps{ - Description: "singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface.", - Type: []string{"string"}, - Format: "", - }, - }, - "namespaced": { - SchemaProps: spec.SchemaProps{ - Description: "namespaced indicates if a resource is namespaced or not.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "group": { - SchemaProps: spec.SchemaProps{ - Description: "group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale\".", - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Description: "version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)\".", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')", - Type: []string{"string"}, - Format: "", - }, - }, - "verbs": { - SchemaProps: spec.SchemaProps{ - Description: "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "shortNames": { - SchemaProps: spec.SchemaProps{ - Description: "shortNames is a list of suggested short names of the resource.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "categories": { - SchemaProps: spec.SchemaProps{ - Description: "categories is a list of the grouped resources this resource belongs to (e.g. 'all')", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "storageVersionHash": { - SchemaProps: spec.SchemaProps{ - Description: "The hash value of the storage version, the version this resource is converted to when written to the data store. Value must be treated as opaque by clients. Only equality comparison on the value is valid. This is an alpha feature and may change or be removed in the future. The field is populated by the apiserver only if the StorageVersionHash feature gate is enabled. This field will remain optional even if it graduates.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name", "singularName", "namespaced", "kind", "verbs"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_APIResourceList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "groupVersion": { - SchemaProps: spec.SchemaProps{ - Description: "groupVersion is the group and version this APIResourceList is for.", - Type: []string{"string"}, - Format: "", - }, - }, - "resources": { - SchemaProps: spec.SchemaProps{ - Description: "resources contains the name of the resources and if they are namespaced.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.APIResource"), - }, - }, - }, - }, - }, - }, - Required: []string{"groupVersion", "resources"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.APIResource"}, - } -} - -func schema_pkg_apis_meta_v1_APIVersions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "APIVersions lists the versions that are available, to allow clients to discover the API at /api, which is the root path of the legacy v1 API.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "versions": { - SchemaProps: spec.SchemaProps{ - Description: "versions are the api versions that are available.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "serverAddressByClientCIDRs": { - SchemaProps: spec.SchemaProps{ - Description: "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR"), - }, - }, - }, - }, - }, - }, - Required: []string{"versions", "serverAddressByClientCIDRs"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR"}, - } -} - -func schema_pkg_apis_meta_v1_CreateOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CreateOptions may be provided when creating an API object.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "dryRun": { - SchemaProps: spec.SchemaProps{ - Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "fieldManager": { - SchemaProps: spec.SchemaProps{ - Description: "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_DeleteOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "DeleteOptions may be provided when deleting an API object.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "gracePeriodSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "preconditions": { - SchemaProps: spec.SchemaProps{ - Description: "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions"), - }, - }, - "orphanDependents": { - SchemaProps: spec.SchemaProps{ - Description: "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "propagationPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", - Type: []string{"string"}, - Format: "", - }, - }, - "dryRun": { - SchemaProps: spec.SchemaProps{ - Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions"}, - } -} - -func schema_pkg_apis_meta_v1_Duration(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Duration is a wrapper around time.Duration which supports correct marshaling to YAML and JSON. In particular, it marshals into strings, which can be used as map keys in json.", - Type: v1.Duration{}.OpenAPISchemaType(), - Format: v1.Duration{}.OpenAPISchemaFormat(), - }, - }, - } -} - -func schema_pkg_apis_meta_v1_ExportOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ExportOptions is the query options to the standard REST get call. Deprecated. Planned for removal in 1.18.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "export": { - SchemaProps: spec.SchemaProps{ - Description: "Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "exact": { - SchemaProps: spec.SchemaProps{ - Description: "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. Deprecated. Planned for removal in 1.18.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"export", "exact"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_Fields(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Fields stores a set of fields in a data structure like a Trie. To understand how this is used, see: https://github.com/kubernetes-sigs/structured-merge-diff", - Type: []string{"object"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GetOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GetOptions is the standard query options to the standard REST get call.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "resourceVersion": { - SchemaProps: spec.SchemaProps{ - Description: "When specified: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GroupKind(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GroupKind specifies a Group and a Kind, but does not force a version. This is useful for identifying concepts during lookup stages without having partially valid types", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "kind"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GroupResource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GroupResource specifies a Group and a Resource, but does not force a version. This is useful for identifying concepts during lookup stages without having partially valid types", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "resource": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "resource"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GroupVersion(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GroupVersion contains the \"group\" and the \"version\", which uniquely identifies the API.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "version"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GroupVersionForDiscovery(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensibility.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "groupVersion": { - SchemaProps: spec.SchemaProps{ - Description: "groupVersion specifies the API group and version in the form \"group/version\"", - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Description: "version specifies the version in the form of \"version\". This is to save the clients the trouble of splitting the GroupVersion.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"groupVersion", "version"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GroupVersionKind(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GroupVersionKind unambiguously identifies a kind. It doesn't anonymously include GroupVersion to avoid automatic coersion. It doesn't use a GroupVersion to avoid custom marshalling", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "version", "kind"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GroupVersionResource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GroupVersionResource unambiguously identifies a resource. It doesn't anonymously include GroupVersion to avoid automatic coersion. It doesn't use a GroupVersion to avoid custom marshalling", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "resource": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "version", "resource"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_Initializer(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Initializer is information about an initializer that has not yet completed.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "name of the process that is responsible for initializing this object.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_Initializers(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Initializers tracks the progress of initialization.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "pending": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Pending is a list of initializers that must execute in order before this object is visible. When the last pending initializer is removed, and no failing result is set, the initializers struct will be set to nil and the object is considered as initialized and visible to all clients.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Initializer"), - }, - }, - }, - }, - }, - "result": { - SchemaProps: spec.SchemaProps{ - Description: "If result is set with the Failure field, the object will be persisted to storage and then deleted, ensuring that other clients can observe the deletion.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Status"), - }, - }, - }, - Required: []string{"pending"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Initializer", "k8s.io/apimachinery/pkg/apis/meta/v1.Status"}, - } -} - -func schema_pkg_apis_meta_v1_InternalEvent(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "InternalEvent makes watch.Event versioned", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "Type": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "Object": { - SchemaProps: spec.SchemaProps{ - Description: "Object is:\n * If Type is Added or Modified: the new state of the object.\n * If Type is Deleted: the state of the object immediately before deletion.\n * If Type is Bookmark: the object (instance of a type being watched) where\n only ResourceVersion field is set. On successful restart of watch from a\n bookmark resourceVersion, client is guaranteed to not get repeat event\n nor miss any events.\n * If Type is Error: *api.Status is recommended; other types may make sense\n depending on context.", - Ref: ref("k8s.io/apimachinery/pkg/runtime.Object"), - }, - }, - }, - Required: []string{"Type", "Object"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/runtime.Object"}, - } -} - -func schema_pkg_apis_meta_v1_LabelSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "matchLabels": { - SchemaProps: spec.SchemaProps{ - Description: "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "matchExpressions": { - SchemaProps: spec.SchemaProps{ - Description: "matchExpressions is a list of label selector requirements. The requirements are ANDed.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement"}, - } -} - -func schema_pkg_apis_meta_v1_LabelSelectorRequirement(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "key": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "key", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "key is the label key that the selector applies to.", - Type: []string{"string"}, - Format: "", - }, - }, - "operator": { - SchemaProps: spec.SchemaProps{ - Description: "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.", - Type: []string{"string"}, - Format: "", - }, - }, - "values": { - SchemaProps: spec.SchemaProps{ - Description: "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"key", "operator"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_List(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "List holds a list of objects, which may not be known by the server.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of objects", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, - } -} - -func schema_pkg_apis_meta_v1_ListMeta(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "selfLink": { - SchemaProps: spec.SchemaProps{ - Description: "selfLink is a URL representing this object. Populated by the system. Read-only.", - Type: []string{"string"}, - Format: "", - }, - }, - "resourceVersion": { - SchemaProps: spec.SchemaProps{ - Description: "String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency", - Type: []string{"string"}, - Format: "", - }, - }, - "continue": { - SchemaProps: spec.SchemaProps{ - Description: "continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message.", - Type: []string{"string"}, - Format: "", - }, - }, - "remainingItemCount": { - SchemaProps: spec.SchemaProps{ - Description: "remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact.\n\nThis field is alpha and can be changed or removed without notice.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_ListOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ListOptions is the query options to a standard REST list call.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "labelSelector": { - SchemaProps: spec.SchemaProps{ - Description: "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - Type: []string{"string"}, - Format: "", - }, - }, - "fieldSelector": { - SchemaProps: spec.SchemaProps{ - Description: "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - Type: []string{"string"}, - Format: "", - }, - }, - "watch": { - SchemaProps: spec.SchemaProps{ - Description: "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "allowWatchBookmarks": { - SchemaProps: spec.SchemaProps{ - Description: "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored.\n\nThis field is alpha and can be changed or removed without notice.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "resourceVersion": { - SchemaProps: spec.SchemaProps{ - Description: "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - Type: []string{"string"}, - Format: "", - }, - }, - "timeoutSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "limit": { - SchemaProps: spec.SchemaProps{ - Description: "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "continue": { - SchemaProps: spec.SchemaProps{ - Description: "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_ManagedFieldsEntry(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource that the fieldset applies to.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "manager": { - SchemaProps: spec.SchemaProps{ - Description: "Manager is an identifier of the workflow managing these fields.", - Type: []string{"string"}, - Format: "", - }, - }, - "operation": { - SchemaProps: spec.SchemaProps{ - Description: "Operation is the type of operation which lead to this ManagedFieldsEntry being created. The only valid values for this field are 'Apply' and 'Update'.", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the version of this resource that this field set applies to. The format is \"group/version\" just like the top-level APIVersion field. It is necessary to track the version of a field set because it cannot be automatically converted.", - Type: []string{"string"}, - Format: "", - }, - }, - "time": { - SchemaProps: spec.SchemaProps{ - Description: "Time is timestamp of when these fields were set. It should always be empty if Operation is 'Apply'", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "fields": { - SchemaProps: spec.SchemaProps{ - Description: "Fields identifies a set of fields.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Fields"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Fields", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_pkg_apis_meta_v1_MicroTime(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "MicroTime is version of Time with microsecond level precision.", - Type: v1.MicroTime{}.OpenAPISchemaType(), - Format: v1.MicroTime{}.OpenAPISchemaFormat(), - }, - }, - } -} - -func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names", - Type: []string{"string"}, - Format: "", - }, - }, - "generateName": { - SchemaProps: spec.SchemaProps{ - Description: "GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency", - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Description: "Namespace defines the space within each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces", - Type: []string{"string"}, - Format: "", - }, - }, - "selfLink": { - SchemaProps: spec.SchemaProps{ - Description: "SelfLink is a URL representing this object. Populated by the system. Read-only.", - Type: []string{"string"}, - Format: "", - }, - }, - "uid": { - SchemaProps: spec.SchemaProps{ - Description: "UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids", - Type: []string{"string"}, - Format: "", - }, - }, - "resourceVersion": { - SchemaProps: spec.SchemaProps{ - Description: "An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency", - Type: []string{"string"}, - Format: "", - }, - }, - "generation": { - SchemaProps: spec.SchemaProps{ - Description: "A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "creationTimestamp": { - SchemaProps: spec.SchemaProps{ - Description: "CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "deletionTimestamp": { - SchemaProps: spec.SchemaProps{ - Description: "DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "deletionGracePeriodSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "labels": { - SchemaProps: spec.SchemaProps{ - Description: "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "annotations": { - SchemaProps: spec.SchemaProps{ - Description: "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "ownerReferences": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "uid", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference"), - }, - }, - }, - }, - }, - "initializers": { - SchemaProps: spec.SchemaProps{ - Description: "An initializer is a controller which enforces some system invariant at object creation time. This field is a list of initializers that have not yet acted on this object. If nil or empty, this object has been completely initialized. Otherwise, the object is considered uninitialized and is hidden (in list/watch and get calls) from clients that haven't explicitly asked to observe uninitialized objects.\n\nWhen an object is created, the system will populate this list with the current set of initializers. Only privileged users may set or modify this list. Once it is empty, it may not be modified further by any user.\n\nDEPRECATED - initializers are an alpha field and will be removed in v1.15.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Initializers"), - }, - }, - "finalizers": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "clusterName": { - SchemaProps: spec.SchemaProps{ - Description: "The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.", - Type: []string{"string"}, - Format: "", - }, - }, - "managedFields": { - SchemaProps: spec.SchemaProps{ - Description: "ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.\n\nThis field is alpha and can be changed or removed without notice.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Initializers", "k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry", "k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_pkg_apis_meta_v1_OwnerReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "OwnerReference contains enough information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "API version of the referent.", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names", - Type: []string{"string"}, - Format: "", - }, - }, - "uid": { - SchemaProps: spec.SchemaProps{ - Description: "UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids", - Type: []string{"string"}, - Format: "", - }, - }, - "controller": { - SchemaProps: spec.SchemaProps{ - Description: "If true, this reference points to the managing controller.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "blockOwnerDeletion": { - SchemaProps: spec.SchemaProps{ - Description: "If true, AND if the owner has the \"foregroundDeletion\" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. Defaults to false. To set this field, a user needs \"delete\" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"apiVersion", "kind", "name", "uid"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_PartialObjectMetadata(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PartialObjectMetadata is a generic representation of any object with ObjectMeta. It allows clients to get access to a particular ObjectMeta schema without knowing the details of the version.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_meta_v1_PartialObjectMetadataList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PartialObjectMetadataList contains a list of objects containing only their metadata", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "items contains each of the included items.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata"}, - } -} - -func schema_pkg_apis_meta_v1_Patch(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.", - Type: []string{"object"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_PatchOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PatchOptions may be provided when patching an API object. PatchOptions is meant to be a superset of UpdateOptions.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "dryRun": { - SchemaProps: spec.SchemaProps{ - Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "force": { - SchemaProps: spec.SchemaProps{ - Description: "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "fieldManager": { - SchemaProps: spec.SchemaProps{ - Description: "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_Preconditions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "uid": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies the target UID.", - Type: []string{"string"}, - Format: "", - }, - }, - "resourceVersion": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies the target ResourceVersion", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_RootPaths(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RootPaths lists the paths available at root. For example: \"/healthz\", \"/apis\".", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "paths": { - SchemaProps: spec.SchemaProps{ - Description: "paths are the paths available at root.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"paths"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_ServerAddressByClientCIDR(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "clientCIDR": { - SchemaProps: spec.SchemaProps{ - Description: "The CIDR with which clients can match their IP to figure out the server address that they should use.", - Type: []string{"string"}, - Format: "", - }, - }, - "serverAddress": { - SchemaProps: spec.SchemaProps{ - Description: "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"clientCIDR", "serverAddress"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_Status(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Status is a return value for calls that don't return other objects.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status of the operation. One of: \"Success\" or \"Failure\". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "A human-readable description of the status of this operation.", - Type: []string{"string"}, - Format: "", - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "A machine-readable description of why this operation is in the \"Failure\" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it.", - Type: []string{"string"}, - Format: "", - }, - }, - "details": { - SchemaProps: spec.SchemaProps{ - Description: "Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails"), - }, - }, - "code": { - SchemaProps: spec.SchemaProps{ - Description: "Suggested HTTP return code for this status, 0 if not set.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails"}, - } -} - -func schema_pkg_apis_meta_v1_StatusCause(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "A machine-readable description of the cause of the error. If this value is empty there is no information available.", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "A human-readable description of the cause of the error. This field may be presented as-is to a reader.", - Type: []string{"string"}, - Format: "", - }, - }, - "field": { - SchemaProps: spec.SchemaProps{ - Description: "The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.\n\nExamples:\n \"name\" - the field \"name\" on the current resource\n \"items[0].name\" - the field \"name\" on the first array entry in \"items\"", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_StatusDetails(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).", - Type: []string{"string"}, - Format: "", - }, - }, - "group": { - SchemaProps: spec.SchemaProps{ - Description: "The group attribute of the resource associated with the status StatusReason.", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "uid": { - SchemaProps: spec.SchemaProps{ - Description: "UID of the resource. (when there is a single resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids", - Type: []string{"string"}, - Format: "", - }, - }, - "causes": { - SchemaProps: spec.SchemaProps{ - Description: "The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause"), - }, - }, - }, - }, - }, - "retryAfterSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause"}, - } -} - -func schema_pkg_apis_meta_v1_Table(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Table is a tabular representation of a set of API resources. The server transforms the object into a set of preferred columns for quickly reviewing the objects.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "columnDefinitions": { - SchemaProps: spec.SchemaProps{ - Description: "columnDefinitions describes each column in the returned items array. The number of cells per row will always match the number of column definitions.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition"), - }, - }, - }, - }, - }, - "rows": { - SchemaProps: spec.SchemaProps{ - Description: "rows is the list of items in the table.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.TableRow"), - }, - }, - }, - }, - }, - }, - Required: []string{"columnDefinitions", "rows"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition", "k8s.io/apimachinery/pkg/apis/meta/v1.TableRow"}, - } -} - -func schema_pkg_apis_meta_v1_TableColumnDefinition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TableColumnDefinition contains information about a column returned in the Table.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "name is a human readable name for the column.", - Type: []string{"string"}, - Format: "", - }, - }, - "type": { - SchemaProps: spec.SchemaProps{ - Description: "type is an OpenAPI type definition for this column, such as number, integer, string, or array. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more.", - Type: []string{"string"}, - Format: "", - }, - }, - "format": { - SchemaProps: spec.SchemaProps{ - Description: "format is an optional OpenAPI type modifier for this column. A format modifies the type and imposes additional rules, like date or time formatting for a string. The 'name' format is applied to the primary identifier column which has type 'string' to assist in clients identifying column is the resource name. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more.", - Type: []string{"string"}, - Format: "", - }, - }, - "description": { - SchemaProps: spec.SchemaProps{ - Description: "description is a human readable description of this column.", - Type: []string{"string"}, - Format: "", - }, - }, - "priority": { - SchemaProps: spec.SchemaProps{ - Description: "priority is an integer defining the relative importance of this column compared to others. Lower numbers are considered higher priority. Columns that may be omitted in limited space scenarios should be given a higher priority.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"name", "type", "format", "description", "priority"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_TableOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TableOptions are used when a Table is requested by the caller.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "includeObject": { - SchemaProps: spec.SchemaProps{ - Description: "includeObject decides whether to include each object along with its columnar information. Specifying \"None\" will return no object, specifying \"Object\" will return the full object contents, and specifying \"Metadata\" (the default) will return the object's metadata in the PartialObjectMetadata kind in version v1beta1 of the meta.k8s.io API group.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_TableRow(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TableRow is an individual row in a table.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "cells": { - SchemaProps: spec.SchemaProps{ - Description: "cells will be as wide as the column definitions array and may contain strings, numbers (float64 or int64), booleans, simple maps, lists, or null. See the type field of the column definition for a more detailed description.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Format: "", - }, - }, - }, - }, - }, - "conditions": { - SchemaProps: spec.SchemaProps{ - Description: "conditions describe additional status of a row that are relevant for a human user. These conditions apply to the row, not to the object, and will be specific to table output. The only defined condition type is 'Completed', for a row that indicates a resource that has run to completion and can be given less visual priority.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition"), - }, - }, - }, - }, - }, - "object": { - SchemaProps: spec.SchemaProps{ - Description: "This field contains the requested additional information about each object based on the includeObject policy when requesting the Table. If \"None\", this field is empty, if \"Object\" this will be the default serialization of the object for the current API version, and if \"Metadata\" (the default) will contain the object metadata. Check the returned kind and apiVersion of the object before parsing. The media type of the object will always match the enclosing list - if this as a JSON table, these will be JSON encoded objects.", - Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), - }, - }, - }, - Required: []string{"cells"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, - } -} - -func schema_pkg_apis_meta_v1_TableRowCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TableRowCondition allows a row to be marked with additional information.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type of row condition. The only defined value is 'Completed' indicating that the object this row represents has reached a completed state and may be given less visual priority than other rows. Clients are not required to honor any conditions but should be consistent where possible about handling the conditions.", - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status of the condition, one of True, False, Unknown.", - Type: []string{"string"}, - Format: "", - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "(brief) machine readable reason for the condition's last transition.", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "Human readable message indicating details about last transition.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type", "status"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_Time(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.", - Type: v1.Time{}.OpenAPISchemaType(), - Format: v1.Time{}.OpenAPISchemaFormat(), - }, - }, - } -} - -func schema_pkg_apis_meta_v1_Timestamp(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Timestamp is a struct that is equivalent to Time, but intended for protobuf marshalling/unmarshalling. It is generated into a serialization that matches Time. Do not use in Go structs.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "seconds": { - SchemaProps: spec.SchemaProps{ - Description: "Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "nanos": { - SchemaProps: spec.SchemaProps{ - Description: "Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. This field may be limited in precision depending on context.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"seconds", "nanos"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_TypeMeta(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TypeMeta describes an individual object in an API response or request with strings representing the type of the object and its API schema version. Structures that are versioned or persisted should inline TypeMeta.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_UpdateOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "UpdateOptions may be provided when updating an API object. All fields in UpdateOptions should also be present in PatchOptions.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "dryRun": { - SchemaProps: spec.SchemaProps{ - Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "fieldManager": { - SchemaProps: spec.SchemaProps{ - Description: "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_WatchEvent(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Event represents a single event to a watched resource.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "object": { - SchemaProps: spec.SchemaProps{ - Description: "Object is:\n * If Type is Added or Modified: the new state of the object.\n * If Type is Deleted: the state of the object immediately before deletion.\n * If Type is Error: *Status is recommended; other types may make sense\n depending on context.", - Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), - }, - }, - }, - Required: []string{"type", "object"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/runtime.RawExtension"}, - } -} - -func schema_k8sio_apimachinery_pkg_runtime_RawExtension(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types.\n\n// Internal package: type MyAPIObject struct {\n\truntime.TypeMeta `json:\",inline\"`\n\tMyPlugin runtime.Object `json:\"myPlugin\"`\n} type PluginA struct {\n\tAOption string `json:\"aOption\"`\n}\n\n// External package: type MyAPIObject struct {\n\truntime.TypeMeta `json:\",inline\"`\n\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n} type PluginA struct {\n\tAOption string `json:\"aOption\"`\n}\n\n// On the wire, the JSON will look something like this: {\n\t\"kind\":\"MyAPIObject\",\n\t\"apiVersion\":\"v1\",\n\t\"myPlugin\": {\n\t\t\"kind\":\"PluginA\",\n\t\t\"aOption\":\"foo\",\n\t},\n}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.)", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "Raw": { - SchemaProps: spec.SchemaProps{ - Description: "Raw is the underlying serialization of this object.", - Type: []string{"string"}, - Format: "byte", - }, - }, - }, - Required: []string{"Raw"}, - }, - }, - } -} - -func schema_k8sio_apimachinery_pkg_runtime_TypeMeta(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TypeMeta is shared by all top level objects. The proper way to use it is to inline it in your type, like this: type MyAwesomeAPIObject struct {\n runtime.TypeMeta `json:\",inline\"`\n ... // other fields\n} func (obj *MyAwesomeAPIObject) SetGroupVersionKind(gvk *metav1.GroupVersionKind) { metav1.UpdateTypeMeta(obj,gvk) }; GroupVersionKind() *GroupVersionKind\n\nTypeMeta is provided here for convenience. You may use it directly from this package or define your own with the same fields.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_apimachinery_pkg_runtime_Unknown(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Unknown allows api objects with unknown types to be passed-through. This can be used to deal with the API objects from a plug-in. Unknown objects still have functioning TypeMeta features-- kind, version, etc. metadata and field mutatation.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "Raw": { - SchemaProps: spec.SchemaProps{ - Description: "Raw will hold the complete serialized object which couldn't be matched with a registered type. Most likely, nothing should be done with this except for passing it through the system.", - Type: []string{"string"}, - Format: "byte", - }, - }, - "ContentEncoding": { - SchemaProps: spec.SchemaProps{ - Description: "ContentEncoding is encoding used to encode 'Raw' data. Unspecified means no encoding.", - Type: []string{"string"}, - Format: "", - }, - }, - "ContentType": { - SchemaProps: spec.SchemaProps{ - Description: "ContentType is serialization method used to serialize 'Raw'. Unspecified means ContentTypeJSON.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"Raw", "ContentEncoding", "ContentType"}, - }, - }, - } -} - -func schema_apimachinery_pkg_util_intstr_IntOrString(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.", - Type: intstr.IntOrString{}.OpenAPISchemaType(), - Format: intstr.IntOrString{}.OpenAPISchemaFormat(), - }, - }, - } -} - -func schema_k8sio_apimachinery_pkg_version_Info(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Info contains versioning information. how we'll want to distribute that information.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "major": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "minor": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "gitVersion": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "gitCommit": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "gitTreeState": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "buildDate": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "goVersion": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "compiler": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "platform": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"major", "minor", "gitVersion", "gitCommit", "gitTreeState", "buildDate", "goVersion", "compiler", "platform"}, - }, - }, - } -} diff --git a/vendor/github.com/kubeflow/common/pkg/apis/common/v1/types.go b/vendor/github.com/kubeflow/common/pkg/apis/common/v1/types.go deleted file mode 100644 index 5158844..0000000 --- a/vendor/github.com/kubeflow/common/pkg/apis/common/v1/types.go +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright 2018 The Kubeflow Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -package v1 - -import ( - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +k8s:openapi-gen=true -// +k8s:deepcopy-gen=true -// JobStatus represents the current observed state of the training Job. -type JobStatus struct { - // Conditions is an array of current observed job conditions. - Conditions []JobCondition `json:"conditions"` - - // ReplicaStatuses is map of ReplicaType and ReplicaStatus, - // specifies the status of each replica. - ReplicaStatuses map[ReplicaType]*ReplicaStatus `json:"replicaStatuses"` - - // Represents time when the job was acknowledged by the job controller. - // It is not guaranteed to be set in happens-before order across separate operations. - // It is represented in RFC3339 form and is in UTC. - StartTime *metav1.Time `json:"startTime,omitempty"` - - // Represents time when the job was completed. It is not guaranteed to - // be set in happens-before order across separate operations. - // It is represented in RFC3339 form and is in UTC. - CompletionTime *metav1.Time `json:"completionTime,omitempty"` - - // Represents last time when the job was reconciled. It is not guaranteed to - // be set in happens-before order across separate operations. - // It is represented in RFC3339 form and is in UTC. - LastReconcileTime *metav1.Time `json:"lastReconcileTime,omitempty"` -} - -// +k8s:openapi-gen=true -// ReplicaType represents the type of the replica. Each operator needs to define its -// own set of ReplicaTypes. -type ReplicaType string - -// +k8s:openapi-gen=true -// ReplicaStatus represents the current observed state of the replica. -type ReplicaStatus struct { - // The number of actively running pods. - Active int32 `json:"active,omitempty"` - - // The number of pods which reached phase Succeeded. - Succeeded int32 `json:"succeeded,omitempty"` - - // The number of pods which reached phase Failed. - Failed int32 `json:"failed,omitempty"` -} - -// +k8s:openapi-gen=true -// +k8s:deepcopy-gen=true -// ReplicaSpec is a description of the replica -type ReplicaSpec struct { - // Replicas is the desired number of replicas of the given template. - // If unspecified, defaults to 1. - Replicas *int32 `json:"replicas,omitempty"` - - // Template is the object that describes the pod that - // will be created for this replica. RestartPolicy in PodTemplateSpec - // will be overide by RestartPolicy in ReplicaSpec - Template v1.PodTemplateSpec `json:"template,omitempty"` - - // Restart policy for all replicas within the job. - // One of Always, OnFailure, Never and ExitCode. - // Default to Never. - RestartPolicy RestartPolicy `json:"restartPolicy,omitempty"` -} - -// +k8s:openapi-gen=true -// +k8s:deepcopy-gen=true -// JobCondition describes the state of the job at a certain point. -type JobCondition struct { - // Type of job condition. - Type JobConditionType `json:"type"` - // Status of the condition, one of True, False, Unknown. - Status v1.ConditionStatus `json:"status"` - // The reason for the condition's last transition. - Reason string `json:"reason,omitempty"` - // A human readable message indicating details about the transition. - Message string `json:"message,omitempty"` - // The last time this condition was updated. - LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"` - // Last time the condition transitioned from one status to another. - LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` -} - -// +k8s:openapi-gen=true -// JobConditionType defines all kinds of types of JobStatus. -type JobConditionType string - -const ( - // JobCreated means the job has been accepted by the system, - // but one or more of the pods/services has not been started. - // This includes time before pods being scheduled and launched. - JobCreated JobConditionType = "Created" - - // JobRunning means all sub-resources (e.g. services/pods) of this job - // have been successfully scheduled and launched. - // The training is running without error. - JobRunning JobConditionType = "Running" - - // JobRestarting means one or more sub-resources (e.g. services/pods) of this job - // reached phase failed but maybe restarted according to it's restart policy - // which specified by user in v1.PodTemplateSpec. - // The training is freezing/pending. - JobRestarting JobConditionType = "Restarting" - - // JobSucceeded means all sub-resources (e.g. services/pods) of this job - // reached phase have terminated in success. - // The training is complete without error. - JobSucceeded JobConditionType = "Succeeded" - - // JobFailed means one or more sub-resources (e.g. services/pods) of this job - // reached phase failed with no restarting. - // The training has failed its execution. - JobFailed JobConditionType = "Failed" -) - -// +k8s:openapi-gen=true -// CleanPodPolicy describes how to deal with pods when the job is finished. -type CleanPodPolicy string - -const ( - CleanPodPolicyUndefined CleanPodPolicy = "" - CleanPodPolicyAll CleanPodPolicy = "All" - CleanPodPolicyRunning CleanPodPolicy = "Running" - CleanPodPolicyNone CleanPodPolicy = "None" -) - -// +k8s:openapi-gen=true -// RestartPolicy describes how the replicas should be restarted. -// Only one of the following restart policies may be specified. -// If none of the following policies is specified, the default one -// is RestartPolicyAlways. -type RestartPolicy string - -const ( - RestartPolicyAlways RestartPolicy = "Always" - RestartPolicyOnFailure RestartPolicy = "OnFailure" - RestartPolicyNever RestartPolicy = "Never" - - // RestartPolicyExitCode policy means that user should add exit code by themselves, - // The job operator will check these exit codes to - // determine the behavior when an error occurs: - // - 1-127: permanent error, do not restart. - // - 128-255: retryable error, will restart the pod. - RestartPolicyExitCode RestartPolicy = "ExitCode" -) - -// +k8s:openapi-gen=true -// +k8s:deepcopy-gen=true -// RunPolicy encapsulates various runtime policies of the distributed training -// job, for example how to clean up resources and how long the job can stay -// active. -type RunPolicy struct { - // CleanPodPolicy defines the policy to kill pods after the job completes. - // Default to Running. - CleanPodPolicy *CleanPodPolicy `json:"cleanPodPolicy,omitempty"` - - // TTLSecondsAfterFinished is the TTL to clean up jobs. - // It may take extra ReconcilePeriod seconds for the cleanup, since - // reconcile gets called periodically. - // Default to infinite. - TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"` - - // Specifies the duration in seconds relative to the startTime that the job may be active - // before the system tries to terminate it; value must be positive integer. - // +optional - ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"` - - // Optional number of retries before marking this job failed. - // +optional - BackoffLimit *int32 `json:"backoffLimit,omitempty"` - - // SchedulingPolicy defines the policy related to scheduling, e.g. gang-scheduling - // +optional - SchedulingPolicy *SchedulingPolicy `json:"schedulingPolicy,omitempty"` -} - -// +k8s:openapi-gen=true -// SchedulingPolicy encapsulates various scheduling policies of the distributed training -// job, for example `minAvailable` for gang-scheduling. -type SchedulingPolicy struct { - MinAvailable *int32 `json:"minAvailable,omitempty"` -} diff --git a/vendor/github.com/kubeflow/common/pkg/apis/common/v1/zz_generated.deepcopy.go b/vendor/github.com/kubeflow/common/pkg/apis/common/v1/zz_generated.deepcopy.go deleted file mode 100644 index bf7e6e1..0000000 --- a/vendor/github.com/kubeflow/common/pkg/apis/common/v1/zz_generated.deepcopy.go +++ /dev/null @@ -1,187 +0,0 @@ -// +build !ignore_autogenerated - -// Copyright 2020 The Kubeflow Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1 - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *JobCondition) DeepCopyInto(out *JobCondition) { - *out = *in - in.LastUpdateTime.DeepCopyInto(&out.LastUpdateTime) - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobCondition. -func (in *JobCondition) DeepCopy() *JobCondition { - if in == nil { - return nil - } - out := new(JobCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *JobStatus) DeepCopyInto(out *JobStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]JobCondition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.ReplicaStatuses != nil { - in, out := &in.ReplicaStatuses, &out.ReplicaStatuses - *out = make(map[ReplicaType]*ReplicaStatus, len(*in)) - for key, val := range *in { - var outVal *ReplicaStatus - if val == nil { - (*out)[key] = nil - } else { - in, out := &val, &outVal - *out = new(ReplicaStatus) - **out = **in - } - (*out)[key] = outVal - } - } - if in.StartTime != nil { - in, out := &in.StartTime, &out.StartTime - *out = (*in).DeepCopy() - } - if in.CompletionTime != nil { - in, out := &in.CompletionTime, &out.CompletionTime - *out = (*in).DeepCopy() - } - if in.LastReconcileTime != nil { - in, out := &in.LastReconcileTime, &out.LastReconcileTime - *out = (*in).DeepCopy() - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobStatus. -func (in *JobStatus) DeepCopy() *JobStatus { - if in == nil { - return nil - } - out := new(JobStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ReplicaSpec) DeepCopyInto(out *ReplicaSpec) { - *out = *in - if in.Replicas != nil { - in, out := &in.Replicas, &out.Replicas - *out = new(int32) - **out = **in - } - in.Template.DeepCopyInto(&out.Template) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaSpec. -func (in *ReplicaSpec) DeepCopy() *ReplicaSpec { - if in == nil { - return nil - } - out := new(ReplicaSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ReplicaStatus) DeepCopyInto(out *ReplicaStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaStatus. -func (in *ReplicaStatus) DeepCopy() *ReplicaStatus { - if in == nil { - return nil - } - out := new(ReplicaStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RunPolicy) DeepCopyInto(out *RunPolicy) { - *out = *in - if in.CleanPodPolicy != nil { - in, out := &in.CleanPodPolicy, &out.CleanPodPolicy - *out = new(CleanPodPolicy) - **out = **in - } - if in.TTLSecondsAfterFinished != nil { - in, out := &in.TTLSecondsAfterFinished, &out.TTLSecondsAfterFinished - *out = new(int32) - **out = **in - } - if in.ActiveDeadlineSeconds != nil { - in, out := &in.ActiveDeadlineSeconds, &out.ActiveDeadlineSeconds - *out = new(int64) - **out = **in - } - if in.BackoffLimit != nil { - in, out := &in.BackoffLimit, &out.BackoffLimit - *out = new(int32) - **out = **in - } - if in.SchedulingPolicy != nil { - in, out := &in.SchedulingPolicy, &out.SchedulingPolicy - *out = new(SchedulingPolicy) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RunPolicy. -func (in *RunPolicy) DeepCopy() *RunPolicy { - if in == nil { - return nil - } - out := new(RunPolicy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SchedulingPolicy) DeepCopyInto(out *SchedulingPolicy) { - *out = *in - if in.MinAvailable != nil { - in, out := &in.MinAvailable, &out.MinAvailable - *out = new(int32) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchedulingPolicy. -func (in *SchedulingPolicy) DeepCopy() *SchedulingPolicy { - if in == nil { - return nil - } - out := new(SchedulingPolicy) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/github.com/kubeflow/common/pkg/apis/common/v1/zz_generated.defaults.go b/vendor/github.com/kubeflow/common/pkg/apis/common/v1/zz_generated.defaults.go deleted file mode 100644 index adf92cc..0000000 --- a/vendor/github.com/kubeflow/common/pkg/apis/common/v1/zz_generated.defaults.go +++ /dev/null @@ -1,30 +0,0 @@ -// +build !ignore_autogenerated - -// Copyright 2020 The Kubeflow Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by defaulter-gen. DO NOT EDIT. - -package v1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// RegisterDefaults adds defaulters functions to the given scheme. -// Public to allow building arbitrary schemes. -// All generated defaulters are covering - they call all nested defaulters. -func RegisterDefaults(scheme *runtime.Scheme) error { - return nil -} diff --git a/vendor/github.com/mailru/easyjson/LICENSE b/vendor/github.com/mailru/easyjson/LICENSE deleted file mode 100644 index fbff658..0000000 --- a/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/vendor/github.com/mailru/easyjson/buffer/pool.go b/vendor/github.com/mailru/easyjson/buffer/pool.go deleted file mode 100644 index 07fb4bc..0000000 --- a/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/vendor/github.com/mailru/easyjson/jlexer/bytestostr.go b/vendor/github.com/mailru/easyjson/jlexer/bytestostr.go deleted file mode 100644 index ff7b27c..0000000 --- a/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/vendor/github.com/mailru/easyjson/jlexer/bytestostr_nounsafe.go b/vendor/github.com/mailru/easyjson/jlexer/bytestostr_nounsafe.go deleted file mode 100644 index 864d1be..0000000 --- a/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/vendor/github.com/mailru/easyjson/jlexer/error.go b/vendor/github.com/mailru/easyjson/jlexer/error.go deleted file mode 100644 index e90ec40..0000000 --- a/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/vendor/github.com/mailru/easyjson/jlexer/lexer.go b/vendor/github.com/mailru/easyjson/jlexer/lexer.go deleted file mode 100644 index ddd376b..0000000 --- a/vendor/github.com/mailru/easyjson/jlexer/lexer.go +++ /dev/null @@ -1,1182 +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) (isValid, 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 true, (delta > 0), (i - delta) - } - } - - return false, 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:] - - isValid, hasEscapes, length := findStringLen(data) - if !isValid { - r.pos += length - r.errParse("unterminated string literal") - return - } - 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 - - switch r.token.delimValue { - case '{': - start, end = '{', '}' - case '[': - start, end = '[', ']' - default: - 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))) - n, err := base64.StdEncoding.Decode(ret, r.token.byteValue) - if err != nil { - r.fatalError = &LexerError{ - Reason: err.Error(), - } - return nil - } - - r.consume() - return ret[:n] -} - -// 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) Float32Str() float32 { - s, b := r.unsafeString() - if !r.Ok() { - return 0 - } - n, err := strconv.ParseFloat(s, 32) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - 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) Float64Str() float64 { - s, b := r.unsafeString() - if !r.Ok() { - return 0 - } - n, err := strconv.ParseFloat(s, 64) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - 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("") - } - - switch r.token.kind { - case tokenString: - return json.Number(r.String()) - case tokenNumber: - return json.Number(r.Raw()) - case tokenNull: - r.Null() - return json.Number("") - default: - r.errSyntax() - return json.Number("") - } -} - -// 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() - - 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/vendor/github.com/mailru/easyjson/jwriter/writer.go b/vendor/github.com/mailru/easyjson/jwriter/writer.go deleted file mode 100644 index eb8547c..0000000 --- a/vendor/github.com/mailru/easyjson/jwriter/writer.go +++ /dev/null @@ -1,407 +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) Float32Str(n float32) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendFloat(w.Buffer.Buf, float64(n), 'g', -1, 32) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -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) Float64Str(n float64) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendFloat(w.Buffer.Buf, float64(n), 'g', -1, 64) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -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 getTable(falseValues ...int) [128]bool { - table := [128]bool{} - - for i := 0; i < 128; i++ { - table[i] = true - } - - for _, v := range falseValues { - table[v] = false - } - - return table -} - -var ( - htmlEscapeTable = getTable(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, '"', '&', '<', '>', '\\') - htmlNoEscapeTable = getTable(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, '"', '\\') -) - -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 - - var escapeTable [128]bool - if w.NoEscapeHTML { - escapeTable = htmlNoEscapeTable - } else { - escapeTable = htmlEscapeTable - } - - for i := 0; i < len(s); { - c := s[i] - - if c < utf8.RuneSelf { - if escapeTable[c] { - // single-width character, no escaping is required - i++ - continue - } - - 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/vendor/github.com/modern-go/concurrent/.gitignore b/vendor/github.com/modern-go/concurrent/.gitignore deleted file mode 100644 index 3f2bc47..0000000 --- a/vendor/github.com/modern-go/concurrent/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/coverage.txt diff --git a/vendor/github.com/modern-go/concurrent/.travis.yml b/vendor/github.com/modern-go/concurrent/.travis.yml deleted file mode 100644 index 449e67c..0000000 --- a/vendor/github.com/modern-go/concurrent/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: go - -go: - - 1.8.x - - 1.x - -before_install: - - go get -t -v ./... - -script: - - ./test.sh - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/vendor/github.com/modern-go/concurrent/README.md b/vendor/github.com/modern-go/concurrent/README.md deleted file mode 100644 index acab320..0000000 --- a/vendor/github.com/modern-go/concurrent/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# concurrent - -[![Sourcegraph](https://sourcegraph.com/github.com/modern-go/concurrent/-/badge.svg)](https://sourcegraph.com/github.com/modern-go/concurrent?badge) -[![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/modern-go/concurrent) -[![Build Status](https://travis-ci.org/modern-go/concurrent.svg?branch=master)](https://travis-ci.org/modern-go/concurrent) -[![codecov](https://codecov.io/gh/modern-go/concurrent/branch/master/graph/badge.svg)](https://codecov.io/gh/modern-go/concurrent) -[![rcard](https://goreportcard.com/badge/github.com/modern-go/concurrent)](https://goreportcard.com/report/github.com/modern-go/concurrent) -[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://raw.githubusercontent.com/modern-go/concurrent/master/LICENSE) - -* concurrent.Map: backport sync.Map for go below 1.9 -* concurrent.Executor: goroutine with explicit ownership and cancellable - -# concurrent.Map - -because sync.Map is only available in go 1.9, we can use concurrent.Map to make code portable - -```go -m := concurrent.NewMap() -m.Store("hello", "world") -elem, found := m.Load("hello") -// elem will be "world" -// found will be true -``` - -# concurrent.Executor - -```go -executor := concurrent.NewUnboundedExecutor() -executor.Go(func(ctx context.Context) { - everyMillisecond := time.NewTicker(time.Millisecond) - for { - select { - case <-ctx.Done(): - fmt.Println("goroutine exited") - return - case <-everyMillisecond.C: - // do something - } - } -}) -time.Sleep(time.Second) -executor.StopAndWaitForever() -fmt.Println("executor stopped") -``` - -attach goroutine to executor instance, so that we can - -* cancel it by stop the executor with Stop/StopAndWait/StopAndWaitForever -* handle panic by callback: the default behavior will no longer crash your application \ No newline at end of file diff --git a/vendor/github.com/modern-go/concurrent/test.sh b/vendor/github.com/modern-go/concurrent/test.sh deleted file mode 100755 index d1e6b2e..0000000 --- a/vendor/github.com/modern-go/concurrent/test.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -set -e -echo "" > coverage.txt - -for d in $(go list ./... | grep -v vendor); do - go test -coverprofile=profile.out -coverpkg=github.com/modern-go/concurrent $d - if [ -f profile.out ]; then - cat profile.out >> coverage.txt - rm profile.out - fi -done diff --git a/vendor/github.com/modern-go/reflect2/.gitignore b/vendor/github.com/modern-go/reflect2/.gitignore deleted file mode 100644 index 7b26c94..0000000 --- a/vendor/github.com/modern-go/reflect2/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/vendor -/coverage.txt diff --git a/vendor/github.com/modern-go/reflect2/.travis.yml b/vendor/github.com/modern-go/reflect2/.travis.yml deleted file mode 100644 index fbb4374..0000000 --- a/vendor/github.com/modern-go/reflect2/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: go - -go: - - 1.8.x - - 1.x - -before_install: - - go get -t -v ./... - - go get -t -v github.com/modern-go/reflect2-tests/... - -script: - - ./test.sh - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/vendor/github.com/modern-go/reflect2/Gopkg.toml b/vendor/github.com/modern-go/reflect2/Gopkg.toml deleted file mode 100644 index 2f4f4db..0000000 --- a/vendor/github.com/modern-go/reflect2/Gopkg.toml +++ /dev/null @@ -1,35 +0,0 @@ -# Gopkg.toml example -# -# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html -# for detailed Gopkg.toml documentation. -# -# required = ["github.com/user/thing/cmd/thing"] -# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] -# -# [[constraint]] -# name = "github.com/user/project" -# version = "1.0.0" -# -# [[constraint]] -# name = "github.com/user/project2" -# branch = "dev" -# source = "github.com/myfork/project2" -# -# [[override]] -# name = "github.com/x/y" -# version = "2.4.0" -# -# [prune] -# non-go = false -# go-tests = true -# unused-packages = true - -ignored = [] - -[[constraint]] - name = "github.com/modern-go/concurrent" - version = "1.0.0" - -[prune] - go-tests = true - unused-packages = true diff --git a/vendor/github.com/modern-go/reflect2/README.md b/vendor/github.com/modern-go/reflect2/README.md deleted file mode 100644 index 6f968aa..0000000 --- a/vendor/github.com/modern-go/reflect2/README.md +++ /dev/null @@ -1,71 +0,0 @@ -# reflect2 - -[![Sourcegraph](https://sourcegraph.com/github.com/modern-go/reflect2/-/badge.svg)](https://sourcegraph.com/github.com/modern-go/reflect2?badge) -[![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/modern-go/reflect2) -[![Build Status](https://travis-ci.org/modern-go/reflect2.svg?branch=master)](https://travis-ci.org/modern-go/reflect2) -[![codecov](https://codecov.io/gh/modern-go/reflect2/branch/master/graph/badge.svg)](https://codecov.io/gh/modern-go/reflect2) -[![rcard](https://goreportcard.com/badge/github.com/modern-go/reflect2)](https://goreportcard.com/report/github.com/modern-go/reflect2) -[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://raw.githubusercontent.com/modern-go/reflect2/master/LICENSE) - -reflect api that avoids runtime reflect.Value cost - -* reflect get/set interface{}, with type checking -* reflect get/set unsafe.Pointer, without type checking -* `reflect2.TypeByName` works like `Class.forName` found in java - -[json-iterator](https://github.com/json-iterator/go) use this package to save runtime dispatching cost. -This package is designed for low level libraries to optimize reflection performance. -General application should still use reflect standard library. - -# reflect2.TypeByName - -```go -// given package is github.com/your/awesome-package -type MyStruct struct { - // ... -} - -// will return the type -reflect2.TypeByName("awesome-package.MyStruct") -// however, if the type has not been used -// it will be eliminated by compiler, so we can not get it in runtime -``` - -# reflect2 get/set interface{} - -```go -valType := reflect2.TypeOf(1) -i := 1 -j := 10 -valType.Set(&i, &j) -// i will be 10 -``` - -to get set `type`, always use its pointer `*type` - -# reflect2 get/set unsafe.Pointer - -```go -valType := reflect2.TypeOf(1) -i := 1 -j := 10 -valType.UnsafeSet(unsafe.Pointer(&i), unsafe.Pointer(&j)) -// i will be 10 -``` - -to get set `type`, always use its pointer `*type` - -# benchmark - -Benchmark is not necessary for this package. It does nothing actually. -As it is just a thin wrapper to make go runtime public. -Both `reflect2` and `reflect` call same function -provided by `runtime` package exposed by go language. - -# unsafe safety - -Instead of casting `[]byte` to `sliceHeader` in your application using unsafe. -We can use reflect2 instead. This way, if `sliceHeader` changes in the future, -only reflect2 need to be upgraded. - -reflect2 tries its best to keep the implementation same as reflect (by testing). \ No newline at end of file diff --git a/vendor/github.com/modern-go/reflect2/test.sh b/vendor/github.com/modern-go/reflect2/test.sh deleted file mode 100755 index 3d2b976..0000000 --- a/vendor/github.com/modern-go/reflect2/test.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -set -e -echo "" > coverage.txt - -for d in $(go list github.com/modern-go/reflect2-tests/... | grep -v vendor); do - go test -coverprofile=profile.out -coverpkg=github.com/modern-go/reflect2 $d - if [ -f profile.out ]; then - cat profile.out >> coverage.txt - rm profile.out - fi -done diff --git a/vendor/github.com/modern-go/reflect2/type_map.go b/vendor/github.com/modern-go/reflect2/type_map.go index 6d48911..3acfb55 100644 --- a/vendor/github.com/modern-go/reflect2/type_map.go +++ b/vendor/github.com/modern-go/reflect2/type_map.go @@ -4,6 +4,7 @@ import ( "reflect" "runtime" "strings" + "sync" "unsafe" ) @@ -15,10 +16,17 @@ func typelinks1() [][]unsafe.Pointer //go:linkname typelinks2 reflect.typelinks func typelinks2() (sections []unsafe.Pointer, offset [][]int32) -var types = map[string]reflect.Type{} -var packages = map[string]map[string]reflect.Type{} +// initOnce guards initialization of types and packages +var initOnce sync.Once + +var types map[string]reflect.Type +var packages map[string]map[string]reflect.Type + +// discoverTypes initializes types and packages +func discoverTypes() { + types = make(map[string]reflect.Type) + packages = make(map[string]map[string]reflect.Type) -func init() { ver := runtime.Version() if ver == "go1.5" || strings.HasPrefix(ver, "go1.5.") { loadGo15Types() @@ -90,11 +98,13 @@ type emptyInterface struct { // TypeByName return the type by its name, just like Class.forName in java func TypeByName(typeName string) Type { + initOnce.Do(discoverTypes) return Type2(types[typeName]) } // TypeByPackageName return the type by its package and name func TypeByPackageName(pkgPath string, name string) Type { + initOnce.Do(discoverTypes) pkgTypes := packages[pkgPath] if pkgTypes == nil { return nil diff --git a/vendor/github.com/pkg/errors/.gitignore b/vendor/github.com/pkg/errors/.gitignore deleted file mode 100644 index daf913b..0000000 --- a/vendor/github.com/pkg/errors/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof diff --git a/vendor/github.com/pkg/errors/.travis.yml b/vendor/github.com/pkg/errors/.travis.yml deleted file mode 100644 index 9159de0..0000000 --- a/vendor/github.com/pkg/errors/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: go -go_import_path: github.com/pkg/errors -go: - - 1.11.x - - 1.12.x - - 1.13.x - - tip - -script: - - make check diff --git a/vendor/github.com/pkg/errors/Makefile b/vendor/github.com/pkg/errors/Makefile deleted file mode 100644 index ce9d7cd..0000000 --- a/vendor/github.com/pkg/errors/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -PKGS := github.com/pkg/errors -SRCDIRS := $(shell go list -f '{{.Dir}}' $(PKGS)) -GO := go - -check: test vet gofmt misspell unconvert staticcheck ineffassign unparam - -test: - $(GO) test $(PKGS) - -vet: | test - $(GO) vet $(PKGS) - -staticcheck: - $(GO) get honnef.co/go/tools/cmd/staticcheck - staticcheck -checks all $(PKGS) - -misspell: - $(GO) get github.com/client9/misspell/cmd/misspell - misspell \ - -locale GB \ - -error \ - *.md *.go - -unconvert: - $(GO) get github.com/mdempsky/unconvert - unconvert -v $(PKGS) - -ineffassign: - $(GO) get github.com/gordonklaus/ineffassign - find $(SRCDIRS) -name '*.go' | xargs ineffassign - -pedantic: check errcheck - -unparam: - $(GO) get mvdan.cc/unparam - unparam ./... - -errcheck: - $(GO) get github.com/kisielk/errcheck - errcheck $(PKGS) - -gofmt: - @echo Checking code is gofmted - @test -z "$(shell gofmt -s -l -d -e $(SRCDIRS) | tee /dev/stderr)" diff --git a/vendor/github.com/pkg/errors/README.md b/vendor/github.com/pkg/errors/README.md deleted file mode 100644 index 54dfdcb..0000000 --- a/vendor/github.com/pkg/errors/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# errors [![Travis-CI](https://travis-ci.org/pkg/errors.svg)](https://travis-ci.org/pkg/errors) [![AppVeyor](https://ci.appveyor.com/api/projects/status/b98mptawhudj53ep/branch/master?svg=true)](https://ci.appveyor.com/project/davecheney/errors/branch/master) [![GoDoc](https://godoc.org/github.com/pkg/errors?status.svg)](http://godoc.org/github.com/pkg/errors) [![Report card](https://goreportcard.com/badge/github.com/pkg/errors)](https://goreportcard.com/report/github.com/pkg/errors) [![Sourcegraph](https://sourcegraph.com/github.com/pkg/errors/-/badge.svg)](https://sourcegraph.com/github.com/pkg/errors?badge) - -Package errors provides simple error handling primitives. - -`go get github.com/pkg/errors` - -The traditional error handling idiom in Go is roughly akin to -```go -if err != nil { - return err -} -``` -which applied recursively up the call stack results in error reports without context or debugging information. The errors package allows programmers to add context to the failure path in their code in a way that does not destroy the original value of the error. - -## Adding context to an error - -The errors.Wrap function returns a new error that adds context to the original error. For example -```go -_, err := ioutil.ReadAll(r) -if err != nil { - return errors.Wrap(err, "read failed") -} -``` -## Retrieving the cause of an error - -Using `errors.Wrap` constructs a stack of errors, adding context to the preceding error. Depending on the nature of the error it may be necessary to reverse the operation of errors.Wrap to retrieve the original error for inspection. Any error value which implements this interface can be inspected by `errors.Cause`. -```go -type causer interface { - Cause() error -} -``` -`errors.Cause` will recursively retrieve the topmost error which does not implement `causer`, which is assumed to be the original cause. For example: -```go -switch err := errors.Cause(err).(type) { -case *MyError: - // handle specifically -default: - // unknown error -} -``` - -[Read the package documentation for more information](https://godoc.org/github.com/pkg/errors). - -## Roadmap - -With the upcoming [Go2 error proposals](https://go.googlesource.com/proposal/+/master/design/go2draft.md) this package is moving into maintenance mode. The roadmap for a 1.0 release is as follows: - -- 0.9. Remove pre Go 1.9 and Go 1.10 support, address outstanding pull requests (if possible) -- 1.0. Final release. - -## Contributing - -Because of the Go2 errors changes, this package is not accepting proposals for new functionality. With that said, we welcome pull requests, bug fixes and issue reports. - -Before sending a PR, please discuss your change by raising an issue. - -## License - -BSD-2-Clause diff --git a/vendor/github.com/pkg/errors/appveyor.yml b/vendor/github.com/pkg/errors/appveyor.yml deleted file mode 100644 index a932ead..0000000 --- a/vendor/github.com/pkg/errors/appveyor.yml +++ /dev/null @@ -1,32 +0,0 @@ -version: build-{build}.{branch} - -clone_folder: C:\gopath\src\github.com\pkg\errors -shallow_clone: true # for startup speed - -environment: - GOPATH: C:\gopath - -platform: - - x64 - -# http://www.appveyor.com/docs/installed-software -install: - # some helpful output for debugging builds - - go version - - go env - # pre-installed MinGW at C:\MinGW is 32bit only - # but MSYS2 at C:\msys64 has mingw64 - - set PATH=C:\msys64\mingw64\bin;%PATH% - - gcc --version - - g++ --version - -build_script: - - go install -v ./... - -test_script: - - set PATH=C:\gopath\bin;%PATH% - - go test -v ./... - -#artifacts: -# - path: '%GOPATH%\bin\*.exe' -deploy: off diff --git a/vendor/github.com/sirupsen/logrus/.gitignore b/vendor/github.com/sirupsen/logrus/.gitignore deleted file mode 100644 index 6b7d7d1..0000000 --- a/vendor/github.com/sirupsen/logrus/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -logrus -vendor diff --git a/vendor/github.com/sirupsen/logrus/.travis.yml b/vendor/github.com/sirupsen/logrus/.travis.yml deleted file mode 100644 index 848938a..0000000 --- a/vendor/github.com/sirupsen/logrus/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -language: go -go_import_path: github.com/sirupsen/logrus -git: - depth: 1 -env: - - GO111MODULE=on - - GO111MODULE=off -go: [ 1.11.x, 1.12.x ] -os: [ linux, osx ] -matrix: - exclude: - - go: 1.12.x - env: GO111MODULE=off - - go: 1.11.x - os: osx -install: - - ./travis/install.sh - - if [[ "$GO111MODULE" == "on" ]]; then go mod download; fi - - if [[ "$GO111MODULE" == "off" ]]; then go get github.com/stretchr/testify/assert golang.org/x/sys/unix github.com/konsorten/go-windows-terminal-sequences; fi -script: - - ./travis/cross_build.sh - - export GOMAXPROCS=4 - - export GORACE=halt_on_error=1 - - go test -race -v ./... - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then go test -race -v -tags appengine ./... ; fi diff --git a/vendor/github.com/sirupsen/logrus/CHANGELOG.md b/vendor/github.com/sirupsen/logrus/CHANGELOG.md deleted file mode 100644 index 51a7ab0..0000000 --- a/vendor/github.com/sirupsen/logrus/CHANGELOG.md +++ /dev/null @@ -1,200 +0,0 @@ -# 1.4.2 - * Fixes build break for plan9, nacl, solaris -# 1.4.1 -This new release introduces: - * Enhance TextFormatter to not print caller information when they are empty (#944) - * Remove dependency on golang.org/x/crypto (#932, #943) - -Fixes: - * Fix Entry.WithContext method to return a copy of the initial entry (#941) - -# 1.4.0 -This new release introduces: - * Add `DeferExitHandler`, similar to `RegisterExitHandler` but prepending the handler to the list of handlers (semantically like `defer`) (#848). - * Add `CallerPrettyfier` to `JSONFormatter` and `TextFormatter (#909, #911) - * Add `Entry.WithContext()` and `Entry.Context`, to set a context on entries to be used e.g. in hooks (#919). - -Fixes: - * Fix wrong method calls `Logger.Print` and `Logger.Warningln` (#893). - * Update `Entry.Logf` to not do string formatting unless the log level is enabled (#903) - * Fix infinite recursion on unknown `Level.String()` (#907) - * Fix race condition in `getCaller` (#916). - - -# 1.3.0 -This new release introduces: - * Log, Logf, Logln functions for Logger and Entry that take a Level - -Fixes: - * Building prometheus node_exporter on AIX (#840) - * Race condition in TextFormatter (#468) - * Travis CI import path (#868) - * Remove coloured output on Windows (#862) - * Pointer to func as field in JSONFormatter (#870) - * Properly marshal Levels (#873) - -# 1.2.0 -This new release introduces: - * A new method `SetReportCaller` in the `Logger` to enable the file, line and calling function from which the trace has been issued - * A new trace level named `Trace` whose level is below `Debug` - * A configurable exit function to be called upon a Fatal trace - * The `Level` object now implements `encoding.TextUnmarshaler` interface - -# 1.1.1 -This is a bug fix release. - * fix the build break on Solaris - * don't drop a whole trace in JSONFormatter when a field param is a function pointer which can not be serialized - -# 1.1.0 -This new release introduces: - * several fixes: - * a fix for a race condition on entry formatting - * proper cleanup of previously used entries before putting them back in the pool - * the extra new line at the end of message in text formatter has been removed - * a new global public API to check if a level is activated: IsLevelEnabled - * the following methods have been added to the Logger object - * IsLevelEnabled - * SetFormatter - * SetOutput - * ReplaceHooks - * introduction of go module - * an indent configuration for the json formatter - * output colour support for windows - * the field sort function is now configurable for text formatter - * the CLICOLOR and CLICOLOR\_FORCE environment variable support in text formater - -# 1.0.6 - -This new release introduces: - * a new api WithTime which allows to easily force the time of the log entry - which is mostly useful for logger wrapper - * a fix reverting the immutability of the entry given as parameter to the hooks - a new configuration field of the json formatter in order to put all the fields - in a nested dictionnary - * a new SetOutput method in the Logger - * a new configuration of the textformatter to configure the name of the default keys - * a new configuration of the text formatter to disable the level truncation - -# 1.0.5 - -* Fix hooks race (#707) -* Fix panic deadlock (#695) - -# 1.0.4 - -* Fix race when adding hooks (#612) -* Fix terminal check in AppEngine (#635) - -# 1.0.3 - -* Replace example files with testable examples - -# 1.0.2 - -* bug: quote non-string values in text formatter (#583) -* Make (*Logger) SetLevel a public method - -# 1.0.1 - -* bug: fix escaping in text formatter (#575) - -# 1.0.0 - -* Officially changed name to lower-case -* bug: colors on Windows 10 (#541) -* bug: fix race in accessing level (#512) - -# 0.11.5 - -* feature: add writer and writerlevel to entry (#372) - -# 0.11.4 - -* bug: fix undefined variable on solaris (#493) - -# 0.11.3 - -* formatter: configure quoting of empty values (#484) -* formatter: configure quoting character (default is `"`) (#484) -* bug: fix not importing io correctly in non-linux environments (#481) - -# 0.11.2 - -* bug: fix windows terminal detection (#476) - -# 0.11.1 - -* bug: fix tty detection with custom out (#471) - -# 0.11.0 - -* performance: Use bufferpool to allocate (#370) -* terminal: terminal detection for app-engine (#343) -* feature: exit handler (#375) - -# 0.10.0 - -* feature: Add a test hook (#180) -* feature: `ParseLevel` is now case-insensitive (#326) -* feature: `FieldLogger` interface that generalizes `Logger` and `Entry` (#308) -* performance: avoid re-allocations on `WithFields` (#335) - -# 0.9.0 - -* logrus/text_formatter: don't emit empty msg -* logrus/hooks/airbrake: move out of main repository -* logrus/hooks/sentry: move out of main repository -* logrus/hooks/papertrail: move out of main repository -* logrus/hooks/bugsnag: move out of main repository -* logrus/core: run tests with `-race` -* logrus/core: detect TTY based on `stderr` -* logrus/core: support `WithError` on logger -* logrus/core: Solaris support - -# 0.8.7 - -* logrus/core: fix possible race (#216) -* logrus/doc: small typo fixes and doc improvements - - -# 0.8.6 - -* hooks/raven: allow passing an initialized client - -# 0.8.5 - -* logrus/core: revert #208 - -# 0.8.4 - -* formatter/text: fix data race (#218) - -# 0.8.3 - -* logrus/core: fix entry log level (#208) -* logrus/core: improve performance of text formatter by 40% -* logrus/core: expose `LevelHooks` type -* logrus/core: add support for DragonflyBSD and NetBSD -* formatter/text: print structs more verbosely - -# 0.8.2 - -* logrus: fix more Fatal family functions - -# 0.8.1 - -* logrus: fix not exiting on `Fatalf` and `Fatalln` - -# 0.8.0 - -* logrus: defaults to stderr instead of stdout -* hooks/sentry: add special field for `*http.Request` -* formatter/text: ignore Windows for colors - -# 0.7.3 - -* formatter/\*: allow configuration of timestamp layout - -# 0.7.2 - -* formatter/text: Add configuration option for time format (#158) diff --git a/vendor/github.com/sirupsen/logrus/README.md b/vendor/github.com/sirupsen/logrus/README.md deleted file mode 100644 index a4796eb..0000000 --- a/vendor/github.com/sirupsen/logrus/README.md +++ /dev/null @@ -1,495 +0,0 @@ -# Logrus :walrus: [![Build Status](https://travis-ci.org/sirupsen/logrus.svg?branch=master)](https://travis-ci.org/sirupsen/logrus) [![GoDoc](https://godoc.org/github.com/sirupsen/logrus?status.svg)](https://godoc.org/github.com/sirupsen/logrus) - -Logrus is a structured logger for Go (golang), completely API compatible with -the standard library logger. - -**Seeing weird case-sensitive problems?** It's in the past been possible to -import Logrus as both upper- and lower-case. Due to the Go package environment, -this caused issues in the community and we needed a standard. Some environments -experienced problems with the upper-case variant, so the lower-case was decided. -Everything using `logrus` will need to use the lower-case: -`github.com/sirupsen/logrus`. Any package that isn't, should be changed. - -To fix Glide, see [these -comments](https://github.com/sirupsen/logrus/issues/553#issuecomment-306591437). -For an in-depth explanation of the casing issue, see [this -comment](https://github.com/sirupsen/logrus/issues/570#issuecomment-313933276). - -**Are you interested in assisting in maintaining Logrus?** Currently I have a -lot of obligations, and I am unable to provide Logrus with the maintainership it -needs. If you'd like to help, please reach out to me at `simon at author's -username dot com`. - -Nicely color-coded in development (when a TTY is attached, otherwise just -plain text): - -![Colored](http://i.imgur.com/PY7qMwd.png) - -With `log.SetFormatter(&log.JSONFormatter{})`, for easy parsing by logstash -or Splunk: - -```json -{"animal":"walrus","level":"info","msg":"A group of walrus emerges from the -ocean","size":10,"time":"2014-03-10 19:57:38.562264131 -0400 EDT"} - -{"level":"warning","msg":"The group's number increased tremendously!", -"number":122,"omg":true,"time":"2014-03-10 19:57:38.562471297 -0400 EDT"} - -{"animal":"walrus","level":"info","msg":"A giant walrus appears!", -"size":10,"time":"2014-03-10 19:57:38.562500591 -0400 EDT"} - -{"animal":"walrus","level":"info","msg":"Tremendously sized cow enters the ocean.", -"size":9,"time":"2014-03-10 19:57:38.562527896 -0400 EDT"} - -{"level":"fatal","msg":"The ice breaks!","number":100,"omg":true, -"time":"2014-03-10 19:57:38.562543128 -0400 EDT"} -``` - -With the default `log.SetFormatter(&log.TextFormatter{})` when a TTY is not -attached, the output is compatible with the -[logfmt](http://godoc.org/github.com/kr/logfmt) format: - -```text -time="2015-03-26T01:27:38-04:00" level=debug msg="Started observing beach" animal=walrus number=8 -time="2015-03-26T01:27:38-04:00" level=info msg="A group of walrus emerges from the ocean" animal=walrus size=10 -time="2015-03-26T01:27:38-04:00" level=warning msg="The group's number increased tremendously!" number=122 omg=true -time="2015-03-26T01:27:38-04:00" level=debug msg="Temperature changes" temperature=-4 -time="2015-03-26T01:27:38-04:00" level=panic msg="It's over 9000!" animal=orca size=9009 -time="2015-03-26T01:27:38-04:00" level=fatal msg="The ice breaks!" err=&{0x2082280c0 map[animal:orca size:9009] 2015-03-26 01:27:38.441574009 -0400 EDT panic It's over 9000!} number=100 omg=true -``` -To ensure this behaviour even if a TTY is attached, set your formatter as follows: - -```go - log.SetFormatter(&log.TextFormatter{ - DisableColors: true, - FullTimestamp: true, - }) -``` - -#### Logging Method Name - -If you wish to add the calling method as a field, instruct the logger via: -```go -log.SetReportCaller(true) -``` -This adds the caller as 'method' like so: - -```json -{"animal":"penguin","level":"fatal","method":"github.com/sirupsen/arcticcreatures.migrate","msg":"a penguin swims by", -"time":"2014-03-10 19:57:38.562543129 -0400 EDT"} -``` - -```text -time="2015-03-26T01:27:38-04:00" level=fatal method=github.com/sirupsen/arcticcreatures.migrate msg="a penguin swims by" animal=penguin -``` -Note that this does add measurable overhead - the cost will depend on the version of Go, but is -between 20 and 40% in recent tests with 1.6 and 1.7. You can validate this in your -environment via benchmarks: -``` -go test -bench=.*CallerTracing -``` - - -#### Case-sensitivity - -The organization's name was changed to lower-case--and this will not be changed -back. If you are getting import conflicts due to case sensitivity, please use -the lower-case import: `github.com/sirupsen/logrus`. - -#### Example - -The simplest way to use Logrus is simply the package-level exported logger: - -```go -package main - -import ( - log "github.com/sirupsen/logrus" -) - -func main() { - log.WithFields(log.Fields{ - "animal": "walrus", - }).Info("A walrus appears") -} -``` - -Note that it's completely api-compatible with the stdlib logger, so you can -replace your `log` imports everywhere with `log "github.com/sirupsen/logrus"` -and you'll now have the flexibility of Logrus. You can customize it all you -want: - -```go -package main - -import ( - "os" - log "github.com/sirupsen/logrus" -) - -func init() { - // Log as JSON instead of the default ASCII formatter. - log.SetFormatter(&log.JSONFormatter{}) - - // Output to stdout instead of the default stderr - // Can be any io.Writer, see below for File example - log.SetOutput(os.Stdout) - - // Only log the warning severity or above. - log.SetLevel(log.WarnLevel) -} - -func main() { - log.WithFields(log.Fields{ - "animal": "walrus", - "size": 10, - }).Info("A group of walrus emerges from the ocean") - - log.WithFields(log.Fields{ - "omg": true, - "number": 122, - }).Warn("The group's number increased tremendously!") - - log.WithFields(log.Fields{ - "omg": true, - "number": 100, - }).Fatal("The ice breaks!") - - // A common pattern is to re-use fields between logging statements by re-using - // the logrus.Entry returned from WithFields() - contextLogger := log.WithFields(log.Fields{ - "common": "this is a common field", - "other": "I also should be logged always", - }) - - contextLogger.Info("I'll be logged with common and other field") - contextLogger.Info("Me too") -} -``` - -For more advanced usage such as logging to multiple locations from the same -application, you can also create an instance of the `logrus` Logger: - -```go -package main - -import ( - "os" - "github.com/sirupsen/logrus" -) - -// Create a new instance of the logger. You can have any number of instances. -var log = logrus.New() - -func main() { - // The API for setting attributes is a little different than the package level - // exported logger. See Godoc. - log.Out = os.Stdout - - // You could set this to any `io.Writer` such as a file - // file, err := os.OpenFile("logrus.log", os.O_CREATE|os.O_WRONLY, 0666) - // if err == nil { - // log.Out = file - // } else { - // log.Info("Failed to log to file, using default stderr") - // } - - log.WithFields(logrus.Fields{ - "animal": "walrus", - "size": 10, - }).Info("A group of walrus emerges from the ocean") -} -``` - -#### Fields - -Logrus encourages careful, structured logging through logging fields instead of -long, unparseable error messages. For example, instead of: `log.Fatalf("Failed -to send event %s to topic %s with key %d")`, you should log the much more -discoverable: - -```go -log.WithFields(log.Fields{ - "event": event, - "topic": topic, - "key": key, -}).Fatal("Failed to send event") -``` - -We've found this API forces you to think about logging in a way that produces -much more useful logging messages. We've been in countless situations where just -a single added field to a log statement that was already there would've saved us -hours. The `WithFields` call is optional. - -In general, with Logrus using any of the `printf`-family functions should be -seen as a hint you should add a field, however, you can still use the -`printf`-family functions with Logrus. - -#### Default Fields - -Often it's helpful to have fields _always_ attached to log statements in an -application or parts of one. For example, you may want to always log the -`request_id` and `user_ip` in the context of a request. Instead of writing -`log.WithFields(log.Fields{"request_id": request_id, "user_ip": user_ip})` on -every line, you can create a `logrus.Entry` to pass around instead: - -```go -requestLogger := log.WithFields(log.Fields{"request_id": request_id, "user_ip": user_ip}) -requestLogger.Info("something happened on that request") # will log request_id and user_ip -requestLogger.Warn("something not great happened") -``` - -#### Hooks - -You can add hooks for logging levels. For example to send errors to an exception -tracking service on `Error`, `Fatal` and `Panic`, info to StatsD or log to -multiple places simultaneously, e.g. syslog. - -Logrus comes with [built-in hooks](hooks/). Add those, or your custom hook, in -`init`: - -```go -import ( - log "github.com/sirupsen/logrus" - "gopkg.in/gemnasium/logrus-airbrake-hook.v2" // the package is named "airbrake" - logrus_syslog "github.com/sirupsen/logrus/hooks/syslog" - "log/syslog" -) - -func init() { - - // Use the Airbrake hook to report errors that have Error severity or above to - // an exception tracker. You can create custom hooks, see the Hooks section. - log.AddHook(airbrake.NewHook(123, "xyz", "production")) - - hook, err := logrus_syslog.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "") - if err != nil { - log.Error("Unable to connect to local syslog daemon") - } else { - log.AddHook(hook) - } -} -``` -Note: Syslog hook also support connecting to local syslog (Ex. "/dev/log" or "/var/run/syslog" or "/var/run/log"). For the detail, please check the [syslog hook README](hooks/syslog/README.md). - -A list of currently known of service hook can be found in this wiki [page](https://github.com/sirupsen/logrus/wiki/Hooks) - - -#### Level logging - -Logrus has seven logging levels: Trace, Debug, Info, Warning, Error, Fatal and Panic. - -```go -log.Trace("Something very low level.") -log.Debug("Useful debugging information.") -log.Info("Something noteworthy happened!") -log.Warn("You should probably take a look at this.") -log.Error("Something failed but I'm not quitting.") -// Calls os.Exit(1) after logging -log.Fatal("Bye.") -// Calls panic() after logging -log.Panic("I'm bailing.") -``` - -You can set the logging level on a `Logger`, then it will only log entries with -that severity or anything above it: - -```go -// Will log anything that is info or above (warn, error, fatal, panic). Default. -log.SetLevel(log.InfoLevel) -``` - -It may be useful to set `log.Level = logrus.DebugLevel` in a debug or verbose -environment if your application has that. - -#### Entries - -Besides the fields added with `WithField` or `WithFields` some fields are -automatically added to all logging events: - -1. `time`. The timestamp when the entry was created. -2. `msg`. The logging message passed to `{Info,Warn,Error,Fatal,Panic}` after - the `AddFields` call. E.g. `Failed to send event.` -3. `level`. The logging level. E.g. `info`. - -#### Environments - -Logrus has no notion of environment. - -If you wish for hooks and formatters to only be used in specific environments, -you should handle that yourself. For example, if your application has a global -variable `Environment`, which is a string representation of the environment you -could do: - -```go -import ( - log "github.com/sirupsen/logrus" -) - -init() { - // do something here to set environment depending on an environment variable - // or command-line flag - if Environment == "production" { - log.SetFormatter(&log.JSONFormatter{}) - } else { - // The TextFormatter is default, you don't actually have to do this. - log.SetFormatter(&log.TextFormatter{}) - } -} -``` - -This configuration is how `logrus` was intended to be used, but JSON in -production is mostly only useful if you do log aggregation with tools like -Splunk or Logstash. - -#### Formatters - -The built-in logging formatters are: - -* `logrus.TextFormatter`. Logs the event in colors if stdout is a tty, otherwise - without colors. - * *Note:* to force colored output when there is no TTY, set the `ForceColors` - field to `true`. To force no colored output even if there is a TTY set the - `DisableColors` field to `true`. For Windows, see - [github.com/mattn/go-colorable](https://github.com/mattn/go-colorable). - * When colors are enabled, levels are truncated to 4 characters by default. To disable - truncation set the `DisableLevelTruncation` field to `true`. - * All options are listed in the [generated docs](https://godoc.org/github.com/sirupsen/logrus#TextFormatter). -* `logrus.JSONFormatter`. Logs fields as JSON. - * All options are listed in the [generated docs](https://godoc.org/github.com/sirupsen/logrus#JSONFormatter). - -Third party logging formatters: - -* [`FluentdFormatter`](https://github.com/joonix/log). Formats entries that can be parsed by Kubernetes and Google Container Engine. -* [`GELF`](https://github.com/fabienm/go-logrus-formatters). Formats entries so they comply to Graylog's [GELF 1.1 specification](http://docs.graylog.org/en/2.4/pages/gelf.html). -* [`logstash`](https://github.com/bshuster-repo/logrus-logstash-hook). Logs fields as [Logstash](http://logstash.net) Events. -* [`prefixed`](https://github.com/x-cray/logrus-prefixed-formatter). Displays log entry source along with alternative layout. -* [`zalgo`](https://github.com/aybabtme/logzalgo). Invoking the P͉̫o̳̼̊w̖͈̰͎e̬͔̭͂r͚̼̹̲ ̫͓͉̳͈ō̠͕͖̚f̝͍̠ ͕̲̞͖͑Z̖̫̤̫ͪa͉̬͈̗l͖͎g̳̥o̰̥̅!̣͔̲̻͊̄ ̙̘̦̹̦. -* [`nested-logrus-formatter`](https://github.com/antonfisher/nested-logrus-formatter). Converts logrus fields to a nested structure. - -You can define your formatter by implementing the `Formatter` interface, -requiring a `Format` method. `Format` takes an `*Entry`. `entry.Data` is a -`Fields` type (`map[string]interface{}`) with all your fields as well as the -default ones (see Entries section above): - -```go -type MyJSONFormatter struct { -} - -log.SetFormatter(new(MyJSONFormatter)) - -func (f *MyJSONFormatter) Format(entry *Entry) ([]byte, error) { - // Note this doesn't include Time, Level and Message which are available on - // the Entry. Consult `godoc` on information about those fields or read the - // source of the official loggers. - serialized, err := json.Marshal(entry.Data) - if err != nil { - return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) - } - return append(serialized, '\n'), nil -} -``` - -#### Logger as an `io.Writer` - -Logrus can be transformed into an `io.Writer`. That writer is the end of an `io.Pipe` and it is your responsibility to close it. - -```go -w := logger.Writer() -defer w.Close() - -srv := http.Server{ - // create a stdlib log.Logger that writes to - // logrus.Logger. - ErrorLog: log.New(w, "", 0), -} -``` - -Each line written to that writer will be printed the usual way, using formatters -and hooks. The level for those entries is `info`. - -This means that we can override the standard library logger easily: - -```go -logger := logrus.New() -logger.Formatter = &logrus.JSONFormatter{} - -// Use logrus for standard log output -// Note that `log` here references stdlib's log -// Not logrus imported under the name `log`. -log.SetOutput(logger.Writer()) -``` - -#### Rotation - -Log rotation is not provided with Logrus. Log rotation should be done by an -external program (like `logrotate(8)`) that can compress and delete old log -entries. It should not be a feature of the application-level logger. - -#### Tools - -| Tool | Description | -| ---- | ----------- | -|[Logrus Mate](https://github.com/gogap/logrus_mate)|Logrus mate is a tool for Logrus to manage loggers, you can initial logger's level, hook and formatter by config file, the logger will generated with different config at different environment.| -|[Logrus Viper Helper](https://github.com/heirko/go-contrib/tree/master/logrusHelper)|An Helper around Logrus to wrap with spf13/Viper to load configuration with fangs! And to simplify Logrus configuration use some behavior of [Logrus Mate](https://github.com/gogap/logrus_mate). [sample](https://github.com/heirko/iris-contrib/blob/master/middleware/logrus-logger/example) | - -#### Testing - -Logrus has a built in facility for asserting the presence of log messages. This is implemented through the `test` hook and provides: - -* decorators for existing logger (`test.NewLocal` and `test.NewGlobal`) which basically just add the `test` hook -* a test logger (`test.NewNullLogger`) that just records log messages (and does not output any): - -```go -import( - "github.com/sirupsen/logrus" - "github.com/sirupsen/logrus/hooks/test" - "github.com/stretchr/testify/assert" - "testing" -) - -func TestSomething(t*testing.T){ - logger, hook := test.NewNullLogger() - logger.Error("Helloerror") - - assert.Equal(t, 1, len(hook.Entries)) - assert.Equal(t, logrus.ErrorLevel, hook.LastEntry().Level) - assert.Equal(t, "Helloerror", hook.LastEntry().Message) - - hook.Reset() - assert.Nil(t, hook.LastEntry()) -} -``` - -#### Fatal handlers - -Logrus can register one or more functions that will be called when any `fatal` -level message is logged. The registered handlers will be executed before -logrus performs a `os.Exit(1)`. This behavior may be helpful if callers need -to gracefully shutdown. Unlike a `panic("Something went wrong...")` call which can be intercepted with a deferred `recover` a call to `os.Exit(1)` can not be intercepted. - -``` -... -handler := func() { - // gracefully shutdown something... -} -logrus.RegisterExitHandler(handler) -... -``` - -#### Thread safety - -By default, Logger is protected by a mutex for concurrent writes. The mutex is held when calling hooks and writing logs. -If you are sure such locking is not needed, you can call logger.SetNoLock() to disable the locking. - -Situation when locking is not needed includes: - -* You have no hooks registered, or hooks calling is already thread-safe. - -* Writing to logger.Out is already thread-safe, for example: - - 1) logger.Out is protected by locks. - - 2) logger.Out is a os.File handler opened with `O_APPEND` flag, and every write is smaller than 4k. (This allow multi-thread/multi-process writing) - - (Refer to http://www.notthewizard.com/2014/06/17/are-files-appends-really-atomic/) diff --git a/vendor/github.com/sirupsen/logrus/appveyor.yml b/vendor/github.com/sirupsen/logrus/appveyor.yml deleted file mode 100644 index 96c2ce1..0000000 --- a/vendor/github.com/sirupsen/logrus/appveyor.yml +++ /dev/null @@ -1,14 +0,0 @@ -version: "{build}" -platform: x64 -clone_folder: c:\gopath\src\github.com\sirupsen\logrus -environment: - GOPATH: c:\gopath -branches: - only: - - master -install: - - set PATH=%GOPATH%\bin;c:\go\bin;%PATH% - - go version -build_script: - - go get -t - - go test diff --git a/vendor/github.com/sirupsen/logrus/entry.go b/vendor/github.com/sirupsen/logrus/entry.go index 63e2558..27b14bf 100644 --- a/vendor/github.com/sirupsen/logrus/entry.go +++ b/vendor/github.com/sirupsen/logrus/entry.go @@ -85,10 +85,15 @@ func NewEntry(logger *Logger) *Entry { } } +// Returns the bytes representation of this entry from the formatter. +func (entry *Entry) Bytes() ([]byte, error) { + return entry.Logger.Formatter.Format(entry) +} + // Returns the string representation from the reader and ultimately the // formatter. func (entry *Entry) String() (string, error) { - serialized, err := entry.Logger.Formatter.Format(entry) + serialized, err := entry.Bytes() if err != nil { return "", err } @@ -103,7 +108,11 @@ func (entry *Entry) WithError(err error) *Entry { // Add a context to the Entry. func (entry *Entry) WithContext(ctx context.Context) *Entry { - return &Entry{Logger: entry.Logger, Data: entry.Data, Time: entry.Time, err: entry.err, Context: ctx} + dataCopy := make(Fields, len(entry.Data)) + for k, v := range entry.Data { + dataCopy[k] = v + } + return &Entry{Logger: entry.Logger, Data: dataCopy, Time: entry.Time, err: entry.err, Context: ctx} } // Add a single field to the Entry. @@ -113,6 +122,8 @@ func (entry *Entry) WithField(key string, value interface{}) *Entry { // Add a map of fields to the Entry. func (entry *Entry) WithFields(fields Fields) *Entry { + entry.Logger.mu.Lock() + defer entry.Logger.mu.Unlock() data := make(Fields, len(entry.Data)+len(fields)) for k, v := range entry.Data { data[k] = v @@ -144,7 +155,11 @@ func (entry *Entry) WithFields(fields Fields) *Entry { // Overrides the time of the Entry. func (entry *Entry) WithTime(t time.Time) *Entry { - return &Entry{Logger: entry.Logger, Data: entry.Data, Time: t, err: entry.err, Context: entry.Context} + dataCopy := make(Fields, len(entry.Data)) + for k, v := range entry.Data { + dataCopy[k] = v + } + return &Entry{Logger: entry.Logger, Data: dataCopy, Time: t, err: entry.err, Context: entry.Context} } // getPackageName reduces a fully qualified function name to the package name @@ -165,15 +180,20 @@ func getPackageName(f string) string { // getCaller retrieves the name of the first non-logrus calling function func getCaller() *runtime.Frame { - // cache this package's fully-qualified name callerInitOnce.Do(func() { - pcs := make([]uintptr, 2) + pcs := make([]uintptr, maximumCallerDepth) _ = runtime.Callers(0, pcs) - logrusPackage = getPackageName(runtime.FuncForPC(pcs[1]).Name()) - // now that we have the cache, we can skip a minimum count of known-logrus functions - // XXX this is dubious, the number of frames may vary + // dynamic get the package name and the minimum caller depth + for i := 0; i < maximumCallerDepth; i++ { + funcName := runtime.FuncForPC(pcs[i]).Name() + if strings.Contains(funcName, "getCaller") { + logrusPackage = getPackageName(funcName) + break + } + } + minimumCallerDepth = knownLogrusFrames }) @@ -187,7 +207,7 @@ func getCaller() *runtime.Frame { // If the caller isn't part of this package, we're done if pkg != logrusPackage { - return &f + return &f //nolint:scopelint } } @@ -217,9 +237,11 @@ func (entry Entry) log(level Level, msg string) { entry.Level = level entry.Message = msg + entry.Logger.mu.Lock() if entry.Logger.ReportCaller { entry.Caller = getCaller() } + entry.Logger.mu.Unlock() entry.fireHooks() @@ -255,11 +277,10 @@ func (entry *Entry) write() { serialized, err := entry.Logger.Formatter.Format(entry) if err != nil { fmt.Fprintf(os.Stderr, "Failed to obtain reader, %v\n", err) - } else { - _, err = entry.Logger.Out.Write(serialized) - if err != nil { - fmt.Fprintf(os.Stderr, "Failed to write to log, %v\n", err) - } + return + } + if _, err = entry.Logger.Out.Write(serialized); err != nil { + fmt.Fprintf(os.Stderr, "Failed to write to log, %v\n", err) } } diff --git a/vendor/github.com/sirupsen/logrus/exported.go b/vendor/github.com/sirupsen/logrus/exported.go index 62fc2f2..42b04f6 100644 --- a/vendor/github.com/sirupsen/logrus/exported.go +++ b/vendor/github.com/sirupsen/logrus/exported.go @@ -80,7 +80,7 @@ func WithFields(fields Fields) *Entry { return std.WithFields(fields) } -// WithTime creats an entry from the standard logger and overrides the time of +// WithTime creates an entry from the standard logger and overrides the time of // logs generated with it. // // Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal diff --git a/vendor/github.com/sirupsen/logrus/go.mod b/vendor/github.com/sirupsen/logrus/go.mod deleted file mode 100644 index 12fdf98..0000000 --- a/vendor/github.com/sirupsen/logrus/go.mod +++ /dev/null @@ -1,10 +0,0 @@ -module github.com/sirupsen/logrus - -require ( - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/konsorten/go-windows-terminal-sequences v1.0.1 - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/stretchr/objx v0.1.1 // indirect - github.com/stretchr/testify v1.2.2 - golang.org/x/sys v0.0.0-20190422165155-953cdadca894 -) diff --git a/vendor/github.com/sirupsen/logrus/go.sum b/vendor/github.com/sirupsen/logrus/go.sum deleted file mode 100644 index 596c318..0000000 --- a/vendor/github.com/sirupsen/logrus/go.sum +++ /dev/null @@ -1,16 +0,0 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe h1:CHRGQ8V7OlCYtwaKPJi3iA7J+YdNKdo8j7nG5IgDhjs= -github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 h1:I6FyU15t786LL7oL/hn43zqTuEGr4PN7F4XJ1p4E3Y8= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/vendor/github.com/sirupsen/logrus/json_formatter.go b/vendor/github.com/sirupsen/logrus/json_formatter.go index 098a21a..ba7f237 100644 --- a/vendor/github.com/sirupsen/logrus/json_formatter.go +++ b/vendor/github.com/sirupsen/logrus/json_formatter.go @@ -28,6 +28,9 @@ type JSONFormatter struct { // DisableTimestamp allows disabling automatic timestamps in output DisableTimestamp bool + // DisableHTMLEscape allows disabling html escaping in output + DisableHTMLEscape bool + // DataKey allows users to put all the log entry parameters into a nested dictionary at a given key. DataKey string @@ -110,6 +113,7 @@ func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) { } encoder := json.NewEncoder(b) + encoder.SetEscapeHTML(!f.DisableHTMLEscape) if f.PrettyPrint { encoder.SetIndent("", " ") } diff --git a/vendor/github.com/sirupsen/logrus/logger.go b/vendor/github.com/sirupsen/logrus/logger.go index c0c0b1e..6fdda74 100644 --- a/vendor/github.com/sirupsen/logrus/logger.go +++ b/vendor/github.com/sirupsen/logrus/logger.go @@ -68,10 +68,10 @@ func (mw *MutexWrap) Disable() { // `Out` and `Hooks` directly on the default logger instance. You can also just // instantiate your own: // -// var log = &Logger{ +// var log = &logrus.Logger{ // Out: os.Stderr, -// Formatter: new(JSONFormatter), -// Hooks: make(LevelHooks), +// Formatter: new(logrus.JSONFormatter), +// Hooks: make(logrus.LevelHooks), // Level: logrus.DebugLevel, // } // @@ -100,8 +100,9 @@ func (logger *Logger) releaseEntry(entry *Entry) { logger.entryPool.Put(entry) } -// Adds a field to the log entry, note that it doesn't log until you call -// Debug, Print, Info, Warn, Error, Fatal or Panic. It only creates a log entry. +// WithField allocates a new entry and adds a field to it. +// Debug, Print, Info, Warn, Error, Fatal or Panic must be then applied to +// this new returned entry. // If you want multiple fields, use `WithFields`. func (logger *Logger) WithField(key string, value interface{}) *Entry { entry := logger.newEntry() diff --git a/vendor/github.com/sirupsen/logrus/logrus.go b/vendor/github.com/sirupsen/logrus/logrus.go index 8644761..2f16224 100644 --- a/vendor/github.com/sirupsen/logrus/logrus.go +++ b/vendor/github.com/sirupsen/logrus/logrus.go @@ -51,7 +51,7 @@ func (level *Level) UnmarshalText(text []byte) error { return err } - *level = Level(l) + *level = l return nil } diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_bsd.go b/vendor/github.com/sirupsen/logrus/terminal_check_bsd.go index 3c4f43f..4997899 100644 --- a/vendor/github.com/sirupsen/logrus/terminal_check_bsd.go +++ b/vendor/github.com/sirupsen/logrus/terminal_check_bsd.go @@ -1,4 +1,5 @@ // +build darwin dragonfly freebsd netbsd openbsd +// +build !js package logrus @@ -10,4 +11,3 @@ func isTerminal(fd int) bool { _, err := unix.IoctlGetTermios(fd, ioctlReadTermios) return err == nil } - diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_js.go b/vendor/github.com/sirupsen/logrus/terminal_check_js.go new file mode 100644 index 0000000..ebdae3e --- /dev/null +++ b/vendor/github.com/sirupsen/logrus/terminal_check_js.go @@ -0,0 +1,7 @@ +// +build js + +package logrus + +func isTerminal(fd int) bool { + return false +} diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_unix.go b/vendor/github.com/sirupsen/logrus/terminal_check_unix.go index 355dc96..cc4fe6e 100644 --- a/vendor/github.com/sirupsen/logrus/terminal_check_unix.go +++ b/vendor/github.com/sirupsen/logrus/terminal_check_unix.go @@ -1,4 +1,5 @@ // +build linux aix +// +build !js package logrus @@ -10,4 +11,3 @@ func isTerminal(fd int) bool { _, err := unix.IoctlGetTermios(fd, ioctlReadTermios) return err == nil } - diff --git a/vendor/github.com/sirupsen/logrus/text_formatter.go b/vendor/github.com/sirupsen/logrus/text_formatter.go index e01587c..2d15a23 100644 --- a/vendor/github.com/sirupsen/logrus/text_formatter.go +++ b/vendor/github.com/sirupsen/logrus/text_formatter.go @@ -6,9 +6,11 @@ import ( "os" "runtime" "sort" + "strconv" "strings" "sync" "time" + "unicode/utf8" ) const ( @@ -32,6 +34,9 @@ type TextFormatter struct { // Force disabling colors. DisableColors bool + // Force quoting of all values + ForceQuote bool + // Override coloring based on CLICOLOR and CLICOLOR_FORCE. - https://bixense.com/clicolors/ EnvironmentOverrideColors bool @@ -57,6 +62,10 @@ type TextFormatter struct { // Disables the truncation of the level text to 4 characters. DisableLevelTruncation bool + // PadLevelText Adds padding the level text so that all the levels output at the same length + // PadLevelText is a superset of the DisableLevelTruncation option + PadLevelText bool + // QuoteEmptyFields will wrap empty fields in quotes if true QuoteEmptyFields bool @@ -79,23 +88,32 @@ type TextFormatter struct { CallerPrettyfier func(*runtime.Frame) (function string, file string) terminalInitOnce sync.Once + + // The max length of the level text, generated dynamically on init + levelTextMaxLength int } func (f *TextFormatter) init(entry *Entry) { if entry.Logger != nil { f.isTerminal = checkIfTerminal(entry.Logger.Out) } + // Get the max length of the level text + for _, level := range AllLevels { + levelTextLength := utf8.RuneCount([]byte(level.String())) + if levelTextLength > f.levelTextMaxLength { + f.levelTextMaxLength = levelTextLength + } + } } func (f *TextFormatter) isColored() bool { isColored := f.ForceColors || (f.isTerminal && (runtime.GOOS != "windows")) if f.EnvironmentOverrideColors { - if force, ok := os.LookupEnv("CLICOLOR_FORCE"); ok && force != "0" { + switch force, ok := os.LookupEnv("CLICOLOR_FORCE"); { + case ok && force != "0": isColored = true - } else if ok && force == "0" { - isColored = false - } else if os.Getenv("CLICOLOR") == "0" { + case ok && force == "0", os.Getenv("CLICOLOR") == "0": isColored = false } } @@ -217,9 +235,18 @@ func (f *TextFormatter) printColored(b *bytes.Buffer, entry *Entry, keys []strin } levelText := strings.ToUpper(entry.Level.String()) - if !f.DisableLevelTruncation { + if !f.DisableLevelTruncation && !f.PadLevelText { levelText = levelText[0:4] } + if f.PadLevelText { + // Generates the format string used in the next line, for example "%-6s" or "%-7s". + // Based on the max level text length. + formatString := "%-" + strconv.Itoa(f.levelTextMaxLength) + "s" + // Formats the level text by appending spaces up to the max length, for example: + // - "INFO " + // - "WARNING" + levelText = fmt.Sprintf(formatString, levelText) + } // Remove a single newline if it already exists in the message to keep // the behavior of logrus text_formatter the same as the stdlib log package @@ -243,11 +270,12 @@ func (f *TextFormatter) printColored(b *bytes.Buffer, entry *Entry, keys []strin } } - if f.DisableTimestamp { + switch { + case f.DisableTimestamp: fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m%s %-44s ", levelColor, levelText, caller, entry.Message) - } else if !f.FullTimestamp { + case !f.FullTimestamp: fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m[%04d]%s %-44s ", levelColor, levelText, int(entry.Time.Sub(baseTimestamp)/time.Second), caller, entry.Message) - } else { + default: fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m[%s]%s %-44s ", levelColor, levelText, entry.Time.Format(timestampFormat), caller, entry.Message) } for _, k := range keys { @@ -258,6 +286,9 @@ func (f *TextFormatter) printColored(b *bytes.Buffer, entry *Entry, keys []strin } func (f *TextFormatter) needsQuoting(text string) bool { + if f.ForceQuote { + return true + } if f.QuoteEmptyFields && len(text) == 0 { return true } diff --git a/vendor/github.com/sirupsen/logrus/writer.go b/vendor/github.com/sirupsen/logrus/writer.go index 9e1f751..72e8e3a 100644 --- a/vendor/github.com/sirupsen/logrus/writer.go +++ b/vendor/github.com/sirupsen/logrus/writer.go @@ -6,10 +6,16 @@ import ( "runtime" ) +// Writer at INFO level. See WriterLevel for details. func (logger *Logger) Writer() *io.PipeWriter { return logger.WriterLevel(InfoLevel) } +// WriterLevel returns an io.Writer that can be used to write arbitrary text to +// the logger at the given log level. Each line written to the writer will be +// printed in the usual way using formatters and hooks. The writer is part of an +// io.Pipe and it is the callers responsibility to close the writer when done. +// This can be used to override the standard library logger easily. func (logger *Logger) WriterLevel(level Level) *io.PipeWriter { return NewEntry(logger).WriterLevel(level) } diff --git a/vendor/github.com/spf13/pflag/.gitignore b/vendor/github.com/spf13/pflag/.gitignore deleted file mode 100644 index c3da290..0000000 --- a/vendor/github.com/spf13/pflag/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.idea/* - diff --git a/vendor/github.com/spf13/pflag/.travis.yml b/vendor/github.com/spf13/pflag/.travis.yml deleted file mode 100644 index 00d04cb..0000000 --- a/vendor/github.com/spf13/pflag/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -sudo: false - -language: go - -go: - - 1.9.x - - 1.10.x - - 1.11.x - - tip - -matrix: - allow_failures: - - go: tip - -install: - - go get golang.org/x/lint/golint - - export PATH=$GOPATH/bin:$PATH - - go install ./... - -script: - - verify/all.sh -v - - go test ./... diff --git a/vendor/github.com/spf13/pflag/README.md b/vendor/github.com/spf13/pflag/README.md deleted file mode 100644 index 7eacc5b..0000000 --- a/vendor/github.com/spf13/pflag/README.md +++ /dev/null @@ -1,296 +0,0 @@ -[![Build Status](https://travis-ci.org/spf13/pflag.svg?branch=master)](https://travis-ci.org/spf13/pflag) -[![Go Report Card](https://goreportcard.com/badge/github.com/spf13/pflag)](https://goreportcard.com/report/github.com/spf13/pflag) -[![GoDoc](https://godoc.org/github.com/spf13/pflag?status.svg)](https://godoc.org/github.com/spf13/pflag) - -## Description - -pflag is a drop-in replacement for Go's flag package, implementing -POSIX/GNU-style --flags. - -pflag is compatible with the [GNU extensions to the POSIX recommendations -for command-line options][1]. For a more precise description, see the -"Command-line flag syntax" section below. - -[1]: http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html - -pflag is available under the same style of BSD license as the Go language, -which can be found in the LICENSE file. - -## Installation - -pflag is available using the standard `go get` command. - -Install by running: - - go get github.com/spf13/pflag - -Run tests by running: - - go test github.com/spf13/pflag - -## Usage - -pflag is a drop-in replacement of Go's native flag package. If you import -pflag under the name "flag" then all code should continue to function -with no changes. - -``` go -import flag "github.com/spf13/pflag" -``` - -There is one exception to this: if you directly instantiate the Flag struct -there is one more field "Shorthand" that you will need to set. -Most code never instantiates this struct directly, and instead uses -functions such as String(), BoolVar(), and Var(), and is therefore -unaffected. - -Define flags using flag.String(), Bool(), Int(), etc. - -This declares an integer flag, -flagname, stored in the pointer ip, with type *int. - -``` go -var ip *int = flag.Int("flagname", 1234, "help message for flagname") -``` - -If you like, you can bind the flag to a variable using the Var() functions. - -``` go -var flagvar int -func init() { - flag.IntVar(&flagvar, "flagname", 1234, "help message for flagname") -} -``` - -Or you can create custom flags that satisfy the Value interface (with -pointer receivers) and couple them to flag parsing by - -``` go -flag.Var(&flagVal, "name", "help message for flagname") -``` - -For such flags, the default value is just the initial value of the variable. - -After all flags are defined, call - -``` go -flag.Parse() -``` - -to parse the command line into the defined flags. - -Flags may then be used directly. If you're using the flags themselves, -they are all pointers; if you bind to variables, they're values. - -``` go -fmt.Println("ip has value ", *ip) -fmt.Println("flagvar has value ", flagvar) -``` - -There are helper functions available to get the value stored in a Flag if you have a FlagSet but find -it difficult to keep up with all of the pointers in your code. -If you have a pflag.FlagSet with a flag called 'flagname' of type int you -can use GetInt() to get the int value. But notice that 'flagname' must exist -and it must be an int. GetString("flagname") will fail. - -``` go -i, err := flagset.GetInt("flagname") -``` - -After parsing, the arguments after the flag are available as the -slice flag.Args() or individually as flag.Arg(i). -The arguments are indexed from 0 through flag.NArg()-1. - -The pflag package also defines some new functions that are not in flag, -that give one-letter shorthands for flags. You can use these by appending -'P' to the name of any function that defines a flag. - -``` go -var ip = flag.IntP("flagname", "f", 1234, "help message") -var flagvar bool -func init() { - flag.BoolVarP(&flagvar, "boolname", "b", true, "help message") -} -flag.VarP(&flagVal, "varname", "v", "help message") -``` - -Shorthand letters can be used with single dashes on the command line. -Boolean shorthand flags can be combined with other shorthand flags. - -The default set of command-line flags is controlled by -top-level functions. The FlagSet type allows one to define -independent sets of flags, such as to implement subcommands -in a command-line interface. The methods of FlagSet are -analogous to the top-level functions for the command-line -flag set. - -## Setting no option default values for flags - -After you create a flag it is possible to set the pflag.NoOptDefVal for -the given flag. Doing this changes the meaning of the flag slightly. If -a flag has a NoOptDefVal and the flag is set on the command line without -an option the flag will be set to the NoOptDefVal. For example given: - -``` go -var ip = flag.IntP("flagname", "f", 1234, "help message") -flag.Lookup("flagname").NoOptDefVal = "4321" -``` - -Would result in something like - -| Parsed Arguments | Resulting Value | -| ------------- | ------------- | -| --flagname=1357 | ip=1357 | -| --flagname | ip=4321 | -| [nothing] | ip=1234 | - -## Command line flag syntax - -``` ---flag // boolean flags, or flags with no option default values ---flag x // only on flags without a default value ---flag=x -``` - -Unlike the flag package, a single dash before an option means something -different than a double dash. Single dashes signify a series of shorthand -letters for flags. All but the last shorthand letter must be boolean flags -or a flag with a default value - -``` -// boolean or flags where the 'no option default value' is set --f --f=true --abc -but --b true is INVALID - -// non-boolean and flags without a 'no option default value' --n 1234 --n=1234 --n1234 - -// mixed --abcs "hello" --absd="hello" --abcs1234 -``` - -Flag parsing stops after the terminator "--". Unlike the flag package, -flags can be interspersed with arguments anywhere on the command line -before this terminator. - -Integer flags accept 1234, 0664, 0x1234 and may be negative. -Boolean flags (in their long form) accept 1, 0, t, f, true, false, -TRUE, FALSE, True, False. -Duration flags accept any input valid for time.ParseDuration. - -## Mutating or "Normalizing" Flag names - -It is possible to set a custom flag name 'normalization function.' It allows flag names to be mutated both when created in the code and when used on the command line to some 'normalized' form. The 'normalized' form is used for comparison. Two examples of using the custom normalization func follow. - -**Example #1**: You want -, _, and . in flags to compare the same. aka --my-flag == --my_flag == --my.flag - -``` go -func wordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName { - from := []string{"-", "_"} - to := "." - for _, sep := range from { - name = strings.Replace(name, sep, to, -1) - } - return pflag.NormalizedName(name) -} - -myFlagSet.SetNormalizeFunc(wordSepNormalizeFunc) -``` - -**Example #2**: You want to alias two flags. aka --old-flag-name == --new-flag-name - -``` go -func aliasNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName { - switch name { - case "old-flag-name": - name = "new-flag-name" - break - } - return pflag.NormalizedName(name) -} - -myFlagSet.SetNormalizeFunc(aliasNormalizeFunc) -``` - -## Deprecating a flag or its shorthand -It is possible to deprecate a flag, or just its shorthand. Deprecating a flag/shorthand hides it from help text and prints a usage message when the deprecated flag/shorthand is used. - -**Example #1**: You want to deprecate a flag named "badflag" as well as inform the users what flag they should use instead. -```go -// deprecate a flag by specifying its name and a usage message -flags.MarkDeprecated("badflag", "please use --good-flag instead") -``` -This hides "badflag" from help text, and prints `Flag --badflag has been deprecated, please use --good-flag instead` when "badflag" is used. - -**Example #2**: You want to keep a flag name "noshorthandflag" but deprecate its shortname "n". -```go -// deprecate a flag shorthand by specifying its flag name and a usage message -flags.MarkShorthandDeprecated("noshorthandflag", "please use --noshorthandflag only") -``` -This hides the shortname "n" from help text, and prints `Flag shorthand -n has been deprecated, please use --noshorthandflag only` when the shorthand "n" is used. - -Note that usage message is essential here, and it should not be empty. - -## Hidden flags -It is possible to mark a flag as hidden, meaning it will still function as normal, however will not show up in usage/help text. - -**Example**: You have a flag named "secretFlag" that you need for internal use only and don't want it showing up in help text, or for its usage text to be available. -```go -// hide a flag by specifying its name -flags.MarkHidden("secretFlag") -``` - -## Disable sorting of flags -`pflag` allows you to disable sorting of flags for help and usage message. - -**Example**: -```go -flags.BoolP("verbose", "v", false, "verbose output") -flags.String("coolflag", "yeaah", "it's really cool flag") -flags.Int("usefulflag", 777, "sometimes it's very useful") -flags.SortFlags = false -flags.PrintDefaults() -``` -**Output**: -``` - -v, --verbose verbose output - --coolflag string it's really cool flag (default "yeaah") - --usefulflag int sometimes it's very useful (default 777) -``` - - -## Supporting Go flags when using pflag -In order to support flags defined using Go's `flag` package, they must be added to the `pflag` flagset. This is usually necessary -to support flags defined by third-party dependencies (e.g. `golang/glog`). - -**Example**: You want to add the Go flags to the `CommandLine` flagset -```go -import ( - goflag "flag" - flag "github.com/spf13/pflag" -) - -var ip *int = flag.Int("flagname", 1234, "help message for flagname") - -func main() { - flag.CommandLine.AddGoFlagSet(goflag.CommandLine) - flag.Parse() -} -``` - -## More info - -You can see the full reference documentation of the pflag package -[at godoc.org][3], or through go's standard documentation system by -running `godoc -http=:6060` and browsing to -[http://localhost:6060/pkg/github.com/spf13/pflag][2] after -installation. - -[2]: http://localhost:6060/pkg/github.com/spf13/pflag -[3]: http://godoc.org/github.com/spf13/pflag diff --git a/vendor/github.com/spf13/pflag/go.mod b/vendor/github.com/spf13/pflag/go.mod deleted file mode 100644 index b2287ee..0000000 --- a/vendor/github.com/spf13/pflag/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/spf13/pflag - -go 1.12 diff --git a/vendor/github.com/spf13/pflag/go.sum b/vendor/github.com/spf13/pflag/go.sum deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/golang.org/x/mod/LICENSE b/vendor/golang.org/x/mod/LICENSE deleted file mode 100644 index 6a66aea..0000000 --- a/vendor/golang.org/x/mod/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/mod/PATENTS b/vendor/golang.org/x/mod/PATENTS deleted file mode 100644 index 7330990..0000000 --- a/vendor/golang.org/x/mod/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Go project. - -Google hereby grants to You a perpetual, worldwide, non-exclusive, -no-charge, royalty-free, irrevocable (except as stated in this section) -patent license to make, have made, use, offer to sell, sell, import, -transfer and otherwise run, modify and propagate the contents of this -implementation of Go, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of Go. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of Go or any code incorporated within this -implementation of Go constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of Go -shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/mod/module/module.go b/vendor/golang.org/x/mod/module/module.go deleted file mode 100644 index 6cd3728..0000000 --- a/vendor/golang.org/x/mod/module/module.go +++ /dev/null @@ -1,718 +0,0 @@ -// 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 module defines the module.Version type along with support code. -// -// The module.Version type is a simple Path, Version pair: -// -// type Version struct { -// Path string -// Version string -// } -// -// There are no restrictions imposed directly by use of this structure, -// but additional checking functions, most notably Check, verify that -// a particular path, version pair is valid. -// -// Escaped Paths -// -// Module paths appear as substrings of file system paths -// (in the download cache) and of web server URLs in the proxy protocol. -// In general we cannot rely on file systems to be case-sensitive, -// nor can we rely on web servers, since they read from file systems. -// That is, we cannot rely on the file system to keep rsc.io/QUOTE -// and rsc.io/quote separate. Windows and macOS don't. -// Instead, we must never require two different casings of a file path. -// Because we want the download cache to match the proxy protocol, -// and because we want the proxy protocol to be possible to serve -// from a tree of static files (which might be stored on a case-insensitive -// file system), the proxy protocol must never require two different casings -// of a URL path either. -// -// One possibility would be to make the escaped form be the lowercase -// hexadecimal encoding of the actual path bytes. This would avoid ever -// needing different casings of a file path, but it would be fairly illegible -// to most programmers when those paths appeared in the file system -// (including in file paths in compiler errors and stack traces) -// in web server logs, and so on. Instead, we want a safe escaped form that -// leaves most paths unaltered. -// -// The safe escaped form is to replace every uppercase letter -// with an exclamation mark followed by the letter's lowercase equivalent. -// -// For example, -// -// github.com/Azure/azure-sdk-for-go -> github.com/!azure/azure-sdk-for-go. -// github.com/GoogleCloudPlatform/cloudsql-proxy -> github.com/!google!cloud!platform/cloudsql-proxy -// github.com/Sirupsen/logrus -> github.com/!sirupsen/logrus. -// -// Import paths that avoid upper-case letters are left unchanged. -// Note that because import paths are ASCII-only and avoid various -// problematic punctuation (like : < and >), the escaped form is also ASCII-only -// and avoids the same problematic punctuation. -// -// Import paths have never allowed exclamation marks, so there is no -// need to define how to escape a literal !. -// -// Unicode Restrictions -// -// Today, paths are disallowed from using Unicode. -// -// Although paths are currently disallowed from using Unicode, -// we would like at some point to allow Unicode letters as well, to assume that -// file systems and URLs are Unicode-safe (storing UTF-8), and apply -// the !-for-uppercase convention for escaping them in the file system. -// But there are at least two subtle considerations. -// -// First, note that not all case-fold equivalent distinct runes -// form an upper/lower pair. -// For example, U+004B ('K'), U+006B ('k'), and U+212A ('K' for Kelvin) -// are three distinct runes that case-fold to each other. -// When we do add Unicode letters, we must not assume that upper/lower -// are the only case-equivalent pairs. -// Perhaps the Kelvin symbol would be disallowed entirely, for example. -// Or perhaps it would escape as "!!k", or perhaps as "(212A)". -// -// Second, it would be nice to allow Unicode marks as well as letters, -// but marks include combining marks, and then we must deal not -// only with case folding but also normalization: both U+00E9 ('é') -// and U+0065 U+0301 ('e' followed by combining acute accent) -// look the same on the page and are treated by some file systems -// as the same path. If we do allow Unicode marks in paths, there -// must be some kind of normalization to allow only one canonical -// encoding of any character used in an import path. -package module - -// IMPORTANT NOTE -// -// This file essentially defines the set of valid import paths for the go command. -// There are many subtle considerations, including Unicode ambiguity, -// security, network, and file system representations. -// -// This file also defines the set of valid module path and version combinations, -// another topic with many subtle considerations. -// -// Changes to the semantics in this file require approval from rsc. - -import ( - "fmt" - "sort" - "strings" - "unicode" - "unicode/utf8" - - "golang.org/x/mod/semver" - errors "golang.org/x/xerrors" -) - -// A Version (for clients, a module.Version) is defined by a module path and version pair. -// These are stored in their plain (unescaped) form. -type Version struct { - // Path is a module path, like "golang.org/x/text" or "rsc.io/quote/v2". - Path string - - // Version is usually a semantic version in canonical form. - // There are three exceptions to this general rule. - // First, the top-level target of a build has no specific version - // and uses Version = "". - // Second, during MVS calculations the version "none" is used - // to represent the decision to take no version of a given module. - // Third, filesystem paths found in "replace" directives are - // represented by a path with an empty version. - Version string `json:",omitempty"` -} - -// String returns a representation of the Version suitable for logging -// (Path@Version, or just Path if Version is empty). -func (m Version) String() string { - if m.Version == "" { - return m.Path - } - return m.Path + "@" + m.Version -} - -// A ModuleError indicates an error specific to a module. -type ModuleError struct { - Path string - Version string - Err error -} - -// VersionError returns a ModuleError derived from a Version and error, -// or err itself if it is already such an error. -func VersionError(v Version, err error) error { - var mErr *ModuleError - if errors.As(err, &mErr) && mErr.Path == v.Path && mErr.Version == v.Version { - return err - } - return &ModuleError{ - Path: v.Path, - Version: v.Version, - Err: err, - } -} - -func (e *ModuleError) Error() string { - if v, ok := e.Err.(*InvalidVersionError); ok { - return fmt.Sprintf("%s@%s: invalid %s: %v", e.Path, v.Version, v.noun(), v.Err) - } - if e.Version != "" { - return fmt.Sprintf("%s@%s: %v", e.Path, e.Version, e.Err) - } - return fmt.Sprintf("module %s: %v", e.Path, e.Err) -} - -func (e *ModuleError) Unwrap() error { return e.Err } - -// An InvalidVersionError indicates an error specific to a version, with the -// module path unknown or specified externally. -// -// A ModuleError may wrap an InvalidVersionError, but an InvalidVersionError -// must not wrap a ModuleError. -type InvalidVersionError struct { - Version string - Pseudo bool - Err error -} - -// noun returns either "version" or "pseudo-version", depending on whether -// e.Version is a pseudo-version. -func (e *InvalidVersionError) noun() string { - if e.Pseudo { - return "pseudo-version" - } - return "version" -} - -func (e *InvalidVersionError) Error() string { - return fmt.Sprintf("%s %q invalid: %s", e.noun(), e.Version, e.Err) -} - -func (e *InvalidVersionError) Unwrap() error { return e.Err } - -// Check checks that a given module path, version pair is valid. -// In addition to the path being a valid module path -// and the version being a valid semantic version, -// the two must correspond. -// For example, the path "yaml/v2" only corresponds to -// semantic versions beginning with "v2.". -func Check(path, version string) error { - if err := CheckPath(path); err != nil { - return err - } - if !semver.IsValid(version) { - return &ModuleError{ - Path: path, - Err: &InvalidVersionError{Version: version, Err: errors.New("not a semantic version")}, - } - } - _, pathMajor, _ := SplitPathVersion(path) - if err := CheckPathMajor(version, pathMajor); err != nil { - return &ModuleError{Path: path, Err: err} - } - return nil -} - -// firstPathOK reports whether r can appear in the first element of a module path. -// The first element of the path must be an LDH domain name, at least for now. -// To avoid case ambiguity, the domain name must be entirely lower case. -func firstPathOK(r rune) bool { - return r == '-' || r == '.' || - '0' <= r && r <= '9' || - 'a' <= r && r <= 'z' -} - -// pathOK reports whether r can appear in an import path element. -// Paths can be ASCII letters, ASCII digits, and limited ASCII punctuation: + - . _ and ~. -// This matches what "go get" has historically recognized in import paths. -// TODO(rsc): We would like to allow Unicode letters, but that requires additional -// care in the safe encoding (see "escaped paths" above). -func pathOK(r rune) bool { - if r < utf8.RuneSelf { - return r == '+' || r == '-' || r == '.' || r == '_' || r == '~' || - '0' <= r && r <= '9' || - 'A' <= r && r <= 'Z' || - 'a' <= r && r <= 'z' - } - return false -} - -// fileNameOK reports whether r can appear in a file name. -// For now we allow all Unicode letters but otherwise limit to pathOK plus a few more punctuation characters. -// If we expand the set of allowed characters here, we have to -// work harder at detecting potential case-folding and normalization collisions. -// See note about "escaped paths" above. -func fileNameOK(r rune) bool { - if r < utf8.RuneSelf { - // Entire set of ASCII punctuation, from which we remove characters: - // ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ - // We disallow some shell special characters: " ' * < > ? ` | - // (Note that some of those are disallowed by the Windows file system as well.) - // We also disallow path separators / : and \ (fileNameOK is only called on path element characters). - // We allow spaces (U+0020) in file names. - const allowed = "!#$%&()+,-.=@[]^_{}~ " - if '0' <= r && r <= '9' || 'A' <= r && r <= 'Z' || 'a' <= r && r <= 'z' { - return true - } - for i := 0; i < len(allowed); i++ { - if rune(allowed[i]) == r { - return true - } - } - return false - } - // It may be OK to add more ASCII punctuation here, but only carefully. - // For example Windows disallows < > \, and macOS disallows :, so we must not allow those. - return unicode.IsLetter(r) -} - -// CheckPath checks that a module path is valid. -// A valid module path is a valid import path, as checked by CheckImportPath, -// with two additional constraints. -// First, the leading path element (up to the first slash, if any), -// by convention a domain name, must contain only lower-case ASCII letters, -// ASCII digits, dots (U+002E), and dashes (U+002D); -// it must contain at least one dot and cannot start with a dash. -// Second, for a final path element of the form /vN, where N looks numeric -// (ASCII digits and dots) must not begin with a leading zero, must not be /v1, -// and must not contain any dots. For paths beginning with "gopkg.in/", -// this second requirement is replaced by a requirement that the path -// follow the gopkg.in server's conventions. -func CheckPath(path string) error { - if err := checkPath(path, false); err != nil { - return fmt.Errorf("malformed module path %q: %v", path, err) - } - i := strings.Index(path, "/") - if i < 0 { - i = len(path) - } - if i == 0 { - return fmt.Errorf("malformed module path %q: leading slash", path) - } - if !strings.Contains(path[:i], ".") { - return fmt.Errorf("malformed module path %q: missing dot in first path element", path) - } - if path[0] == '-' { - return fmt.Errorf("malformed module path %q: leading dash in first path element", path) - } - for _, r := range path[:i] { - if !firstPathOK(r) { - return fmt.Errorf("malformed module path %q: invalid char %q in first path element", path, r) - } - } - if _, _, ok := SplitPathVersion(path); !ok { - return fmt.Errorf("malformed module path %q: invalid version", path) - } - return nil -} - -// CheckImportPath checks that an import path is valid. -// -// A valid import path consists of one or more valid path elements -// separated by slashes (U+002F). (It must not begin with nor end in a slash.) -// -// A valid path element is a non-empty string made up of -// ASCII letters, ASCII digits, and limited ASCII punctuation: + - . _ and ~. -// It must not begin or end with a dot (U+002E), nor contain two dots in a row. -// -// The element prefix up to the first dot must not be a reserved file name -// on Windows, regardless of case (CON, com1, NuL, and so on). -// -// CheckImportPath may be less restrictive in the future, but see the -// top-level package documentation for additional information about -// subtleties of Unicode. -func CheckImportPath(path string) error { - if err := checkPath(path, false); err != nil { - return fmt.Errorf("malformed import path %q: %v", path, err) - } - return nil -} - -// checkPath checks that a general path is valid. -// It returns an error describing why but not mentioning path. -// Because these checks apply to both module paths and import paths, -// the caller is expected to add the "malformed ___ path %q: " prefix. -// fileName indicates whether the final element of the path is a file name -// (as opposed to a directory name). -func checkPath(path string, fileName bool) error { - if !utf8.ValidString(path) { - return fmt.Errorf("invalid UTF-8") - } - if path == "" { - return fmt.Errorf("empty string") - } - if path[0] == '-' { - return fmt.Errorf("leading dash") - } - if strings.Contains(path, "//") { - return fmt.Errorf("double slash") - } - if path[len(path)-1] == '/' { - return fmt.Errorf("trailing slash") - } - elemStart := 0 - for i, r := range path { - if r == '/' { - if err := checkElem(path[elemStart:i], fileName); err != nil { - return err - } - elemStart = i + 1 - } - } - if err := checkElem(path[elemStart:], fileName); err != nil { - return err - } - return nil -} - -// checkElem checks whether an individual path element is valid. -// fileName indicates whether the element is a file name (not a directory name). -func checkElem(elem string, fileName bool) error { - if elem == "" { - return fmt.Errorf("empty path element") - } - if strings.Count(elem, ".") == len(elem) { - return fmt.Errorf("invalid path element %q", elem) - } - if elem[0] == '.' && !fileName { - return fmt.Errorf("leading dot in path element") - } - if elem[len(elem)-1] == '.' { - return fmt.Errorf("trailing dot in path element") - } - charOK := pathOK - if fileName { - charOK = fileNameOK - } - for _, r := range elem { - if !charOK(r) { - return fmt.Errorf("invalid char %q", r) - } - } - - // Windows disallows a bunch of path elements, sadly. - // See https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file - short := elem - if i := strings.Index(short, "."); i >= 0 { - short = short[:i] - } - for _, bad := range badWindowsNames { - if strings.EqualFold(bad, short) { - return fmt.Errorf("%q disallowed as path element component on Windows", short) - } - } - return nil -} - -// CheckFilePath checks that a slash-separated file path is valid. -// The definition of a valid file path is the same as the definition -// of a valid import path except that the set of allowed characters is larger: -// all Unicode letters, ASCII digits, the ASCII space character (U+0020), -// and the ASCII punctuation characters -// “!#$%&()+,-.=@[]^_{}~”. -// (The excluded punctuation characters, " * < > ? ` ' | / \ and :, -// have special meanings in certain shells or operating systems.) -// -// CheckFilePath may be less restrictive in the future, but see the -// top-level package documentation for additional information about -// subtleties of Unicode. -func CheckFilePath(path string) error { - if err := checkPath(path, true); err != nil { - return fmt.Errorf("malformed file path %q: %v", path, err) - } - return nil -} - -// badWindowsNames are the reserved file path elements on Windows. -// See https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file -var badWindowsNames = []string{ - "CON", - "PRN", - "AUX", - "NUL", - "COM1", - "COM2", - "COM3", - "COM4", - "COM5", - "COM6", - "COM7", - "COM8", - "COM9", - "LPT1", - "LPT2", - "LPT3", - "LPT4", - "LPT5", - "LPT6", - "LPT7", - "LPT8", - "LPT9", -} - -// SplitPathVersion returns prefix and major version such that prefix+pathMajor == path -// and version is either empty or "/vN" for N >= 2. -// As a special case, gopkg.in paths are recognized directly; -// they require ".vN" instead of "/vN", and for all N, not just N >= 2. -// SplitPathVersion returns with ok = false when presented with -// a path whose last path element does not satisfy the constraints -// applied by CheckPath, such as "example.com/pkg/v1" or "example.com/pkg/v1.2". -func SplitPathVersion(path string) (prefix, pathMajor string, ok bool) { - if strings.HasPrefix(path, "gopkg.in/") { - return splitGopkgIn(path) - } - - i := len(path) - dot := false - for i > 0 && ('0' <= path[i-1] && path[i-1] <= '9' || path[i-1] == '.') { - if path[i-1] == '.' { - dot = true - } - i-- - } - if i <= 1 || i == len(path) || path[i-1] != 'v' || path[i-2] != '/' { - return path, "", true - } - prefix, pathMajor = path[:i-2], path[i-2:] - if dot || len(pathMajor) <= 2 || pathMajor[2] == '0' || pathMajor == "/v1" { - return path, "", false - } - return prefix, pathMajor, true -} - -// splitGopkgIn is like SplitPathVersion but only for gopkg.in paths. -func splitGopkgIn(path string) (prefix, pathMajor string, ok bool) { - if !strings.HasPrefix(path, "gopkg.in/") { - return path, "", false - } - i := len(path) - if strings.HasSuffix(path, "-unstable") { - i -= len("-unstable") - } - for i > 0 && ('0' <= path[i-1] && path[i-1] <= '9') { - i-- - } - if i <= 1 || path[i-1] != 'v' || path[i-2] != '.' { - // All gopkg.in paths must end in vN for some N. - return path, "", false - } - prefix, pathMajor = path[:i-2], path[i-2:] - if len(pathMajor) <= 2 || pathMajor[2] == '0' && pathMajor != ".v0" { - return path, "", false - } - return prefix, pathMajor, true -} - -// MatchPathMajor reports whether the semantic version v -// matches the path major version pathMajor. -// -// MatchPathMajor returns true if and only if CheckPathMajor returns nil. -func MatchPathMajor(v, pathMajor string) bool { - return CheckPathMajor(v, pathMajor) == nil -} - -// CheckPathMajor returns a non-nil error if the semantic version v -// does not match the path major version pathMajor. -func CheckPathMajor(v, pathMajor string) error { - // TODO(jayconrod): return errors or panic for invalid inputs. This function - // (and others) was covered by integration tests for cmd/go, and surrounding - // code protected against invalid inputs like non-canonical versions. - if strings.HasPrefix(pathMajor, ".v") && strings.HasSuffix(pathMajor, "-unstable") { - pathMajor = strings.TrimSuffix(pathMajor, "-unstable") - } - if strings.HasPrefix(v, "v0.0.0-") && pathMajor == ".v1" { - // Allow old bug in pseudo-versions that generated v0.0.0- pseudoversion for gopkg .v1. - // For example, gopkg.in/yaml.v2@v2.2.1's go.mod requires gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405. - return nil - } - m := semver.Major(v) - if pathMajor == "" { - if m == "v0" || m == "v1" || semver.Build(v) == "+incompatible" { - return nil - } - pathMajor = "v0 or v1" - } else if pathMajor[0] == '/' || pathMajor[0] == '.' { - if m == pathMajor[1:] { - return nil - } - pathMajor = pathMajor[1:] - } - return &InvalidVersionError{ - Version: v, - Err: fmt.Errorf("should be %s, not %s", pathMajor, semver.Major(v)), - } -} - -// PathMajorPrefix returns the major-version tag prefix implied by pathMajor. -// An empty PathMajorPrefix allows either v0 or v1. -// -// Note that MatchPathMajor may accept some versions that do not actually begin -// with this prefix: namely, it accepts a 'v0.0.0-' prefix for a '.v1' -// pathMajor, even though that pathMajor implies 'v1' tagging. -func PathMajorPrefix(pathMajor string) string { - if pathMajor == "" { - return "" - } - if pathMajor[0] != '/' && pathMajor[0] != '.' { - panic("pathMajor suffix " + pathMajor + " passed to PathMajorPrefix lacks separator") - } - if strings.HasPrefix(pathMajor, ".v") && strings.HasSuffix(pathMajor, "-unstable") { - pathMajor = strings.TrimSuffix(pathMajor, "-unstable") - } - m := pathMajor[1:] - if m != semver.Major(m) { - panic("pathMajor suffix " + pathMajor + "passed to PathMajorPrefix is not a valid major version") - } - return m -} - -// CanonicalVersion returns the canonical form of the version string v. -// It is the same as semver.Canonical(v) except that it preserves the special build suffix "+incompatible". -func CanonicalVersion(v string) string { - cv := semver.Canonical(v) - if semver.Build(v) == "+incompatible" { - cv += "+incompatible" - } - return cv -} - -// Sort sorts the list by Path, breaking ties by comparing Version fields. -// The Version fields are interpreted as semantic versions (using semver.Compare) -// optionally followed by a tie-breaking suffix introduced by a slash character, -// like in "v0.0.1/go.mod". -func Sort(list []Version) { - sort.Slice(list, func(i, j int) bool { - mi := list[i] - mj := list[j] - if mi.Path != mj.Path { - return mi.Path < mj.Path - } - // To help go.sum formatting, allow version/file. - // Compare semver prefix by semver rules, - // file by string order. - vi := mi.Version - vj := mj.Version - var fi, fj string - if k := strings.Index(vi, "/"); k >= 0 { - vi, fi = vi[:k], vi[k:] - } - if k := strings.Index(vj, "/"); k >= 0 { - vj, fj = vj[:k], vj[k:] - } - if vi != vj { - return semver.Compare(vi, vj) < 0 - } - return fi < fj - }) -} - -// EscapePath returns the escaped form of the given module path. -// It fails if the module path is invalid. -func EscapePath(path string) (escaped string, err error) { - if err := CheckPath(path); err != nil { - return "", err - } - - return escapeString(path) -} - -// EscapeVersion returns the escaped form of the given module version. -// Versions are allowed to be in non-semver form but must be valid file names -// and not contain exclamation marks. -func EscapeVersion(v string) (escaped string, err error) { - if err := checkElem(v, true); err != nil || strings.Contains(v, "!") { - return "", &InvalidVersionError{ - Version: v, - Err: fmt.Errorf("disallowed version string"), - } - } - return escapeString(v) -} - -func escapeString(s string) (escaped string, err error) { - haveUpper := false - for _, r := range s { - if r == '!' || r >= utf8.RuneSelf { - // This should be disallowed by CheckPath, but diagnose anyway. - // The correctness of the escaping loop below depends on it. - return "", fmt.Errorf("internal error: inconsistency in EscapePath") - } - if 'A' <= r && r <= 'Z' { - haveUpper = true - } - } - - if !haveUpper { - return s, nil - } - - var buf []byte - for _, r := range s { - if 'A' <= r && r <= 'Z' { - buf = append(buf, '!', byte(r+'a'-'A')) - } else { - buf = append(buf, byte(r)) - } - } - return string(buf), nil -} - -// UnescapePath returns the module path for the given escaped path. -// It fails if the escaped path is invalid or describes an invalid path. -func UnescapePath(escaped string) (path string, err error) { - path, ok := unescapeString(escaped) - if !ok { - return "", fmt.Errorf("invalid escaped module path %q", escaped) - } - if err := CheckPath(path); err != nil { - return "", fmt.Errorf("invalid escaped module path %q: %v", escaped, err) - } - return path, nil -} - -// UnescapeVersion returns the version string for the given escaped version. -// It fails if the escaped form is invalid or describes an invalid version. -// Versions are allowed to be in non-semver form but must be valid file names -// and not contain exclamation marks. -func UnescapeVersion(escaped string) (v string, err error) { - v, ok := unescapeString(escaped) - if !ok { - return "", fmt.Errorf("invalid escaped version %q", escaped) - } - if err := checkElem(v, true); err != nil { - return "", fmt.Errorf("invalid escaped version %q: %v", v, err) - } - return v, nil -} - -func unescapeString(escaped string) (string, bool) { - var buf []byte - - bang := false - for _, r := range escaped { - if r >= utf8.RuneSelf { - return "", false - } - if bang { - bang = false - if r < 'a' || 'z' < r { - return "", false - } - buf = append(buf, byte(r+'A'-'a')) - continue - } - if r == '!' { - bang = true - continue - } - if 'A' <= r && r <= 'Z' { - return "", false - } - buf = append(buf, byte(r)) - } - if bang { - return "", false - } - return string(buf), true -} diff --git a/vendor/golang.org/x/mod/semver/semver.go b/vendor/golang.org/x/mod/semver/semver.go deleted file mode 100644 index 2988e3c..0000000 --- a/vendor/golang.org/x/mod/semver/semver.go +++ /dev/null @@ -1,388 +0,0 @@ -// 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 semver implements comparison of semantic version strings. -// In this package, semantic version strings must begin with a leading "v", -// as in "v1.0.0". -// -// The general form of a semantic version string accepted by this package is -// -// vMAJOR[.MINOR[.PATCH[-PRERELEASE][+BUILD]]] -// -// where square brackets indicate optional parts of the syntax; -// MAJOR, MINOR, and PATCH are decimal integers without extra leading zeros; -// PRERELEASE and BUILD are each a series of non-empty dot-separated identifiers -// using only alphanumeric characters and hyphens; and -// all-numeric PRERELEASE identifiers must not have leading zeros. -// -// This package follows Semantic Versioning 2.0.0 (see semver.org) -// with two exceptions. First, it requires the "v" prefix. Second, it recognizes -// vMAJOR and vMAJOR.MINOR (with no prerelease or build suffixes) -// as shorthands for vMAJOR.0.0 and vMAJOR.MINOR.0. -package semver - -// parsed returns the parsed form of a semantic version string. -type parsed struct { - major string - minor string - patch string - short string - prerelease string - build string - err string -} - -// IsValid reports whether v is a valid semantic version string. -func IsValid(v string) bool { - _, ok := parse(v) - return ok -} - -// Canonical returns the canonical formatting of the semantic version v. -// It fills in any missing .MINOR or .PATCH and discards build metadata. -// Two semantic versions compare equal only if their canonical formattings -// are identical strings. -// The canonical invalid semantic version is the empty string. -func Canonical(v string) string { - p, ok := parse(v) - if !ok { - return "" - } - if p.build != "" { - return v[:len(v)-len(p.build)] - } - if p.short != "" { - return v + p.short - } - return v -} - -// Major returns the major version prefix of the semantic version v. -// For example, Major("v2.1.0") == "v2". -// If v is an invalid semantic version string, Major returns the empty string. -func Major(v string) string { - pv, ok := parse(v) - if !ok { - return "" - } - return v[:1+len(pv.major)] -} - -// MajorMinor returns the major.minor version prefix of the semantic version v. -// For example, MajorMinor("v2.1.0") == "v2.1". -// If v is an invalid semantic version string, MajorMinor returns the empty string. -func MajorMinor(v string) string { - pv, ok := parse(v) - if !ok { - return "" - } - i := 1 + len(pv.major) - if j := i + 1 + len(pv.minor); j <= len(v) && v[i] == '.' && v[i+1:j] == pv.minor { - return v[:j] - } - return v[:i] + "." + pv.minor -} - -// Prerelease returns the prerelease suffix of the semantic version v. -// For example, Prerelease("v2.1.0-pre+meta") == "-pre". -// If v is an invalid semantic version string, Prerelease returns the empty string. -func Prerelease(v string) string { - pv, ok := parse(v) - if !ok { - return "" - } - return pv.prerelease -} - -// Build returns the build suffix of the semantic version v. -// For example, Build("v2.1.0+meta") == "+meta". -// If v is an invalid semantic version string, Build returns the empty string. -func Build(v string) string { - pv, ok := parse(v) - if !ok { - return "" - } - return pv.build -} - -// Compare returns an integer comparing two versions according to -// semantic version precedence. -// The result will be 0 if v == w, -1 if v < w, or +1 if v > w. -// -// An invalid semantic version string is considered less than a valid one. -// All invalid semantic version strings compare equal to each other. -func Compare(v, w string) int { - pv, ok1 := parse(v) - pw, ok2 := parse(w) - if !ok1 && !ok2 { - return 0 - } - if !ok1 { - return -1 - } - if !ok2 { - return +1 - } - if c := compareInt(pv.major, pw.major); c != 0 { - return c - } - if c := compareInt(pv.minor, pw.minor); c != 0 { - return c - } - if c := compareInt(pv.patch, pw.patch); c != 0 { - return c - } - return comparePrerelease(pv.prerelease, pw.prerelease) -} - -// Max canonicalizes its arguments and then returns the version string -// that compares greater. -func Max(v, w string) string { - v = Canonical(v) - w = Canonical(w) - if Compare(v, w) > 0 { - return v - } - return w -} - -func parse(v string) (p parsed, ok bool) { - if v == "" || v[0] != 'v' { - p.err = "missing v prefix" - return - } - p.major, v, ok = parseInt(v[1:]) - if !ok { - p.err = "bad major version" - return - } - if v == "" { - p.minor = "0" - p.patch = "0" - p.short = ".0.0" - return - } - if v[0] != '.' { - p.err = "bad minor prefix" - ok = false - return - } - p.minor, v, ok = parseInt(v[1:]) - if !ok { - p.err = "bad minor version" - return - } - if v == "" { - p.patch = "0" - p.short = ".0" - return - } - if v[0] != '.' { - p.err = "bad patch prefix" - ok = false - return - } - p.patch, v, ok = parseInt(v[1:]) - if !ok { - p.err = "bad patch version" - return - } - if len(v) > 0 && v[0] == '-' { - p.prerelease, v, ok = parsePrerelease(v) - if !ok { - p.err = "bad prerelease" - return - } - } - if len(v) > 0 && v[0] == '+' { - p.build, v, ok = parseBuild(v) - if !ok { - p.err = "bad build" - return - } - } - if v != "" { - p.err = "junk on end" - ok = false - return - } - ok = true - return -} - -func parseInt(v string) (t, rest string, ok bool) { - if v == "" { - return - } - if v[0] < '0' || '9' < v[0] { - return - } - i := 1 - for i < len(v) && '0' <= v[i] && v[i] <= '9' { - i++ - } - if v[0] == '0' && i != 1 { - return - } - return v[:i], v[i:], true -} - -func parsePrerelease(v string) (t, rest string, ok bool) { - // "A pre-release version MAY be denoted by appending a hyphen and - // a series of dot separated identifiers immediately following the patch version. - // Identifiers MUST comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-]. - // Identifiers MUST NOT be empty. Numeric identifiers MUST NOT include leading zeroes." - if v == "" || v[0] != '-' { - return - } - i := 1 - start := 1 - for i < len(v) && v[i] != '+' { - if !isIdentChar(v[i]) && v[i] != '.' { - return - } - if v[i] == '.' { - if start == i || isBadNum(v[start:i]) { - return - } - start = i + 1 - } - i++ - } - if start == i || isBadNum(v[start:i]) { - return - } - return v[:i], v[i:], true -} - -func parseBuild(v string) (t, rest string, ok bool) { - if v == "" || v[0] != '+' { - return - } - i := 1 - start := 1 - for i < len(v) { - if !isIdentChar(v[i]) && v[i] != '.' { - return - } - if v[i] == '.' { - if start == i { - return - } - start = i + 1 - } - i++ - } - if start == i { - return - } - return v[:i], v[i:], true -} - -func isIdentChar(c byte) bool { - return 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' || '0' <= c && c <= '9' || c == '-' -} - -func isBadNum(v string) bool { - i := 0 - for i < len(v) && '0' <= v[i] && v[i] <= '9' { - i++ - } - return i == len(v) && i > 1 && v[0] == '0' -} - -func isNum(v string) bool { - i := 0 - for i < len(v) && '0' <= v[i] && v[i] <= '9' { - i++ - } - return i == len(v) -} - -func compareInt(x, y string) int { - if x == y { - return 0 - } - if len(x) < len(y) { - return -1 - } - if len(x) > len(y) { - return +1 - } - if x < y { - return -1 - } else { - return +1 - } -} - -func comparePrerelease(x, y string) int { - // "When major, minor, and patch are equal, a pre-release version has - // lower precedence than a normal version. - // Example: 1.0.0-alpha < 1.0.0. - // Precedence for two pre-release versions with the same major, minor, - // and patch version MUST be determined by comparing each dot separated - // identifier from left to right until a difference is found as follows: - // identifiers consisting of only digits are compared numerically and - // identifiers with letters or hyphens are compared lexically in ASCII - // sort order. Numeric identifiers always have lower precedence than - // non-numeric identifiers. A larger set of pre-release fields has a - // higher precedence than a smaller set, if all of the preceding - // identifiers are equal. - // Example: 1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-alpha.beta < - // 1.0.0-beta < 1.0.0-beta.2 < 1.0.0-beta.11 < 1.0.0-rc.1 < 1.0.0." - if x == y { - return 0 - } - if x == "" { - return +1 - } - if y == "" { - return -1 - } - for x != "" && y != "" { - x = x[1:] // skip - or . - y = y[1:] // skip - or . - var dx, dy string - dx, x = nextIdent(x) - dy, y = nextIdent(y) - if dx != dy { - ix := isNum(dx) - iy := isNum(dy) - if ix != iy { - if ix { - return -1 - } else { - return +1 - } - } - if ix { - if len(dx) < len(dy) { - return -1 - } - if len(dx) > len(dy) { - return +1 - } - } - if dx < dy { - return -1 - } else { - return +1 - } - } - } - if x == "" { - return -1 - } else { - return +1 - } -} - -func nextIdent(x string) (dx, rest string) { - i := 0 - for i < len(x) && x[i] != '.' { - i++ - } - return x[:i], x[i:] -} diff --git a/vendor/golang.org/x/net/http2/.gitignore b/vendor/golang.org/x/net/http2/.gitignore deleted file mode 100644 index 190f122..0000000 --- a/vendor/golang.org/x/net/http2/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*~ -h2i/h2i diff --git a/vendor/golang.org/x/net/http2/Dockerfile b/vendor/golang.org/x/net/http2/Dockerfile deleted file mode 100644 index 53fc525..0000000 --- a/vendor/golang.org/x/net/http2/Dockerfile +++ /dev/null @@ -1,51 +0,0 @@ -# -# This Dockerfile builds a recent curl with HTTP/2 client support, using -# a recent nghttp2 build. -# -# See the Makefile for how to tag it. If Docker and that image is found, the -# Go tests use this curl binary for integration tests. -# - -FROM ubuntu:trusty - -RUN apt-get update && \ - apt-get upgrade -y && \ - apt-get install -y git-core build-essential wget - -RUN apt-get install -y --no-install-recommends \ - autotools-dev libtool pkg-config zlib1g-dev \ - libcunit1-dev libssl-dev libxml2-dev libevent-dev \ - automake autoconf - -# The list of packages nghttp2 recommends for h2load: -RUN apt-get install -y --no-install-recommends make binutils \ - autoconf automake autotools-dev \ - libtool pkg-config zlib1g-dev libcunit1-dev libssl-dev libxml2-dev \ - libev-dev libevent-dev libjansson-dev libjemalloc-dev \ - cython python3.4-dev python-setuptools - -# Note: setting NGHTTP2_VER before the git clone, so an old git clone isn't cached: -ENV NGHTTP2_VER 895da9a -RUN cd /root && git clone https://github.com/tatsuhiro-t/nghttp2.git - -WORKDIR /root/nghttp2 -RUN git reset --hard $NGHTTP2_VER -RUN autoreconf -i -RUN automake -RUN autoconf -RUN ./configure -RUN make -RUN make install - -WORKDIR /root -RUN wget http://curl.haxx.se/download/curl-7.45.0.tar.gz -RUN tar -zxvf curl-7.45.0.tar.gz -WORKDIR /root/curl-7.45.0 -RUN ./configure --with-ssl --with-nghttp2=/usr/local -RUN make -RUN make install -RUN ldconfig - -CMD ["-h"] -ENTRYPOINT ["/usr/local/bin/curl"] - diff --git a/vendor/golang.org/x/net/http2/Makefile b/vendor/golang.org/x/net/http2/Makefile deleted file mode 100644 index 55fd826..0000000 --- a/vendor/golang.org/x/net/http2/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -curlimage: - docker build -t gohttp2/curl . - diff --git a/vendor/golang.org/x/net/http2/README b/vendor/golang.org/x/net/http2/README deleted file mode 100644 index 360d5aa..0000000 --- a/vendor/golang.org/x/net/http2/README +++ /dev/null @@ -1,20 +0,0 @@ -This is a work-in-progress HTTP/2 implementation for Go. - -It will eventually live in the Go standard library and won't require -any changes to your code to use. It will just be automatic. - -Status: - -* The server support is pretty good. A few things are missing - but are being worked on. -* The client work has just started but shares a lot of code - is coming along much quicker. - -Docs are at https://godoc.org/golang.org/x/net/http2 - -Demo test server at https://http2.golang.org/ - -Help & bug reports welcome! - -Contributing: https://golang.org/doc/contribute.html -Bugs: https://golang.org/issue/new?title=x/net/http2:+ diff --git a/vendor/golang.org/x/net/http2/hpack/encode.go b/vendor/golang.org/x/net/http2/hpack/encode.go index 1565cf2..97f1783 100644 --- a/vendor/golang.org/x/net/http2/hpack/encode.go +++ b/vendor/golang.org/x/net/http2/hpack/encode.go @@ -150,7 +150,7 @@ func appendIndexed(dst []byte, i uint64) []byte { // extended buffer. // // If f.Sensitive is true, "Never Indexed" representation is used. If -// f.Sensitive is false and indexing is true, "Inremental Indexing" +// f.Sensitive is false and indexing is true, "Incremental Indexing" // representation is used. func appendNewName(dst []byte, f HeaderField, indexing bool) []byte { dst = append(dst, encodeTypeByte(indexing, f.Sensitive)) diff --git a/vendor/golang.org/x/net/http2/http2.go b/vendor/golang.org/x/net/http2/http2.go index bdaba1d..27cc893 100644 --- a/vendor/golang.org/x/net/http2/http2.go +++ b/vendor/golang.org/x/net/http2/http2.go @@ -19,7 +19,6 @@ package http2 // import "golang.org/x/net/http2" import ( "bufio" "crypto/tls" - "errors" "fmt" "io" "net/http" @@ -173,11 +172,6 @@ func (s SettingID) String() string { return fmt.Sprintf("UNKNOWN_SETTING_%d", uint16(s)) } -var ( - errInvalidHeaderFieldName = errors.New("http2: invalid header field name") - errInvalidHeaderFieldValue = errors.New("http2: invalid header field value") -) - // validWireHeaderFieldName reports whether v is a valid header field // name (key). See httpguts.ValidHeaderName for the base rules. // diff --git a/vendor/golang.org/x/net/http2/pipe.go b/vendor/golang.org/x/net/http2/pipe.go index a614009..2a5399e 100644 --- a/vendor/golang.org/x/net/http2/pipe.go +++ b/vendor/golang.org/x/net/http2/pipe.go @@ -17,6 +17,7 @@ type pipe struct { mu sync.Mutex c sync.Cond // c.L lazily initialized to &p.mu b pipeBuffer // nil when done reading + unread int // bytes unread when done err error // read error once empty. non-nil means closed. breakErr error // immediate read error (caller doesn't see rest of b) donec chan struct{} // closed on error @@ -33,7 +34,7 @@ func (p *pipe) Len() int { p.mu.Lock() defer p.mu.Unlock() if p.b == nil { - return 0 + return p.unread } return p.b.Len() } @@ -80,6 +81,7 @@ func (p *pipe) Write(d []byte) (n int, err error) { return 0, errClosedPipeWrite } if p.breakErr != nil { + p.unread += len(d) return len(d), nil // discard when there is no reader } return p.b.Write(d) @@ -117,6 +119,9 @@ func (p *pipe) closeWithError(dst *error, err error, fn func()) { } p.readFn = fn if dst == &p.breakErr { + if p.b != nil { + p.unread += p.b.Len() + } p.b = nil } *dst = err diff --git a/vendor/golang.org/x/net/http2/server.go b/vendor/golang.org/x/net/http2/server.go index 5e01ce9..bc9e41a 100644 --- a/vendor/golang.org/x/net/http2/server.go +++ b/vendor/golang.org/x/net/http2/server.go @@ -252,7 +252,7 @@ func ConfigureServer(s *http.Server, conf *Server) error { } } if !haveRequired { - return fmt.Errorf("http2: TLSConfig.CipherSuites is missing an HTTP/2-required AES_128_GCM_SHA256 cipher.") + return fmt.Errorf("http2: TLSConfig.CipherSuites is missing an HTTP/2-required AES_128_GCM_SHA256 cipher (need at least one of TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 or TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256).") } } @@ -322,7 +322,7 @@ type ServeConnOpts struct { } func (o *ServeConnOpts) context() context.Context { - if o.Context != nil { + if o != nil && o.Context != nil { return o.Context } return context.Background() @@ -581,13 +581,10 @@ type stream struct { cancelCtx func() // owned by serverConn's serve loop: - bodyBytes int64 // body bytes seen so far - declBodyBytes int64 // or -1 if undeclared - flow flow // limits writing from Handler to client - inflow flow // what the client is allowed to POST/etc to us - parent *stream // or nil - numTrailerValues int64 - weight uint8 + bodyBytes int64 // body bytes seen so far + declBodyBytes int64 // or -1 if undeclared + flow flow // limits writing from Handler to client + inflow flow // what the client is allowed to POST/etc to us state streamState resetQueued bool // RST_STREAM queued for write; set by sc.resetStream gotTrailerHeader bool // HEADER frame for trailers was seen @@ -2415,7 +2412,11 @@ func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) { clen = strconv.Itoa(len(p)) } _, hasContentType := rws.snapHeader["Content-Type"] - if !hasContentType && bodyAllowedForStatus(rws.status) && len(p) > 0 { + // If the Content-Encoding is non-blank, we shouldn't + // sniff the body. See Issue golang.org/issue/31753. + ce := rws.snapHeader.Get("Content-Encoding") + hasCE := len(ce) > 0 + if !hasCE && !hasContentType && bodyAllowedForStatus(rws.status) && len(p) > 0 { ctype = http.DetectContentType(p) } var date string @@ -2524,7 +2525,7 @@ const TrailerPrefix = "Trailer:" // trailers. That worked for a while, until we found the first major // user of Trailers in the wild: gRPC (using them only over http2), // and gRPC libraries permit setting trailers mid-stream without -// predeclarnig them. So: change of plans. We still permit the old +// predeclaring them. So: change of plans. We still permit the old // way, but we also permit this hack: if a Header() key begins with // "Trailer:", the suffix of that key is a Trailer. Because ':' is an // invalid token byte anyway, there is no ambiguity. (And it's already @@ -2824,7 +2825,7 @@ func (sc *serverConn) startPush(msg *startPushRequest) { // PUSH_PROMISE frames MUST only be sent on a peer-initiated stream that // is in either the "open" or "half-closed (remote)" state. if msg.parent.state != stateOpen && msg.parent.state != stateHalfClosedRemote { - // responseWriter.Push checks that the stream is peer-initiaed. + // responseWriter.Push checks that the stream is peer-initiated. msg.done <- errStreamClosed return } diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go index aeac7d8..e4fb025 100644 --- a/vendor/golang.org/x/net/http2/transport.go +++ b/vendor/golang.org/x/net/http2/transport.go @@ -93,7 +93,7 @@ type Transport struct { // send in the initial settings frame. It is how many bytes // of response headers are allowed. Unlike the http2 spec, zero here // means to use a default limit (currently 10MB). If you actually - // want to advertise an ulimited value to the peer, Transport + // want to advertise an unlimited value to the peer, Transport // interprets the highest possible value here (0xffffffff or 1<<32-1) // to mean no limit. MaxHeaderListSize uint32 @@ -227,6 +227,7 @@ type ClientConn struct { br *bufio.Reader fr *Framer lastActive time.Time + lastIdle time.Time // time last idle // Settings from peer: (also guarded by mu) maxFrameSize uint32 maxConcurrentStreams uint32 @@ -603,7 +604,7 @@ func (t *Transport) expectContinueTimeout() time.Duration { } func (t *Transport) NewClientConn(c net.Conn) (*ClientConn, error) { - return t.newClientConn(c, false) + return t.newClientConn(c, t.disableKeepAlives()) } func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, error) { @@ -736,7 +737,8 @@ func (cc *ClientConn) idleStateLocked() (st clientConnIdleState) { } st.canTakeNewRequest = cc.goAway == nil && !cc.closed && !cc.closing && maxConcurrentOkay && - int64(cc.nextStreamID)+2*int64(cc.pendingRequests) < math.MaxInt32 + int64(cc.nextStreamID)+2*int64(cc.pendingRequests) < math.MaxInt32 && + !cc.tooIdleLocked() st.freshConn = cc.nextStreamID == 1 && st.canTakeNewRequest return } @@ -746,6 +748,16 @@ func (cc *ClientConn) canTakeNewRequestLocked() bool { return st.canTakeNewRequest } +// tooIdleLocked reports whether this connection has been been sitting idle +// for too much wall time. +func (cc *ClientConn) tooIdleLocked() bool { + // The Round(0) strips the monontonic clock reading so the + // times are compared based on their wall time. We don't want + // to reuse a connection that's been sitting idle during + // VM/laptop suspend if monotonic time was also frozen. + return cc.idleTimeout != 0 && !cc.lastIdle.IsZero() && time.Since(cc.lastIdle.Round(0)) > cc.idleTimeout +} + // onIdleTimeout is called from a time.AfterFunc goroutine. It will // only be called when we're idle, but because we're coming from a new // goroutine, there could be a new request coming in at the same time, @@ -1150,6 +1162,7 @@ func (cc *ClientConn) awaitOpenSlotForRequest(req *http.Request) error { } return errClientConnUnusable } + cc.lastIdle = time.Time{} if int64(len(cc.streams))+1 <= int64(cc.maxConcurrentStreams) { if waitingForConn != nil { close(waitingForConn) @@ -1216,6 +1229,8 @@ var ( // abort request body write, but send stream reset of cancel. errStopReqBodyWriteAndCancel = errors.New("http2: canceling request") + + errReqBodyTooLong = errors.New("http2: request body larger than specified content length") ) func (cs *clientStream) writeRequestBody(body io.Reader, bodyCloser io.Closer) (err error) { @@ -1238,10 +1253,32 @@ func (cs *clientStream) writeRequestBody(body io.Reader, bodyCloser io.Closer) ( req := cs.req hasTrailers := req.Trailer != nil + remainLen := actualContentLength(req) + hasContentLen := remainLen != -1 var sawEOF bool for !sawEOF { - n, err := body.Read(buf) + n, err := body.Read(buf[:len(buf)-1]) + if hasContentLen { + remainLen -= int64(n) + if remainLen == 0 && err == nil { + // The request body's Content-Length was predeclared and + // we just finished reading it all, but the underlying io.Reader + // returned the final chunk with a nil error (which is one of + // the two valid things a Reader can do at EOF). Because we'd prefer + // to send the END_STREAM bit early, double-check that we're actually + // at EOF. Subsequent reads should return (0, EOF) at this point. + // If either value is different, we return an error in one of two ways below. + var n1 int + n1, err = body.Read(buf[n:]) + remainLen -= int64(n1) + } + if remainLen < 0 { + err = errReqBodyTooLong + cc.writeStreamReset(cs.ID, ErrCodeCancel, err) + return err + } + } if err == io.EOF { sawEOF = true err = nil @@ -1454,7 +1491,29 @@ func (cc *ClientConn) encodeHeaders(req *http.Request, addGzipHeader bool, trail if vv[0] == "" { continue } - + } else if strings.EqualFold(k, "cookie") { + // Per 8.1.2.5 To allow for better compression efficiency, the + // Cookie header field MAY be split into separate header fields, + // each with one or more cookie-pairs. + for _, v := range vv { + for { + p := strings.IndexByte(v, ';') + if p < 0 { + break + } + f("cookie", v[:p]) + p++ + // strip space after semicolon if any. + for p+1 <= len(v) && v[p] == ' ' { + p++ + } + v = v[p:] + } + if len(v) > 0 { + f("cookie", v) + } + } + continue } for _, v := range vv { @@ -1592,6 +1651,7 @@ func (cc *ClientConn) streamByID(id uint32, andRemove bool) *clientStream { delete(cc.streams, id) if len(cc.streams) == 0 && cc.idleTimer != nil { cc.idleTimer.Reset(cc.idleTimeout) + cc.lastIdle = time.Now() } close(cs.done) // Wake up checkResetOrDone via clientStream.awaitFlowControl and @@ -1832,7 +1892,9 @@ func (rl *clientConnReadLoop) handleResponse(cs *clientStream, f *MetaHeadersFra return nil, errors.New("malformed response from server: malformed non-numeric status pseudo header") } - header := make(http.Header) + regularFields := f.RegularFields() + strs := make([]string, len(regularFields)) + header := make(http.Header, len(regularFields)) res := &http.Response{ Proto: "HTTP/2.0", ProtoMajor: 2, @@ -1840,7 +1902,7 @@ func (rl *clientConnReadLoop) handleResponse(cs *clientStream, f *MetaHeadersFra StatusCode: statusCode, Status: status + " " + http.StatusText(statusCode), } - for _, hf := range f.RegularFields() { + for _, hf := range regularFields { key := http.CanonicalHeaderKey(hf.Name) if key == "Trailer" { t := res.Trailer @@ -1852,7 +1914,18 @@ func (rl *clientConnReadLoop) handleResponse(cs *clientStream, f *MetaHeadersFra t[http.CanonicalHeaderKey(v)] = nil }) } else { - header[key] = append(header[key], hf.Value) + vv := header[key] + if vv == nil && len(strs) > 0 { + // More than likely this will be a single-element key. + // Most headers aren't multi-valued. + // Set the capacity on strs[0] to 1, so any future append + // won't extend the slice into the other strings. + vv, strs = strs[:1:1], strs[1:] + vv[0] = hf.Value + header[key] = vv + } else { + header[key] = append(vv, hf.Value) + } } } @@ -2138,8 +2211,6 @@ func (rl *clientConnReadLoop) processData(f *DataFrame) error { return nil } -var errInvalidTrailers = errors.New("http2: invalid trailers") - func (rl *clientConnReadLoop) endStream(cs *clientStream) { // TODO: check that any declared content-length matches, like // server.go's (*stream).endStream method. @@ -2370,7 +2441,6 @@ func (cc *ClientConn) writeStreamReset(streamID uint32, code ErrCode, err error) var ( errResponseHeaderListSize = errors.New("http2: response header list larger than advertised limit") errRequestHeaderListSize = errors.New("http2: request header list larger than peer's advertised limit") - errPseudoTrailers = errors.New("http2: invalid pseudo header in trailers") ) func (cc *ClientConn) logf(format string, args ...interface{}) { diff --git a/vendor/golang.org/x/net/http2/writesched_priority.go b/vendor/golang.org/x/net/http2/writesched_priority.go index 848fed6..2618b2c 100644 --- a/vendor/golang.org/x/net/http2/writesched_priority.go +++ b/vendor/golang.org/x/net/http2/writesched_priority.go @@ -149,7 +149,7 @@ func (n *priorityNode) addBytes(b int64) { } // walkReadyInOrder iterates over the tree in priority order, calling f for each node -// with a non-empty write queue. When f returns true, this funcion returns true and the +// with a non-empty write queue. When f returns true, this function returns true and the // walk halts. tmp is used as scratch space for sorting. // // f(n, openParent) takes two arguments: the node to visit, n, and a bool that is true diff --git a/vendor/golang.org/x/net/idna/tables11.0.0.go b/vendor/golang.org/x/net/idna/tables11.0.0.go index c515d7a..8ce0811 100644 --- a/vendor/golang.org/x/net/idna/tables11.0.0.go +++ b/vendor/golang.org/x/net/idna/tables11.0.0.go @@ -1,6 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -// +build go1.13 +// +build go1.13,!go1.14 package idna diff --git a/vendor/golang.org/x/net/idna/tables12.00.go b/vendor/golang.org/x/net/idna/tables12.00.go new file mode 100644 index 0000000..f4b8ea3 --- /dev/null +++ b/vendor/golang.org/x/net/idna/tables12.00.go @@ -0,0 +1,4733 @@ +// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. + +// +build go1.14 + +package idna + +// UnicodeVersion is the Unicode version from which the tables in this package are derived. +const UnicodeVersion = "12.0.0" + +var mappings string = "" + // Size: 8178 bytes + "\x00\x01 \x03 ̈\x01a\x03 ̄\x012\x013\x03 ́\x03 ̧\x011\x01o\x051⁄4\x051⁄2" + + "\x053⁄4\x03i̇\x03l·\x03ʼn\x01s\x03dž\x03ⱥ\x03ⱦ\x01h\x01j\x01r\x01w\x01y" + + "\x03 ̆\x03 ̇\x03 ̊\x03 ̨\x03 ̃\x03 ̋\x01l\x01x\x04̈́\x03 ι\x01;\x05 ̈́" + + "\x04եւ\x04اٴ\x04وٴ\x04ۇٴ\x04يٴ\x06क़\x06ख़\x06ग़\x06ज़\x06ड़\x06ढ़\x06फ़" + + "\x06य़\x06ড়\x06ঢ়\x06য়\x06ਲ਼\x06ਸ਼\x06ਖ਼\x06ਗ਼\x06ਜ਼\x06ਫ਼\x06ଡ଼\x06ଢ଼" + + "\x06ํา\x06ໍາ\x06ຫນ\x06ຫມ\x06གྷ\x06ཌྷ\x06དྷ\x06བྷ\x06ཛྷ\x06ཀྵ\x06ཱི\x06ཱུ" + + "\x06ྲྀ\x09ྲཱྀ\x06ླྀ\x09ླཱྀ\x06ཱྀ\x06ྒྷ\x06ྜྷ\x06ྡྷ\x06ྦྷ\x06ྫྷ\x06ྐྵ\x02" + + "в\x02д\x02о\x02с\x02т\x02ъ\x02ѣ\x02æ\x01b\x01d\x01e\x02ǝ\x01g\x01i\x01k" + + "\x01m\x01n\x02ȣ\x01p\x01t\x01u\x02ɐ\x02ɑ\x02ə\x02ɛ\x02ɜ\x02ŋ\x02ɔ\x02ɯ" + + "\x01v\x02β\x02γ\x02δ\x02φ\x02χ\x02ρ\x02н\x02ɒ\x01c\x02ɕ\x02ð\x01f\x02ɟ" + + "\x02ɡ\x02ɥ\x02ɨ\x02ɩ\x02ɪ\x02ʝ\x02ɭ\x02ʟ\x02ɱ\x02ɰ\x02ɲ\x02ɳ\x02ɴ\x02ɵ" + + "\x02ɸ\x02ʂ\x02ʃ\x02ƫ\x02ʉ\x02ʊ\x02ʋ\x02ʌ\x01z\x02ʐ\x02ʑ\x02ʒ\x02θ\x02ss" + + "\x02ά\x02έ\x02ή\x02ί\x02ό\x02ύ\x02ώ\x05ἀι\x05ἁι\x05ἂι\x05ἃι\x05ἄι\x05ἅι" + + "\x05ἆι\x05ἇι\x05ἠι\x05ἡι\x05ἢι\x05ἣι\x05ἤι\x05ἥι\x05ἦι\x05ἧι\x05ὠι\x05ὡι" + + "\x05ὢι\x05ὣι\x05ὤι\x05ὥι\x05ὦι\x05ὧι\x05ὰι\x04αι\x04άι\x05ᾶι\x02ι\x05 ̈͂" + + "\x05ὴι\x04ηι\x04ήι\x05ῆι\x05 ̓̀\x05 ̓́\x05 ̓͂\x02ΐ\x05 ̔̀\x05 ̔́\x05 ̔͂" + + "\x02ΰ\x05 ̈̀\x01`\x05ὼι\x04ωι\x04ώι\x05ῶι\x06′′\x09′′′\x06‵‵\x09‵‵‵\x02!" + + "!\x02??\x02?!\x02!?\x0c′′′′\x010\x014\x015\x016\x017\x018\x019\x01+\x01=" + + "\x01(\x01)\x02rs\x02ħ\x02no\x01q\x02sm\x02tm\x02ω\x02å\x02א\x02ב\x02ג" + + "\x02ד\x02π\x051⁄7\x051⁄9\x061⁄10\x051⁄3\x052⁄3\x051⁄5\x052⁄5\x053⁄5\x054" + + "⁄5\x051⁄6\x055⁄6\x051⁄8\x053⁄8\x055⁄8\x057⁄8\x041⁄\x02ii\x02iv\x02vi" + + "\x04viii\x02ix\x02xi\x050⁄3\x06∫∫\x09∫∫∫\x06∮∮\x09∮∮∮\x0210\x0211\x0212" + + "\x0213\x0214\x0215\x0216\x0217\x0218\x0219\x0220\x04(10)\x04(11)\x04(12)" + + "\x04(13)\x04(14)\x04(15)\x04(16)\x04(17)\x04(18)\x04(19)\x04(20)\x0c∫∫∫∫" + + "\x02==\x05⫝̸\x02ɫ\x02ɽ\x02ȿ\x02ɀ\x01.\x04 ゙\x04 ゚\x06より\x06コト\x05(ᄀ)\x05" + + "(ᄂ)\x05(ᄃ)\x05(ᄅ)\x05(ᄆ)\x05(ᄇ)\x05(ᄉ)\x05(ᄋ)\x05(ᄌ)\x05(ᄎ)\x05(ᄏ)\x05(ᄐ" + + ")\x05(ᄑ)\x05(ᄒ)\x05(가)\x05(나)\x05(다)\x05(라)\x05(마)\x05(바)\x05(사)\x05(아)" + + "\x05(자)\x05(차)\x05(카)\x05(타)\x05(파)\x05(하)\x05(주)\x08(오전)\x08(오후)\x05(一)" + + "\x05(二)\x05(三)\x05(四)\x05(五)\x05(六)\x05(七)\x05(八)\x05(九)\x05(十)\x05(月)" + + "\x05(火)\x05(水)\x05(木)\x05(金)\x05(土)\x05(日)\x05(株)\x05(有)\x05(社)\x05(名)" + + "\x05(特)\x05(財)\x05(祝)\x05(労)\x05(代)\x05(呼)\x05(学)\x05(監)\x05(企)\x05(資)" + + "\x05(協)\x05(祭)\x05(休)\x05(自)\x05(至)\x0221\x0222\x0223\x0224\x0225\x0226" + + "\x0227\x0228\x0229\x0230\x0231\x0232\x0233\x0234\x0235\x06참고\x06주의\x0236" + + "\x0237\x0238\x0239\x0240\x0241\x0242\x0243\x0244\x0245\x0246\x0247\x0248" + + "\x0249\x0250\x041月\x042月\x043月\x044月\x045月\x046月\x047月\x048月\x049月\x0510" + + "月\x0511月\x0512月\x02hg\x02ev\x0cアパート\x0cアルファ\x0cアンペア\x09アール\x0cイニング\x09" + + "インチ\x09ウォン\x0fエスクード\x0cエーカー\x09オンス\x09オーム\x09カイリ\x0cカラット\x0cカロリー\x09ガロ" + + "ン\x09ガンマ\x06ギガ\x09ギニー\x0cキュリー\x0cギルダー\x06キロ\x0fキログラム\x12キロメートル\x0fキロワッ" + + "ト\x09グラム\x0fグラムトン\x0fクルゼイロ\x0cクローネ\x09ケース\x09コルナ\x09コーポ\x0cサイクル\x0fサンチ" + + "ーム\x0cシリング\x09センチ\x09セント\x09ダース\x06デシ\x06ドル\x06トン\x06ナノ\x09ノット\x09ハイツ" + + "\x0fパーセント\x09パーツ\x0cバーレル\x0fピアストル\x09ピクル\x06ピコ\x06ビル\x0fファラッド\x0cフィート" + + "\x0fブッシェル\x09フラン\x0fヘクタール\x06ペソ\x09ペニヒ\x09ヘルツ\x09ペンス\x09ページ\x09ベータ\x0cポイ" + + "ント\x09ボルト\x06ホン\x09ポンド\x09ホール\x09ホーン\x0cマイクロ\x09マイル\x09マッハ\x09マルク\x0fマ" + + "ンション\x0cミクロン\x06ミリ\x0fミリバール\x06メガ\x0cメガトン\x0cメートル\x09ヤード\x09ヤール\x09ユアン" + + "\x0cリットル\x06リラ\x09ルピー\x0cルーブル\x06レム\x0fレントゲン\x09ワット\x040点\x041点\x042点" + + "\x043点\x044点\x045点\x046点\x047点\x048点\x049点\x0510点\x0511点\x0512点\x0513点" + + "\x0514点\x0515点\x0516点\x0517点\x0518点\x0519点\x0520点\x0521点\x0522点\x0523点" + + "\x0524点\x02da\x02au\x02ov\x02pc\x02dm\x02iu\x06平成\x06昭和\x06大正\x06明治\x0c株" + + "式会社\x02pa\x02na\x02ma\x02ka\x02kb\x02mb\x02gb\x04kcal\x02pf\x02nf\x02m" + + "g\x02kg\x02hz\x02ml\x02dl\x02kl\x02fm\x02nm\x02mm\x02cm\x02km\x02m2\x02m" + + "3\x05m∕s\x06m∕s2\x07rad∕s\x08rad∕s2\x02ps\x02ns\x02ms\x02pv\x02nv\x02mv" + + "\x02kv\x02pw\x02nw\x02mw\x02kw\x02bq\x02cc\x02cd\x06c∕kg\x02db\x02gy\x02" + + "ha\x02hp\x02in\x02kk\x02kt\x02lm\x02ln\x02lx\x02ph\x02pr\x02sr\x02sv\x02" + + "wb\x05v∕m\x05a∕m\x041日\x042日\x043日\x044日\x045日\x046日\x047日\x048日\x049日" + + "\x0510日\x0511日\x0512日\x0513日\x0514日\x0515日\x0516日\x0517日\x0518日\x0519日" + + "\x0520日\x0521日\x0522日\x0523日\x0524日\x0525日\x0526日\x0527日\x0528日\x0529日" + + "\x0530日\x0531日\x02ь\x02ɦ\x02ɬ\x02ʞ\x02ʇ\x02œ\x04𤋮\x04𢡊\x04𢡄\x04𣏕\x04𥉉" + + "\x04𥳐\x04𧻓\x02ff\x02fi\x02fl\x02st\x04մն\x04մե\x04մի\x04վն\x04մխ\x04יִ" + + "\x04ײַ\x02ע\x02ה\x02כ\x02ל\x02ם\x02ר\x02ת\x04שׁ\x04שׂ\x06שּׁ\x06שּׂ\x04א" + + "ַ\x04אָ\x04אּ\x04בּ\x04גּ\x04דּ\x04הּ\x04וּ\x04זּ\x04טּ\x04יּ\x04ךּ\x04" + + "כּ\x04לּ\x04מּ\x04נּ\x04סּ\x04ףּ\x04פּ\x04צּ\x04קּ\x04רּ\x04שּ\x04תּ" + + "\x04וֹ\x04בֿ\x04כֿ\x04פֿ\x04אל\x02ٱ\x02ٻ\x02پ\x02ڀ\x02ٺ\x02ٿ\x02ٹ\x02ڤ" + + "\x02ڦ\x02ڄ\x02ڃ\x02چ\x02ڇ\x02ڍ\x02ڌ\x02ڎ\x02ڈ\x02ژ\x02ڑ\x02ک\x02گ\x02ڳ" + + "\x02ڱ\x02ں\x02ڻ\x02ۀ\x02ہ\x02ھ\x02ے\x02ۓ\x02ڭ\x02ۇ\x02ۆ\x02ۈ\x02ۋ\x02ۅ" + + "\x02ۉ\x02ې\x02ى\x04ئا\x04ئە\x04ئو\x04ئۇ\x04ئۆ\x04ئۈ\x04ئې\x04ئى\x02ی\x04" + + "ئج\x04ئح\x04ئم\x04ئي\x04بج\x04بح\x04بخ\x04بم\x04بى\x04بي\x04تج\x04تح" + + "\x04تخ\x04تم\x04تى\x04تي\x04ثج\x04ثم\x04ثى\x04ثي\x04جح\x04جم\x04حج\x04حم" + + "\x04خج\x04خح\x04خم\x04سج\x04سح\x04سخ\x04سم\x04صح\x04صم\x04ضج\x04ضح\x04ضخ" + + "\x04ضم\x04طح\x04طم\x04ظم\x04عج\x04عم\x04غج\x04غم\x04فج\x04فح\x04فخ\x04فم" + + "\x04فى\x04في\x04قح\x04قم\x04قى\x04قي\x04كا\x04كج\x04كح\x04كخ\x04كل\x04كم" + + "\x04كى\x04كي\x04لج\x04لح\x04لخ\x04لم\x04لى\x04لي\x04مج\x04مح\x04مخ\x04مم" + + "\x04مى\x04مي\x04نج\x04نح\x04نخ\x04نم\x04نى\x04ني\x04هج\x04هم\x04هى\x04هي" + + "\x04يج\x04يح\x04يخ\x04يم\x04يى\x04يي\x04ذٰ\x04رٰ\x04ىٰ\x05 ٌّ\x05 ٍّ\x05" + + " َّ\x05 ُّ\x05 ِّ\x05 ّٰ\x04ئر\x04ئز\x04ئن\x04بر\x04بز\x04بن\x04تر\x04تز" + + "\x04تن\x04ثر\x04ثز\x04ثن\x04ما\x04نر\x04نز\x04نن\x04ير\x04يز\x04ين\x04ئخ" + + "\x04ئه\x04به\x04ته\x04صخ\x04له\x04نه\x04هٰ\x04يه\x04ثه\x04سه\x04شم\x04شه" + + "\x06ـَّ\x06ـُّ\x06ـِّ\x04طى\x04طي\x04عى\x04عي\x04غى\x04غي\x04سى\x04سي" + + "\x04شى\x04شي\x04حى\x04حي\x04جى\x04جي\x04خى\x04خي\x04صى\x04صي\x04ضى\x04ضي" + + "\x04شج\x04شح\x04شخ\x04شر\x04سر\x04صر\x04ضر\x04اً\x06تجم\x06تحج\x06تحم" + + "\x06تخم\x06تمج\x06تمح\x06تمخ\x06جمح\x06حمي\x06حمى\x06سحج\x06سجح\x06سجى" + + "\x06سمح\x06سمج\x06سمم\x06صحح\x06صمم\x06شحم\x06شجي\x06شمخ\x06شمم\x06ضحى" + + "\x06ضخم\x06طمح\x06طمم\x06طمي\x06عجم\x06عمم\x06عمى\x06غمم\x06غمي\x06غمى" + + "\x06فخم\x06قمح\x06قمم\x06لحم\x06لحي\x06لحى\x06لجج\x06لخم\x06لمح\x06محج" + + "\x06محم\x06محي\x06مجح\x06مجم\x06مخج\x06مخم\x06مجخ\x06همج\x06همم\x06نحم" + + "\x06نحى\x06نجم\x06نجى\x06نمي\x06نمى\x06يمم\x06بخي\x06تجي\x06تجى\x06تخي" + + "\x06تخى\x06تمي\x06تمى\x06جمي\x06جحى\x06جمى\x06سخى\x06صحي\x06شحي\x06ضحي" + + "\x06لجي\x06لمي\x06يحي\x06يجي\x06يمي\x06ممي\x06قمي\x06نحي\x06عمي\x06كمي" + + "\x06نجح\x06مخي\x06لجم\x06كمم\x06جحي\x06حجي\x06مجي\x06فمي\x06بحي\x06سخي" + + "\x06نجي\x06صلے\x06قلے\x08الله\x08اكبر\x08محمد\x08صلعم\x08رسول\x08عليه" + + "\x08وسلم\x06صلى!صلى الله عليه وسلم\x0fجل جلاله\x08ریال\x01,\x01:\x01!" + + "\x01?\x01_\x01{\x01}\x01[\x01]\x01#\x01&\x01*\x01-\x01<\x01>\x01\\\x01$" + + "\x01%\x01@\x04ـً\x04ـَ\x04ـُ\x04ـِ\x04ـّ\x04ـْ\x02ء\x02آ\x02أ\x02ؤ\x02إ" + + "\x02ئ\x02ا\x02ب\x02ة\x02ت\x02ث\x02ج\x02ح\x02خ\x02د\x02ذ\x02ر\x02ز\x02س" + + "\x02ش\x02ص\x02ض\x02ط\x02ظ\x02ع\x02غ\x02ف\x02ق\x02ك\x02ل\x02م\x02ن\x02ه" + + "\x02و\x02ي\x04لآ\x04لأ\x04لإ\x04لا\x01\x22\x01'\x01/\x01^\x01|\x01~\x02¢" + + "\x02£\x02¬\x02¦\x02¥\x08𝅗𝅥\x08𝅘𝅥\x0c𝅘𝅥𝅮\x0c𝅘𝅥𝅯\x0c𝅘𝅥𝅰\x0c𝅘𝅥𝅱\x0c𝅘𝅥𝅲\x08𝆹" + + "𝅥\x08𝆺𝅥\x0c𝆹𝅥𝅮\x0c𝆺𝅥𝅮\x0c𝆹𝅥𝅯\x0c𝆺𝅥𝅯\x02ı\x02ȷ\x02α\x02ε\x02ζ\x02η\x02" + + "κ\x02λ\x02μ\x02ν\x02ξ\x02ο\x02σ\x02τ\x02υ\x02ψ\x03∇\x03∂\x02ϝ\x02ٮ\x02ڡ" + + "\x02ٯ\x020,\x021,\x022,\x023,\x024,\x025,\x026,\x027,\x028,\x029,\x03(a)" + + "\x03(b)\x03(c)\x03(d)\x03(e)\x03(f)\x03(g)\x03(h)\x03(i)\x03(j)\x03(k)" + + "\x03(l)\x03(m)\x03(n)\x03(o)\x03(p)\x03(q)\x03(r)\x03(s)\x03(t)\x03(u)" + + "\x03(v)\x03(w)\x03(x)\x03(y)\x03(z)\x07〔s〕\x02wz\x02hv\x02sd\x03ppv\x02w" + + "c\x02mc\x02md\x02mr\x02dj\x06ほか\x06ココ\x03サ\x03手\x03字\x03双\x03デ\x03二\x03多" + + "\x03解\x03天\x03交\x03映\x03無\x03料\x03前\x03後\x03再\x03新\x03初\x03終\x03生\x03販" + + "\x03声\x03吹\x03演\x03投\x03捕\x03一\x03三\x03遊\x03左\x03中\x03右\x03指\x03走\x03打" + + "\x03禁\x03空\x03合\x03満\x03有\x03月\x03申\x03割\x03営\x03配\x09〔本〕\x09〔三〕\x09〔二〕" + + "\x09〔安〕\x09〔点〕\x09〔打〕\x09〔盗〕\x09〔勝〕\x09〔敗〕\x03得\x03可\x03丽\x03丸\x03乁\x03你" + + "\x03侮\x03侻\x03倂\x03偺\x03備\x03僧\x03像\x03㒞\x03免\x03兔\x03兤\x03具\x03㒹\x03內" + + "\x03冗\x03冤\x03仌\x03冬\x03况\x03凵\x03刃\x03㓟\x03刻\x03剆\x03剷\x03㔕\x03勇\x03勉" + + "\x03勤\x03勺\x03包\x03匆\x03北\x03卉\x03卑\x03博\x03即\x03卽\x03卿\x03灰\x03及\x03叟" + + "\x03叫\x03叱\x03吆\x03咞\x03吸\x03呈\x03周\x03咢\x03哶\x03唐\x03啓\x03啣\x03善\x03喙" + + "\x03喫\x03喳\x03嗂\x03圖\x03嘆\x03圗\x03噑\x03噴\x03切\x03壮\x03城\x03埴\x03堍\x03型" + + "\x03堲\x03報\x03墬\x03売\x03壷\x03夆\x03夢\x03奢\x03姬\x03娛\x03娧\x03姘\x03婦\x03㛮" + + "\x03嬈\x03嬾\x03寃\x03寘\x03寧\x03寳\x03寿\x03将\x03尢\x03㞁\x03屠\x03屮\x03峀\x03岍" + + "\x03嵃\x03嵮\x03嵫\x03嵼\x03巡\x03巢\x03㠯\x03巽\x03帨\x03帽\x03幩\x03㡢\x03㡼\x03庰" + + "\x03庳\x03庶\x03廊\x03廾\x03舁\x03弢\x03㣇\x03形\x03彫\x03㣣\x03徚\x03忍\x03志\x03忹" + + "\x03悁\x03㤺\x03㤜\x03悔\x03惇\x03慈\x03慌\x03慎\x03慺\x03憎\x03憲\x03憤\x03憯\x03懞" + + "\x03懲\x03懶\x03成\x03戛\x03扝\x03抱\x03拔\x03捐\x03挽\x03拼\x03捨\x03掃\x03揤\x03搢" + + "\x03揅\x03掩\x03㨮\x03摩\x03摾\x03撝\x03摷\x03㩬\x03敏\x03敬\x03旣\x03書\x03晉\x03㬙" + + "\x03暑\x03㬈\x03㫤\x03冒\x03冕\x03最\x03暜\x03肭\x03䏙\x03朗\x03望\x03朡\x03杞\x03杓" + + "\x03㭉\x03柺\x03枅\x03桒\x03梅\x03梎\x03栟\x03椔\x03㮝\x03楂\x03榣\x03槪\x03檨\x03櫛" + + "\x03㰘\x03次\x03歔\x03㱎\x03歲\x03殟\x03殺\x03殻\x03汎\x03沿\x03泍\x03汧\x03洖\x03派" + + "\x03海\x03流\x03浩\x03浸\x03涅\x03洴\x03港\x03湮\x03㴳\x03滋\x03滇\x03淹\x03潮\x03濆" + + "\x03瀹\x03瀞\x03瀛\x03㶖\x03灊\x03災\x03灷\x03炭\x03煅\x03熜\x03爨\x03爵\x03牐\x03犀" + + "\x03犕\x03獺\x03王\x03㺬\x03玥\x03㺸\x03瑇\x03瑜\x03瑱\x03璅\x03瓊\x03㼛\x03甤\x03甾" + + "\x03異\x03瘐\x03㿼\x03䀈\x03直\x03眞\x03真\x03睊\x03䀹\x03瞋\x03䁆\x03䂖\x03硎\x03碌" + + "\x03磌\x03䃣\x03祖\x03福\x03秫\x03䄯\x03穀\x03穊\x03穏\x03䈂\x03篆\x03築\x03䈧\x03糒" + + "\x03䊠\x03糨\x03糣\x03紀\x03絣\x03䌁\x03緇\x03縂\x03繅\x03䌴\x03䍙\x03罺\x03羕\x03翺" + + "\x03者\x03聠\x03聰\x03䏕\x03育\x03脃\x03䐋\x03脾\x03媵\x03舄\x03辞\x03䑫\x03芑\x03芋" + + "\x03芝\x03劳\x03花\x03芳\x03芽\x03苦\x03若\x03茝\x03荣\x03莭\x03茣\x03莽\x03菧\x03著" + + "\x03荓\x03菊\x03菌\x03菜\x03䔫\x03蓱\x03蓳\x03蔖\x03蕤\x03䕝\x03䕡\x03䕫\x03虐\x03虜" + + "\x03虧\x03虩\x03蚩\x03蚈\x03蜎\x03蛢\x03蝹\x03蜨\x03蝫\x03螆\x03蟡\x03蠁\x03䗹\x03衠" + + "\x03衣\x03裗\x03裞\x03䘵\x03裺\x03㒻\x03䚾\x03䛇\x03誠\x03諭\x03變\x03豕\x03貫\x03賁" + + "\x03贛\x03起\x03跋\x03趼\x03跰\x03軔\x03輸\x03邔\x03郱\x03鄑\x03鄛\x03鈸\x03鋗\x03鋘" + + "\x03鉼\x03鏹\x03鐕\x03開\x03䦕\x03閷\x03䧦\x03雃\x03嶲\x03霣\x03䩮\x03䩶\x03韠\x03䪲" + + "\x03頋\x03頩\x03飢\x03䬳\x03餩\x03馧\x03駂\x03駾\x03䯎\x03鬒\x03鱀\x03鳽\x03䳎\x03䳭" + + "\x03鵧\x03䳸\x03麻\x03䵖\x03黹\x03黾\x03鼅\x03鼏\x03鼖\x03鼻" + +var xorData string = "" + // Size: 4862 bytes + "\x02\x0c\x09\x02\xb0\xec\x02\xad\xd8\x02\xad\xd9\x02\x06\x07\x02\x0f\x12" + + "\x02\x0f\x1f\x02\x0f\x1d\x02\x01\x13\x02\x0f\x16\x02\x0f\x0b\x02\x0f3" + + "\x02\x0f7\x02\x0f?\x02\x0f/\x02\x0f*\x02\x0c&\x02\x0c*\x02\x0c;\x02\x0c9" + + "\x02\x0c%\x02\xab\xed\x02\xab\xe2\x02\xab\xe3\x02\xa9\xe0\x02\xa9\xe1" + + "\x02\xa9\xe6\x02\xa3\xcb\x02\xa3\xc8\x02\xa3\xc9\x02\x01#\x02\x01\x08" + + "\x02\x0e>\x02\x0e'\x02\x0f\x03\x02\x03\x0d\x02\x03\x09\x02\x03\x17\x02" + + "\x03\x0e\x02\x02\x03\x02\x011\x02\x01\x00\x02\x01\x10\x02\x03<\x02\x07" + + "\x0d\x02\x02\x0c\x02\x0c0\x02\x01\x03\x02\x01\x01\x02\x01 \x02\x01\x22" + + "\x02\x01)\x02\x01\x0a\x02\x01\x0c\x02\x02\x06\x02\x02\x02\x02\x03\x10" + + "\x03\x037 \x03\x0b+\x03\x021\x00\x02\x01\x04\x02\x01\x02\x02\x019\x02" + + "\x03\x1c\x02\x02$\x03\x80p$\x02\x03:\x02\x03\x0a\x03\xc1r.\x03\xc1r,\x03" + + "\xc1r\x02\x02\x02:\x02\x02>\x02\x02,\x02\x02\x10\x02\x02\x00\x03\xc1s<" + + "\x03\xc1s*\x03\xc2L$\x03\xc2L;\x02\x09)\x02\x0a\x19\x03\x83\xab\xe3\x03" + + "\x83\xab\xf2\x03 4\xe0\x03\x81\xab\xea\x03\x81\xab\xf3\x03 4\xef\x03\x96" + + "\xe1\xcd\x03\x84\xe5\xc3\x02\x0d\x11\x03\x8b\xec\xcb\x03\x94\xec\xcf\x03" + + "\x9a\xec\xc2\x03\x8b\xec\xdb\x03\x94\xec\xdf\x03\x9a\xec\xd2\x03\x01\x0c" + + "!\x03\x01\x0c#\x03ʠ\x9d\x03ʣ\x9c\x03ʢ\x9f\x03ʥ\x9e\x03ʤ\x91\x03ʧ\x90\x03" + + "ʦ\x93\x03ʩ\x92\x03ʨ\x95\x03\xca\xf3\xb5\x03\xca\xf0\xb4\x03\xca\xf1\xb7" + + "\x03\xca\xf6\xb6\x03\xca\xf7\x89\x03\xca\xf4\x88\x03\xca\xf5\x8b\x03\xca" + + "\xfa\x8a\x03\xca\xfb\x8d\x03\xca\xf8\x8c\x03\xca\xf9\x8f\x03\xca\xfe\x8e" + + "\x03\xca\xff\x81\x03\xca\xfc\x80\x03\xca\xfd\x83\x03\xca\xe2\x82\x03\xca" + + "\xe3\x85\x03\xca\xe0\x84\x03\xca\xe1\x87\x03\xca\xe6\x86\x03\xca\xe7\x99" + + "\x03\xca\xe4\x98\x03\xca\xe5\x9b\x03\xca\xea\x9a\x03\xca\xeb\x9d\x03\xca" + + "\xe8\x9c\x03ؓ\x89\x03ߔ\x8b\x02\x010\x03\x03\x04\x1e\x03\x04\x15\x12\x03" + + "\x0b\x05,\x03\x06\x04\x00\x03\x06\x04)\x03\x06\x044\x03\x06\x04<\x03\x06" + + "\x05\x1d\x03\x06\x06\x00\x03\x06\x06\x0a\x03\x06\x06'\x03\x06\x062\x03" + + "\x0786\x03\x079/\x03\x079 \x03\x07:\x0e\x03\x07:\x1b\x03\x07:%\x03\x07;/" + + "\x03\x07;%\x03\x074\x11\x03\x076\x09\x03\x077*\x03\x070\x01\x03\x070\x0f" + + "\x03\x070.\x03\x071\x16\x03\x071\x04\x03\x0710\x03\x072\x18\x03\x072-" + + "\x03\x073\x14\x03\x073>\x03\x07'\x09\x03\x07 \x00\x03\x07\x1f\x0b\x03" + + "\x07\x18#\x03\x07\x18(\x03\x07\x186\x03\x07\x18\x03\x03\x07\x19\x16\x03" + + "\x07\x116\x03\x07\x12'\x03\x07\x13\x10\x03\x07\x0c&\x03\x07\x0c\x08\x03" + + "\x07\x0c\x13\x03\x07\x0d\x02\x03\x07\x0d\x1c\x03\x07\x0b5\x03\x07\x0b" + + "\x0a\x03\x07\x0b\x01\x03\x07\x0b\x0f\x03\x07\x05\x00\x03\x07\x05\x09\x03" + + "\x07\x05\x0b\x03\x07\x07\x01\x03\x07\x07\x08\x03\x07\x00<\x03\x07\x00+" + + "\x03\x07\x01)\x03\x07\x01\x1b\x03\x07\x01\x08\x03\x07\x03?\x03\x0445\x03" + + "\x044\x08\x03\x0454\x03\x04)/\x03\x04)5\x03\x04+\x05\x03\x04+\x14\x03" + + "\x04+ \x03\x04+<\x03\x04*&\x03\x04*\x22\x03\x04&8\x03\x04!\x01\x03\x04!" + + "\x22\x03\x04\x11+\x03\x04\x10.\x03\x04\x104\x03\x04\x13=\x03\x04\x12\x04" + + "\x03\x04\x12\x0a\x03\x04\x0d\x1d\x03\x04\x0d\x07\x03\x04\x0d \x03\x05<>" + + "\x03\x055<\x03\x055!\x03\x055#\x03\x055&\x03\x054\x1d\x03\x054\x02\x03" + + "\x054\x07\x03\x0571\x03\x053\x1a\x03\x053\x16\x03\x05.<\x03\x05.\x07\x03" + + "\x05):\x03\x05)<\x03\x05)\x0c\x03\x05)\x15\x03\x05+-\x03\x05+5\x03\x05$" + + "\x1e\x03\x05$\x14\x03\x05'\x04\x03\x05'\x14\x03\x05&\x02\x03\x05\x226" + + "\x03\x05\x22\x0c\x03\x05\x22\x1c\x03\x05\x19\x0a\x03\x05\x1b\x09\x03\x05" + + "\x1b\x0c\x03\x05\x14\x07\x03\x05\x16?\x03\x05\x16\x0c\x03\x05\x0c\x05" + + "\x03\x05\x0e\x0f\x03\x05\x01\x0e\x03\x05\x00(\x03\x05\x030\x03\x05\x03" + + "\x06\x03\x0a==\x03\x0a=1\x03\x0a=,\x03\x0a=\x0c\x03\x0a??\x03\x0a<\x08" + + "\x03\x0a9!\x03\x0a9)\x03\x0a97\x03\x0a99\x03\x0a6\x0a\x03\x0a6\x1c\x03" + + "\x0a6\x17\x03\x0a7'\x03\x0a78\x03\x0a73\x03\x0a'\x01\x03\x0a'&\x03\x0a" + + "\x1f\x0e\x03\x0a\x1f\x03\x03\x0a\x1f3\x03\x0a\x1b/\x03\x0a\x18\x19\x03" + + "\x0a\x19\x01\x03\x0a\x16\x14\x03\x0a\x0e\x22\x03\x0a\x0f\x10\x03\x0a\x0f" + + "\x02\x03\x0a\x0f \x03\x0a\x0c\x04\x03\x0a\x0b>\x03\x0a\x0b+\x03\x0a\x08/" + + "\x03\x0a\x046\x03\x0a\x05\x14\x03\x0a\x00\x04\x03\x0a\x00\x10\x03\x0a" + + "\x00\x14\x03\x0b<3\x03\x0b;*\x03\x0b9\x22\x03\x0b9)\x03\x0b97\x03\x0b+" + + "\x10\x03\x0b((\x03\x0b&5\x03\x0b$\x1c\x03\x0b$\x12\x03\x0b%\x04\x03\x0b#" + + "<\x03\x0b#0\x03\x0b#\x0d\x03\x0b#\x19\x03\x0b!:\x03\x0b!\x1f\x03\x0b!" + + "\x00\x03\x0b\x1e5\x03\x0b\x1c\x1d\x03\x0b\x1d-\x03\x0b\x1d(\x03\x0b\x18." + + "\x03\x0b\x18 \x03\x0b\x18\x16\x03\x0b\x14\x13\x03\x0b\x15$\x03\x0b\x15" + + "\x22\x03\x0b\x12\x1b\x03\x0b\x12\x10\x03\x0b\x132\x03\x0b\x13=\x03\x0b" + + "\x12\x18\x03\x0b\x0c&\x03\x0b\x061\x03\x0b\x06:\x03\x0b\x05#\x03\x0b\x05" + + "<\x03\x0b\x04\x0b\x03\x0b\x04\x04\x03\x0b\x04\x1b\x03\x0b\x042\x03\x0b" + + "\x041\x03\x0b\x03\x03\x03\x0b\x03\x1d\x03\x0b\x03/\x03\x0b\x03+\x03\x0b" + + "\x02\x1b\x03\x0b\x02\x00\x03\x0b\x01\x1e\x03\x0b\x01\x08\x03\x0b\x015" + + "\x03\x06\x0d9\x03\x06\x0d=\x03\x06\x0d?\x03\x02\x001\x03\x02\x003\x03" + + "\x02\x02\x19\x03\x02\x006\x03\x02\x02\x1b\x03\x02\x004\x03\x02\x00<\x03" + + "\x02\x02\x0a\x03\x02\x02\x0e\x03\x02\x01\x1a\x03\x02\x01\x07\x03\x02\x01" + + "\x05\x03\x02\x01\x0b\x03\x02\x01%\x03\x02\x01\x0c\x03\x02\x01\x04\x03" + + "\x02\x01\x1c\x03\x02\x00.\x03\x02\x002\x03\x02\x00>\x03\x02\x00\x12\x03" + + "\x02\x00\x16\x03\x02\x011\x03\x02\x013\x03\x02\x02 \x03\x02\x02%\x03\x02" + + "\x02$\x03\x02\x028\x03\x02\x02;\x03\x02\x024\x03\x02\x012\x03\x02\x022" + + "\x03\x02\x02/\x03\x02\x01,\x03\x02\x01\x13\x03\x02\x01\x16\x03\x02\x01" + + "\x11\x03\x02\x01\x1e\x03\x02\x01\x15\x03\x02\x01\x17\x03\x02\x01\x0f\x03" + + "\x02\x01\x08\x03\x02\x00?\x03\x02\x03\x07\x03\x02\x03\x0d\x03\x02\x03" + + "\x13\x03\x02\x03\x1d\x03\x02\x03\x1f\x03\x02\x00\x03\x03\x02\x00\x0d\x03" + + "\x02\x00\x01\x03\x02\x00\x1b\x03\x02\x00\x19\x03\x02\x00\x18\x03\x02\x00" + + "\x13\x03\x02\x00/\x03\x07>\x12\x03\x07<\x1f\x03\x07>\x1d\x03\x06\x1d\x0e" + + "\x03\x07>\x1c\x03\x07>:\x03\x07>\x13\x03\x04\x12+\x03\x07?\x03\x03\x07>" + + "\x02\x03\x06\x224\x03\x06\x1a.\x03\x07<%\x03\x06\x1c\x0b\x03\x0609\x03" + + "\x05\x1f\x01\x03\x04'\x08\x03\x93\xfd\xf5\x03\x02\x0d \x03\x02\x0d#\x03" + + "\x02\x0d!\x03\x02\x0d&\x03\x02\x0d\x22\x03\x02\x0d/\x03\x02\x0d,\x03\x02" + + "\x0d$\x03\x02\x0d'\x03\x02\x0d%\x03\x02\x0d;\x03\x02\x0d=\x03\x02\x0d?" + + "\x03\x099.\x03\x08\x0b7\x03\x08\x02\x14\x03\x08\x14\x0d\x03\x08.:\x03" + + "\x089'\x03\x0f\x0b\x18\x03\x0f\x1c1\x03\x0f\x17&\x03\x0f9\x1f\x03\x0f0" + + "\x0c\x03\x0e\x0a9\x03\x0e\x056\x03\x0e\x1c#\x03\x0f\x13\x0e\x03\x072\x00" + + "\x03\x070\x0d\x03\x072\x0b\x03\x06\x11\x18\x03\x070\x10\x03\x06\x0f(\x03" + + "\x072\x05\x03\x06\x0f,\x03\x073\x15\x03\x06\x07\x08\x03\x05\x16\x02\x03" + + "\x04\x0b \x03\x05:8\x03\x05\x16%\x03\x0a\x0d\x1f\x03\x06\x16\x10\x03\x05" + + "\x1d5\x03\x05*;\x03\x05\x16\x1b\x03\x04.-\x03\x06\x1a\x19\x03\x04\x03," + + "\x03\x0b87\x03\x04/\x0a\x03\x06\x00,\x03\x04-\x01\x03\x04\x1e-\x03\x06/(" + + "\x03\x0a\x0b5\x03\x06\x0e7\x03\x06\x07.\x03\x0597\x03\x0a*%\x03\x0760" + + "\x03\x06\x0c;\x03\x05'\x00\x03\x072.\x03\x072\x08\x03\x06=\x01\x03\x06" + + "\x05\x1b\x03\x06\x06\x12\x03\x06$=\x03\x06'\x0d\x03\x04\x11\x0f\x03\x076" + + ",\x03\x06\x07;\x03\x06.,\x03\x86\xf9\xea\x03\x8f\xff\xeb\x02\x092\x02" + + "\x095\x02\x094\x02\x09;\x02\x09>\x02\x098\x02\x09*\x02\x09/\x02\x09,\x02" + + "\x09%\x02\x09&\x02\x09#\x02\x09 \x02\x08!\x02\x08%\x02\x08$\x02\x08+\x02" + + "\x08.\x02\x08*\x02\x08&\x02\x088\x02\x08>\x02\x084\x02\x086\x02\x080\x02" + + "\x08\x10\x02\x08\x17\x02\x08\x12\x02\x08\x1d\x02\x08\x1f\x02\x08\x13\x02" + + "\x08\x15\x02\x08\x14\x02\x08\x0c\x03\x8b\xfd\xd0\x03\x81\xec\xc6\x03\x87" + + "\xe0\x8a\x03-2\xe3\x03\x80\xef\xe4\x03-2\xea\x03\x88\xe6\xeb\x03\x8e\xe6" + + "\xe8\x03\x84\xe6\xe9\x03\x97\xe6\xee\x03-2\xf9\x03-2\xf6\x03\x8e\xe3\xad" + + "\x03\x80\xe3\x92\x03\x88\xe3\x90\x03\x8e\xe3\x90\x03\x80\xe3\x97\x03\x88" + + "\xe3\x95\x03\x88\xfe\xcb\x03\x8e\xfe\xca\x03\x84\xfe\xcd\x03\x91\xef\xc9" + + "\x03-2\xc1\x03-2\xc0\x03-2\xcb\x03\x88@\x09\x03\x8e@\x08\x03\x8f\xe0\xf5" + + "\x03\x8e\xe6\xf9\x03\x8e\xe0\xfa\x03\x93\xff\xf4\x03\x84\xee\xd3\x03\x0b" + + "(\x04\x023 \x03\x0b)\x08\x021;\x02\x01*\x03\x0b#\x10\x03\x0b 0\x03\x0b!" + + "\x10\x03\x0b!0\x03\x07\x15\x08\x03\x09?5\x03\x07\x1f\x08\x03\x07\x17\x0b" + + "\x03\x09\x1f\x15\x03\x0b\x1c7\x03\x0a+#\x03\x06\x1a\x1b\x03\x06\x1a\x14" + + "\x03\x0a\x01\x18\x03\x06#\x1b\x03\x0a2\x0c\x03\x0a\x01\x04\x03\x09#;\x03" + + "\x08='\x03\x08\x1a\x0a\x03\x07\x03\x0a\x111\x03\x09\x1b\x09\x03\x073.\x03\x07" + + "\x01\x00\x03\x09/,\x03\x07#>\x03\x07\x048\x03\x0a\x1f\x22\x03\x098>\x03" + + "\x09\x11\x00\x03\x08/\x17\x03\x06'\x22\x03\x0b\x1a+\x03\x0a\x22\x19\x03" + + "\x0a/1\x03\x0974\x03\x09\x0f\x22\x03\x08,\x22\x03\x08?\x14\x03\x07$5\x03" + + "\x07<3\x03\x07=*\x03\x07\x13\x18\x03\x068\x0a\x03\x06\x09\x16\x03\x06" + + "\x13\x00\x03\x08\x067\x03\x08\x01\x03\x03\x08\x12\x1d\x03\x07+7\x03\x06(" + + ";\x03\x06\x1c?\x03\x07\x0e\x17\x03\x0a\x06\x1d\x03\x0a\x19\x07\x03\x08" + + "\x14$\x03\x07$;\x03\x08,$\x03\x08\x06\x0d\x03\x07\x16\x0a\x03\x06>>\x03" + + "\x0a\x06\x12\x03\x0a\x14)\x03\x09\x0d\x1f\x03\x09\x12\x17\x03\x09\x19" + + "\x01\x03\x08\x11 \x03\x08\x1d'\x03\x06<\x1a\x03\x0a.\x00\x03\x07'\x18" + + "\x03\x0a\x22\x08\x03\x08\x0d\x0a\x03\x08\x13)\x03\x07*)\x03\x06<,\x03" + + "\x07\x0b\x1a\x03\x09.\x14\x03\x09\x0d\x1e\x03\x07\x0e#\x03\x0b\x1d'\x03" + + "\x0a\x0a8\x03\x09%2\x03\x08+&\x03\x080\x12\x03\x0a)4\x03\x08\x06\x1f\x03" + + "\x0b\x1b\x1a\x03\x0a\x1b\x0f\x03\x0b\x1d*\x03\x09\x16$\x03\x090\x11\x03" + + "\x08\x11\x08\x03\x0a*(\x03\x0a\x042\x03\x089,\x03\x074'\x03\x07\x0f\x05" + + "\x03\x09\x0b\x0a\x03\x07\x1b\x01\x03\x09\x17:\x03\x09.\x0d\x03\x07.\x11" + + "\x03\x09+\x15\x03\x080\x13\x03\x0b\x1f\x19\x03\x0a \x11\x03\x0a\x220\x03" + + "\x09\x07;\x03\x08\x16\x1c\x03\x07,\x13\x03\x07\x0e/\x03\x06\x221\x03\x0a" + + ".\x0a\x03\x0a7\x02\x03\x0a\x032\x03\x0a\x1d.\x03\x091\x06\x03\x09\x19:" + + "\x03\x08\x02/\x03\x060+\x03\x06\x0f-\x03\x06\x1c\x1f\x03\x06\x1d\x07\x03" + + "\x0a,\x11\x03\x09=\x0d\x03\x09\x0b;\x03\x07\x1b/\x03\x0a\x1f:\x03\x09 " + + "\x1f\x03\x09.\x10\x03\x094\x0b\x03\x09\x1a1\x03\x08#\x1a\x03\x084\x1d" + + "\x03\x08\x01\x1f\x03\x08\x11\x22\x03\x07'8\x03\x07\x1a>\x03\x0757\x03" + + "\x06&9\x03\x06+\x11\x03\x0a.\x0b\x03\x0a,>\x03\x0a4#\x03\x08%\x17\x03" + + "\x07\x05\x22\x03\x07\x0c\x0b\x03\x0a\x1d+\x03\x0a\x19\x16\x03\x09+\x1f" + + "\x03\x09\x08\x0b\x03\x08\x16\x18\x03\x08+\x12\x03\x0b\x1d\x0c\x03\x0a=" + + "\x10\x03\x0a\x09\x0d\x03\x0a\x10\x11\x03\x09&0\x03\x08(\x1f\x03\x087\x07" + + "\x03\x08\x185\x03\x07'6\x03\x06.\x05\x03\x06=\x04\x03\x06;;\x03\x06\x06," + + "\x03\x0b\x18>\x03\x08\x00\x18\x03\x06 \x03\x03\x06<\x00\x03\x09%\x18\x03" + + "\x0b\x1c<\x03\x0a%!\x03\x0a\x09\x12\x03\x0a\x16\x02\x03\x090'\x03\x09" + + "\x0e=\x03\x08 \x0e\x03\x08>\x03\x03\x074>\x03\x06&?\x03\x06\x19\x09\x03" + + "\x06?(\x03\x0a-\x0e\x03\x09:3\x03\x098:\x03\x09\x12\x0b\x03\x09\x1d\x17" + + "\x03\x087\x05\x03\x082\x14\x03\x08\x06%\x03\x08\x13\x1f\x03\x06\x06\x0e" + + "\x03\x0a\x22<\x03\x09/<\x03\x06>+\x03\x0a'?\x03\x0a\x13\x0c\x03\x09\x10<" + + "\x03\x07\x1b=\x03\x0a\x19\x13\x03\x09\x22\x1d\x03\x09\x07\x0d\x03\x08)" + + "\x1c\x03\x06=\x1a\x03\x0a/4\x03\x0a7\x11\x03\x0a\x16:\x03\x09?3\x03\x09:" + + "/\x03\x09\x05\x0a\x03\x09\x14\x06\x03\x087\x22\x03\x080\x07\x03\x08\x1a" + + "\x1f\x03\x07\x04(\x03\x07\x04\x09\x03\x06 %\x03\x06<\x08\x03\x0a+\x14" + + "\x03\x09\x1d\x16\x03\x0a70\x03\x08 >\x03\x0857\x03\x070\x0a\x03\x06=\x12" + + "\x03\x06\x16%\x03\x06\x1d,\x03\x099#\x03\x09\x10>\x03\x07 \x1e\x03\x08" + + "\x0c<\x03\x08\x0b\x18\x03\x08\x15+\x03\x08,:\x03\x08%\x22\x03\x07\x0a$" + + "\x03\x0b\x1c=\x03\x07+\x08\x03\x0a/\x05\x03\x0a \x07\x03\x0a\x12'\x03" + + "\x09#\x11\x03\x08\x1b\x15\x03\x0a\x06\x01\x03\x09\x1c\x1b\x03\x0922\x03" + + "\x07\x14<\x03\x07\x09\x04\x03\x061\x04\x03\x07\x0e\x01\x03\x0a\x13\x18" + + "\x03\x0a-\x0c\x03\x0a?\x0d\x03\x0a\x09\x0a\x03\x091&\x03\x0a/\x0b\x03" + + "\x08$<\x03\x083\x1d\x03\x08\x0c$\x03\x08\x0d\x07\x03\x08\x0d?\x03\x08" + + "\x0e\x14\x03\x065\x0a\x03\x08\x1a#\x03\x08\x16#\x03\x0702\x03\x07\x03" + + "\x1a\x03\x06(\x1d\x03\x06+\x1b\x03\x06\x0b\x05\x03\x06\x0b\x17\x03\x06" + + "\x0c\x04\x03\x06\x1e\x19\x03\x06+0\x03\x062\x18\x03\x0b\x16\x1e\x03\x0a+" + + "\x16\x03\x0a-?\x03\x0a#:\x03\x0a#\x10\x03\x0a%$\x03\x0a>+\x03\x0a01\x03" + + "\x0a1\x10\x03\x0a\x099\x03\x0a\x0a\x12\x03\x0a\x19\x1f\x03\x0a\x19\x12" + + "\x03\x09*)\x03\x09-\x16\x03\x09.1\x03\x09.2\x03\x09<\x0e\x03\x09> \x03" + + "\x093\x12\x03\x09\x0b\x01\x03\x09\x1c2\x03\x09\x11\x1c\x03\x09\x15%\x03" + + "\x08,&\x03\x08!\x22\x03\x089(\x03\x08\x0b\x1a\x03\x08\x0d2\x03\x08\x0c" + + "\x04\x03\x08\x0c\x06\x03\x08\x0c\x1f\x03\x08\x0c\x0c\x03\x08\x0f\x1f\x03" + + "\x08\x0f\x1d\x03\x08\x00\x14\x03\x08\x03\x14\x03\x08\x06\x16\x03\x08\x1e" + + "#\x03\x08\x11\x11\x03\x08\x10\x18\x03\x08\x14(\x03\x07)\x1e\x03\x07.1" + + "\x03\x07 $\x03\x07 '\x03\x078\x08\x03\x07\x0d0\x03\x07\x0f7\x03\x07\x05#" + + "\x03\x07\x05\x1a\x03\x07\x1a7\x03\x07\x1d-\x03\x07\x17\x10\x03\x06)\x1f" + + "\x03\x062\x0b\x03\x066\x16\x03\x06\x09\x11\x03\x09(\x1e\x03\x07!5\x03" + + "\x0b\x11\x16\x03\x0a/\x04\x03\x0a,\x1a\x03\x0b\x173\x03\x0a,1\x03\x0a/5" + + "\x03\x0a\x221\x03\x0a\x22\x0d\x03\x0a?%\x03\x0a<,\x03\x0a?#\x03\x0a>\x19" + + "\x03\x0a\x08&\x03\x0a\x0b\x0e\x03\x0a\x0c:\x03\x0a\x0c+\x03\x0a\x03\x22" + + "\x03\x0a\x06)\x03\x0a\x11\x10\x03\x0a\x11\x1a\x03\x0a\x17-\x03\x0a\x14(" + + "\x03\x09)\x1e\x03\x09/\x09\x03\x09.\x00\x03\x09,\x07\x03\x09/*\x03\x09-9" + + "\x03\x09\x228\x03\x09%\x09\x03\x09:\x12\x03\x09;\x1d\x03\x09?\x06\x03" + + "\x093%\x03\x096\x05\x03\x096\x08\x03\x097\x02\x03\x09\x07,\x03\x09\x04," + + "\x03\x09\x1f\x16\x03\x09\x11\x03\x03\x09\x11\x12\x03\x09\x168\x03\x08*" + + "\x05\x03\x08/2\x03\x084:\x03\x08\x22+\x03\x08 0\x03\x08&\x0a\x03\x08;" + + "\x10\x03\x08>$\x03\x08>\x18\x03\x0829\x03\x082:\x03\x081,\x03\x081<\x03" + + "\x081\x1c\x03\x087#\x03\x087*\x03\x08\x09'\x03\x08\x00\x1d\x03\x08\x05-" + + "\x03\x08\x1f4\x03\x08\x1d\x04\x03\x08\x16\x0f\x03\x07*7\x03\x07'!\x03" + + "\x07%\x1b\x03\x077\x0c\x03\x07\x0c1\x03\x07\x0c.\x03\x07\x00\x06\x03\x07" + + "\x01\x02\x03\x07\x010\x03\x07\x06=\x03\x07\x01\x03\x03\x07\x01\x13\x03" + + "\x07\x06\x06\x03\x07\x05\x0a\x03\x07\x1f\x09\x03\x07\x17:\x03\x06*1\x03" + + "\x06-\x1d\x03\x06\x223\x03\x062:\x03\x060$\x03\x066\x1e\x03\x064\x12\x03" + + "\x0645\x03\x06\x0b\x00\x03\x06\x0b7\x03\x06\x07\x1f\x03\x06\x15\x12\x03" + + "\x0c\x05\x0f\x03\x0b+\x0b\x03\x0b+-\x03\x06\x16\x1b\x03\x06\x15\x17\x03" + + "\x89\xca\xea\x03\x89\xca\xe8\x03\x0c8\x10\x03\x0c8\x01\x03\x0c8\x0f\x03" + + "\x0d8%\x03\x0d8!\x03\x0c8-\x03\x0c8/\x03\x0c8+\x03\x0c87\x03\x0c85\x03" + + "\x0c9\x09\x03\x0c9\x0d\x03\x0c9\x0f\x03\x0c9\x0b\x03\xcfu\x0c\x03\xcfu" + + "\x0f\x03\xcfu\x0e\x03\xcfu\x09\x03\x0c9\x10\x03\x0d9\x0c\x03\xcf`;\x03" + + "\xcf`>\x03\xcf`9\x03\xcf`8\x03\xcf`7\x03\xcf`*\x03\xcf`-\x03\xcf`,\x03" + + "\x0d\x1b\x1a\x03\x0d\x1b&\x03\x0c=.\x03\x0c=%\x03\x0c>\x1e\x03\x0c>\x14" + + "\x03\x0c?\x06\x03\x0c?\x0b\x03\x0c?\x0c\x03\x0c?\x0d\x03\x0c?\x02\x03" + + "\x0c>\x0f\x03\x0c>\x08\x03\x0c>\x09\x03\x0c>,\x03\x0c>\x0c\x03\x0c?\x13" + + "\x03\x0c?\x16\x03\x0c?\x15\x03\x0c?\x1c\x03\x0c?\x1f\x03\x0c?\x1d\x03" + + "\x0c?\x1a\x03\x0c?\x17\x03\x0c?\x08\x03\x0c?\x09\x03\x0c?\x0e\x03\x0c?" + + "\x04\x03\x0c?\x05\x03\x0c" + + "\x03\x0c=2\x03\x0c=6\x03\x0c<\x07\x03\x0c<\x05\x03\x0e:!\x03\x0e:#\x03" + + "\x0e8\x09\x03\x0e:&\x03\x0e8\x0b\x03\x0e:$\x03\x0e:,\x03\x0e8\x1a\x03" + + "\x0e8\x1e\x03\x0e:*\x03\x0e:7\x03\x0e:5\x03\x0e:;\x03\x0e:\x15\x03\x0e:<" + + "\x03\x0e:4\x03\x0e:'\x03\x0e:-\x03\x0e:%\x03\x0e:?\x03\x0e:=\x03\x0e:)" + + "\x03\x0e:/\x03\xcfs'\x03\x0d=\x0f\x03\x0d+*\x03\x0d99\x03\x0d9;\x03\x0d9" + + "?\x03\x0d)\x0d\x03\x0d(%\x02\x01\x18\x02\x01(\x02\x01\x1e\x03\x0f$!\x03" + + "\x0f87\x03\x0f4\x0e\x03\x0f5\x1d\x03\x06'\x03\x03\x0f\x08\x18\x03\x0f" + + "\x0d\x1b\x03\x0e2=\x03\x0e;\x08\x03\x0e:\x0b\x03\x0e\x06$\x03\x0e\x0d)" + + "\x03\x0e\x16\x1f\x03\x0e\x16\x1b\x03\x0d$\x0a\x03\x05,\x1d\x03\x0d. \x03" + + "\x0d.#\x03\x0c(/\x03\x09%\x02\x03\x0d90\x03\x0d\x0e4\x03\x0d\x0d\x0f\x03" + + "\x0c#\x00\x03\x0c,\x1e\x03\x0c2\x0e\x03\x0c\x01\x17\x03\x0c\x09:\x03\x0e" + + "\x173\x03\x0c\x08\x03\x03\x0c\x11\x07\x03\x0c\x10\x18\x03\x0c\x1f\x1c" + + "\x03\x0c\x19\x0e\x03\x0c\x1a\x1f\x03\x0f0>\x03\x0b->\x03\x0b<+\x03\x0b8" + + "\x13\x03\x0b\x043\x03\x0b\x14\x03\x03\x0b\x16%\x03\x0d\x22&\x03\x0b\x1a" + + "\x1a\x03\x0b\x1a\x04\x03\x0a%9\x03\x0a&2\x03\x0a&0\x03\x0a!\x1a\x03\x0a!" + + "7\x03\x0a5\x10\x03\x0a=4\x03\x0a?\x0e\x03\x0a>\x10\x03\x0a\x00 \x03\x0a" + + "\x0f:\x03\x0a\x0f9\x03\x0a\x0b\x0a\x03\x0a\x17%\x03\x0a\x1b-\x03\x09-" + + "\x1a\x03\x09,4\x03\x09.,\x03\x09)\x09\x03\x096!\x03\x091\x1f\x03\x093" + + "\x16\x03\x0c+\x1f\x03\x098 \x03\x098=\x03\x0c(\x1a\x03\x0c(\x16\x03\x09" + + "\x0a+\x03\x09\x16\x12\x03\x09\x13\x0e\x03\x09\x153\x03\x08)!\x03\x09\x1a" + + "\x01\x03\x09\x18\x01\x03\x08%#\x03\x08>\x22\x03\x08\x05%\x03\x08\x02*" + + "\x03\x08\x15;\x03\x08\x1b7\x03\x0f\x07\x1d\x03\x0f\x04\x03\x03\x070\x0c" + + "\x03\x07;\x0b\x03\x07\x08\x17\x03\x07\x12\x06\x03\x06/-\x03\x0671\x03" + + "\x065+\x03\x06>7\x03\x06\x049\x03\x05+\x1e\x03\x05,\x17\x03\x05 \x1d\x03" + + "\x05\x22\x05\x03\x050\x1d" + +// lookup returns the trie value for the first UTF-8 encoding in s and +// the width in bytes of this encoding. The size will be 0 if s does not +// hold enough bytes to complete the encoding. len(s) must be greater than 0. +func (t *idnaTrie) lookup(s []byte) (v uint16, sz int) { + c0 := s[0] + switch { + case c0 < 0x80: // is ASCII + return idnaValues[c0], 1 + case c0 < 0xC2: + return 0, 1 // Illegal UTF-8: not a starter, not ASCII. + case c0 < 0xE0: // 2-byte UTF-8 + if len(s) < 2 { + return 0, 0 + } + i := idnaIndex[c0] + c1 := s[1] + if c1 < 0x80 || 0xC0 <= c1 { + return 0, 1 // Illegal UTF-8: not a continuation byte. + } + return t.lookupValue(uint32(i), c1), 2 + case c0 < 0xF0: // 3-byte UTF-8 + if len(s) < 3 { + return 0, 0 + } + i := idnaIndex[c0] + c1 := s[1] + if c1 < 0x80 || 0xC0 <= c1 { + return 0, 1 // Illegal UTF-8: not a continuation byte. + } + o := uint32(i)<<6 + uint32(c1) + i = idnaIndex[o] + c2 := s[2] + if c2 < 0x80 || 0xC0 <= c2 { + return 0, 2 // Illegal UTF-8: not a continuation byte. + } + return t.lookupValue(uint32(i), c2), 3 + case c0 < 0xF8: // 4-byte UTF-8 + if len(s) < 4 { + return 0, 0 + } + i := idnaIndex[c0] + c1 := s[1] + if c1 < 0x80 || 0xC0 <= c1 { + return 0, 1 // Illegal UTF-8: not a continuation byte. + } + o := uint32(i)<<6 + uint32(c1) + i = idnaIndex[o] + c2 := s[2] + if c2 < 0x80 || 0xC0 <= c2 { + return 0, 2 // Illegal UTF-8: not a continuation byte. + } + o = uint32(i)<<6 + uint32(c2) + i = idnaIndex[o] + c3 := s[3] + if c3 < 0x80 || 0xC0 <= c3 { + return 0, 3 // Illegal UTF-8: not a continuation byte. + } + return t.lookupValue(uint32(i), c3), 4 + } + // Illegal rune + return 0, 1 +} + +// lookupUnsafe returns the trie value for the first UTF-8 encoding in s. +// s must start with a full and valid UTF-8 encoded rune. +func (t *idnaTrie) lookupUnsafe(s []byte) uint16 { + c0 := s[0] + if c0 < 0x80 { // is ASCII + return idnaValues[c0] + } + i := idnaIndex[c0] + if c0 < 0xE0 { // 2-byte UTF-8 + return t.lookupValue(uint32(i), s[1]) + } + i = idnaIndex[uint32(i)<<6+uint32(s[1])] + if c0 < 0xF0 { // 3-byte UTF-8 + return t.lookupValue(uint32(i), s[2]) + } + i = idnaIndex[uint32(i)<<6+uint32(s[2])] + if c0 < 0xF8 { // 4-byte UTF-8 + return t.lookupValue(uint32(i), s[3]) + } + return 0 +} + +// lookupString returns the trie value for the first UTF-8 encoding in s and +// the width in bytes of this encoding. The size will be 0 if s does not +// hold enough bytes to complete the encoding. len(s) must be greater than 0. +func (t *idnaTrie) lookupString(s string) (v uint16, sz int) { + c0 := s[0] + switch { + case c0 < 0x80: // is ASCII + return idnaValues[c0], 1 + case c0 < 0xC2: + return 0, 1 // Illegal UTF-8: not a starter, not ASCII. + case c0 < 0xE0: // 2-byte UTF-8 + if len(s) < 2 { + return 0, 0 + } + i := idnaIndex[c0] + c1 := s[1] + if c1 < 0x80 || 0xC0 <= c1 { + return 0, 1 // Illegal UTF-8: not a continuation byte. + } + return t.lookupValue(uint32(i), c1), 2 + case c0 < 0xF0: // 3-byte UTF-8 + if len(s) < 3 { + return 0, 0 + } + i := idnaIndex[c0] + c1 := s[1] + if c1 < 0x80 || 0xC0 <= c1 { + return 0, 1 // Illegal UTF-8: not a continuation byte. + } + o := uint32(i)<<6 + uint32(c1) + i = idnaIndex[o] + c2 := s[2] + if c2 < 0x80 || 0xC0 <= c2 { + return 0, 2 // Illegal UTF-8: not a continuation byte. + } + return t.lookupValue(uint32(i), c2), 3 + case c0 < 0xF8: // 4-byte UTF-8 + if len(s) < 4 { + return 0, 0 + } + i := idnaIndex[c0] + c1 := s[1] + if c1 < 0x80 || 0xC0 <= c1 { + return 0, 1 // Illegal UTF-8: not a continuation byte. + } + o := uint32(i)<<6 + uint32(c1) + i = idnaIndex[o] + c2 := s[2] + if c2 < 0x80 || 0xC0 <= c2 { + return 0, 2 // Illegal UTF-8: not a continuation byte. + } + o = uint32(i)<<6 + uint32(c2) + i = idnaIndex[o] + c3 := s[3] + if c3 < 0x80 || 0xC0 <= c3 { + return 0, 3 // Illegal UTF-8: not a continuation byte. + } + return t.lookupValue(uint32(i), c3), 4 + } + // Illegal rune + return 0, 1 +} + +// lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. +// s must start with a full and valid UTF-8 encoded rune. +func (t *idnaTrie) lookupStringUnsafe(s string) uint16 { + c0 := s[0] + if c0 < 0x80 { // is ASCII + return idnaValues[c0] + } + i := idnaIndex[c0] + if c0 < 0xE0 { // 2-byte UTF-8 + return t.lookupValue(uint32(i), s[1]) + } + i = idnaIndex[uint32(i)<<6+uint32(s[1])] + if c0 < 0xF0 { // 3-byte UTF-8 + return t.lookupValue(uint32(i), s[2]) + } + i = idnaIndex[uint32(i)<<6+uint32(s[2])] + if c0 < 0xF8 { // 4-byte UTF-8 + return t.lookupValue(uint32(i), s[3]) + } + return 0 +} + +// idnaTrie. Total size: 29708 bytes (29.01 KiB). Checksum: c3ecc76d8fffa6e6. +type idnaTrie struct{} + +func newIdnaTrie(i int) *idnaTrie { + return &idnaTrie{} +} + +// lookupValue determines the type of block n and looks up the value for b. +func (t *idnaTrie) lookupValue(n uint32, b byte) uint16 { + switch { + case n < 125: + return uint16(idnaValues[n<<6+uint32(b)]) + default: + n -= 125 + return uint16(idnaSparse.lookup(n, b)) + } +} + +// idnaValues: 127 blocks, 8128 entries, 16256 bytes +// The third block is the zero block. +var idnaValues = [8128]uint16{ + // Block 0x0, offset 0x0 + 0x00: 0x0080, 0x01: 0x0080, 0x02: 0x0080, 0x03: 0x0080, 0x04: 0x0080, 0x05: 0x0080, + 0x06: 0x0080, 0x07: 0x0080, 0x08: 0x0080, 0x09: 0x0080, 0x0a: 0x0080, 0x0b: 0x0080, + 0x0c: 0x0080, 0x0d: 0x0080, 0x0e: 0x0080, 0x0f: 0x0080, 0x10: 0x0080, 0x11: 0x0080, + 0x12: 0x0080, 0x13: 0x0080, 0x14: 0x0080, 0x15: 0x0080, 0x16: 0x0080, 0x17: 0x0080, + 0x18: 0x0080, 0x19: 0x0080, 0x1a: 0x0080, 0x1b: 0x0080, 0x1c: 0x0080, 0x1d: 0x0080, + 0x1e: 0x0080, 0x1f: 0x0080, 0x20: 0x0080, 0x21: 0x0080, 0x22: 0x0080, 0x23: 0x0080, + 0x24: 0x0080, 0x25: 0x0080, 0x26: 0x0080, 0x27: 0x0080, 0x28: 0x0080, 0x29: 0x0080, + 0x2a: 0x0080, 0x2b: 0x0080, 0x2c: 0x0080, 0x2d: 0x0008, 0x2e: 0x0008, 0x2f: 0x0080, + 0x30: 0x0008, 0x31: 0x0008, 0x32: 0x0008, 0x33: 0x0008, 0x34: 0x0008, 0x35: 0x0008, + 0x36: 0x0008, 0x37: 0x0008, 0x38: 0x0008, 0x39: 0x0008, 0x3a: 0x0080, 0x3b: 0x0080, + 0x3c: 0x0080, 0x3d: 0x0080, 0x3e: 0x0080, 0x3f: 0x0080, + // Block 0x1, offset 0x40 + 0x40: 0x0080, 0x41: 0xe105, 0x42: 0xe105, 0x43: 0xe105, 0x44: 0xe105, 0x45: 0xe105, + 0x46: 0xe105, 0x47: 0xe105, 0x48: 0xe105, 0x49: 0xe105, 0x4a: 0xe105, 0x4b: 0xe105, + 0x4c: 0xe105, 0x4d: 0xe105, 0x4e: 0xe105, 0x4f: 0xe105, 0x50: 0xe105, 0x51: 0xe105, + 0x52: 0xe105, 0x53: 0xe105, 0x54: 0xe105, 0x55: 0xe105, 0x56: 0xe105, 0x57: 0xe105, + 0x58: 0xe105, 0x59: 0xe105, 0x5a: 0xe105, 0x5b: 0x0080, 0x5c: 0x0080, 0x5d: 0x0080, + 0x5e: 0x0080, 0x5f: 0x0080, 0x60: 0x0080, 0x61: 0x0008, 0x62: 0x0008, 0x63: 0x0008, + 0x64: 0x0008, 0x65: 0x0008, 0x66: 0x0008, 0x67: 0x0008, 0x68: 0x0008, 0x69: 0x0008, + 0x6a: 0x0008, 0x6b: 0x0008, 0x6c: 0x0008, 0x6d: 0x0008, 0x6e: 0x0008, 0x6f: 0x0008, + 0x70: 0x0008, 0x71: 0x0008, 0x72: 0x0008, 0x73: 0x0008, 0x74: 0x0008, 0x75: 0x0008, + 0x76: 0x0008, 0x77: 0x0008, 0x78: 0x0008, 0x79: 0x0008, 0x7a: 0x0008, 0x7b: 0x0080, + 0x7c: 0x0080, 0x7d: 0x0080, 0x7e: 0x0080, 0x7f: 0x0080, + // Block 0x2, offset 0x80 + // Block 0x3, offset 0xc0 + 0xc0: 0x0040, 0xc1: 0x0040, 0xc2: 0x0040, 0xc3: 0x0040, 0xc4: 0x0040, 0xc5: 0x0040, + 0xc6: 0x0040, 0xc7: 0x0040, 0xc8: 0x0040, 0xc9: 0x0040, 0xca: 0x0040, 0xcb: 0x0040, + 0xcc: 0x0040, 0xcd: 0x0040, 0xce: 0x0040, 0xcf: 0x0040, 0xd0: 0x0040, 0xd1: 0x0040, + 0xd2: 0x0040, 0xd3: 0x0040, 0xd4: 0x0040, 0xd5: 0x0040, 0xd6: 0x0040, 0xd7: 0x0040, + 0xd8: 0x0040, 0xd9: 0x0040, 0xda: 0x0040, 0xdb: 0x0040, 0xdc: 0x0040, 0xdd: 0x0040, + 0xde: 0x0040, 0xdf: 0x0040, 0xe0: 0x000a, 0xe1: 0x0018, 0xe2: 0x0018, 0xe3: 0x0018, + 0xe4: 0x0018, 0xe5: 0x0018, 0xe6: 0x0018, 0xe7: 0x0018, 0xe8: 0x001a, 0xe9: 0x0018, + 0xea: 0x0039, 0xeb: 0x0018, 0xec: 0x0018, 0xed: 0x03c0, 0xee: 0x0018, 0xef: 0x004a, + 0xf0: 0x0018, 0xf1: 0x0018, 0xf2: 0x0069, 0xf3: 0x0079, 0xf4: 0x008a, 0xf5: 0x0005, + 0xf6: 0x0018, 0xf7: 0x0008, 0xf8: 0x00aa, 0xf9: 0x00c9, 0xfa: 0x00d9, 0xfb: 0x0018, + 0xfc: 0x00e9, 0xfd: 0x0119, 0xfe: 0x0149, 0xff: 0x0018, + // Block 0x4, offset 0x100 + 0x100: 0xe00d, 0x101: 0x0008, 0x102: 0xe00d, 0x103: 0x0008, 0x104: 0xe00d, 0x105: 0x0008, + 0x106: 0xe00d, 0x107: 0x0008, 0x108: 0xe00d, 0x109: 0x0008, 0x10a: 0xe00d, 0x10b: 0x0008, + 0x10c: 0xe00d, 0x10d: 0x0008, 0x10e: 0xe00d, 0x10f: 0x0008, 0x110: 0xe00d, 0x111: 0x0008, + 0x112: 0xe00d, 0x113: 0x0008, 0x114: 0xe00d, 0x115: 0x0008, 0x116: 0xe00d, 0x117: 0x0008, + 0x118: 0xe00d, 0x119: 0x0008, 0x11a: 0xe00d, 0x11b: 0x0008, 0x11c: 0xe00d, 0x11d: 0x0008, + 0x11e: 0xe00d, 0x11f: 0x0008, 0x120: 0xe00d, 0x121: 0x0008, 0x122: 0xe00d, 0x123: 0x0008, + 0x124: 0xe00d, 0x125: 0x0008, 0x126: 0xe00d, 0x127: 0x0008, 0x128: 0xe00d, 0x129: 0x0008, + 0x12a: 0xe00d, 0x12b: 0x0008, 0x12c: 0xe00d, 0x12d: 0x0008, 0x12e: 0xe00d, 0x12f: 0x0008, + 0x130: 0x0179, 0x131: 0x0008, 0x132: 0x0035, 0x133: 0x004d, 0x134: 0xe00d, 0x135: 0x0008, + 0x136: 0xe00d, 0x137: 0x0008, 0x138: 0x0008, 0x139: 0xe01d, 0x13a: 0x0008, 0x13b: 0xe03d, + 0x13c: 0x0008, 0x13d: 0xe01d, 0x13e: 0x0008, 0x13f: 0x0199, + // Block 0x5, offset 0x140 + 0x140: 0x0199, 0x141: 0xe01d, 0x142: 0x0008, 0x143: 0xe03d, 0x144: 0x0008, 0x145: 0xe01d, + 0x146: 0x0008, 0x147: 0xe07d, 0x148: 0x0008, 0x149: 0x01b9, 0x14a: 0xe00d, 0x14b: 0x0008, + 0x14c: 0xe00d, 0x14d: 0x0008, 0x14e: 0xe00d, 0x14f: 0x0008, 0x150: 0xe00d, 0x151: 0x0008, + 0x152: 0xe00d, 0x153: 0x0008, 0x154: 0xe00d, 0x155: 0x0008, 0x156: 0xe00d, 0x157: 0x0008, + 0x158: 0xe00d, 0x159: 0x0008, 0x15a: 0xe00d, 0x15b: 0x0008, 0x15c: 0xe00d, 0x15d: 0x0008, + 0x15e: 0xe00d, 0x15f: 0x0008, 0x160: 0xe00d, 0x161: 0x0008, 0x162: 0xe00d, 0x163: 0x0008, + 0x164: 0xe00d, 0x165: 0x0008, 0x166: 0xe00d, 0x167: 0x0008, 0x168: 0xe00d, 0x169: 0x0008, + 0x16a: 0xe00d, 0x16b: 0x0008, 0x16c: 0xe00d, 0x16d: 0x0008, 0x16e: 0xe00d, 0x16f: 0x0008, + 0x170: 0xe00d, 0x171: 0x0008, 0x172: 0xe00d, 0x173: 0x0008, 0x174: 0xe00d, 0x175: 0x0008, + 0x176: 0xe00d, 0x177: 0x0008, 0x178: 0x0065, 0x179: 0xe01d, 0x17a: 0x0008, 0x17b: 0xe03d, + 0x17c: 0x0008, 0x17d: 0xe01d, 0x17e: 0x0008, 0x17f: 0x01d9, + // Block 0x6, offset 0x180 + 0x180: 0x0008, 0x181: 0x007d, 0x182: 0xe00d, 0x183: 0x0008, 0x184: 0xe00d, 0x185: 0x0008, + 0x186: 0x007d, 0x187: 0xe07d, 0x188: 0x0008, 0x189: 0x0095, 0x18a: 0x00ad, 0x18b: 0xe03d, + 0x18c: 0x0008, 0x18d: 0x0008, 0x18e: 0x00c5, 0x18f: 0x00dd, 0x190: 0x00f5, 0x191: 0xe01d, + 0x192: 0x0008, 0x193: 0x010d, 0x194: 0x0125, 0x195: 0x0008, 0x196: 0x013d, 0x197: 0x013d, + 0x198: 0xe00d, 0x199: 0x0008, 0x19a: 0x0008, 0x19b: 0x0008, 0x19c: 0x010d, 0x19d: 0x0155, + 0x19e: 0x0008, 0x19f: 0x016d, 0x1a0: 0xe00d, 0x1a1: 0x0008, 0x1a2: 0xe00d, 0x1a3: 0x0008, + 0x1a4: 0xe00d, 0x1a5: 0x0008, 0x1a6: 0x0185, 0x1a7: 0xe07d, 0x1a8: 0x0008, 0x1a9: 0x019d, + 0x1aa: 0x0008, 0x1ab: 0x0008, 0x1ac: 0xe00d, 0x1ad: 0x0008, 0x1ae: 0x0185, 0x1af: 0xe0fd, + 0x1b0: 0x0008, 0x1b1: 0x01b5, 0x1b2: 0x01cd, 0x1b3: 0xe03d, 0x1b4: 0x0008, 0x1b5: 0xe01d, + 0x1b6: 0x0008, 0x1b7: 0x01e5, 0x1b8: 0xe00d, 0x1b9: 0x0008, 0x1ba: 0x0008, 0x1bb: 0x0008, + 0x1bc: 0xe00d, 0x1bd: 0x0008, 0x1be: 0x0008, 0x1bf: 0x0008, + // Block 0x7, offset 0x1c0 + 0x1c0: 0x0008, 0x1c1: 0x0008, 0x1c2: 0x0008, 0x1c3: 0x0008, 0x1c4: 0x01e9, 0x1c5: 0x01e9, + 0x1c6: 0x01e9, 0x1c7: 0x01fd, 0x1c8: 0x0215, 0x1c9: 0x022d, 0x1ca: 0x0245, 0x1cb: 0x025d, + 0x1cc: 0x0275, 0x1cd: 0xe01d, 0x1ce: 0x0008, 0x1cf: 0xe0fd, 0x1d0: 0x0008, 0x1d1: 0xe01d, + 0x1d2: 0x0008, 0x1d3: 0xe03d, 0x1d4: 0x0008, 0x1d5: 0xe01d, 0x1d6: 0x0008, 0x1d7: 0xe07d, + 0x1d8: 0x0008, 0x1d9: 0xe01d, 0x1da: 0x0008, 0x1db: 0xe03d, 0x1dc: 0x0008, 0x1dd: 0x0008, + 0x1de: 0xe00d, 0x1df: 0x0008, 0x1e0: 0xe00d, 0x1e1: 0x0008, 0x1e2: 0xe00d, 0x1e3: 0x0008, + 0x1e4: 0xe00d, 0x1e5: 0x0008, 0x1e6: 0xe00d, 0x1e7: 0x0008, 0x1e8: 0xe00d, 0x1e9: 0x0008, + 0x1ea: 0xe00d, 0x1eb: 0x0008, 0x1ec: 0xe00d, 0x1ed: 0x0008, 0x1ee: 0xe00d, 0x1ef: 0x0008, + 0x1f0: 0x0008, 0x1f1: 0x028d, 0x1f2: 0x02a5, 0x1f3: 0x02bd, 0x1f4: 0xe00d, 0x1f5: 0x0008, + 0x1f6: 0x02d5, 0x1f7: 0x02ed, 0x1f8: 0xe00d, 0x1f9: 0x0008, 0x1fa: 0xe00d, 0x1fb: 0x0008, + 0x1fc: 0xe00d, 0x1fd: 0x0008, 0x1fe: 0xe00d, 0x1ff: 0x0008, + // Block 0x8, offset 0x200 + 0x200: 0xe00d, 0x201: 0x0008, 0x202: 0xe00d, 0x203: 0x0008, 0x204: 0xe00d, 0x205: 0x0008, + 0x206: 0xe00d, 0x207: 0x0008, 0x208: 0xe00d, 0x209: 0x0008, 0x20a: 0xe00d, 0x20b: 0x0008, + 0x20c: 0xe00d, 0x20d: 0x0008, 0x20e: 0xe00d, 0x20f: 0x0008, 0x210: 0xe00d, 0x211: 0x0008, + 0x212: 0xe00d, 0x213: 0x0008, 0x214: 0xe00d, 0x215: 0x0008, 0x216: 0xe00d, 0x217: 0x0008, + 0x218: 0xe00d, 0x219: 0x0008, 0x21a: 0xe00d, 0x21b: 0x0008, 0x21c: 0xe00d, 0x21d: 0x0008, + 0x21e: 0xe00d, 0x21f: 0x0008, 0x220: 0x0305, 0x221: 0x0008, 0x222: 0xe00d, 0x223: 0x0008, + 0x224: 0xe00d, 0x225: 0x0008, 0x226: 0xe00d, 0x227: 0x0008, 0x228: 0xe00d, 0x229: 0x0008, + 0x22a: 0xe00d, 0x22b: 0x0008, 0x22c: 0xe00d, 0x22d: 0x0008, 0x22e: 0xe00d, 0x22f: 0x0008, + 0x230: 0xe00d, 0x231: 0x0008, 0x232: 0xe00d, 0x233: 0x0008, 0x234: 0x0008, 0x235: 0x0008, + 0x236: 0x0008, 0x237: 0x0008, 0x238: 0x0008, 0x239: 0x0008, 0x23a: 0x0209, 0x23b: 0xe03d, + 0x23c: 0x0008, 0x23d: 0x031d, 0x23e: 0x0229, 0x23f: 0x0008, + // Block 0x9, offset 0x240 + 0x240: 0x0008, 0x241: 0x0008, 0x242: 0x0018, 0x243: 0x0018, 0x244: 0x0018, 0x245: 0x0018, + 0x246: 0x0008, 0x247: 0x0008, 0x248: 0x0008, 0x249: 0x0008, 0x24a: 0x0008, 0x24b: 0x0008, + 0x24c: 0x0008, 0x24d: 0x0008, 0x24e: 0x0008, 0x24f: 0x0008, 0x250: 0x0008, 0x251: 0x0008, + 0x252: 0x0018, 0x253: 0x0018, 0x254: 0x0018, 0x255: 0x0018, 0x256: 0x0018, 0x257: 0x0018, + 0x258: 0x029a, 0x259: 0x02ba, 0x25a: 0x02da, 0x25b: 0x02fa, 0x25c: 0x031a, 0x25d: 0x033a, + 0x25e: 0x0018, 0x25f: 0x0018, 0x260: 0x03ad, 0x261: 0x0359, 0x262: 0x01d9, 0x263: 0x0369, + 0x264: 0x03c5, 0x265: 0x0018, 0x266: 0x0018, 0x267: 0x0018, 0x268: 0x0018, 0x269: 0x0018, + 0x26a: 0x0018, 0x26b: 0x0018, 0x26c: 0x0008, 0x26d: 0x0018, 0x26e: 0x0008, 0x26f: 0x0018, + 0x270: 0x0018, 0x271: 0x0018, 0x272: 0x0018, 0x273: 0x0018, 0x274: 0x0018, 0x275: 0x0018, + 0x276: 0x0018, 0x277: 0x0018, 0x278: 0x0018, 0x279: 0x0018, 0x27a: 0x0018, 0x27b: 0x0018, + 0x27c: 0x0018, 0x27d: 0x0018, 0x27e: 0x0018, 0x27f: 0x0018, + // Block 0xa, offset 0x280 + 0x280: 0x03dd, 0x281: 0x03dd, 0x282: 0x3308, 0x283: 0x03f5, 0x284: 0x0379, 0x285: 0x040d, + 0x286: 0x3308, 0x287: 0x3308, 0x288: 0x3308, 0x289: 0x3308, 0x28a: 0x3308, 0x28b: 0x3308, + 0x28c: 0x3308, 0x28d: 0x3308, 0x28e: 0x3308, 0x28f: 0x33c0, 0x290: 0x3308, 0x291: 0x3308, + 0x292: 0x3308, 0x293: 0x3308, 0x294: 0x3308, 0x295: 0x3308, 0x296: 0x3308, 0x297: 0x3308, + 0x298: 0x3308, 0x299: 0x3308, 0x29a: 0x3308, 0x29b: 0x3308, 0x29c: 0x3308, 0x29d: 0x3308, + 0x29e: 0x3308, 0x29f: 0x3308, 0x2a0: 0x3308, 0x2a1: 0x3308, 0x2a2: 0x3308, 0x2a3: 0x3308, + 0x2a4: 0x3308, 0x2a5: 0x3308, 0x2a6: 0x3308, 0x2a7: 0x3308, 0x2a8: 0x3308, 0x2a9: 0x3308, + 0x2aa: 0x3308, 0x2ab: 0x3308, 0x2ac: 0x3308, 0x2ad: 0x3308, 0x2ae: 0x3308, 0x2af: 0x3308, + 0x2b0: 0xe00d, 0x2b1: 0x0008, 0x2b2: 0xe00d, 0x2b3: 0x0008, 0x2b4: 0x0425, 0x2b5: 0x0008, + 0x2b6: 0xe00d, 0x2b7: 0x0008, 0x2b8: 0x0040, 0x2b9: 0x0040, 0x2ba: 0x03a2, 0x2bb: 0x0008, + 0x2bc: 0x0008, 0x2bd: 0x0008, 0x2be: 0x03c2, 0x2bf: 0x043d, + // Block 0xb, offset 0x2c0 + 0x2c0: 0x0040, 0x2c1: 0x0040, 0x2c2: 0x0040, 0x2c3: 0x0040, 0x2c4: 0x008a, 0x2c5: 0x03d2, + 0x2c6: 0xe155, 0x2c7: 0x0455, 0x2c8: 0xe12d, 0x2c9: 0xe13d, 0x2ca: 0xe12d, 0x2cb: 0x0040, + 0x2cc: 0x03dd, 0x2cd: 0x0040, 0x2ce: 0x046d, 0x2cf: 0x0485, 0x2d0: 0x0008, 0x2d1: 0xe105, + 0x2d2: 0xe105, 0x2d3: 0xe105, 0x2d4: 0xe105, 0x2d5: 0xe105, 0x2d6: 0xe105, 0x2d7: 0xe105, + 0x2d8: 0xe105, 0x2d9: 0xe105, 0x2da: 0xe105, 0x2db: 0xe105, 0x2dc: 0xe105, 0x2dd: 0xe105, + 0x2de: 0xe105, 0x2df: 0xe105, 0x2e0: 0x049d, 0x2e1: 0x049d, 0x2e2: 0x0040, 0x2e3: 0x049d, + 0x2e4: 0x049d, 0x2e5: 0x049d, 0x2e6: 0x049d, 0x2e7: 0x049d, 0x2e8: 0x049d, 0x2e9: 0x049d, + 0x2ea: 0x049d, 0x2eb: 0x049d, 0x2ec: 0x0008, 0x2ed: 0x0008, 0x2ee: 0x0008, 0x2ef: 0x0008, + 0x2f0: 0x0008, 0x2f1: 0x0008, 0x2f2: 0x0008, 0x2f3: 0x0008, 0x2f4: 0x0008, 0x2f5: 0x0008, + 0x2f6: 0x0008, 0x2f7: 0x0008, 0x2f8: 0x0008, 0x2f9: 0x0008, 0x2fa: 0x0008, 0x2fb: 0x0008, + 0x2fc: 0x0008, 0x2fd: 0x0008, 0x2fe: 0x0008, 0x2ff: 0x0008, + // Block 0xc, offset 0x300 + 0x300: 0x0008, 0x301: 0x0008, 0x302: 0xe00f, 0x303: 0x0008, 0x304: 0x0008, 0x305: 0x0008, + 0x306: 0x0008, 0x307: 0x0008, 0x308: 0x0008, 0x309: 0x0008, 0x30a: 0x0008, 0x30b: 0x0008, + 0x30c: 0x0008, 0x30d: 0x0008, 0x30e: 0x0008, 0x30f: 0xe0c5, 0x310: 0x04b5, 0x311: 0x04cd, + 0x312: 0xe0bd, 0x313: 0xe0f5, 0x314: 0xe0fd, 0x315: 0xe09d, 0x316: 0xe0b5, 0x317: 0x0008, + 0x318: 0xe00d, 0x319: 0x0008, 0x31a: 0xe00d, 0x31b: 0x0008, 0x31c: 0xe00d, 0x31d: 0x0008, + 0x31e: 0xe00d, 0x31f: 0x0008, 0x320: 0xe00d, 0x321: 0x0008, 0x322: 0xe00d, 0x323: 0x0008, + 0x324: 0xe00d, 0x325: 0x0008, 0x326: 0xe00d, 0x327: 0x0008, 0x328: 0xe00d, 0x329: 0x0008, + 0x32a: 0xe00d, 0x32b: 0x0008, 0x32c: 0xe00d, 0x32d: 0x0008, 0x32e: 0xe00d, 0x32f: 0x0008, + 0x330: 0x04e5, 0x331: 0xe185, 0x332: 0xe18d, 0x333: 0x0008, 0x334: 0x04fd, 0x335: 0x03dd, + 0x336: 0x0018, 0x337: 0xe07d, 0x338: 0x0008, 0x339: 0xe1d5, 0x33a: 0xe00d, 0x33b: 0x0008, + 0x33c: 0x0008, 0x33d: 0x0515, 0x33e: 0x052d, 0x33f: 0x052d, + // Block 0xd, offset 0x340 + 0x340: 0x0008, 0x341: 0x0008, 0x342: 0x0008, 0x343: 0x0008, 0x344: 0x0008, 0x345: 0x0008, + 0x346: 0x0008, 0x347: 0x0008, 0x348: 0x0008, 0x349: 0x0008, 0x34a: 0x0008, 0x34b: 0x0008, + 0x34c: 0x0008, 0x34d: 0x0008, 0x34e: 0x0008, 0x34f: 0x0008, 0x350: 0x0008, 0x351: 0x0008, + 0x352: 0x0008, 0x353: 0x0008, 0x354: 0x0008, 0x355: 0x0008, 0x356: 0x0008, 0x357: 0x0008, + 0x358: 0x0008, 0x359: 0x0008, 0x35a: 0x0008, 0x35b: 0x0008, 0x35c: 0x0008, 0x35d: 0x0008, + 0x35e: 0x0008, 0x35f: 0x0008, 0x360: 0xe00d, 0x361: 0x0008, 0x362: 0xe00d, 0x363: 0x0008, + 0x364: 0xe00d, 0x365: 0x0008, 0x366: 0xe00d, 0x367: 0x0008, 0x368: 0xe00d, 0x369: 0x0008, + 0x36a: 0xe00d, 0x36b: 0x0008, 0x36c: 0xe00d, 0x36d: 0x0008, 0x36e: 0xe00d, 0x36f: 0x0008, + 0x370: 0xe00d, 0x371: 0x0008, 0x372: 0xe00d, 0x373: 0x0008, 0x374: 0xe00d, 0x375: 0x0008, + 0x376: 0xe00d, 0x377: 0x0008, 0x378: 0xe00d, 0x379: 0x0008, 0x37a: 0xe00d, 0x37b: 0x0008, + 0x37c: 0xe00d, 0x37d: 0x0008, 0x37e: 0xe00d, 0x37f: 0x0008, + // Block 0xe, offset 0x380 + 0x380: 0xe00d, 0x381: 0x0008, 0x382: 0x0018, 0x383: 0x3308, 0x384: 0x3308, 0x385: 0x3308, + 0x386: 0x3308, 0x387: 0x3308, 0x388: 0x3318, 0x389: 0x3318, 0x38a: 0xe00d, 0x38b: 0x0008, + 0x38c: 0xe00d, 0x38d: 0x0008, 0x38e: 0xe00d, 0x38f: 0x0008, 0x390: 0xe00d, 0x391: 0x0008, + 0x392: 0xe00d, 0x393: 0x0008, 0x394: 0xe00d, 0x395: 0x0008, 0x396: 0xe00d, 0x397: 0x0008, + 0x398: 0xe00d, 0x399: 0x0008, 0x39a: 0xe00d, 0x39b: 0x0008, 0x39c: 0xe00d, 0x39d: 0x0008, + 0x39e: 0xe00d, 0x39f: 0x0008, 0x3a0: 0xe00d, 0x3a1: 0x0008, 0x3a2: 0xe00d, 0x3a3: 0x0008, + 0x3a4: 0xe00d, 0x3a5: 0x0008, 0x3a6: 0xe00d, 0x3a7: 0x0008, 0x3a8: 0xe00d, 0x3a9: 0x0008, + 0x3aa: 0xe00d, 0x3ab: 0x0008, 0x3ac: 0xe00d, 0x3ad: 0x0008, 0x3ae: 0xe00d, 0x3af: 0x0008, + 0x3b0: 0xe00d, 0x3b1: 0x0008, 0x3b2: 0xe00d, 0x3b3: 0x0008, 0x3b4: 0xe00d, 0x3b5: 0x0008, + 0x3b6: 0xe00d, 0x3b7: 0x0008, 0x3b8: 0xe00d, 0x3b9: 0x0008, 0x3ba: 0xe00d, 0x3bb: 0x0008, + 0x3bc: 0xe00d, 0x3bd: 0x0008, 0x3be: 0xe00d, 0x3bf: 0x0008, + // Block 0xf, offset 0x3c0 + 0x3c0: 0x0040, 0x3c1: 0xe01d, 0x3c2: 0x0008, 0x3c3: 0xe03d, 0x3c4: 0x0008, 0x3c5: 0xe01d, + 0x3c6: 0x0008, 0x3c7: 0xe07d, 0x3c8: 0x0008, 0x3c9: 0xe01d, 0x3ca: 0x0008, 0x3cb: 0xe03d, + 0x3cc: 0x0008, 0x3cd: 0xe01d, 0x3ce: 0x0008, 0x3cf: 0x0008, 0x3d0: 0xe00d, 0x3d1: 0x0008, + 0x3d2: 0xe00d, 0x3d3: 0x0008, 0x3d4: 0xe00d, 0x3d5: 0x0008, 0x3d6: 0xe00d, 0x3d7: 0x0008, + 0x3d8: 0xe00d, 0x3d9: 0x0008, 0x3da: 0xe00d, 0x3db: 0x0008, 0x3dc: 0xe00d, 0x3dd: 0x0008, + 0x3de: 0xe00d, 0x3df: 0x0008, 0x3e0: 0xe00d, 0x3e1: 0x0008, 0x3e2: 0xe00d, 0x3e3: 0x0008, + 0x3e4: 0xe00d, 0x3e5: 0x0008, 0x3e6: 0xe00d, 0x3e7: 0x0008, 0x3e8: 0xe00d, 0x3e9: 0x0008, + 0x3ea: 0xe00d, 0x3eb: 0x0008, 0x3ec: 0xe00d, 0x3ed: 0x0008, 0x3ee: 0xe00d, 0x3ef: 0x0008, + 0x3f0: 0xe00d, 0x3f1: 0x0008, 0x3f2: 0xe00d, 0x3f3: 0x0008, 0x3f4: 0xe00d, 0x3f5: 0x0008, + 0x3f6: 0xe00d, 0x3f7: 0x0008, 0x3f8: 0xe00d, 0x3f9: 0x0008, 0x3fa: 0xe00d, 0x3fb: 0x0008, + 0x3fc: 0xe00d, 0x3fd: 0x0008, 0x3fe: 0xe00d, 0x3ff: 0x0008, + // Block 0x10, offset 0x400 + 0x400: 0xe00d, 0x401: 0x0008, 0x402: 0xe00d, 0x403: 0x0008, 0x404: 0xe00d, 0x405: 0x0008, + 0x406: 0xe00d, 0x407: 0x0008, 0x408: 0xe00d, 0x409: 0x0008, 0x40a: 0xe00d, 0x40b: 0x0008, + 0x40c: 0xe00d, 0x40d: 0x0008, 0x40e: 0xe00d, 0x40f: 0x0008, 0x410: 0xe00d, 0x411: 0x0008, + 0x412: 0xe00d, 0x413: 0x0008, 0x414: 0xe00d, 0x415: 0x0008, 0x416: 0xe00d, 0x417: 0x0008, + 0x418: 0xe00d, 0x419: 0x0008, 0x41a: 0xe00d, 0x41b: 0x0008, 0x41c: 0xe00d, 0x41d: 0x0008, + 0x41e: 0xe00d, 0x41f: 0x0008, 0x420: 0xe00d, 0x421: 0x0008, 0x422: 0xe00d, 0x423: 0x0008, + 0x424: 0xe00d, 0x425: 0x0008, 0x426: 0xe00d, 0x427: 0x0008, 0x428: 0xe00d, 0x429: 0x0008, + 0x42a: 0xe00d, 0x42b: 0x0008, 0x42c: 0xe00d, 0x42d: 0x0008, 0x42e: 0xe00d, 0x42f: 0x0008, + 0x430: 0x0040, 0x431: 0x03f5, 0x432: 0x03f5, 0x433: 0x03f5, 0x434: 0x03f5, 0x435: 0x03f5, + 0x436: 0x03f5, 0x437: 0x03f5, 0x438: 0x03f5, 0x439: 0x03f5, 0x43a: 0x03f5, 0x43b: 0x03f5, + 0x43c: 0x03f5, 0x43d: 0x03f5, 0x43e: 0x03f5, 0x43f: 0x03f5, + // Block 0x11, offset 0x440 + 0x440: 0x0840, 0x441: 0x0840, 0x442: 0x0840, 0x443: 0x0840, 0x444: 0x0840, 0x445: 0x0840, + 0x446: 0x0018, 0x447: 0x0018, 0x448: 0x0818, 0x449: 0x0018, 0x44a: 0x0018, 0x44b: 0x0818, + 0x44c: 0x0018, 0x44d: 0x0818, 0x44e: 0x0018, 0x44f: 0x0018, 0x450: 0x3308, 0x451: 0x3308, + 0x452: 0x3308, 0x453: 0x3308, 0x454: 0x3308, 0x455: 0x3308, 0x456: 0x3308, 0x457: 0x3308, + 0x458: 0x3308, 0x459: 0x3308, 0x45a: 0x3308, 0x45b: 0x0818, 0x45c: 0x0b40, 0x45d: 0x0040, + 0x45e: 0x0818, 0x45f: 0x0818, 0x460: 0x0a08, 0x461: 0x0808, 0x462: 0x0c08, 0x463: 0x0c08, + 0x464: 0x0c08, 0x465: 0x0c08, 0x466: 0x0a08, 0x467: 0x0c08, 0x468: 0x0a08, 0x469: 0x0c08, + 0x46a: 0x0a08, 0x46b: 0x0a08, 0x46c: 0x0a08, 0x46d: 0x0a08, 0x46e: 0x0a08, 0x46f: 0x0c08, + 0x470: 0x0c08, 0x471: 0x0c08, 0x472: 0x0c08, 0x473: 0x0a08, 0x474: 0x0a08, 0x475: 0x0a08, + 0x476: 0x0a08, 0x477: 0x0a08, 0x478: 0x0a08, 0x479: 0x0a08, 0x47a: 0x0a08, 0x47b: 0x0a08, + 0x47c: 0x0a08, 0x47d: 0x0a08, 0x47e: 0x0a08, 0x47f: 0x0a08, + // Block 0x12, offset 0x480 + 0x480: 0x0818, 0x481: 0x0a08, 0x482: 0x0a08, 0x483: 0x0a08, 0x484: 0x0a08, 0x485: 0x0a08, + 0x486: 0x0a08, 0x487: 0x0a08, 0x488: 0x0c08, 0x489: 0x0a08, 0x48a: 0x0a08, 0x48b: 0x3308, + 0x48c: 0x3308, 0x48d: 0x3308, 0x48e: 0x3308, 0x48f: 0x3308, 0x490: 0x3308, 0x491: 0x3308, + 0x492: 0x3308, 0x493: 0x3308, 0x494: 0x3308, 0x495: 0x3308, 0x496: 0x3308, 0x497: 0x3308, + 0x498: 0x3308, 0x499: 0x3308, 0x49a: 0x3308, 0x49b: 0x3308, 0x49c: 0x3308, 0x49d: 0x3308, + 0x49e: 0x3308, 0x49f: 0x3308, 0x4a0: 0x0808, 0x4a1: 0x0808, 0x4a2: 0x0808, 0x4a3: 0x0808, + 0x4a4: 0x0808, 0x4a5: 0x0808, 0x4a6: 0x0808, 0x4a7: 0x0808, 0x4a8: 0x0808, 0x4a9: 0x0808, + 0x4aa: 0x0018, 0x4ab: 0x0818, 0x4ac: 0x0818, 0x4ad: 0x0818, 0x4ae: 0x0a08, 0x4af: 0x0a08, + 0x4b0: 0x3308, 0x4b1: 0x0c08, 0x4b2: 0x0c08, 0x4b3: 0x0c08, 0x4b4: 0x0808, 0x4b5: 0x0429, + 0x4b6: 0x0451, 0x4b7: 0x0479, 0x4b8: 0x04a1, 0x4b9: 0x0a08, 0x4ba: 0x0a08, 0x4bb: 0x0a08, + 0x4bc: 0x0a08, 0x4bd: 0x0a08, 0x4be: 0x0a08, 0x4bf: 0x0a08, + // Block 0x13, offset 0x4c0 + 0x4c0: 0x0c08, 0x4c1: 0x0a08, 0x4c2: 0x0a08, 0x4c3: 0x0c08, 0x4c4: 0x0c08, 0x4c5: 0x0c08, + 0x4c6: 0x0c08, 0x4c7: 0x0c08, 0x4c8: 0x0c08, 0x4c9: 0x0c08, 0x4ca: 0x0c08, 0x4cb: 0x0c08, + 0x4cc: 0x0a08, 0x4cd: 0x0c08, 0x4ce: 0x0a08, 0x4cf: 0x0c08, 0x4d0: 0x0a08, 0x4d1: 0x0a08, + 0x4d2: 0x0c08, 0x4d3: 0x0c08, 0x4d4: 0x0818, 0x4d5: 0x0c08, 0x4d6: 0x3308, 0x4d7: 0x3308, + 0x4d8: 0x3308, 0x4d9: 0x3308, 0x4da: 0x3308, 0x4db: 0x3308, 0x4dc: 0x3308, 0x4dd: 0x0840, + 0x4de: 0x0018, 0x4df: 0x3308, 0x4e0: 0x3308, 0x4e1: 0x3308, 0x4e2: 0x3308, 0x4e3: 0x3308, + 0x4e4: 0x3308, 0x4e5: 0x0808, 0x4e6: 0x0808, 0x4e7: 0x3308, 0x4e8: 0x3308, 0x4e9: 0x0018, + 0x4ea: 0x3308, 0x4eb: 0x3308, 0x4ec: 0x3308, 0x4ed: 0x3308, 0x4ee: 0x0c08, 0x4ef: 0x0c08, + 0x4f0: 0x0008, 0x4f1: 0x0008, 0x4f2: 0x0008, 0x4f3: 0x0008, 0x4f4: 0x0008, 0x4f5: 0x0008, + 0x4f6: 0x0008, 0x4f7: 0x0008, 0x4f8: 0x0008, 0x4f9: 0x0008, 0x4fa: 0x0a08, 0x4fb: 0x0a08, + 0x4fc: 0x0a08, 0x4fd: 0x0808, 0x4fe: 0x0808, 0x4ff: 0x0a08, + // Block 0x14, offset 0x500 + 0x500: 0x0818, 0x501: 0x0818, 0x502: 0x0818, 0x503: 0x0818, 0x504: 0x0818, 0x505: 0x0818, + 0x506: 0x0818, 0x507: 0x0818, 0x508: 0x0818, 0x509: 0x0818, 0x50a: 0x0818, 0x50b: 0x0818, + 0x50c: 0x0818, 0x50d: 0x0818, 0x50e: 0x0040, 0x50f: 0x0b40, 0x510: 0x0c08, 0x511: 0x3308, + 0x512: 0x0a08, 0x513: 0x0a08, 0x514: 0x0a08, 0x515: 0x0c08, 0x516: 0x0c08, 0x517: 0x0c08, + 0x518: 0x0c08, 0x519: 0x0c08, 0x51a: 0x0a08, 0x51b: 0x0a08, 0x51c: 0x0a08, 0x51d: 0x0a08, + 0x51e: 0x0c08, 0x51f: 0x0a08, 0x520: 0x0a08, 0x521: 0x0a08, 0x522: 0x0a08, 0x523: 0x0a08, + 0x524: 0x0a08, 0x525: 0x0a08, 0x526: 0x0a08, 0x527: 0x0a08, 0x528: 0x0c08, 0x529: 0x0a08, + 0x52a: 0x0c08, 0x52b: 0x0a08, 0x52c: 0x0c08, 0x52d: 0x0a08, 0x52e: 0x0a08, 0x52f: 0x0c08, + 0x530: 0x3308, 0x531: 0x3308, 0x532: 0x3308, 0x533: 0x3308, 0x534: 0x3308, 0x535: 0x3308, + 0x536: 0x3308, 0x537: 0x3308, 0x538: 0x3308, 0x539: 0x3308, 0x53a: 0x3308, 0x53b: 0x3308, + 0x53c: 0x3308, 0x53d: 0x3308, 0x53e: 0x3308, 0x53f: 0x3308, + // Block 0x15, offset 0x540 + 0x540: 0x0c08, 0x541: 0x0a08, 0x542: 0x0a08, 0x543: 0x0a08, 0x544: 0x0a08, 0x545: 0x0a08, + 0x546: 0x0c08, 0x547: 0x0c08, 0x548: 0x0a08, 0x549: 0x0c08, 0x54a: 0x0a08, 0x54b: 0x0a08, + 0x54c: 0x0a08, 0x54d: 0x0a08, 0x54e: 0x0a08, 0x54f: 0x0a08, 0x550: 0x0a08, 0x551: 0x0a08, + 0x552: 0x0a08, 0x553: 0x0a08, 0x554: 0x0c08, 0x555: 0x0a08, 0x556: 0x0808, 0x557: 0x0808, + 0x558: 0x0808, 0x559: 0x3308, 0x55a: 0x3308, 0x55b: 0x3308, 0x55c: 0x0040, 0x55d: 0x0040, + 0x55e: 0x0818, 0x55f: 0x0040, 0x560: 0x0a08, 0x561: 0x0808, 0x562: 0x0a08, 0x563: 0x0a08, + 0x564: 0x0a08, 0x565: 0x0a08, 0x566: 0x0808, 0x567: 0x0c08, 0x568: 0x0a08, 0x569: 0x0c08, + 0x56a: 0x0c08, 0x56b: 0x0040, 0x56c: 0x0040, 0x56d: 0x0040, 0x56e: 0x0040, 0x56f: 0x0040, + 0x570: 0x0040, 0x571: 0x0040, 0x572: 0x0040, 0x573: 0x0040, 0x574: 0x0040, 0x575: 0x0040, + 0x576: 0x0040, 0x577: 0x0040, 0x578: 0x0040, 0x579: 0x0040, 0x57a: 0x0040, 0x57b: 0x0040, + 0x57c: 0x0040, 0x57d: 0x0040, 0x57e: 0x0040, 0x57f: 0x0040, + // Block 0x16, offset 0x580 + 0x580: 0x3008, 0x581: 0x3308, 0x582: 0x3308, 0x583: 0x3308, 0x584: 0x3308, 0x585: 0x3308, + 0x586: 0x3308, 0x587: 0x3308, 0x588: 0x3308, 0x589: 0x3008, 0x58a: 0x3008, 0x58b: 0x3008, + 0x58c: 0x3008, 0x58d: 0x3b08, 0x58e: 0x3008, 0x58f: 0x3008, 0x590: 0x0008, 0x591: 0x3308, + 0x592: 0x3308, 0x593: 0x3308, 0x594: 0x3308, 0x595: 0x3308, 0x596: 0x3308, 0x597: 0x3308, + 0x598: 0x04c9, 0x599: 0x0501, 0x59a: 0x0539, 0x59b: 0x0571, 0x59c: 0x05a9, 0x59d: 0x05e1, + 0x59e: 0x0619, 0x59f: 0x0651, 0x5a0: 0x0008, 0x5a1: 0x0008, 0x5a2: 0x3308, 0x5a3: 0x3308, + 0x5a4: 0x0018, 0x5a5: 0x0018, 0x5a6: 0x0008, 0x5a7: 0x0008, 0x5a8: 0x0008, 0x5a9: 0x0008, + 0x5aa: 0x0008, 0x5ab: 0x0008, 0x5ac: 0x0008, 0x5ad: 0x0008, 0x5ae: 0x0008, 0x5af: 0x0008, + 0x5b0: 0x0018, 0x5b1: 0x0008, 0x5b2: 0x0008, 0x5b3: 0x0008, 0x5b4: 0x0008, 0x5b5: 0x0008, + 0x5b6: 0x0008, 0x5b7: 0x0008, 0x5b8: 0x0008, 0x5b9: 0x0008, 0x5ba: 0x0008, 0x5bb: 0x0008, + 0x5bc: 0x0008, 0x5bd: 0x0008, 0x5be: 0x0008, 0x5bf: 0x0008, + // Block 0x17, offset 0x5c0 + 0x5c0: 0x0008, 0x5c1: 0x3308, 0x5c2: 0x3008, 0x5c3: 0x3008, 0x5c4: 0x0040, 0x5c5: 0x0008, + 0x5c6: 0x0008, 0x5c7: 0x0008, 0x5c8: 0x0008, 0x5c9: 0x0008, 0x5ca: 0x0008, 0x5cb: 0x0008, + 0x5cc: 0x0008, 0x5cd: 0x0040, 0x5ce: 0x0040, 0x5cf: 0x0008, 0x5d0: 0x0008, 0x5d1: 0x0040, + 0x5d2: 0x0040, 0x5d3: 0x0008, 0x5d4: 0x0008, 0x5d5: 0x0008, 0x5d6: 0x0008, 0x5d7: 0x0008, + 0x5d8: 0x0008, 0x5d9: 0x0008, 0x5da: 0x0008, 0x5db: 0x0008, 0x5dc: 0x0008, 0x5dd: 0x0008, + 0x5de: 0x0008, 0x5df: 0x0008, 0x5e0: 0x0008, 0x5e1: 0x0008, 0x5e2: 0x0008, 0x5e3: 0x0008, + 0x5e4: 0x0008, 0x5e5: 0x0008, 0x5e6: 0x0008, 0x5e7: 0x0008, 0x5e8: 0x0008, 0x5e9: 0x0040, + 0x5ea: 0x0008, 0x5eb: 0x0008, 0x5ec: 0x0008, 0x5ed: 0x0008, 0x5ee: 0x0008, 0x5ef: 0x0008, + 0x5f0: 0x0008, 0x5f1: 0x0040, 0x5f2: 0x0008, 0x5f3: 0x0040, 0x5f4: 0x0040, 0x5f5: 0x0040, + 0x5f6: 0x0008, 0x5f7: 0x0008, 0x5f8: 0x0008, 0x5f9: 0x0008, 0x5fa: 0x0040, 0x5fb: 0x0040, + 0x5fc: 0x3308, 0x5fd: 0x0008, 0x5fe: 0x3008, 0x5ff: 0x3008, + // Block 0x18, offset 0x600 + 0x600: 0x3008, 0x601: 0x3308, 0x602: 0x3308, 0x603: 0x3308, 0x604: 0x3308, 0x605: 0x0040, + 0x606: 0x0040, 0x607: 0x3008, 0x608: 0x3008, 0x609: 0x0040, 0x60a: 0x0040, 0x60b: 0x3008, + 0x60c: 0x3008, 0x60d: 0x3b08, 0x60e: 0x0008, 0x60f: 0x0040, 0x610: 0x0040, 0x611: 0x0040, + 0x612: 0x0040, 0x613: 0x0040, 0x614: 0x0040, 0x615: 0x0040, 0x616: 0x0040, 0x617: 0x3008, + 0x618: 0x0040, 0x619: 0x0040, 0x61a: 0x0040, 0x61b: 0x0040, 0x61c: 0x0689, 0x61d: 0x06c1, + 0x61e: 0x0040, 0x61f: 0x06f9, 0x620: 0x0008, 0x621: 0x0008, 0x622: 0x3308, 0x623: 0x3308, + 0x624: 0x0040, 0x625: 0x0040, 0x626: 0x0008, 0x627: 0x0008, 0x628: 0x0008, 0x629: 0x0008, + 0x62a: 0x0008, 0x62b: 0x0008, 0x62c: 0x0008, 0x62d: 0x0008, 0x62e: 0x0008, 0x62f: 0x0008, + 0x630: 0x0008, 0x631: 0x0008, 0x632: 0x0018, 0x633: 0x0018, 0x634: 0x0018, 0x635: 0x0018, + 0x636: 0x0018, 0x637: 0x0018, 0x638: 0x0018, 0x639: 0x0018, 0x63a: 0x0018, 0x63b: 0x0018, + 0x63c: 0x0008, 0x63d: 0x0018, 0x63e: 0x3308, 0x63f: 0x0040, + // Block 0x19, offset 0x640 + 0x640: 0x0040, 0x641: 0x3308, 0x642: 0x3308, 0x643: 0x3008, 0x644: 0x0040, 0x645: 0x0008, + 0x646: 0x0008, 0x647: 0x0008, 0x648: 0x0008, 0x649: 0x0008, 0x64a: 0x0008, 0x64b: 0x0040, + 0x64c: 0x0040, 0x64d: 0x0040, 0x64e: 0x0040, 0x64f: 0x0008, 0x650: 0x0008, 0x651: 0x0040, + 0x652: 0x0040, 0x653: 0x0008, 0x654: 0x0008, 0x655: 0x0008, 0x656: 0x0008, 0x657: 0x0008, + 0x658: 0x0008, 0x659: 0x0008, 0x65a: 0x0008, 0x65b: 0x0008, 0x65c: 0x0008, 0x65d: 0x0008, + 0x65e: 0x0008, 0x65f: 0x0008, 0x660: 0x0008, 0x661: 0x0008, 0x662: 0x0008, 0x663: 0x0008, + 0x664: 0x0008, 0x665: 0x0008, 0x666: 0x0008, 0x667: 0x0008, 0x668: 0x0008, 0x669: 0x0040, + 0x66a: 0x0008, 0x66b: 0x0008, 0x66c: 0x0008, 0x66d: 0x0008, 0x66e: 0x0008, 0x66f: 0x0008, + 0x670: 0x0008, 0x671: 0x0040, 0x672: 0x0008, 0x673: 0x0731, 0x674: 0x0040, 0x675: 0x0008, + 0x676: 0x0769, 0x677: 0x0040, 0x678: 0x0008, 0x679: 0x0008, 0x67a: 0x0040, 0x67b: 0x0040, + 0x67c: 0x3308, 0x67d: 0x0040, 0x67e: 0x3008, 0x67f: 0x3008, + // Block 0x1a, offset 0x680 + 0x680: 0x3008, 0x681: 0x3308, 0x682: 0x3308, 0x683: 0x0040, 0x684: 0x0040, 0x685: 0x0040, + 0x686: 0x0040, 0x687: 0x3308, 0x688: 0x3308, 0x689: 0x0040, 0x68a: 0x0040, 0x68b: 0x3308, + 0x68c: 0x3308, 0x68d: 0x3b08, 0x68e: 0x0040, 0x68f: 0x0040, 0x690: 0x0040, 0x691: 0x3308, + 0x692: 0x0040, 0x693: 0x0040, 0x694: 0x0040, 0x695: 0x0040, 0x696: 0x0040, 0x697: 0x0040, + 0x698: 0x0040, 0x699: 0x07a1, 0x69a: 0x07d9, 0x69b: 0x0811, 0x69c: 0x0008, 0x69d: 0x0040, + 0x69e: 0x0849, 0x69f: 0x0040, 0x6a0: 0x0040, 0x6a1: 0x0040, 0x6a2: 0x0040, 0x6a3: 0x0040, + 0x6a4: 0x0040, 0x6a5: 0x0040, 0x6a6: 0x0008, 0x6a7: 0x0008, 0x6a8: 0x0008, 0x6a9: 0x0008, + 0x6aa: 0x0008, 0x6ab: 0x0008, 0x6ac: 0x0008, 0x6ad: 0x0008, 0x6ae: 0x0008, 0x6af: 0x0008, + 0x6b0: 0x3308, 0x6b1: 0x3308, 0x6b2: 0x0008, 0x6b3: 0x0008, 0x6b4: 0x0008, 0x6b5: 0x3308, + 0x6b6: 0x0018, 0x6b7: 0x0040, 0x6b8: 0x0040, 0x6b9: 0x0040, 0x6ba: 0x0040, 0x6bb: 0x0040, + 0x6bc: 0x0040, 0x6bd: 0x0040, 0x6be: 0x0040, 0x6bf: 0x0040, + // Block 0x1b, offset 0x6c0 + 0x6c0: 0x0040, 0x6c1: 0x3308, 0x6c2: 0x3308, 0x6c3: 0x3008, 0x6c4: 0x0040, 0x6c5: 0x0008, + 0x6c6: 0x0008, 0x6c7: 0x0008, 0x6c8: 0x0008, 0x6c9: 0x0008, 0x6ca: 0x0008, 0x6cb: 0x0008, + 0x6cc: 0x0008, 0x6cd: 0x0008, 0x6ce: 0x0040, 0x6cf: 0x0008, 0x6d0: 0x0008, 0x6d1: 0x0008, + 0x6d2: 0x0040, 0x6d3: 0x0008, 0x6d4: 0x0008, 0x6d5: 0x0008, 0x6d6: 0x0008, 0x6d7: 0x0008, + 0x6d8: 0x0008, 0x6d9: 0x0008, 0x6da: 0x0008, 0x6db: 0x0008, 0x6dc: 0x0008, 0x6dd: 0x0008, + 0x6de: 0x0008, 0x6df: 0x0008, 0x6e0: 0x0008, 0x6e1: 0x0008, 0x6e2: 0x0008, 0x6e3: 0x0008, + 0x6e4: 0x0008, 0x6e5: 0x0008, 0x6e6: 0x0008, 0x6e7: 0x0008, 0x6e8: 0x0008, 0x6e9: 0x0040, + 0x6ea: 0x0008, 0x6eb: 0x0008, 0x6ec: 0x0008, 0x6ed: 0x0008, 0x6ee: 0x0008, 0x6ef: 0x0008, + 0x6f0: 0x0008, 0x6f1: 0x0040, 0x6f2: 0x0008, 0x6f3: 0x0008, 0x6f4: 0x0040, 0x6f5: 0x0008, + 0x6f6: 0x0008, 0x6f7: 0x0008, 0x6f8: 0x0008, 0x6f9: 0x0008, 0x6fa: 0x0040, 0x6fb: 0x0040, + 0x6fc: 0x3308, 0x6fd: 0x0008, 0x6fe: 0x3008, 0x6ff: 0x3008, + // Block 0x1c, offset 0x700 + 0x700: 0x3008, 0x701: 0x3308, 0x702: 0x3308, 0x703: 0x3308, 0x704: 0x3308, 0x705: 0x3308, + 0x706: 0x0040, 0x707: 0x3308, 0x708: 0x3308, 0x709: 0x3008, 0x70a: 0x0040, 0x70b: 0x3008, + 0x70c: 0x3008, 0x70d: 0x3b08, 0x70e: 0x0040, 0x70f: 0x0040, 0x710: 0x0008, 0x711: 0x0040, + 0x712: 0x0040, 0x713: 0x0040, 0x714: 0x0040, 0x715: 0x0040, 0x716: 0x0040, 0x717: 0x0040, + 0x718: 0x0040, 0x719: 0x0040, 0x71a: 0x0040, 0x71b: 0x0040, 0x71c: 0x0040, 0x71d: 0x0040, + 0x71e: 0x0040, 0x71f: 0x0040, 0x720: 0x0008, 0x721: 0x0008, 0x722: 0x3308, 0x723: 0x3308, + 0x724: 0x0040, 0x725: 0x0040, 0x726: 0x0008, 0x727: 0x0008, 0x728: 0x0008, 0x729: 0x0008, + 0x72a: 0x0008, 0x72b: 0x0008, 0x72c: 0x0008, 0x72d: 0x0008, 0x72e: 0x0008, 0x72f: 0x0008, + 0x730: 0x0018, 0x731: 0x0018, 0x732: 0x0040, 0x733: 0x0040, 0x734: 0x0040, 0x735: 0x0040, + 0x736: 0x0040, 0x737: 0x0040, 0x738: 0x0040, 0x739: 0x0008, 0x73a: 0x3308, 0x73b: 0x3308, + 0x73c: 0x3308, 0x73d: 0x3308, 0x73e: 0x3308, 0x73f: 0x3308, + // Block 0x1d, offset 0x740 + 0x740: 0x0040, 0x741: 0x3308, 0x742: 0x3008, 0x743: 0x3008, 0x744: 0x0040, 0x745: 0x0008, + 0x746: 0x0008, 0x747: 0x0008, 0x748: 0x0008, 0x749: 0x0008, 0x74a: 0x0008, 0x74b: 0x0008, + 0x74c: 0x0008, 0x74d: 0x0040, 0x74e: 0x0040, 0x74f: 0x0008, 0x750: 0x0008, 0x751: 0x0040, + 0x752: 0x0040, 0x753: 0x0008, 0x754: 0x0008, 0x755: 0x0008, 0x756: 0x0008, 0x757: 0x0008, + 0x758: 0x0008, 0x759: 0x0008, 0x75a: 0x0008, 0x75b: 0x0008, 0x75c: 0x0008, 0x75d: 0x0008, + 0x75e: 0x0008, 0x75f: 0x0008, 0x760: 0x0008, 0x761: 0x0008, 0x762: 0x0008, 0x763: 0x0008, + 0x764: 0x0008, 0x765: 0x0008, 0x766: 0x0008, 0x767: 0x0008, 0x768: 0x0008, 0x769: 0x0040, + 0x76a: 0x0008, 0x76b: 0x0008, 0x76c: 0x0008, 0x76d: 0x0008, 0x76e: 0x0008, 0x76f: 0x0008, + 0x770: 0x0008, 0x771: 0x0040, 0x772: 0x0008, 0x773: 0x0008, 0x774: 0x0040, 0x775: 0x0008, + 0x776: 0x0008, 0x777: 0x0008, 0x778: 0x0008, 0x779: 0x0008, 0x77a: 0x0040, 0x77b: 0x0040, + 0x77c: 0x3308, 0x77d: 0x0008, 0x77e: 0x3008, 0x77f: 0x3308, + // Block 0x1e, offset 0x780 + 0x780: 0x3008, 0x781: 0x3308, 0x782: 0x3308, 0x783: 0x3308, 0x784: 0x3308, 0x785: 0x0040, + 0x786: 0x0040, 0x787: 0x3008, 0x788: 0x3008, 0x789: 0x0040, 0x78a: 0x0040, 0x78b: 0x3008, + 0x78c: 0x3008, 0x78d: 0x3b08, 0x78e: 0x0040, 0x78f: 0x0040, 0x790: 0x0040, 0x791: 0x0040, + 0x792: 0x0040, 0x793: 0x0040, 0x794: 0x0040, 0x795: 0x0040, 0x796: 0x3308, 0x797: 0x3008, + 0x798: 0x0040, 0x799: 0x0040, 0x79a: 0x0040, 0x79b: 0x0040, 0x79c: 0x0881, 0x79d: 0x08b9, + 0x79e: 0x0040, 0x79f: 0x0008, 0x7a0: 0x0008, 0x7a1: 0x0008, 0x7a2: 0x3308, 0x7a3: 0x3308, + 0x7a4: 0x0040, 0x7a5: 0x0040, 0x7a6: 0x0008, 0x7a7: 0x0008, 0x7a8: 0x0008, 0x7a9: 0x0008, + 0x7aa: 0x0008, 0x7ab: 0x0008, 0x7ac: 0x0008, 0x7ad: 0x0008, 0x7ae: 0x0008, 0x7af: 0x0008, + 0x7b0: 0x0018, 0x7b1: 0x0008, 0x7b2: 0x0018, 0x7b3: 0x0018, 0x7b4: 0x0018, 0x7b5: 0x0018, + 0x7b6: 0x0018, 0x7b7: 0x0018, 0x7b8: 0x0040, 0x7b9: 0x0040, 0x7ba: 0x0040, 0x7bb: 0x0040, + 0x7bc: 0x0040, 0x7bd: 0x0040, 0x7be: 0x0040, 0x7bf: 0x0040, + // Block 0x1f, offset 0x7c0 + 0x7c0: 0x0040, 0x7c1: 0x0040, 0x7c2: 0x3308, 0x7c3: 0x0008, 0x7c4: 0x0040, 0x7c5: 0x0008, + 0x7c6: 0x0008, 0x7c7: 0x0008, 0x7c8: 0x0008, 0x7c9: 0x0008, 0x7ca: 0x0008, 0x7cb: 0x0040, + 0x7cc: 0x0040, 0x7cd: 0x0040, 0x7ce: 0x0008, 0x7cf: 0x0008, 0x7d0: 0x0008, 0x7d1: 0x0040, + 0x7d2: 0x0008, 0x7d3: 0x0008, 0x7d4: 0x0008, 0x7d5: 0x0008, 0x7d6: 0x0040, 0x7d7: 0x0040, + 0x7d8: 0x0040, 0x7d9: 0x0008, 0x7da: 0x0008, 0x7db: 0x0040, 0x7dc: 0x0008, 0x7dd: 0x0040, + 0x7de: 0x0008, 0x7df: 0x0008, 0x7e0: 0x0040, 0x7e1: 0x0040, 0x7e2: 0x0040, 0x7e3: 0x0008, + 0x7e4: 0x0008, 0x7e5: 0x0040, 0x7e6: 0x0040, 0x7e7: 0x0040, 0x7e8: 0x0008, 0x7e9: 0x0008, + 0x7ea: 0x0008, 0x7eb: 0x0040, 0x7ec: 0x0040, 0x7ed: 0x0040, 0x7ee: 0x0008, 0x7ef: 0x0008, + 0x7f0: 0x0008, 0x7f1: 0x0008, 0x7f2: 0x0008, 0x7f3: 0x0008, 0x7f4: 0x0008, 0x7f5: 0x0008, + 0x7f6: 0x0008, 0x7f7: 0x0008, 0x7f8: 0x0008, 0x7f9: 0x0008, 0x7fa: 0x0040, 0x7fb: 0x0040, + 0x7fc: 0x0040, 0x7fd: 0x0040, 0x7fe: 0x3008, 0x7ff: 0x3008, + // Block 0x20, offset 0x800 + 0x800: 0x3308, 0x801: 0x3008, 0x802: 0x3008, 0x803: 0x3008, 0x804: 0x3008, 0x805: 0x0040, + 0x806: 0x3308, 0x807: 0x3308, 0x808: 0x3308, 0x809: 0x0040, 0x80a: 0x3308, 0x80b: 0x3308, + 0x80c: 0x3308, 0x80d: 0x3b08, 0x80e: 0x0040, 0x80f: 0x0040, 0x810: 0x0040, 0x811: 0x0040, + 0x812: 0x0040, 0x813: 0x0040, 0x814: 0x0040, 0x815: 0x3308, 0x816: 0x3308, 0x817: 0x0040, + 0x818: 0x0008, 0x819: 0x0008, 0x81a: 0x0008, 0x81b: 0x0040, 0x81c: 0x0040, 0x81d: 0x0040, + 0x81e: 0x0040, 0x81f: 0x0040, 0x820: 0x0008, 0x821: 0x0008, 0x822: 0x3308, 0x823: 0x3308, + 0x824: 0x0040, 0x825: 0x0040, 0x826: 0x0008, 0x827: 0x0008, 0x828: 0x0008, 0x829: 0x0008, + 0x82a: 0x0008, 0x82b: 0x0008, 0x82c: 0x0008, 0x82d: 0x0008, 0x82e: 0x0008, 0x82f: 0x0008, + 0x830: 0x0040, 0x831: 0x0040, 0x832: 0x0040, 0x833: 0x0040, 0x834: 0x0040, 0x835: 0x0040, + 0x836: 0x0040, 0x837: 0x0018, 0x838: 0x0018, 0x839: 0x0018, 0x83a: 0x0018, 0x83b: 0x0018, + 0x83c: 0x0018, 0x83d: 0x0018, 0x83e: 0x0018, 0x83f: 0x0018, + // Block 0x21, offset 0x840 + 0x840: 0x0008, 0x841: 0x3308, 0x842: 0x3008, 0x843: 0x3008, 0x844: 0x0018, 0x845: 0x0008, + 0x846: 0x0008, 0x847: 0x0008, 0x848: 0x0008, 0x849: 0x0008, 0x84a: 0x0008, 0x84b: 0x0008, + 0x84c: 0x0008, 0x84d: 0x0040, 0x84e: 0x0008, 0x84f: 0x0008, 0x850: 0x0008, 0x851: 0x0040, + 0x852: 0x0008, 0x853: 0x0008, 0x854: 0x0008, 0x855: 0x0008, 0x856: 0x0008, 0x857: 0x0008, + 0x858: 0x0008, 0x859: 0x0008, 0x85a: 0x0008, 0x85b: 0x0008, 0x85c: 0x0008, 0x85d: 0x0008, + 0x85e: 0x0008, 0x85f: 0x0008, 0x860: 0x0008, 0x861: 0x0008, 0x862: 0x0008, 0x863: 0x0008, + 0x864: 0x0008, 0x865: 0x0008, 0x866: 0x0008, 0x867: 0x0008, 0x868: 0x0008, 0x869: 0x0040, + 0x86a: 0x0008, 0x86b: 0x0008, 0x86c: 0x0008, 0x86d: 0x0008, 0x86e: 0x0008, 0x86f: 0x0008, + 0x870: 0x0008, 0x871: 0x0008, 0x872: 0x0008, 0x873: 0x0008, 0x874: 0x0040, 0x875: 0x0008, + 0x876: 0x0008, 0x877: 0x0008, 0x878: 0x0008, 0x879: 0x0008, 0x87a: 0x0040, 0x87b: 0x0040, + 0x87c: 0x3308, 0x87d: 0x0008, 0x87e: 0x3008, 0x87f: 0x3308, + // Block 0x22, offset 0x880 + 0x880: 0x3008, 0x881: 0x3008, 0x882: 0x3008, 0x883: 0x3008, 0x884: 0x3008, 0x885: 0x0040, + 0x886: 0x3308, 0x887: 0x3008, 0x888: 0x3008, 0x889: 0x0040, 0x88a: 0x3008, 0x88b: 0x3008, + 0x88c: 0x3308, 0x88d: 0x3b08, 0x88e: 0x0040, 0x88f: 0x0040, 0x890: 0x0040, 0x891: 0x0040, + 0x892: 0x0040, 0x893: 0x0040, 0x894: 0x0040, 0x895: 0x3008, 0x896: 0x3008, 0x897: 0x0040, + 0x898: 0x0040, 0x899: 0x0040, 0x89a: 0x0040, 0x89b: 0x0040, 0x89c: 0x0040, 0x89d: 0x0040, + 0x89e: 0x0008, 0x89f: 0x0040, 0x8a0: 0x0008, 0x8a1: 0x0008, 0x8a2: 0x3308, 0x8a3: 0x3308, + 0x8a4: 0x0040, 0x8a5: 0x0040, 0x8a6: 0x0008, 0x8a7: 0x0008, 0x8a8: 0x0008, 0x8a9: 0x0008, + 0x8aa: 0x0008, 0x8ab: 0x0008, 0x8ac: 0x0008, 0x8ad: 0x0008, 0x8ae: 0x0008, 0x8af: 0x0008, + 0x8b0: 0x0040, 0x8b1: 0x0008, 0x8b2: 0x0008, 0x8b3: 0x0040, 0x8b4: 0x0040, 0x8b5: 0x0040, + 0x8b6: 0x0040, 0x8b7: 0x0040, 0x8b8: 0x0040, 0x8b9: 0x0040, 0x8ba: 0x0040, 0x8bb: 0x0040, + 0x8bc: 0x0040, 0x8bd: 0x0040, 0x8be: 0x0040, 0x8bf: 0x0040, + // Block 0x23, offset 0x8c0 + 0x8c0: 0x3008, 0x8c1: 0x3308, 0x8c2: 0x3308, 0x8c3: 0x3308, 0x8c4: 0x3308, 0x8c5: 0x0040, + 0x8c6: 0x3008, 0x8c7: 0x3008, 0x8c8: 0x3008, 0x8c9: 0x0040, 0x8ca: 0x3008, 0x8cb: 0x3008, + 0x8cc: 0x3008, 0x8cd: 0x3b08, 0x8ce: 0x0008, 0x8cf: 0x0018, 0x8d0: 0x0040, 0x8d1: 0x0040, + 0x8d2: 0x0040, 0x8d3: 0x0040, 0x8d4: 0x0008, 0x8d5: 0x0008, 0x8d6: 0x0008, 0x8d7: 0x3008, + 0x8d8: 0x0018, 0x8d9: 0x0018, 0x8da: 0x0018, 0x8db: 0x0018, 0x8dc: 0x0018, 0x8dd: 0x0018, + 0x8de: 0x0018, 0x8df: 0x0008, 0x8e0: 0x0008, 0x8e1: 0x0008, 0x8e2: 0x3308, 0x8e3: 0x3308, + 0x8e4: 0x0040, 0x8e5: 0x0040, 0x8e6: 0x0008, 0x8e7: 0x0008, 0x8e8: 0x0008, 0x8e9: 0x0008, + 0x8ea: 0x0008, 0x8eb: 0x0008, 0x8ec: 0x0008, 0x8ed: 0x0008, 0x8ee: 0x0008, 0x8ef: 0x0008, + 0x8f0: 0x0018, 0x8f1: 0x0018, 0x8f2: 0x0018, 0x8f3: 0x0018, 0x8f4: 0x0018, 0x8f5: 0x0018, + 0x8f6: 0x0018, 0x8f7: 0x0018, 0x8f8: 0x0018, 0x8f9: 0x0018, 0x8fa: 0x0008, 0x8fb: 0x0008, + 0x8fc: 0x0008, 0x8fd: 0x0008, 0x8fe: 0x0008, 0x8ff: 0x0008, + // Block 0x24, offset 0x900 + 0x900: 0x0040, 0x901: 0x0008, 0x902: 0x0008, 0x903: 0x0040, 0x904: 0x0008, 0x905: 0x0040, + 0x906: 0x0008, 0x907: 0x0008, 0x908: 0x0008, 0x909: 0x0008, 0x90a: 0x0008, 0x90b: 0x0040, + 0x90c: 0x0008, 0x90d: 0x0008, 0x90e: 0x0008, 0x90f: 0x0008, 0x910: 0x0008, 0x911: 0x0008, + 0x912: 0x0008, 0x913: 0x0008, 0x914: 0x0008, 0x915: 0x0008, 0x916: 0x0008, 0x917: 0x0008, + 0x918: 0x0008, 0x919: 0x0008, 0x91a: 0x0008, 0x91b: 0x0008, 0x91c: 0x0008, 0x91d: 0x0008, + 0x91e: 0x0008, 0x91f: 0x0008, 0x920: 0x0008, 0x921: 0x0008, 0x922: 0x0008, 0x923: 0x0008, + 0x924: 0x0040, 0x925: 0x0008, 0x926: 0x0040, 0x927: 0x0008, 0x928: 0x0008, 0x929: 0x0008, + 0x92a: 0x0008, 0x92b: 0x0008, 0x92c: 0x0008, 0x92d: 0x0008, 0x92e: 0x0008, 0x92f: 0x0008, + 0x930: 0x0008, 0x931: 0x3308, 0x932: 0x0008, 0x933: 0x0929, 0x934: 0x3308, 0x935: 0x3308, + 0x936: 0x3308, 0x937: 0x3308, 0x938: 0x3308, 0x939: 0x3308, 0x93a: 0x3b08, 0x93b: 0x3308, + 0x93c: 0x3308, 0x93d: 0x0008, 0x93e: 0x0040, 0x93f: 0x0040, + // Block 0x25, offset 0x940 + 0x940: 0x0008, 0x941: 0x0008, 0x942: 0x0008, 0x943: 0x09d1, 0x944: 0x0008, 0x945: 0x0008, + 0x946: 0x0008, 0x947: 0x0008, 0x948: 0x0040, 0x949: 0x0008, 0x94a: 0x0008, 0x94b: 0x0008, + 0x94c: 0x0008, 0x94d: 0x0a09, 0x94e: 0x0008, 0x94f: 0x0008, 0x950: 0x0008, 0x951: 0x0008, + 0x952: 0x0a41, 0x953: 0x0008, 0x954: 0x0008, 0x955: 0x0008, 0x956: 0x0008, 0x957: 0x0a79, + 0x958: 0x0008, 0x959: 0x0008, 0x95a: 0x0008, 0x95b: 0x0008, 0x95c: 0x0ab1, 0x95d: 0x0008, + 0x95e: 0x0008, 0x95f: 0x0008, 0x960: 0x0008, 0x961: 0x0008, 0x962: 0x0008, 0x963: 0x0008, + 0x964: 0x0008, 0x965: 0x0008, 0x966: 0x0008, 0x967: 0x0008, 0x968: 0x0008, 0x969: 0x0ae9, + 0x96a: 0x0008, 0x96b: 0x0008, 0x96c: 0x0008, 0x96d: 0x0040, 0x96e: 0x0040, 0x96f: 0x0040, + 0x970: 0x0040, 0x971: 0x3308, 0x972: 0x3308, 0x973: 0x0b21, 0x974: 0x3308, 0x975: 0x0b59, + 0x976: 0x0b91, 0x977: 0x0bc9, 0x978: 0x0c19, 0x979: 0x0c51, 0x97a: 0x3308, 0x97b: 0x3308, + 0x97c: 0x3308, 0x97d: 0x3308, 0x97e: 0x3308, 0x97f: 0x3008, + // Block 0x26, offset 0x980 + 0x980: 0x3308, 0x981: 0x0ca1, 0x982: 0x3308, 0x983: 0x3308, 0x984: 0x3b08, 0x985: 0x0018, + 0x986: 0x3308, 0x987: 0x3308, 0x988: 0x0008, 0x989: 0x0008, 0x98a: 0x0008, 0x98b: 0x0008, + 0x98c: 0x0008, 0x98d: 0x3308, 0x98e: 0x3308, 0x98f: 0x3308, 0x990: 0x3308, 0x991: 0x3308, + 0x992: 0x3308, 0x993: 0x0cd9, 0x994: 0x3308, 0x995: 0x3308, 0x996: 0x3308, 0x997: 0x3308, + 0x998: 0x0040, 0x999: 0x3308, 0x99a: 0x3308, 0x99b: 0x3308, 0x99c: 0x3308, 0x99d: 0x0d11, + 0x99e: 0x3308, 0x99f: 0x3308, 0x9a0: 0x3308, 0x9a1: 0x3308, 0x9a2: 0x0d49, 0x9a3: 0x3308, + 0x9a4: 0x3308, 0x9a5: 0x3308, 0x9a6: 0x3308, 0x9a7: 0x0d81, 0x9a8: 0x3308, 0x9a9: 0x3308, + 0x9aa: 0x3308, 0x9ab: 0x3308, 0x9ac: 0x0db9, 0x9ad: 0x3308, 0x9ae: 0x3308, 0x9af: 0x3308, + 0x9b0: 0x3308, 0x9b1: 0x3308, 0x9b2: 0x3308, 0x9b3: 0x3308, 0x9b4: 0x3308, 0x9b5: 0x3308, + 0x9b6: 0x3308, 0x9b7: 0x3308, 0x9b8: 0x3308, 0x9b9: 0x0df1, 0x9ba: 0x3308, 0x9bb: 0x3308, + 0x9bc: 0x3308, 0x9bd: 0x0040, 0x9be: 0x0018, 0x9bf: 0x0018, + // Block 0x27, offset 0x9c0 + 0x9c0: 0x0008, 0x9c1: 0x0008, 0x9c2: 0x0008, 0x9c3: 0x0008, 0x9c4: 0x0008, 0x9c5: 0x0008, + 0x9c6: 0x0008, 0x9c7: 0x0008, 0x9c8: 0x0008, 0x9c9: 0x0008, 0x9ca: 0x0008, 0x9cb: 0x0008, + 0x9cc: 0x0008, 0x9cd: 0x0008, 0x9ce: 0x0008, 0x9cf: 0x0008, 0x9d0: 0x0008, 0x9d1: 0x0008, + 0x9d2: 0x0008, 0x9d3: 0x0008, 0x9d4: 0x0008, 0x9d5: 0x0008, 0x9d6: 0x0008, 0x9d7: 0x0008, + 0x9d8: 0x0008, 0x9d9: 0x0008, 0x9da: 0x0008, 0x9db: 0x0008, 0x9dc: 0x0008, 0x9dd: 0x0008, + 0x9de: 0x0008, 0x9df: 0x0008, 0x9e0: 0x0008, 0x9e1: 0x0008, 0x9e2: 0x0008, 0x9e3: 0x0008, + 0x9e4: 0x0008, 0x9e5: 0x0008, 0x9e6: 0x0008, 0x9e7: 0x0008, 0x9e8: 0x0008, 0x9e9: 0x0008, + 0x9ea: 0x0008, 0x9eb: 0x0008, 0x9ec: 0x0039, 0x9ed: 0x0ed1, 0x9ee: 0x0ee9, 0x9ef: 0x0008, + 0x9f0: 0x0ef9, 0x9f1: 0x0f09, 0x9f2: 0x0f19, 0x9f3: 0x0f31, 0x9f4: 0x0249, 0x9f5: 0x0f41, + 0x9f6: 0x0259, 0x9f7: 0x0f51, 0x9f8: 0x0359, 0x9f9: 0x0f61, 0x9fa: 0x0f71, 0x9fb: 0x0008, + 0x9fc: 0x00d9, 0x9fd: 0x0f81, 0x9fe: 0x0f99, 0x9ff: 0x0269, + // Block 0x28, offset 0xa00 + 0xa00: 0x0fa9, 0xa01: 0x0fb9, 0xa02: 0x0279, 0xa03: 0x0039, 0xa04: 0x0fc9, 0xa05: 0x0fe1, + 0xa06: 0x05b5, 0xa07: 0x0ee9, 0xa08: 0x0ef9, 0xa09: 0x0f09, 0xa0a: 0x0ff9, 0xa0b: 0x1011, + 0xa0c: 0x1029, 0xa0d: 0x0f31, 0xa0e: 0x0008, 0xa0f: 0x0f51, 0xa10: 0x0f61, 0xa11: 0x1041, + 0xa12: 0x00d9, 0xa13: 0x1059, 0xa14: 0x05cd, 0xa15: 0x05cd, 0xa16: 0x0f99, 0xa17: 0x0fa9, + 0xa18: 0x0fb9, 0xa19: 0x05b5, 0xa1a: 0x1071, 0xa1b: 0x1089, 0xa1c: 0x05e5, 0xa1d: 0x1099, + 0xa1e: 0x10b1, 0xa1f: 0x10c9, 0xa20: 0x10e1, 0xa21: 0x10f9, 0xa22: 0x0f41, 0xa23: 0x0269, + 0xa24: 0x0fb9, 0xa25: 0x1089, 0xa26: 0x1099, 0xa27: 0x10b1, 0xa28: 0x1111, 0xa29: 0x10e1, + 0xa2a: 0x10f9, 0xa2b: 0x0008, 0xa2c: 0x0008, 0xa2d: 0x0008, 0xa2e: 0x0008, 0xa2f: 0x0008, + 0xa30: 0x0008, 0xa31: 0x0008, 0xa32: 0x0008, 0xa33: 0x0008, 0xa34: 0x0008, 0xa35: 0x0008, + 0xa36: 0x0008, 0xa37: 0x0008, 0xa38: 0x1129, 0xa39: 0x0008, 0xa3a: 0x0008, 0xa3b: 0x0008, + 0xa3c: 0x0008, 0xa3d: 0x0008, 0xa3e: 0x0008, 0xa3f: 0x0008, + // Block 0x29, offset 0xa40 + 0xa40: 0x0008, 0xa41: 0x0008, 0xa42: 0x0008, 0xa43: 0x0008, 0xa44: 0x0008, 0xa45: 0x0008, + 0xa46: 0x0008, 0xa47: 0x0008, 0xa48: 0x0008, 0xa49: 0x0008, 0xa4a: 0x0008, 0xa4b: 0x0008, + 0xa4c: 0x0008, 0xa4d: 0x0008, 0xa4e: 0x0008, 0xa4f: 0x0008, 0xa50: 0x0008, 0xa51: 0x0008, + 0xa52: 0x0008, 0xa53: 0x0008, 0xa54: 0x0008, 0xa55: 0x0008, 0xa56: 0x0008, 0xa57: 0x0008, + 0xa58: 0x0008, 0xa59: 0x0008, 0xa5a: 0x0008, 0xa5b: 0x1141, 0xa5c: 0x1159, 0xa5d: 0x1169, + 0xa5e: 0x1181, 0xa5f: 0x1029, 0xa60: 0x1199, 0xa61: 0x11a9, 0xa62: 0x11c1, 0xa63: 0x11d9, + 0xa64: 0x11f1, 0xa65: 0x1209, 0xa66: 0x1221, 0xa67: 0x05fd, 0xa68: 0x1239, 0xa69: 0x1251, + 0xa6a: 0xe17d, 0xa6b: 0x1269, 0xa6c: 0x1281, 0xa6d: 0x1299, 0xa6e: 0x12b1, 0xa6f: 0x12c9, + 0xa70: 0x12e1, 0xa71: 0x12f9, 0xa72: 0x1311, 0xa73: 0x1329, 0xa74: 0x1341, 0xa75: 0x1359, + 0xa76: 0x1371, 0xa77: 0x1389, 0xa78: 0x0615, 0xa79: 0x13a1, 0xa7a: 0x13b9, 0xa7b: 0x13d1, + 0xa7c: 0x13e1, 0xa7d: 0x13f9, 0xa7e: 0x1411, 0xa7f: 0x1429, + // Block 0x2a, offset 0xa80 + 0xa80: 0xe00d, 0xa81: 0x0008, 0xa82: 0xe00d, 0xa83: 0x0008, 0xa84: 0xe00d, 0xa85: 0x0008, + 0xa86: 0xe00d, 0xa87: 0x0008, 0xa88: 0xe00d, 0xa89: 0x0008, 0xa8a: 0xe00d, 0xa8b: 0x0008, + 0xa8c: 0xe00d, 0xa8d: 0x0008, 0xa8e: 0xe00d, 0xa8f: 0x0008, 0xa90: 0xe00d, 0xa91: 0x0008, + 0xa92: 0xe00d, 0xa93: 0x0008, 0xa94: 0xe00d, 0xa95: 0x0008, 0xa96: 0xe00d, 0xa97: 0x0008, + 0xa98: 0xe00d, 0xa99: 0x0008, 0xa9a: 0xe00d, 0xa9b: 0x0008, 0xa9c: 0xe00d, 0xa9d: 0x0008, + 0xa9e: 0xe00d, 0xa9f: 0x0008, 0xaa0: 0xe00d, 0xaa1: 0x0008, 0xaa2: 0xe00d, 0xaa3: 0x0008, + 0xaa4: 0xe00d, 0xaa5: 0x0008, 0xaa6: 0xe00d, 0xaa7: 0x0008, 0xaa8: 0xe00d, 0xaa9: 0x0008, + 0xaaa: 0xe00d, 0xaab: 0x0008, 0xaac: 0xe00d, 0xaad: 0x0008, 0xaae: 0xe00d, 0xaaf: 0x0008, + 0xab0: 0xe00d, 0xab1: 0x0008, 0xab2: 0xe00d, 0xab3: 0x0008, 0xab4: 0xe00d, 0xab5: 0x0008, + 0xab6: 0xe00d, 0xab7: 0x0008, 0xab8: 0xe00d, 0xab9: 0x0008, 0xaba: 0xe00d, 0xabb: 0x0008, + 0xabc: 0xe00d, 0xabd: 0x0008, 0xabe: 0xe00d, 0xabf: 0x0008, + // Block 0x2b, offset 0xac0 + 0xac0: 0xe00d, 0xac1: 0x0008, 0xac2: 0xe00d, 0xac3: 0x0008, 0xac4: 0xe00d, 0xac5: 0x0008, + 0xac6: 0xe00d, 0xac7: 0x0008, 0xac8: 0xe00d, 0xac9: 0x0008, 0xaca: 0xe00d, 0xacb: 0x0008, + 0xacc: 0xe00d, 0xacd: 0x0008, 0xace: 0xe00d, 0xacf: 0x0008, 0xad0: 0xe00d, 0xad1: 0x0008, + 0xad2: 0xe00d, 0xad3: 0x0008, 0xad4: 0xe00d, 0xad5: 0x0008, 0xad6: 0x0008, 0xad7: 0x0008, + 0xad8: 0x0008, 0xad9: 0x0008, 0xada: 0x062d, 0xadb: 0x064d, 0xadc: 0x0008, 0xadd: 0x0008, + 0xade: 0x1441, 0xadf: 0x0008, 0xae0: 0xe00d, 0xae1: 0x0008, 0xae2: 0xe00d, 0xae3: 0x0008, + 0xae4: 0xe00d, 0xae5: 0x0008, 0xae6: 0xe00d, 0xae7: 0x0008, 0xae8: 0xe00d, 0xae9: 0x0008, + 0xaea: 0xe00d, 0xaeb: 0x0008, 0xaec: 0xe00d, 0xaed: 0x0008, 0xaee: 0xe00d, 0xaef: 0x0008, + 0xaf0: 0xe00d, 0xaf1: 0x0008, 0xaf2: 0xe00d, 0xaf3: 0x0008, 0xaf4: 0xe00d, 0xaf5: 0x0008, + 0xaf6: 0xe00d, 0xaf7: 0x0008, 0xaf8: 0xe00d, 0xaf9: 0x0008, 0xafa: 0xe00d, 0xafb: 0x0008, + 0xafc: 0xe00d, 0xafd: 0x0008, 0xafe: 0xe00d, 0xaff: 0x0008, + // Block 0x2c, offset 0xb00 + 0xb00: 0x0008, 0xb01: 0x0008, 0xb02: 0x0008, 0xb03: 0x0008, 0xb04: 0x0008, 0xb05: 0x0008, + 0xb06: 0x0040, 0xb07: 0x0040, 0xb08: 0xe045, 0xb09: 0xe045, 0xb0a: 0xe045, 0xb0b: 0xe045, + 0xb0c: 0xe045, 0xb0d: 0xe045, 0xb0e: 0x0040, 0xb0f: 0x0040, 0xb10: 0x0008, 0xb11: 0x0008, + 0xb12: 0x0008, 0xb13: 0x0008, 0xb14: 0x0008, 0xb15: 0x0008, 0xb16: 0x0008, 0xb17: 0x0008, + 0xb18: 0x0040, 0xb19: 0xe045, 0xb1a: 0x0040, 0xb1b: 0xe045, 0xb1c: 0x0040, 0xb1d: 0xe045, + 0xb1e: 0x0040, 0xb1f: 0xe045, 0xb20: 0x0008, 0xb21: 0x0008, 0xb22: 0x0008, 0xb23: 0x0008, + 0xb24: 0x0008, 0xb25: 0x0008, 0xb26: 0x0008, 0xb27: 0x0008, 0xb28: 0xe045, 0xb29: 0xe045, + 0xb2a: 0xe045, 0xb2b: 0xe045, 0xb2c: 0xe045, 0xb2d: 0xe045, 0xb2e: 0xe045, 0xb2f: 0xe045, + 0xb30: 0x0008, 0xb31: 0x1459, 0xb32: 0x0008, 0xb33: 0x1471, 0xb34: 0x0008, 0xb35: 0x1489, + 0xb36: 0x0008, 0xb37: 0x14a1, 0xb38: 0x0008, 0xb39: 0x14b9, 0xb3a: 0x0008, 0xb3b: 0x14d1, + 0xb3c: 0x0008, 0xb3d: 0x14e9, 0xb3e: 0x0040, 0xb3f: 0x0040, + // Block 0x2d, offset 0xb40 + 0xb40: 0x1501, 0xb41: 0x1531, 0xb42: 0x1561, 0xb43: 0x1591, 0xb44: 0x15c1, 0xb45: 0x15f1, + 0xb46: 0x1621, 0xb47: 0x1651, 0xb48: 0x1501, 0xb49: 0x1531, 0xb4a: 0x1561, 0xb4b: 0x1591, + 0xb4c: 0x15c1, 0xb4d: 0x15f1, 0xb4e: 0x1621, 0xb4f: 0x1651, 0xb50: 0x1681, 0xb51: 0x16b1, + 0xb52: 0x16e1, 0xb53: 0x1711, 0xb54: 0x1741, 0xb55: 0x1771, 0xb56: 0x17a1, 0xb57: 0x17d1, + 0xb58: 0x1681, 0xb59: 0x16b1, 0xb5a: 0x16e1, 0xb5b: 0x1711, 0xb5c: 0x1741, 0xb5d: 0x1771, + 0xb5e: 0x17a1, 0xb5f: 0x17d1, 0xb60: 0x1801, 0xb61: 0x1831, 0xb62: 0x1861, 0xb63: 0x1891, + 0xb64: 0x18c1, 0xb65: 0x18f1, 0xb66: 0x1921, 0xb67: 0x1951, 0xb68: 0x1801, 0xb69: 0x1831, + 0xb6a: 0x1861, 0xb6b: 0x1891, 0xb6c: 0x18c1, 0xb6d: 0x18f1, 0xb6e: 0x1921, 0xb6f: 0x1951, + 0xb70: 0x0008, 0xb71: 0x0008, 0xb72: 0x1981, 0xb73: 0x19b1, 0xb74: 0x19d9, 0xb75: 0x0040, + 0xb76: 0x0008, 0xb77: 0x1a01, 0xb78: 0xe045, 0xb79: 0xe045, 0xb7a: 0x0665, 0xb7b: 0x1459, + 0xb7c: 0x19b1, 0xb7d: 0x067e, 0xb7e: 0x1a31, 0xb7f: 0x069e, + // Block 0x2e, offset 0xb80 + 0xb80: 0x06be, 0xb81: 0x1a4a, 0xb82: 0x1a79, 0xb83: 0x1aa9, 0xb84: 0x1ad1, 0xb85: 0x0040, + 0xb86: 0x0008, 0xb87: 0x1af9, 0xb88: 0x06dd, 0xb89: 0x1471, 0xb8a: 0x06f5, 0xb8b: 0x1489, + 0xb8c: 0x1aa9, 0xb8d: 0x1b2a, 0xb8e: 0x1b5a, 0xb8f: 0x1b8a, 0xb90: 0x0008, 0xb91: 0x0008, + 0xb92: 0x0008, 0xb93: 0x1bb9, 0xb94: 0x0040, 0xb95: 0x0040, 0xb96: 0x0008, 0xb97: 0x0008, + 0xb98: 0xe045, 0xb99: 0xe045, 0xb9a: 0x070d, 0xb9b: 0x14a1, 0xb9c: 0x0040, 0xb9d: 0x1bd2, + 0xb9e: 0x1c02, 0xb9f: 0x1c32, 0xba0: 0x0008, 0xba1: 0x0008, 0xba2: 0x0008, 0xba3: 0x1c61, + 0xba4: 0x0008, 0xba5: 0x0008, 0xba6: 0x0008, 0xba7: 0x0008, 0xba8: 0xe045, 0xba9: 0xe045, + 0xbaa: 0x0725, 0xbab: 0x14d1, 0xbac: 0xe04d, 0xbad: 0x1c7a, 0xbae: 0x03d2, 0xbaf: 0x1caa, + 0xbb0: 0x0040, 0xbb1: 0x0040, 0xbb2: 0x1cb9, 0xbb3: 0x1ce9, 0xbb4: 0x1d11, 0xbb5: 0x0040, + 0xbb6: 0x0008, 0xbb7: 0x1d39, 0xbb8: 0x073d, 0xbb9: 0x14b9, 0xbba: 0x0515, 0xbbb: 0x14e9, + 0xbbc: 0x1ce9, 0xbbd: 0x0756, 0xbbe: 0x0776, 0xbbf: 0x0040, + // Block 0x2f, offset 0xbc0 + 0xbc0: 0x000a, 0xbc1: 0x000a, 0xbc2: 0x000a, 0xbc3: 0x000a, 0xbc4: 0x000a, 0xbc5: 0x000a, + 0xbc6: 0x000a, 0xbc7: 0x000a, 0xbc8: 0x000a, 0xbc9: 0x000a, 0xbca: 0x000a, 0xbcb: 0x03c0, + 0xbcc: 0x0003, 0xbcd: 0x0003, 0xbce: 0x0340, 0xbcf: 0x0b40, 0xbd0: 0x0018, 0xbd1: 0xe00d, + 0xbd2: 0x0018, 0xbd3: 0x0018, 0xbd4: 0x0018, 0xbd5: 0x0018, 0xbd6: 0x0018, 0xbd7: 0x0796, + 0xbd8: 0x0018, 0xbd9: 0x0018, 0xbda: 0x0018, 0xbdb: 0x0018, 0xbdc: 0x0018, 0xbdd: 0x0018, + 0xbde: 0x0018, 0xbdf: 0x0018, 0xbe0: 0x0018, 0xbe1: 0x0018, 0xbe2: 0x0018, 0xbe3: 0x0018, + 0xbe4: 0x0040, 0xbe5: 0x0040, 0xbe6: 0x0040, 0xbe7: 0x0018, 0xbe8: 0x0040, 0xbe9: 0x0040, + 0xbea: 0x0340, 0xbeb: 0x0340, 0xbec: 0x0340, 0xbed: 0x0340, 0xbee: 0x0340, 0xbef: 0x000a, + 0xbf0: 0x0018, 0xbf1: 0x0018, 0xbf2: 0x0018, 0xbf3: 0x1d69, 0xbf4: 0x1da1, 0xbf5: 0x0018, + 0xbf6: 0x1df1, 0xbf7: 0x1e29, 0xbf8: 0x0018, 0xbf9: 0x0018, 0xbfa: 0x0018, 0xbfb: 0x0018, + 0xbfc: 0x1e7a, 0xbfd: 0x0018, 0xbfe: 0x07b6, 0xbff: 0x0018, + // Block 0x30, offset 0xc00 + 0xc00: 0x0018, 0xc01: 0x0018, 0xc02: 0x0018, 0xc03: 0x0018, 0xc04: 0x0018, 0xc05: 0x0018, + 0xc06: 0x0018, 0xc07: 0x1e92, 0xc08: 0x1eaa, 0xc09: 0x1ec2, 0xc0a: 0x0018, 0xc0b: 0x0018, + 0xc0c: 0x0018, 0xc0d: 0x0018, 0xc0e: 0x0018, 0xc0f: 0x0018, 0xc10: 0x0018, 0xc11: 0x0018, + 0xc12: 0x0018, 0xc13: 0x0018, 0xc14: 0x0018, 0xc15: 0x0018, 0xc16: 0x0018, 0xc17: 0x1ed9, + 0xc18: 0x0018, 0xc19: 0x0018, 0xc1a: 0x0018, 0xc1b: 0x0018, 0xc1c: 0x0018, 0xc1d: 0x0018, + 0xc1e: 0x0018, 0xc1f: 0x000a, 0xc20: 0x03c0, 0xc21: 0x0340, 0xc22: 0x0340, 0xc23: 0x0340, + 0xc24: 0x03c0, 0xc25: 0x0040, 0xc26: 0x0040, 0xc27: 0x0040, 0xc28: 0x0040, 0xc29: 0x0040, + 0xc2a: 0x0340, 0xc2b: 0x0340, 0xc2c: 0x0340, 0xc2d: 0x0340, 0xc2e: 0x0340, 0xc2f: 0x0340, + 0xc30: 0x1f41, 0xc31: 0x0f41, 0xc32: 0x0040, 0xc33: 0x0040, 0xc34: 0x1f51, 0xc35: 0x1f61, + 0xc36: 0x1f71, 0xc37: 0x1f81, 0xc38: 0x1f91, 0xc39: 0x1fa1, 0xc3a: 0x1fb2, 0xc3b: 0x07d5, + 0xc3c: 0x1fc2, 0xc3d: 0x1fd2, 0xc3e: 0x1fe2, 0xc3f: 0x0f71, + // Block 0x31, offset 0xc40 + 0xc40: 0x1f41, 0xc41: 0x00c9, 0xc42: 0x0069, 0xc43: 0x0079, 0xc44: 0x1f51, 0xc45: 0x1f61, + 0xc46: 0x1f71, 0xc47: 0x1f81, 0xc48: 0x1f91, 0xc49: 0x1fa1, 0xc4a: 0x1fb2, 0xc4b: 0x07ed, + 0xc4c: 0x1fc2, 0xc4d: 0x1fd2, 0xc4e: 0x1fe2, 0xc4f: 0x0040, 0xc50: 0x0039, 0xc51: 0x0f09, + 0xc52: 0x00d9, 0xc53: 0x0369, 0xc54: 0x0ff9, 0xc55: 0x0249, 0xc56: 0x0f51, 0xc57: 0x0359, + 0xc58: 0x0f61, 0xc59: 0x0f71, 0xc5a: 0x0f99, 0xc5b: 0x01d9, 0xc5c: 0x0fa9, 0xc5d: 0x0040, + 0xc5e: 0x0040, 0xc5f: 0x0040, 0xc60: 0x0018, 0xc61: 0x0018, 0xc62: 0x0018, 0xc63: 0x0018, + 0xc64: 0x0018, 0xc65: 0x0018, 0xc66: 0x0018, 0xc67: 0x0018, 0xc68: 0x1ff1, 0xc69: 0x0018, + 0xc6a: 0x0018, 0xc6b: 0x0018, 0xc6c: 0x0018, 0xc6d: 0x0018, 0xc6e: 0x0018, 0xc6f: 0x0018, + 0xc70: 0x0018, 0xc71: 0x0018, 0xc72: 0x0018, 0xc73: 0x0018, 0xc74: 0x0018, 0xc75: 0x0018, + 0xc76: 0x0018, 0xc77: 0x0018, 0xc78: 0x0018, 0xc79: 0x0018, 0xc7a: 0x0018, 0xc7b: 0x0018, + 0xc7c: 0x0018, 0xc7d: 0x0018, 0xc7e: 0x0018, 0xc7f: 0x0018, + // Block 0x32, offset 0xc80 + 0xc80: 0x0806, 0xc81: 0x0826, 0xc82: 0x1159, 0xc83: 0x0845, 0xc84: 0x0018, 0xc85: 0x0866, + 0xc86: 0x0886, 0xc87: 0x1011, 0xc88: 0x0018, 0xc89: 0x08a5, 0xc8a: 0x0f31, 0xc8b: 0x0249, + 0xc8c: 0x0249, 0xc8d: 0x0249, 0xc8e: 0x0249, 0xc8f: 0x2009, 0xc90: 0x0f41, 0xc91: 0x0f41, + 0xc92: 0x0359, 0xc93: 0x0359, 0xc94: 0x0018, 0xc95: 0x0f71, 0xc96: 0x2021, 0xc97: 0x0018, + 0xc98: 0x0018, 0xc99: 0x0f99, 0xc9a: 0x2039, 0xc9b: 0x0269, 0xc9c: 0x0269, 0xc9d: 0x0269, + 0xc9e: 0x0018, 0xc9f: 0x0018, 0xca0: 0x2049, 0xca1: 0x08c5, 0xca2: 0x2061, 0xca3: 0x0018, + 0xca4: 0x13d1, 0xca5: 0x0018, 0xca6: 0x2079, 0xca7: 0x0018, 0xca8: 0x13d1, 0xca9: 0x0018, + 0xcaa: 0x0f51, 0xcab: 0x2091, 0xcac: 0x0ee9, 0xcad: 0x1159, 0xcae: 0x0018, 0xcaf: 0x0f09, + 0xcb0: 0x0f09, 0xcb1: 0x1199, 0xcb2: 0x0040, 0xcb3: 0x0f61, 0xcb4: 0x00d9, 0xcb5: 0x20a9, + 0xcb6: 0x20c1, 0xcb7: 0x20d9, 0xcb8: 0x20f1, 0xcb9: 0x0f41, 0xcba: 0x0018, 0xcbb: 0x08e5, + 0xcbc: 0x2109, 0xcbd: 0x10b1, 0xcbe: 0x10b1, 0xcbf: 0x2109, + // Block 0x33, offset 0xcc0 + 0xcc0: 0x0905, 0xcc1: 0x0018, 0xcc2: 0x0018, 0xcc3: 0x0018, 0xcc4: 0x0018, 0xcc5: 0x0ef9, + 0xcc6: 0x0ef9, 0xcc7: 0x0f09, 0xcc8: 0x0f41, 0xcc9: 0x0259, 0xcca: 0x0018, 0xccb: 0x0018, + 0xccc: 0x0018, 0xccd: 0x0018, 0xcce: 0x0008, 0xccf: 0x0018, 0xcd0: 0x2121, 0xcd1: 0x2151, + 0xcd2: 0x2181, 0xcd3: 0x21b9, 0xcd4: 0x21e9, 0xcd5: 0x2219, 0xcd6: 0x2249, 0xcd7: 0x2279, + 0xcd8: 0x22a9, 0xcd9: 0x22d9, 0xcda: 0x2309, 0xcdb: 0x2339, 0xcdc: 0x2369, 0xcdd: 0x2399, + 0xcde: 0x23c9, 0xcdf: 0x23f9, 0xce0: 0x0f41, 0xce1: 0x2421, 0xce2: 0x091d, 0xce3: 0x2439, + 0xce4: 0x1089, 0xce5: 0x2451, 0xce6: 0x093d, 0xce7: 0x2469, 0xce8: 0x2491, 0xce9: 0x0369, + 0xcea: 0x24a9, 0xceb: 0x095d, 0xcec: 0x0359, 0xced: 0x1159, 0xcee: 0x0ef9, 0xcef: 0x0f61, + 0xcf0: 0x0f41, 0xcf1: 0x2421, 0xcf2: 0x097d, 0xcf3: 0x2439, 0xcf4: 0x1089, 0xcf5: 0x2451, + 0xcf6: 0x099d, 0xcf7: 0x2469, 0xcf8: 0x2491, 0xcf9: 0x0369, 0xcfa: 0x24a9, 0xcfb: 0x09bd, + 0xcfc: 0x0359, 0xcfd: 0x1159, 0xcfe: 0x0ef9, 0xcff: 0x0f61, + // Block 0x34, offset 0xd00 + 0xd00: 0x0018, 0xd01: 0x0018, 0xd02: 0x0018, 0xd03: 0x0018, 0xd04: 0x0018, 0xd05: 0x0018, + 0xd06: 0x0018, 0xd07: 0x0018, 0xd08: 0x0018, 0xd09: 0x0018, 0xd0a: 0x0018, 0xd0b: 0x0040, + 0xd0c: 0x0040, 0xd0d: 0x0040, 0xd0e: 0x0040, 0xd0f: 0x0040, 0xd10: 0x0040, 0xd11: 0x0040, + 0xd12: 0x0040, 0xd13: 0x0040, 0xd14: 0x0040, 0xd15: 0x0040, 0xd16: 0x0040, 0xd17: 0x0040, + 0xd18: 0x0040, 0xd19: 0x0040, 0xd1a: 0x0040, 0xd1b: 0x0040, 0xd1c: 0x0040, 0xd1d: 0x0040, + 0xd1e: 0x0040, 0xd1f: 0x0040, 0xd20: 0x00c9, 0xd21: 0x0069, 0xd22: 0x0079, 0xd23: 0x1f51, + 0xd24: 0x1f61, 0xd25: 0x1f71, 0xd26: 0x1f81, 0xd27: 0x1f91, 0xd28: 0x1fa1, 0xd29: 0x2601, + 0xd2a: 0x2619, 0xd2b: 0x2631, 0xd2c: 0x2649, 0xd2d: 0x2661, 0xd2e: 0x2679, 0xd2f: 0x2691, + 0xd30: 0x26a9, 0xd31: 0x26c1, 0xd32: 0x26d9, 0xd33: 0x26f1, 0xd34: 0x0a1e, 0xd35: 0x0a3e, + 0xd36: 0x0a5e, 0xd37: 0x0a7e, 0xd38: 0x0a9e, 0xd39: 0x0abe, 0xd3a: 0x0ade, 0xd3b: 0x0afe, + 0xd3c: 0x0b1e, 0xd3d: 0x270a, 0xd3e: 0x2732, 0xd3f: 0x275a, + // Block 0x35, offset 0xd40 + 0xd40: 0x2782, 0xd41: 0x27aa, 0xd42: 0x27d2, 0xd43: 0x27fa, 0xd44: 0x2822, 0xd45: 0x284a, + 0xd46: 0x2872, 0xd47: 0x289a, 0xd48: 0x0040, 0xd49: 0x0040, 0xd4a: 0x0040, 0xd4b: 0x0040, + 0xd4c: 0x0040, 0xd4d: 0x0040, 0xd4e: 0x0040, 0xd4f: 0x0040, 0xd50: 0x0040, 0xd51: 0x0040, + 0xd52: 0x0040, 0xd53: 0x0040, 0xd54: 0x0040, 0xd55: 0x0040, 0xd56: 0x0040, 0xd57: 0x0040, + 0xd58: 0x0040, 0xd59: 0x0040, 0xd5a: 0x0040, 0xd5b: 0x0040, 0xd5c: 0x0b3e, 0xd5d: 0x0b5e, + 0xd5e: 0x0b7e, 0xd5f: 0x0b9e, 0xd60: 0x0bbe, 0xd61: 0x0bde, 0xd62: 0x0bfe, 0xd63: 0x0c1e, + 0xd64: 0x0c3e, 0xd65: 0x0c5e, 0xd66: 0x0c7e, 0xd67: 0x0c9e, 0xd68: 0x0cbe, 0xd69: 0x0cde, + 0xd6a: 0x0cfe, 0xd6b: 0x0d1e, 0xd6c: 0x0d3e, 0xd6d: 0x0d5e, 0xd6e: 0x0d7e, 0xd6f: 0x0d9e, + 0xd70: 0x0dbe, 0xd71: 0x0dde, 0xd72: 0x0dfe, 0xd73: 0x0e1e, 0xd74: 0x0e3e, 0xd75: 0x0e5e, + 0xd76: 0x0039, 0xd77: 0x0ee9, 0xd78: 0x1159, 0xd79: 0x0ef9, 0xd7a: 0x0f09, 0xd7b: 0x1199, + 0xd7c: 0x0f31, 0xd7d: 0x0249, 0xd7e: 0x0f41, 0xd7f: 0x0259, + // Block 0x36, offset 0xd80 + 0xd80: 0x0f51, 0xd81: 0x0359, 0xd82: 0x0f61, 0xd83: 0x0f71, 0xd84: 0x00d9, 0xd85: 0x0f99, + 0xd86: 0x2039, 0xd87: 0x0269, 0xd88: 0x01d9, 0xd89: 0x0fa9, 0xd8a: 0x0fb9, 0xd8b: 0x1089, + 0xd8c: 0x0279, 0xd8d: 0x0369, 0xd8e: 0x0289, 0xd8f: 0x13d1, 0xd90: 0x0039, 0xd91: 0x0ee9, + 0xd92: 0x1159, 0xd93: 0x0ef9, 0xd94: 0x0f09, 0xd95: 0x1199, 0xd96: 0x0f31, 0xd97: 0x0249, + 0xd98: 0x0f41, 0xd99: 0x0259, 0xd9a: 0x0f51, 0xd9b: 0x0359, 0xd9c: 0x0f61, 0xd9d: 0x0f71, + 0xd9e: 0x00d9, 0xd9f: 0x0f99, 0xda0: 0x2039, 0xda1: 0x0269, 0xda2: 0x01d9, 0xda3: 0x0fa9, + 0xda4: 0x0fb9, 0xda5: 0x1089, 0xda6: 0x0279, 0xda7: 0x0369, 0xda8: 0x0289, 0xda9: 0x13d1, + 0xdaa: 0x1f41, 0xdab: 0x0018, 0xdac: 0x0018, 0xdad: 0x0018, 0xdae: 0x0018, 0xdaf: 0x0018, + 0xdb0: 0x0018, 0xdb1: 0x0018, 0xdb2: 0x0018, 0xdb3: 0x0018, 0xdb4: 0x0018, 0xdb5: 0x0018, + 0xdb6: 0x0018, 0xdb7: 0x0018, 0xdb8: 0x0018, 0xdb9: 0x0018, 0xdba: 0x0018, 0xdbb: 0x0018, + 0xdbc: 0x0018, 0xdbd: 0x0018, 0xdbe: 0x0018, 0xdbf: 0x0018, + // Block 0x37, offset 0xdc0 + 0xdc0: 0x0008, 0xdc1: 0x0008, 0xdc2: 0x0008, 0xdc3: 0x0008, 0xdc4: 0x0008, 0xdc5: 0x0008, + 0xdc6: 0x0008, 0xdc7: 0x0008, 0xdc8: 0x0008, 0xdc9: 0x0008, 0xdca: 0x0008, 0xdcb: 0x0008, + 0xdcc: 0x0008, 0xdcd: 0x0008, 0xdce: 0x0008, 0xdcf: 0x0008, 0xdd0: 0x0008, 0xdd1: 0x0008, + 0xdd2: 0x0008, 0xdd3: 0x0008, 0xdd4: 0x0008, 0xdd5: 0x0008, 0xdd6: 0x0008, 0xdd7: 0x0008, + 0xdd8: 0x0008, 0xdd9: 0x0008, 0xdda: 0x0008, 0xddb: 0x0008, 0xddc: 0x0008, 0xddd: 0x0008, + 0xdde: 0x0008, 0xddf: 0x0040, 0xde0: 0xe00d, 0xde1: 0x0008, 0xde2: 0x2971, 0xde3: 0x0ed5, + 0xde4: 0x2989, 0xde5: 0x0008, 0xde6: 0x0008, 0xde7: 0xe07d, 0xde8: 0x0008, 0xde9: 0xe01d, + 0xdea: 0x0008, 0xdeb: 0xe03d, 0xdec: 0x0008, 0xded: 0x0fe1, 0xdee: 0x1281, 0xdef: 0x0fc9, + 0xdf0: 0x1141, 0xdf1: 0x0008, 0xdf2: 0xe00d, 0xdf3: 0x0008, 0xdf4: 0x0008, 0xdf5: 0xe01d, + 0xdf6: 0x0008, 0xdf7: 0x0008, 0xdf8: 0x0008, 0xdf9: 0x0008, 0xdfa: 0x0008, 0xdfb: 0x0008, + 0xdfc: 0x0259, 0xdfd: 0x1089, 0xdfe: 0x29a1, 0xdff: 0x29b9, + // Block 0x38, offset 0xe00 + 0xe00: 0xe00d, 0xe01: 0x0008, 0xe02: 0xe00d, 0xe03: 0x0008, 0xe04: 0xe00d, 0xe05: 0x0008, + 0xe06: 0xe00d, 0xe07: 0x0008, 0xe08: 0xe00d, 0xe09: 0x0008, 0xe0a: 0xe00d, 0xe0b: 0x0008, + 0xe0c: 0xe00d, 0xe0d: 0x0008, 0xe0e: 0xe00d, 0xe0f: 0x0008, 0xe10: 0xe00d, 0xe11: 0x0008, + 0xe12: 0xe00d, 0xe13: 0x0008, 0xe14: 0xe00d, 0xe15: 0x0008, 0xe16: 0xe00d, 0xe17: 0x0008, + 0xe18: 0xe00d, 0xe19: 0x0008, 0xe1a: 0xe00d, 0xe1b: 0x0008, 0xe1c: 0xe00d, 0xe1d: 0x0008, + 0xe1e: 0xe00d, 0xe1f: 0x0008, 0xe20: 0xe00d, 0xe21: 0x0008, 0xe22: 0xe00d, 0xe23: 0x0008, + 0xe24: 0x0008, 0xe25: 0x0018, 0xe26: 0x0018, 0xe27: 0x0018, 0xe28: 0x0018, 0xe29: 0x0018, + 0xe2a: 0x0018, 0xe2b: 0xe03d, 0xe2c: 0x0008, 0xe2d: 0xe01d, 0xe2e: 0x0008, 0xe2f: 0x3308, + 0xe30: 0x3308, 0xe31: 0x3308, 0xe32: 0xe00d, 0xe33: 0x0008, 0xe34: 0x0040, 0xe35: 0x0040, + 0xe36: 0x0040, 0xe37: 0x0040, 0xe38: 0x0040, 0xe39: 0x0018, 0xe3a: 0x0018, 0xe3b: 0x0018, + 0xe3c: 0x0018, 0xe3d: 0x0018, 0xe3e: 0x0018, 0xe3f: 0x0018, + // Block 0x39, offset 0xe40 + 0xe40: 0x2715, 0xe41: 0x2735, 0xe42: 0x2755, 0xe43: 0x2775, 0xe44: 0x2795, 0xe45: 0x27b5, + 0xe46: 0x27d5, 0xe47: 0x27f5, 0xe48: 0x2815, 0xe49: 0x2835, 0xe4a: 0x2855, 0xe4b: 0x2875, + 0xe4c: 0x2895, 0xe4d: 0x28b5, 0xe4e: 0x28d5, 0xe4f: 0x28f5, 0xe50: 0x2915, 0xe51: 0x2935, + 0xe52: 0x2955, 0xe53: 0x2975, 0xe54: 0x2995, 0xe55: 0x29b5, 0xe56: 0x0040, 0xe57: 0x0040, + 0xe58: 0x0040, 0xe59: 0x0040, 0xe5a: 0x0040, 0xe5b: 0x0040, 0xe5c: 0x0040, 0xe5d: 0x0040, + 0xe5e: 0x0040, 0xe5f: 0x0040, 0xe60: 0x0040, 0xe61: 0x0040, 0xe62: 0x0040, 0xe63: 0x0040, + 0xe64: 0x0040, 0xe65: 0x0040, 0xe66: 0x0040, 0xe67: 0x0040, 0xe68: 0x0040, 0xe69: 0x0040, + 0xe6a: 0x0040, 0xe6b: 0x0040, 0xe6c: 0x0040, 0xe6d: 0x0040, 0xe6e: 0x0040, 0xe6f: 0x0040, + 0xe70: 0x0040, 0xe71: 0x0040, 0xe72: 0x0040, 0xe73: 0x0040, 0xe74: 0x0040, 0xe75: 0x0040, + 0xe76: 0x0040, 0xe77: 0x0040, 0xe78: 0x0040, 0xe79: 0x0040, 0xe7a: 0x0040, 0xe7b: 0x0040, + 0xe7c: 0x0040, 0xe7d: 0x0040, 0xe7e: 0x0040, 0xe7f: 0x0040, + // Block 0x3a, offset 0xe80 + 0xe80: 0x000a, 0xe81: 0x0018, 0xe82: 0x29d1, 0xe83: 0x0018, 0xe84: 0x0018, 0xe85: 0x0008, + 0xe86: 0x0008, 0xe87: 0x0008, 0xe88: 0x0018, 0xe89: 0x0018, 0xe8a: 0x0018, 0xe8b: 0x0018, + 0xe8c: 0x0018, 0xe8d: 0x0018, 0xe8e: 0x0018, 0xe8f: 0x0018, 0xe90: 0x0018, 0xe91: 0x0018, + 0xe92: 0x0018, 0xe93: 0x0018, 0xe94: 0x0018, 0xe95: 0x0018, 0xe96: 0x0018, 0xe97: 0x0018, + 0xe98: 0x0018, 0xe99: 0x0018, 0xe9a: 0x0018, 0xe9b: 0x0018, 0xe9c: 0x0018, 0xe9d: 0x0018, + 0xe9e: 0x0018, 0xe9f: 0x0018, 0xea0: 0x0018, 0xea1: 0x0018, 0xea2: 0x0018, 0xea3: 0x0018, + 0xea4: 0x0018, 0xea5: 0x0018, 0xea6: 0x0018, 0xea7: 0x0018, 0xea8: 0x0018, 0xea9: 0x0018, + 0xeaa: 0x3308, 0xeab: 0x3308, 0xeac: 0x3308, 0xead: 0x3308, 0xeae: 0x3018, 0xeaf: 0x3018, + 0xeb0: 0x0018, 0xeb1: 0x0018, 0xeb2: 0x0018, 0xeb3: 0x0018, 0xeb4: 0x0018, 0xeb5: 0x0018, + 0xeb6: 0xe125, 0xeb7: 0x0018, 0xeb8: 0x29d5, 0xeb9: 0x29f5, 0xeba: 0x2a15, 0xebb: 0x0018, + 0xebc: 0x0008, 0xebd: 0x0018, 0xebe: 0x0018, 0xebf: 0x0018, + // Block 0x3b, offset 0xec0 + 0xec0: 0x2b55, 0xec1: 0x2b75, 0xec2: 0x2b95, 0xec3: 0x2bb5, 0xec4: 0x2bd5, 0xec5: 0x2bf5, + 0xec6: 0x2bf5, 0xec7: 0x2bf5, 0xec8: 0x2c15, 0xec9: 0x2c15, 0xeca: 0x2c15, 0xecb: 0x2c15, + 0xecc: 0x2c35, 0xecd: 0x2c35, 0xece: 0x2c35, 0xecf: 0x2c55, 0xed0: 0x2c75, 0xed1: 0x2c75, + 0xed2: 0x2a95, 0xed3: 0x2a95, 0xed4: 0x2c75, 0xed5: 0x2c75, 0xed6: 0x2c95, 0xed7: 0x2c95, + 0xed8: 0x2c75, 0xed9: 0x2c75, 0xeda: 0x2a95, 0xedb: 0x2a95, 0xedc: 0x2c75, 0xedd: 0x2c75, + 0xede: 0x2c55, 0xedf: 0x2c55, 0xee0: 0x2cb5, 0xee1: 0x2cb5, 0xee2: 0x2cd5, 0xee3: 0x2cd5, + 0xee4: 0x0040, 0xee5: 0x2cf5, 0xee6: 0x2d15, 0xee7: 0x2d35, 0xee8: 0x2d35, 0xee9: 0x2d55, + 0xeea: 0x2d75, 0xeeb: 0x2d95, 0xeec: 0x2db5, 0xeed: 0x2dd5, 0xeee: 0x2df5, 0xeef: 0x2e15, + 0xef0: 0x2e35, 0xef1: 0x2e55, 0xef2: 0x2e55, 0xef3: 0x2e75, 0xef4: 0x2e95, 0xef5: 0x2e95, + 0xef6: 0x2eb5, 0xef7: 0x2ed5, 0xef8: 0x2e75, 0xef9: 0x2ef5, 0xefa: 0x2f15, 0xefb: 0x2ef5, + 0xefc: 0x2e75, 0xefd: 0x2f35, 0xefe: 0x2f55, 0xeff: 0x2f75, + // Block 0x3c, offset 0xf00 + 0xf00: 0x2f95, 0xf01: 0x2fb5, 0xf02: 0x2d15, 0xf03: 0x2cf5, 0xf04: 0x2fd5, 0xf05: 0x2ff5, + 0xf06: 0x3015, 0xf07: 0x3035, 0xf08: 0x3055, 0xf09: 0x3075, 0xf0a: 0x3095, 0xf0b: 0x30b5, + 0xf0c: 0x30d5, 0xf0d: 0x30f5, 0xf0e: 0x3115, 0xf0f: 0x0040, 0xf10: 0x0018, 0xf11: 0x0018, + 0xf12: 0x3135, 0xf13: 0x3155, 0xf14: 0x3175, 0xf15: 0x3195, 0xf16: 0x31b5, 0xf17: 0x31d5, + 0xf18: 0x31f5, 0xf19: 0x3215, 0xf1a: 0x3235, 0xf1b: 0x3255, 0xf1c: 0x3175, 0xf1d: 0x3275, + 0xf1e: 0x3295, 0xf1f: 0x32b5, 0xf20: 0x0008, 0xf21: 0x0008, 0xf22: 0x0008, 0xf23: 0x0008, + 0xf24: 0x0008, 0xf25: 0x0008, 0xf26: 0x0008, 0xf27: 0x0008, 0xf28: 0x0008, 0xf29: 0x0008, + 0xf2a: 0x0008, 0xf2b: 0x0008, 0xf2c: 0x0008, 0xf2d: 0x0008, 0xf2e: 0x0008, 0xf2f: 0x0008, + 0xf30: 0x0008, 0xf31: 0x0008, 0xf32: 0x0008, 0xf33: 0x0008, 0xf34: 0x0008, 0xf35: 0x0008, + 0xf36: 0x0008, 0xf37: 0x0008, 0xf38: 0x0008, 0xf39: 0x0008, 0xf3a: 0x0008, 0xf3b: 0x0040, + 0xf3c: 0x0040, 0xf3d: 0x0040, 0xf3e: 0x0040, 0xf3f: 0x0040, + // Block 0x3d, offset 0xf40 + 0xf40: 0x36a2, 0xf41: 0x36d2, 0xf42: 0x3702, 0xf43: 0x3732, 0xf44: 0x32d5, 0xf45: 0x32f5, + 0xf46: 0x3315, 0xf47: 0x3335, 0xf48: 0x0018, 0xf49: 0x0018, 0xf4a: 0x0018, 0xf4b: 0x0018, + 0xf4c: 0x0018, 0xf4d: 0x0018, 0xf4e: 0x0018, 0xf4f: 0x0018, 0xf50: 0x3355, 0xf51: 0x3761, + 0xf52: 0x3779, 0xf53: 0x3791, 0xf54: 0x37a9, 0xf55: 0x37c1, 0xf56: 0x37d9, 0xf57: 0x37f1, + 0xf58: 0x3809, 0xf59: 0x3821, 0xf5a: 0x3839, 0xf5b: 0x3851, 0xf5c: 0x3869, 0xf5d: 0x3881, + 0xf5e: 0x3899, 0xf5f: 0x38b1, 0xf60: 0x3375, 0xf61: 0x3395, 0xf62: 0x33b5, 0xf63: 0x33d5, + 0xf64: 0x33f5, 0xf65: 0x33f5, 0xf66: 0x3415, 0xf67: 0x3435, 0xf68: 0x3455, 0xf69: 0x3475, + 0xf6a: 0x3495, 0xf6b: 0x34b5, 0xf6c: 0x34d5, 0xf6d: 0x34f5, 0xf6e: 0x3515, 0xf6f: 0x3535, + 0xf70: 0x3555, 0xf71: 0x3575, 0xf72: 0x3595, 0xf73: 0x35b5, 0xf74: 0x35d5, 0xf75: 0x35f5, + 0xf76: 0x3615, 0xf77: 0x3635, 0xf78: 0x3655, 0xf79: 0x3675, 0xf7a: 0x3695, 0xf7b: 0x36b5, + 0xf7c: 0x38c9, 0xf7d: 0x3901, 0xf7e: 0x36d5, 0xf7f: 0x0018, + // Block 0x3e, offset 0xf80 + 0xf80: 0x36f5, 0xf81: 0x3715, 0xf82: 0x3735, 0xf83: 0x3755, 0xf84: 0x3775, 0xf85: 0x3795, + 0xf86: 0x37b5, 0xf87: 0x37d5, 0xf88: 0x37f5, 0xf89: 0x3815, 0xf8a: 0x3835, 0xf8b: 0x3855, + 0xf8c: 0x3875, 0xf8d: 0x3895, 0xf8e: 0x38b5, 0xf8f: 0x38d5, 0xf90: 0x38f5, 0xf91: 0x3915, + 0xf92: 0x3935, 0xf93: 0x3955, 0xf94: 0x3975, 0xf95: 0x3995, 0xf96: 0x39b5, 0xf97: 0x39d5, + 0xf98: 0x39f5, 0xf99: 0x3a15, 0xf9a: 0x3a35, 0xf9b: 0x3a55, 0xf9c: 0x3a75, 0xf9d: 0x3a95, + 0xf9e: 0x3ab5, 0xf9f: 0x3ad5, 0xfa0: 0x3af5, 0xfa1: 0x3b15, 0xfa2: 0x3b35, 0xfa3: 0x3b55, + 0xfa4: 0x3b75, 0xfa5: 0x3b95, 0xfa6: 0x1295, 0xfa7: 0x3bb5, 0xfa8: 0x3bd5, 0xfa9: 0x3bf5, + 0xfaa: 0x3c15, 0xfab: 0x3c35, 0xfac: 0x3c55, 0xfad: 0x3c75, 0xfae: 0x23b5, 0xfaf: 0x3c95, + 0xfb0: 0x3cb5, 0xfb1: 0x3939, 0xfb2: 0x3951, 0xfb3: 0x3969, 0xfb4: 0x3981, 0xfb5: 0x3999, + 0xfb6: 0x39b1, 0xfb7: 0x39c9, 0xfb8: 0x39e1, 0xfb9: 0x39f9, 0xfba: 0x3a11, 0xfbb: 0x3a29, + 0xfbc: 0x3a41, 0xfbd: 0x3a59, 0xfbe: 0x3a71, 0xfbf: 0x3a89, + // Block 0x3f, offset 0xfc0 + 0xfc0: 0x3aa1, 0xfc1: 0x3ac9, 0xfc2: 0x3af1, 0xfc3: 0x3b19, 0xfc4: 0x3b41, 0xfc5: 0x3b69, + 0xfc6: 0x3b91, 0xfc7: 0x3bb9, 0xfc8: 0x3be1, 0xfc9: 0x3c09, 0xfca: 0x3c39, 0xfcb: 0x3c69, + 0xfcc: 0x3c99, 0xfcd: 0x3cd5, 0xfce: 0x3cb1, 0xfcf: 0x3cf5, 0xfd0: 0x3d15, 0xfd1: 0x3d2d, + 0xfd2: 0x3d45, 0xfd3: 0x3d5d, 0xfd4: 0x3d75, 0xfd5: 0x3d75, 0xfd6: 0x3d5d, 0xfd7: 0x3d8d, + 0xfd8: 0x07d5, 0xfd9: 0x3da5, 0xfda: 0x3dbd, 0xfdb: 0x3dd5, 0xfdc: 0x3ded, 0xfdd: 0x3e05, + 0xfde: 0x3e1d, 0xfdf: 0x3e35, 0xfe0: 0x3e4d, 0xfe1: 0x3e65, 0xfe2: 0x3e7d, 0xfe3: 0x3e95, + 0xfe4: 0x3ead, 0xfe5: 0x3ead, 0xfe6: 0x3ec5, 0xfe7: 0x3ec5, 0xfe8: 0x3edd, 0xfe9: 0x3edd, + 0xfea: 0x3ef5, 0xfeb: 0x3f0d, 0xfec: 0x3f25, 0xfed: 0x3f3d, 0xfee: 0x3f55, 0xfef: 0x3f55, + 0xff0: 0x3f6d, 0xff1: 0x3f6d, 0xff2: 0x3f6d, 0xff3: 0x3f85, 0xff4: 0x3f9d, 0xff5: 0x3fb5, + 0xff6: 0x3fcd, 0xff7: 0x3fb5, 0xff8: 0x3fe5, 0xff9: 0x3ffd, 0xffa: 0x3f85, 0xffb: 0x4015, + 0xffc: 0x402d, 0xffd: 0x402d, 0xffe: 0x402d, 0xfff: 0x0040, + // Block 0x40, offset 0x1000 + 0x1000: 0x3cc9, 0x1001: 0x3d31, 0x1002: 0x3d99, 0x1003: 0x3e01, 0x1004: 0x3e51, 0x1005: 0x3eb9, + 0x1006: 0x3f09, 0x1007: 0x3f59, 0x1008: 0x3fd9, 0x1009: 0x4041, 0x100a: 0x4091, 0x100b: 0x40e1, + 0x100c: 0x4131, 0x100d: 0x4199, 0x100e: 0x4201, 0x100f: 0x4251, 0x1010: 0x42a1, 0x1011: 0x42d9, + 0x1012: 0x4329, 0x1013: 0x4391, 0x1014: 0x43f9, 0x1015: 0x4431, 0x1016: 0x44b1, 0x1017: 0x4549, + 0x1018: 0x45c9, 0x1019: 0x4619, 0x101a: 0x4699, 0x101b: 0x4719, 0x101c: 0x4781, 0x101d: 0x47d1, + 0x101e: 0x4821, 0x101f: 0x4871, 0x1020: 0x48d9, 0x1021: 0x4959, 0x1022: 0x49c1, 0x1023: 0x4a11, + 0x1024: 0x4a61, 0x1025: 0x4ab1, 0x1026: 0x4ae9, 0x1027: 0x4b21, 0x1028: 0x4b59, 0x1029: 0x4b91, + 0x102a: 0x4be1, 0x102b: 0x4c31, 0x102c: 0x4cb1, 0x102d: 0x4d01, 0x102e: 0x4d69, 0x102f: 0x4de9, + 0x1030: 0x4e39, 0x1031: 0x4e71, 0x1032: 0x4ea9, 0x1033: 0x4f29, 0x1034: 0x4f91, 0x1035: 0x5011, + 0x1036: 0x5061, 0x1037: 0x50e1, 0x1038: 0x5119, 0x1039: 0x5169, 0x103a: 0x51b9, 0x103b: 0x5209, + 0x103c: 0x5259, 0x103d: 0x52a9, 0x103e: 0x5311, 0x103f: 0x5361, + // Block 0x41, offset 0x1040 + 0x1040: 0x5399, 0x1041: 0x53e9, 0x1042: 0x5439, 0x1043: 0x5489, 0x1044: 0x54f1, 0x1045: 0x5541, + 0x1046: 0x5591, 0x1047: 0x55e1, 0x1048: 0x5661, 0x1049: 0x56c9, 0x104a: 0x5701, 0x104b: 0x5781, + 0x104c: 0x57b9, 0x104d: 0x5821, 0x104e: 0x5889, 0x104f: 0x58d9, 0x1050: 0x5929, 0x1051: 0x5979, + 0x1052: 0x59e1, 0x1053: 0x5a19, 0x1054: 0x5a69, 0x1055: 0x5ad1, 0x1056: 0x5b09, 0x1057: 0x5b89, + 0x1058: 0x5bd9, 0x1059: 0x5c01, 0x105a: 0x5c29, 0x105b: 0x5c51, 0x105c: 0x5c79, 0x105d: 0x5ca1, + 0x105e: 0x5cc9, 0x105f: 0x5cf1, 0x1060: 0x5d19, 0x1061: 0x5d41, 0x1062: 0x5d69, 0x1063: 0x5d99, + 0x1064: 0x5dc9, 0x1065: 0x5df9, 0x1066: 0x5e29, 0x1067: 0x5e59, 0x1068: 0x5e89, 0x1069: 0x5eb9, + 0x106a: 0x5ee9, 0x106b: 0x5f19, 0x106c: 0x5f49, 0x106d: 0x5f79, 0x106e: 0x5fa9, 0x106f: 0x5fd9, + 0x1070: 0x6009, 0x1071: 0x4045, 0x1072: 0x6039, 0x1073: 0x6051, 0x1074: 0x4065, 0x1075: 0x6069, + 0x1076: 0x6081, 0x1077: 0x6099, 0x1078: 0x4085, 0x1079: 0x4085, 0x107a: 0x60b1, 0x107b: 0x60c9, + 0x107c: 0x6101, 0x107d: 0x6139, 0x107e: 0x6171, 0x107f: 0x61a9, + // Block 0x42, offset 0x1080 + 0x1080: 0x6211, 0x1081: 0x6229, 0x1082: 0x40a5, 0x1083: 0x6241, 0x1084: 0x6259, 0x1085: 0x6271, + 0x1086: 0x6289, 0x1087: 0x62a1, 0x1088: 0x40c5, 0x1089: 0x62b9, 0x108a: 0x62e1, 0x108b: 0x62f9, + 0x108c: 0x40e5, 0x108d: 0x40e5, 0x108e: 0x6311, 0x108f: 0x6329, 0x1090: 0x6341, 0x1091: 0x4105, + 0x1092: 0x4125, 0x1093: 0x4145, 0x1094: 0x4165, 0x1095: 0x4185, 0x1096: 0x6359, 0x1097: 0x6371, + 0x1098: 0x6389, 0x1099: 0x63a1, 0x109a: 0x63b9, 0x109b: 0x41a5, 0x109c: 0x63d1, 0x109d: 0x63e9, + 0x109e: 0x6401, 0x109f: 0x41c5, 0x10a0: 0x41e5, 0x10a1: 0x6419, 0x10a2: 0x4205, 0x10a3: 0x4225, + 0x10a4: 0x4245, 0x10a5: 0x6431, 0x10a6: 0x4265, 0x10a7: 0x6449, 0x10a8: 0x6479, 0x10a9: 0x6211, + 0x10aa: 0x4285, 0x10ab: 0x42a5, 0x10ac: 0x42c5, 0x10ad: 0x42e5, 0x10ae: 0x64b1, 0x10af: 0x64f1, + 0x10b0: 0x6539, 0x10b1: 0x6551, 0x10b2: 0x4305, 0x10b3: 0x6569, 0x10b4: 0x6581, 0x10b5: 0x6599, + 0x10b6: 0x4325, 0x10b7: 0x65b1, 0x10b8: 0x65c9, 0x10b9: 0x65b1, 0x10ba: 0x65e1, 0x10bb: 0x65f9, + 0x10bc: 0x4345, 0x10bd: 0x6611, 0x10be: 0x6629, 0x10bf: 0x6611, + // Block 0x43, offset 0x10c0 + 0x10c0: 0x4365, 0x10c1: 0x4385, 0x10c2: 0x0040, 0x10c3: 0x6641, 0x10c4: 0x6659, 0x10c5: 0x6671, + 0x10c6: 0x6689, 0x10c7: 0x0040, 0x10c8: 0x66c1, 0x10c9: 0x66d9, 0x10ca: 0x66f1, 0x10cb: 0x6709, + 0x10cc: 0x6721, 0x10cd: 0x6739, 0x10ce: 0x6401, 0x10cf: 0x6751, 0x10d0: 0x6769, 0x10d1: 0x6781, + 0x10d2: 0x43a5, 0x10d3: 0x6799, 0x10d4: 0x6289, 0x10d5: 0x43c5, 0x10d6: 0x43e5, 0x10d7: 0x67b1, + 0x10d8: 0x0040, 0x10d9: 0x4405, 0x10da: 0x67c9, 0x10db: 0x67e1, 0x10dc: 0x67f9, 0x10dd: 0x6811, + 0x10de: 0x6829, 0x10df: 0x6859, 0x10e0: 0x6889, 0x10e1: 0x68b1, 0x10e2: 0x68d9, 0x10e3: 0x6901, + 0x10e4: 0x6929, 0x10e5: 0x6951, 0x10e6: 0x6979, 0x10e7: 0x69a1, 0x10e8: 0x69c9, 0x10e9: 0x69f1, + 0x10ea: 0x6a21, 0x10eb: 0x6a51, 0x10ec: 0x6a81, 0x10ed: 0x6ab1, 0x10ee: 0x6ae1, 0x10ef: 0x6b11, + 0x10f0: 0x6b41, 0x10f1: 0x6b71, 0x10f2: 0x6ba1, 0x10f3: 0x6bd1, 0x10f4: 0x6c01, 0x10f5: 0x6c31, + 0x10f6: 0x6c61, 0x10f7: 0x6c91, 0x10f8: 0x6cc1, 0x10f9: 0x6cf1, 0x10fa: 0x6d21, 0x10fb: 0x6d51, + 0x10fc: 0x6d81, 0x10fd: 0x6db1, 0x10fe: 0x6de1, 0x10ff: 0x4425, + // Block 0x44, offset 0x1100 + 0x1100: 0xe00d, 0x1101: 0x0008, 0x1102: 0xe00d, 0x1103: 0x0008, 0x1104: 0xe00d, 0x1105: 0x0008, + 0x1106: 0xe00d, 0x1107: 0x0008, 0x1108: 0xe00d, 0x1109: 0x0008, 0x110a: 0xe00d, 0x110b: 0x0008, + 0x110c: 0xe00d, 0x110d: 0x0008, 0x110e: 0xe00d, 0x110f: 0x0008, 0x1110: 0xe00d, 0x1111: 0x0008, + 0x1112: 0xe00d, 0x1113: 0x0008, 0x1114: 0xe00d, 0x1115: 0x0008, 0x1116: 0xe00d, 0x1117: 0x0008, + 0x1118: 0xe00d, 0x1119: 0x0008, 0x111a: 0xe00d, 0x111b: 0x0008, 0x111c: 0xe00d, 0x111d: 0x0008, + 0x111e: 0xe00d, 0x111f: 0x0008, 0x1120: 0xe00d, 0x1121: 0x0008, 0x1122: 0xe00d, 0x1123: 0x0008, + 0x1124: 0xe00d, 0x1125: 0x0008, 0x1126: 0xe00d, 0x1127: 0x0008, 0x1128: 0xe00d, 0x1129: 0x0008, + 0x112a: 0xe00d, 0x112b: 0x0008, 0x112c: 0xe00d, 0x112d: 0x0008, 0x112e: 0x0008, 0x112f: 0x3308, + 0x1130: 0x3318, 0x1131: 0x3318, 0x1132: 0x3318, 0x1133: 0x0018, 0x1134: 0x3308, 0x1135: 0x3308, + 0x1136: 0x3308, 0x1137: 0x3308, 0x1138: 0x3308, 0x1139: 0x3308, 0x113a: 0x3308, 0x113b: 0x3308, + 0x113c: 0x3308, 0x113d: 0x3308, 0x113e: 0x0018, 0x113f: 0x0008, + // Block 0x45, offset 0x1140 + 0x1140: 0xe00d, 0x1141: 0x0008, 0x1142: 0xe00d, 0x1143: 0x0008, 0x1144: 0xe00d, 0x1145: 0x0008, + 0x1146: 0xe00d, 0x1147: 0x0008, 0x1148: 0xe00d, 0x1149: 0x0008, 0x114a: 0xe00d, 0x114b: 0x0008, + 0x114c: 0xe00d, 0x114d: 0x0008, 0x114e: 0xe00d, 0x114f: 0x0008, 0x1150: 0xe00d, 0x1151: 0x0008, + 0x1152: 0xe00d, 0x1153: 0x0008, 0x1154: 0xe00d, 0x1155: 0x0008, 0x1156: 0xe00d, 0x1157: 0x0008, + 0x1158: 0xe00d, 0x1159: 0x0008, 0x115a: 0xe00d, 0x115b: 0x0008, 0x115c: 0x0ea1, 0x115d: 0x6e11, + 0x115e: 0x3308, 0x115f: 0x3308, 0x1160: 0x0008, 0x1161: 0x0008, 0x1162: 0x0008, 0x1163: 0x0008, + 0x1164: 0x0008, 0x1165: 0x0008, 0x1166: 0x0008, 0x1167: 0x0008, 0x1168: 0x0008, 0x1169: 0x0008, + 0x116a: 0x0008, 0x116b: 0x0008, 0x116c: 0x0008, 0x116d: 0x0008, 0x116e: 0x0008, 0x116f: 0x0008, + 0x1170: 0x0008, 0x1171: 0x0008, 0x1172: 0x0008, 0x1173: 0x0008, 0x1174: 0x0008, 0x1175: 0x0008, + 0x1176: 0x0008, 0x1177: 0x0008, 0x1178: 0x0008, 0x1179: 0x0008, 0x117a: 0x0008, 0x117b: 0x0008, + 0x117c: 0x0008, 0x117d: 0x0008, 0x117e: 0x0008, 0x117f: 0x0008, + // Block 0x46, offset 0x1180 + 0x1180: 0x0018, 0x1181: 0x0018, 0x1182: 0x0018, 0x1183: 0x0018, 0x1184: 0x0018, 0x1185: 0x0018, + 0x1186: 0x0018, 0x1187: 0x0018, 0x1188: 0x0018, 0x1189: 0x0018, 0x118a: 0x0018, 0x118b: 0x0018, + 0x118c: 0x0018, 0x118d: 0x0018, 0x118e: 0x0018, 0x118f: 0x0018, 0x1190: 0x0018, 0x1191: 0x0018, + 0x1192: 0x0018, 0x1193: 0x0018, 0x1194: 0x0018, 0x1195: 0x0018, 0x1196: 0x0018, 0x1197: 0x0008, + 0x1198: 0x0008, 0x1199: 0x0008, 0x119a: 0x0008, 0x119b: 0x0008, 0x119c: 0x0008, 0x119d: 0x0008, + 0x119e: 0x0008, 0x119f: 0x0008, 0x11a0: 0x0018, 0x11a1: 0x0018, 0x11a2: 0xe00d, 0x11a3: 0x0008, + 0x11a4: 0xe00d, 0x11a5: 0x0008, 0x11a6: 0xe00d, 0x11a7: 0x0008, 0x11a8: 0xe00d, 0x11a9: 0x0008, + 0x11aa: 0xe00d, 0x11ab: 0x0008, 0x11ac: 0xe00d, 0x11ad: 0x0008, 0x11ae: 0xe00d, 0x11af: 0x0008, + 0x11b0: 0x0008, 0x11b1: 0x0008, 0x11b2: 0xe00d, 0x11b3: 0x0008, 0x11b4: 0xe00d, 0x11b5: 0x0008, + 0x11b6: 0xe00d, 0x11b7: 0x0008, 0x11b8: 0xe00d, 0x11b9: 0x0008, 0x11ba: 0xe00d, 0x11bb: 0x0008, + 0x11bc: 0xe00d, 0x11bd: 0x0008, 0x11be: 0xe00d, 0x11bf: 0x0008, + // Block 0x47, offset 0x11c0 + 0x11c0: 0xe00d, 0x11c1: 0x0008, 0x11c2: 0xe00d, 0x11c3: 0x0008, 0x11c4: 0xe00d, 0x11c5: 0x0008, + 0x11c6: 0xe00d, 0x11c7: 0x0008, 0x11c8: 0xe00d, 0x11c9: 0x0008, 0x11ca: 0xe00d, 0x11cb: 0x0008, + 0x11cc: 0xe00d, 0x11cd: 0x0008, 0x11ce: 0xe00d, 0x11cf: 0x0008, 0x11d0: 0xe00d, 0x11d1: 0x0008, + 0x11d2: 0xe00d, 0x11d3: 0x0008, 0x11d4: 0xe00d, 0x11d5: 0x0008, 0x11d6: 0xe00d, 0x11d7: 0x0008, + 0x11d8: 0xe00d, 0x11d9: 0x0008, 0x11da: 0xe00d, 0x11db: 0x0008, 0x11dc: 0xe00d, 0x11dd: 0x0008, + 0x11de: 0xe00d, 0x11df: 0x0008, 0x11e0: 0xe00d, 0x11e1: 0x0008, 0x11e2: 0xe00d, 0x11e3: 0x0008, + 0x11e4: 0xe00d, 0x11e5: 0x0008, 0x11e6: 0xe00d, 0x11e7: 0x0008, 0x11e8: 0xe00d, 0x11e9: 0x0008, + 0x11ea: 0xe00d, 0x11eb: 0x0008, 0x11ec: 0xe00d, 0x11ed: 0x0008, 0x11ee: 0xe00d, 0x11ef: 0x0008, + 0x11f0: 0xe0fd, 0x11f1: 0x0008, 0x11f2: 0x0008, 0x11f3: 0x0008, 0x11f4: 0x0008, 0x11f5: 0x0008, + 0x11f6: 0x0008, 0x11f7: 0x0008, 0x11f8: 0x0008, 0x11f9: 0xe01d, 0x11fa: 0x0008, 0x11fb: 0xe03d, + 0x11fc: 0x0008, 0x11fd: 0x4445, 0x11fe: 0xe00d, 0x11ff: 0x0008, + // Block 0x48, offset 0x1200 + 0x1200: 0xe00d, 0x1201: 0x0008, 0x1202: 0xe00d, 0x1203: 0x0008, 0x1204: 0xe00d, 0x1205: 0x0008, + 0x1206: 0xe00d, 0x1207: 0x0008, 0x1208: 0x0008, 0x1209: 0x0018, 0x120a: 0x0018, 0x120b: 0xe03d, + 0x120c: 0x0008, 0x120d: 0x11d9, 0x120e: 0x0008, 0x120f: 0x0008, 0x1210: 0xe00d, 0x1211: 0x0008, + 0x1212: 0xe00d, 0x1213: 0x0008, 0x1214: 0x0008, 0x1215: 0x0008, 0x1216: 0xe00d, 0x1217: 0x0008, + 0x1218: 0xe00d, 0x1219: 0x0008, 0x121a: 0xe00d, 0x121b: 0x0008, 0x121c: 0xe00d, 0x121d: 0x0008, + 0x121e: 0xe00d, 0x121f: 0x0008, 0x1220: 0xe00d, 0x1221: 0x0008, 0x1222: 0xe00d, 0x1223: 0x0008, + 0x1224: 0xe00d, 0x1225: 0x0008, 0x1226: 0xe00d, 0x1227: 0x0008, 0x1228: 0xe00d, 0x1229: 0x0008, + 0x122a: 0x6e29, 0x122b: 0x1029, 0x122c: 0x11c1, 0x122d: 0x6e41, 0x122e: 0x1221, 0x122f: 0x0008, + 0x1230: 0x6e59, 0x1231: 0x6e71, 0x1232: 0x1239, 0x1233: 0x4465, 0x1234: 0xe00d, 0x1235: 0x0008, + 0x1236: 0xe00d, 0x1237: 0x0008, 0x1238: 0xe00d, 0x1239: 0x0008, 0x123a: 0xe00d, 0x123b: 0x0008, + 0x123c: 0xe00d, 0x123d: 0x0008, 0x123e: 0xe00d, 0x123f: 0x0008, + // Block 0x49, offset 0x1240 + 0x1240: 0x650d, 0x1241: 0x652d, 0x1242: 0x654d, 0x1243: 0x656d, 0x1244: 0x658d, 0x1245: 0x65ad, + 0x1246: 0x65cd, 0x1247: 0x65ed, 0x1248: 0x660d, 0x1249: 0x662d, 0x124a: 0x664d, 0x124b: 0x666d, + 0x124c: 0x668d, 0x124d: 0x66ad, 0x124e: 0x0008, 0x124f: 0x0008, 0x1250: 0x66cd, 0x1251: 0x0008, + 0x1252: 0x66ed, 0x1253: 0x0008, 0x1254: 0x0008, 0x1255: 0x670d, 0x1256: 0x672d, 0x1257: 0x674d, + 0x1258: 0x676d, 0x1259: 0x678d, 0x125a: 0x67ad, 0x125b: 0x67cd, 0x125c: 0x67ed, 0x125d: 0x680d, + 0x125e: 0x682d, 0x125f: 0x0008, 0x1260: 0x684d, 0x1261: 0x0008, 0x1262: 0x686d, 0x1263: 0x0008, + 0x1264: 0x0008, 0x1265: 0x688d, 0x1266: 0x68ad, 0x1267: 0x0008, 0x1268: 0x0008, 0x1269: 0x0008, + 0x126a: 0x68cd, 0x126b: 0x68ed, 0x126c: 0x690d, 0x126d: 0x692d, 0x126e: 0x694d, 0x126f: 0x696d, + 0x1270: 0x698d, 0x1271: 0x69ad, 0x1272: 0x69cd, 0x1273: 0x69ed, 0x1274: 0x6a0d, 0x1275: 0x6a2d, + 0x1276: 0x6a4d, 0x1277: 0x6a6d, 0x1278: 0x6a8d, 0x1279: 0x6aad, 0x127a: 0x6acd, 0x127b: 0x6aed, + 0x127c: 0x6b0d, 0x127d: 0x6b2d, 0x127e: 0x6b4d, 0x127f: 0x6b6d, + // Block 0x4a, offset 0x1280 + 0x1280: 0x7acd, 0x1281: 0x7aed, 0x1282: 0x7b0d, 0x1283: 0x7b2d, 0x1284: 0x7b4d, 0x1285: 0x7b6d, + 0x1286: 0x7b8d, 0x1287: 0x7bad, 0x1288: 0x7bcd, 0x1289: 0x7bed, 0x128a: 0x7c0d, 0x128b: 0x7c2d, + 0x128c: 0x7c4d, 0x128d: 0x7c6d, 0x128e: 0x7c8d, 0x128f: 0x6ec9, 0x1290: 0x6ef1, 0x1291: 0x6f19, + 0x1292: 0x7cad, 0x1293: 0x7ccd, 0x1294: 0x7ced, 0x1295: 0x6f41, 0x1296: 0x6f69, 0x1297: 0x6f91, + 0x1298: 0x7d0d, 0x1299: 0x7d2d, 0x129a: 0x0040, 0x129b: 0x0040, 0x129c: 0x0040, 0x129d: 0x0040, + 0x129e: 0x0040, 0x129f: 0x0040, 0x12a0: 0x0040, 0x12a1: 0x0040, 0x12a2: 0x0040, 0x12a3: 0x0040, + 0x12a4: 0x0040, 0x12a5: 0x0040, 0x12a6: 0x0040, 0x12a7: 0x0040, 0x12a8: 0x0040, 0x12a9: 0x0040, + 0x12aa: 0x0040, 0x12ab: 0x0040, 0x12ac: 0x0040, 0x12ad: 0x0040, 0x12ae: 0x0040, 0x12af: 0x0040, + 0x12b0: 0x0040, 0x12b1: 0x0040, 0x12b2: 0x0040, 0x12b3: 0x0040, 0x12b4: 0x0040, 0x12b5: 0x0040, + 0x12b6: 0x0040, 0x12b7: 0x0040, 0x12b8: 0x0040, 0x12b9: 0x0040, 0x12ba: 0x0040, 0x12bb: 0x0040, + 0x12bc: 0x0040, 0x12bd: 0x0040, 0x12be: 0x0040, 0x12bf: 0x0040, + // Block 0x4b, offset 0x12c0 + 0x12c0: 0x6fb9, 0x12c1: 0x6fd1, 0x12c2: 0x6fe9, 0x12c3: 0x7d4d, 0x12c4: 0x7d6d, 0x12c5: 0x7001, + 0x12c6: 0x7001, 0x12c7: 0x0040, 0x12c8: 0x0040, 0x12c9: 0x0040, 0x12ca: 0x0040, 0x12cb: 0x0040, + 0x12cc: 0x0040, 0x12cd: 0x0040, 0x12ce: 0x0040, 0x12cf: 0x0040, 0x12d0: 0x0040, 0x12d1: 0x0040, + 0x12d2: 0x0040, 0x12d3: 0x7019, 0x12d4: 0x7041, 0x12d5: 0x7069, 0x12d6: 0x7091, 0x12d7: 0x70b9, + 0x12d8: 0x0040, 0x12d9: 0x0040, 0x12da: 0x0040, 0x12db: 0x0040, 0x12dc: 0x0040, 0x12dd: 0x70e1, + 0x12de: 0x3308, 0x12df: 0x7109, 0x12e0: 0x7131, 0x12e1: 0x20a9, 0x12e2: 0x20f1, 0x12e3: 0x7149, + 0x12e4: 0x7161, 0x12e5: 0x7179, 0x12e6: 0x7191, 0x12e7: 0x71a9, 0x12e8: 0x71c1, 0x12e9: 0x1fb2, + 0x12ea: 0x71d9, 0x12eb: 0x7201, 0x12ec: 0x7229, 0x12ed: 0x7261, 0x12ee: 0x7299, 0x12ef: 0x72c1, + 0x12f0: 0x72e9, 0x12f1: 0x7311, 0x12f2: 0x7339, 0x12f3: 0x7361, 0x12f4: 0x7389, 0x12f5: 0x73b1, + 0x12f6: 0x73d9, 0x12f7: 0x0040, 0x12f8: 0x7401, 0x12f9: 0x7429, 0x12fa: 0x7451, 0x12fb: 0x7479, + 0x12fc: 0x74a1, 0x12fd: 0x0040, 0x12fe: 0x74c9, 0x12ff: 0x0040, + // Block 0x4c, offset 0x1300 + 0x1300: 0x74f1, 0x1301: 0x7519, 0x1302: 0x0040, 0x1303: 0x7541, 0x1304: 0x7569, 0x1305: 0x0040, + 0x1306: 0x7591, 0x1307: 0x75b9, 0x1308: 0x75e1, 0x1309: 0x7609, 0x130a: 0x7631, 0x130b: 0x7659, + 0x130c: 0x7681, 0x130d: 0x76a9, 0x130e: 0x76d1, 0x130f: 0x76f9, 0x1310: 0x7721, 0x1311: 0x7721, + 0x1312: 0x7739, 0x1313: 0x7739, 0x1314: 0x7739, 0x1315: 0x7739, 0x1316: 0x7751, 0x1317: 0x7751, + 0x1318: 0x7751, 0x1319: 0x7751, 0x131a: 0x7769, 0x131b: 0x7769, 0x131c: 0x7769, 0x131d: 0x7769, + 0x131e: 0x7781, 0x131f: 0x7781, 0x1320: 0x7781, 0x1321: 0x7781, 0x1322: 0x7799, 0x1323: 0x7799, + 0x1324: 0x7799, 0x1325: 0x7799, 0x1326: 0x77b1, 0x1327: 0x77b1, 0x1328: 0x77b1, 0x1329: 0x77b1, + 0x132a: 0x77c9, 0x132b: 0x77c9, 0x132c: 0x77c9, 0x132d: 0x77c9, 0x132e: 0x77e1, 0x132f: 0x77e1, + 0x1330: 0x77e1, 0x1331: 0x77e1, 0x1332: 0x77f9, 0x1333: 0x77f9, 0x1334: 0x77f9, 0x1335: 0x77f9, + 0x1336: 0x7811, 0x1337: 0x7811, 0x1338: 0x7811, 0x1339: 0x7811, 0x133a: 0x7829, 0x133b: 0x7829, + 0x133c: 0x7829, 0x133d: 0x7829, 0x133e: 0x7841, 0x133f: 0x7841, + // Block 0x4d, offset 0x1340 + 0x1340: 0x7841, 0x1341: 0x7841, 0x1342: 0x7859, 0x1343: 0x7859, 0x1344: 0x7871, 0x1345: 0x7871, + 0x1346: 0x7889, 0x1347: 0x7889, 0x1348: 0x78a1, 0x1349: 0x78a1, 0x134a: 0x78b9, 0x134b: 0x78b9, + 0x134c: 0x78d1, 0x134d: 0x78d1, 0x134e: 0x78e9, 0x134f: 0x78e9, 0x1350: 0x78e9, 0x1351: 0x78e9, + 0x1352: 0x7901, 0x1353: 0x7901, 0x1354: 0x7901, 0x1355: 0x7901, 0x1356: 0x7919, 0x1357: 0x7919, + 0x1358: 0x7919, 0x1359: 0x7919, 0x135a: 0x7931, 0x135b: 0x7931, 0x135c: 0x7931, 0x135d: 0x7931, + 0x135e: 0x7949, 0x135f: 0x7949, 0x1360: 0x7961, 0x1361: 0x7961, 0x1362: 0x7961, 0x1363: 0x7961, + 0x1364: 0x7979, 0x1365: 0x7979, 0x1366: 0x7991, 0x1367: 0x7991, 0x1368: 0x7991, 0x1369: 0x7991, + 0x136a: 0x79a9, 0x136b: 0x79a9, 0x136c: 0x79a9, 0x136d: 0x79a9, 0x136e: 0x79c1, 0x136f: 0x79c1, + 0x1370: 0x79d9, 0x1371: 0x79d9, 0x1372: 0x0818, 0x1373: 0x0818, 0x1374: 0x0818, 0x1375: 0x0818, + 0x1376: 0x0818, 0x1377: 0x0818, 0x1378: 0x0818, 0x1379: 0x0818, 0x137a: 0x0818, 0x137b: 0x0818, + 0x137c: 0x0818, 0x137d: 0x0818, 0x137e: 0x0818, 0x137f: 0x0818, + // Block 0x4e, offset 0x1380 + 0x1380: 0x0818, 0x1381: 0x0818, 0x1382: 0x0040, 0x1383: 0x0040, 0x1384: 0x0040, 0x1385: 0x0040, + 0x1386: 0x0040, 0x1387: 0x0040, 0x1388: 0x0040, 0x1389: 0x0040, 0x138a: 0x0040, 0x138b: 0x0040, + 0x138c: 0x0040, 0x138d: 0x0040, 0x138e: 0x0040, 0x138f: 0x0040, 0x1390: 0x0040, 0x1391: 0x0040, + 0x1392: 0x0040, 0x1393: 0x79f1, 0x1394: 0x79f1, 0x1395: 0x79f1, 0x1396: 0x79f1, 0x1397: 0x7a09, + 0x1398: 0x7a09, 0x1399: 0x7a21, 0x139a: 0x7a21, 0x139b: 0x7a39, 0x139c: 0x7a39, 0x139d: 0x0479, + 0x139e: 0x7a51, 0x139f: 0x7a51, 0x13a0: 0x7a69, 0x13a1: 0x7a69, 0x13a2: 0x7a81, 0x13a3: 0x7a81, + 0x13a4: 0x7a99, 0x13a5: 0x7a99, 0x13a6: 0x7a99, 0x13a7: 0x7a99, 0x13a8: 0x7ab1, 0x13a9: 0x7ab1, + 0x13aa: 0x7ac9, 0x13ab: 0x7ac9, 0x13ac: 0x7af1, 0x13ad: 0x7af1, 0x13ae: 0x7b19, 0x13af: 0x7b19, + 0x13b0: 0x7b41, 0x13b1: 0x7b41, 0x13b2: 0x7b69, 0x13b3: 0x7b69, 0x13b4: 0x7b91, 0x13b5: 0x7b91, + 0x13b6: 0x7bb9, 0x13b7: 0x7bb9, 0x13b8: 0x7bb9, 0x13b9: 0x7be1, 0x13ba: 0x7be1, 0x13bb: 0x7be1, + 0x13bc: 0x7c09, 0x13bd: 0x7c09, 0x13be: 0x7c09, 0x13bf: 0x7c09, + // Block 0x4f, offset 0x13c0 + 0x13c0: 0x85f9, 0x13c1: 0x8621, 0x13c2: 0x8649, 0x13c3: 0x8671, 0x13c4: 0x8699, 0x13c5: 0x86c1, + 0x13c6: 0x86e9, 0x13c7: 0x8711, 0x13c8: 0x8739, 0x13c9: 0x8761, 0x13ca: 0x8789, 0x13cb: 0x87b1, + 0x13cc: 0x87d9, 0x13cd: 0x8801, 0x13ce: 0x8829, 0x13cf: 0x8851, 0x13d0: 0x8879, 0x13d1: 0x88a1, + 0x13d2: 0x88c9, 0x13d3: 0x88f1, 0x13d4: 0x8919, 0x13d5: 0x8941, 0x13d6: 0x8969, 0x13d7: 0x8991, + 0x13d8: 0x89b9, 0x13d9: 0x89e1, 0x13da: 0x8a09, 0x13db: 0x8a31, 0x13dc: 0x8a59, 0x13dd: 0x8a81, + 0x13de: 0x8aaa, 0x13df: 0x8ada, 0x13e0: 0x8b0a, 0x13e1: 0x8b3a, 0x13e2: 0x8b6a, 0x13e3: 0x8b9a, + 0x13e4: 0x8bc9, 0x13e5: 0x8bf1, 0x13e6: 0x7c71, 0x13e7: 0x8c19, 0x13e8: 0x7be1, 0x13e9: 0x7c99, + 0x13ea: 0x8c41, 0x13eb: 0x8c69, 0x13ec: 0x7d39, 0x13ed: 0x8c91, 0x13ee: 0x7d61, 0x13ef: 0x7d89, + 0x13f0: 0x8cb9, 0x13f1: 0x8ce1, 0x13f2: 0x7e29, 0x13f3: 0x8d09, 0x13f4: 0x7e51, 0x13f5: 0x7e79, + 0x13f6: 0x8d31, 0x13f7: 0x8d59, 0x13f8: 0x7ec9, 0x13f9: 0x8d81, 0x13fa: 0x7ef1, 0x13fb: 0x7f19, + 0x13fc: 0x83a1, 0x13fd: 0x83c9, 0x13fe: 0x8441, 0x13ff: 0x8469, + // Block 0x50, offset 0x1400 + 0x1400: 0x8491, 0x1401: 0x8531, 0x1402: 0x8559, 0x1403: 0x8581, 0x1404: 0x85a9, 0x1405: 0x8649, + 0x1406: 0x8671, 0x1407: 0x8699, 0x1408: 0x8da9, 0x1409: 0x8739, 0x140a: 0x8dd1, 0x140b: 0x8df9, + 0x140c: 0x8829, 0x140d: 0x8e21, 0x140e: 0x8851, 0x140f: 0x8879, 0x1410: 0x8a81, 0x1411: 0x8e49, + 0x1412: 0x8e71, 0x1413: 0x89b9, 0x1414: 0x8e99, 0x1415: 0x89e1, 0x1416: 0x8a09, 0x1417: 0x7c21, + 0x1418: 0x7c49, 0x1419: 0x8ec1, 0x141a: 0x7c71, 0x141b: 0x8ee9, 0x141c: 0x7cc1, 0x141d: 0x7ce9, + 0x141e: 0x7d11, 0x141f: 0x7d39, 0x1420: 0x8f11, 0x1421: 0x7db1, 0x1422: 0x7dd9, 0x1423: 0x7e01, + 0x1424: 0x7e29, 0x1425: 0x8f39, 0x1426: 0x7ec9, 0x1427: 0x7f41, 0x1428: 0x7f69, 0x1429: 0x7f91, + 0x142a: 0x7fb9, 0x142b: 0x7fe1, 0x142c: 0x8031, 0x142d: 0x8059, 0x142e: 0x8081, 0x142f: 0x80a9, + 0x1430: 0x80d1, 0x1431: 0x80f9, 0x1432: 0x8f61, 0x1433: 0x8121, 0x1434: 0x8149, 0x1435: 0x8171, + 0x1436: 0x8199, 0x1437: 0x81c1, 0x1438: 0x81e9, 0x1439: 0x8239, 0x143a: 0x8261, 0x143b: 0x8289, + 0x143c: 0x82b1, 0x143d: 0x82d9, 0x143e: 0x8301, 0x143f: 0x8329, + // Block 0x51, offset 0x1440 + 0x1440: 0x8351, 0x1441: 0x8379, 0x1442: 0x83f1, 0x1443: 0x8419, 0x1444: 0x84b9, 0x1445: 0x84e1, + 0x1446: 0x8509, 0x1447: 0x8531, 0x1448: 0x8559, 0x1449: 0x85d1, 0x144a: 0x85f9, 0x144b: 0x8621, + 0x144c: 0x8649, 0x144d: 0x8f89, 0x144e: 0x86c1, 0x144f: 0x86e9, 0x1450: 0x8711, 0x1451: 0x8739, + 0x1452: 0x87b1, 0x1453: 0x87d9, 0x1454: 0x8801, 0x1455: 0x8829, 0x1456: 0x8fb1, 0x1457: 0x88a1, + 0x1458: 0x88c9, 0x1459: 0x8fd9, 0x145a: 0x8941, 0x145b: 0x8969, 0x145c: 0x8991, 0x145d: 0x89b9, + 0x145e: 0x9001, 0x145f: 0x7c71, 0x1460: 0x8ee9, 0x1461: 0x7d39, 0x1462: 0x8f11, 0x1463: 0x7e29, + 0x1464: 0x8f39, 0x1465: 0x7ec9, 0x1466: 0x9029, 0x1467: 0x80d1, 0x1468: 0x9051, 0x1469: 0x9079, + 0x146a: 0x90a1, 0x146b: 0x8531, 0x146c: 0x8559, 0x146d: 0x8649, 0x146e: 0x8829, 0x146f: 0x8fb1, + 0x1470: 0x89b9, 0x1471: 0x9001, 0x1472: 0x90c9, 0x1473: 0x9101, 0x1474: 0x9139, 0x1475: 0x9171, + 0x1476: 0x9199, 0x1477: 0x91c1, 0x1478: 0x91e9, 0x1479: 0x9211, 0x147a: 0x9239, 0x147b: 0x9261, + 0x147c: 0x9289, 0x147d: 0x92b1, 0x147e: 0x92d9, 0x147f: 0x9301, + // Block 0x52, offset 0x1480 + 0x1480: 0x9329, 0x1481: 0x9351, 0x1482: 0x9379, 0x1483: 0x93a1, 0x1484: 0x93c9, 0x1485: 0x93f1, + 0x1486: 0x9419, 0x1487: 0x9441, 0x1488: 0x9469, 0x1489: 0x9491, 0x148a: 0x94b9, 0x148b: 0x94e1, + 0x148c: 0x9079, 0x148d: 0x9509, 0x148e: 0x9531, 0x148f: 0x9559, 0x1490: 0x9581, 0x1491: 0x9171, + 0x1492: 0x9199, 0x1493: 0x91c1, 0x1494: 0x91e9, 0x1495: 0x9211, 0x1496: 0x9239, 0x1497: 0x9261, + 0x1498: 0x9289, 0x1499: 0x92b1, 0x149a: 0x92d9, 0x149b: 0x9301, 0x149c: 0x9329, 0x149d: 0x9351, + 0x149e: 0x9379, 0x149f: 0x93a1, 0x14a0: 0x93c9, 0x14a1: 0x93f1, 0x14a2: 0x9419, 0x14a3: 0x9441, + 0x14a4: 0x9469, 0x14a5: 0x9491, 0x14a6: 0x94b9, 0x14a7: 0x94e1, 0x14a8: 0x9079, 0x14a9: 0x9509, + 0x14aa: 0x9531, 0x14ab: 0x9559, 0x14ac: 0x9581, 0x14ad: 0x9491, 0x14ae: 0x94b9, 0x14af: 0x94e1, + 0x14b0: 0x9079, 0x14b1: 0x9051, 0x14b2: 0x90a1, 0x14b3: 0x8211, 0x14b4: 0x8059, 0x14b5: 0x8081, + 0x14b6: 0x80a9, 0x14b7: 0x9491, 0x14b8: 0x94b9, 0x14b9: 0x94e1, 0x14ba: 0x8211, 0x14bb: 0x8239, + 0x14bc: 0x95a9, 0x14bd: 0x95a9, 0x14be: 0x0018, 0x14bf: 0x0018, + // Block 0x53, offset 0x14c0 + 0x14c0: 0x0040, 0x14c1: 0x0040, 0x14c2: 0x0040, 0x14c3: 0x0040, 0x14c4: 0x0040, 0x14c5: 0x0040, + 0x14c6: 0x0040, 0x14c7: 0x0040, 0x14c8: 0x0040, 0x14c9: 0x0040, 0x14ca: 0x0040, 0x14cb: 0x0040, + 0x14cc: 0x0040, 0x14cd: 0x0040, 0x14ce: 0x0040, 0x14cf: 0x0040, 0x14d0: 0x95d1, 0x14d1: 0x9609, + 0x14d2: 0x9609, 0x14d3: 0x9641, 0x14d4: 0x9679, 0x14d5: 0x96b1, 0x14d6: 0x96e9, 0x14d7: 0x9721, + 0x14d8: 0x9759, 0x14d9: 0x9759, 0x14da: 0x9791, 0x14db: 0x97c9, 0x14dc: 0x9801, 0x14dd: 0x9839, + 0x14de: 0x9871, 0x14df: 0x98a9, 0x14e0: 0x98a9, 0x14e1: 0x98e1, 0x14e2: 0x9919, 0x14e3: 0x9919, + 0x14e4: 0x9951, 0x14e5: 0x9951, 0x14e6: 0x9989, 0x14e7: 0x99c1, 0x14e8: 0x99c1, 0x14e9: 0x99f9, + 0x14ea: 0x9a31, 0x14eb: 0x9a31, 0x14ec: 0x9a69, 0x14ed: 0x9a69, 0x14ee: 0x9aa1, 0x14ef: 0x9ad9, + 0x14f0: 0x9ad9, 0x14f1: 0x9b11, 0x14f2: 0x9b11, 0x14f3: 0x9b49, 0x14f4: 0x9b81, 0x14f5: 0x9bb9, + 0x14f6: 0x9bf1, 0x14f7: 0x9bf1, 0x14f8: 0x9c29, 0x14f9: 0x9c61, 0x14fa: 0x9c99, 0x14fb: 0x9cd1, + 0x14fc: 0x9d09, 0x14fd: 0x9d09, 0x14fe: 0x9d41, 0x14ff: 0x9d79, + // Block 0x54, offset 0x1500 + 0x1500: 0xa949, 0x1501: 0xa981, 0x1502: 0xa9b9, 0x1503: 0xa8a1, 0x1504: 0x9bb9, 0x1505: 0x9989, + 0x1506: 0xa9f1, 0x1507: 0xaa29, 0x1508: 0x0040, 0x1509: 0x0040, 0x150a: 0x0040, 0x150b: 0x0040, + 0x150c: 0x0040, 0x150d: 0x0040, 0x150e: 0x0040, 0x150f: 0x0040, 0x1510: 0x0040, 0x1511: 0x0040, + 0x1512: 0x0040, 0x1513: 0x0040, 0x1514: 0x0040, 0x1515: 0x0040, 0x1516: 0x0040, 0x1517: 0x0040, + 0x1518: 0x0040, 0x1519: 0x0040, 0x151a: 0x0040, 0x151b: 0x0040, 0x151c: 0x0040, 0x151d: 0x0040, + 0x151e: 0x0040, 0x151f: 0x0040, 0x1520: 0x0040, 0x1521: 0x0040, 0x1522: 0x0040, 0x1523: 0x0040, + 0x1524: 0x0040, 0x1525: 0x0040, 0x1526: 0x0040, 0x1527: 0x0040, 0x1528: 0x0040, 0x1529: 0x0040, + 0x152a: 0x0040, 0x152b: 0x0040, 0x152c: 0x0040, 0x152d: 0x0040, 0x152e: 0x0040, 0x152f: 0x0040, + 0x1530: 0xaa61, 0x1531: 0xaa99, 0x1532: 0xaad1, 0x1533: 0xab19, 0x1534: 0xab61, 0x1535: 0xaba9, + 0x1536: 0xabf1, 0x1537: 0xac39, 0x1538: 0xac81, 0x1539: 0xacc9, 0x153a: 0xad02, 0x153b: 0xae12, + 0x153c: 0xae91, 0x153d: 0x0018, 0x153e: 0x0040, 0x153f: 0x0040, + // Block 0x55, offset 0x1540 + 0x1540: 0x33c0, 0x1541: 0x33c0, 0x1542: 0x33c0, 0x1543: 0x33c0, 0x1544: 0x33c0, 0x1545: 0x33c0, + 0x1546: 0x33c0, 0x1547: 0x33c0, 0x1548: 0x33c0, 0x1549: 0x33c0, 0x154a: 0x33c0, 0x154b: 0x33c0, + 0x154c: 0x33c0, 0x154d: 0x33c0, 0x154e: 0x33c0, 0x154f: 0x33c0, 0x1550: 0xaeda, 0x1551: 0x7d8d, + 0x1552: 0x0040, 0x1553: 0xaeea, 0x1554: 0x03c2, 0x1555: 0xaefa, 0x1556: 0xaf0a, 0x1557: 0x7dad, + 0x1558: 0x7dcd, 0x1559: 0x0040, 0x155a: 0x0040, 0x155b: 0x0040, 0x155c: 0x0040, 0x155d: 0x0040, + 0x155e: 0x0040, 0x155f: 0x0040, 0x1560: 0x3308, 0x1561: 0x3308, 0x1562: 0x3308, 0x1563: 0x3308, + 0x1564: 0x3308, 0x1565: 0x3308, 0x1566: 0x3308, 0x1567: 0x3308, 0x1568: 0x3308, 0x1569: 0x3308, + 0x156a: 0x3308, 0x156b: 0x3308, 0x156c: 0x3308, 0x156d: 0x3308, 0x156e: 0x3308, 0x156f: 0x3308, + 0x1570: 0x0040, 0x1571: 0x7ded, 0x1572: 0x7e0d, 0x1573: 0xaf1a, 0x1574: 0xaf1a, 0x1575: 0x1fd2, + 0x1576: 0x1fe2, 0x1577: 0xaf2a, 0x1578: 0xaf3a, 0x1579: 0x7e2d, 0x157a: 0x7e4d, 0x157b: 0x7e6d, + 0x157c: 0x7e2d, 0x157d: 0x7e8d, 0x157e: 0x7ead, 0x157f: 0x7e8d, + // Block 0x56, offset 0x1580 + 0x1580: 0x7ecd, 0x1581: 0x7eed, 0x1582: 0x7f0d, 0x1583: 0x7eed, 0x1584: 0x7f2d, 0x1585: 0x0018, + 0x1586: 0x0018, 0x1587: 0xaf4a, 0x1588: 0xaf5a, 0x1589: 0x7f4e, 0x158a: 0x7f6e, 0x158b: 0x7f8e, + 0x158c: 0x7fae, 0x158d: 0xaf1a, 0x158e: 0xaf1a, 0x158f: 0xaf1a, 0x1590: 0xaeda, 0x1591: 0x7fcd, + 0x1592: 0x0040, 0x1593: 0x0040, 0x1594: 0x03c2, 0x1595: 0xaeea, 0x1596: 0xaf0a, 0x1597: 0xaefa, + 0x1598: 0x7fed, 0x1599: 0x1fd2, 0x159a: 0x1fe2, 0x159b: 0xaf2a, 0x159c: 0xaf3a, 0x159d: 0x7ecd, + 0x159e: 0x7f2d, 0x159f: 0xaf6a, 0x15a0: 0xaf7a, 0x15a1: 0xaf8a, 0x15a2: 0x1fb2, 0x15a3: 0xaf99, + 0x15a4: 0xafaa, 0x15a5: 0xafba, 0x15a6: 0x1fc2, 0x15a7: 0x0040, 0x15a8: 0xafca, 0x15a9: 0xafda, + 0x15aa: 0xafea, 0x15ab: 0xaffa, 0x15ac: 0x0040, 0x15ad: 0x0040, 0x15ae: 0x0040, 0x15af: 0x0040, + 0x15b0: 0x800e, 0x15b1: 0xb009, 0x15b2: 0x802e, 0x15b3: 0x0808, 0x15b4: 0x804e, 0x15b5: 0x0040, + 0x15b6: 0x806e, 0x15b7: 0xb031, 0x15b8: 0x808e, 0x15b9: 0xb059, 0x15ba: 0x80ae, 0x15bb: 0xb081, + 0x15bc: 0x80ce, 0x15bd: 0xb0a9, 0x15be: 0x80ee, 0x15bf: 0xb0d1, + // Block 0x57, offset 0x15c0 + 0x15c0: 0xb0f9, 0x15c1: 0xb111, 0x15c2: 0xb111, 0x15c3: 0xb129, 0x15c4: 0xb129, 0x15c5: 0xb141, + 0x15c6: 0xb141, 0x15c7: 0xb159, 0x15c8: 0xb159, 0x15c9: 0xb171, 0x15ca: 0xb171, 0x15cb: 0xb171, + 0x15cc: 0xb171, 0x15cd: 0xb189, 0x15ce: 0xb189, 0x15cf: 0xb1a1, 0x15d0: 0xb1a1, 0x15d1: 0xb1a1, + 0x15d2: 0xb1a1, 0x15d3: 0xb1b9, 0x15d4: 0xb1b9, 0x15d5: 0xb1d1, 0x15d6: 0xb1d1, 0x15d7: 0xb1d1, + 0x15d8: 0xb1d1, 0x15d9: 0xb1e9, 0x15da: 0xb1e9, 0x15db: 0xb1e9, 0x15dc: 0xb1e9, 0x15dd: 0xb201, + 0x15de: 0xb201, 0x15df: 0xb201, 0x15e0: 0xb201, 0x15e1: 0xb219, 0x15e2: 0xb219, 0x15e3: 0xb219, + 0x15e4: 0xb219, 0x15e5: 0xb231, 0x15e6: 0xb231, 0x15e7: 0xb231, 0x15e8: 0xb231, 0x15e9: 0xb249, + 0x15ea: 0xb249, 0x15eb: 0xb261, 0x15ec: 0xb261, 0x15ed: 0xb279, 0x15ee: 0xb279, 0x15ef: 0xb291, + 0x15f0: 0xb291, 0x15f1: 0xb2a9, 0x15f2: 0xb2a9, 0x15f3: 0xb2a9, 0x15f4: 0xb2a9, 0x15f5: 0xb2c1, + 0x15f6: 0xb2c1, 0x15f7: 0xb2c1, 0x15f8: 0xb2c1, 0x15f9: 0xb2d9, 0x15fa: 0xb2d9, 0x15fb: 0xb2d9, + 0x15fc: 0xb2d9, 0x15fd: 0xb2f1, 0x15fe: 0xb2f1, 0x15ff: 0xb2f1, + // Block 0x58, offset 0x1600 + 0x1600: 0xb2f1, 0x1601: 0xb309, 0x1602: 0xb309, 0x1603: 0xb309, 0x1604: 0xb309, 0x1605: 0xb321, + 0x1606: 0xb321, 0x1607: 0xb321, 0x1608: 0xb321, 0x1609: 0xb339, 0x160a: 0xb339, 0x160b: 0xb339, + 0x160c: 0xb339, 0x160d: 0xb351, 0x160e: 0xb351, 0x160f: 0xb351, 0x1610: 0xb351, 0x1611: 0xb369, + 0x1612: 0xb369, 0x1613: 0xb369, 0x1614: 0xb369, 0x1615: 0xb381, 0x1616: 0xb381, 0x1617: 0xb381, + 0x1618: 0xb381, 0x1619: 0xb399, 0x161a: 0xb399, 0x161b: 0xb399, 0x161c: 0xb399, 0x161d: 0xb3b1, + 0x161e: 0xb3b1, 0x161f: 0xb3b1, 0x1620: 0xb3b1, 0x1621: 0xb3c9, 0x1622: 0xb3c9, 0x1623: 0xb3c9, + 0x1624: 0xb3c9, 0x1625: 0xb3e1, 0x1626: 0xb3e1, 0x1627: 0xb3e1, 0x1628: 0xb3e1, 0x1629: 0xb3f9, + 0x162a: 0xb3f9, 0x162b: 0xb3f9, 0x162c: 0xb3f9, 0x162d: 0xb411, 0x162e: 0xb411, 0x162f: 0x7ab1, + 0x1630: 0x7ab1, 0x1631: 0xb429, 0x1632: 0xb429, 0x1633: 0xb429, 0x1634: 0xb429, 0x1635: 0xb441, + 0x1636: 0xb441, 0x1637: 0xb469, 0x1638: 0xb469, 0x1639: 0xb491, 0x163a: 0xb491, 0x163b: 0xb4b9, + 0x163c: 0xb4b9, 0x163d: 0x0040, 0x163e: 0x0040, 0x163f: 0x03c0, + // Block 0x59, offset 0x1640 + 0x1640: 0x0040, 0x1641: 0xaefa, 0x1642: 0xb4e2, 0x1643: 0xaf6a, 0x1644: 0xafda, 0x1645: 0xafea, + 0x1646: 0xaf7a, 0x1647: 0xb4f2, 0x1648: 0x1fd2, 0x1649: 0x1fe2, 0x164a: 0xaf8a, 0x164b: 0x1fb2, + 0x164c: 0xaeda, 0x164d: 0xaf99, 0x164e: 0x29d1, 0x164f: 0xb502, 0x1650: 0x1f41, 0x1651: 0x00c9, + 0x1652: 0x0069, 0x1653: 0x0079, 0x1654: 0x1f51, 0x1655: 0x1f61, 0x1656: 0x1f71, 0x1657: 0x1f81, + 0x1658: 0x1f91, 0x1659: 0x1fa1, 0x165a: 0xaeea, 0x165b: 0x03c2, 0x165c: 0xafaa, 0x165d: 0x1fc2, + 0x165e: 0xafba, 0x165f: 0xaf0a, 0x1660: 0xaffa, 0x1661: 0x0039, 0x1662: 0x0ee9, 0x1663: 0x1159, + 0x1664: 0x0ef9, 0x1665: 0x0f09, 0x1666: 0x1199, 0x1667: 0x0f31, 0x1668: 0x0249, 0x1669: 0x0f41, + 0x166a: 0x0259, 0x166b: 0x0f51, 0x166c: 0x0359, 0x166d: 0x0f61, 0x166e: 0x0f71, 0x166f: 0x00d9, + 0x1670: 0x0f99, 0x1671: 0x2039, 0x1672: 0x0269, 0x1673: 0x01d9, 0x1674: 0x0fa9, 0x1675: 0x0fb9, + 0x1676: 0x1089, 0x1677: 0x0279, 0x1678: 0x0369, 0x1679: 0x0289, 0x167a: 0x13d1, 0x167b: 0xaf4a, + 0x167c: 0xafca, 0x167d: 0xaf5a, 0x167e: 0xb512, 0x167f: 0xaf1a, + // Block 0x5a, offset 0x1680 + 0x1680: 0x1caa, 0x1681: 0x0039, 0x1682: 0x0ee9, 0x1683: 0x1159, 0x1684: 0x0ef9, 0x1685: 0x0f09, + 0x1686: 0x1199, 0x1687: 0x0f31, 0x1688: 0x0249, 0x1689: 0x0f41, 0x168a: 0x0259, 0x168b: 0x0f51, + 0x168c: 0x0359, 0x168d: 0x0f61, 0x168e: 0x0f71, 0x168f: 0x00d9, 0x1690: 0x0f99, 0x1691: 0x2039, + 0x1692: 0x0269, 0x1693: 0x01d9, 0x1694: 0x0fa9, 0x1695: 0x0fb9, 0x1696: 0x1089, 0x1697: 0x0279, + 0x1698: 0x0369, 0x1699: 0x0289, 0x169a: 0x13d1, 0x169b: 0xaf2a, 0x169c: 0xb522, 0x169d: 0xaf3a, + 0x169e: 0xb532, 0x169f: 0x810d, 0x16a0: 0x812d, 0x16a1: 0x29d1, 0x16a2: 0x814d, 0x16a3: 0x814d, + 0x16a4: 0x816d, 0x16a5: 0x818d, 0x16a6: 0x81ad, 0x16a7: 0x81cd, 0x16a8: 0x81ed, 0x16a9: 0x820d, + 0x16aa: 0x822d, 0x16ab: 0x824d, 0x16ac: 0x826d, 0x16ad: 0x828d, 0x16ae: 0x82ad, 0x16af: 0x82cd, + 0x16b0: 0x82ed, 0x16b1: 0x830d, 0x16b2: 0x832d, 0x16b3: 0x834d, 0x16b4: 0x836d, 0x16b5: 0x838d, + 0x16b6: 0x83ad, 0x16b7: 0x83cd, 0x16b8: 0x83ed, 0x16b9: 0x840d, 0x16ba: 0x842d, 0x16bb: 0x844d, + 0x16bc: 0x81ed, 0x16bd: 0x846d, 0x16be: 0x848d, 0x16bf: 0x824d, + // Block 0x5b, offset 0x16c0 + 0x16c0: 0x84ad, 0x16c1: 0x84cd, 0x16c2: 0x84ed, 0x16c3: 0x850d, 0x16c4: 0x852d, 0x16c5: 0x854d, + 0x16c6: 0x856d, 0x16c7: 0x858d, 0x16c8: 0x850d, 0x16c9: 0x85ad, 0x16ca: 0x850d, 0x16cb: 0x85cd, + 0x16cc: 0x85cd, 0x16cd: 0x85ed, 0x16ce: 0x85ed, 0x16cf: 0x860d, 0x16d0: 0x854d, 0x16d1: 0x862d, + 0x16d2: 0x864d, 0x16d3: 0x862d, 0x16d4: 0x866d, 0x16d5: 0x864d, 0x16d6: 0x868d, 0x16d7: 0x868d, + 0x16d8: 0x86ad, 0x16d9: 0x86ad, 0x16da: 0x86cd, 0x16db: 0x86cd, 0x16dc: 0x864d, 0x16dd: 0x814d, + 0x16de: 0x86ed, 0x16df: 0x870d, 0x16e0: 0x0040, 0x16e1: 0x872d, 0x16e2: 0x874d, 0x16e3: 0x876d, + 0x16e4: 0x878d, 0x16e5: 0x876d, 0x16e6: 0x87ad, 0x16e7: 0x87cd, 0x16e8: 0x87ed, 0x16e9: 0x87ed, + 0x16ea: 0x880d, 0x16eb: 0x880d, 0x16ec: 0x882d, 0x16ed: 0x882d, 0x16ee: 0x880d, 0x16ef: 0x880d, + 0x16f0: 0x884d, 0x16f1: 0x886d, 0x16f2: 0x888d, 0x16f3: 0x88ad, 0x16f4: 0x88cd, 0x16f5: 0x88ed, + 0x16f6: 0x88ed, 0x16f7: 0x88ed, 0x16f8: 0x890d, 0x16f9: 0x890d, 0x16fa: 0x890d, 0x16fb: 0x890d, + 0x16fc: 0x87ed, 0x16fd: 0x87ed, 0x16fe: 0x87ed, 0x16ff: 0x0040, + // Block 0x5c, offset 0x1700 + 0x1700: 0x0040, 0x1701: 0x0040, 0x1702: 0x874d, 0x1703: 0x872d, 0x1704: 0x892d, 0x1705: 0x872d, + 0x1706: 0x874d, 0x1707: 0x872d, 0x1708: 0x0040, 0x1709: 0x0040, 0x170a: 0x894d, 0x170b: 0x874d, + 0x170c: 0x896d, 0x170d: 0x892d, 0x170e: 0x896d, 0x170f: 0x874d, 0x1710: 0x0040, 0x1711: 0x0040, + 0x1712: 0x898d, 0x1713: 0x89ad, 0x1714: 0x88ad, 0x1715: 0x896d, 0x1716: 0x892d, 0x1717: 0x896d, + 0x1718: 0x0040, 0x1719: 0x0040, 0x171a: 0x89cd, 0x171b: 0x89ed, 0x171c: 0x89cd, 0x171d: 0x0040, + 0x171e: 0x0040, 0x171f: 0x0040, 0x1720: 0xb541, 0x1721: 0xb559, 0x1722: 0xb571, 0x1723: 0x8a0e, + 0x1724: 0xb589, 0x1725: 0xb5a1, 0x1726: 0x8a2d, 0x1727: 0x0040, 0x1728: 0x8a4d, 0x1729: 0x8a6d, + 0x172a: 0x8a8d, 0x172b: 0x8a6d, 0x172c: 0x8aad, 0x172d: 0x8acd, 0x172e: 0x8aed, 0x172f: 0x0040, + 0x1730: 0x0040, 0x1731: 0x0040, 0x1732: 0x0040, 0x1733: 0x0040, 0x1734: 0x0040, 0x1735: 0x0040, + 0x1736: 0x0040, 0x1737: 0x0040, 0x1738: 0x0040, 0x1739: 0x0340, 0x173a: 0x0340, 0x173b: 0x0340, + 0x173c: 0x0040, 0x173d: 0x0040, 0x173e: 0x0040, 0x173f: 0x0040, + // Block 0x5d, offset 0x1740 + 0x1740: 0x0a08, 0x1741: 0x0a08, 0x1742: 0x0a08, 0x1743: 0x0a08, 0x1744: 0x0a08, 0x1745: 0x0c08, + 0x1746: 0x0808, 0x1747: 0x0c08, 0x1748: 0x0818, 0x1749: 0x0c08, 0x174a: 0x0c08, 0x174b: 0x0808, + 0x174c: 0x0808, 0x174d: 0x0908, 0x174e: 0x0c08, 0x174f: 0x0c08, 0x1750: 0x0c08, 0x1751: 0x0c08, + 0x1752: 0x0c08, 0x1753: 0x0a08, 0x1754: 0x0a08, 0x1755: 0x0a08, 0x1756: 0x0a08, 0x1757: 0x0908, + 0x1758: 0x0a08, 0x1759: 0x0a08, 0x175a: 0x0a08, 0x175b: 0x0a08, 0x175c: 0x0a08, 0x175d: 0x0c08, + 0x175e: 0x0a08, 0x175f: 0x0a08, 0x1760: 0x0a08, 0x1761: 0x0c08, 0x1762: 0x0808, 0x1763: 0x0808, + 0x1764: 0x0c08, 0x1765: 0x3308, 0x1766: 0x3308, 0x1767: 0x0040, 0x1768: 0x0040, 0x1769: 0x0040, + 0x176a: 0x0040, 0x176b: 0x0a18, 0x176c: 0x0a18, 0x176d: 0x0a18, 0x176e: 0x0a18, 0x176f: 0x0c18, + 0x1770: 0x0818, 0x1771: 0x0818, 0x1772: 0x0818, 0x1773: 0x0818, 0x1774: 0x0818, 0x1775: 0x0818, + 0x1776: 0x0818, 0x1777: 0x0040, 0x1778: 0x0040, 0x1779: 0x0040, 0x177a: 0x0040, 0x177b: 0x0040, + 0x177c: 0x0040, 0x177d: 0x0040, 0x177e: 0x0040, 0x177f: 0x0040, + // Block 0x5e, offset 0x1780 + 0x1780: 0x0a08, 0x1781: 0x0c08, 0x1782: 0x0a08, 0x1783: 0x0c08, 0x1784: 0x0c08, 0x1785: 0x0c08, + 0x1786: 0x0a08, 0x1787: 0x0a08, 0x1788: 0x0a08, 0x1789: 0x0c08, 0x178a: 0x0a08, 0x178b: 0x0a08, + 0x178c: 0x0c08, 0x178d: 0x0a08, 0x178e: 0x0c08, 0x178f: 0x0c08, 0x1790: 0x0a08, 0x1791: 0x0c08, + 0x1792: 0x0040, 0x1793: 0x0040, 0x1794: 0x0040, 0x1795: 0x0040, 0x1796: 0x0040, 0x1797: 0x0040, + 0x1798: 0x0040, 0x1799: 0x0818, 0x179a: 0x0818, 0x179b: 0x0818, 0x179c: 0x0818, 0x179d: 0x0040, + 0x179e: 0x0040, 0x179f: 0x0040, 0x17a0: 0x0040, 0x17a1: 0x0040, 0x17a2: 0x0040, 0x17a3: 0x0040, + 0x17a4: 0x0040, 0x17a5: 0x0040, 0x17a6: 0x0040, 0x17a7: 0x0040, 0x17a8: 0x0040, 0x17a9: 0x0c18, + 0x17aa: 0x0c18, 0x17ab: 0x0c18, 0x17ac: 0x0c18, 0x17ad: 0x0a18, 0x17ae: 0x0a18, 0x17af: 0x0818, + 0x17b0: 0x0040, 0x17b1: 0x0040, 0x17b2: 0x0040, 0x17b3: 0x0040, 0x17b4: 0x0040, 0x17b5: 0x0040, + 0x17b6: 0x0040, 0x17b7: 0x0040, 0x17b8: 0x0040, 0x17b9: 0x0040, 0x17ba: 0x0040, 0x17bb: 0x0040, + 0x17bc: 0x0040, 0x17bd: 0x0040, 0x17be: 0x0040, 0x17bf: 0x0040, + // Block 0x5f, offset 0x17c0 + 0x17c0: 0x3308, 0x17c1: 0x3308, 0x17c2: 0x3008, 0x17c3: 0x3008, 0x17c4: 0x0040, 0x17c5: 0x0008, + 0x17c6: 0x0008, 0x17c7: 0x0008, 0x17c8: 0x0008, 0x17c9: 0x0008, 0x17ca: 0x0008, 0x17cb: 0x0008, + 0x17cc: 0x0008, 0x17cd: 0x0040, 0x17ce: 0x0040, 0x17cf: 0x0008, 0x17d0: 0x0008, 0x17d1: 0x0040, + 0x17d2: 0x0040, 0x17d3: 0x0008, 0x17d4: 0x0008, 0x17d5: 0x0008, 0x17d6: 0x0008, 0x17d7: 0x0008, + 0x17d8: 0x0008, 0x17d9: 0x0008, 0x17da: 0x0008, 0x17db: 0x0008, 0x17dc: 0x0008, 0x17dd: 0x0008, + 0x17de: 0x0008, 0x17df: 0x0008, 0x17e0: 0x0008, 0x17e1: 0x0008, 0x17e2: 0x0008, 0x17e3: 0x0008, + 0x17e4: 0x0008, 0x17e5: 0x0008, 0x17e6: 0x0008, 0x17e7: 0x0008, 0x17e8: 0x0008, 0x17e9: 0x0040, + 0x17ea: 0x0008, 0x17eb: 0x0008, 0x17ec: 0x0008, 0x17ed: 0x0008, 0x17ee: 0x0008, 0x17ef: 0x0008, + 0x17f0: 0x0008, 0x17f1: 0x0040, 0x17f2: 0x0008, 0x17f3: 0x0008, 0x17f4: 0x0040, 0x17f5: 0x0008, + 0x17f6: 0x0008, 0x17f7: 0x0008, 0x17f8: 0x0008, 0x17f9: 0x0008, 0x17fa: 0x0040, 0x17fb: 0x3308, + 0x17fc: 0x3308, 0x17fd: 0x0008, 0x17fe: 0x3008, 0x17ff: 0x3008, + // Block 0x60, offset 0x1800 + 0x1800: 0x3308, 0x1801: 0x3008, 0x1802: 0x3008, 0x1803: 0x3008, 0x1804: 0x3008, 0x1805: 0x0040, + 0x1806: 0x0040, 0x1807: 0x3008, 0x1808: 0x3008, 0x1809: 0x0040, 0x180a: 0x0040, 0x180b: 0x3008, + 0x180c: 0x3008, 0x180d: 0x3808, 0x180e: 0x0040, 0x180f: 0x0040, 0x1810: 0x0008, 0x1811: 0x0040, + 0x1812: 0x0040, 0x1813: 0x0040, 0x1814: 0x0040, 0x1815: 0x0040, 0x1816: 0x0040, 0x1817: 0x3008, + 0x1818: 0x0040, 0x1819: 0x0040, 0x181a: 0x0040, 0x181b: 0x0040, 0x181c: 0x0040, 0x181d: 0x0008, + 0x181e: 0x0008, 0x181f: 0x0008, 0x1820: 0x0008, 0x1821: 0x0008, 0x1822: 0x3008, 0x1823: 0x3008, + 0x1824: 0x0040, 0x1825: 0x0040, 0x1826: 0x3308, 0x1827: 0x3308, 0x1828: 0x3308, 0x1829: 0x3308, + 0x182a: 0x3308, 0x182b: 0x3308, 0x182c: 0x3308, 0x182d: 0x0040, 0x182e: 0x0040, 0x182f: 0x0040, + 0x1830: 0x3308, 0x1831: 0x3308, 0x1832: 0x3308, 0x1833: 0x3308, 0x1834: 0x3308, 0x1835: 0x0040, + 0x1836: 0x0040, 0x1837: 0x0040, 0x1838: 0x0040, 0x1839: 0x0040, 0x183a: 0x0040, 0x183b: 0x0040, + 0x183c: 0x0040, 0x183d: 0x0040, 0x183e: 0x0040, 0x183f: 0x0040, + // Block 0x61, offset 0x1840 + 0x1840: 0x0039, 0x1841: 0x0ee9, 0x1842: 0x1159, 0x1843: 0x0ef9, 0x1844: 0x0f09, 0x1845: 0x1199, + 0x1846: 0x0f31, 0x1847: 0x0249, 0x1848: 0x0f41, 0x1849: 0x0259, 0x184a: 0x0f51, 0x184b: 0x0359, + 0x184c: 0x0f61, 0x184d: 0x0f71, 0x184e: 0x00d9, 0x184f: 0x0f99, 0x1850: 0x2039, 0x1851: 0x0269, + 0x1852: 0x01d9, 0x1853: 0x0fa9, 0x1854: 0x0fb9, 0x1855: 0x1089, 0x1856: 0x0279, 0x1857: 0x0369, + 0x1858: 0x0289, 0x1859: 0x13d1, 0x185a: 0x0039, 0x185b: 0x0ee9, 0x185c: 0x1159, 0x185d: 0x0ef9, + 0x185e: 0x0f09, 0x185f: 0x1199, 0x1860: 0x0f31, 0x1861: 0x0249, 0x1862: 0x0f41, 0x1863: 0x0259, + 0x1864: 0x0f51, 0x1865: 0x0359, 0x1866: 0x0f61, 0x1867: 0x0f71, 0x1868: 0x00d9, 0x1869: 0x0f99, + 0x186a: 0x2039, 0x186b: 0x0269, 0x186c: 0x01d9, 0x186d: 0x0fa9, 0x186e: 0x0fb9, 0x186f: 0x1089, + 0x1870: 0x0279, 0x1871: 0x0369, 0x1872: 0x0289, 0x1873: 0x13d1, 0x1874: 0x0039, 0x1875: 0x0ee9, + 0x1876: 0x1159, 0x1877: 0x0ef9, 0x1878: 0x0f09, 0x1879: 0x1199, 0x187a: 0x0f31, 0x187b: 0x0249, + 0x187c: 0x0f41, 0x187d: 0x0259, 0x187e: 0x0f51, 0x187f: 0x0359, + // Block 0x62, offset 0x1880 + 0x1880: 0x0f61, 0x1881: 0x0f71, 0x1882: 0x00d9, 0x1883: 0x0f99, 0x1884: 0x2039, 0x1885: 0x0269, + 0x1886: 0x01d9, 0x1887: 0x0fa9, 0x1888: 0x0fb9, 0x1889: 0x1089, 0x188a: 0x0279, 0x188b: 0x0369, + 0x188c: 0x0289, 0x188d: 0x13d1, 0x188e: 0x0039, 0x188f: 0x0ee9, 0x1890: 0x1159, 0x1891: 0x0ef9, + 0x1892: 0x0f09, 0x1893: 0x1199, 0x1894: 0x0f31, 0x1895: 0x0040, 0x1896: 0x0f41, 0x1897: 0x0259, + 0x1898: 0x0f51, 0x1899: 0x0359, 0x189a: 0x0f61, 0x189b: 0x0f71, 0x189c: 0x00d9, 0x189d: 0x0f99, + 0x189e: 0x2039, 0x189f: 0x0269, 0x18a0: 0x01d9, 0x18a1: 0x0fa9, 0x18a2: 0x0fb9, 0x18a3: 0x1089, + 0x18a4: 0x0279, 0x18a5: 0x0369, 0x18a6: 0x0289, 0x18a7: 0x13d1, 0x18a8: 0x0039, 0x18a9: 0x0ee9, + 0x18aa: 0x1159, 0x18ab: 0x0ef9, 0x18ac: 0x0f09, 0x18ad: 0x1199, 0x18ae: 0x0f31, 0x18af: 0x0249, + 0x18b0: 0x0f41, 0x18b1: 0x0259, 0x18b2: 0x0f51, 0x18b3: 0x0359, 0x18b4: 0x0f61, 0x18b5: 0x0f71, + 0x18b6: 0x00d9, 0x18b7: 0x0f99, 0x18b8: 0x2039, 0x18b9: 0x0269, 0x18ba: 0x01d9, 0x18bb: 0x0fa9, + 0x18bc: 0x0fb9, 0x18bd: 0x1089, 0x18be: 0x0279, 0x18bf: 0x0369, + // Block 0x63, offset 0x18c0 + 0x18c0: 0x0289, 0x18c1: 0x13d1, 0x18c2: 0x0039, 0x18c3: 0x0ee9, 0x18c4: 0x1159, 0x18c5: 0x0ef9, + 0x18c6: 0x0f09, 0x18c7: 0x1199, 0x18c8: 0x0f31, 0x18c9: 0x0249, 0x18ca: 0x0f41, 0x18cb: 0x0259, + 0x18cc: 0x0f51, 0x18cd: 0x0359, 0x18ce: 0x0f61, 0x18cf: 0x0f71, 0x18d0: 0x00d9, 0x18d1: 0x0f99, + 0x18d2: 0x2039, 0x18d3: 0x0269, 0x18d4: 0x01d9, 0x18d5: 0x0fa9, 0x18d6: 0x0fb9, 0x18d7: 0x1089, + 0x18d8: 0x0279, 0x18d9: 0x0369, 0x18da: 0x0289, 0x18db: 0x13d1, 0x18dc: 0x0039, 0x18dd: 0x0040, + 0x18de: 0x1159, 0x18df: 0x0ef9, 0x18e0: 0x0040, 0x18e1: 0x0040, 0x18e2: 0x0f31, 0x18e3: 0x0040, + 0x18e4: 0x0040, 0x18e5: 0x0259, 0x18e6: 0x0f51, 0x18e7: 0x0040, 0x18e8: 0x0040, 0x18e9: 0x0f71, + 0x18ea: 0x00d9, 0x18eb: 0x0f99, 0x18ec: 0x2039, 0x18ed: 0x0040, 0x18ee: 0x01d9, 0x18ef: 0x0fa9, + 0x18f0: 0x0fb9, 0x18f1: 0x1089, 0x18f2: 0x0279, 0x18f3: 0x0369, 0x18f4: 0x0289, 0x18f5: 0x13d1, + 0x18f6: 0x0039, 0x18f7: 0x0ee9, 0x18f8: 0x1159, 0x18f9: 0x0ef9, 0x18fa: 0x0040, 0x18fb: 0x1199, + 0x18fc: 0x0040, 0x18fd: 0x0249, 0x18fe: 0x0f41, 0x18ff: 0x0259, + // Block 0x64, offset 0x1900 + 0x1900: 0x0f51, 0x1901: 0x0359, 0x1902: 0x0f61, 0x1903: 0x0f71, 0x1904: 0x0040, 0x1905: 0x0f99, + 0x1906: 0x2039, 0x1907: 0x0269, 0x1908: 0x01d9, 0x1909: 0x0fa9, 0x190a: 0x0fb9, 0x190b: 0x1089, + 0x190c: 0x0279, 0x190d: 0x0369, 0x190e: 0x0289, 0x190f: 0x13d1, 0x1910: 0x0039, 0x1911: 0x0ee9, + 0x1912: 0x1159, 0x1913: 0x0ef9, 0x1914: 0x0f09, 0x1915: 0x1199, 0x1916: 0x0f31, 0x1917: 0x0249, + 0x1918: 0x0f41, 0x1919: 0x0259, 0x191a: 0x0f51, 0x191b: 0x0359, 0x191c: 0x0f61, 0x191d: 0x0f71, + 0x191e: 0x00d9, 0x191f: 0x0f99, 0x1920: 0x2039, 0x1921: 0x0269, 0x1922: 0x01d9, 0x1923: 0x0fa9, + 0x1924: 0x0fb9, 0x1925: 0x1089, 0x1926: 0x0279, 0x1927: 0x0369, 0x1928: 0x0289, 0x1929: 0x13d1, + 0x192a: 0x0039, 0x192b: 0x0ee9, 0x192c: 0x1159, 0x192d: 0x0ef9, 0x192e: 0x0f09, 0x192f: 0x1199, + 0x1930: 0x0f31, 0x1931: 0x0249, 0x1932: 0x0f41, 0x1933: 0x0259, 0x1934: 0x0f51, 0x1935: 0x0359, + 0x1936: 0x0f61, 0x1937: 0x0f71, 0x1938: 0x00d9, 0x1939: 0x0f99, 0x193a: 0x2039, 0x193b: 0x0269, + 0x193c: 0x01d9, 0x193d: 0x0fa9, 0x193e: 0x0fb9, 0x193f: 0x1089, + // Block 0x65, offset 0x1940 + 0x1940: 0x0279, 0x1941: 0x0369, 0x1942: 0x0289, 0x1943: 0x13d1, 0x1944: 0x0039, 0x1945: 0x0ee9, + 0x1946: 0x0040, 0x1947: 0x0ef9, 0x1948: 0x0f09, 0x1949: 0x1199, 0x194a: 0x0f31, 0x194b: 0x0040, + 0x194c: 0x0040, 0x194d: 0x0259, 0x194e: 0x0f51, 0x194f: 0x0359, 0x1950: 0x0f61, 0x1951: 0x0f71, + 0x1952: 0x00d9, 0x1953: 0x0f99, 0x1954: 0x2039, 0x1955: 0x0040, 0x1956: 0x01d9, 0x1957: 0x0fa9, + 0x1958: 0x0fb9, 0x1959: 0x1089, 0x195a: 0x0279, 0x195b: 0x0369, 0x195c: 0x0289, 0x195d: 0x0040, + 0x195e: 0x0039, 0x195f: 0x0ee9, 0x1960: 0x1159, 0x1961: 0x0ef9, 0x1962: 0x0f09, 0x1963: 0x1199, + 0x1964: 0x0f31, 0x1965: 0x0249, 0x1966: 0x0f41, 0x1967: 0x0259, 0x1968: 0x0f51, 0x1969: 0x0359, + 0x196a: 0x0f61, 0x196b: 0x0f71, 0x196c: 0x00d9, 0x196d: 0x0f99, 0x196e: 0x2039, 0x196f: 0x0269, + 0x1970: 0x01d9, 0x1971: 0x0fa9, 0x1972: 0x0fb9, 0x1973: 0x1089, 0x1974: 0x0279, 0x1975: 0x0369, + 0x1976: 0x0289, 0x1977: 0x13d1, 0x1978: 0x0039, 0x1979: 0x0ee9, 0x197a: 0x0040, 0x197b: 0x0ef9, + 0x197c: 0x0f09, 0x197d: 0x1199, 0x197e: 0x0f31, 0x197f: 0x0040, + // Block 0x66, offset 0x1980 + 0x1980: 0x0f41, 0x1981: 0x0259, 0x1982: 0x0f51, 0x1983: 0x0359, 0x1984: 0x0f61, 0x1985: 0x0040, + 0x1986: 0x00d9, 0x1987: 0x0040, 0x1988: 0x0040, 0x1989: 0x0040, 0x198a: 0x01d9, 0x198b: 0x0fa9, + 0x198c: 0x0fb9, 0x198d: 0x1089, 0x198e: 0x0279, 0x198f: 0x0369, 0x1990: 0x0289, 0x1991: 0x0040, + 0x1992: 0x0039, 0x1993: 0x0ee9, 0x1994: 0x1159, 0x1995: 0x0ef9, 0x1996: 0x0f09, 0x1997: 0x1199, + 0x1998: 0x0f31, 0x1999: 0x0249, 0x199a: 0x0f41, 0x199b: 0x0259, 0x199c: 0x0f51, 0x199d: 0x0359, + 0x199e: 0x0f61, 0x199f: 0x0f71, 0x19a0: 0x00d9, 0x19a1: 0x0f99, 0x19a2: 0x2039, 0x19a3: 0x0269, + 0x19a4: 0x01d9, 0x19a5: 0x0fa9, 0x19a6: 0x0fb9, 0x19a7: 0x1089, 0x19a8: 0x0279, 0x19a9: 0x0369, + 0x19aa: 0x0289, 0x19ab: 0x13d1, 0x19ac: 0x0039, 0x19ad: 0x0ee9, 0x19ae: 0x1159, 0x19af: 0x0ef9, + 0x19b0: 0x0f09, 0x19b1: 0x1199, 0x19b2: 0x0f31, 0x19b3: 0x0249, 0x19b4: 0x0f41, 0x19b5: 0x0259, + 0x19b6: 0x0f51, 0x19b7: 0x0359, 0x19b8: 0x0f61, 0x19b9: 0x0f71, 0x19ba: 0x00d9, 0x19bb: 0x0f99, + 0x19bc: 0x2039, 0x19bd: 0x0269, 0x19be: 0x01d9, 0x19bf: 0x0fa9, + // Block 0x67, offset 0x19c0 + 0x19c0: 0x0fb9, 0x19c1: 0x1089, 0x19c2: 0x0279, 0x19c3: 0x0369, 0x19c4: 0x0289, 0x19c5: 0x13d1, + 0x19c6: 0x0039, 0x19c7: 0x0ee9, 0x19c8: 0x1159, 0x19c9: 0x0ef9, 0x19ca: 0x0f09, 0x19cb: 0x1199, + 0x19cc: 0x0f31, 0x19cd: 0x0249, 0x19ce: 0x0f41, 0x19cf: 0x0259, 0x19d0: 0x0f51, 0x19d1: 0x0359, + 0x19d2: 0x0f61, 0x19d3: 0x0f71, 0x19d4: 0x00d9, 0x19d5: 0x0f99, 0x19d6: 0x2039, 0x19d7: 0x0269, + 0x19d8: 0x01d9, 0x19d9: 0x0fa9, 0x19da: 0x0fb9, 0x19db: 0x1089, 0x19dc: 0x0279, 0x19dd: 0x0369, + 0x19de: 0x0289, 0x19df: 0x13d1, 0x19e0: 0x0039, 0x19e1: 0x0ee9, 0x19e2: 0x1159, 0x19e3: 0x0ef9, + 0x19e4: 0x0f09, 0x19e5: 0x1199, 0x19e6: 0x0f31, 0x19e7: 0x0249, 0x19e8: 0x0f41, 0x19e9: 0x0259, + 0x19ea: 0x0f51, 0x19eb: 0x0359, 0x19ec: 0x0f61, 0x19ed: 0x0f71, 0x19ee: 0x00d9, 0x19ef: 0x0f99, + 0x19f0: 0x2039, 0x19f1: 0x0269, 0x19f2: 0x01d9, 0x19f3: 0x0fa9, 0x19f4: 0x0fb9, 0x19f5: 0x1089, + 0x19f6: 0x0279, 0x19f7: 0x0369, 0x19f8: 0x0289, 0x19f9: 0x13d1, 0x19fa: 0x0039, 0x19fb: 0x0ee9, + 0x19fc: 0x1159, 0x19fd: 0x0ef9, 0x19fe: 0x0f09, 0x19ff: 0x1199, + // Block 0x68, offset 0x1a00 + 0x1a00: 0x0f31, 0x1a01: 0x0249, 0x1a02: 0x0f41, 0x1a03: 0x0259, 0x1a04: 0x0f51, 0x1a05: 0x0359, + 0x1a06: 0x0f61, 0x1a07: 0x0f71, 0x1a08: 0x00d9, 0x1a09: 0x0f99, 0x1a0a: 0x2039, 0x1a0b: 0x0269, + 0x1a0c: 0x01d9, 0x1a0d: 0x0fa9, 0x1a0e: 0x0fb9, 0x1a0f: 0x1089, 0x1a10: 0x0279, 0x1a11: 0x0369, + 0x1a12: 0x0289, 0x1a13: 0x13d1, 0x1a14: 0x0039, 0x1a15: 0x0ee9, 0x1a16: 0x1159, 0x1a17: 0x0ef9, + 0x1a18: 0x0f09, 0x1a19: 0x1199, 0x1a1a: 0x0f31, 0x1a1b: 0x0249, 0x1a1c: 0x0f41, 0x1a1d: 0x0259, + 0x1a1e: 0x0f51, 0x1a1f: 0x0359, 0x1a20: 0x0f61, 0x1a21: 0x0f71, 0x1a22: 0x00d9, 0x1a23: 0x0f99, + 0x1a24: 0x2039, 0x1a25: 0x0269, 0x1a26: 0x01d9, 0x1a27: 0x0fa9, 0x1a28: 0x0fb9, 0x1a29: 0x1089, + 0x1a2a: 0x0279, 0x1a2b: 0x0369, 0x1a2c: 0x0289, 0x1a2d: 0x13d1, 0x1a2e: 0x0039, 0x1a2f: 0x0ee9, + 0x1a30: 0x1159, 0x1a31: 0x0ef9, 0x1a32: 0x0f09, 0x1a33: 0x1199, 0x1a34: 0x0f31, 0x1a35: 0x0249, + 0x1a36: 0x0f41, 0x1a37: 0x0259, 0x1a38: 0x0f51, 0x1a39: 0x0359, 0x1a3a: 0x0f61, 0x1a3b: 0x0f71, + 0x1a3c: 0x00d9, 0x1a3d: 0x0f99, 0x1a3e: 0x2039, 0x1a3f: 0x0269, + // Block 0x69, offset 0x1a40 + 0x1a40: 0x01d9, 0x1a41: 0x0fa9, 0x1a42: 0x0fb9, 0x1a43: 0x1089, 0x1a44: 0x0279, 0x1a45: 0x0369, + 0x1a46: 0x0289, 0x1a47: 0x13d1, 0x1a48: 0x0039, 0x1a49: 0x0ee9, 0x1a4a: 0x1159, 0x1a4b: 0x0ef9, + 0x1a4c: 0x0f09, 0x1a4d: 0x1199, 0x1a4e: 0x0f31, 0x1a4f: 0x0249, 0x1a50: 0x0f41, 0x1a51: 0x0259, + 0x1a52: 0x0f51, 0x1a53: 0x0359, 0x1a54: 0x0f61, 0x1a55: 0x0f71, 0x1a56: 0x00d9, 0x1a57: 0x0f99, + 0x1a58: 0x2039, 0x1a59: 0x0269, 0x1a5a: 0x01d9, 0x1a5b: 0x0fa9, 0x1a5c: 0x0fb9, 0x1a5d: 0x1089, + 0x1a5e: 0x0279, 0x1a5f: 0x0369, 0x1a60: 0x0289, 0x1a61: 0x13d1, 0x1a62: 0x0039, 0x1a63: 0x0ee9, + 0x1a64: 0x1159, 0x1a65: 0x0ef9, 0x1a66: 0x0f09, 0x1a67: 0x1199, 0x1a68: 0x0f31, 0x1a69: 0x0249, + 0x1a6a: 0x0f41, 0x1a6b: 0x0259, 0x1a6c: 0x0f51, 0x1a6d: 0x0359, 0x1a6e: 0x0f61, 0x1a6f: 0x0f71, + 0x1a70: 0x00d9, 0x1a71: 0x0f99, 0x1a72: 0x2039, 0x1a73: 0x0269, 0x1a74: 0x01d9, 0x1a75: 0x0fa9, + 0x1a76: 0x0fb9, 0x1a77: 0x1089, 0x1a78: 0x0279, 0x1a79: 0x0369, 0x1a7a: 0x0289, 0x1a7b: 0x13d1, + 0x1a7c: 0x0039, 0x1a7d: 0x0ee9, 0x1a7e: 0x1159, 0x1a7f: 0x0ef9, + // Block 0x6a, offset 0x1a80 + 0x1a80: 0x0f09, 0x1a81: 0x1199, 0x1a82: 0x0f31, 0x1a83: 0x0249, 0x1a84: 0x0f41, 0x1a85: 0x0259, + 0x1a86: 0x0f51, 0x1a87: 0x0359, 0x1a88: 0x0f61, 0x1a89: 0x0f71, 0x1a8a: 0x00d9, 0x1a8b: 0x0f99, + 0x1a8c: 0x2039, 0x1a8d: 0x0269, 0x1a8e: 0x01d9, 0x1a8f: 0x0fa9, 0x1a90: 0x0fb9, 0x1a91: 0x1089, + 0x1a92: 0x0279, 0x1a93: 0x0369, 0x1a94: 0x0289, 0x1a95: 0x13d1, 0x1a96: 0x0039, 0x1a97: 0x0ee9, + 0x1a98: 0x1159, 0x1a99: 0x0ef9, 0x1a9a: 0x0f09, 0x1a9b: 0x1199, 0x1a9c: 0x0f31, 0x1a9d: 0x0249, + 0x1a9e: 0x0f41, 0x1a9f: 0x0259, 0x1aa0: 0x0f51, 0x1aa1: 0x0359, 0x1aa2: 0x0f61, 0x1aa3: 0x0f71, + 0x1aa4: 0x00d9, 0x1aa5: 0x0f99, 0x1aa6: 0x2039, 0x1aa7: 0x0269, 0x1aa8: 0x01d9, 0x1aa9: 0x0fa9, + 0x1aaa: 0x0fb9, 0x1aab: 0x1089, 0x1aac: 0x0279, 0x1aad: 0x0369, 0x1aae: 0x0289, 0x1aaf: 0x13d1, + 0x1ab0: 0x0039, 0x1ab1: 0x0ee9, 0x1ab2: 0x1159, 0x1ab3: 0x0ef9, 0x1ab4: 0x0f09, 0x1ab5: 0x1199, + 0x1ab6: 0x0f31, 0x1ab7: 0x0249, 0x1ab8: 0x0f41, 0x1ab9: 0x0259, 0x1aba: 0x0f51, 0x1abb: 0x0359, + 0x1abc: 0x0f61, 0x1abd: 0x0f71, 0x1abe: 0x00d9, 0x1abf: 0x0f99, + // Block 0x6b, offset 0x1ac0 + 0x1ac0: 0x2039, 0x1ac1: 0x0269, 0x1ac2: 0x01d9, 0x1ac3: 0x0fa9, 0x1ac4: 0x0fb9, 0x1ac5: 0x1089, + 0x1ac6: 0x0279, 0x1ac7: 0x0369, 0x1ac8: 0x0289, 0x1ac9: 0x13d1, 0x1aca: 0x0039, 0x1acb: 0x0ee9, + 0x1acc: 0x1159, 0x1acd: 0x0ef9, 0x1ace: 0x0f09, 0x1acf: 0x1199, 0x1ad0: 0x0f31, 0x1ad1: 0x0249, + 0x1ad2: 0x0f41, 0x1ad3: 0x0259, 0x1ad4: 0x0f51, 0x1ad5: 0x0359, 0x1ad6: 0x0f61, 0x1ad7: 0x0f71, + 0x1ad8: 0x00d9, 0x1ad9: 0x0f99, 0x1ada: 0x2039, 0x1adb: 0x0269, 0x1adc: 0x01d9, 0x1add: 0x0fa9, + 0x1ade: 0x0fb9, 0x1adf: 0x1089, 0x1ae0: 0x0279, 0x1ae1: 0x0369, 0x1ae2: 0x0289, 0x1ae3: 0x13d1, + 0x1ae4: 0xba81, 0x1ae5: 0xba99, 0x1ae6: 0x0040, 0x1ae7: 0x0040, 0x1ae8: 0xbab1, 0x1ae9: 0x1099, + 0x1aea: 0x10b1, 0x1aeb: 0x10c9, 0x1aec: 0xbac9, 0x1aed: 0xbae1, 0x1aee: 0xbaf9, 0x1aef: 0x1429, + 0x1af0: 0x1a31, 0x1af1: 0xbb11, 0x1af2: 0xbb29, 0x1af3: 0xbb41, 0x1af4: 0xbb59, 0x1af5: 0xbb71, + 0x1af6: 0xbb89, 0x1af7: 0x2109, 0x1af8: 0x1111, 0x1af9: 0x1429, 0x1afa: 0xbba1, 0x1afb: 0xbbb9, + 0x1afc: 0xbbd1, 0x1afd: 0x10e1, 0x1afe: 0x10f9, 0x1aff: 0xbbe9, + // Block 0x6c, offset 0x1b00 + 0x1b00: 0x2079, 0x1b01: 0xbc01, 0x1b02: 0xbab1, 0x1b03: 0x1099, 0x1b04: 0x10b1, 0x1b05: 0x10c9, + 0x1b06: 0xbac9, 0x1b07: 0xbae1, 0x1b08: 0xbaf9, 0x1b09: 0x1429, 0x1b0a: 0x1a31, 0x1b0b: 0xbb11, + 0x1b0c: 0xbb29, 0x1b0d: 0xbb41, 0x1b0e: 0xbb59, 0x1b0f: 0xbb71, 0x1b10: 0xbb89, 0x1b11: 0x2109, + 0x1b12: 0x1111, 0x1b13: 0xbba1, 0x1b14: 0xbba1, 0x1b15: 0xbbb9, 0x1b16: 0xbbd1, 0x1b17: 0x10e1, + 0x1b18: 0x10f9, 0x1b19: 0xbbe9, 0x1b1a: 0x2079, 0x1b1b: 0xbc21, 0x1b1c: 0xbac9, 0x1b1d: 0x1429, + 0x1b1e: 0xbb11, 0x1b1f: 0x10e1, 0x1b20: 0x1111, 0x1b21: 0x2109, 0x1b22: 0xbab1, 0x1b23: 0x1099, + 0x1b24: 0x10b1, 0x1b25: 0x10c9, 0x1b26: 0xbac9, 0x1b27: 0xbae1, 0x1b28: 0xbaf9, 0x1b29: 0x1429, + 0x1b2a: 0x1a31, 0x1b2b: 0xbb11, 0x1b2c: 0xbb29, 0x1b2d: 0xbb41, 0x1b2e: 0xbb59, 0x1b2f: 0xbb71, + 0x1b30: 0xbb89, 0x1b31: 0x2109, 0x1b32: 0x1111, 0x1b33: 0x1429, 0x1b34: 0xbba1, 0x1b35: 0xbbb9, + 0x1b36: 0xbbd1, 0x1b37: 0x10e1, 0x1b38: 0x10f9, 0x1b39: 0xbbe9, 0x1b3a: 0x2079, 0x1b3b: 0xbc01, + 0x1b3c: 0xbab1, 0x1b3d: 0x1099, 0x1b3e: 0x10b1, 0x1b3f: 0x10c9, + // Block 0x6d, offset 0x1b40 + 0x1b40: 0xbac9, 0x1b41: 0xbae1, 0x1b42: 0xbaf9, 0x1b43: 0x1429, 0x1b44: 0x1a31, 0x1b45: 0xbb11, + 0x1b46: 0xbb29, 0x1b47: 0xbb41, 0x1b48: 0xbb59, 0x1b49: 0xbb71, 0x1b4a: 0xbb89, 0x1b4b: 0x2109, + 0x1b4c: 0x1111, 0x1b4d: 0xbba1, 0x1b4e: 0xbba1, 0x1b4f: 0xbbb9, 0x1b50: 0xbbd1, 0x1b51: 0x10e1, + 0x1b52: 0x10f9, 0x1b53: 0xbbe9, 0x1b54: 0x2079, 0x1b55: 0xbc21, 0x1b56: 0xbac9, 0x1b57: 0x1429, + 0x1b58: 0xbb11, 0x1b59: 0x10e1, 0x1b5a: 0x1111, 0x1b5b: 0x2109, 0x1b5c: 0xbab1, 0x1b5d: 0x1099, + 0x1b5e: 0x10b1, 0x1b5f: 0x10c9, 0x1b60: 0xbac9, 0x1b61: 0xbae1, 0x1b62: 0xbaf9, 0x1b63: 0x1429, + 0x1b64: 0x1a31, 0x1b65: 0xbb11, 0x1b66: 0xbb29, 0x1b67: 0xbb41, 0x1b68: 0xbb59, 0x1b69: 0xbb71, + 0x1b6a: 0xbb89, 0x1b6b: 0x2109, 0x1b6c: 0x1111, 0x1b6d: 0x1429, 0x1b6e: 0xbba1, 0x1b6f: 0xbbb9, + 0x1b70: 0xbbd1, 0x1b71: 0x10e1, 0x1b72: 0x10f9, 0x1b73: 0xbbe9, 0x1b74: 0x2079, 0x1b75: 0xbc01, + 0x1b76: 0xbab1, 0x1b77: 0x1099, 0x1b78: 0x10b1, 0x1b79: 0x10c9, 0x1b7a: 0xbac9, 0x1b7b: 0xbae1, + 0x1b7c: 0xbaf9, 0x1b7d: 0x1429, 0x1b7e: 0x1a31, 0x1b7f: 0xbb11, + // Block 0x6e, offset 0x1b80 + 0x1b80: 0xbb29, 0x1b81: 0xbb41, 0x1b82: 0xbb59, 0x1b83: 0xbb71, 0x1b84: 0xbb89, 0x1b85: 0x2109, + 0x1b86: 0x1111, 0x1b87: 0xbba1, 0x1b88: 0xbba1, 0x1b89: 0xbbb9, 0x1b8a: 0xbbd1, 0x1b8b: 0x10e1, + 0x1b8c: 0x10f9, 0x1b8d: 0xbbe9, 0x1b8e: 0x2079, 0x1b8f: 0xbc21, 0x1b90: 0xbac9, 0x1b91: 0x1429, + 0x1b92: 0xbb11, 0x1b93: 0x10e1, 0x1b94: 0x1111, 0x1b95: 0x2109, 0x1b96: 0xbab1, 0x1b97: 0x1099, + 0x1b98: 0x10b1, 0x1b99: 0x10c9, 0x1b9a: 0xbac9, 0x1b9b: 0xbae1, 0x1b9c: 0xbaf9, 0x1b9d: 0x1429, + 0x1b9e: 0x1a31, 0x1b9f: 0xbb11, 0x1ba0: 0xbb29, 0x1ba1: 0xbb41, 0x1ba2: 0xbb59, 0x1ba3: 0xbb71, + 0x1ba4: 0xbb89, 0x1ba5: 0x2109, 0x1ba6: 0x1111, 0x1ba7: 0x1429, 0x1ba8: 0xbba1, 0x1ba9: 0xbbb9, + 0x1baa: 0xbbd1, 0x1bab: 0x10e1, 0x1bac: 0x10f9, 0x1bad: 0xbbe9, 0x1bae: 0x2079, 0x1baf: 0xbc01, + 0x1bb0: 0xbab1, 0x1bb1: 0x1099, 0x1bb2: 0x10b1, 0x1bb3: 0x10c9, 0x1bb4: 0xbac9, 0x1bb5: 0xbae1, + 0x1bb6: 0xbaf9, 0x1bb7: 0x1429, 0x1bb8: 0x1a31, 0x1bb9: 0xbb11, 0x1bba: 0xbb29, 0x1bbb: 0xbb41, + 0x1bbc: 0xbb59, 0x1bbd: 0xbb71, 0x1bbe: 0xbb89, 0x1bbf: 0x2109, + // Block 0x6f, offset 0x1bc0 + 0x1bc0: 0x1111, 0x1bc1: 0xbba1, 0x1bc2: 0xbba1, 0x1bc3: 0xbbb9, 0x1bc4: 0xbbd1, 0x1bc5: 0x10e1, + 0x1bc6: 0x10f9, 0x1bc7: 0xbbe9, 0x1bc8: 0x2079, 0x1bc9: 0xbc21, 0x1bca: 0xbac9, 0x1bcb: 0x1429, + 0x1bcc: 0xbb11, 0x1bcd: 0x10e1, 0x1bce: 0x1111, 0x1bcf: 0x2109, 0x1bd0: 0xbab1, 0x1bd1: 0x1099, + 0x1bd2: 0x10b1, 0x1bd3: 0x10c9, 0x1bd4: 0xbac9, 0x1bd5: 0xbae1, 0x1bd6: 0xbaf9, 0x1bd7: 0x1429, + 0x1bd8: 0x1a31, 0x1bd9: 0xbb11, 0x1bda: 0xbb29, 0x1bdb: 0xbb41, 0x1bdc: 0xbb59, 0x1bdd: 0xbb71, + 0x1bde: 0xbb89, 0x1bdf: 0x2109, 0x1be0: 0x1111, 0x1be1: 0x1429, 0x1be2: 0xbba1, 0x1be3: 0xbbb9, + 0x1be4: 0xbbd1, 0x1be5: 0x10e1, 0x1be6: 0x10f9, 0x1be7: 0xbbe9, 0x1be8: 0x2079, 0x1be9: 0xbc01, + 0x1bea: 0xbab1, 0x1beb: 0x1099, 0x1bec: 0x10b1, 0x1bed: 0x10c9, 0x1bee: 0xbac9, 0x1bef: 0xbae1, + 0x1bf0: 0xbaf9, 0x1bf1: 0x1429, 0x1bf2: 0x1a31, 0x1bf3: 0xbb11, 0x1bf4: 0xbb29, 0x1bf5: 0xbb41, + 0x1bf6: 0xbb59, 0x1bf7: 0xbb71, 0x1bf8: 0xbb89, 0x1bf9: 0x2109, 0x1bfa: 0x1111, 0x1bfb: 0xbba1, + 0x1bfc: 0xbba1, 0x1bfd: 0xbbb9, 0x1bfe: 0xbbd1, 0x1bff: 0x10e1, + // Block 0x70, offset 0x1c00 + 0x1c00: 0x10f9, 0x1c01: 0xbbe9, 0x1c02: 0x2079, 0x1c03: 0xbc21, 0x1c04: 0xbac9, 0x1c05: 0x1429, + 0x1c06: 0xbb11, 0x1c07: 0x10e1, 0x1c08: 0x1111, 0x1c09: 0x2109, 0x1c0a: 0xbc41, 0x1c0b: 0xbc41, + 0x1c0c: 0x0040, 0x1c0d: 0x0040, 0x1c0e: 0x1f41, 0x1c0f: 0x00c9, 0x1c10: 0x0069, 0x1c11: 0x0079, + 0x1c12: 0x1f51, 0x1c13: 0x1f61, 0x1c14: 0x1f71, 0x1c15: 0x1f81, 0x1c16: 0x1f91, 0x1c17: 0x1fa1, + 0x1c18: 0x1f41, 0x1c19: 0x00c9, 0x1c1a: 0x0069, 0x1c1b: 0x0079, 0x1c1c: 0x1f51, 0x1c1d: 0x1f61, + 0x1c1e: 0x1f71, 0x1c1f: 0x1f81, 0x1c20: 0x1f91, 0x1c21: 0x1fa1, 0x1c22: 0x1f41, 0x1c23: 0x00c9, + 0x1c24: 0x0069, 0x1c25: 0x0079, 0x1c26: 0x1f51, 0x1c27: 0x1f61, 0x1c28: 0x1f71, 0x1c29: 0x1f81, + 0x1c2a: 0x1f91, 0x1c2b: 0x1fa1, 0x1c2c: 0x1f41, 0x1c2d: 0x00c9, 0x1c2e: 0x0069, 0x1c2f: 0x0079, + 0x1c30: 0x1f51, 0x1c31: 0x1f61, 0x1c32: 0x1f71, 0x1c33: 0x1f81, 0x1c34: 0x1f91, 0x1c35: 0x1fa1, + 0x1c36: 0x1f41, 0x1c37: 0x00c9, 0x1c38: 0x0069, 0x1c39: 0x0079, 0x1c3a: 0x1f51, 0x1c3b: 0x1f61, + 0x1c3c: 0x1f71, 0x1c3d: 0x1f81, 0x1c3e: 0x1f91, 0x1c3f: 0x1fa1, + // Block 0x71, offset 0x1c40 + 0x1c40: 0xe115, 0x1c41: 0xe115, 0x1c42: 0xe135, 0x1c43: 0xe135, 0x1c44: 0xe115, 0x1c45: 0xe115, + 0x1c46: 0xe175, 0x1c47: 0xe175, 0x1c48: 0xe115, 0x1c49: 0xe115, 0x1c4a: 0xe135, 0x1c4b: 0xe135, + 0x1c4c: 0xe115, 0x1c4d: 0xe115, 0x1c4e: 0xe1f5, 0x1c4f: 0xe1f5, 0x1c50: 0xe115, 0x1c51: 0xe115, + 0x1c52: 0xe135, 0x1c53: 0xe135, 0x1c54: 0xe115, 0x1c55: 0xe115, 0x1c56: 0xe175, 0x1c57: 0xe175, + 0x1c58: 0xe115, 0x1c59: 0xe115, 0x1c5a: 0xe135, 0x1c5b: 0xe135, 0x1c5c: 0xe115, 0x1c5d: 0xe115, + 0x1c5e: 0x8b3d, 0x1c5f: 0x8b3d, 0x1c60: 0x04b5, 0x1c61: 0x04b5, 0x1c62: 0x0a08, 0x1c63: 0x0a08, + 0x1c64: 0x0a08, 0x1c65: 0x0a08, 0x1c66: 0x0a08, 0x1c67: 0x0a08, 0x1c68: 0x0a08, 0x1c69: 0x0a08, + 0x1c6a: 0x0a08, 0x1c6b: 0x0a08, 0x1c6c: 0x0a08, 0x1c6d: 0x0a08, 0x1c6e: 0x0a08, 0x1c6f: 0x0a08, + 0x1c70: 0x0a08, 0x1c71: 0x0a08, 0x1c72: 0x0a08, 0x1c73: 0x0a08, 0x1c74: 0x0a08, 0x1c75: 0x0a08, + 0x1c76: 0x0a08, 0x1c77: 0x0a08, 0x1c78: 0x0a08, 0x1c79: 0x0a08, 0x1c7a: 0x0a08, 0x1c7b: 0x0a08, + 0x1c7c: 0x0a08, 0x1c7d: 0x0a08, 0x1c7e: 0x0a08, 0x1c7f: 0x0a08, + // Block 0x72, offset 0x1c80 + 0x1c80: 0xb189, 0x1c81: 0xb1a1, 0x1c82: 0xb201, 0x1c83: 0xb249, 0x1c84: 0x0040, 0x1c85: 0xb411, + 0x1c86: 0xb291, 0x1c87: 0xb219, 0x1c88: 0xb309, 0x1c89: 0xb429, 0x1c8a: 0xb399, 0x1c8b: 0xb3b1, + 0x1c8c: 0xb3c9, 0x1c8d: 0xb3e1, 0x1c8e: 0xb2a9, 0x1c8f: 0xb339, 0x1c90: 0xb369, 0x1c91: 0xb2d9, + 0x1c92: 0xb381, 0x1c93: 0xb279, 0x1c94: 0xb2c1, 0x1c95: 0xb1d1, 0x1c96: 0xb1e9, 0x1c97: 0xb231, + 0x1c98: 0xb261, 0x1c99: 0xb2f1, 0x1c9a: 0xb321, 0x1c9b: 0xb351, 0x1c9c: 0xbc59, 0x1c9d: 0x7949, + 0x1c9e: 0xbc71, 0x1c9f: 0xbc89, 0x1ca0: 0x0040, 0x1ca1: 0xb1a1, 0x1ca2: 0xb201, 0x1ca3: 0x0040, + 0x1ca4: 0xb3f9, 0x1ca5: 0x0040, 0x1ca6: 0x0040, 0x1ca7: 0xb219, 0x1ca8: 0x0040, 0x1ca9: 0xb429, + 0x1caa: 0xb399, 0x1cab: 0xb3b1, 0x1cac: 0xb3c9, 0x1cad: 0xb3e1, 0x1cae: 0xb2a9, 0x1caf: 0xb339, + 0x1cb0: 0xb369, 0x1cb1: 0xb2d9, 0x1cb2: 0xb381, 0x1cb3: 0x0040, 0x1cb4: 0xb2c1, 0x1cb5: 0xb1d1, + 0x1cb6: 0xb1e9, 0x1cb7: 0xb231, 0x1cb8: 0x0040, 0x1cb9: 0xb2f1, 0x1cba: 0x0040, 0x1cbb: 0xb351, + 0x1cbc: 0x0040, 0x1cbd: 0x0040, 0x1cbe: 0x0040, 0x1cbf: 0x0040, + // Block 0x73, offset 0x1cc0 + 0x1cc0: 0x0040, 0x1cc1: 0x0040, 0x1cc2: 0xb201, 0x1cc3: 0x0040, 0x1cc4: 0x0040, 0x1cc5: 0x0040, + 0x1cc6: 0x0040, 0x1cc7: 0xb219, 0x1cc8: 0x0040, 0x1cc9: 0xb429, 0x1cca: 0x0040, 0x1ccb: 0xb3b1, + 0x1ccc: 0x0040, 0x1ccd: 0xb3e1, 0x1cce: 0xb2a9, 0x1ccf: 0xb339, 0x1cd0: 0x0040, 0x1cd1: 0xb2d9, + 0x1cd2: 0xb381, 0x1cd3: 0x0040, 0x1cd4: 0xb2c1, 0x1cd5: 0x0040, 0x1cd6: 0x0040, 0x1cd7: 0xb231, + 0x1cd8: 0x0040, 0x1cd9: 0xb2f1, 0x1cda: 0x0040, 0x1cdb: 0xb351, 0x1cdc: 0x0040, 0x1cdd: 0x7949, + 0x1cde: 0x0040, 0x1cdf: 0xbc89, 0x1ce0: 0x0040, 0x1ce1: 0xb1a1, 0x1ce2: 0xb201, 0x1ce3: 0x0040, + 0x1ce4: 0xb3f9, 0x1ce5: 0x0040, 0x1ce6: 0x0040, 0x1ce7: 0xb219, 0x1ce8: 0xb309, 0x1ce9: 0xb429, + 0x1cea: 0xb399, 0x1ceb: 0x0040, 0x1cec: 0xb3c9, 0x1ced: 0xb3e1, 0x1cee: 0xb2a9, 0x1cef: 0xb339, + 0x1cf0: 0xb369, 0x1cf1: 0xb2d9, 0x1cf2: 0xb381, 0x1cf3: 0x0040, 0x1cf4: 0xb2c1, 0x1cf5: 0xb1d1, + 0x1cf6: 0xb1e9, 0x1cf7: 0xb231, 0x1cf8: 0x0040, 0x1cf9: 0xb2f1, 0x1cfa: 0xb321, 0x1cfb: 0xb351, + 0x1cfc: 0xbc59, 0x1cfd: 0x0040, 0x1cfe: 0xbc71, 0x1cff: 0x0040, + // Block 0x74, offset 0x1d00 + 0x1d00: 0xb189, 0x1d01: 0xb1a1, 0x1d02: 0xb201, 0x1d03: 0xb249, 0x1d04: 0xb3f9, 0x1d05: 0xb411, + 0x1d06: 0xb291, 0x1d07: 0xb219, 0x1d08: 0xb309, 0x1d09: 0xb429, 0x1d0a: 0x0040, 0x1d0b: 0xb3b1, + 0x1d0c: 0xb3c9, 0x1d0d: 0xb3e1, 0x1d0e: 0xb2a9, 0x1d0f: 0xb339, 0x1d10: 0xb369, 0x1d11: 0xb2d9, + 0x1d12: 0xb381, 0x1d13: 0xb279, 0x1d14: 0xb2c1, 0x1d15: 0xb1d1, 0x1d16: 0xb1e9, 0x1d17: 0xb231, + 0x1d18: 0xb261, 0x1d19: 0xb2f1, 0x1d1a: 0xb321, 0x1d1b: 0xb351, 0x1d1c: 0x0040, 0x1d1d: 0x0040, + 0x1d1e: 0x0040, 0x1d1f: 0x0040, 0x1d20: 0x0040, 0x1d21: 0xb1a1, 0x1d22: 0xb201, 0x1d23: 0xb249, + 0x1d24: 0x0040, 0x1d25: 0xb411, 0x1d26: 0xb291, 0x1d27: 0xb219, 0x1d28: 0xb309, 0x1d29: 0xb429, + 0x1d2a: 0x0040, 0x1d2b: 0xb3b1, 0x1d2c: 0xb3c9, 0x1d2d: 0xb3e1, 0x1d2e: 0xb2a9, 0x1d2f: 0xb339, + 0x1d30: 0xb369, 0x1d31: 0xb2d9, 0x1d32: 0xb381, 0x1d33: 0xb279, 0x1d34: 0xb2c1, 0x1d35: 0xb1d1, + 0x1d36: 0xb1e9, 0x1d37: 0xb231, 0x1d38: 0xb261, 0x1d39: 0xb2f1, 0x1d3a: 0xb321, 0x1d3b: 0xb351, + 0x1d3c: 0x0040, 0x1d3d: 0x0040, 0x1d3e: 0x0040, 0x1d3f: 0x0040, + // Block 0x75, offset 0x1d40 + 0x1d40: 0x0040, 0x1d41: 0xbca2, 0x1d42: 0xbcba, 0x1d43: 0xbcd2, 0x1d44: 0xbcea, 0x1d45: 0xbd02, + 0x1d46: 0xbd1a, 0x1d47: 0xbd32, 0x1d48: 0xbd4a, 0x1d49: 0xbd62, 0x1d4a: 0xbd7a, 0x1d4b: 0x0018, + 0x1d4c: 0x0018, 0x1d4d: 0x0040, 0x1d4e: 0x0040, 0x1d4f: 0x0040, 0x1d50: 0xbd92, 0x1d51: 0xbdb2, + 0x1d52: 0xbdd2, 0x1d53: 0xbdf2, 0x1d54: 0xbe12, 0x1d55: 0xbe32, 0x1d56: 0xbe52, 0x1d57: 0xbe72, + 0x1d58: 0xbe92, 0x1d59: 0xbeb2, 0x1d5a: 0xbed2, 0x1d5b: 0xbef2, 0x1d5c: 0xbf12, 0x1d5d: 0xbf32, + 0x1d5e: 0xbf52, 0x1d5f: 0xbf72, 0x1d60: 0xbf92, 0x1d61: 0xbfb2, 0x1d62: 0xbfd2, 0x1d63: 0xbff2, + 0x1d64: 0xc012, 0x1d65: 0xc032, 0x1d66: 0xc052, 0x1d67: 0xc072, 0x1d68: 0xc092, 0x1d69: 0xc0b2, + 0x1d6a: 0xc0d1, 0x1d6b: 0x1159, 0x1d6c: 0x0269, 0x1d6d: 0x6671, 0x1d6e: 0xc111, 0x1d6f: 0x0018, + 0x1d70: 0x0039, 0x1d71: 0x0ee9, 0x1d72: 0x1159, 0x1d73: 0x0ef9, 0x1d74: 0x0f09, 0x1d75: 0x1199, + 0x1d76: 0x0f31, 0x1d77: 0x0249, 0x1d78: 0x0f41, 0x1d79: 0x0259, 0x1d7a: 0x0f51, 0x1d7b: 0x0359, + 0x1d7c: 0x0f61, 0x1d7d: 0x0f71, 0x1d7e: 0x00d9, 0x1d7f: 0x0f99, + // Block 0x76, offset 0x1d80 + 0x1d80: 0x2039, 0x1d81: 0x0269, 0x1d82: 0x01d9, 0x1d83: 0x0fa9, 0x1d84: 0x0fb9, 0x1d85: 0x1089, + 0x1d86: 0x0279, 0x1d87: 0x0369, 0x1d88: 0x0289, 0x1d89: 0x13d1, 0x1d8a: 0xc129, 0x1d8b: 0x65b1, + 0x1d8c: 0xc141, 0x1d8d: 0x1441, 0x1d8e: 0xc159, 0x1d8f: 0xc179, 0x1d90: 0x0018, 0x1d91: 0x0018, + 0x1d92: 0x0018, 0x1d93: 0x0018, 0x1d94: 0x0018, 0x1d95: 0x0018, 0x1d96: 0x0018, 0x1d97: 0x0018, + 0x1d98: 0x0018, 0x1d99: 0x0018, 0x1d9a: 0x0018, 0x1d9b: 0x0018, 0x1d9c: 0x0018, 0x1d9d: 0x0018, + 0x1d9e: 0x0018, 0x1d9f: 0x0018, 0x1da0: 0x0018, 0x1da1: 0x0018, 0x1da2: 0x0018, 0x1da3: 0x0018, + 0x1da4: 0x0018, 0x1da5: 0x0018, 0x1da6: 0x0018, 0x1da7: 0x0018, 0x1da8: 0x0018, 0x1da9: 0x0018, + 0x1daa: 0xc191, 0x1dab: 0xc1a9, 0x1dac: 0xc1c1, 0x1dad: 0x0040, 0x1dae: 0x0040, 0x1daf: 0x0040, + 0x1db0: 0x0018, 0x1db1: 0x0018, 0x1db2: 0x0018, 0x1db3: 0x0018, 0x1db4: 0x0018, 0x1db5: 0x0018, + 0x1db6: 0x0018, 0x1db7: 0x0018, 0x1db8: 0x0018, 0x1db9: 0x0018, 0x1dba: 0x0018, 0x1dbb: 0x0018, + 0x1dbc: 0x0018, 0x1dbd: 0x0018, 0x1dbe: 0x0018, 0x1dbf: 0x0018, + // Block 0x77, offset 0x1dc0 + 0x1dc0: 0xc1f1, 0x1dc1: 0xc229, 0x1dc2: 0xc261, 0x1dc3: 0x0040, 0x1dc4: 0x0040, 0x1dc5: 0x0040, + 0x1dc6: 0x0040, 0x1dc7: 0x0040, 0x1dc8: 0x0040, 0x1dc9: 0x0040, 0x1dca: 0x0040, 0x1dcb: 0x0040, + 0x1dcc: 0x0040, 0x1dcd: 0x0040, 0x1dce: 0x0040, 0x1dcf: 0x0040, 0x1dd0: 0xc281, 0x1dd1: 0xc2a1, + 0x1dd2: 0xc2c1, 0x1dd3: 0xc2e1, 0x1dd4: 0xc301, 0x1dd5: 0xc321, 0x1dd6: 0xc341, 0x1dd7: 0xc361, + 0x1dd8: 0xc381, 0x1dd9: 0xc3a1, 0x1dda: 0xc3c1, 0x1ddb: 0xc3e1, 0x1ddc: 0xc401, 0x1ddd: 0xc421, + 0x1dde: 0xc441, 0x1ddf: 0xc461, 0x1de0: 0xc481, 0x1de1: 0xc4a1, 0x1de2: 0xc4c1, 0x1de3: 0xc4e1, + 0x1de4: 0xc501, 0x1de5: 0xc521, 0x1de6: 0xc541, 0x1de7: 0xc561, 0x1de8: 0xc581, 0x1de9: 0xc5a1, + 0x1dea: 0xc5c1, 0x1deb: 0xc5e1, 0x1dec: 0xc601, 0x1ded: 0xc621, 0x1dee: 0xc641, 0x1def: 0xc661, + 0x1df0: 0xc681, 0x1df1: 0xc6a1, 0x1df2: 0xc6c1, 0x1df3: 0xc6e1, 0x1df4: 0xc701, 0x1df5: 0xc721, + 0x1df6: 0xc741, 0x1df7: 0xc761, 0x1df8: 0xc781, 0x1df9: 0xc7a1, 0x1dfa: 0xc7c1, 0x1dfb: 0xc7e1, + 0x1dfc: 0x0040, 0x1dfd: 0x0040, 0x1dfe: 0x0040, 0x1dff: 0x0040, + // Block 0x78, offset 0x1e00 + 0x1e00: 0xcb11, 0x1e01: 0xcb31, 0x1e02: 0xcb51, 0x1e03: 0x8b55, 0x1e04: 0xcb71, 0x1e05: 0xcb91, + 0x1e06: 0xcbb1, 0x1e07: 0xcbd1, 0x1e08: 0xcbf1, 0x1e09: 0xcc11, 0x1e0a: 0xcc31, 0x1e0b: 0xcc51, + 0x1e0c: 0xcc71, 0x1e0d: 0x8b75, 0x1e0e: 0xcc91, 0x1e0f: 0xccb1, 0x1e10: 0xccd1, 0x1e11: 0xccf1, + 0x1e12: 0x8b95, 0x1e13: 0xcd11, 0x1e14: 0xcd31, 0x1e15: 0xc441, 0x1e16: 0x8bb5, 0x1e17: 0xcd51, + 0x1e18: 0xcd71, 0x1e19: 0xcd91, 0x1e1a: 0xcdb1, 0x1e1b: 0xcdd1, 0x1e1c: 0x8bd5, 0x1e1d: 0xcdf1, + 0x1e1e: 0xce11, 0x1e1f: 0xce31, 0x1e20: 0xce51, 0x1e21: 0xce71, 0x1e22: 0xc7a1, 0x1e23: 0xce91, + 0x1e24: 0xceb1, 0x1e25: 0xced1, 0x1e26: 0xcef1, 0x1e27: 0xcf11, 0x1e28: 0xcf31, 0x1e29: 0xcf51, + 0x1e2a: 0xcf71, 0x1e2b: 0xcf91, 0x1e2c: 0xcfb1, 0x1e2d: 0xcfd1, 0x1e2e: 0xcff1, 0x1e2f: 0xd011, + 0x1e30: 0xd031, 0x1e31: 0xd051, 0x1e32: 0xd051, 0x1e33: 0xd051, 0x1e34: 0x8bf5, 0x1e35: 0xd071, + 0x1e36: 0xd091, 0x1e37: 0xd0b1, 0x1e38: 0x8c15, 0x1e39: 0xd0d1, 0x1e3a: 0xd0f1, 0x1e3b: 0xd111, + 0x1e3c: 0xd131, 0x1e3d: 0xd151, 0x1e3e: 0xd171, 0x1e3f: 0xd191, + // Block 0x79, offset 0x1e40 + 0x1e40: 0xd1b1, 0x1e41: 0xd1d1, 0x1e42: 0xd1f1, 0x1e43: 0xd211, 0x1e44: 0xd231, 0x1e45: 0xd251, + 0x1e46: 0xd251, 0x1e47: 0xd271, 0x1e48: 0xd291, 0x1e49: 0xd2b1, 0x1e4a: 0xd2d1, 0x1e4b: 0xd2f1, + 0x1e4c: 0xd311, 0x1e4d: 0xd331, 0x1e4e: 0xd351, 0x1e4f: 0xd371, 0x1e50: 0xd391, 0x1e51: 0xd3b1, + 0x1e52: 0xd3d1, 0x1e53: 0xd3f1, 0x1e54: 0xd411, 0x1e55: 0xd431, 0x1e56: 0xd451, 0x1e57: 0xd471, + 0x1e58: 0xd491, 0x1e59: 0x8c35, 0x1e5a: 0xd4b1, 0x1e5b: 0xd4d1, 0x1e5c: 0xd4f1, 0x1e5d: 0xc321, + 0x1e5e: 0xd511, 0x1e5f: 0xd531, 0x1e60: 0x8c55, 0x1e61: 0x8c75, 0x1e62: 0xd551, 0x1e63: 0xd571, + 0x1e64: 0xd591, 0x1e65: 0xd5b1, 0x1e66: 0xd5d1, 0x1e67: 0xd5f1, 0x1e68: 0x2040, 0x1e69: 0xd611, + 0x1e6a: 0xd631, 0x1e6b: 0xd631, 0x1e6c: 0x8c95, 0x1e6d: 0xd651, 0x1e6e: 0xd671, 0x1e6f: 0xd691, + 0x1e70: 0xd6b1, 0x1e71: 0x8cb5, 0x1e72: 0xd6d1, 0x1e73: 0xd6f1, 0x1e74: 0x2040, 0x1e75: 0xd711, + 0x1e76: 0xd731, 0x1e77: 0xd751, 0x1e78: 0xd771, 0x1e79: 0xd791, 0x1e7a: 0xd7b1, 0x1e7b: 0x8cd5, + 0x1e7c: 0xd7d1, 0x1e7d: 0x8cf5, 0x1e7e: 0xd7f1, 0x1e7f: 0xd811, + // Block 0x7a, offset 0x1e80 + 0x1e80: 0xd831, 0x1e81: 0xd851, 0x1e82: 0xd871, 0x1e83: 0xd891, 0x1e84: 0xd8b1, 0x1e85: 0xd8d1, + 0x1e86: 0xd8f1, 0x1e87: 0xd911, 0x1e88: 0xd931, 0x1e89: 0x8d15, 0x1e8a: 0xd951, 0x1e8b: 0xd971, + 0x1e8c: 0xd991, 0x1e8d: 0xd9b1, 0x1e8e: 0xd9d1, 0x1e8f: 0x8d35, 0x1e90: 0xd9f1, 0x1e91: 0x8d55, + 0x1e92: 0x8d75, 0x1e93: 0xda11, 0x1e94: 0xda31, 0x1e95: 0xda31, 0x1e96: 0xda51, 0x1e97: 0x8d95, + 0x1e98: 0x8db5, 0x1e99: 0xda71, 0x1e9a: 0xda91, 0x1e9b: 0xdab1, 0x1e9c: 0xdad1, 0x1e9d: 0xdaf1, + 0x1e9e: 0xdb11, 0x1e9f: 0xdb31, 0x1ea0: 0xdb51, 0x1ea1: 0xdb71, 0x1ea2: 0xdb91, 0x1ea3: 0xdbb1, + 0x1ea4: 0x8dd5, 0x1ea5: 0xdbd1, 0x1ea6: 0xdbf1, 0x1ea7: 0xdc11, 0x1ea8: 0xdc31, 0x1ea9: 0xdc11, + 0x1eaa: 0xdc51, 0x1eab: 0xdc71, 0x1eac: 0xdc91, 0x1ead: 0xdcb1, 0x1eae: 0xdcd1, 0x1eaf: 0xdcf1, + 0x1eb0: 0xdd11, 0x1eb1: 0xdd31, 0x1eb2: 0xdd51, 0x1eb3: 0xdd71, 0x1eb4: 0xdd91, 0x1eb5: 0xddb1, + 0x1eb6: 0xddd1, 0x1eb7: 0xddf1, 0x1eb8: 0x8df5, 0x1eb9: 0xde11, 0x1eba: 0xde31, 0x1ebb: 0xde51, + 0x1ebc: 0xde71, 0x1ebd: 0xde91, 0x1ebe: 0x8e15, 0x1ebf: 0xdeb1, + // Block 0x7b, offset 0x1ec0 + 0x1ec0: 0xe5b1, 0x1ec1: 0xe5d1, 0x1ec2: 0xe5f1, 0x1ec3: 0xe611, 0x1ec4: 0xe631, 0x1ec5: 0xe651, + 0x1ec6: 0x8f35, 0x1ec7: 0xe671, 0x1ec8: 0xe691, 0x1ec9: 0xe6b1, 0x1eca: 0xe6d1, 0x1ecb: 0xe6f1, + 0x1ecc: 0xe711, 0x1ecd: 0x8f55, 0x1ece: 0xe731, 0x1ecf: 0xe751, 0x1ed0: 0x8f75, 0x1ed1: 0x8f95, + 0x1ed2: 0xe771, 0x1ed3: 0xe791, 0x1ed4: 0xe7b1, 0x1ed5: 0xe7d1, 0x1ed6: 0xe7f1, 0x1ed7: 0xe811, + 0x1ed8: 0xe831, 0x1ed9: 0xe851, 0x1eda: 0xe871, 0x1edb: 0x8fb5, 0x1edc: 0xe891, 0x1edd: 0x8fd5, + 0x1ede: 0xe8b1, 0x1edf: 0x2040, 0x1ee0: 0xe8d1, 0x1ee1: 0xe8f1, 0x1ee2: 0xe911, 0x1ee3: 0x8ff5, + 0x1ee4: 0xe931, 0x1ee5: 0xe951, 0x1ee6: 0x9015, 0x1ee7: 0x9035, 0x1ee8: 0xe971, 0x1ee9: 0xe991, + 0x1eea: 0xe9b1, 0x1eeb: 0xe9d1, 0x1eec: 0xe9f1, 0x1eed: 0xe9f1, 0x1eee: 0xea11, 0x1eef: 0xea31, + 0x1ef0: 0xea51, 0x1ef1: 0xea71, 0x1ef2: 0xea91, 0x1ef3: 0xeab1, 0x1ef4: 0xead1, 0x1ef5: 0x9055, + 0x1ef6: 0xeaf1, 0x1ef7: 0x9075, 0x1ef8: 0xeb11, 0x1ef9: 0x9095, 0x1efa: 0xeb31, 0x1efb: 0x90b5, + 0x1efc: 0x90d5, 0x1efd: 0x90f5, 0x1efe: 0xeb51, 0x1eff: 0xeb71, + // Block 0x7c, offset 0x1f00 + 0x1f00: 0xeb91, 0x1f01: 0x9115, 0x1f02: 0x9135, 0x1f03: 0x9155, 0x1f04: 0x9175, 0x1f05: 0xebb1, + 0x1f06: 0xebd1, 0x1f07: 0xebd1, 0x1f08: 0xebf1, 0x1f09: 0xec11, 0x1f0a: 0xec31, 0x1f0b: 0xec51, + 0x1f0c: 0xec71, 0x1f0d: 0x9195, 0x1f0e: 0xec91, 0x1f0f: 0xecb1, 0x1f10: 0xecd1, 0x1f11: 0xecf1, + 0x1f12: 0x91b5, 0x1f13: 0xed11, 0x1f14: 0x91d5, 0x1f15: 0x91f5, 0x1f16: 0xed31, 0x1f17: 0xed51, + 0x1f18: 0xed71, 0x1f19: 0xed91, 0x1f1a: 0xedb1, 0x1f1b: 0xedd1, 0x1f1c: 0x9215, 0x1f1d: 0x9235, + 0x1f1e: 0x9255, 0x1f1f: 0x2040, 0x1f20: 0xedf1, 0x1f21: 0x9275, 0x1f22: 0xee11, 0x1f23: 0xee31, + 0x1f24: 0xee51, 0x1f25: 0x9295, 0x1f26: 0xee71, 0x1f27: 0xee91, 0x1f28: 0xeeb1, 0x1f29: 0xeed1, + 0x1f2a: 0xeef1, 0x1f2b: 0x92b5, 0x1f2c: 0xef11, 0x1f2d: 0xef31, 0x1f2e: 0xef51, 0x1f2f: 0xef71, + 0x1f30: 0xef91, 0x1f31: 0xefb1, 0x1f32: 0x92d5, 0x1f33: 0x92f5, 0x1f34: 0xefd1, 0x1f35: 0x9315, + 0x1f36: 0xeff1, 0x1f37: 0x9335, 0x1f38: 0xf011, 0x1f39: 0xf031, 0x1f3a: 0xf051, 0x1f3b: 0x9355, + 0x1f3c: 0x9375, 0x1f3d: 0xf071, 0x1f3e: 0x9395, 0x1f3f: 0xf091, + // Block 0x7d, offset 0x1f40 + 0x1f40: 0xf6d1, 0x1f41: 0xf6f1, 0x1f42: 0xf711, 0x1f43: 0xf731, 0x1f44: 0xf751, 0x1f45: 0x9555, + 0x1f46: 0xf771, 0x1f47: 0xf791, 0x1f48: 0xf7b1, 0x1f49: 0xf7d1, 0x1f4a: 0xf7f1, 0x1f4b: 0x9575, + 0x1f4c: 0x9595, 0x1f4d: 0xf811, 0x1f4e: 0xf831, 0x1f4f: 0xf851, 0x1f50: 0xf871, 0x1f51: 0xf891, + 0x1f52: 0xf8b1, 0x1f53: 0x95b5, 0x1f54: 0xf8d1, 0x1f55: 0xf8f1, 0x1f56: 0xf911, 0x1f57: 0xf931, + 0x1f58: 0x95d5, 0x1f59: 0x95f5, 0x1f5a: 0xf951, 0x1f5b: 0xf971, 0x1f5c: 0xf991, 0x1f5d: 0x9615, + 0x1f5e: 0xf9b1, 0x1f5f: 0xf9d1, 0x1f60: 0x684d, 0x1f61: 0x9635, 0x1f62: 0xf9f1, 0x1f63: 0xfa11, + 0x1f64: 0xfa31, 0x1f65: 0x9655, 0x1f66: 0xfa51, 0x1f67: 0xfa71, 0x1f68: 0xfa91, 0x1f69: 0xfab1, + 0x1f6a: 0xfad1, 0x1f6b: 0xfaf1, 0x1f6c: 0xfb11, 0x1f6d: 0x9675, 0x1f6e: 0xfb31, 0x1f6f: 0xfb51, + 0x1f70: 0xfb71, 0x1f71: 0x9695, 0x1f72: 0xfb91, 0x1f73: 0xfbb1, 0x1f74: 0xfbd1, 0x1f75: 0xfbf1, + 0x1f76: 0x7b6d, 0x1f77: 0x96b5, 0x1f78: 0xfc11, 0x1f79: 0xfc31, 0x1f7a: 0xfc51, 0x1f7b: 0x96d5, + 0x1f7c: 0xfc71, 0x1f7d: 0x96f5, 0x1f7e: 0xfc91, 0x1f7f: 0xfc91, + // Block 0x7e, offset 0x1f80 + 0x1f80: 0xfcb1, 0x1f81: 0x9715, 0x1f82: 0xfcd1, 0x1f83: 0xfcf1, 0x1f84: 0xfd11, 0x1f85: 0xfd31, + 0x1f86: 0xfd51, 0x1f87: 0xfd71, 0x1f88: 0xfd91, 0x1f89: 0x9735, 0x1f8a: 0xfdb1, 0x1f8b: 0xfdd1, + 0x1f8c: 0xfdf1, 0x1f8d: 0xfe11, 0x1f8e: 0xfe31, 0x1f8f: 0xfe51, 0x1f90: 0x9755, 0x1f91: 0xfe71, + 0x1f92: 0x9775, 0x1f93: 0x9795, 0x1f94: 0x97b5, 0x1f95: 0xfe91, 0x1f96: 0xfeb1, 0x1f97: 0xfed1, + 0x1f98: 0xfef1, 0x1f99: 0xff11, 0x1f9a: 0xff31, 0x1f9b: 0xff51, 0x1f9c: 0xff71, 0x1f9d: 0x97d5, + 0x1f9e: 0x0040, 0x1f9f: 0x0040, 0x1fa0: 0x0040, 0x1fa1: 0x0040, 0x1fa2: 0x0040, 0x1fa3: 0x0040, + 0x1fa4: 0x0040, 0x1fa5: 0x0040, 0x1fa6: 0x0040, 0x1fa7: 0x0040, 0x1fa8: 0x0040, 0x1fa9: 0x0040, + 0x1faa: 0x0040, 0x1fab: 0x0040, 0x1fac: 0x0040, 0x1fad: 0x0040, 0x1fae: 0x0040, 0x1faf: 0x0040, + 0x1fb0: 0x0040, 0x1fb1: 0x0040, 0x1fb2: 0x0040, 0x1fb3: 0x0040, 0x1fb4: 0x0040, 0x1fb5: 0x0040, + 0x1fb6: 0x0040, 0x1fb7: 0x0040, 0x1fb8: 0x0040, 0x1fb9: 0x0040, 0x1fba: 0x0040, 0x1fbb: 0x0040, + 0x1fbc: 0x0040, 0x1fbd: 0x0040, 0x1fbe: 0x0040, 0x1fbf: 0x0040, +} + +// idnaIndex: 36 blocks, 2304 entries, 4608 bytes +// Block 0 is the zero block. +var idnaIndex = [2304]uint16{ + // Block 0x0, offset 0x0 + // Block 0x1, offset 0x40 + // Block 0x2, offset 0x80 + // Block 0x3, offset 0xc0 + 0xc2: 0x01, 0xc3: 0x7d, 0xc4: 0x02, 0xc5: 0x03, 0xc6: 0x04, 0xc7: 0x05, + 0xc8: 0x06, 0xc9: 0x7e, 0xca: 0x7f, 0xcb: 0x07, 0xcc: 0x80, 0xcd: 0x08, 0xce: 0x09, 0xcf: 0x0a, + 0xd0: 0x81, 0xd1: 0x0b, 0xd2: 0x0c, 0xd3: 0x0d, 0xd4: 0x0e, 0xd5: 0x82, 0xd6: 0x83, 0xd7: 0x84, + 0xd8: 0x0f, 0xd9: 0x10, 0xda: 0x85, 0xdb: 0x11, 0xdc: 0x12, 0xdd: 0x86, 0xde: 0x87, 0xdf: 0x88, + 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05, 0xe4: 0x06, 0xe5: 0x07, 0xe6: 0x07, 0xe7: 0x07, + 0xe8: 0x07, 0xe9: 0x08, 0xea: 0x09, 0xeb: 0x07, 0xec: 0x07, 0xed: 0x0a, 0xee: 0x0b, 0xef: 0x0c, + 0xf0: 0x1d, 0xf1: 0x1e, 0xf2: 0x1e, 0xf3: 0x20, 0xf4: 0x21, + // Block 0x4, offset 0x100 + 0x120: 0x89, 0x121: 0x13, 0x122: 0x8a, 0x123: 0x8b, 0x124: 0x8c, 0x125: 0x14, 0x126: 0x15, 0x127: 0x16, + 0x128: 0x17, 0x129: 0x18, 0x12a: 0x19, 0x12b: 0x1a, 0x12c: 0x1b, 0x12d: 0x1c, 0x12e: 0x1d, 0x12f: 0x8d, + 0x130: 0x8e, 0x131: 0x1e, 0x132: 0x1f, 0x133: 0x20, 0x134: 0x8f, 0x135: 0x21, 0x136: 0x90, 0x137: 0x91, + 0x138: 0x92, 0x139: 0x93, 0x13a: 0x22, 0x13b: 0x94, 0x13c: 0x95, 0x13d: 0x23, 0x13e: 0x24, 0x13f: 0x96, + // Block 0x5, offset 0x140 + 0x140: 0x97, 0x141: 0x98, 0x142: 0x99, 0x143: 0x9a, 0x144: 0x9b, 0x145: 0x9c, 0x146: 0x9d, 0x147: 0x9e, + 0x148: 0x9f, 0x149: 0xa0, 0x14a: 0xa1, 0x14b: 0xa2, 0x14c: 0xa3, 0x14d: 0xa4, 0x14e: 0xa5, 0x14f: 0xa6, + 0x150: 0xa7, 0x151: 0x9f, 0x152: 0x9f, 0x153: 0x9f, 0x154: 0x9f, 0x155: 0x9f, 0x156: 0x9f, 0x157: 0x9f, + 0x158: 0x9f, 0x159: 0xa8, 0x15a: 0xa9, 0x15b: 0xaa, 0x15c: 0xab, 0x15d: 0xac, 0x15e: 0xad, 0x15f: 0xae, + 0x160: 0xaf, 0x161: 0xb0, 0x162: 0xb1, 0x163: 0xb2, 0x164: 0xb3, 0x165: 0xb4, 0x166: 0xb5, 0x167: 0xb6, + 0x168: 0xb7, 0x169: 0xb8, 0x16a: 0xb9, 0x16b: 0xba, 0x16c: 0xbb, 0x16d: 0xbc, 0x16e: 0xbd, 0x16f: 0xbe, + 0x170: 0xbf, 0x171: 0xc0, 0x172: 0xc1, 0x173: 0xc2, 0x174: 0x25, 0x175: 0x26, 0x176: 0x27, 0x177: 0xc3, + 0x178: 0x28, 0x179: 0x28, 0x17a: 0x29, 0x17b: 0x28, 0x17c: 0xc4, 0x17d: 0x2a, 0x17e: 0x2b, 0x17f: 0x2c, + // Block 0x6, offset 0x180 + 0x180: 0x2d, 0x181: 0x2e, 0x182: 0x2f, 0x183: 0xc5, 0x184: 0x30, 0x185: 0x31, 0x186: 0xc6, 0x187: 0x9b, + 0x188: 0xc7, 0x189: 0xc8, 0x18a: 0x9b, 0x18b: 0x9b, 0x18c: 0xc9, 0x18d: 0x9b, 0x18e: 0x9b, 0x18f: 0x9b, + 0x190: 0xca, 0x191: 0x32, 0x192: 0x33, 0x193: 0x34, 0x194: 0x9b, 0x195: 0x9b, 0x196: 0x9b, 0x197: 0x9b, + 0x198: 0x9b, 0x199: 0x9b, 0x19a: 0x9b, 0x19b: 0x9b, 0x19c: 0x9b, 0x19d: 0x9b, 0x19e: 0x9b, 0x19f: 0x9b, + 0x1a0: 0x9b, 0x1a1: 0x9b, 0x1a2: 0x9b, 0x1a3: 0x9b, 0x1a4: 0x9b, 0x1a5: 0x9b, 0x1a6: 0x9b, 0x1a7: 0x9b, + 0x1a8: 0xcb, 0x1a9: 0xcc, 0x1aa: 0x9b, 0x1ab: 0xcd, 0x1ac: 0x9b, 0x1ad: 0xce, 0x1ae: 0xcf, 0x1af: 0x9b, + 0x1b0: 0xd0, 0x1b1: 0x35, 0x1b2: 0x28, 0x1b3: 0x36, 0x1b4: 0xd1, 0x1b5: 0xd2, 0x1b6: 0xd3, 0x1b7: 0xd4, + 0x1b8: 0xd5, 0x1b9: 0xd6, 0x1ba: 0xd7, 0x1bb: 0xd8, 0x1bc: 0xd9, 0x1bd: 0xda, 0x1be: 0xdb, 0x1bf: 0x37, + // Block 0x7, offset 0x1c0 + 0x1c0: 0x38, 0x1c1: 0xdc, 0x1c2: 0xdd, 0x1c3: 0xde, 0x1c4: 0xdf, 0x1c5: 0x39, 0x1c6: 0x3a, 0x1c7: 0xe0, + 0x1c8: 0xe1, 0x1c9: 0x3b, 0x1ca: 0x3c, 0x1cb: 0x3d, 0x1cc: 0x3e, 0x1cd: 0x3f, 0x1ce: 0x40, 0x1cf: 0x41, + 0x1d0: 0x9f, 0x1d1: 0x9f, 0x1d2: 0x9f, 0x1d3: 0x9f, 0x1d4: 0x9f, 0x1d5: 0x9f, 0x1d6: 0x9f, 0x1d7: 0x9f, + 0x1d8: 0x9f, 0x1d9: 0x9f, 0x1da: 0x9f, 0x1db: 0x9f, 0x1dc: 0x9f, 0x1dd: 0x9f, 0x1de: 0x9f, 0x1df: 0x9f, + 0x1e0: 0x9f, 0x1e1: 0x9f, 0x1e2: 0x9f, 0x1e3: 0x9f, 0x1e4: 0x9f, 0x1e5: 0x9f, 0x1e6: 0x9f, 0x1e7: 0x9f, + 0x1e8: 0x9f, 0x1e9: 0x9f, 0x1ea: 0x9f, 0x1eb: 0x9f, 0x1ec: 0x9f, 0x1ed: 0x9f, 0x1ee: 0x9f, 0x1ef: 0x9f, + 0x1f0: 0x9f, 0x1f1: 0x9f, 0x1f2: 0x9f, 0x1f3: 0x9f, 0x1f4: 0x9f, 0x1f5: 0x9f, 0x1f6: 0x9f, 0x1f7: 0x9f, + 0x1f8: 0x9f, 0x1f9: 0x9f, 0x1fa: 0x9f, 0x1fb: 0x9f, 0x1fc: 0x9f, 0x1fd: 0x9f, 0x1fe: 0x9f, 0x1ff: 0x9f, + // Block 0x8, offset 0x200 + 0x200: 0x9f, 0x201: 0x9f, 0x202: 0x9f, 0x203: 0x9f, 0x204: 0x9f, 0x205: 0x9f, 0x206: 0x9f, 0x207: 0x9f, + 0x208: 0x9f, 0x209: 0x9f, 0x20a: 0x9f, 0x20b: 0x9f, 0x20c: 0x9f, 0x20d: 0x9f, 0x20e: 0x9f, 0x20f: 0x9f, + 0x210: 0x9f, 0x211: 0x9f, 0x212: 0x9f, 0x213: 0x9f, 0x214: 0x9f, 0x215: 0x9f, 0x216: 0x9f, 0x217: 0x9f, + 0x218: 0x9f, 0x219: 0x9f, 0x21a: 0x9f, 0x21b: 0x9f, 0x21c: 0x9f, 0x21d: 0x9f, 0x21e: 0x9f, 0x21f: 0x9f, + 0x220: 0x9f, 0x221: 0x9f, 0x222: 0x9f, 0x223: 0x9f, 0x224: 0x9f, 0x225: 0x9f, 0x226: 0x9f, 0x227: 0x9f, + 0x228: 0x9f, 0x229: 0x9f, 0x22a: 0x9f, 0x22b: 0x9f, 0x22c: 0x9f, 0x22d: 0x9f, 0x22e: 0x9f, 0x22f: 0x9f, + 0x230: 0x9f, 0x231: 0x9f, 0x232: 0x9f, 0x233: 0x9f, 0x234: 0x9f, 0x235: 0x9f, 0x236: 0xb2, 0x237: 0x9b, + 0x238: 0x9f, 0x239: 0x9f, 0x23a: 0x9f, 0x23b: 0x9f, 0x23c: 0x9f, 0x23d: 0x9f, 0x23e: 0x9f, 0x23f: 0x9f, + // Block 0x9, offset 0x240 + 0x240: 0x9f, 0x241: 0x9f, 0x242: 0x9f, 0x243: 0x9f, 0x244: 0x9f, 0x245: 0x9f, 0x246: 0x9f, 0x247: 0x9f, + 0x248: 0x9f, 0x249: 0x9f, 0x24a: 0x9f, 0x24b: 0x9f, 0x24c: 0x9f, 0x24d: 0x9f, 0x24e: 0x9f, 0x24f: 0x9f, + 0x250: 0x9f, 0x251: 0x9f, 0x252: 0x9f, 0x253: 0x9f, 0x254: 0x9f, 0x255: 0x9f, 0x256: 0x9f, 0x257: 0x9f, + 0x258: 0x9f, 0x259: 0x9f, 0x25a: 0x9f, 0x25b: 0x9f, 0x25c: 0x9f, 0x25d: 0x9f, 0x25e: 0x9f, 0x25f: 0x9f, + 0x260: 0x9f, 0x261: 0x9f, 0x262: 0x9f, 0x263: 0x9f, 0x264: 0x9f, 0x265: 0x9f, 0x266: 0x9f, 0x267: 0x9f, + 0x268: 0x9f, 0x269: 0x9f, 0x26a: 0x9f, 0x26b: 0x9f, 0x26c: 0x9f, 0x26d: 0x9f, 0x26e: 0x9f, 0x26f: 0x9f, + 0x270: 0x9f, 0x271: 0x9f, 0x272: 0x9f, 0x273: 0x9f, 0x274: 0x9f, 0x275: 0x9f, 0x276: 0x9f, 0x277: 0x9f, + 0x278: 0x9f, 0x279: 0x9f, 0x27a: 0x9f, 0x27b: 0x9f, 0x27c: 0x9f, 0x27d: 0x9f, 0x27e: 0x9f, 0x27f: 0x9f, + // Block 0xa, offset 0x280 + 0x280: 0x9f, 0x281: 0x9f, 0x282: 0x9f, 0x283: 0x9f, 0x284: 0x9f, 0x285: 0x9f, 0x286: 0x9f, 0x287: 0x9f, + 0x288: 0x9f, 0x289: 0x9f, 0x28a: 0x9f, 0x28b: 0x9f, 0x28c: 0x9f, 0x28d: 0x9f, 0x28e: 0x9f, 0x28f: 0x9f, + 0x290: 0x9f, 0x291: 0x9f, 0x292: 0x9f, 0x293: 0x9f, 0x294: 0x9f, 0x295: 0x9f, 0x296: 0x9f, 0x297: 0x9f, + 0x298: 0x9f, 0x299: 0x9f, 0x29a: 0x9f, 0x29b: 0x9f, 0x29c: 0x9f, 0x29d: 0x9f, 0x29e: 0x9f, 0x29f: 0x9f, + 0x2a0: 0x9f, 0x2a1: 0x9f, 0x2a2: 0x9f, 0x2a3: 0x9f, 0x2a4: 0x9f, 0x2a5: 0x9f, 0x2a6: 0x9f, 0x2a7: 0x9f, + 0x2a8: 0x9f, 0x2a9: 0x9f, 0x2aa: 0x9f, 0x2ab: 0x9f, 0x2ac: 0x9f, 0x2ad: 0x9f, 0x2ae: 0x9f, 0x2af: 0x9f, + 0x2b0: 0x9f, 0x2b1: 0x9f, 0x2b2: 0x9f, 0x2b3: 0x9f, 0x2b4: 0x9f, 0x2b5: 0x9f, 0x2b6: 0x9f, 0x2b7: 0x9f, + 0x2b8: 0x9f, 0x2b9: 0x9f, 0x2ba: 0x9f, 0x2bb: 0x9f, 0x2bc: 0x9f, 0x2bd: 0x9f, 0x2be: 0x9f, 0x2bf: 0xe2, + // Block 0xb, offset 0x2c0 + 0x2c0: 0x9f, 0x2c1: 0x9f, 0x2c2: 0x9f, 0x2c3: 0x9f, 0x2c4: 0x9f, 0x2c5: 0x9f, 0x2c6: 0x9f, 0x2c7: 0x9f, + 0x2c8: 0x9f, 0x2c9: 0x9f, 0x2ca: 0x9f, 0x2cb: 0x9f, 0x2cc: 0x9f, 0x2cd: 0x9f, 0x2ce: 0x9f, 0x2cf: 0x9f, + 0x2d0: 0x9f, 0x2d1: 0x9f, 0x2d2: 0xe3, 0x2d3: 0xe4, 0x2d4: 0x9f, 0x2d5: 0x9f, 0x2d6: 0x9f, 0x2d7: 0x9f, + 0x2d8: 0xe5, 0x2d9: 0x42, 0x2da: 0x43, 0x2db: 0xe6, 0x2dc: 0x44, 0x2dd: 0x45, 0x2de: 0x46, 0x2df: 0xe7, + 0x2e0: 0xe8, 0x2e1: 0xe9, 0x2e2: 0xea, 0x2e3: 0xeb, 0x2e4: 0xec, 0x2e5: 0xed, 0x2e6: 0xee, 0x2e7: 0xef, + 0x2e8: 0xf0, 0x2e9: 0xf1, 0x2ea: 0xf2, 0x2eb: 0xf3, 0x2ec: 0xf4, 0x2ed: 0xf5, 0x2ee: 0xf6, 0x2ef: 0xf7, + 0x2f0: 0x9f, 0x2f1: 0x9f, 0x2f2: 0x9f, 0x2f3: 0x9f, 0x2f4: 0x9f, 0x2f5: 0x9f, 0x2f6: 0x9f, 0x2f7: 0x9f, + 0x2f8: 0x9f, 0x2f9: 0x9f, 0x2fa: 0x9f, 0x2fb: 0x9f, 0x2fc: 0x9f, 0x2fd: 0x9f, 0x2fe: 0x9f, 0x2ff: 0x9f, + // Block 0xc, offset 0x300 + 0x300: 0x9f, 0x301: 0x9f, 0x302: 0x9f, 0x303: 0x9f, 0x304: 0x9f, 0x305: 0x9f, 0x306: 0x9f, 0x307: 0x9f, + 0x308: 0x9f, 0x309: 0x9f, 0x30a: 0x9f, 0x30b: 0x9f, 0x30c: 0x9f, 0x30d: 0x9f, 0x30e: 0x9f, 0x30f: 0x9f, + 0x310: 0x9f, 0x311: 0x9f, 0x312: 0x9f, 0x313: 0x9f, 0x314: 0x9f, 0x315: 0x9f, 0x316: 0x9f, 0x317: 0x9f, + 0x318: 0x9f, 0x319: 0x9f, 0x31a: 0x9f, 0x31b: 0x9f, 0x31c: 0x9f, 0x31d: 0x9f, 0x31e: 0xf8, 0x31f: 0xf9, + // Block 0xd, offset 0x340 + 0x340: 0xba, 0x341: 0xba, 0x342: 0xba, 0x343: 0xba, 0x344: 0xba, 0x345: 0xba, 0x346: 0xba, 0x347: 0xba, + 0x348: 0xba, 0x349: 0xba, 0x34a: 0xba, 0x34b: 0xba, 0x34c: 0xba, 0x34d: 0xba, 0x34e: 0xba, 0x34f: 0xba, + 0x350: 0xba, 0x351: 0xba, 0x352: 0xba, 0x353: 0xba, 0x354: 0xba, 0x355: 0xba, 0x356: 0xba, 0x357: 0xba, + 0x358: 0xba, 0x359: 0xba, 0x35a: 0xba, 0x35b: 0xba, 0x35c: 0xba, 0x35d: 0xba, 0x35e: 0xba, 0x35f: 0xba, + 0x360: 0xba, 0x361: 0xba, 0x362: 0xba, 0x363: 0xba, 0x364: 0xba, 0x365: 0xba, 0x366: 0xba, 0x367: 0xba, + 0x368: 0xba, 0x369: 0xba, 0x36a: 0xba, 0x36b: 0xba, 0x36c: 0xba, 0x36d: 0xba, 0x36e: 0xba, 0x36f: 0xba, + 0x370: 0xba, 0x371: 0xba, 0x372: 0xba, 0x373: 0xba, 0x374: 0xba, 0x375: 0xba, 0x376: 0xba, 0x377: 0xba, + 0x378: 0xba, 0x379: 0xba, 0x37a: 0xba, 0x37b: 0xba, 0x37c: 0xba, 0x37d: 0xba, 0x37e: 0xba, 0x37f: 0xba, + // Block 0xe, offset 0x380 + 0x380: 0xba, 0x381: 0xba, 0x382: 0xba, 0x383: 0xba, 0x384: 0xba, 0x385: 0xba, 0x386: 0xba, 0x387: 0xba, + 0x388: 0xba, 0x389: 0xba, 0x38a: 0xba, 0x38b: 0xba, 0x38c: 0xba, 0x38d: 0xba, 0x38e: 0xba, 0x38f: 0xba, + 0x390: 0xba, 0x391: 0xba, 0x392: 0xba, 0x393: 0xba, 0x394: 0xba, 0x395: 0xba, 0x396: 0xba, 0x397: 0xba, + 0x398: 0xba, 0x399: 0xba, 0x39a: 0xba, 0x39b: 0xba, 0x39c: 0xba, 0x39d: 0xba, 0x39e: 0xba, 0x39f: 0xba, + 0x3a0: 0xba, 0x3a1: 0xba, 0x3a2: 0xba, 0x3a3: 0xba, 0x3a4: 0xfa, 0x3a5: 0xfb, 0x3a6: 0xfc, 0x3a7: 0xfd, + 0x3a8: 0x47, 0x3a9: 0xfe, 0x3aa: 0xff, 0x3ab: 0x48, 0x3ac: 0x49, 0x3ad: 0x4a, 0x3ae: 0x4b, 0x3af: 0x4c, + 0x3b0: 0x100, 0x3b1: 0x4d, 0x3b2: 0x4e, 0x3b3: 0x4f, 0x3b4: 0x50, 0x3b5: 0x51, 0x3b6: 0x101, 0x3b7: 0x52, + 0x3b8: 0x53, 0x3b9: 0x54, 0x3ba: 0x55, 0x3bb: 0x56, 0x3bc: 0x57, 0x3bd: 0x58, 0x3be: 0x59, 0x3bf: 0x5a, + // Block 0xf, offset 0x3c0 + 0x3c0: 0x102, 0x3c1: 0x103, 0x3c2: 0x9f, 0x3c3: 0x104, 0x3c4: 0x105, 0x3c5: 0x9b, 0x3c6: 0x106, 0x3c7: 0x107, + 0x3c8: 0xba, 0x3c9: 0xba, 0x3ca: 0x108, 0x3cb: 0x109, 0x3cc: 0x10a, 0x3cd: 0x10b, 0x3ce: 0x10c, 0x3cf: 0x10d, + 0x3d0: 0x10e, 0x3d1: 0x9f, 0x3d2: 0x10f, 0x3d3: 0x110, 0x3d4: 0x111, 0x3d5: 0x112, 0x3d6: 0xba, 0x3d7: 0xba, + 0x3d8: 0x9f, 0x3d9: 0x9f, 0x3da: 0x9f, 0x3db: 0x9f, 0x3dc: 0x113, 0x3dd: 0x114, 0x3de: 0xba, 0x3df: 0xba, + 0x3e0: 0x115, 0x3e1: 0x116, 0x3e2: 0x117, 0x3e3: 0x118, 0x3e4: 0x119, 0x3e5: 0xba, 0x3e6: 0x11a, 0x3e7: 0x11b, + 0x3e8: 0x11c, 0x3e9: 0x11d, 0x3ea: 0x11e, 0x3eb: 0x5b, 0x3ec: 0x11f, 0x3ed: 0x120, 0x3ee: 0x5c, 0x3ef: 0xba, + 0x3f0: 0x121, 0x3f1: 0x122, 0x3f2: 0x123, 0x3f3: 0x124, 0x3f4: 0x125, 0x3f5: 0xba, 0x3f6: 0xba, 0x3f7: 0xba, + 0x3f8: 0xba, 0x3f9: 0x126, 0x3fa: 0xba, 0x3fb: 0xba, 0x3fc: 0x127, 0x3fd: 0x128, 0x3fe: 0xba, 0x3ff: 0x129, + // Block 0x10, offset 0x400 + 0x400: 0x12a, 0x401: 0x12b, 0x402: 0x12c, 0x403: 0x12d, 0x404: 0x12e, 0x405: 0x12f, 0x406: 0x130, 0x407: 0x131, + 0x408: 0x132, 0x409: 0xba, 0x40a: 0x133, 0x40b: 0x134, 0x40c: 0x5d, 0x40d: 0x5e, 0x40e: 0xba, 0x40f: 0xba, + 0x410: 0x135, 0x411: 0x136, 0x412: 0x137, 0x413: 0x138, 0x414: 0xba, 0x415: 0xba, 0x416: 0x139, 0x417: 0x13a, + 0x418: 0x13b, 0x419: 0x13c, 0x41a: 0x13d, 0x41b: 0x13e, 0x41c: 0x13f, 0x41d: 0xba, 0x41e: 0xba, 0x41f: 0xba, + 0x420: 0x140, 0x421: 0xba, 0x422: 0x141, 0x423: 0x142, 0x424: 0xba, 0x425: 0xba, 0x426: 0x143, 0x427: 0x144, + 0x428: 0x145, 0x429: 0x146, 0x42a: 0x147, 0x42b: 0x148, 0x42c: 0xba, 0x42d: 0xba, 0x42e: 0xba, 0x42f: 0xba, + 0x430: 0x149, 0x431: 0x14a, 0x432: 0x14b, 0x433: 0xba, 0x434: 0x14c, 0x435: 0x14d, 0x436: 0x14e, 0x437: 0xba, + 0x438: 0xba, 0x439: 0xba, 0x43a: 0xba, 0x43b: 0x14f, 0x43c: 0xba, 0x43d: 0xba, 0x43e: 0xba, 0x43f: 0x150, + // Block 0x11, offset 0x440 + 0x440: 0x9f, 0x441: 0x9f, 0x442: 0x9f, 0x443: 0x9f, 0x444: 0x9f, 0x445: 0x9f, 0x446: 0x9f, 0x447: 0x9f, + 0x448: 0x9f, 0x449: 0x9f, 0x44a: 0x9f, 0x44b: 0x9f, 0x44c: 0x9f, 0x44d: 0x9f, 0x44e: 0x151, 0x44f: 0xba, + 0x450: 0x9b, 0x451: 0x152, 0x452: 0x9f, 0x453: 0x9f, 0x454: 0x9f, 0x455: 0x153, 0x456: 0xba, 0x457: 0xba, + 0x458: 0xba, 0x459: 0xba, 0x45a: 0xba, 0x45b: 0xba, 0x45c: 0xba, 0x45d: 0xba, 0x45e: 0xba, 0x45f: 0xba, + 0x460: 0xba, 0x461: 0xba, 0x462: 0xba, 0x463: 0xba, 0x464: 0xba, 0x465: 0xba, 0x466: 0xba, 0x467: 0xba, + 0x468: 0xba, 0x469: 0xba, 0x46a: 0xba, 0x46b: 0xba, 0x46c: 0xba, 0x46d: 0xba, 0x46e: 0xba, 0x46f: 0xba, + 0x470: 0xba, 0x471: 0xba, 0x472: 0xba, 0x473: 0xba, 0x474: 0xba, 0x475: 0xba, 0x476: 0xba, 0x477: 0xba, + 0x478: 0xba, 0x479: 0xba, 0x47a: 0xba, 0x47b: 0xba, 0x47c: 0xba, 0x47d: 0xba, 0x47e: 0xba, 0x47f: 0xba, + // Block 0x12, offset 0x480 + 0x480: 0x9f, 0x481: 0x9f, 0x482: 0x9f, 0x483: 0x9f, 0x484: 0x9f, 0x485: 0x9f, 0x486: 0x9f, 0x487: 0x9f, + 0x488: 0x9f, 0x489: 0x9f, 0x48a: 0x9f, 0x48b: 0x9f, 0x48c: 0x9f, 0x48d: 0x9f, 0x48e: 0x9f, 0x48f: 0x9f, + 0x490: 0x154, 0x491: 0xba, 0x492: 0xba, 0x493: 0xba, 0x494: 0xba, 0x495: 0xba, 0x496: 0xba, 0x497: 0xba, + 0x498: 0xba, 0x499: 0xba, 0x49a: 0xba, 0x49b: 0xba, 0x49c: 0xba, 0x49d: 0xba, 0x49e: 0xba, 0x49f: 0xba, + 0x4a0: 0xba, 0x4a1: 0xba, 0x4a2: 0xba, 0x4a3: 0xba, 0x4a4: 0xba, 0x4a5: 0xba, 0x4a6: 0xba, 0x4a7: 0xba, + 0x4a8: 0xba, 0x4a9: 0xba, 0x4aa: 0xba, 0x4ab: 0xba, 0x4ac: 0xba, 0x4ad: 0xba, 0x4ae: 0xba, 0x4af: 0xba, + 0x4b0: 0xba, 0x4b1: 0xba, 0x4b2: 0xba, 0x4b3: 0xba, 0x4b4: 0xba, 0x4b5: 0xba, 0x4b6: 0xba, 0x4b7: 0xba, + 0x4b8: 0xba, 0x4b9: 0xba, 0x4ba: 0xba, 0x4bb: 0xba, 0x4bc: 0xba, 0x4bd: 0xba, 0x4be: 0xba, 0x4bf: 0xba, + // Block 0x13, offset 0x4c0 + 0x4c0: 0xba, 0x4c1: 0xba, 0x4c2: 0xba, 0x4c3: 0xba, 0x4c4: 0xba, 0x4c5: 0xba, 0x4c6: 0xba, 0x4c7: 0xba, + 0x4c8: 0xba, 0x4c9: 0xba, 0x4ca: 0xba, 0x4cb: 0xba, 0x4cc: 0xba, 0x4cd: 0xba, 0x4ce: 0xba, 0x4cf: 0xba, + 0x4d0: 0x9f, 0x4d1: 0x9f, 0x4d2: 0x9f, 0x4d3: 0x9f, 0x4d4: 0x9f, 0x4d5: 0x9f, 0x4d6: 0x9f, 0x4d7: 0x9f, + 0x4d8: 0x9f, 0x4d9: 0x155, 0x4da: 0xba, 0x4db: 0xba, 0x4dc: 0xba, 0x4dd: 0xba, 0x4de: 0xba, 0x4df: 0xba, + 0x4e0: 0xba, 0x4e1: 0xba, 0x4e2: 0xba, 0x4e3: 0xba, 0x4e4: 0xba, 0x4e5: 0xba, 0x4e6: 0xba, 0x4e7: 0xba, + 0x4e8: 0xba, 0x4e9: 0xba, 0x4ea: 0xba, 0x4eb: 0xba, 0x4ec: 0xba, 0x4ed: 0xba, 0x4ee: 0xba, 0x4ef: 0xba, + 0x4f0: 0xba, 0x4f1: 0xba, 0x4f2: 0xba, 0x4f3: 0xba, 0x4f4: 0xba, 0x4f5: 0xba, 0x4f6: 0xba, 0x4f7: 0xba, + 0x4f8: 0xba, 0x4f9: 0xba, 0x4fa: 0xba, 0x4fb: 0xba, 0x4fc: 0xba, 0x4fd: 0xba, 0x4fe: 0xba, 0x4ff: 0xba, + // Block 0x14, offset 0x500 + 0x500: 0xba, 0x501: 0xba, 0x502: 0xba, 0x503: 0xba, 0x504: 0xba, 0x505: 0xba, 0x506: 0xba, 0x507: 0xba, + 0x508: 0xba, 0x509: 0xba, 0x50a: 0xba, 0x50b: 0xba, 0x50c: 0xba, 0x50d: 0xba, 0x50e: 0xba, 0x50f: 0xba, + 0x510: 0xba, 0x511: 0xba, 0x512: 0xba, 0x513: 0xba, 0x514: 0xba, 0x515: 0xba, 0x516: 0xba, 0x517: 0xba, + 0x518: 0xba, 0x519: 0xba, 0x51a: 0xba, 0x51b: 0xba, 0x51c: 0xba, 0x51d: 0xba, 0x51e: 0xba, 0x51f: 0xba, + 0x520: 0x9f, 0x521: 0x9f, 0x522: 0x9f, 0x523: 0x9f, 0x524: 0x9f, 0x525: 0x9f, 0x526: 0x9f, 0x527: 0x9f, + 0x528: 0x148, 0x529: 0x156, 0x52a: 0xba, 0x52b: 0x157, 0x52c: 0x158, 0x52d: 0x159, 0x52e: 0x15a, 0x52f: 0xba, + 0x530: 0xba, 0x531: 0xba, 0x532: 0xba, 0x533: 0xba, 0x534: 0xba, 0x535: 0xba, 0x536: 0xba, 0x537: 0xba, + 0x538: 0xba, 0x539: 0x15b, 0x53a: 0x15c, 0x53b: 0xba, 0x53c: 0x9f, 0x53d: 0x15d, 0x53e: 0x15e, 0x53f: 0x15f, + // Block 0x15, offset 0x540 + 0x540: 0x9f, 0x541: 0x9f, 0x542: 0x9f, 0x543: 0x9f, 0x544: 0x9f, 0x545: 0x9f, 0x546: 0x9f, 0x547: 0x9f, + 0x548: 0x9f, 0x549: 0x9f, 0x54a: 0x9f, 0x54b: 0x9f, 0x54c: 0x9f, 0x54d: 0x9f, 0x54e: 0x9f, 0x54f: 0x9f, + 0x550: 0x9f, 0x551: 0x9f, 0x552: 0x9f, 0x553: 0x9f, 0x554: 0x9f, 0x555: 0x9f, 0x556: 0x9f, 0x557: 0x9f, + 0x558: 0x9f, 0x559: 0x9f, 0x55a: 0x9f, 0x55b: 0x9f, 0x55c: 0x9f, 0x55d: 0x9f, 0x55e: 0x9f, 0x55f: 0x160, + 0x560: 0x9f, 0x561: 0x9f, 0x562: 0x9f, 0x563: 0x9f, 0x564: 0x9f, 0x565: 0x9f, 0x566: 0x9f, 0x567: 0x9f, + 0x568: 0x9f, 0x569: 0x9f, 0x56a: 0x9f, 0x56b: 0x161, 0x56c: 0xba, 0x56d: 0xba, 0x56e: 0xba, 0x56f: 0xba, + 0x570: 0xba, 0x571: 0xba, 0x572: 0xba, 0x573: 0xba, 0x574: 0xba, 0x575: 0xba, 0x576: 0xba, 0x577: 0xba, + 0x578: 0xba, 0x579: 0xba, 0x57a: 0xba, 0x57b: 0xba, 0x57c: 0xba, 0x57d: 0xba, 0x57e: 0xba, 0x57f: 0xba, + // Block 0x16, offset 0x580 + 0x580: 0x9f, 0x581: 0x9f, 0x582: 0x9f, 0x583: 0x9f, 0x584: 0x162, 0x585: 0x163, 0x586: 0x9f, 0x587: 0x9f, + 0x588: 0x9f, 0x589: 0x9f, 0x58a: 0x9f, 0x58b: 0x164, 0x58c: 0xba, 0x58d: 0xba, 0x58e: 0xba, 0x58f: 0xba, + 0x590: 0xba, 0x591: 0xba, 0x592: 0xba, 0x593: 0xba, 0x594: 0xba, 0x595: 0xba, 0x596: 0xba, 0x597: 0xba, + 0x598: 0xba, 0x599: 0xba, 0x59a: 0xba, 0x59b: 0xba, 0x59c: 0xba, 0x59d: 0xba, 0x59e: 0xba, 0x59f: 0xba, + 0x5a0: 0xba, 0x5a1: 0xba, 0x5a2: 0xba, 0x5a3: 0xba, 0x5a4: 0xba, 0x5a5: 0xba, 0x5a6: 0xba, 0x5a7: 0xba, + 0x5a8: 0xba, 0x5a9: 0xba, 0x5aa: 0xba, 0x5ab: 0xba, 0x5ac: 0xba, 0x5ad: 0xba, 0x5ae: 0xba, 0x5af: 0xba, + 0x5b0: 0x9f, 0x5b1: 0x165, 0x5b2: 0x166, 0x5b3: 0xba, 0x5b4: 0xba, 0x5b5: 0xba, 0x5b6: 0xba, 0x5b7: 0xba, + 0x5b8: 0xba, 0x5b9: 0xba, 0x5ba: 0xba, 0x5bb: 0xba, 0x5bc: 0xba, 0x5bd: 0xba, 0x5be: 0xba, 0x5bf: 0xba, + // Block 0x17, offset 0x5c0 + 0x5c0: 0x9b, 0x5c1: 0x9b, 0x5c2: 0x9b, 0x5c3: 0x167, 0x5c4: 0x168, 0x5c5: 0x169, 0x5c6: 0x16a, 0x5c7: 0x16b, + 0x5c8: 0x9b, 0x5c9: 0x16c, 0x5ca: 0xba, 0x5cb: 0x16d, 0x5cc: 0x9b, 0x5cd: 0x16e, 0x5ce: 0xba, 0x5cf: 0xba, + 0x5d0: 0x5f, 0x5d1: 0x60, 0x5d2: 0x61, 0x5d3: 0x62, 0x5d4: 0x63, 0x5d5: 0x64, 0x5d6: 0x65, 0x5d7: 0x66, + 0x5d8: 0x67, 0x5d9: 0x68, 0x5da: 0x69, 0x5db: 0x6a, 0x5dc: 0x6b, 0x5dd: 0x6c, 0x5de: 0x6d, 0x5df: 0x6e, + 0x5e0: 0x9b, 0x5e1: 0x9b, 0x5e2: 0x9b, 0x5e3: 0x9b, 0x5e4: 0x9b, 0x5e5: 0x9b, 0x5e6: 0x9b, 0x5e7: 0x9b, + 0x5e8: 0x16f, 0x5e9: 0x170, 0x5ea: 0x171, 0x5eb: 0xba, 0x5ec: 0xba, 0x5ed: 0xba, 0x5ee: 0xba, 0x5ef: 0xba, + 0x5f0: 0xba, 0x5f1: 0xba, 0x5f2: 0xba, 0x5f3: 0xba, 0x5f4: 0xba, 0x5f5: 0xba, 0x5f6: 0xba, 0x5f7: 0xba, + 0x5f8: 0xba, 0x5f9: 0xba, 0x5fa: 0xba, 0x5fb: 0xba, 0x5fc: 0xba, 0x5fd: 0xba, 0x5fe: 0xba, 0x5ff: 0xba, + // Block 0x18, offset 0x600 + 0x600: 0x172, 0x601: 0xba, 0x602: 0xba, 0x603: 0xba, 0x604: 0x173, 0x605: 0x174, 0x606: 0xba, 0x607: 0xba, + 0x608: 0xba, 0x609: 0xba, 0x60a: 0xba, 0x60b: 0x175, 0x60c: 0xba, 0x60d: 0xba, 0x60e: 0xba, 0x60f: 0xba, + 0x610: 0xba, 0x611: 0xba, 0x612: 0xba, 0x613: 0xba, 0x614: 0xba, 0x615: 0xba, 0x616: 0xba, 0x617: 0xba, + 0x618: 0xba, 0x619: 0xba, 0x61a: 0xba, 0x61b: 0xba, 0x61c: 0xba, 0x61d: 0xba, 0x61e: 0xba, 0x61f: 0xba, + 0x620: 0x121, 0x621: 0x121, 0x622: 0x121, 0x623: 0x176, 0x624: 0x6f, 0x625: 0x177, 0x626: 0xba, 0x627: 0xba, + 0x628: 0xba, 0x629: 0xba, 0x62a: 0xba, 0x62b: 0xba, 0x62c: 0xba, 0x62d: 0xba, 0x62e: 0xba, 0x62f: 0xba, + 0x630: 0xba, 0x631: 0x178, 0x632: 0x179, 0x633: 0xba, 0x634: 0x17a, 0x635: 0xba, 0x636: 0xba, 0x637: 0xba, + 0x638: 0x70, 0x639: 0x71, 0x63a: 0x72, 0x63b: 0x17b, 0x63c: 0xba, 0x63d: 0xba, 0x63e: 0xba, 0x63f: 0xba, + // Block 0x19, offset 0x640 + 0x640: 0x17c, 0x641: 0x9b, 0x642: 0x17d, 0x643: 0x17e, 0x644: 0x73, 0x645: 0x74, 0x646: 0x17f, 0x647: 0x180, + 0x648: 0x75, 0x649: 0x181, 0x64a: 0xba, 0x64b: 0xba, 0x64c: 0x9b, 0x64d: 0x9b, 0x64e: 0x9b, 0x64f: 0x9b, + 0x650: 0x9b, 0x651: 0x9b, 0x652: 0x9b, 0x653: 0x9b, 0x654: 0x9b, 0x655: 0x9b, 0x656: 0x9b, 0x657: 0x9b, + 0x658: 0x9b, 0x659: 0x9b, 0x65a: 0x9b, 0x65b: 0x182, 0x65c: 0x9b, 0x65d: 0x183, 0x65e: 0x9b, 0x65f: 0x184, + 0x660: 0x185, 0x661: 0x186, 0x662: 0x187, 0x663: 0xba, 0x664: 0x188, 0x665: 0x189, 0x666: 0x18a, 0x667: 0x18b, + 0x668: 0x9b, 0x669: 0x18c, 0x66a: 0x18d, 0x66b: 0xba, 0x66c: 0xba, 0x66d: 0xba, 0x66e: 0xba, 0x66f: 0xba, + 0x670: 0xba, 0x671: 0xba, 0x672: 0xba, 0x673: 0xba, 0x674: 0xba, 0x675: 0xba, 0x676: 0xba, 0x677: 0xba, + 0x678: 0xba, 0x679: 0xba, 0x67a: 0xba, 0x67b: 0xba, 0x67c: 0xba, 0x67d: 0xba, 0x67e: 0xba, 0x67f: 0xba, + // Block 0x1a, offset 0x680 + 0x680: 0x9f, 0x681: 0x9f, 0x682: 0x9f, 0x683: 0x9f, 0x684: 0x9f, 0x685: 0x9f, 0x686: 0x9f, 0x687: 0x9f, + 0x688: 0x9f, 0x689: 0x9f, 0x68a: 0x9f, 0x68b: 0x9f, 0x68c: 0x9f, 0x68d: 0x9f, 0x68e: 0x9f, 0x68f: 0x9f, + 0x690: 0x9f, 0x691: 0x9f, 0x692: 0x9f, 0x693: 0x9f, 0x694: 0x9f, 0x695: 0x9f, 0x696: 0x9f, 0x697: 0x9f, + 0x698: 0x9f, 0x699: 0x9f, 0x69a: 0x9f, 0x69b: 0x18e, 0x69c: 0x9f, 0x69d: 0x9f, 0x69e: 0x9f, 0x69f: 0x9f, + 0x6a0: 0x9f, 0x6a1: 0x9f, 0x6a2: 0x9f, 0x6a3: 0x9f, 0x6a4: 0x9f, 0x6a5: 0x9f, 0x6a6: 0x9f, 0x6a7: 0x9f, + 0x6a8: 0x9f, 0x6a9: 0x9f, 0x6aa: 0x9f, 0x6ab: 0x9f, 0x6ac: 0x9f, 0x6ad: 0x9f, 0x6ae: 0x9f, 0x6af: 0x9f, + 0x6b0: 0x9f, 0x6b1: 0x9f, 0x6b2: 0x9f, 0x6b3: 0x9f, 0x6b4: 0x9f, 0x6b5: 0x9f, 0x6b6: 0x9f, 0x6b7: 0x9f, + 0x6b8: 0x9f, 0x6b9: 0x9f, 0x6ba: 0x9f, 0x6bb: 0x9f, 0x6bc: 0x9f, 0x6bd: 0x9f, 0x6be: 0x9f, 0x6bf: 0x9f, + // Block 0x1b, offset 0x6c0 + 0x6c0: 0x9f, 0x6c1: 0x9f, 0x6c2: 0x9f, 0x6c3: 0x9f, 0x6c4: 0x9f, 0x6c5: 0x9f, 0x6c6: 0x9f, 0x6c7: 0x9f, + 0x6c8: 0x9f, 0x6c9: 0x9f, 0x6ca: 0x9f, 0x6cb: 0x9f, 0x6cc: 0x9f, 0x6cd: 0x9f, 0x6ce: 0x9f, 0x6cf: 0x9f, + 0x6d0: 0x9f, 0x6d1: 0x9f, 0x6d2: 0x9f, 0x6d3: 0x9f, 0x6d4: 0x9f, 0x6d5: 0x9f, 0x6d6: 0x9f, 0x6d7: 0x9f, + 0x6d8: 0x9f, 0x6d9: 0x9f, 0x6da: 0x9f, 0x6db: 0x9f, 0x6dc: 0x18f, 0x6dd: 0x9f, 0x6de: 0x9f, 0x6df: 0x9f, + 0x6e0: 0x190, 0x6e1: 0x9f, 0x6e2: 0x9f, 0x6e3: 0x9f, 0x6e4: 0x9f, 0x6e5: 0x9f, 0x6e6: 0x9f, 0x6e7: 0x9f, + 0x6e8: 0x9f, 0x6e9: 0x9f, 0x6ea: 0x9f, 0x6eb: 0x9f, 0x6ec: 0x9f, 0x6ed: 0x9f, 0x6ee: 0x9f, 0x6ef: 0x9f, + 0x6f0: 0x9f, 0x6f1: 0x9f, 0x6f2: 0x9f, 0x6f3: 0x9f, 0x6f4: 0x9f, 0x6f5: 0x9f, 0x6f6: 0x9f, 0x6f7: 0x9f, + 0x6f8: 0x9f, 0x6f9: 0x9f, 0x6fa: 0x9f, 0x6fb: 0x9f, 0x6fc: 0x9f, 0x6fd: 0x9f, 0x6fe: 0x9f, 0x6ff: 0x9f, + // Block 0x1c, offset 0x700 + 0x700: 0x9f, 0x701: 0x9f, 0x702: 0x9f, 0x703: 0x9f, 0x704: 0x9f, 0x705: 0x9f, 0x706: 0x9f, 0x707: 0x9f, + 0x708: 0x9f, 0x709: 0x9f, 0x70a: 0x9f, 0x70b: 0x9f, 0x70c: 0x9f, 0x70d: 0x9f, 0x70e: 0x9f, 0x70f: 0x9f, + 0x710: 0x9f, 0x711: 0x9f, 0x712: 0x9f, 0x713: 0x9f, 0x714: 0x9f, 0x715: 0x9f, 0x716: 0x9f, 0x717: 0x9f, + 0x718: 0x9f, 0x719: 0x9f, 0x71a: 0x9f, 0x71b: 0x9f, 0x71c: 0x9f, 0x71d: 0x9f, 0x71e: 0x9f, 0x71f: 0x9f, + 0x720: 0x9f, 0x721: 0x9f, 0x722: 0x9f, 0x723: 0x9f, 0x724: 0x9f, 0x725: 0x9f, 0x726: 0x9f, 0x727: 0x9f, + 0x728: 0x9f, 0x729: 0x9f, 0x72a: 0x9f, 0x72b: 0x9f, 0x72c: 0x9f, 0x72d: 0x9f, 0x72e: 0x9f, 0x72f: 0x9f, + 0x730: 0x9f, 0x731: 0x9f, 0x732: 0x9f, 0x733: 0x9f, 0x734: 0x9f, 0x735: 0x9f, 0x736: 0x9f, 0x737: 0x9f, + 0x738: 0x9f, 0x739: 0x9f, 0x73a: 0x191, 0x73b: 0x9f, 0x73c: 0x9f, 0x73d: 0x9f, 0x73e: 0x9f, 0x73f: 0x9f, + // Block 0x1d, offset 0x740 + 0x740: 0x9f, 0x741: 0x9f, 0x742: 0x9f, 0x743: 0x9f, 0x744: 0x9f, 0x745: 0x9f, 0x746: 0x9f, 0x747: 0x9f, + 0x748: 0x9f, 0x749: 0x9f, 0x74a: 0x9f, 0x74b: 0x9f, 0x74c: 0x9f, 0x74d: 0x9f, 0x74e: 0x9f, 0x74f: 0x9f, + 0x750: 0x9f, 0x751: 0x9f, 0x752: 0x9f, 0x753: 0x9f, 0x754: 0x9f, 0x755: 0x9f, 0x756: 0x9f, 0x757: 0x9f, + 0x758: 0x9f, 0x759: 0x9f, 0x75a: 0x9f, 0x75b: 0x9f, 0x75c: 0x9f, 0x75d: 0x9f, 0x75e: 0x9f, 0x75f: 0x9f, + 0x760: 0x9f, 0x761: 0x9f, 0x762: 0x9f, 0x763: 0x9f, 0x764: 0x9f, 0x765: 0x9f, 0x766: 0x9f, 0x767: 0x9f, + 0x768: 0x9f, 0x769: 0x9f, 0x76a: 0x9f, 0x76b: 0x9f, 0x76c: 0x9f, 0x76d: 0x9f, 0x76e: 0x9f, 0x76f: 0x192, + 0x770: 0xba, 0x771: 0xba, 0x772: 0xba, 0x773: 0xba, 0x774: 0xba, 0x775: 0xba, 0x776: 0xba, 0x777: 0xba, + 0x778: 0xba, 0x779: 0xba, 0x77a: 0xba, 0x77b: 0xba, 0x77c: 0xba, 0x77d: 0xba, 0x77e: 0xba, 0x77f: 0xba, + // Block 0x1e, offset 0x780 + 0x780: 0xba, 0x781: 0xba, 0x782: 0xba, 0x783: 0xba, 0x784: 0xba, 0x785: 0xba, 0x786: 0xba, 0x787: 0xba, + 0x788: 0xba, 0x789: 0xba, 0x78a: 0xba, 0x78b: 0xba, 0x78c: 0xba, 0x78d: 0xba, 0x78e: 0xba, 0x78f: 0xba, + 0x790: 0xba, 0x791: 0xba, 0x792: 0xba, 0x793: 0xba, 0x794: 0xba, 0x795: 0xba, 0x796: 0xba, 0x797: 0xba, + 0x798: 0xba, 0x799: 0xba, 0x79a: 0xba, 0x79b: 0xba, 0x79c: 0xba, 0x79d: 0xba, 0x79e: 0xba, 0x79f: 0xba, + 0x7a0: 0x76, 0x7a1: 0x77, 0x7a2: 0x78, 0x7a3: 0x193, 0x7a4: 0x79, 0x7a5: 0x7a, 0x7a6: 0x194, 0x7a7: 0x7b, + 0x7a8: 0x7c, 0x7a9: 0xba, 0x7aa: 0xba, 0x7ab: 0xba, 0x7ac: 0xba, 0x7ad: 0xba, 0x7ae: 0xba, 0x7af: 0xba, + 0x7b0: 0xba, 0x7b1: 0xba, 0x7b2: 0xba, 0x7b3: 0xba, 0x7b4: 0xba, 0x7b5: 0xba, 0x7b6: 0xba, 0x7b7: 0xba, + 0x7b8: 0xba, 0x7b9: 0xba, 0x7ba: 0xba, 0x7bb: 0xba, 0x7bc: 0xba, 0x7bd: 0xba, 0x7be: 0xba, 0x7bf: 0xba, + // Block 0x1f, offset 0x7c0 + 0x7d0: 0x0d, 0x7d1: 0x0e, 0x7d2: 0x0f, 0x7d3: 0x10, 0x7d4: 0x11, 0x7d5: 0x0b, 0x7d6: 0x12, 0x7d7: 0x07, + 0x7d8: 0x13, 0x7d9: 0x0b, 0x7da: 0x0b, 0x7db: 0x14, 0x7dc: 0x0b, 0x7dd: 0x15, 0x7de: 0x16, 0x7df: 0x17, + 0x7e0: 0x07, 0x7e1: 0x07, 0x7e2: 0x07, 0x7e3: 0x07, 0x7e4: 0x07, 0x7e5: 0x07, 0x7e6: 0x07, 0x7e7: 0x07, + 0x7e8: 0x07, 0x7e9: 0x07, 0x7ea: 0x18, 0x7eb: 0x19, 0x7ec: 0x1a, 0x7ed: 0x07, 0x7ee: 0x1b, 0x7ef: 0x1c, + 0x7f0: 0x0b, 0x7f1: 0x0b, 0x7f2: 0x0b, 0x7f3: 0x0b, 0x7f4: 0x0b, 0x7f5: 0x0b, 0x7f6: 0x0b, 0x7f7: 0x0b, + 0x7f8: 0x0b, 0x7f9: 0x0b, 0x7fa: 0x0b, 0x7fb: 0x0b, 0x7fc: 0x0b, 0x7fd: 0x0b, 0x7fe: 0x0b, 0x7ff: 0x0b, + // Block 0x20, offset 0x800 + 0x800: 0x0b, 0x801: 0x0b, 0x802: 0x0b, 0x803: 0x0b, 0x804: 0x0b, 0x805: 0x0b, 0x806: 0x0b, 0x807: 0x0b, + 0x808: 0x0b, 0x809: 0x0b, 0x80a: 0x0b, 0x80b: 0x0b, 0x80c: 0x0b, 0x80d: 0x0b, 0x80e: 0x0b, 0x80f: 0x0b, + 0x810: 0x0b, 0x811: 0x0b, 0x812: 0x0b, 0x813: 0x0b, 0x814: 0x0b, 0x815: 0x0b, 0x816: 0x0b, 0x817: 0x0b, + 0x818: 0x0b, 0x819: 0x0b, 0x81a: 0x0b, 0x81b: 0x0b, 0x81c: 0x0b, 0x81d: 0x0b, 0x81e: 0x0b, 0x81f: 0x0b, + 0x820: 0x0b, 0x821: 0x0b, 0x822: 0x0b, 0x823: 0x0b, 0x824: 0x0b, 0x825: 0x0b, 0x826: 0x0b, 0x827: 0x0b, + 0x828: 0x0b, 0x829: 0x0b, 0x82a: 0x0b, 0x82b: 0x0b, 0x82c: 0x0b, 0x82d: 0x0b, 0x82e: 0x0b, 0x82f: 0x0b, + 0x830: 0x0b, 0x831: 0x0b, 0x832: 0x0b, 0x833: 0x0b, 0x834: 0x0b, 0x835: 0x0b, 0x836: 0x0b, 0x837: 0x0b, + 0x838: 0x0b, 0x839: 0x0b, 0x83a: 0x0b, 0x83b: 0x0b, 0x83c: 0x0b, 0x83d: 0x0b, 0x83e: 0x0b, 0x83f: 0x0b, + // Block 0x21, offset 0x840 + 0x840: 0x195, 0x841: 0x196, 0x842: 0xba, 0x843: 0xba, 0x844: 0x197, 0x845: 0x197, 0x846: 0x197, 0x847: 0x198, + 0x848: 0xba, 0x849: 0xba, 0x84a: 0xba, 0x84b: 0xba, 0x84c: 0xba, 0x84d: 0xba, 0x84e: 0xba, 0x84f: 0xba, + 0x850: 0xba, 0x851: 0xba, 0x852: 0xba, 0x853: 0xba, 0x854: 0xba, 0x855: 0xba, 0x856: 0xba, 0x857: 0xba, + 0x858: 0xba, 0x859: 0xba, 0x85a: 0xba, 0x85b: 0xba, 0x85c: 0xba, 0x85d: 0xba, 0x85e: 0xba, 0x85f: 0xba, + 0x860: 0xba, 0x861: 0xba, 0x862: 0xba, 0x863: 0xba, 0x864: 0xba, 0x865: 0xba, 0x866: 0xba, 0x867: 0xba, + 0x868: 0xba, 0x869: 0xba, 0x86a: 0xba, 0x86b: 0xba, 0x86c: 0xba, 0x86d: 0xba, 0x86e: 0xba, 0x86f: 0xba, + 0x870: 0xba, 0x871: 0xba, 0x872: 0xba, 0x873: 0xba, 0x874: 0xba, 0x875: 0xba, 0x876: 0xba, 0x877: 0xba, + 0x878: 0xba, 0x879: 0xba, 0x87a: 0xba, 0x87b: 0xba, 0x87c: 0xba, 0x87d: 0xba, 0x87e: 0xba, 0x87f: 0xba, + // Block 0x22, offset 0x880 + 0x880: 0x0b, 0x881: 0x0b, 0x882: 0x0b, 0x883: 0x0b, 0x884: 0x0b, 0x885: 0x0b, 0x886: 0x0b, 0x887: 0x0b, + 0x888: 0x0b, 0x889: 0x0b, 0x88a: 0x0b, 0x88b: 0x0b, 0x88c: 0x0b, 0x88d: 0x0b, 0x88e: 0x0b, 0x88f: 0x0b, + 0x890: 0x0b, 0x891: 0x0b, 0x892: 0x0b, 0x893: 0x0b, 0x894: 0x0b, 0x895: 0x0b, 0x896: 0x0b, 0x897: 0x0b, + 0x898: 0x0b, 0x899: 0x0b, 0x89a: 0x0b, 0x89b: 0x0b, 0x89c: 0x0b, 0x89d: 0x0b, 0x89e: 0x0b, 0x89f: 0x0b, + 0x8a0: 0x1f, 0x8a1: 0x0b, 0x8a2: 0x0b, 0x8a3: 0x0b, 0x8a4: 0x0b, 0x8a5: 0x0b, 0x8a6: 0x0b, 0x8a7: 0x0b, + 0x8a8: 0x0b, 0x8a9: 0x0b, 0x8aa: 0x0b, 0x8ab: 0x0b, 0x8ac: 0x0b, 0x8ad: 0x0b, 0x8ae: 0x0b, 0x8af: 0x0b, + 0x8b0: 0x0b, 0x8b1: 0x0b, 0x8b2: 0x0b, 0x8b3: 0x0b, 0x8b4: 0x0b, 0x8b5: 0x0b, 0x8b6: 0x0b, 0x8b7: 0x0b, + 0x8b8: 0x0b, 0x8b9: 0x0b, 0x8ba: 0x0b, 0x8bb: 0x0b, 0x8bc: 0x0b, 0x8bd: 0x0b, 0x8be: 0x0b, 0x8bf: 0x0b, + // Block 0x23, offset 0x8c0 + 0x8c0: 0x0b, 0x8c1: 0x0b, 0x8c2: 0x0b, 0x8c3: 0x0b, 0x8c4: 0x0b, 0x8c5: 0x0b, 0x8c6: 0x0b, 0x8c7: 0x0b, + 0x8c8: 0x0b, 0x8c9: 0x0b, 0x8ca: 0x0b, 0x8cb: 0x0b, 0x8cc: 0x0b, 0x8cd: 0x0b, 0x8ce: 0x0b, 0x8cf: 0x0b, +} + +// idnaSparseOffset: 284 entries, 568 bytes +var idnaSparseOffset = []uint16{0x0, 0x8, 0x19, 0x25, 0x27, 0x2c, 0x33, 0x3e, 0x4a, 0x4e, 0x5d, 0x62, 0x6c, 0x78, 0x86, 0x8b, 0x94, 0xa4, 0xb2, 0xbe, 0xca, 0xdb, 0xe5, 0xec, 0xf9, 0x10a, 0x111, 0x11c, 0x12b, 0x139, 0x143, 0x145, 0x14a, 0x14d, 0x150, 0x152, 0x15e, 0x169, 0x171, 0x177, 0x17d, 0x182, 0x187, 0x18a, 0x18e, 0x194, 0x199, 0x1a5, 0x1af, 0x1b5, 0x1c6, 0x1d0, 0x1d3, 0x1db, 0x1de, 0x1eb, 0x1f3, 0x1f7, 0x1fe, 0x206, 0x216, 0x222, 0x224, 0x22e, 0x23a, 0x246, 0x252, 0x25a, 0x25f, 0x26c, 0x27d, 0x281, 0x28c, 0x290, 0x299, 0x2a1, 0x2a7, 0x2ac, 0x2af, 0x2b3, 0x2b9, 0x2bd, 0x2c1, 0x2c5, 0x2cb, 0x2d3, 0x2da, 0x2e5, 0x2ef, 0x2f3, 0x2f6, 0x2fc, 0x300, 0x302, 0x305, 0x307, 0x30a, 0x314, 0x317, 0x326, 0x32a, 0x32f, 0x332, 0x336, 0x33b, 0x340, 0x346, 0x352, 0x361, 0x367, 0x36b, 0x37a, 0x37f, 0x387, 0x391, 0x39c, 0x3a4, 0x3b5, 0x3be, 0x3ce, 0x3db, 0x3e5, 0x3ea, 0x3f7, 0x3fb, 0x400, 0x402, 0x406, 0x408, 0x40c, 0x415, 0x41b, 0x41f, 0x42f, 0x439, 0x43e, 0x441, 0x447, 0x44e, 0x453, 0x457, 0x45d, 0x462, 0x46b, 0x470, 0x476, 0x47d, 0x484, 0x48b, 0x48f, 0x494, 0x497, 0x49c, 0x4a8, 0x4ae, 0x4b3, 0x4ba, 0x4c2, 0x4c7, 0x4cb, 0x4db, 0x4e2, 0x4e6, 0x4ea, 0x4f1, 0x4f3, 0x4f6, 0x4f9, 0x4fd, 0x506, 0x50a, 0x512, 0x51a, 0x51e, 0x524, 0x52d, 0x539, 0x540, 0x549, 0x553, 0x55a, 0x568, 0x575, 0x582, 0x58b, 0x58f, 0x59f, 0x5a7, 0x5b2, 0x5bb, 0x5c1, 0x5c9, 0x5d2, 0x5dd, 0x5e0, 0x5ec, 0x5f5, 0x5f8, 0x5fd, 0x602, 0x60f, 0x61a, 0x623, 0x62d, 0x630, 0x63a, 0x643, 0x64f, 0x65c, 0x669, 0x677, 0x67e, 0x682, 0x685, 0x68a, 0x68d, 0x692, 0x695, 0x69c, 0x6a3, 0x6a7, 0x6b2, 0x6b5, 0x6b8, 0x6bb, 0x6c1, 0x6c7, 0x6cd, 0x6d0, 0x6d3, 0x6d6, 0x6dd, 0x6e0, 0x6e5, 0x6ef, 0x6f2, 0x6f6, 0x705, 0x711, 0x715, 0x71a, 0x71e, 0x723, 0x727, 0x72c, 0x735, 0x740, 0x746, 0x74c, 0x752, 0x758, 0x761, 0x764, 0x767, 0x76b, 0x76f, 0x773, 0x779, 0x77f, 0x784, 0x787, 0x797, 0x79e, 0x7a1, 0x7a6, 0x7aa, 0x7b0, 0x7b5, 0x7b9, 0x7bf, 0x7c5, 0x7c9, 0x7d2, 0x7d7, 0x7da, 0x7dd, 0x7e1, 0x7e5, 0x7e8, 0x7f8, 0x809, 0x80e, 0x810, 0x812} + +// idnaSparseValues: 2069 entries, 8276 bytes +var idnaSparseValues = [2069]valueRange{ + // Block 0x0, offset 0x0 + {value: 0x0000, lo: 0x07}, + {value: 0xe105, lo: 0x80, hi: 0x96}, + {value: 0x0018, lo: 0x97, hi: 0x97}, + {value: 0xe105, lo: 0x98, hi: 0x9e}, + {value: 0x001f, lo: 0x9f, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xb6}, + {value: 0x0018, lo: 0xb7, hi: 0xb7}, + {value: 0x0008, lo: 0xb8, hi: 0xbf}, + // Block 0x1, offset 0x8 + {value: 0x0000, lo: 0x10}, + {value: 0x0008, lo: 0x80, hi: 0x80}, + {value: 0xe01d, lo: 0x81, hi: 0x81}, + {value: 0x0008, lo: 0x82, hi: 0x82}, + {value: 0x0335, lo: 0x83, hi: 0x83}, + {value: 0x034d, lo: 0x84, hi: 0x84}, + {value: 0x0365, lo: 0x85, hi: 0x85}, + {value: 0xe00d, lo: 0x86, hi: 0x86}, + {value: 0x0008, lo: 0x87, hi: 0x87}, + {value: 0xe00d, lo: 0x88, hi: 0x88}, + {value: 0x0008, lo: 0x89, hi: 0x89}, + {value: 0xe00d, lo: 0x8a, hi: 0x8a}, + {value: 0x0008, lo: 0x8b, hi: 0x8b}, + {value: 0xe00d, lo: 0x8c, hi: 0x8c}, + {value: 0x0008, lo: 0x8d, hi: 0x8d}, + {value: 0xe00d, lo: 0x8e, hi: 0x8e}, + {value: 0x0008, lo: 0x8f, hi: 0xbf}, + // Block 0x2, offset 0x19 + {value: 0x0000, lo: 0x0b}, + {value: 0x0008, lo: 0x80, hi: 0xaf}, + {value: 0x0249, lo: 0xb0, hi: 0xb0}, + {value: 0x037d, lo: 0xb1, hi: 0xb1}, + {value: 0x0259, lo: 0xb2, hi: 0xb2}, + {value: 0x0269, lo: 0xb3, hi: 0xb3}, + {value: 0x034d, lo: 0xb4, hi: 0xb4}, + {value: 0x0395, lo: 0xb5, hi: 0xb5}, + {value: 0xe1bd, lo: 0xb6, hi: 0xb6}, + {value: 0x0279, lo: 0xb7, hi: 0xb7}, + {value: 0x0289, lo: 0xb8, hi: 0xb8}, + {value: 0x0008, lo: 0xb9, hi: 0xbf}, + // Block 0x3, offset 0x25 + {value: 0x0000, lo: 0x01}, + {value: 0x3308, lo: 0x80, hi: 0xbf}, + // Block 0x4, offset 0x27 + {value: 0x0000, lo: 0x04}, + {value: 0x03f5, lo: 0x80, hi: 0x8f}, + {value: 0xe105, lo: 0x90, hi: 0x9f}, + {value: 0x049d, lo: 0xa0, hi: 0xaf}, + {value: 0x0008, lo: 0xb0, hi: 0xbf}, + // Block 0x5, offset 0x2c + {value: 0x0000, lo: 0x06}, + {value: 0xe185, lo: 0x80, hi: 0x8f}, + {value: 0x0545, lo: 0x90, hi: 0x96}, + {value: 0x0040, lo: 0x97, hi: 0x98}, + {value: 0x0008, lo: 0x99, hi: 0x99}, + {value: 0x0018, lo: 0x9a, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xbf}, + // Block 0x6, offset 0x33 + {value: 0x0000, lo: 0x0a}, + {value: 0x0008, lo: 0x80, hi: 0x86}, + {value: 0x0401, lo: 0x87, hi: 0x87}, + {value: 0x0008, lo: 0x88, hi: 0x88}, + {value: 0x0018, lo: 0x89, hi: 0x8a}, + {value: 0x0040, lo: 0x8b, hi: 0x8c}, + {value: 0x0018, lo: 0x8d, hi: 0x8f}, + {value: 0x0040, lo: 0x90, hi: 0x90}, + {value: 0x3308, lo: 0x91, hi: 0xbd}, + {value: 0x0818, lo: 0xbe, hi: 0xbe}, + {value: 0x3308, lo: 0xbf, hi: 0xbf}, + // Block 0x7, offset 0x3e + {value: 0x0000, lo: 0x0b}, + {value: 0x0818, lo: 0x80, hi: 0x80}, + {value: 0x3308, lo: 0x81, hi: 0x82}, + {value: 0x0818, lo: 0x83, hi: 0x83}, + {value: 0x3308, lo: 0x84, hi: 0x85}, + {value: 0x0818, lo: 0x86, hi: 0x86}, + {value: 0x3308, lo: 0x87, hi: 0x87}, + {value: 0x0040, lo: 0x88, hi: 0x8f}, + {value: 0x0808, lo: 0x90, hi: 0xaa}, + {value: 0x0040, lo: 0xab, hi: 0xae}, + {value: 0x0808, lo: 0xaf, hi: 0xb4}, + {value: 0x0040, lo: 0xb5, hi: 0xbf}, + // Block 0x8, offset 0x4a + {value: 0x0000, lo: 0x03}, + {value: 0x0a08, lo: 0x80, hi: 0x87}, + {value: 0x0c08, lo: 0x88, hi: 0x99}, + {value: 0x0a08, lo: 0x9a, hi: 0xbf}, + // Block 0x9, offset 0x4e + {value: 0x0000, lo: 0x0e}, + {value: 0x3308, lo: 0x80, hi: 0x8a}, + {value: 0x0040, lo: 0x8b, hi: 0x8c}, + {value: 0x0c08, lo: 0x8d, hi: 0x8d}, + {value: 0x0a08, lo: 0x8e, hi: 0x98}, + {value: 0x0c08, lo: 0x99, hi: 0x9b}, + {value: 0x0a08, lo: 0x9c, hi: 0xaa}, + {value: 0x0c08, lo: 0xab, hi: 0xac}, + {value: 0x0a08, lo: 0xad, hi: 0xb0}, + {value: 0x0c08, lo: 0xb1, hi: 0xb1}, + {value: 0x0a08, lo: 0xb2, hi: 0xb2}, + {value: 0x0c08, lo: 0xb3, hi: 0xb4}, + {value: 0x0a08, lo: 0xb5, hi: 0xb7}, + {value: 0x0c08, lo: 0xb8, hi: 0xb9}, + {value: 0x0a08, lo: 0xba, hi: 0xbf}, + // Block 0xa, offset 0x5d + {value: 0x0000, lo: 0x04}, + {value: 0x0808, lo: 0x80, hi: 0xa5}, + {value: 0x3308, lo: 0xa6, hi: 0xb0}, + {value: 0x0808, lo: 0xb1, hi: 0xb1}, + {value: 0x0040, lo: 0xb2, hi: 0xbf}, + // Block 0xb, offset 0x62 + {value: 0x0000, lo: 0x09}, + {value: 0x0808, lo: 0x80, hi: 0x89}, + {value: 0x0a08, lo: 0x8a, hi: 0xaa}, + {value: 0x3308, lo: 0xab, hi: 0xb3}, + {value: 0x0808, lo: 0xb4, hi: 0xb5}, + {value: 0x0018, lo: 0xb6, hi: 0xb9}, + {value: 0x0818, lo: 0xba, hi: 0xba}, + {value: 0x0040, lo: 0xbb, hi: 0xbc}, + {value: 0x3308, lo: 0xbd, hi: 0xbd}, + {value: 0x0818, lo: 0xbe, hi: 0xbf}, + // Block 0xc, offset 0x6c + {value: 0x0000, lo: 0x0b}, + {value: 0x0808, lo: 0x80, hi: 0x95}, + {value: 0x3308, lo: 0x96, hi: 0x99}, + {value: 0x0808, lo: 0x9a, hi: 0x9a}, + {value: 0x3308, lo: 0x9b, hi: 0xa3}, + {value: 0x0808, lo: 0xa4, hi: 0xa4}, + {value: 0x3308, lo: 0xa5, hi: 0xa7}, + {value: 0x0808, lo: 0xa8, hi: 0xa8}, + {value: 0x3308, lo: 0xa9, hi: 0xad}, + {value: 0x0040, lo: 0xae, hi: 0xaf}, + {value: 0x0818, lo: 0xb0, hi: 0xbe}, + {value: 0x0040, lo: 0xbf, hi: 0xbf}, + // Block 0xd, offset 0x78 + {value: 0x0000, lo: 0x0d}, + {value: 0x0040, lo: 0x80, hi: 0x9f}, + {value: 0x0a08, lo: 0xa0, hi: 0xa9}, + {value: 0x0c08, lo: 0xaa, hi: 0xac}, + {value: 0x0808, lo: 0xad, hi: 0xad}, + {value: 0x0c08, lo: 0xae, hi: 0xae}, + {value: 0x0a08, lo: 0xaf, hi: 0xb0}, + {value: 0x0c08, lo: 0xb1, hi: 0xb2}, + {value: 0x0a08, lo: 0xb3, hi: 0xb4}, + {value: 0x0040, lo: 0xb5, hi: 0xb5}, + {value: 0x0a08, lo: 0xb6, hi: 0xb8}, + {value: 0x0c08, lo: 0xb9, hi: 0xb9}, + {value: 0x0a08, lo: 0xba, hi: 0xbd}, + {value: 0x0040, lo: 0xbe, hi: 0xbf}, + // Block 0xe, offset 0x86 + {value: 0x0000, lo: 0x04}, + {value: 0x0040, lo: 0x80, hi: 0x92}, + {value: 0x3308, lo: 0x93, hi: 0xa1}, + {value: 0x0840, lo: 0xa2, hi: 0xa2}, + {value: 0x3308, lo: 0xa3, hi: 0xbf}, + // Block 0xf, offset 0x8b + {value: 0x0000, lo: 0x08}, + {value: 0x3308, lo: 0x80, hi: 0x82}, + {value: 0x3008, lo: 0x83, hi: 0x83}, + {value: 0x0008, lo: 0x84, hi: 0xb9}, + {value: 0x3308, lo: 0xba, hi: 0xba}, + {value: 0x3008, lo: 0xbb, hi: 0xbb}, + {value: 0x3308, lo: 0xbc, hi: 0xbc}, + {value: 0x0008, lo: 0xbd, hi: 0xbd}, + {value: 0x3008, lo: 0xbe, hi: 0xbf}, + // Block 0x10, offset 0x94 + {value: 0x0000, lo: 0x0f}, + {value: 0x3308, lo: 0x80, hi: 0x80}, + {value: 0x3008, lo: 0x81, hi: 0x82}, + {value: 0x0040, lo: 0x83, hi: 0x85}, + {value: 0x3008, lo: 0x86, hi: 0x88}, + {value: 0x0040, lo: 0x89, hi: 0x89}, + {value: 0x3008, lo: 0x8a, hi: 0x8c}, + {value: 0x3b08, lo: 0x8d, hi: 0x8d}, + {value: 0x0040, lo: 0x8e, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0x90}, + {value: 0x0040, lo: 0x91, hi: 0x96}, + {value: 0x3008, lo: 0x97, hi: 0x97}, + {value: 0x0040, lo: 0x98, hi: 0xa5}, + {value: 0x0008, lo: 0xa6, hi: 0xaf}, + {value: 0x0018, lo: 0xb0, hi: 0xba}, + {value: 0x0040, lo: 0xbb, hi: 0xbf}, + // Block 0x11, offset 0xa4 + {value: 0x0000, lo: 0x0d}, + {value: 0x3308, lo: 0x80, hi: 0x80}, + {value: 0x3008, lo: 0x81, hi: 0x83}, + {value: 0x3308, lo: 0x84, hi: 0x84}, + {value: 0x0008, lo: 0x85, hi: 0x8c}, + {value: 0x0040, lo: 0x8d, hi: 0x8d}, + {value: 0x0008, lo: 0x8e, hi: 0x90}, + {value: 0x0040, lo: 0x91, hi: 0x91}, + {value: 0x0008, lo: 0x92, hi: 0xa8}, + {value: 0x0040, lo: 0xa9, hi: 0xa9}, + {value: 0x0008, lo: 0xaa, hi: 0xb9}, + {value: 0x0040, lo: 0xba, hi: 0xbc}, + {value: 0x0008, lo: 0xbd, hi: 0xbd}, + {value: 0x3308, lo: 0xbe, hi: 0xbf}, + // Block 0x12, offset 0xb2 + {value: 0x0000, lo: 0x0b}, + {value: 0x3308, lo: 0x80, hi: 0x81}, + {value: 0x3008, lo: 0x82, hi: 0x83}, + {value: 0x0040, lo: 0x84, hi: 0x84}, + {value: 0x0008, lo: 0x85, hi: 0x8c}, + {value: 0x0040, lo: 0x8d, hi: 0x8d}, + {value: 0x0008, lo: 0x8e, hi: 0x90}, + {value: 0x0040, lo: 0x91, hi: 0x91}, + {value: 0x0008, lo: 0x92, hi: 0xba}, + {value: 0x3b08, lo: 0xbb, hi: 0xbc}, + {value: 0x0008, lo: 0xbd, hi: 0xbd}, + {value: 0x3008, lo: 0xbe, hi: 0xbf}, + // Block 0x13, offset 0xbe + {value: 0x0000, lo: 0x0b}, + {value: 0x0040, lo: 0x80, hi: 0x81}, + {value: 0x3008, lo: 0x82, hi: 0x83}, + {value: 0x0040, lo: 0x84, hi: 0x84}, + {value: 0x0008, lo: 0x85, hi: 0x96}, + {value: 0x0040, lo: 0x97, hi: 0x99}, + {value: 0x0008, lo: 0x9a, hi: 0xb1}, + {value: 0x0040, lo: 0xb2, hi: 0xb2}, + {value: 0x0008, lo: 0xb3, hi: 0xbb}, + {value: 0x0040, lo: 0xbc, hi: 0xbc}, + {value: 0x0008, lo: 0xbd, hi: 0xbd}, + {value: 0x0040, lo: 0xbe, hi: 0xbf}, + // Block 0x14, offset 0xca + {value: 0x0000, lo: 0x10}, + {value: 0x0008, lo: 0x80, hi: 0x86}, + {value: 0x0040, lo: 0x87, hi: 0x89}, + {value: 0x3b08, lo: 0x8a, hi: 0x8a}, + {value: 0x0040, lo: 0x8b, hi: 0x8e}, + {value: 0x3008, lo: 0x8f, hi: 0x91}, + {value: 0x3308, lo: 0x92, hi: 0x94}, + {value: 0x0040, lo: 0x95, hi: 0x95}, + {value: 0x3308, lo: 0x96, hi: 0x96}, + {value: 0x0040, lo: 0x97, hi: 0x97}, + {value: 0x3008, lo: 0x98, hi: 0x9f}, + {value: 0x0040, lo: 0xa0, hi: 0xa5}, + {value: 0x0008, lo: 0xa6, hi: 0xaf}, + {value: 0x0040, lo: 0xb0, hi: 0xb1}, + {value: 0x3008, lo: 0xb2, hi: 0xb3}, + {value: 0x0018, lo: 0xb4, hi: 0xb4}, + {value: 0x0040, lo: 0xb5, hi: 0xbf}, + // Block 0x15, offset 0xdb + {value: 0x0000, lo: 0x09}, + {value: 0x0040, lo: 0x80, hi: 0x80}, + {value: 0x0008, lo: 0x81, hi: 0xb0}, + {value: 0x3308, lo: 0xb1, hi: 0xb1}, + {value: 0x0008, lo: 0xb2, hi: 0xb2}, + {value: 0x08f1, lo: 0xb3, hi: 0xb3}, + {value: 0x3308, lo: 0xb4, hi: 0xb9}, + {value: 0x3b08, lo: 0xba, hi: 0xba}, + {value: 0x0040, lo: 0xbb, hi: 0xbe}, + {value: 0x0018, lo: 0xbf, hi: 0xbf}, + // Block 0x16, offset 0xe5 + {value: 0x0000, lo: 0x06}, + {value: 0x0008, lo: 0x80, hi: 0x86}, + {value: 0x3308, lo: 0x87, hi: 0x8e}, + {value: 0x0018, lo: 0x8f, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0x99}, + {value: 0x0018, lo: 0x9a, hi: 0x9b}, + {value: 0x0040, lo: 0x9c, hi: 0xbf}, + // Block 0x17, offset 0xec + {value: 0x0000, lo: 0x0c}, + {value: 0x0008, lo: 0x80, hi: 0x84}, + {value: 0x0040, lo: 0x85, hi: 0x85}, + {value: 0x0008, lo: 0x86, hi: 0x86}, + {value: 0x0040, lo: 0x87, hi: 0x87}, + {value: 0x3308, lo: 0x88, hi: 0x8d}, + {value: 0x0040, lo: 0x8e, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0x99}, + {value: 0x0040, lo: 0x9a, hi: 0x9b}, + {value: 0x0961, lo: 0x9c, hi: 0x9c}, + {value: 0x0999, lo: 0x9d, hi: 0x9d}, + {value: 0x0008, lo: 0x9e, hi: 0x9f}, + {value: 0x0040, lo: 0xa0, hi: 0xbf}, + // Block 0x18, offset 0xf9 + {value: 0x0000, lo: 0x10}, + {value: 0x0008, lo: 0x80, hi: 0x80}, + {value: 0x0018, lo: 0x81, hi: 0x8a}, + {value: 0x0008, lo: 0x8b, hi: 0x8b}, + {value: 0xe03d, lo: 0x8c, hi: 0x8c}, + {value: 0x0018, lo: 0x8d, hi: 0x97}, + {value: 0x3308, lo: 0x98, hi: 0x99}, + {value: 0x0018, lo: 0x9a, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xa9}, + {value: 0x0018, lo: 0xaa, hi: 0xb4}, + {value: 0x3308, lo: 0xb5, hi: 0xb5}, + {value: 0x0018, lo: 0xb6, hi: 0xb6}, + {value: 0x3308, lo: 0xb7, hi: 0xb7}, + {value: 0x0018, lo: 0xb8, hi: 0xb8}, + {value: 0x3308, lo: 0xb9, hi: 0xb9}, + {value: 0x0018, lo: 0xba, hi: 0xbd}, + {value: 0x3008, lo: 0xbe, hi: 0xbf}, + // Block 0x19, offset 0x10a + {value: 0x0000, lo: 0x06}, + {value: 0x0018, lo: 0x80, hi: 0x85}, + {value: 0x3308, lo: 0x86, hi: 0x86}, + {value: 0x0018, lo: 0x87, hi: 0x8c}, + {value: 0x0040, lo: 0x8d, hi: 0x8d}, + {value: 0x0018, lo: 0x8e, hi: 0x9a}, + {value: 0x0040, lo: 0x9b, hi: 0xbf}, + // Block 0x1a, offset 0x111 + {value: 0x0000, lo: 0x0a}, + {value: 0x0008, lo: 0x80, hi: 0xaa}, + {value: 0x3008, lo: 0xab, hi: 0xac}, + {value: 0x3308, lo: 0xad, hi: 0xb0}, + {value: 0x3008, lo: 0xb1, hi: 0xb1}, + {value: 0x3308, lo: 0xb2, hi: 0xb7}, + {value: 0x3008, lo: 0xb8, hi: 0xb8}, + {value: 0x3b08, lo: 0xb9, hi: 0xba}, + {value: 0x3008, lo: 0xbb, hi: 0xbc}, + {value: 0x3308, lo: 0xbd, hi: 0xbe}, + {value: 0x0008, lo: 0xbf, hi: 0xbf}, + // Block 0x1b, offset 0x11c + {value: 0x0000, lo: 0x0e}, + {value: 0x0008, lo: 0x80, hi: 0x89}, + {value: 0x0018, lo: 0x8a, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0x95}, + {value: 0x3008, lo: 0x96, hi: 0x97}, + {value: 0x3308, lo: 0x98, hi: 0x99}, + {value: 0x0008, lo: 0x9a, hi: 0x9d}, + {value: 0x3308, lo: 0x9e, hi: 0xa0}, + {value: 0x0008, lo: 0xa1, hi: 0xa1}, + {value: 0x3008, lo: 0xa2, hi: 0xa4}, + {value: 0x0008, lo: 0xa5, hi: 0xa6}, + {value: 0x3008, lo: 0xa7, hi: 0xad}, + {value: 0x0008, lo: 0xae, hi: 0xb0}, + {value: 0x3308, lo: 0xb1, hi: 0xb4}, + {value: 0x0008, lo: 0xb5, hi: 0xbf}, + // Block 0x1c, offset 0x12b + {value: 0x0000, lo: 0x0d}, + {value: 0x0008, lo: 0x80, hi: 0x81}, + {value: 0x3308, lo: 0x82, hi: 0x82}, + {value: 0x3008, lo: 0x83, hi: 0x84}, + {value: 0x3308, lo: 0x85, hi: 0x86}, + {value: 0x3008, lo: 0x87, hi: 0x8c}, + {value: 0x3308, lo: 0x8d, hi: 0x8d}, + {value: 0x0008, lo: 0x8e, hi: 0x8e}, + {value: 0x3008, lo: 0x8f, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0x99}, + {value: 0x3008, lo: 0x9a, hi: 0x9c}, + {value: 0x3308, lo: 0x9d, hi: 0x9d}, + {value: 0x0018, lo: 0x9e, hi: 0x9f}, + {value: 0x0040, lo: 0xa0, hi: 0xbf}, + // Block 0x1d, offset 0x139 + {value: 0x0000, lo: 0x09}, + {value: 0x0040, lo: 0x80, hi: 0x86}, + {value: 0x055d, lo: 0x87, hi: 0x87}, + {value: 0x0040, lo: 0x88, hi: 0x8c}, + {value: 0x055d, lo: 0x8d, hi: 0x8d}, + {value: 0x0040, lo: 0x8e, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0xba}, + {value: 0x0018, lo: 0xbb, hi: 0xbb}, + {value: 0xe105, lo: 0xbc, hi: 0xbc}, + {value: 0x0008, lo: 0xbd, hi: 0xbf}, + // Block 0x1e, offset 0x143 + {value: 0x0000, lo: 0x01}, + {value: 0x0018, lo: 0x80, hi: 0xbf}, + // Block 0x1f, offset 0x145 + {value: 0x0000, lo: 0x04}, + {value: 0x0018, lo: 0x80, hi: 0x9e}, + {value: 0x0040, lo: 0x9f, hi: 0xa0}, + {value: 0x2018, lo: 0xa1, hi: 0xb5}, + {value: 0x0018, lo: 0xb6, hi: 0xbf}, + // Block 0x20, offset 0x14a + {value: 0x0000, lo: 0x02}, + {value: 0x0018, lo: 0x80, hi: 0xa7}, + {value: 0x2018, lo: 0xa8, hi: 0xbf}, + // Block 0x21, offset 0x14d + {value: 0x0000, lo: 0x02}, + {value: 0x2018, lo: 0x80, hi: 0x82}, + {value: 0x0018, lo: 0x83, hi: 0xbf}, + // Block 0x22, offset 0x150 + {value: 0x0000, lo: 0x01}, + {value: 0x0008, lo: 0x80, hi: 0xbf}, + // Block 0x23, offset 0x152 + {value: 0x0000, lo: 0x0b}, + {value: 0x0008, lo: 0x80, hi: 0x88}, + {value: 0x0040, lo: 0x89, hi: 0x89}, + {value: 0x0008, lo: 0x8a, hi: 0x8d}, + {value: 0x0040, lo: 0x8e, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0x96}, + {value: 0x0040, lo: 0x97, hi: 0x97}, + {value: 0x0008, lo: 0x98, hi: 0x98}, + {value: 0x0040, lo: 0x99, hi: 0x99}, + {value: 0x0008, lo: 0x9a, hi: 0x9d}, + {value: 0x0040, lo: 0x9e, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xbf}, + // Block 0x24, offset 0x15e + {value: 0x0000, lo: 0x0a}, + {value: 0x0008, lo: 0x80, hi: 0x88}, + {value: 0x0040, lo: 0x89, hi: 0x89}, + {value: 0x0008, lo: 0x8a, hi: 0x8d}, + {value: 0x0040, lo: 0x8e, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0xb0}, + {value: 0x0040, lo: 0xb1, hi: 0xb1}, + {value: 0x0008, lo: 0xb2, hi: 0xb5}, + {value: 0x0040, lo: 0xb6, hi: 0xb7}, + {value: 0x0008, lo: 0xb8, hi: 0xbe}, + {value: 0x0040, lo: 0xbf, hi: 0xbf}, + // Block 0x25, offset 0x169 + {value: 0x0000, lo: 0x07}, + {value: 0x0008, lo: 0x80, hi: 0x80}, + {value: 0x0040, lo: 0x81, hi: 0x81}, + {value: 0x0008, lo: 0x82, hi: 0x85}, + {value: 0x0040, lo: 0x86, hi: 0x87}, + {value: 0x0008, lo: 0x88, hi: 0x96}, + {value: 0x0040, lo: 0x97, hi: 0x97}, + {value: 0x0008, lo: 0x98, hi: 0xbf}, + // Block 0x26, offset 0x171 + {value: 0x0000, lo: 0x05}, + {value: 0x0008, lo: 0x80, hi: 0x90}, + {value: 0x0040, lo: 0x91, hi: 0x91}, + {value: 0x0008, lo: 0x92, hi: 0x95}, + {value: 0x0040, lo: 0x96, hi: 0x97}, + {value: 0x0008, lo: 0x98, hi: 0xbf}, + // Block 0x27, offset 0x177 + {value: 0x0000, lo: 0x05}, + {value: 0x0008, lo: 0x80, hi: 0x9a}, + {value: 0x0040, lo: 0x9b, hi: 0x9c}, + {value: 0x3308, lo: 0x9d, hi: 0x9f}, + {value: 0x0018, lo: 0xa0, hi: 0xbc}, + {value: 0x0040, lo: 0xbd, hi: 0xbf}, + // Block 0x28, offset 0x17d + {value: 0x0000, lo: 0x04}, + {value: 0x0008, lo: 0x80, hi: 0x8f}, + {value: 0x0018, lo: 0x90, hi: 0x99}, + {value: 0x0040, lo: 0x9a, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xbf}, + // Block 0x29, offset 0x182 + {value: 0x0000, lo: 0x04}, + {value: 0x0008, lo: 0x80, hi: 0xb5}, + {value: 0x0040, lo: 0xb6, hi: 0xb7}, + {value: 0xe045, lo: 0xb8, hi: 0xbd}, + {value: 0x0040, lo: 0xbe, hi: 0xbf}, + // Block 0x2a, offset 0x187 + {value: 0x0000, lo: 0x02}, + {value: 0x0018, lo: 0x80, hi: 0x80}, + {value: 0x0008, lo: 0x81, hi: 0xbf}, + // Block 0x2b, offset 0x18a + {value: 0x0000, lo: 0x03}, + {value: 0x0008, lo: 0x80, hi: 0xac}, + {value: 0x0018, lo: 0xad, hi: 0xae}, + {value: 0x0008, lo: 0xaf, hi: 0xbf}, + // Block 0x2c, offset 0x18e + {value: 0x0000, lo: 0x05}, + {value: 0x0040, lo: 0x80, hi: 0x80}, + {value: 0x0008, lo: 0x81, hi: 0x9a}, + {value: 0x0018, lo: 0x9b, hi: 0x9c}, + {value: 0x0040, lo: 0x9d, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xbf}, + // Block 0x2d, offset 0x194 + {value: 0x0000, lo: 0x04}, + {value: 0x0008, lo: 0x80, hi: 0xaa}, + {value: 0x0018, lo: 0xab, hi: 0xb0}, + {value: 0x0008, lo: 0xb1, hi: 0xb8}, + {value: 0x0040, lo: 0xb9, hi: 0xbf}, + // Block 0x2e, offset 0x199 + {value: 0x0000, lo: 0x0b}, + {value: 0x0008, lo: 0x80, hi: 0x8c}, + {value: 0x0040, lo: 0x8d, hi: 0x8d}, + {value: 0x0008, lo: 0x8e, hi: 0x91}, + {value: 0x3308, lo: 0x92, hi: 0x93}, + {value: 0x3b08, lo: 0x94, hi: 0x94}, + {value: 0x0040, lo: 0x95, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xb1}, + {value: 0x3308, lo: 0xb2, hi: 0xb3}, + {value: 0x3b08, lo: 0xb4, hi: 0xb4}, + {value: 0x0018, lo: 0xb5, hi: 0xb6}, + {value: 0x0040, lo: 0xb7, hi: 0xbf}, + // Block 0x2f, offset 0x1a5 + {value: 0x0000, lo: 0x09}, + {value: 0x0008, lo: 0x80, hi: 0x91}, + {value: 0x3308, lo: 0x92, hi: 0x93}, + {value: 0x0040, lo: 0x94, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xac}, + {value: 0x0040, lo: 0xad, hi: 0xad}, + {value: 0x0008, lo: 0xae, hi: 0xb0}, + {value: 0x0040, lo: 0xb1, hi: 0xb1}, + {value: 0x3308, lo: 0xb2, hi: 0xb3}, + {value: 0x0040, lo: 0xb4, hi: 0xbf}, + // Block 0x30, offset 0x1af + {value: 0x0000, lo: 0x05}, + {value: 0x0008, lo: 0x80, hi: 0xb3}, + {value: 0x3340, lo: 0xb4, hi: 0xb5}, + {value: 0x3008, lo: 0xb6, hi: 0xb6}, + {value: 0x3308, lo: 0xb7, hi: 0xbd}, + {value: 0x3008, lo: 0xbe, hi: 0xbf}, + // Block 0x31, offset 0x1b5 + {value: 0x0000, lo: 0x10}, + {value: 0x3008, lo: 0x80, hi: 0x85}, + {value: 0x3308, lo: 0x86, hi: 0x86}, + {value: 0x3008, lo: 0x87, hi: 0x88}, + {value: 0x3308, lo: 0x89, hi: 0x91}, + {value: 0x3b08, lo: 0x92, hi: 0x92}, + {value: 0x3308, lo: 0x93, hi: 0x93}, + {value: 0x0018, lo: 0x94, hi: 0x96}, + {value: 0x0008, lo: 0x97, hi: 0x97}, + {value: 0x0018, lo: 0x98, hi: 0x9b}, + {value: 0x0008, lo: 0x9c, hi: 0x9c}, + {value: 0x3308, lo: 0x9d, hi: 0x9d}, + {value: 0x0040, lo: 0x9e, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xa9}, + {value: 0x0040, lo: 0xaa, hi: 0xaf}, + {value: 0x0018, lo: 0xb0, hi: 0xb9}, + {value: 0x0040, lo: 0xba, hi: 0xbf}, + // Block 0x32, offset 0x1c6 + {value: 0x0000, lo: 0x09}, + {value: 0x0018, lo: 0x80, hi: 0x85}, + {value: 0x0040, lo: 0x86, hi: 0x86}, + {value: 0x0218, lo: 0x87, hi: 0x87}, + {value: 0x0018, lo: 0x88, hi: 0x8a}, + {value: 0x33c0, lo: 0x8b, hi: 0x8d}, + {value: 0x0040, lo: 0x8e, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0x99}, + {value: 0x0040, lo: 0x9a, hi: 0x9f}, + {value: 0x0208, lo: 0xa0, hi: 0xbf}, + // Block 0x33, offset 0x1d0 + {value: 0x0000, lo: 0x02}, + {value: 0x0208, lo: 0x80, hi: 0xb8}, + {value: 0x0040, lo: 0xb9, hi: 0xbf}, + // Block 0x34, offset 0x1d3 + {value: 0x0000, lo: 0x07}, + {value: 0x0008, lo: 0x80, hi: 0x84}, + {value: 0x3308, lo: 0x85, hi: 0x86}, + {value: 0x0208, lo: 0x87, hi: 0xa8}, + {value: 0x3308, lo: 0xa9, hi: 0xa9}, + {value: 0x0208, lo: 0xaa, hi: 0xaa}, + {value: 0x0040, lo: 0xab, hi: 0xaf}, + {value: 0x0008, lo: 0xb0, hi: 0xbf}, + // Block 0x35, offset 0x1db + {value: 0x0000, lo: 0x02}, + {value: 0x0008, lo: 0x80, hi: 0xb5}, + {value: 0x0040, lo: 0xb6, hi: 0xbf}, + // Block 0x36, offset 0x1de + {value: 0x0000, lo: 0x0c}, + {value: 0x0008, lo: 0x80, hi: 0x9e}, + {value: 0x0040, lo: 0x9f, hi: 0x9f}, + {value: 0x3308, lo: 0xa0, hi: 0xa2}, + {value: 0x3008, lo: 0xa3, hi: 0xa6}, + {value: 0x3308, lo: 0xa7, hi: 0xa8}, + {value: 0x3008, lo: 0xa9, hi: 0xab}, + {value: 0x0040, lo: 0xac, hi: 0xaf}, + {value: 0x3008, lo: 0xb0, hi: 0xb1}, + {value: 0x3308, lo: 0xb2, hi: 0xb2}, + {value: 0x3008, lo: 0xb3, hi: 0xb8}, + {value: 0x3308, lo: 0xb9, hi: 0xbb}, + {value: 0x0040, lo: 0xbc, hi: 0xbf}, + // Block 0x37, offset 0x1eb + {value: 0x0000, lo: 0x07}, + {value: 0x0018, lo: 0x80, hi: 0x80}, + {value: 0x0040, lo: 0x81, hi: 0x83}, + {value: 0x0018, lo: 0x84, hi: 0x85}, + {value: 0x0008, lo: 0x86, hi: 0xad}, + {value: 0x0040, lo: 0xae, hi: 0xaf}, + {value: 0x0008, lo: 0xb0, hi: 0xb4}, + {value: 0x0040, lo: 0xb5, hi: 0xbf}, + // Block 0x38, offset 0x1f3 + {value: 0x0000, lo: 0x03}, + {value: 0x0008, lo: 0x80, hi: 0xab}, + {value: 0x0040, lo: 0xac, hi: 0xaf}, + {value: 0x0008, lo: 0xb0, hi: 0xbf}, + // Block 0x39, offset 0x1f7 + {value: 0x0000, lo: 0x06}, + {value: 0x0008, lo: 0x80, hi: 0x89}, + {value: 0x0040, lo: 0x8a, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0x99}, + {value: 0x0028, lo: 0x9a, hi: 0x9a}, + {value: 0x0040, lo: 0x9b, hi: 0x9d}, + {value: 0x0018, lo: 0x9e, hi: 0xbf}, + // Block 0x3a, offset 0x1fe + {value: 0x0000, lo: 0x07}, + {value: 0x0008, lo: 0x80, hi: 0x96}, + {value: 0x3308, lo: 0x97, hi: 0x98}, + {value: 0x3008, lo: 0x99, hi: 0x9a}, + {value: 0x3308, lo: 0x9b, hi: 0x9b}, + {value: 0x0040, lo: 0x9c, hi: 0x9d}, + {value: 0x0018, lo: 0x9e, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xbf}, + // Block 0x3b, offset 0x206 + {value: 0x0000, lo: 0x0f}, + {value: 0x0008, lo: 0x80, hi: 0x94}, + {value: 0x3008, lo: 0x95, hi: 0x95}, + {value: 0x3308, lo: 0x96, hi: 0x96}, + {value: 0x3008, lo: 0x97, hi: 0x97}, + {value: 0x3308, lo: 0x98, hi: 0x9e}, + {value: 0x0040, lo: 0x9f, hi: 0x9f}, + {value: 0x3b08, lo: 0xa0, hi: 0xa0}, + {value: 0x3008, lo: 0xa1, hi: 0xa1}, + {value: 0x3308, lo: 0xa2, hi: 0xa2}, + {value: 0x3008, lo: 0xa3, hi: 0xa4}, + {value: 0x3308, lo: 0xa5, hi: 0xac}, + {value: 0x3008, lo: 0xad, hi: 0xb2}, + {value: 0x3308, lo: 0xb3, hi: 0xbc}, + {value: 0x0040, lo: 0xbd, hi: 0xbe}, + {value: 0x3308, lo: 0xbf, hi: 0xbf}, + // Block 0x3c, offset 0x216 + {value: 0x0000, lo: 0x0b}, + {value: 0x0008, lo: 0x80, hi: 0x89}, + {value: 0x0040, lo: 0x8a, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0x99}, + {value: 0x0040, lo: 0x9a, hi: 0x9f}, + {value: 0x0018, lo: 0xa0, hi: 0xa6}, + {value: 0x0008, lo: 0xa7, hi: 0xa7}, + {value: 0x0018, lo: 0xa8, hi: 0xad}, + {value: 0x0040, lo: 0xae, hi: 0xaf}, + {value: 0x3308, lo: 0xb0, hi: 0xbd}, + {value: 0x3318, lo: 0xbe, hi: 0xbe}, + {value: 0x0040, lo: 0xbf, hi: 0xbf}, + // Block 0x3d, offset 0x222 + {value: 0x0000, lo: 0x01}, + {value: 0x0040, lo: 0x80, hi: 0xbf}, + // Block 0x3e, offset 0x224 + {value: 0x0000, lo: 0x09}, + {value: 0x3308, lo: 0x80, hi: 0x83}, + {value: 0x3008, lo: 0x84, hi: 0x84}, + {value: 0x0008, lo: 0x85, hi: 0xb3}, + {value: 0x3308, lo: 0xb4, hi: 0xb4}, + {value: 0x3008, lo: 0xb5, hi: 0xb5}, + {value: 0x3308, lo: 0xb6, hi: 0xba}, + {value: 0x3008, lo: 0xbb, hi: 0xbb}, + {value: 0x3308, lo: 0xbc, hi: 0xbc}, + {value: 0x3008, lo: 0xbd, hi: 0xbf}, + // Block 0x3f, offset 0x22e + {value: 0x0000, lo: 0x0b}, + {value: 0x3008, lo: 0x80, hi: 0x81}, + {value: 0x3308, lo: 0x82, hi: 0x82}, + {value: 0x3008, lo: 0x83, hi: 0x83}, + {value: 0x3808, lo: 0x84, hi: 0x84}, + {value: 0x0008, lo: 0x85, hi: 0x8b}, + {value: 0x0040, lo: 0x8c, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0x99}, + {value: 0x0018, lo: 0x9a, hi: 0xaa}, + {value: 0x3308, lo: 0xab, hi: 0xb3}, + {value: 0x0018, lo: 0xb4, hi: 0xbc}, + {value: 0x0040, lo: 0xbd, hi: 0xbf}, + // Block 0x40, offset 0x23a + {value: 0x0000, lo: 0x0b}, + {value: 0x3308, lo: 0x80, hi: 0x81}, + {value: 0x3008, lo: 0x82, hi: 0x82}, + {value: 0x0008, lo: 0x83, hi: 0xa0}, + {value: 0x3008, lo: 0xa1, hi: 0xa1}, + {value: 0x3308, lo: 0xa2, hi: 0xa5}, + {value: 0x3008, lo: 0xa6, hi: 0xa7}, + {value: 0x3308, lo: 0xa8, hi: 0xa9}, + {value: 0x3808, lo: 0xaa, hi: 0xaa}, + {value: 0x3b08, lo: 0xab, hi: 0xab}, + {value: 0x3308, lo: 0xac, hi: 0xad}, + {value: 0x0008, lo: 0xae, hi: 0xbf}, + // Block 0x41, offset 0x246 + {value: 0x0000, lo: 0x0b}, + {value: 0x0008, lo: 0x80, hi: 0xa5}, + {value: 0x3308, lo: 0xa6, hi: 0xa6}, + {value: 0x3008, lo: 0xa7, hi: 0xa7}, + {value: 0x3308, lo: 0xa8, hi: 0xa9}, + {value: 0x3008, lo: 0xaa, hi: 0xac}, + {value: 0x3308, lo: 0xad, hi: 0xad}, + {value: 0x3008, lo: 0xae, hi: 0xae}, + {value: 0x3308, lo: 0xaf, hi: 0xb1}, + {value: 0x3808, lo: 0xb2, hi: 0xb3}, + {value: 0x0040, lo: 0xb4, hi: 0xbb}, + {value: 0x0018, lo: 0xbc, hi: 0xbf}, + // Block 0x42, offset 0x252 + {value: 0x0000, lo: 0x07}, + {value: 0x0008, lo: 0x80, hi: 0xa3}, + {value: 0x3008, lo: 0xa4, hi: 0xab}, + {value: 0x3308, lo: 0xac, hi: 0xb3}, + {value: 0x3008, lo: 0xb4, hi: 0xb5}, + {value: 0x3308, lo: 0xb6, hi: 0xb7}, + {value: 0x0040, lo: 0xb8, hi: 0xba}, + {value: 0x0018, lo: 0xbb, hi: 0xbf}, + // Block 0x43, offset 0x25a + {value: 0x0000, lo: 0x04}, + {value: 0x0008, lo: 0x80, hi: 0x89}, + {value: 0x0040, lo: 0x8a, hi: 0x8c}, + {value: 0x0008, lo: 0x8d, hi: 0xbd}, + {value: 0x0018, lo: 0xbe, hi: 0xbf}, + // Block 0x44, offset 0x25f + {value: 0x0000, lo: 0x0c}, + {value: 0x0e29, lo: 0x80, hi: 0x80}, + {value: 0x0e41, lo: 0x81, hi: 0x81}, + {value: 0x0e59, lo: 0x82, hi: 0x82}, + {value: 0x0e71, lo: 0x83, hi: 0x83}, + {value: 0x0e89, lo: 0x84, hi: 0x85}, + {value: 0x0ea1, lo: 0x86, hi: 0x86}, + {value: 0x0eb9, lo: 0x87, hi: 0x87}, + {value: 0x057d, lo: 0x88, hi: 0x88}, + {value: 0x0040, lo: 0x89, hi: 0x8f}, + {value: 0x059d, lo: 0x90, hi: 0xba}, + {value: 0x0040, lo: 0xbb, hi: 0xbc}, + {value: 0x059d, lo: 0xbd, hi: 0xbf}, + // Block 0x45, offset 0x26c + {value: 0x0000, lo: 0x10}, + {value: 0x0018, lo: 0x80, hi: 0x87}, + {value: 0x0040, lo: 0x88, hi: 0x8f}, + {value: 0x3308, lo: 0x90, hi: 0x92}, + {value: 0x0018, lo: 0x93, hi: 0x93}, + {value: 0x3308, lo: 0x94, hi: 0xa0}, + {value: 0x3008, lo: 0xa1, hi: 0xa1}, + {value: 0x3308, lo: 0xa2, hi: 0xa8}, + {value: 0x0008, lo: 0xa9, hi: 0xac}, + {value: 0x3308, lo: 0xad, hi: 0xad}, + {value: 0x0008, lo: 0xae, hi: 0xb3}, + {value: 0x3308, lo: 0xb4, hi: 0xb4}, + {value: 0x0008, lo: 0xb5, hi: 0xb6}, + {value: 0x3008, lo: 0xb7, hi: 0xb7}, + {value: 0x3308, lo: 0xb8, hi: 0xb9}, + {value: 0x0008, lo: 0xba, hi: 0xba}, + {value: 0x0040, lo: 0xbb, hi: 0xbf}, + // Block 0x46, offset 0x27d + {value: 0x0000, lo: 0x03}, + {value: 0x3308, lo: 0x80, hi: 0xb9}, + {value: 0x0040, lo: 0xba, hi: 0xba}, + {value: 0x3308, lo: 0xbb, hi: 0xbf}, + // Block 0x47, offset 0x281 + {value: 0x0000, lo: 0x0a}, + {value: 0x0008, lo: 0x80, hi: 0x87}, + {value: 0xe045, lo: 0x88, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0x95}, + {value: 0x0040, lo: 0x96, hi: 0x97}, + {value: 0xe045, lo: 0x98, hi: 0x9d}, + {value: 0x0040, lo: 0x9e, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xa7}, + {value: 0xe045, lo: 0xa8, hi: 0xaf}, + {value: 0x0008, lo: 0xb0, hi: 0xb7}, + {value: 0xe045, lo: 0xb8, hi: 0xbf}, + // Block 0x48, offset 0x28c + {value: 0x0000, lo: 0x03}, + {value: 0x0040, lo: 0x80, hi: 0x8f}, + {value: 0x3318, lo: 0x90, hi: 0xb0}, + {value: 0x0040, lo: 0xb1, hi: 0xbf}, + // Block 0x49, offset 0x290 + {value: 0x0000, lo: 0x08}, + {value: 0x0018, lo: 0x80, hi: 0x82}, + {value: 0x0040, lo: 0x83, hi: 0x83}, + {value: 0x0008, lo: 0x84, hi: 0x84}, + {value: 0x0018, lo: 0x85, hi: 0x88}, + {value: 0x24c1, lo: 0x89, hi: 0x89}, + {value: 0x0018, lo: 0x8a, hi: 0x8b}, + {value: 0x0040, lo: 0x8c, hi: 0x8f}, + {value: 0x0018, lo: 0x90, hi: 0xbf}, + // Block 0x4a, offset 0x299 + {value: 0x0000, lo: 0x07}, + {value: 0x0018, lo: 0x80, hi: 0xab}, + {value: 0x24f1, lo: 0xac, hi: 0xac}, + {value: 0x2529, lo: 0xad, hi: 0xad}, + {value: 0x0018, lo: 0xae, hi: 0xae}, + {value: 0x2579, lo: 0xaf, hi: 0xaf}, + {value: 0x25b1, lo: 0xb0, hi: 0xb0}, + {value: 0x0018, lo: 0xb1, hi: 0xbf}, + // Block 0x4b, offset 0x2a1 + {value: 0x0000, lo: 0x05}, + {value: 0x0018, lo: 0x80, hi: 0x9f}, + {value: 0x0080, lo: 0xa0, hi: 0xa0}, + {value: 0x0018, lo: 0xa1, hi: 0xad}, + {value: 0x0080, lo: 0xae, hi: 0xaf}, + {value: 0x0018, lo: 0xb0, hi: 0xbf}, + // Block 0x4c, offset 0x2a7 + {value: 0x0000, lo: 0x04}, + {value: 0x0018, lo: 0x80, hi: 0xa8}, + {value: 0x09dd, lo: 0xa9, hi: 0xa9}, + {value: 0x09fd, lo: 0xaa, hi: 0xaa}, + {value: 0x0018, lo: 0xab, hi: 0xbf}, + // Block 0x4d, offset 0x2ac + {value: 0x0000, lo: 0x02}, + {value: 0x0018, lo: 0x80, hi: 0xa6}, + {value: 0x0040, lo: 0xa7, hi: 0xbf}, + // Block 0x4e, offset 0x2af + {value: 0x0000, lo: 0x03}, + {value: 0x0018, lo: 0x80, hi: 0x8b}, + {value: 0x28c1, lo: 0x8c, hi: 0x8c}, + {value: 0x0018, lo: 0x8d, hi: 0xbf}, + // Block 0x4f, offset 0x2b3 + {value: 0x0000, lo: 0x05}, + {value: 0x0018, lo: 0x80, hi: 0xb3}, + {value: 0x0e7e, lo: 0xb4, hi: 0xb4}, + {value: 0x292a, lo: 0xb5, hi: 0xb5}, + {value: 0x0e9e, lo: 0xb6, hi: 0xb6}, + {value: 0x0018, lo: 0xb7, hi: 0xbf}, + // Block 0x50, offset 0x2b9 + {value: 0x0000, lo: 0x03}, + {value: 0x0018, lo: 0x80, hi: 0x9b}, + {value: 0x2941, lo: 0x9c, hi: 0x9c}, + {value: 0x0018, lo: 0x9d, hi: 0xbf}, + // Block 0x51, offset 0x2bd + {value: 0x0000, lo: 0x03}, + {value: 0x0018, lo: 0x80, hi: 0xb3}, + {value: 0x0040, lo: 0xb4, hi: 0xb5}, + {value: 0x0018, lo: 0xb6, hi: 0xbf}, + // Block 0x52, offset 0x2c1 + {value: 0x0000, lo: 0x03}, + {value: 0x0018, lo: 0x80, hi: 0x95}, + {value: 0x0040, lo: 0x96, hi: 0x97}, + {value: 0x0018, lo: 0x98, hi: 0xbf}, + // Block 0x53, offset 0x2c5 + {value: 0x0000, lo: 0x05}, + {value: 0xe185, lo: 0x80, hi: 0x8f}, + {value: 0x03f5, lo: 0x90, hi: 0x9f}, + {value: 0x0ebd, lo: 0xa0, hi: 0xae}, + {value: 0x0040, lo: 0xaf, hi: 0xaf}, + {value: 0x0008, lo: 0xb0, hi: 0xbf}, + // Block 0x54, offset 0x2cb + {value: 0x0000, lo: 0x07}, + {value: 0x0008, lo: 0x80, hi: 0xa5}, + {value: 0x0040, lo: 0xa6, hi: 0xa6}, + {value: 0x0008, lo: 0xa7, hi: 0xa7}, + {value: 0x0040, lo: 0xa8, hi: 0xac}, + {value: 0x0008, lo: 0xad, hi: 0xad}, + {value: 0x0040, lo: 0xae, hi: 0xaf}, + {value: 0x0008, lo: 0xb0, hi: 0xbf}, + // Block 0x55, offset 0x2d3 + {value: 0x0000, lo: 0x06}, + {value: 0x0008, lo: 0x80, hi: 0xa7}, + {value: 0x0040, lo: 0xa8, hi: 0xae}, + {value: 0xe075, lo: 0xaf, hi: 0xaf}, + {value: 0x0018, lo: 0xb0, hi: 0xb0}, + {value: 0x0040, lo: 0xb1, hi: 0xbe}, + {value: 0x3b08, lo: 0xbf, hi: 0xbf}, + // Block 0x56, offset 0x2da + {value: 0x0000, lo: 0x0a}, + {value: 0x0008, lo: 0x80, hi: 0x96}, + {value: 0x0040, lo: 0x97, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xa6}, + {value: 0x0040, lo: 0xa7, hi: 0xa7}, + {value: 0x0008, lo: 0xa8, hi: 0xae}, + {value: 0x0040, lo: 0xaf, hi: 0xaf}, + {value: 0x0008, lo: 0xb0, hi: 0xb6}, + {value: 0x0040, lo: 0xb7, hi: 0xb7}, + {value: 0x0008, lo: 0xb8, hi: 0xbe}, + {value: 0x0040, lo: 0xbf, hi: 0xbf}, + // Block 0x57, offset 0x2e5 + {value: 0x0000, lo: 0x09}, + {value: 0x0008, lo: 0x80, hi: 0x86}, + {value: 0x0040, lo: 0x87, hi: 0x87}, + {value: 0x0008, lo: 0x88, hi: 0x8e}, + {value: 0x0040, lo: 0x8f, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0x96}, + {value: 0x0040, lo: 0x97, hi: 0x97}, + {value: 0x0008, lo: 0x98, hi: 0x9e}, + {value: 0x0040, lo: 0x9f, hi: 0x9f}, + {value: 0x3308, lo: 0xa0, hi: 0xbf}, + // Block 0x58, offset 0x2ef + {value: 0x0000, lo: 0x03}, + {value: 0x0018, lo: 0x80, hi: 0xae}, + {value: 0x0008, lo: 0xaf, hi: 0xaf}, + {value: 0x0018, lo: 0xb0, hi: 0xbf}, + // Block 0x59, offset 0x2f3 + {value: 0x0000, lo: 0x02}, + {value: 0x0018, lo: 0x80, hi: 0x8f}, + {value: 0x0040, lo: 0x90, hi: 0xbf}, + // Block 0x5a, offset 0x2f6 + {value: 0x0000, lo: 0x05}, + {value: 0x0018, lo: 0x80, hi: 0x99}, + {value: 0x0040, lo: 0x9a, hi: 0x9a}, + {value: 0x0018, lo: 0x9b, hi: 0x9e}, + {value: 0x0ef5, lo: 0x9f, hi: 0x9f}, + {value: 0x0018, lo: 0xa0, hi: 0xbf}, + // Block 0x5b, offset 0x2fc + {value: 0x0000, lo: 0x03}, + {value: 0x0018, lo: 0x80, hi: 0xb2}, + {value: 0x0f15, lo: 0xb3, hi: 0xb3}, + {value: 0x0040, lo: 0xb4, hi: 0xbf}, + // Block 0x5c, offset 0x300 + {value: 0x0020, lo: 0x01}, + {value: 0x0f35, lo: 0x80, hi: 0xbf}, + // Block 0x5d, offset 0x302 + {value: 0x0020, lo: 0x02}, + {value: 0x1735, lo: 0x80, hi: 0x8f}, + {value: 0x1915, lo: 0x90, hi: 0xbf}, + // Block 0x5e, offset 0x305 + {value: 0x0020, lo: 0x01}, + {value: 0x1f15, lo: 0x80, hi: 0xbf}, + // Block 0x5f, offset 0x307 + {value: 0x0000, lo: 0x02}, + {value: 0x0040, lo: 0x80, hi: 0x80}, + {value: 0x0008, lo: 0x81, hi: 0xbf}, + // Block 0x60, offset 0x30a + {value: 0x0000, lo: 0x09}, + {value: 0x0008, lo: 0x80, hi: 0x96}, + {value: 0x0040, lo: 0x97, hi: 0x98}, + {value: 0x3308, lo: 0x99, hi: 0x9a}, + {value: 0x29e2, lo: 0x9b, hi: 0x9b}, + {value: 0x2a0a, lo: 0x9c, hi: 0x9c}, + {value: 0x0008, lo: 0x9d, hi: 0x9e}, + {value: 0x2a31, lo: 0x9f, hi: 0x9f}, + {value: 0x0018, lo: 0xa0, hi: 0xa0}, + {value: 0x0008, lo: 0xa1, hi: 0xbf}, + // Block 0x61, offset 0x314 + {value: 0x0000, lo: 0x02}, + {value: 0x0008, lo: 0x80, hi: 0xbe}, + {value: 0x2a69, lo: 0xbf, hi: 0xbf}, + // Block 0x62, offset 0x317 + {value: 0x0000, lo: 0x0e}, + {value: 0x0040, lo: 0x80, hi: 0x84}, + {value: 0x0008, lo: 0x85, hi: 0xaf}, + {value: 0x0040, lo: 0xb0, hi: 0xb0}, + {value: 0x2a35, lo: 0xb1, hi: 0xb1}, + {value: 0x2a55, lo: 0xb2, hi: 0xb2}, + {value: 0x2a75, lo: 0xb3, hi: 0xb3}, + {value: 0x2a95, lo: 0xb4, hi: 0xb4}, + {value: 0x2a75, lo: 0xb5, hi: 0xb5}, + {value: 0x2ab5, lo: 0xb6, hi: 0xb6}, + {value: 0x2ad5, lo: 0xb7, hi: 0xb7}, + {value: 0x2af5, lo: 0xb8, hi: 0xb9}, + {value: 0x2b15, lo: 0xba, hi: 0xbb}, + {value: 0x2b35, lo: 0xbc, hi: 0xbd}, + {value: 0x2b15, lo: 0xbe, hi: 0xbf}, + // Block 0x63, offset 0x326 + {value: 0x0000, lo: 0x03}, + {value: 0x0018, lo: 0x80, hi: 0xa3}, + {value: 0x0040, lo: 0xa4, hi: 0xaf}, + {value: 0x0008, lo: 0xb0, hi: 0xbf}, + // Block 0x64, offset 0x32a + {value: 0x0030, lo: 0x04}, + {value: 0x2aa2, lo: 0x80, hi: 0x9d}, + {value: 0x305a, lo: 0x9e, hi: 0x9e}, + {value: 0x0040, lo: 0x9f, hi: 0x9f}, + {value: 0x30a2, lo: 0xa0, hi: 0xbf}, + // Block 0x65, offset 0x32f + {value: 0x0000, lo: 0x02}, + {value: 0x0008, lo: 0x80, hi: 0xaf}, + {value: 0x0040, lo: 0xb0, hi: 0xbf}, + // Block 0x66, offset 0x332 + {value: 0x0000, lo: 0x03}, + {value: 0x0008, lo: 0x80, hi: 0x8c}, + {value: 0x0040, lo: 0x8d, hi: 0x8f}, + {value: 0x0018, lo: 0x90, hi: 0xbf}, + // Block 0x67, offset 0x336 + {value: 0x0000, lo: 0x04}, + {value: 0x0018, lo: 0x80, hi: 0x86}, + {value: 0x0040, lo: 0x87, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0xbd}, + {value: 0x0018, lo: 0xbe, hi: 0xbf}, + // Block 0x68, offset 0x33b + {value: 0x0000, lo: 0x04}, + {value: 0x0008, lo: 0x80, hi: 0x8c}, + {value: 0x0018, lo: 0x8d, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0xab}, + {value: 0x0040, lo: 0xac, hi: 0xbf}, + // Block 0x69, offset 0x340 + {value: 0x0000, lo: 0x05}, + {value: 0x0008, lo: 0x80, hi: 0xa5}, + {value: 0x0018, lo: 0xa6, hi: 0xaf}, + {value: 0x3308, lo: 0xb0, hi: 0xb1}, + {value: 0x0018, lo: 0xb2, hi: 0xb7}, + {value: 0x0040, lo: 0xb8, hi: 0xbf}, + // Block 0x6a, offset 0x346 + {value: 0x0000, lo: 0x0b}, + {value: 0x0040, lo: 0x80, hi: 0x81}, + {value: 0xe00d, lo: 0x82, hi: 0x82}, + {value: 0x0008, lo: 0x83, hi: 0x83}, + {value: 0x03f5, lo: 0x84, hi: 0x84}, + {value: 0x1329, lo: 0x85, hi: 0x85}, + {value: 0x447d, lo: 0x86, hi: 0x86}, + {value: 0x0040, lo: 0x87, hi: 0xb6}, + {value: 0x0008, lo: 0xb7, hi: 0xb7}, + {value: 0x2009, lo: 0xb8, hi: 0xb8}, + {value: 0x6e89, lo: 0xb9, hi: 0xb9}, + {value: 0x0008, lo: 0xba, hi: 0xbf}, + // Block 0x6b, offset 0x352 + {value: 0x0000, lo: 0x0e}, + {value: 0x0008, lo: 0x80, hi: 0x81}, + {value: 0x3308, lo: 0x82, hi: 0x82}, + {value: 0x0008, lo: 0x83, hi: 0x85}, + {value: 0x3b08, lo: 0x86, hi: 0x86}, + {value: 0x0008, lo: 0x87, hi: 0x8a}, + {value: 0x3308, lo: 0x8b, hi: 0x8b}, + {value: 0x0008, lo: 0x8c, hi: 0xa2}, + {value: 0x3008, lo: 0xa3, hi: 0xa4}, + {value: 0x3308, lo: 0xa5, hi: 0xa6}, + {value: 0x3008, lo: 0xa7, hi: 0xa7}, + {value: 0x0018, lo: 0xa8, hi: 0xab}, + {value: 0x0040, lo: 0xac, hi: 0xaf}, + {value: 0x0018, lo: 0xb0, hi: 0xb9}, + {value: 0x0040, lo: 0xba, hi: 0xbf}, + // Block 0x6c, offset 0x361 + {value: 0x0000, lo: 0x05}, + {value: 0x0208, lo: 0x80, hi: 0xb1}, + {value: 0x0108, lo: 0xb2, hi: 0xb2}, + {value: 0x0008, lo: 0xb3, hi: 0xb3}, + {value: 0x0018, lo: 0xb4, hi: 0xb7}, + {value: 0x0040, lo: 0xb8, hi: 0xbf}, + // Block 0x6d, offset 0x367 + {value: 0x0000, lo: 0x03}, + {value: 0x3008, lo: 0x80, hi: 0x81}, + {value: 0x0008, lo: 0x82, hi: 0xb3}, + {value: 0x3008, lo: 0xb4, hi: 0xbf}, + // Block 0x6e, offset 0x36b + {value: 0x0000, lo: 0x0e}, + {value: 0x3008, lo: 0x80, hi: 0x83}, + {value: 0x3b08, lo: 0x84, hi: 0x84}, + {value: 0x3308, lo: 0x85, hi: 0x85}, + {value: 0x0040, lo: 0x86, hi: 0x8d}, + {value: 0x0018, lo: 0x8e, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0x99}, + {value: 0x0040, lo: 0x9a, hi: 0x9f}, + {value: 0x3308, lo: 0xa0, hi: 0xb1}, + {value: 0x0008, lo: 0xb2, hi: 0xb7}, + {value: 0x0018, lo: 0xb8, hi: 0xba}, + {value: 0x0008, lo: 0xbb, hi: 0xbb}, + {value: 0x0018, lo: 0xbc, hi: 0xbc}, + {value: 0x0008, lo: 0xbd, hi: 0xbe}, + {value: 0x3308, lo: 0xbf, hi: 0xbf}, + // Block 0x6f, offset 0x37a + {value: 0x0000, lo: 0x04}, + {value: 0x0008, lo: 0x80, hi: 0xa5}, + {value: 0x3308, lo: 0xa6, hi: 0xad}, + {value: 0x0018, lo: 0xae, hi: 0xaf}, + {value: 0x0008, lo: 0xb0, hi: 0xbf}, + // Block 0x70, offset 0x37f + {value: 0x0000, lo: 0x07}, + {value: 0x0008, lo: 0x80, hi: 0x86}, + {value: 0x3308, lo: 0x87, hi: 0x91}, + {value: 0x3008, lo: 0x92, hi: 0x92}, + {value: 0x3808, lo: 0x93, hi: 0x93}, + {value: 0x0040, lo: 0x94, hi: 0x9e}, + {value: 0x0018, lo: 0x9f, hi: 0xbc}, + {value: 0x0040, lo: 0xbd, hi: 0xbf}, + // Block 0x71, offset 0x387 + {value: 0x0000, lo: 0x09}, + {value: 0x3308, lo: 0x80, hi: 0x82}, + {value: 0x3008, lo: 0x83, hi: 0x83}, + {value: 0x0008, lo: 0x84, hi: 0xb2}, + {value: 0x3308, lo: 0xb3, hi: 0xb3}, + {value: 0x3008, lo: 0xb4, hi: 0xb5}, + {value: 0x3308, lo: 0xb6, hi: 0xb9}, + {value: 0x3008, lo: 0xba, hi: 0xbb}, + {value: 0x3308, lo: 0xbc, hi: 0xbd}, + {value: 0x3008, lo: 0xbe, hi: 0xbf}, + // Block 0x72, offset 0x391 + {value: 0x0000, lo: 0x0a}, + {value: 0x3808, lo: 0x80, hi: 0x80}, + {value: 0x0018, lo: 0x81, hi: 0x8d}, + {value: 0x0040, lo: 0x8e, hi: 0x8e}, + {value: 0x0008, lo: 0x8f, hi: 0x99}, + {value: 0x0040, lo: 0x9a, hi: 0x9d}, + {value: 0x0018, lo: 0x9e, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xa4}, + {value: 0x3308, lo: 0xa5, hi: 0xa5}, + {value: 0x0008, lo: 0xa6, hi: 0xbe}, + {value: 0x0040, lo: 0xbf, hi: 0xbf}, + // Block 0x73, offset 0x39c + {value: 0x0000, lo: 0x07}, + {value: 0x0008, lo: 0x80, hi: 0xa8}, + {value: 0x3308, lo: 0xa9, hi: 0xae}, + {value: 0x3008, lo: 0xaf, hi: 0xb0}, + {value: 0x3308, lo: 0xb1, hi: 0xb2}, + {value: 0x3008, lo: 0xb3, hi: 0xb4}, + {value: 0x3308, lo: 0xb5, hi: 0xb6}, + {value: 0x0040, lo: 0xb7, hi: 0xbf}, + // Block 0x74, offset 0x3a4 + {value: 0x0000, lo: 0x10}, + {value: 0x0008, lo: 0x80, hi: 0x82}, + {value: 0x3308, lo: 0x83, hi: 0x83}, + {value: 0x0008, lo: 0x84, hi: 0x8b}, + {value: 0x3308, lo: 0x8c, hi: 0x8c}, + {value: 0x3008, lo: 0x8d, hi: 0x8d}, + {value: 0x0040, lo: 0x8e, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0x99}, + {value: 0x0040, lo: 0x9a, hi: 0x9b}, + {value: 0x0018, lo: 0x9c, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xb6}, + {value: 0x0018, lo: 0xb7, hi: 0xb9}, + {value: 0x0008, lo: 0xba, hi: 0xba}, + {value: 0x3008, lo: 0xbb, hi: 0xbb}, + {value: 0x3308, lo: 0xbc, hi: 0xbc}, + {value: 0x3008, lo: 0xbd, hi: 0xbd}, + {value: 0x0008, lo: 0xbe, hi: 0xbf}, + // Block 0x75, offset 0x3b5 + {value: 0x0000, lo: 0x08}, + {value: 0x0008, lo: 0x80, hi: 0xaf}, + {value: 0x3308, lo: 0xb0, hi: 0xb0}, + {value: 0x0008, lo: 0xb1, hi: 0xb1}, + {value: 0x3308, lo: 0xb2, hi: 0xb4}, + {value: 0x0008, lo: 0xb5, hi: 0xb6}, + {value: 0x3308, lo: 0xb7, hi: 0xb8}, + {value: 0x0008, lo: 0xb9, hi: 0xbd}, + {value: 0x3308, lo: 0xbe, hi: 0xbf}, + // Block 0x76, offset 0x3be + {value: 0x0000, lo: 0x0f}, + {value: 0x0008, lo: 0x80, hi: 0x80}, + {value: 0x3308, lo: 0x81, hi: 0x81}, + {value: 0x0008, lo: 0x82, hi: 0x82}, + {value: 0x0040, lo: 0x83, hi: 0x9a}, + {value: 0x0008, lo: 0x9b, hi: 0x9d}, + {value: 0x0018, lo: 0x9e, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xaa}, + {value: 0x3008, lo: 0xab, hi: 0xab}, + {value: 0x3308, lo: 0xac, hi: 0xad}, + {value: 0x3008, lo: 0xae, hi: 0xaf}, + {value: 0x0018, lo: 0xb0, hi: 0xb1}, + {value: 0x0008, lo: 0xb2, hi: 0xb4}, + {value: 0x3008, lo: 0xb5, hi: 0xb5}, + {value: 0x3b08, lo: 0xb6, hi: 0xb6}, + {value: 0x0040, lo: 0xb7, hi: 0xbf}, + // Block 0x77, offset 0x3ce + {value: 0x0000, lo: 0x0c}, + {value: 0x0040, lo: 0x80, hi: 0x80}, + {value: 0x0008, lo: 0x81, hi: 0x86}, + {value: 0x0040, lo: 0x87, hi: 0x88}, + {value: 0x0008, lo: 0x89, hi: 0x8e}, + {value: 0x0040, lo: 0x8f, hi: 0x90}, + {value: 0x0008, lo: 0x91, hi: 0x96}, + {value: 0x0040, lo: 0x97, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xa6}, + {value: 0x0040, lo: 0xa7, hi: 0xa7}, + {value: 0x0008, lo: 0xa8, hi: 0xae}, + {value: 0x0040, lo: 0xaf, hi: 0xaf}, + {value: 0x0008, lo: 0xb0, hi: 0xbf}, + // Block 0x78, offset 0x3db + {value: 0x0000, lo: 0x09}, + {value: 0x0008, lo: 0x80, hi: 0x9a}, + {value: 0x0018, lo: 0x9b, hi: 0x9b}, + {value: 0x449d, lo: 0x9c, hi: 0x9c}, + {value: 0x44b5, lo: 0x9d, hi: 0x9d}, + {value: 0x2971, lo: 0x9e, hi: 0x9e}, + {value: 0xe06d, lo: 0x9f, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xa7}, + {value: 0x0040, lo: 0xa8, hi: 0xaf}, + {value: 0x44cd, lo: 0xb0, hi: 0xbf}, + // Block 0x79, offset 0x3e5 + {value: 0x0000, lo: 0x04}, + {value: 0x44ed, lo: 0x80, hi: 0x8f}, + {value: 0x450d, lo: 0x90, hi: 0x9f}, + {value: 0x452d, lo: 0xa0, hi: 0xaf}, + {value: 0x450d, lo: 0xb0, hi: 0xbf}, + // Block 0x7a, offset 0x3ea + {value: 0x0000, lo: 0x0c}, + {value: 0x0008, lo: 0x80, hi: 0xa2}, + {value: 0x3008, lo: 0xa3, hi: 0xa4}, + {value: 0x3308, lo: 0xa5, hi: 0xa5}, + {value: 0x3008, lo: 0xa6, hi: 0xa7}, + {value: 0x3308, lo: 0xa8, hi: 0xa8}, + {value: 0x3008, lo: 0xa9, hi: 0xaa}, + {value: 0x0018, lo: 0xab, hi: 0xab}, + {value: 0x3008, lo: 0xac, hi: 0xac}, + {value: 0x3b08, lo: 0xad, hi: 0xad}, + {value: 0x0040, lo: 0xae, hi: 0xaf}, + {value: 0x0008, lo: 0xb0, hi: 0xb9}, + {value: 0x0040, lo: 0xba, hi: 0xbf}, + // Block 0x7b, offset 0x3f7 + {value: 0x0000, lo: 0x03}, + {value: 0x0008, lo: 0x80, hi: 0xa3}, + {value: 0x0040, lo: 0xa4, hi: 0xaf}, + {value: 0x0018, lo: 0xb0, hi: 0xbf}, + // Block 0x7c, offset 0x3fb + {value: 0x0000, lo: 0x04}, + {value: 0x0018, lo: 0x80, hi: 0x86}, + {value: 0x0040, lo: 0x87, hi: 0x8a}, + {value: 0x0018, lo: 0x8b, hi: 0xbb}, + {value: 0x0040, lo: 0xbc, hi: 0xbf}, + // Block 0x7d, offset 0x400 + {value: 0x0020, lo: 0x01}, + {value: 0x454d, lo: 0x80, hi: 0xbf}, + // Block 0x7e, offset 0x402 + {value: 0x0020, lo: 0x03}, + {value: 0x4d4d, lo: 0x80, hi: 0x94}, + {value: 0x4b0d, lo: 0x95, hi: 0x95}, + {value: 0x4fed, lo: 0x96, hi: 0xbf}, + // Block 0x7f, offset 0x406 + {value: 0x0020, lo: 0x01}, + {value: 0x552d, lo: 0x80, hi: 0xbf}, + // Block 0x80, offset 0x408 + {value: 0x0020, lo: 0x03}, + {value: 0x5d2d, lo: 0x80, hi: 0x84}, + {value: 0x568d, lo: 0x85, hi: 0x85}, + {value: 0x5dcd, lo: 0x86, hi: 0xbf}, + // Block 0x81, offset 0x40c + {value: 0x0020, lo: 0x08}, + {value: 0x6b8d, lo: 0x80, hi: 0x8f}, + {value: 0x6d4d, lo: 0x90, hi: 0x90}, + {value: 0x6d8d, lo: 0x91, hi: 0xab}, + {value: 0x6ea1, lo: 0xac, hi: 0xac}, + {value: 0x70ed, lo: 0xad, hi: 0xad}, + {value: 0x0040, lo: 0xae, hi: 0xae}, + {value: 0x0040, lo: 0xaf, hi: 0xaf}, + {value: 0x710d, lo: 0xb0, hi: 0xbf}, + // Block 0x82, offset 0x415 + {value: 0x0020, lo: 0x05}, + {value: 0x730d, lo: 0x80, hi: 0xad}, + {value: 0x656d, lo: 0xae, hi: 0xae}, + {value: 0x78cd, lo: 0xaf, hi: 0xb5}, + {value: 0x6f8d, lo: 0xb6, hi: 0xb6}, + {value: 0x79ad, lo: 0xb7, hi: 0xbf}, + // Block 0x83, offset 0x41b + {value: 0x0028, lo: 0x03}, + {value: 0x7c21, lo: 0x80, hi: 0x82}, + {value: 0x7be1, lo: 0x83, hi: 0x83}, + {value: 0x7c99, lo: 0x84, hi: 0xbf}, + // Block 0x84, offset 0x41f + {value: 0x0038, lo: 0x0f}, + {value: 0x9db1, lo: 0x80, hi: 0x83}, + {value: 0x9e59, lo: 0x84, hi: 0x85}, + {value: 0x9e91, lo: 0x86, hi: 0x87}, + {value: 0x9ec9, lo: 0x88, hi: 0x8f}, + {value: 0x0040, lo: 0x90, hi: 0x90}, + {value: 0x0040, lo: 0x91, hi: 0x91}, + {value: 0xa089, lo: 0x92, hi: 0x97}, + {value: 0xa1a1, lo: 0x98, hi: 0x9c}, + {value: 0xa281, lo: 0x9d, hi: 0xb3}, + {value: 0x9d41, lo: 0xb4, hi: 0xb4}, + {value: 0x9db1, lo: 0xb5, hi: 0xb5}, + {value: 0xa789, lo: 0xb6, hi: 0xbb}, + {value: 0xa869, lo: 0xbc, hi: 0xbc}, + {value: 0xa7f9, lo: 0xbd, hi: 0xbd}, + {value: 0xa8d9, lo: 0xbe, hi: 0xbf}, + // Block 0x85, offset 0x42f + {value: 0x0000, lo: 0x09}, + {value: 0x0008, lo: 0x80, hi: 0x8b}, + {value: 0x0040, lo: 0x8c, hi: 0x8c}, + {value: 0x0008, lo: 0x8d, hi: 0xa6}, + {value: 0x0040, lo: 0xa7, hi: 0xa7}, + {value: 0x0008, lo: 0xa8, hi: 0xba}, + {value: 0x0040, lo: 0xbb, hi: 0xbb}, + {value: 0x0008, lo: 0xbc, hi: 0xbd}, + {value: 0x0040, lo: 0xbe, hi: 0xbe}, + {value: 0x0008, lo: 0xbf, hi: 0xbf}, + // Block 0x86, offset 0x439 + {value: 0x0000, lo: 0x04}, + {value: 0x0008, lo: 0x80, hi: 0x8d}, + {value: 0x0040, lo: 0x8e, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0x9d}, + {value: 0x0040, lo: 0x9e, hi: 0xbf}, + // Block 0x87, offset 0x43e + {value: 0x0000, lo: 0x02}, + {value: 0x0008, lo: 0x80, hi: 0xba}, + {value: 0x0040, lo: 0xbb, hi: 0xbf}, + // Block 0x88, offset 0x441 + {value: 0x0000, lo: 0x05}, + {value: 0x0018, lo: 0x80, hi: 0x82}, + {value: 0x0040, lo: 0x83, hi: 0x86}, + {value: 0x0018, lo: 0x87, hi: 0xb3}, + {value: 0x0040, lo: 0xb4, hi: 0xb6}, + {value: 0x0018, lo: 0xb7, hi: 0xbf}, + // Block 0x89, offset 0x447 + {value: 0x0000, lo: 0x06}, + {value: 0x0018, lo: 0x80, hi: 0x8e}, + {value: 0x0040, lo: 0x8f, hi: 0x8f}, + {value: 0x0018, lo: 0x90, hi: 0x9b}, + {value: 0x0040, lo: 0x9c, hi: 0x9f}, + {value: 0x0018, lo: 0xa0, hi: 0xa0}, + {value: 0x0040, lo: 0xa1, hi: 0xbf}, + // Block 0x8a, offset 0x44e + {value: 0x0000, lo: 0x04}, + {value: 0x0040, lo: 0x80, hi: 0x8f}, + {value: 0x0018, lo: 0x90, hi: 0xbc}, + {value: 0x3308, lo: 0xbd, hi: 0xbd}, + {value: 0x0040, lo: 0xbe, hi: 0xbf}, + // Block 0x8b, offset 0x453 + {value: 0x0000, lo: 0x03}, + {value: 0x0008, lo: 0x80, hi: 0x9c}, + {value: 0x0040, lo: 0x9d, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xbf}, + // Block 0x8c, offset 0x457 + {value: 0x0000, lo: 0x05}, + {value: 0x0008, lo: 0x80, hi: 0x90}, + {value: 0x0040, lo: 0x91, hi: 0x9f}, + {value: 0x3308, lo: 0xa0, hi: 0xa0}, + {value: 0x0018, lo: 0xa1, hi: 0xbb}, + {value: 0x0040, lo: 0xbc, hi: 0xbf}, + // Block 0x8d, offset 0x45d + {value: 0x0000, lo: 0x04}, + {value: 0x0008, lo: 0x80, hi: 0x9f}, + {value: 0x0018, lo: 0xa0, hi: 0xa3}, + {value: 0x0040, lo: 0xa4, hi: 0xac}, + {value: 0x0008, lo: 0xad, hi: 0xbf}, + // Block 0x8e, offset 0x462 + {value: 0x0000, lo: 0x08}, + {value: 0x0008, lo: 0x80, hi: 0x80}, + {value: 0x0018, lo: 0x81, hi: 0x81}, + {value: 0x0008, lo: 0x82, hi: 0x89}, + {value: 0x0018, lo: 0x8a, hi: 0x8a}, + {value: 0x0040, lo: 0x8b, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0xb5}, + {value: 0x3308, lo: 0xb6, hi: 0xba}, + {value: 0x0040, lo: 0xbb, hi: 0xbf}, + // Block 0x8f, offset 0x46b + {value: 0x0000, lo: 0x04}, + {value: 0x0008, lo: 0x80, hi: 0x9d}, + {value: 0x0040, lo: 0x9e, hi: 0x9e}, + {value: 0x0018, lo: 0x9f, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xbf}, + // Block 0x90, offset 0x470 + {value: 0x0000, lo: 0x05}, + {value: 0x0008, lo: 0x80, hi: 0x83}, + {value: 0x0040, lo: 0x84, hi: 0x87}, + {value: 0x0008, lo: 0x88, hi: 0x8f}, + {value: 0x0018, lo: 0x90, hi: 0x95}, + {value: 0x0040, lo: 0x96, hi: 0xbf}, + // Block 0x91, offset 0x476 + {value: 0x0000, lo: 0x06}, + {value: 0xe145, lo: 0x80, hi: 0x87}, + {value: 0xe1c5, lo: 0x88, hi: 0x8f}, + {value: 0xe145, lo: 0x90, hi: 0x97}, + {value: 0x8b0d, lo: 0x98, hi: 0x9f}, + {value: 0x8b25, lo: 0xa0, hi: 0xa7}, + {value: 0x0008, lo: 0xa8, hi: 0xbf}, + // Block 0x92, offset 0x47d + {value: 0x0000, lo: 0x06}, + {value: 0x0008, lo: 0x80, hi: 0x9d}, + {value: 0x0040, lo: 0x9e, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xa9}, + {value: 0x0040, lo: 0xaa, hi: 0xaf}, + {value: 0x8b25, lo: 0xb0, hi: 0xb7}, + {value: 0x8b0d, lo: 0xb8, hi: 0xbf}, + // Block 0x93, offset 0x484 + {value: 0x0000, lo: 0x06}, + {value: 0xe145, lo: 0x80, hi: 0x87}, + {value: 0xe1c5, lo: 0x88, hi: 0x8f}, + {value: 0xe145, lo: 0x90, hi: 0x93}, + {value: 0x0040, lo: 0x94, hi: 0x97}, + {value: 0x0008, lo: 0x98, hi: 0xbb}, + {value: 0x0040, lo: 0xbc, hi: 0xbf}, + // Block 0x94, offset 0x48b + {value: 0x0000, lo: 0x03}, + {value: 0x0008, lo: 0x80, hi: 0xa7}, + {value: 0x0040, lo: 0xa8, hi: 0xaf}, + {value: 0x0008, lo: 0xb0, hi: 0xbf}, + // Block 0x95, offset 0x48f + {value: 0x0000, lo: 0x04}, + {value: 0x0008, lo: 0x80, hi: 0xa3}, + {value: 0x0040, lo: 0xa4, hi: 0xae}, + {value: 0x0018, lo: 0xaf, hi: 0xaf}, + {value: 0x0040, lo: 0xb0, hi: 0xbf}, + // Block 0x96, offset 0x494 + {value: 0x0000, lo: 0x02}, + {value: 0x0008, lo: 0x80, hi: 0xb6}, + {value: 0x0040, lo: 0xb7, hi: 0xbf}, + // Block 0x97, offset 0x497 + {value: 0x0000, lo: 0x04}, + {value: 0x0008, lo: 0x80, hi: 0x95}, + {value: 0x0040, lo: 0x96, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xa7}, + {value: 0x0040, lo: 0xa8, hi: 0xbf}, + // Block 0x98, offset 0x49c + {value: 0x0000, lo: 0x0b}, + {value: 0x0808, lo: 0x80, hi: 0x85}, + {value: 0x0040, lo: 0x86, hi: 0x87}, + {value: 0x0808, lo: 0x88, hi: 0x88}, + {value: 0x0040, lo: 0x89, hi: 0x89}, + {value: 0x0808, lo: 0x8a, hi: 0xb5}, + {value: 0x0040, lo: 0xb6, hi: 0xb6}, + {value: 0x0808, lo: 0xb7, hi: 0xb8}, + {value: 0x0040, lo: 0xb9, hi: 0xbb}, + {value: 0x0808, lo: 0xbc, hi: 0xbc}, + {value: 0x0040, lo: 0xbd, hi: 0xbe}, + {value: 0x0808, lo: 0xbf, hi: 0xbf}, + // Block 0x99, offset 0x4a8 + {value: 0x0000, lo: 0x05}, + {value: 0x0808, lo: 0x80, hi: 0x95}, + {value: 0x0040, lo: 0x96, hi: 0x96}, + {value: 0x0818, lo: 0x97, hi: 0x9f}, + {value: 0x0808, lo: 0xa0, hi: 0xb6}, + {value: 0x0818, lo: 0xb7, hi: 0xbf}, + // Block 0x9a, offset 0x4ae + {value: 0x0000, lo: 0x04}, + {value: 0x0808, lo: 0x80, hi: 0x9e}, + {value: 0x0040, lo: 0x9f, hi: 0xa6}, + {value: 0x0818, lo: 0xa7, hi: 0xaf}, + {value: 0x0040, lo: 0xb0, hi: 0xbf}, + // Block 0x9b, offset 0x4b3 + {value: 0x0000, lo: 0x06}, + {value: 0x0040, lo: 0x80, hi: 0x9f}, + {value: 0x0808, lo: 0xa0, hi: 0xb2}, + {value: 0x0040, lo: 0xb3, hi: 0xb3}, + {value: 0x0808, lo: 0xb4, hi: 0xb5}, + {value: 0x0040, lo: 0xb6, hi: 0xba}, + {value: 0x0818, lo: 0xbb, hi: 0xbf}, + // Block 0x9c, offset 0x4ba + {value: 0x0000, lo: 0x07}, + {value: 0x0808, lo: 0x80, hi: 0x95}, + {value: 0x0818, lo: 0x96, hi: 0x9b}, + {value: 0x0040, lo: 0x9c, hi: 0x9e}, + {value: 0x0018, lo: 0x9f, hi: 0x9f}, + {value: 0x0808, lo: 0xa0, hi: 0xb9}, + {value: 0x0040, lo: 0xba, hi: 0xbe}, + {value: 0x0818, lo: 0xbf, hi: 0xbf}, + // Block 0x9d, offset 0x4c2 + {value: 0x0000, lo: 0x04}, + {value: 0x0808, lo: 0x80, hi: 0xb7}, + {value: 0x0040, lo: 0xb8, hi: 0xbb}, + {value: 0x0818, lo: 0xbc, hi: 0xbd}, + {value: 0x0808, lo: 0xbe, hi: 0xbf}, + // Block 0x9e, offset 0x4c7 + {value: 0x0000, lo: 0x03}, + {value: 0x0818, lo: 0x80, hi: 0x8f}, + {value: 0x0040, lo: 0x90, hi: 0x91}, + {value: 0x0818, lo: 0x92, hi: 0xbf}, + // Block 0x9f, offset 0x4cb + {value: 0x0000, lo: 0x0f}, + {value: 0x0808, lo: 0x80, hi: 0x80}, + {value: 0x3308, lo: 0x81, hi: 0x83}, + {value: 0x0040, lo: 0x84, hi: 0x84}, + {value: 0x3308, lo: 0x85, hi: 0x86}, + {value: 0x0040, lo: 0x87, hi: 0x8b}, + {value: 0x3308, lo: 0x8c, hi: 0x8f}, + {value: 0x0808, lo: 0x90, hi: 0x93}, + {value: 0x0040, lo: 0x94, hi: 0x94}, + {value: 0x0808, lo: 0x95, hi: 0x97}, + {value: 0x0040, lo: 0x98, hi: 0x98}, + {value: 0x0808, lo: 0x99, hi: 0xb5}, + {value: 0x0040, lo: 0xb6, hi: 0xb7}, + {value: 0x3308, lo: 0xb8, hi: 0xba}, + {value: 0x0040, lo: 0xbb, hi: 0xbe}, + {value: 0x3b08, lo: 0xbf, hi: 0xbf}, + // Block 0xa0, offset 0x4db + {value: 0x0000, lo: 0x06}, + {value: 0x0818, lo: 0x80, hi: 0x88}, + {value: 0x0040, lo: 0x89, hi: 0x8f}, + {value: 0x0818, lo: 0x90, hi: 0x98}, + {value: 0x0040, lo: 0x99, hi: 0x9f}, + {value: 0x0808, lo: 0xa0, hi: 0xbc}, + {value: 0x0818, lo: 0xbd, hi: 0xbf}, + // Block 0xa1, offset 0x4e2 + {value: 0x0000, lo: 0x03}, + {value: 0x0808, lo: 0x80, hi: 0x9c}, + {value: 0x0818, lo: 0x9d, hi: 0x9f}, + {value: 0x0040, lo: 0xa0, hi: 0xbf}, + // Block 0xa2, offset 0x4e6 + {value: 0x0000, lo: 0x03}, + {value: 0x0808, lo: 0x80, hi: 0xb5}, + {value: 0x0040, lo: 0xb6, hi: 0xb8}, + {value: 0x0018, lo: 0xb9, hi: 0xbf}, + // Block 0xa3, offset 0x4ea + {value: 0x0000, lo: 0x06}, + {value: 0x0808, lo: 0x80, hi: 0x95}, + {value: 0x0040, lo: 0x96, hi: 0x97}, + {value: 0x0818, lo: 0x98, hi: 0x9f}, + {value: 0x0808, lo: 0xa0, hi: 0xb2}, + {value: 0x0040, lo: 0xb3, hi: 0xb7}, + {value: 0x0818, lo: 0xb8, hi: 0xbf}, + // Block 0xa4, offset 0x4f1 + {value: 0x0000, lo: 0x01}, + {value: 0x0808, lo: 0x80, hi: 0xbf}, + // Block 0xa5, offset 0x4f3 + {value: 0x0000, lo: 0x02}, + {value: 0x0808, lo: 0x80, hi: 0x88}, + {value: 0x0040, lo: 0x89, hi: 0xbf}, + // Block 0xa6, offset 0x4f6 + {value: 0x0000, lo: 0x02}, + {value: 0x03dd, lo: 0x80, hi: 0xb2}, + {value: 0x0040, lo: 0xb3, hi: 0xbf}, + // Block 0xa7, offset 0x4f9 + {value: 0x0000, lo: 0x03}, + {value: 0x0808, lo: 0x80, hi: 0xb2}, + {value: 0x0040, lo: 0xb3, hi: 0xb9}, + {value: 0x0818, lo: 0xba, hi: 0xbf}, + // Block 0xa8, offset 0x4fd + {value: 0x0000, lo: 0x08}, + {value: 0x0908, lo: 0x80, hi: 0x80}, + {value: 0x0a08, lo: 0x81, hi: 0xa1}, + {value: 0x0c08, lo: 0xa2, hi: 0xa2}, + {value: 0x0a08, lo: 0xa3, hi: 0xa3}, + {value: 0x3308, lo: 0xa4, hi: 0xa7}, + {value: 0x0040, lo: 0xa8, hi: 0xaf}, + {value: 0x0808, lo: 0xb0, hi: 0xb9}, + {value: 0x0040, lo: 0xba, hi: 0xbf}, + // Block 0xa9, offset 0x506 + {value: 0x0000, lo: 0x03}, + {value: 0x0040, lo: 0x80, hi: 0x9f}, + {value: 0x0818, lo: 0xa0, hi: 0xbe}, + {value: 0x0040, lo: 0xbf, hi: 0xbf}, + // Block 0xaa, offset 0x50a + {value: 0x0000, lo: 0x07}, + {value: 0x0808, lo: 0x80, hi: 0x9c}, + {value: 0x0818, lo: 0x9d, hi: 0xa6}, + {value: 0x0808, lo: 0xa7, hi: 0xa7}, + {value: 0x0040, lo: 0xa8, hi: 0xaf}, + {value: 0x0a08, lo: 0xb0, hi: 0xb2}, + {value: 0x0c08, lo: 0xb3, hi: 0xb3}, + {value: 0x0a08, lo: 0xb4, hi: 0xbf}, + // Block 0xab, offset 0x512 + {value: 0x0000, lo: 0x07}, + {value: 0x0a08, lo: 0x80, hi: 0x84}, + {value: 0x0808, lo: 0x85, hi: 0x85}, + {value: 0x3308, lo: 0x86, hi: 0x90}, + {value: 0x0a18, lo: 0x91, hi: 0x93}, + {value: 0x0c18, lo: 0x94, hi: 0x94}, + {value: 0x0818, lo: 0x95, hi: 0x99}, + {value: 0x0040, lo: 0x9a, hi: 0xbf}, + // Block 0xac, offset 0x51a + {value: 0x0000, lo: 0x03}, + {value: 0x0040, lo: 0x80, hi: 0x9f}, + {value: 0x0808, lo: 0xa0, hi: 0xb6}, + {value: 0x0040, lo: 0xb7, hi: 0xbf}, + // Block 0xad, offset 0x51e + {value: 0x0000, lo: 0x05}, + {value: 0x3008, lo: 0x80, hi: 0x80}, + {value: 0x3308, lo: 0x81, hi: 0x81}, + {value: 0x3008, lo: 0x82, hi: 0x82}, + {value: 0x0008, lo: 0x83, hi: 0xb7}, + {value: 0x3308, lo: 0xb8, hi: 0xbf}, + // Block 0xae, offset 0x524 + {value: 0x0000, lo: 0x08}, + {value: 0x3308, lo: 0x80, hi: 0x85}, + {value: 0x3b08, lo: 0x86, hi: 0x86}, + {value: 0x0018, lo: 0x87, hi: 0x8d}, + {value: 0x0040, lo: 0x8e, hi: 0x91}, + {value: 0x0018, lo: 0x92, hi: 0xa5}, + {value: 0x0008, lo: 0xa6, hi: 0xaf}, + {value: 0x0040, lo: 0xb0, hi: 0xbe}, + {value: 0x3b08, lo: 0xbf, hi: 0xbf}, + // Block 0xaf, offset 0x52d + {value: 0x0000, lo: 0x0b}, + {value: 0x3308, lo: 0x80, hi: 0x81}, + {value: 0x3008, lo: 0x82, hi: 0x82}, + {value: 0x0008, lo: 0x83, hi: 0xaf}, + {value: 0x3008, lo: 0xb0, hi: 0xb2}, + {value: 0x3308, lo: 0xb3, hi: 0xb6}, + {value: 0x3008, lo: 0xb7, hi: 0xb8}, + {value: 0x3b08, lo: 0xb9, hi: 0xb9}, + {value: 0x3308, lo: 0xba, hi: 0xba}, + {value: 0x0018, lo: 0xbb, hi: 0xbc}, + {value: 0x0040, lo: 0xbd, hi: 0xbd}, + {value: 0x0018, lo: 0xbe, hi: 0xbf}, + // Block 0xb0, offset 0x539 + {value: 0x0000, lo: 0x06}, + {value: 0x0018, lo: 0x80, hi: 0x81}, + {value: 0x0040, lo: 0x82, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0xa8}, + {value: 0x0040, lo: 0xa9, hi: 0xaf}, + {value: 0x0008, lo: 0xb0, hi: 0xb9}, + {value: 0x0040, lo: 0xba, hi: 0xbf}, + // Block 0xb1, offset 0x540 + {value: 0x0000, lo: 0x08}, + {value: 0x3308, lo: 0x80, hi: 0x82}, + {value: 0x0008, lo: 0x83, hi: 0xa6}, + {value: 0x3308, lo: 0xa7, hi: 0xab}, + {value: 0x3008, lo: 0xac, hi: 0xac}, + {value: 0x3308, lo: 0xad, hi: 0xb2}, + {value: 0x3b08, lo: 0xb3, hi: 0xb4}, + {value: 0x0040, lo: 0xb5, hi: 0xb5}, + {value: 0x0008, lo: 0xb6, hi: 0xbf}, + // Block 0xb2, offset 0x549 + {value: 0x0000, lo: 0x09}, + {value: 0x0018, lo: 0x80, hi: 0x83}, + {value: 0x0008, lo: 0x84, hi: 0x84}, + {value: 0x3008, lo: 0x85, hi: 0x86}, + {value: 0x0040, lo: 0x87, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0xb2}, + {value: 0x3308, lo: 0xb3, hi: 0xb3}, + {value: 0x0018, lo: 0xb4, hi: 0xb5}, + {value: 0x0008, lo: 0xb6, hi: 0xb6}, + {value: 0x0040, lo: 0xb7, hi: 0xbf}, + // Block 0xb3, offset 0x553 + {value: 0x0000, lo: 0x06}, + {value: 0x3308, lo: 0x80, hi: 0x81}, + {value: 0x3008, lo: 0x82, hi: 0x82}, + {value: 0x0008, lo: 0x83, hi: 0xb2}, + {value: 0x3008, lo: 0xb3, hi: 0xb5}, + {value: 0x3308, lo: 0xb6, hi: 0xbe}, + {value: 0x3008, lo: 0xbf, hi: 0xbf}, + // Block 0xb4, offset 0x55a + {value: 0x0000, lo: 0x0d}, + {value: 0x3808, lo: 0x80, hi: 0x80}, + {value: 0x0008, lo: 0x81, hi: 0x84}, + {value: 0x0018, lo: 0x85, hi: 0x88}, + {value: 0x3308, lo: 0x89, hi: 0x8c}, + {value: 0x0018, lo: 0x8d, hi: 0x8d}, + {value: 0x0040, lo: 0x8e, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0x9a}, + {value: 0x0018, lo: 0x9b, hi: 0x9b}, + {value: 0x0008, lo: 0x9c, hi: 0x9c}, + {value: 0x0018, lo: 0x9d, hi: 0x9f}, + {value: 0x0040, lo: 0xa0, hi: 0xa0}, + {value: 0x0018, lo: 0xa1, hi: 0xb4}, + {value: 0x0040, lo: 0xb5, hi: 0xbf}, + // Block 0xb5, offset 0x568 + {value: 0x0000, lo: 0x0c}, + {value: 0x0008, lo: 0x80, hi: 0x91}, + {value: 0x0040, lo: 0x92, hi: 0x92}, + {value: 0x0008, lo: 0x93, hi: 0xab}, + {value: 0x3008, lo: 0xac, hi: 0xae}, + {value: 0x3308, lo: 0xaf, hi: 0xb1}, + {value: 0x3008, lo: 0xb2, hi: 0xb3}, + {value: 0x3308, lo: 0xb4, hi: 0xb4}, + {value: 0x3808, lo: 0xb5, hi: 0xb5}, + {value: 0x3308, lo: 0xb6, hi: 0xb7}, + {value: 0x0018, lo: 0xb8, hi: 0xbd}, + {value: 0x3308, lo: 0xbe, hi: 0xbe}, + {value: 0x0040, lo: 0xbf, hi: 0xbf}, + // Block 0xb6, offset 0x575 + {value: 0x0000, lo: 0x0c}, + {value: 0x0008, lo: 0x80, hi: 0x86}, + {value: 0x0040, lo: 0x87, hi: 0x87}, + {value: 0x0008, lo: 0x88, hi: 0x88}, + {value: 0x0040, lo: 0x89, hi: 0x89}, + {value: 0x0008, lo: 0x8a, hi: 0x8d}, + {value: 0x0040, lo: 0x8e, hi: 0x8e}, + {value: 0x0008, lo: 0x8f, hi: 0x9d}, + {value: 0x0040, lo: 0x9e, hi: 0x9e}, + {value: 0x0008, lo: 0x9f, hi: 0xa8}, + {value: 0x0018, lo: 0xa9, hi: 0xa9}, + {value: 0x0040, lo: 0xaa, hi: 0xaf}, + {value: 0x0008, lo: 0xb0, hi: 0xbf}, + // Block 0xb7, offset 0x582 + {value: 0x0000, lo: 0x08}, + {value: 0x0008, lo: 0x80, hi: 0x9e}, + {value: 0x3308, lo: 0x9f, hi: 0x9f}, + {value: 0x3008, lo: 0xa0, hi: 0xa2}, + {value: 0x3308, lo: 0xa3, hi: 0xa9}, + {value: 0x3b08, lo: 0xaa, hi: 0xaa}, + {value: 0x0040, lo: 0xab, hi: 0xaf}, + {value: 0x0008, lo: 0xb0, hi: 0xb9}, + {value: 0x0040, lo: 0xba, hi: 0xbf}, + // Block 0xb8, offset 0x58b + {value: 0x0000, lo: 0x03}, + {value: 0x0008, lo: 0x80, hi: 0xb4}, + {value: 0x3008, lo: 0xb5, hi: 0xb7}, + {value: 0x3308, lo: 0xb8, hi: 0xbf}, + // Block 0xb9, offset 0x58f + {value: 0x0000, lo: 0x0f}, + {value: 0x3008, lo: 0x80, hi: 0x81}, + {value: 0x3b08, lo: 0x82, hi: 0x82}, + {value: 0x3308, lo: 0x83, hi: 0x84}, + {value: 0x3008, lo: 0x85, hi: 0x85}, + {value: 0x3308, lo: 0x86, hi: 0x86}, + {value: 0x0008, lo: 0x87, hi: 0x8a}, + {value: 0x0018, lo: 0x8b, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0x99}, + {value: 0x0040, lo: 0x9a, hi: 0x9a}, + {value: 0x0018, lo: 0x9b, hi: 0x9b}, + {value: 0x0040, lo: 0x9c, hi: 0x9c}, + {value: 0x0018, lo: 0x9d, hi: 0x9d}, + {value: 0x3308, lo: 0x9e, hi: 0x9e}, + {value: 0x0008, lo: 0x9f, hi: 0x9f}, + {value: 0x0040, lo: 0xa0, hi: 0xbf}, + // Block 0xba, offset 0x59f + {value: 0x0000, lo: 0x07}, + {value: 0x0008, lo: 0x80, hi: 0xaf}, + {value: 0x3008, lo: 0xb0, hi: 0xb2}, + {value: 0x3308, lo: 0xb3, hi: 0xb8}, + {value: 0x3008, lo: 0xb9, hi: 0xb9}, + {value: 0x3308, lo: 0xba, hi: 0xba}, + {value: 0x3008, lo: 0xbb, hi: 0xbe}, + {value: 0x3308, lo: 0xbf, hi: 0xbf}, + // Block 0xbb, offset 0x5a7 + {value: 0x0000, lo: 0x0a}, + {value: 0x3308, lo: 0x80, hi: 0x80}, + {value: 0x3008, lo: 0x81, hi: 0x81}, + {value: 0x3b08, lo: 0x82, hi: 0x82}, + {value: 0x3308, lo: 0x83, hi: 0x83}, + {value: 0x0008, lo: 0x84, hi: 0x85}, + {value: 0x0018, lo: 0x86, hi: 0x86}, + {value: 0x0008, lo: 0x87, hi: 0x87}, + {value: 0x0040, lo: 0x88, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0x99}, + {value: 0x0040, lo: 0x9a, hi: 0xbf}, + // Block 0xbc, offset 0x5b2 + {value: 0x0000, lo: 0x08}, + {value: 0x0008, lo: 0x80, hi: 0xae}, + {value: 0x3008, lo: 0xaf, hi: 0xb1}, + {value: 0x3308, lo: 0xb2, hi: 0xb5}, + {value: 0x0040, lo: 0xb6, hi: 0xb7}, + {value: 0x3008, lo: 0xb8, hi: 0xbb}, + {value: 0x3308, lo: 0xbc, hi: 0xbd}, + {value: 0x3008, lo: 0xbe, hi: 0xbe}, + {value: 0x3b08, lo: 0xbf, hi: 0xbf}, + // Block 0xbd, offset 0x5bb + {value: 0x0000, lo: 0x05}, + {value: 0x3308, lo: 0x80, hi: 0x80}, + {value: 0x0018, lo: 0x81, hi: 0x97}, + {value: 0x0008, lo: 0x98, hi: 0x9b}, + {value: 0x3308, lo: 0x9c, hi: 0x9d}, + {value: 0x0040, lo: 0x9e, hi: 0xbf}, + // Block 0xbe, offset 0x5c1 + {value: 0x0000, lo: 0x07}, + {value: 0x0008, lo: 0x80, hi: 0xaf}, + {value: 0x3008, lo: 0xb0, hi: 0xb2}, + {value: 0x3308, lo: 0xb3, hi: 0xba}, + {value: 0x3008, lo: 0xbb, hi: 0xbc}, + {value: 0x3308, lo: 0xbd, hi: 0xbd}, + {value: 0x3008, lo: 0xbe, hi: 0xbe}, + {value: 0x3b08, lo: 0xbf, hi: 0xbf}, + // Block 0xbf, offset 0x5c9 + {value: 0x0000, lo: 0x08}, + {value: 0x3308, lo: 0x80, hi: 0x80}, + {value: 0x0018, lo: 0x81, hi: 0x83}, + {value: 0x0008, lo: 0x84, hi: 0x84}, + {value: 0x0040, lo: 0x85, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0x99}, + {value: 0x0040, lo: 0x9a, hi: 0x9f}, + {value: 0x0018, lo: 0xa0, hi: 0xac}, + {value: 0x0040, lo: 0xad, hi: 0xbf}, + // Block 0xc0, offset 0x5d2 + {value: 0x0000, lo: 0x0a}, + {value: 0x0008, lo: 0x80, hi: 0xaa}, + {value: 0x3308, lo: 0xab, hi: 0xab}, + {value: 0x3008, lo: 0xac, hi: 0xac}, + {value: 0x3308, lo: 0xad, hi: 0xad}, + {value: 0x3008, lo: 0xae, hi: 0xaf}, + {value: 0x3308, lo: 0xb0, hi: 0xb5}, + {value: 0x3808, lo: 0xb6, hi: 0xb6}, + {value: 0x3308, lo: 0xb7, hi: 0xb7}, + {value: 0x0008, lo: 0xb8, hi: 0xb8}, + {value: 0x0040, lo: 0xb9, hi: 0xbf}, + // Block 0xc1, offset 0x5dd + {value: 0x0000, lo: 0x02}, + {value: 0x0008, lo: 0x80, hi: 0x89}, + {value: 0x0040, lo: 0x8a, hi: 0xbf}, + // Block 0xc2, offset 0x5e0 + {value: 0x0000, lo: 0x0b}, + {value: 0x0008, lo: 0x80, hi: 0x9a}, + {value: 0x0040, lo: 0x9b, hi: 0x9c}, + {value: 0x3308, lo: 0x9d, hi: 0x9f}, + {value: 0x3008, lo: 0xa0, hi: 0xa1}, + {value: 0x3308, lo: 0xa2, hi: 0xa5}, + {value: 0x3008, lo: 0xa6, hi: 0xa6}, + {value: 0x3308, lo: 0xa7, hi: 0xaa}, + {value: 0x3b08, lo: 0xab, hi: 0xab}, + {value: 0x0040, lo: 0xac, hi: 0xaf}, + {value: 0x0008, lo: 0xb0, hi: 0xb9}, + {value: 0x0018, lo: 0xba, hi: 0xbf}, + // Block 0xc3, offset 0x5ec + {value: 0x0000, lo: 0x08}, + {value: 0x0008, lo: 0x80, hi: 0xab}, + {value: 0x3008, lo: 0xac, hi: 0xae}, + {value: 0x3308, lo: 0xaf, hi: 0xb7}, + {value: 0x3008, lo: 0xb8, hi: 0xb8}, + {value: 0x3b08, lo: 0xb9, hi: 0xb9}, + {value: 0x3308, lo: 0xba, hi: 0xba}, + {value: 0x0018, lo: 0xbb, hi: 0xbb}, + {value: 0x0040, lo: 0xbc, hi: 0xbf}, + // Block 0xc4, offset 0x5f5 + {value: 0x0000, lo: 0x02}, + {value: 0x0040, lo: 0x80, hi: 0x9f}, + {value: 0x049d, lo: 0xa0, hi: 0xbf}, + // Block 0xc5, offset 0x5f8 + {value: 0x0000, lo: 0x04}, + {value: 0x0008, lo: 0x80, hi: 0xa9}, + {value: 0x0018, lo: 0xaa, hi: 0xb2}, + {value: 0x0040, lo: 0xb3, hi: 0xbe}, + {value: 0x0008, lo: 0xbf, hi: 0xbf}, + // Block 0xc6, offset 0x5fd + {value: 0x0000, lo: 0x04}, + {value: 0x0040, lo: 0x80, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xa7}, + {value: 0x0040, lo: 0xa8, hi: 0xa9}, + {value: 0x0008, lo: 0xaa, hi: 0xbf}, + // Block 0xc7, offset 0x602 + {value: 0x0000, lo: 0x0c}, + {value: 0x0008, lo: 0x80, hi: 0x90}, + {value: 0x3008, lo: 0x91, hi: 0x93}, + {value: 0x3308, lo: 0x94, hi: 0x97}, + {value: 0x0040, lo: 0x98, hi: 0x99}, + {value: 0x3308, lo: 0x9a, hi: 0x9b}, + {value: 0x3008, lo: 0x9c, hi: 0x9f}, + {value: 0x3b08, lo: 0xa0, hi: 0xa0}, + {value: 0x0008, lo: 0xa1, hi: 0xa1}, + {value: 0x0018, lo: 0xa2, hi: 0xa2}, + {value: 0x0008, lo: 0xa3, hi: 0xa3}, + {value: 0x3008, lo: 0xa4, hi: 0xa4}, + {value: 0x0040, lo: 0xa5, hi: 0xbf}, + // Block 0xc8, offset 0x60f + {value: 0x0000, lo: 0x0a}, + {value: 0x0008, lo: 0x80, hi: 0x80}, + {value: 0x3308, lo: 0x81, hi: 0x8a}, + {value: 0x0008, lo: 0x8b, hi: 0xb2}, + {value: 0x3308, lo: 0xb3, hi: 0xb3}, + {value: 0x3b08, lo: 0xb4, hi: 0xb4}, + {value: 0x3308, lo: 0xb5, hi: 0xb8}, + {value: 0x3008, lo: 0xb9, hi: 0xb9}, + {value: 0x0008, lo: 0xba, hi: 0xba}, + {value: 0x3308, lo: 0xbb, hi: 0xbe}, + {value: 0x0018, lo: 0xbf, hi: 0xbf}, + // Block 0xc9, offset 0x61a + {value: 0x0000, lo: 0x08}, + {value: 0x0018, lo: 0x80, hi: 0x86}, + {value: 0x3b08, lo: 0x87, hi: 0x87}, + {value: 0x0040, lo: 0x88, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0x90}, + {value: 0x3308, lo: 0x91, hi: 0x96}, + {value: 0x3008, lo: 0x97, hi: 0x98}, + {value: 0x3308, lo: 0x99, hi: 0x9b}, + {value: 0x0008, lo: 0x9c, hi: 0xbf}, + // Block 0xca, offset 0x623 + {value: 0x0000, lo: 0x09}, + {value: 0x0008, lo: 0x80, hi: 0x89}, + {value: 0x3308, lo: 0x8a, hi: 0x96}, + {value: 0x3008, lo: 0x97, hi: 0x97}, + {value: 0x3308, lo: 0x98, hi: 0x98}, + {value: 0x3b08, lo: 0x99, hi: 0x99}, + {value: 0x0018, lo: 0x9a, hi: 0x9c}, + {value: 0x0008, lo: 0x9d, hi: 0x9d}, + {value: 0x0018, lo: 0x9e, hi: 0xa2}, + {value: 0x0040, lo: 0xa3, hi: 0xbf}, + // Block 0xcb, offset 0x62d + {value: 0x0000, lo: 0x02}, + {value: 0x0008, lo: 0x80, hi: 0xb8}, + {value: 0x0040, lo: 0xb9, hi: 0xbf}, + // Block 0xcc, offset 0x630 + {value: 0x0000, lo: 0x09}, + {value: 0x0008, lo: 0x80, hi: 0x88}, + {value: 0x0040, lo: 0x89, hi: 0x89}, + {value: 0x0008, lo: 0x8a, hi: 0xae}, + {value: 0x3008, lo: 0xaf, hi: 0xaf}, + {value: 0x3308, lo: 0xb0, hi: 0xb6}, + {value: 0x0040, lo: 0xb7, hi: 0xb7}, + {value: 0x3308, lo: 0xb8, hi: 0xbd}, + {value: 0x3008, lo: 0xbe, hi: 0xbe}, + {value: 0x3b08, lo: 0xbf, hi: 0xbf}, + // Block 0xcd, offset 0x63a + {value: 0x0000, lo: 0x08}, + {value: 0x0008, lo: 0x80, hi: 0x80}, + {value: 0x0018, lo: 0x81, hi: 0x85}, + {value: 0x0040, lo: 0x86, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0x99}, + {value: 0x0018, lo: 0x9a, hi: 0xac}, + {value: 0x0040, lo: 0xad, hi: 0xaf}, + {value: 0x0018, lo: 0xb0, hi: 0xb1}, + {value: 0x0008, lo: 0xb2, hi: 0xbf}, + // Block 0xce, offset 0x643 + {value: 0x0000, lo: 0x0b}, + {value: 0x0008, lo: 0x80, hi: 0x8f}, + {value: 0x0040, lo: 0x90, hi: 0x91}, + {value: 0x3308, lo: 0x92, hi: 0xa7}, + {value: 0x0040, lo: 0xa8, hi: 0xa8}, + {value: 0x3008, lo: 0xa9, hi: 0xa9}, + {value: 0x3308, lo: 0xaa, hi: 0xb0}, + {value: 0x3008, lo: 0xb1, hi: 0xb1}, + {value: 0x3308, lo: 0xb2, hi: 0xb3}, + {value: 0x3008, lo: 0xb4, hi: 0xb4}, + {value: 0x3308, lo: 0xb5, hi: 0xb6}, + {value: 0x0040, lo: 0xb7, hi: 0xbf}, + // Block 0xcf, offset 0x64f + {value: 0x0000, lo: 0x0c}, + {value: 0x0008, lo: 0x80, hi: 0x86}, + {value: 0x0040, lo: 0x87, hi: 0x87}, + {value: 0x0008, lo: 0x88, hi: 0x89}, + {value: 0x0040, lo: 0x8a, hi: 0x8a}, + {value: 0x0008, lo: 0x8b, hi: 0xb0}, + {value: 0x3308, lo: 0xb1, hi: 0xb6}, + {value: 0x0040, lo: 0xb7, hi: 0xb9}, + {value: 0x3308, lo: 0xba, hi: 0xba}, + {value: 0x0040, lo: 0xbb, hi: 0xbb}, + {value: 0x3308, lo: 0xbc, hi: 0xbd}, + {value: 0x0040, lo: 0xbe, hi: 0xbe}, + {value: 0x3308, lo: 0xbf, hi: 0xbf}, + // Block 0xd0, offset 0x65c + {value: 0x0000, lo: 0x0c}, + {value: 0x3308, lo: 0x80, hi: 0x83}, + {value: 0x3b08, lo: 0x84, hi: 0x85}, + {value: 0x0008, lo: 0x86, hi: 0x86}, + {value: 0x3308, lo: 0x87, hi: 0x87}, + {value: 0x0040, lo: 0x88, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0x99}, + {value: 0x0040, lo: 0x9a, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xa5}, + {value: 0x0040, lo: 0xa6, hi: 0xa6}, + {value: 0x0008, lo: 0xa7, hi: 0xa8}, + {value: 0x0040, lo: 0xa9, hi: 0xa9}, + {value: 0x0008, lo: 0xaa, hi: 0xbf}, + // Block 0xd1, offset 0x669 + {value: 0x0000, lo: 0x0d}, + {value: 0x0008, lo: 0x80, hi: 0x89}, + {value: 0x3008, lo: 0x8a, hi: 0x8e}, + {value: 0x0040, lo: 0x8f, hi: 0x8f}, + {value: 0x3308, lo: 0x90, hi: 0x91}, + {value: 0x0040, lo: 0x92, hi: 0x92}, + {value: 0x3008, lo: 0x93, hi: 0x94}, + {value: 0x3308, lo: 0x95, hi: 0x95}, + {value: 0x3008, lo: 0x96, hi: 0x96}, + {value: 0x3b08, lo: 0x97, hi: 0x97}, + {value: 0x0008, lo: 0x98, hi: 0x98}, + {value: 0x0040, lo: 0x99, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xa9}, + {value: 0x0040, lo: 0xaa, hi: 0xbf}, + // Block 0xd2, offset 0x677 + {value: 0x0000, lo: 0x06}, + {value: 0x0040, lo: 0x80, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xb2}, + {value: 0x3308, lo: 0xb3, hi: 0xb4}, + {value: 0x3008, lo: 0xb5, hi: 0xb6}, + {value: 0x0018, lo: 0xb7, hi: 0xb8}, + {value: 0x0040, lo: 0xb9, hi: 0xbf}, + // Block 0xd3, offset 0x67e + {value: 0x0000, lo: 0x03}, + {value: 0x0018, lo: 0x80, hi: 0xb1}, + {value: 0x0040, lo: 0xb2, hi: 0xbe}, + {value: 0x0018, lo: 0xbf, hi: 0xbf}, + // Block 0xd4, offset 0x682 + {value: 0x0000, lo: 0x02}, + {value: 0x0008, lo: 0x80, hi: 0x99}, + {value: 0x0040, lo: 0x9a, hi: 0xbf}, + // Block 0xd5, offset 0x685 + {value: 0x0000, lo: 0x04}, + {value: 0x0018, lo: 0x80, hi: 0xae}, + {value: 0x0040, lo: 0xaf, hi: 0xaf}, + {value: 0x0018, lo: 0xb0, hi: 0xb4}, + {value: 0x0040, lo: 0xb5, hi: 0xbf}, + // Block 0xd6, offset 0x68a + {value: 0x0000, lo: 0x02}, + {value: 0x0008, lo: 0x80, hi: 0x83}, + {value: 0x0040, lo: 0x84, hi: 0xbf}, + // Block 0xd7, offset 0x68d + {value: 0x0000, lo: 0x04}, + {value: 0x0008, lo: 0x80, hi: 0xae}, + {value: 0x0040, lo: 0xaf, hi: 0xaf}, + {value: 0x0340, lo: 0xb0, hi: 0xb8}, + {value: 0x0040, lo: 0xb9, hi: 0xbf}, + // Block 0xd8, offset 0x692 + {value: 0x0000, lo: 0x02}, + {value: 0x0008, lo: 0x80, hi: 0x86}, + {value: 0x0040, lo: 0x87, hi: 0xbf}, + // Block 0xd9, offset 0x695 + {value: 0x0000, lo: 0x06}, + {value: 0x0008, lo: 0x80, hi: 0x9e}, + {value: 0x0040, lo: 0x9f, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xa9}, + {value: 0x0040, lo: 0xaa, hi: 0xad}, + {value: 0x0018, lo: 0xae, hi: 0xaf}, + {value: 0x0040, lo: 0xb0, hi: 0xbf}, + // Block 0xda, offset 0x69c + {value: 0x0000, lo: 0x06}, + {value: 0x0040, lo: 0x80, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0xad}, + {value: 0x0040, lo: 0xae, hi: 0xaf}, + {value: 0x3308, lo: 0xb0, hi: 0xb4}, + {value: 0x0018, lo: 0xb5, hi: 0xb5}, + {value: 0x0040, lo: 0xb6, hi: 0xbf}, + // Block 0xdb, offset 0x6a3 + {value: 0x0000, lo: 0x03}, + {value: 0x0008, lo: 0x80, hi: 0xaf}, + {value: 0x3308, lo: 0xb0, hi: 0xb6}, + {value: 0x0018, lo: 0xb7, hi: 0xbf}, + // Block 0xdc, offset 0x6a7 + {value: 0x0000, lo: 0x0a}, + {value: 0x0008, lo: 0x80, hi: 0x83}, + {value: 0x0018, lo: 0x84, hi: 0x85}, + {value: 0x0040, lo: 0x86, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0x99}, + {value: 0x0040, lo: 0x9a, hi: 0x9a}, + {value: 0x0018, lo: 0x9b, hi: 0xa1}, + {value: 0x0040, lo: 0xa2, hi: 0xa2}, + {value: 0x0008, lo: 0xa3, hi: 0xb7}, + {value: 0x0040, lo: 0xb8, hi: 0xbc}, + {value: 0x0008, lo: 0xbd, hi: 0xbf}, + // Block 0xdd, offset 0x6b2 + {value: 0x0000, lo: 0x02}, + {value: 0x0008, lo: 0x80, hi: 0x8f}, + {value: 0x0040, lo: 0x90, hi: 0xbf}, + // Block 0xde, offset 0x6b5 + {value: 0x0000, lo: 0x02}, + {value: 0xe105, lo: 0x80, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xbf}, + // Block 0xdf, offset 0x6b8 + {value: 0x0000, lo: 0x02}, + {value: 0x0018, lo: 0x80, hi: 0x9a}, + {value: 0x0040, lo: 0x9b, hi: 0xbf}, + // Block 0xe0, offset 0x6bb + {value: 0x0000, lo: 0x05}, + {value: 0x0008, lo: 0x80, hi: 0x8a}, + {value: 0x0040, lo: 0x8b, hi: 0x8e}, + {value: 0x3308, lo: 0x8f, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0x90}, + {value: 0x3008, lo: 0x91, hi: 0xbf}, + // Block 0xe1, offset 0x6c1 + {value: 0x0000, lo: 0x05}, + {value: 0x3008, lo: 0x80, hi: 0x87}, + {value: 0x0040, lo: 0x88, hi: 0x8e}, + {value: 0x3308, lo: 0x8f, hi: 0x92}, + {value: 0x0008, lo: 0x93, hi: 0x9f}, + {value: 0x0040, lo: 0xa0, hi: 0xbf}, + // Block 0xe2, offset 0x6c7 + {value: 0x0000, lo: 0x05}, + {value: 0x0040, lo: 0x80, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xa1}, + {value: 0x0018, lo: 0xa2, hi: 0xa2}, + {value: 0x0008, lo: 0xa3, hi: 0xa3}, + {value: 0x0040, lo: 0xa4, hi: 0xbf}, + // Block 0xe3, offset 0x6cd + {value: 0x0000, lo: 0x02}, + {value: 0x0008, lo: 0x80, hi: 0xb7}, + {value: 0x0040, lo: 0xb8, hi: 0xbf}, + // Block 0xe4, offset 0x6d0 + {value: 0x0000, lo: 0x02}, + {value: 0x0008, lo: 0x80, hi: 0xb2}, + {value: 0x0040, lo: 0xb3, hi: 0xbf}, + // Block 0xe5, offset 0x6d3 + {value: 0x0000, lo: 0x02}, + {value: 0x0008, lo: 0x80, hi: 0x9e}, + {value: 0x0040, lo: 0x9f, hi: 0xbf}, + // Block 0xe6, offset 0x6d6 + {value: 0x0000, lo: 0x06}, + {value: 0x0040, lo: 0x80, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0x92}, + {value: 0x0040, lo: 0x93, hi: 0xa3}, + {value: 0x0008, lo: 0xa4, hi: 0xa7}, + {value: 0x0040, lo: 0xa8, hi: 0xaf}, + {value: 0x0008, lo: 0xb0, hi: 0xbf}, + // Block 0xe7, offset 0x6dd + {value: 0x0000, lo: 0x02}, + {value: 0x0008, lo: 0x80, hi: 0xbb}, + {value: 0x0040, lo: 0xbc, hi: 0xbf}, + // Block 0xe8, offset 0x6e0 + {value: 0x0000, lo: 0x04}, + {value: 0x0008, lo: 0x80, hi: 0xaa}, + {value: 0x0040, lo: 0xab, hi: 0xaf}, + {value: 0x0008, lo: 0xb0, hi: 0xbc}, + {value: 0x0040, lo: 0xbd, hi: 0xbf}, + // Block 0xe9, offset 0x6e5 + {value: 0x0000, lo: 0x09}, + {value: 0x0008, lo: 0x80, hi: 0x88}, + {value: 0x0040, lo: 0x89, hi: 0x8f}, + {value: 0x0008, lo: 0x90, hi: 0x99}, + {value: 0x0040, lo: 0x9a, hi: 0x9b}, + {value: 0x0018, lo: 0x9c, hi: 0x9c}, + {value: 0x3308, lo: 0x9d, hi: 0x9e}, + {value: 0x0018, lo: 0x9f, hi: 0x9f}, + {value: 0x03c0, lo: 0xa0, hi: 0xa3}, + {value: 0x0040, lo: 0xa4, hi: 0xbf}, + // Block 0xea, offset 0x6ef + {value: 0x0000, lo: 0x02}, + {value: 0x0018, lo: 0x80, hi: 0xb5}, + {value: 0x0040, lo: 0xb6, hi: 0xbf}, + // Block 0xeb, offset 0x6f2 + {value: 0x0000, lo: 0x03}, + {value: 0x0018, lo: 0x80, hi: 0xa6}, + {value: 0x0040, lo: 0xa7, hi: 0xa8}, + {value: 0x0018, lo: 0xa9, hi: 0xbf}, + // Block 0xec, offset 0x6f6 + {value: 0x0000, lo: 0x0e}, + {value: 0x0018, lo: 0x80, hi: 0x9d}, + {value: 0xb5b9, lo: 0x9e, hi: 0x9e}, + {value: 0xb601, lo: 0x9f, hi: 0x9f}, + {value: 0xb649, lo: 0xa0, hi: 0xa0}, + {value: 0xb6b1, lo: 0xa1, hi: 0xa1}, + {value: 0xb719, lo: 0xa2, hi: 0xa2}, + {value: 0xb781, lo: 0xa3, hi: 0xa3}, + {value: 0xb7e9, lo: 0xa4, hi: 0xa4}, + {value: 0x3018, lo: 0xa5, hi: 0xa6}, + {value: 0x3318, lo: 0xa7, hi: 0xa9}, + {value: 0x0018, lo: 0xaa, hi: 0xac}, + {value: 0x3018, lo: 0xad, hi: 0xb2}, + {value: 0x0340, lo: 0xb3, hi: 0xba}, + {value: 0x3318, lo: 0xbb, hi: 0xbf}, + // Block 0xed, offset 0x705 + {value: 0x0000, lo: 0x0b}, + {value: 0x3318, lo: 0x80, hi: 0x82}, + {value: 0x0018, lo: 0x83, hi: 0x84}, + {value: 0x3318, lo: 0x85, hi: 0x8b}, + {value: 0x0018, lo: 0x8c, hi: 0xa9}, + {value: 0x3318, lo: 0xaa, hi: 0xad}, + {value: 0x0018, lo: 0xae, hi: 0xba}, + {value: 0xb851, lo: 0xbb, hi: 0xbb}, + {value: 0xb899, lo: 0xbc, hi: 0xbc}, + {value: 0xb8e1, lo: 0xbd, hi: 0xbd}, + {value: 0xb949, lo: 0xbe, hi: 0xbe}, + {value: 0xb9b1, lo: 0xbf, hi: 0xbf}, + // Block 0xee, offset 0x711 + {value: 0x0000, lo: 0x03}, + {value: 0xba19, lo: 0x80, hi: 0x80}, + {value: 0x0018, lo: 0x81, hi: 0xa8}, + {value: 0x0040, lo: 0xa9, hi: 0xbf}, + // Block 0xef, offset 0x715 + {value: 0x0000, lo: 0x04}, + {value: 0x0018, lo: 0x80, hi: 0x81}, + {value: 0x3318, lo: 0x82, hi: 0x84}, + {value: 0x0018, lo: 0x85, hi: 0x85}, + {value: 0x0040, lo: 0x86, hi: 0xbf}, + // Block 0xf0, offset 0x71a + {value: 0x0000, lo: 0x03}, + {value: 0x0040, lo: 0x80, hi: 0x9f}, + {value: 0x0018, lo: 0xa0, hi: 0xb3}, + {value: 0x0040, lo: 0xb4, hi: 0xbf}, + // Block 0xf1, offset 0x71e + {value: 0x0000, lo: 0x04}, + {value: 0x0018, lo: 0x80, hi: 0x96}, + {value: 0x0040, lo: 0x97, hi: 0x9f}, + {value: 0x0018, lo: 0xa0, hi: 0xb8}, + {value: 0x0040, lo: 0xb9, hi: 0xbf}, + // Block 0xf2, offset 0x723 + {value: 0x0000, lo: 0x03}, + {value: 0x3308, lo: 0x80, hi: 0xb6}, + {value: 0x0018, lo: 0xb7, hi: 0xba}, + {value: 0x3308, lo: 0xbb, hi: 0xbf}, + // Block 0xf3, offset 0x727 + {value: 0x0000, lo: 0x04}, + {value: 0x3308, lo: 0x80, hi: 0xac}, + {value: 0x0018, lo: 0xad, hi: 0xb4}, + {value: 0x3308, lo: 0xb5, hi: 0xb5}, + {value: 0x0018, lo: 0xb6, hi: 0xbf}, + // Block 0xf4, offset 0x72c + {value: 0x0000, lo: 0x08}, + {value: 0x0018, lo: 0x80, hi: 0x83}, + {value: 0x3308, lo: 0x84, hi: 0x84}, + {value: 0x0018, lo: 0x85, hi: 0x8b}, + {value: 0x0040, lo: 0x8c, hi: 0x9a}, + {value: 0x3308, lo: 0x9b, hi: 0x9f}, + {value: 0x0040, lo: 0xa0, hi: 0xa0}, + {value: 0x3308, lo: 0xa1, hi: 0xaf}, + {value: 0x0040, lo: 0xb0, hi: 0xbf}, + // Block 0xf5, offset 0x735 + {value: 0x0000, lo: 0x0a}, + {value: 0x3308, lo: 0x80, hi: 0x86}, + {value: 0x0040, lo: 0x87, hi: 0x87}, + {value: 0x3308, lo: 0x88, hi: 0x98}, + {value: 0x0040, lo: 0x99, hi: 0x9a}, + {value: 0x3308, lo: 0x9b, hi: 0xa1}, + {value: 0x0040, lo: 0xa2, hi: 0xa2}, + {value: 0x3308, lo: 0xa3, hi: 0xa4}, + {value: 0x0040, lo: 0xa5, hi: 0xa5}, + {value: 0x3308, lo: 0xa6, hi: 0xaa}, + {value: 0x0040, lo: 0xab, hi: 0xbf}, + // Block 0xf6, offset 0x740 + {value: 0x0000, lo: 0x05}, + {value: 0x0008, lo: 0x80, hi: 0xac}, + {value: 0x0040, lo: 0xad, hi: 0xaf}, + {value: 0x3308, lo: 0xb0, hi: 0xb6}, + {value: 0x0008, lo: 0xb7, hi: 0xbd}, + {value: 0x0040, lo: 0xbe, hi: 0xbf}, + // Block 0xf7, offset 0x746 + {value: 0x0000, lo: 0x05}, + {value: 0x0008, lo: 0x80, hi: 0x89}, + {value: 0x0040, lo: 0x8a, hi: 0x8d}, + {value: 0x0008, lo: 0x8e, hi: 0x8e}, + {value: 0x0018, lo: 0x8f, hi: 0x8f}, + {value: 0x0040, lo: 0x90, hi: 0xbf}, + // Block 0xf8, offset 0x74c + {value: 0x0000, lo: 0x05}, + {value: 0x0008, lo: 0x80, hi: 0xab}, + {value: 0x3308, lo: 0xac, hi: 0xaf}, + {value: 0x0008, lo: 0xb0, hi: 0xb9}, + {value: 0x0040, lo: 0xba, hi: 0xbe}, + {value: 0x0018, lo: 0xbf, hi: 0xbf}, + // Block 0xf9, offset 0x752 + {value: 0x0000, lo: 0x05}, + {value: 0x0808, lo: 0x80, hi: 0x84}, + {value: 0x0040, lo: 0x85, hi: 0x86}, + {value: 0x0818, lo: 0x87, hi: 0x8f}, + {value: 0x3308, lo: 0x90, hi: 0x96}, + {value: 0x0040, lo: 0x97, hi: 0xbf}, + // Block 0xfa, offset 0x758 + {value: 0x0000, lo: 0x08}, + {value: 0x0a08, lo: 0x80, hi: 0x83}, + {value: 0x3308, lo: 0x84, hi: 0x8a}, + {value: 0x0b08, lo: 0x8b, hi: 0x8b}, + {value: 0x0040, lo: 0x8c, hi: 0x8f}, + {value: 0x0808, lo: 0x90, hi: 0x99}, + {value: 0x0040, lo: 0x9a, hi: 0x9d}, + {value: 0x0818, lo: 0x9e, hi: 0x9f}, + {value: 0x0040, lo: 0xa0, hi: 0xbf}, + // Block 0xfb, offset 0x761 + {value: 0x0000, lo: 0x02}, + {value: 0x0040, lo: 0x80, hi: 0xb0}, + {value: 0x0818, lo: 0xb1, hi: 0xbf}, + // Block 0xfc, offset 0x764 + {value: 0x0000, lo: 0x02}, + {value: 0x0818, lo: 0x80, hi: 0xb4}, + {value: 0x0040, lo: 0xb5, hi: 0xbf}, + // Block 0xfd, offset 0x767 + {value: 0x0000, lo: 0x03}, + {value: 0x0040, lo: 0x80, hi: 0x80}, + {value: 0x0818, lo: 0x81, hi: 0xbd}, + {value: 0x0040, lo: 0xbe, hi: 0xbf}, + // Block 0xfe, offset 0x76b + {value: 0x0000, lo: 0x03}, + {value: 0x0040, lo: 0x80, hi: 0xaf}, + {value: 0x0018, lo: 0xb0, hi: 0xb1}, + {value: 0x0040, lo: 0xb2, hi: 0xbf}, + // Block 0xff, offset 0x76f + {value: 0x0000, lo: 0x03}, + {value: 0x0018, lo: 0x80, hi: 0xab}, + {value: 0x0040, lo: 0xac, hi: 0xaf}, + {value: 0x0018, lo: 0xb0, hi: 0xbf}, + // Block 0x100, offset 0x773 + {value: 0x0000, lo: 0x05}, + {value: 0x0018, lo: 0x80, hi: 0x93}, + {value: 0x0040, lo: 0x94, hi: 0x9f}, + {value: 0x0018, lo: 0xa0, hi: 0xae}, + {value: 0x0040, lo: 0xaf, hi: 0xb0}, + {value: 0x0018, lo: 0xb1, hi: 0xbf}, + // Block 0x101, offset 0x779 + {value: 0x0000, lo: 0x05}, + {value: 0x0040, lo: 0x80, hi: 0x80}, + {value: 0x0018, lo: 0x81, hi: 0x8f}, + {value: 0x0040, lo: 0x90, hi: 0x90}, + {value: 0x0018, lo: 0x91, hi: 0xb5}, + {value: 0x0040, lo: 0xb6, hi: 0xbf}, + // Block 0x102, offset 0x77f + {value: 0x0000, lo: 0x04}, + {value: 0x0018, lo: 0x80, hi: 0x8f}, + {value: 0xc1d9, lo: 0x90, hi: 0x90}, + {value: 0x0018, lo: 0x91, hi: 0xac}, + {value: 0x0040, lo: 0xad, hi: 0xbf}, + // Block 0x103, offset 0x784 + {value: 0x0000, lo: 0x02}, + {value: 0x0040, lo: 0x80, hi: 0xa5}, + {value: 0x0018, lo: 0xa6, hi: 0xbf}, + // Block 0x104, offset 0x787 + {value: 0x0000, lo: 0x0f}, + {value: 0xc801, lo: 0x80, hi: 0x80}, + {value: 0xc851, lo: 0x81, hi: 0x81}, + {value: 0xc8a1, lo: 0x82, hi: 0x82}, + {value: 0xc8f1, lo: 0x83, hi: 0x83}, + {value: 0xc941, lo: 0x84, hi: 0x84}, + {value: 0xc991, lo: 0x85, hi: 0x85}, + {value: 0xc9e1, lo: 0x86, hi: 0x86}, + {value: 0xca31, lo: 0x87, hi: 0x87}, + {value: 0xca81, lo: 0x88, hi: 0x88}, + {value: 0x0040, lo: 0x89, hi: 0x8f}, + {value: 0xcad1, lo: 0x90, hi: 0x90}, + {value: 0xcaf1, lo: 0x91, hi: 0x91}, + {value: 0x0040, lo: 0x92, hi: 0x9f}, + {value: 0x0018, lo: 0xa0, hi: 0xa5}, + {value: 0x0040, lo: 0xa6, hi: 0xbf}, + // Block 0x105, offset 0x797 + {value: 0x0000, lo: 0x06}, + {value: 0x0018, lo: 0x80, hi: 0x95}, + {value: 0x0040, lo: 0x96, hi: 0x9f}, + {value: 0x0018, lo: 0xa0, hi: 0xac}, + {value: 0x0040, lo: 0xad, hi: 0xaf}, + {value: 0x0018, lo: 0xb0, hi: 0xba}, + {value: 0x0040, lo: 0xbb, hi: 0xbf}, + // Block 0x106, offset 0x79e + {value: 0x0000, lo: 0x02}, + {value: 0x0018, lo: 0x80, hi: 0xb3}, + {value: 0x0040, lo: 0xb4, hi: 0xbf}, + // Block 0x107, offset 0x7a1 + {value: 0x0000, lo: 0x04}, + {value: 0x0018, lo: 0x80, hi: 0x98}, + {value: 0x0040, lo: 0x99, hi: 0x9f}, + {value: 0x0018, lo: 0xa0, hi: 0xab}, + {value: 0x0040, lo: 0xac, hi: 0xbf}, + // Block 0x108, offset 0x7a6 + {value: 0x0000, lo: 0x03}, + {value: 0x0018, lo: 0x80, hi: 0x8b}, + {value: 0x0040, lo: 0x8c, hi: 0x8f}, + {value: 0x0018, lo: 0x90, hi: 0xbf}, + // Block 0x109, offset 0x7aa + {value: 0x0000, lo: 0x05}, + {value: 0x0018, lo: 0x80, hi: 0x87}, + {value: 0x0040, lo: 0x88, hi: 0x8f}, + {value: 0x0018, lo: 0x90, hi: 0x99}, + {value: 0x0040, lo: 0x9a, hi: 0x9f}, + {value: 0x0018, lo: 0xa0, hi: 0xbf}, + // Block 0x10a, offset 0x7b0 + {value: 0x0000, lo: 0x04}, + {value: 0x0018, lo: 0x80, hi: 0x87}, + {value: 0x0040, lo: 0x88, hi: 0x8f}, + {value: 0x0018, lo: 0x90, hi: 0xad}, + {value: 0x0040, lo: 0xae, hi: 0xbf}, + // Block 0x10b, offset 0x7b5 + {value: 0x0000, lo: 0x03}, + {value: 0x0018, lo: 0x80, hi: 0x8b}, + {value: 0x0040, lo: 0x8c, hi: 0x8c}, + {value: 0x0018, lo: 0x8d, hi: 0xbf}, + // Block 0x10c, offset 0x7b9 + {value: 0x0000, lo: 0x05}, + {value: 0x0018, lo: 0x80, hi: 0xb1}, + {value: 0x0040, lo: 0xb2, hi: 0xb2}, + {value: 0x0018, lo: 0xb3, hi: 0xb6}, + {value: 0x0040, lo: 0xb7, hi: 0xb9}, + {value: 0x0018, lo: 0xba, hi: 0xbf}, + // Block 0x10d, offset 0x7bf + {value: 0x0000, lo: 0x05}, + {value: 0x0018, lo: 0x80, hi: 0xa2}, + {value: 0x0040, lo: 0xa3, hi: 0xa4}, + {value: 0x0018, lo: 0xa5, hi: 0xaa}, + {value: 0x0040, lo: 0xab, hi: 0xad}, + {value: 0x0018, lo: 0xae, hi: 0xbf}, + // Block 0x10e, offset 0x7c5 + {value: 0x0000, lo: 0x03}, + {value: 0x0018, lo: 0x80, hi: 0x8a}, + {value: 0x0040, lo: 0x8b, hi: 0x8c}, + {value: 0x0018, lo: 0x8d, hi: 0xbf}, + // Block 0x10f, offset 0x7c9 + {value: 0x0000, lo: 0x08}, + {value: 0x0018, lo: 0x80, hi: 0x93}, + {value: 0x0040, lo: 0x94, hi: 0x9f}, + {value: 0x0018, lo: 0xa0, hi: 0xad}, + {value: 0x0040, lo: 0xae, hi: 0xaf}, + {value: 0x0018, lo: 0xb0, hi: 0xb3}, + {value: 0x0040, lo: 0xb4, hi: 0xb7}, + {value: 0x0018, lo: 0xb8, hi: 0xba}, + {value: 0x0040, lo: 0xbb, hi: 0xbf}, + // Block 0x110, offset 0x7d2 + {value: 0x0000, lo: 0x04}, + {value: 0x0018, lo: 0x80, hi: 0x82}, + {value: 0x0040, lo: 0x83, hi: 0x8f}, + {value: 0x0018, lo: 0x90, hi: 0x95}, + {value: 0x0040, lo: 0x96, hi: 0xbf}, + // Block 0x111, offset 0x7d7 + {value: 0x0000, lo: 0x02}, + {value: 0x0008, lo: 0x80, hi: 0x96}, + {value: 0x0040, lo: 0x97, hi: 0xbf}, + // Block 0x112, offset 0x7da + {value: 0x0000, lo: 0x02}, + {value: 0x0008, lo: 0x80, hi: 0xb4}, + {value: 0x0040, lo: 0xb5, hi: 0xbf}, + // Block 0x113, offset 0x7dd + {value: 0x0000, lo: 0x03}, + {value: 0x0008, lo: 0x80, hi: 0x9d}, + {value: 0x0040, lo: 0x9e, hi: 0x9f}, + {value: 0x0008, lo: 0xa0, hi: 0xbf}, + // Block 0x114, offset 0x7e1 + {value: 0x0000, lo: 0x03}, + {value: 0x0008, lo: 0x80, hi: 0xa1}, + {value: 0x0040, lo: 0xa2, hi: 0xaf}, + {value: 0x0008, lo: 0xb0, hi: 0xbf}, + // Block 0x115, offset 0x7e5 + {value: 0x0000, lo: 0x02}, + {value: 0x0008, lo: 0x80, hi: 0xa0}, + {value: 0x0040, lo: 0xa1, hi: 0xbf}, + // Block 0x116, offset 0x7e8 + {value: 0x0020, lo: 0x0f}, + {value: 0xded1, lo: 0x80, hi: 0x89}, + {value: 0x8e35, lo: 0x8a, hi: 0x8a}, + {value: 0xe011, lo: 0x8b, hi: 0x9c}, + {value: 0x8e55, lo: 0x9d, hi: 0x9d}, + {value: 0xe251, lo: 0x9e, hi: 0xa2}, + {value: 0x8e75, lo: 0xa3, hi: 0xa3}, + {value: 0xe2f1, lo: 0xa4, hi: 0xab}, + {value: 0x7f0d, lo: 0xac, hi: 0xac}, + {value: 0xe3f1, lo: 0xad, hi: 0xaf}, + {value: 0x8e95, lo: 0xb0, hi: 0xb0}, + {value: 0xe451, lo: 0xb1, hi: 0xb6}, + {value: 0x8eb5, lo: 0xb7, hi: 0xb9}, + {value: 0xe511, lo: 0xba, hi: 0xba}, + {value: 0x8f15, lo: 0xbb, hi: 0xbb}, + {value: 0xe531, lo: 0xbc, hi: 0xbf}, + // Block 0x117, offset 0x7f8 + {value: 0x0020, lo: 0x10}, + {value: 0x93b5, lo: 0x80, hi: 0x80}, + {value: 0xf0b1, lo: 0x81, hi: 0x86}, + {value: 0x93d5, lo: 0x87, hi: 0x8a}, + {value: 0xda11, lo: 0x8b, hi: 0x8b}, + {value: 0xf171, lo: 0x8c, hi: 0x96}, + {value: 0x9455, lo: 0x97, hi: 0x97}, + {value: 0xf2d1, lo: 0x98, hi: 0xa3}, + {value: 0x9475, lo: 0xa4, hi: 0xa6}, + {value: 0xf451, lo: 0xa7, hi: 0xaa}, + {value: 0x94d5, lo: 0xab, hi: 0xab}, + {value: 0xf4d1, lo: 0xac, hi: 0xac}, + {value: 0x94f5, lo: 0xad, hi: 0xad}, + {value: 0xf4f1, lo: 0xae, hi: 0xaf}, + {value: 0x9515, lo: 0xb0, hi: 0xb1}, + {value: 0xf531, lo: 0xb2, hi: 0xbe}, + {value: 0x2040, lo: 0xbf, hi: 0xbf}, + // Block 0x118, offset 0x809 + {value: 0x0000, lo: 0x04}, + {value: 0x0040, lo: 0x80, hi: 0x80}, + {value: 0x0340, lo: 0x81, hi: 0x81}, + {value: 0x0040, lo: 0x82, hi: 0x9f}, + {value: 0x0340, lo: 0xa0, hi: 0xbf}, + // Block 0x119, offset 0x80e + {value: 0x0000, lo: 0x01}, + {value: 0x0340, lo: 0x80, hi: 0xbf}, + // Block 0x11a, offset 0x810 + {value: 0x0000, lo: 0x01}, + {value: 0x33c0, lo: 0x80, hi: 0xbf}, + // Block 0x11b, offset 0x812 + {value: 0x0000, lo: 0x02}, + {value: 0x33c0, lo: 0x80, hi: 0xaf}, + {value: 0x0040, lo: 0xb0, hi: 0xbf}, +} + +// Total table size 42780 bytes (41KiB); checksum: 29936AB9 diff --git a/vendor/golang.org/x/oauth2/.travis.yml b/vendor/golang.org/x/oauth2/.travis.yml deleted file mode 100644 index fa139db..0000000 --- a/vendor/golang.org/x/oauth2/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: go - -go: - - tip - -install: - - export GOPATH="$HOME/gopath" - - mkdir -p "$GOPATH/src/golang.org/x" - - mv "$TRAVIS_BUILD_DIR" "$GOPATH/src/golang.org/x/oauth2" - - go get -v -t -d golang.org/x/oauth2/... - -script: - - go test -v golang.org/x/oauth2/... diff --git a/vendor/golang.org/x/oauth2/CONTRIBUTING.md b/vendor/golang.org/x/oauth2/CONTRIBUTING.md deleted file mode 100644 index dfbed62..0000000 --- a/vendor/golang.org/x/oauth2/CONTRIBUTING.md +++ /dev/null @@ -1,26 +0,0 @@ -# Contributing to Go - -Go is an open source project. - -It is the work of hundreds of contributors. We appreciate your help! - -## Filing issues - -When [filing an issue](https://github.com/golang/oauth2/issues), make sure to answer these five questions: - -1. What version of Go are you using (`go version`)? -2. What operating system and processor architecture are you using? -3. What did you do? -4. What did you expect to see? -5. What did you see instead? - -General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. -The gophers there will answer or ask you to file an issue if you've tripped over a bug. - -## Contributing code - -Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) -before sending patches. - -Unless otherwise noted, the Go source files are distributed under -the BSD-style license found in the LICENSE file. diff --git a/vendor/golang.org/x/oauth2/README.md b/vendor/golang.org/x/oauth2/README.md deleted file mode 100644 index 8cfd606..0000000 --- a/vendor/golang.org/x/oauth2/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# OAuth2 for Go - -[![Build Status](https://travis-ci.org/golang/oauth2.svg?branch=master)](https://travis-ci.org/golang/oauth2) -[![GoDoc](https://godoc.org/golang.org/x/oauth2?status.svg)](https://godoc.org/golang.org/x/oauth2) - -oauth2 package contains a client implementation for OAuth 2.0 spec. - -## Installation - -~~~~ -go get golang.org/x/oauth2 -~~~~ - -Or you can manually git clone the repository to -`$(go env GOPATH)/src/golang.org/x/oauth2`. - -See godoc for further documentation and examples. - -* [godoc.org/golang.org/x/oauth2](https://godoc.org/golang.org/x/oauth2) -* [godoc.org/golang.org/x/oauth2/google](https://godoc.org/golang.org/x/oauth2/google) - -## Policy for new packages - -We no longer accept new provider-specific packages in this repo if all -they do is add a single endpoint variable. If you just want to add a -single endpoint, add it to the -[godoc.org/golang.org/x/oauth2/endpoints](https://godoc.org/golang.org/x/oauth2/endpoints) -package. - -## Report Issues / Send Patches - -This repository uses Gerrit for code changes. To learn how to submit changes to -this repository, see https://golang.org/doc/contribute.html. - -The main issue tracker for the oauth2 repository is located at -https://github.com/golang/oauth2/issues. diff --git a/vendor/golang.org/x/oauth2/go.mod b/vendor/golang.org/x/oauth2/go.mod deleted file mode 100644 index b345781..0000000 --- a/vendor/golang.org/x/oauth2/go.mod +++ /dev/null @@ -1,10 +0,0 @@ -module golang.org/x/oauth2 - -go 1.11 - -require ( - cloud.google.com/go v0.34.0 - golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e - golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 // indirect - google.golang.org/appengine v1.4.0 -) diff --git a/vendor/golang.org/x/oauth2/go.sum b/vendor/golang.org/x/oauth2/go.sum deleted file mode 100644 index 6f0079b..0000000 --- a/vendor/golang.org/x/oauth2/go.sum +++ /dev/null @@ -1,12 +0,0 @@ -cloud.google.com/go v0.34.0 h1:eOI3/cP2VTU6uZLDYAoic+eyzzB9YyGmJ7eIjl8rOPg= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/vendor/golang.org/x/oauth2/transport.go b/vendor/golang.org/x/oauth2/transport.go index 9065791..aa0d34f 100644 --- a/vendor/golang.org/x/oauth2/transport.go +++ b/vendor/golang.org/x/oauth2/transport.go @@ -6,7 +6,7 @@ package oauth2 import ( "errors" - "log" + "io" "net/http" "sync" ) @@ -25,6 +25,9 @@ type Transport struct { // Base is the base RoundTripper used to make HTTP requests. // If nil, http.DefaultTransport is used. Base http.RoundTripper + + mu sync.Mutex // guards modReq + modReq map[*http.Request]*http.Request // original -> modified } // RoundTrip authorizes and authenticates the request with an @@ -49,22 +52,35 @@ func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { req2 := cloneRequest(req) // per RoundTripper contract token.SetAuthHeader(req2) + t.setModReq(req, req2) + res, err := t.base().RoundTrip(req2) - // req.Body is assumed to be closed by the base RoundTripper. + // req.Body is assumed to have been closed by the base RoundTripper. reqBodyClosed = true - return t.base().RoundTrip(req2) -} -var cancelOnce sync.Once + if err != nil { + t.setModReq(req, nil) + return nil, err + } + res.Body = &onEOFReader{ + rc: res.Body, + fn: func() { t.setModReq(req, nil) }, + } + return res, nil +} -// CancelRequest does nothing. It used to be a legacy cancellation mechanism -// but now only it only logs on first use to warn that it's deprecated. -// -// Deprecated: use contexts for cancellation instead. +// CancelRequest cancels an in-flight request by closing its connection. func (t *Transport) CancelRequest(req *http.Request) { - cancelOnce.Do(func() { - log.Printf("deprecated: golang.org/x/oauth2: Transport.CancelRequest no longer does anything; use contexts") - }) + type canceler interface { + CancelRequest(*http.Request) + } + if cr, ok := t.base().(canceler); ok { + t.mu.Lock() + modReq := t.modReq[req] + delete(t.modReq, req) + t.mu.Unlock() + cr.CancelRequest(modReq) + } } func (t *Transport) base() http.RoundTripper { @@ -74,6 +90,19 @@ func (t *Transport) base() http.RoundTripper { return http.DefaultTransport } +func (t *Transport) setModReq(orig, mod *http.Request) { + t.mu.Lock() + defer t.mu.Unlock() + if t.modReq == nil { + t.modReq = make(map[*http.Request]*http.Request) + } + if mod == nil { + delete(t.modReq, orig) + } else { + t.modReq[orig] = mod + } +} + // cloneRequest returns a clone of the provided *http.Request. // The clone is a shallow copy of the struct and its Header map. func cloneRequest(r *http.Request) *http.Request { @@ -87,3 +116,29 @@ func cloneRequest(r *http.Request) *http.Request { } return r2 } + +type onEOFReader struct { + rc io.ReadCloser + fn func() +} + +func (r *onEOFReader) Read(p []byte) (n int, err error) { + n, err = r.rc.Read(p) + if err == io.EOF { + r.runFunc() + } + return +} + +func (r *onEOFReader) Close() error { + err := r.rc.Close() + r.runFunc() + return err +} + +func (r *onEOFReader) runFunc() { + if fn := r.fn; fn != nil { + fn() + r.fn = nil + } +} diff --git a/vendor/golang.org/x/sys/unix/.gitignore b/vendor/golang.org/x/sys/unix/.gitignore deleted file mode 100644 index e3e0fc6..0000000 --- a/vendor/golang.org/x/sys/unix/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -_obj/ -unix.test diff --git a/vendor/golang.org/x/sys/unix/README.md b/vendor/golang.org/x/sys/unix/README.md deleted file mode 100644 index ab433cc..0000000 --- a/vendor/golang.org/x/sys/unix/README.md +++ /dev/null @@ -1,184 +0,0 @@ -# Building `sys/unix` - -The sys/unix package provides access to the raw system call interface of the -underlying operating system. See: https://godoc.org/golang.org/x/sys/unix - -Porting Go to a new architecture/OS combination or adding syscalls, types, or -constants to an existing architecture/OS pair requires some manual effort; -however, there are tools that automate much of the process. - -## Build Systems - -There are currently two ways we generate the necessary files. We are currently -migrating the build system to use containers so the builds are reproducible. -This is being done on an OS-by-OS basis. Please update this documentation as -components of the build system change. - -### Old Build System (currently for `GOOS != "linux"`) - -The old build system generates the Go files based on the C header files -present on your system. This means that files -for a given GOOS/GOARCH pair must be generated on a system with that OS and -architecture. This also means that the generated code can differ from system -to system, based on differences in the header files. - -To avoid this, if you are using the old build system, only generate the Go -files on an installation with unmodified header files. It is also important to -keep track of which version of the OS the files were generated from (ex. -Darwin 14 vs Darwin 15). This makes it easier to track the progress of changes -and have each OS upgrade correspond to a single change. - -To build the files for your current OS and architecture, make sure GOOS and -GOARCH are set correctly and run `mkall.sh`. This will generate the files for -your specific system. Running `mkall.sh -n` shows the commands that will be run. - -Requirements: bash, go - -### New Build System (currently for `GOOS == "linux"`) - -The new build system uses a Docker container to generate the go files directly -from source checkouts of the kernel and various system libraries. This means -that on any platform that supports Docker, all the files using the new build -system can be generated at once, and generated files will not change based on -what the person running the scripts has installed on their computer. - -The OS specific files for the new build system are located in the `${GOOS}` -directory, and the build is coordinated by the `${GOOS}/mkall.go` program. When -the kernel or system library updates, modify the Dockerfile at -`${GOOS}/Dockerfile` to checkout the new release of the source. - -To build all the files under the new build system, you must be on an amd64/Linux -system and have your GOOS and GOARCH set accordingly. Running `mkall.sh` will -then generate all of the files for all of the GOOS/GOARCH pairs in the new build -system. Running `mkall.sh -n` shows the commands that will be run. - -Requirements: bash, go, docker - -## Component files - -This section describes the various files used in the code generation process. -It also contains instructions on how to modify these files to add a new -architecture/OS or to add additional syscalls, types, or constants. Note that -if you are using the new build system, the scripts/programs cannot be called normally. -They must be called from within the docker container. - -### asm files - -The hand-written assembly file at `asm_${GOOS}_${GOARCH}.s` implements system -call dispatch. There are three entry points: -``` - func Syscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) - func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) - func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) -``` -The first and second are the standard ones; they differ only in how many -arguments can be passed to the kernel. The third is for low-level use by the -ForkExec wrapper. Unlike the first two, it does not call into the scheduler to -let it know that a system call is running. - -When porting Go to an new architecture/OS, this file must be implemented for -each GOOS/GOARCH pair. - -### mksysnum - -Mksysnum is a Go program located at `${GOOS}/mksysnum.go` (or `mksysnum_${GOOS}.go` -for the old system). This program takes in a list of header files containing the -syscall number declarations and parses them to produce the corresponding list of -Go numeric constants. See `zsysnum_${GOOS}_${GOARCH}.go` for the generated -constants. - -Adding new syscall numbers is mostly done by running the build on a sufficiently -new installation of the target OS (or updating the source checkouts for the -new build system). However, depending on the OS, you make need to update the -parsing in mksysnum. - -### mksyscall.go - -The `syscall.go`, `syscall_${GOOS}.go`, `syscall_${GOOS}_${GOARCH}.go` are -hand-written Go files which implement system calls (for unix, the specific OS, -or the specific OS/Architecture pair respectively) that need special handling -and list `//sys` comments giving prototypes for ones that can be generated. - -The mksyscall.go program takes the `//sys` and `//sysnb` comments and converts -them into syscalls. This requires the name of the prototype in the comment to -match a syscall number in the `zsysnum_${GOOS}_${GOARCH}.go` file. The function -prototype can be exported (capitalized) or not. - -Adding a new syscall often just requires adding a new `//sys` function prototype -with the desired arguments and a capitalized name so it is exported. However, if -you want the interface to the syscall to be different, often one will make an -unexported `//sys` prototype, an then write a custom wrapper in -`syscall_${GOOS}.go`. - -### types files - -For each OS, there is a hand-written Go file at `${GOOS}/types.go` (or -`types_${GOOS}.go` on the old system). This file includes standard C headers and -creates Go type aliases to the corresponding C types. The file is then fed -through godef to get the Go compatible definitions. Finally, the generated code -is fed though mkpost.go to format the code correctly and remove any hidden or -private identifiers. This cleaned-up code is written to -`ztypes_${GOOS}_${GOARCH}.go`. - -The hardest part about preparing this file is figuring out which headers to -include and which symbols need to be `#define`d to get the actual data -structures that pass through to the kernel system calls. Some C libraries -preset alternate versions for binary compatibility and translate them on the -way in and out of system calls, but there is almost always a `#define` that can -get the real ones. -See `types_darwin.go` and `linux/types.go` for examples. - -To add a new type, add in the necessary include statement at the top of the -file (if it is not already there) and add in a type alias line. Note that if -your type is significantly different on different architectures, you may need -some `#if/#elif` macros in your include statements. - -### mkerrors.sh - -This script is used to generate the system's various constants. This doesn't -just include the error numbers and error strings, but also the signal numbers -an a wide variety of miscellaneous constants. The constants come from the list -of include files in the `includes_${uname}` variable. A regex then picks out -the desired `#define` statements, and generates the corresponding Go constants. -The error numbers and strings are generated from `#include `, and the -signal numbers and strings are generated from `#include `. All of -these constants are written to `zerrors_${GOOS}_${GOARCH}.go` via a C program, -`_errors.c`, which prints out all the constants. - -To add a constant, add the header that includes it to the appropriate variable. -Then, edit the regex (if necessary) to match the desired constant. Avoid making -the regex too broad to avoid matching unintended constants. - -### mkmerge.go - -This program is used to extract duplicate const, func, and type declarations -from the generated architecture-specific files listed below, and merge these -into a common file for each OS. - -The merge is performed in the following steps: -1. Construct the set of common code that is idential in all architecture-specific files. -2. Write this common code to the merged file. -3. Remove the common code from all architecture-specific files. - - -## Generated files - -### `zerror_${GOOS}_${GOARCH}.go` - -A file containing all of the system's generated error numbers, error strings, -signal numbers, and constants. Generated by `mkerrors.sh` (see above). - -### `zsyscall_${GOOS}_${GOARCH}.go` - -A file containing all the generated syscalls for a specific GOOS and GOARCH. -Generated by `mksyscall.go` (see above). - -### `zsysnum_${GOOS}_${GOARCH}.go` - -A list of numeric constants for all the syscall number of the specific GOOS -and GOARCH. Generated by mksysnum (see above). - -### `ztypes_${GOOS}_${GOARCH}.go` - -A file containing Go types for passing into (or returning from) syscalls. -Generated by godefs and the types file (see above). diff --git a/vendor/golang.org/x/sys/unix/mkall.sh b/vendor/golang.org/x/sys/unix/mkall.sh deleted file mode 100755 index ece31e9..0000000 --- a/vendor/golang.org/x/sys/unix/mkall.sh +++ /dev/null @@ -1,240 +0,0 @@ -#!/usr/bin/env bash -# 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. - -# This script runs or (given -n) prints suggested commands to generate files for -# the Architecture/OS specified by the GOARCH and GOOS environment variables. -# See README.md for more information about how the build system works. - -GOOSARCH="${GOOS}_${GOARCH}" - -# defaults -mksyscall="go run mksyscall.go" -mkerrors="./mkerrors.sh" -zerrors="zerrors_$GOOSARCH.go" -mksysctl="" -zsysctl="zsysctl_$GOOSARCH.go" -mksysnum= -mktypes= -mkasm= -run="sh" -cmd="" - -case "$1" in --syscalls) - for i in zsyscall*go - do - # Run the command line that appears in the first line - # of the generated file to regenerate it. - sed 1q $i | sed 's;^// ;;' | sh > _$i && gofmt < _$i > $i - rm _$i - done - exit 0 - ;; --n) - run="cat" - cmd="echo" - shift -esac - -case "$#" in -0) - ;; -*) - echo 'usage: mkall.sh [-n]' 1>&2 - exit 2 -esac - -if [[ "$GOOS" = "linux" ]]; then - # Use the Docker-based build system - # Files generated through docker (use $cmd so you can Ctl-C the build or run) - $cmd docker build --tag generate:$GOOS $GOOS - $cmd docker run --interactive --tty --volume $(cd -- "$(dirname -- "$0")" && /bin/pwd):/build generate:$GOOS - exit -fi - -GOOSARCH_in=syscall_$GOOSARCH.go -case "$GOOSARCH" in -_* | *_ | _) - echo 'undefined $GOOS_$GOARCH:' "$GOOSARCH" 1>&2 - exit 1 - ;; -aix_ppc) - mkerrors="$mkerrors -maix32" - mksyscall="go run mksyscall_aix_ppc.go -aix" - mktypes="GOARCH=$GOARCH go tool cgo -godefs" - ;; -aix_ppc64) - mkerrors="$mkerrors -maix64" - mksyscall="go run mksyscall_aix_ppc64.go -aix" - mktypes="GOARCH=$GOARCH go tool cgo -godefs" - ;; -darwin_386) - mkerrors="$mkerrors -m32" - mksyscall="go run mksyscall.go -l32" - mksysnum="go run mksysnum.go $(xcrun --show-sdk-path --sdk macosx)/usr/include/sys/syscall.h" - mktypes="GOARCH=$GOARCH go tool cgo -godefs" - mkasm="go run mkasm_darwin.go" - ;; -darwin_amd64) - mkerrors="$mkerrors -m64" - mksysnum="go run mksysnum.go $(xcrun --show-sdk-path --sdk macosx)/usr/include/sys/syscall.h" - mktypes="GOARCH=$GOARCH go tool cgo -godefs" - mkasm="go run mkasm_darwin.go" - ;; -darwin_arm) - mkerrors="$mkerrors" - mksyscall="go run mksyscall.go -l32" - mksysnum="go run mksysnum.go $(xcrun --show-sdk-path --sdk iphoneos)/usr/include/sys/syscall.h" - mktypes="GOARCH=$GOARCH go tool cgo -godefs" - mkasm="go run mkasm_darwin.go" - ;; -darwin_arm64) - mkerrors="$mkerrors -m64" - mksysnum="go run mksysnum.go $(xcrun --show-sdk-path --sdk iphoneos)/usr/include/sys/syscall.h" - mktypes="GOARCH=$GOARCH go tool cgo -godefs" - mkasm="go run mkasm_darwin.go" - ;; -dragonfly_amd64) - mkerrors="$mkerrors -m64" - mksyscall="go run mksyscall.go -dragonfly" - mksysnum="go run mksysnum.go 'https://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/sys/kern/syscalls.master'" - mktypes="GOARCH=$GOARCH go tool cgo -godefs" - ;; -freebsd_386) - mkerrors="$mkerrors -m32" - mksyscall="go run mksyscall.go -l32" - mksysnum="go run mksysnum.go 'https://svn.freebsd.org/base/stable/11/sys/kern/syscalls.master'" - mktypes="GOARCH=$GOARCH go tool cgo -godefs" - ;; -freebsd_amd64) - mkerrors="$mkerrors -m64" - mksysnum="go run mksysnum.go 'https://svn.freebsd.org/base/stable/11/sys/kern/syscalls.master'" - mktypes="GOARCH=$GOARCH go tool cgo -godefs" - ;; -freebsd_arm) - mkerrors="$mkerrors" - mksyscall="go run mksyscall.go -l32 -arm" - mksysnum="go run mksysnum.go 'https://svn.freebsd.org/base/stable/11/sys/kern/syscalls.master'" - # Let the type of C char be signed for making the bare syscall - # API consistent across platforms. - mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" - ;; -freebsd_arm64) - mkerrors="$mkerrors -m64" - mksysnum="go run mksysnum.go 'https://svn.freebsd.org/base/stable/11/sys/kern/syscalls.master'" - mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" - ;; -netbsd_386) - mkerrors="$mkerrors -m32" - mksyscall="go run mksyscall.go -l32 -netbsd" - mksysnum="go run mksysnum.go 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master'" - mktypes="GOARCH=$GOARCH go tool cgo -godefs" - ;; -netbsd_amd64) - mkerrors="$mkerrors -m64" - mksyscall="go run mksyscall.go -netbsd" - mksysnum="go run mksysnum.go 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master'" - mktypes="GOARCH=$GOARCH go tool cgo -godefs" - ;; -netbsd_arm) - mkerrors="$mkerrors" - mksyscall="go run mksyscall.go -l32 -netbsd -arm" - mksysnum="go run mksysnum.go 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master'" - # Let the type of C char be signed for making the bare syscall - # API consistent across platforms. - mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" - ;; -netbsd_arm64) - mkerrors="$mkerrors -m64" - mksyscall="go run mksyscall.go -netbsd" - mksysnum="go run mksysnum.go 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master'" - mktypes="GOARCH=$GOARCH go tool cgo -godefs" - ;; -openbsd_386) - mkerrors="$mkerrors -m32" - mksyscall="go run mksyscall.go -l32 -openbsd" - mksysctl="go run mksysctl_openbsd.go" - mksysnum="go run mksysnum.go 'https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master'" - mktypes="GOARCH=$GOARCH go tool cgo -godefs" - ;; -openbsd_amd64) - mkerrors="$mkerrors -m64" - mksyscall="go run mksyscall.go -openbsd" - mksysctl="go run mksysctl_openbsd.go" - mksysnum="go run mksysnum.go 'https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master'" - mktypes="GOARCH=$GOARCH go tool cgo -godefs" - ;; -openbsd_arm) - mkerrors="$mkerrors" - mksyscall="go run mksyscall.go -l32 -openbsd -arm" - mksysctl="go run mksysctl_openbsd.go" - mksysnum="go run mksysnum.go 'https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master'" - # Let the type of C char be signed for making the bare syscall - # API consistent across platforms. - mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" - ;; -openbsd_arm64) - mkerrors="$mkerrors -m64" - mksyscall="go run mksyscall.go -openbsd" - mksysctl="go run mksysctl_openbsd.go" - mksysnum="go run mksysnum.go 'https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master'" - # Let the type of C char be signed for making the bare syscall - # API consistent across platforms. - mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" - ;; -solaris_amd64) - mksyscall="go run mksyscall_solaris.go" - mkerrors="$mkerrors -m64" - mksysnum= - mktypes="GOARCH=$GOARCH go tool cgo -godefs" - ;; -illumos_amd64) - mksyscall="go run mksyscall_solaris.go" - mkerrors= - mksysnum= - mktypes= - ;; -*) - echo 'unrecognized $GOOS_$GOARCH: ' "$GOOSARCH" 1>&2 - exit 1 - ;; -esac - -( - if [ -n "$mkerrors" ]; then echo "$mkerrors |gofmt >$zerrors"; fi - case "$GOOS" in - *) - syscall_goos="syscall_$GOOS.go" - case "$GOOS" in - darwin | dragonfly | freebsd | netbsd | openbsd) - syscall_goos="syscall_bsd.go $syscall_goos" - ;; - esac - if [ -n "$mksyscall" ]; then - if [ "$GOOSARCH" == "aix_ppc64" ]; then - # aix/ppc64 script generates files instead of writing to stdin. - echo "$mksyscall -tags $GOOS,$GOARCH $syscall_goos $GOOSARCH_in && gofmt -w zsyscall_$GOOSARCH.go && gofmt -w zsyscall_"$GOOSARCH"_gccgo.go && gofmt -w zsyscall_"$GOOSARCH"_gc.go " ; - elif [ "$GOOS" == "darwin" ]; then - # pre-1.12, direct syscalls - echo "$mksyscall -tags $GOOS,$GOARCH,!go1.12 $syscall_goos syscall_darwin_${GOARCH}.1_11.go $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.1_11.go"; - # 1.12 and later, syscalls via libSystem - echo "$mksyscall -tags $GOOS,$GOARCH,go1.12 $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go"; - # 1.13 and later, syscalls via libSystem (including syscallPtr) - echo "$mksyscall -tags $GOOS,$GOARCH,go1.13 syscall_darwin.1_13.go |gofmt >zsyscall_$GOOSARCH.1_13.go"; - elif [ "$GOOS" == "illumos" ]; then - # illumos code generation requires a --illumos switch - echo "$mksyscall -illumos -tags illumos,$GOARCH syscall_illumos.go |gofmt > zsyscall_illumos_$GOARCH.go"; - # illumos implies solaris, so solaris code generation is also required - echo "$mksyscall -tags solaris,$GOARCH syscall_solaris.go syscall_solaris_$GOARCH.go |gofmt >zsyscall_solaris_$GOARCH.go"; - else - echo "$mksyscall -tags $GOOS,$GOARCH $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go"; - fi - fi - esac - if [ -n "$mksysctl" ]; then echo "$mksysctl |gofmt >$zsysctl"; fi - if [ -n "$mksysnum" ]; then echo "$mksysnum |gofmt >zsysnum_$GOOSARCH.go"; fi - if [ -n "$mktypes" ]; then echo "$mktypes types_$GOOS.go | go run mkpost.go > ztypes_$GOOSARCH.go"; fi - if [ -n "$mkasm" ]; then echo "$mkasm $GOARCH"; fi -) | $run diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh deleted file mode 100755 index bc076cf..0000000 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ /dev/null @@ -1,699 +0,0 @@ -#!/usr/bin/env bash -# 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. - -# Generate Go code listing errors and other #defined constant -# values (ENAMETOOLONG etc.), by asking the preprocessor -# about the definitions. - -unset LANG -export LC_ALL=C -export LC_CTYPE=C - -if test -z "$GOARCH" -o -z "$GOOS"; then - echo 1>&2 "GOARCH or GOOS not defined in environment" - exit 1 -fi - -# Check that we are using the new build system if we should -if [[ "$GOOS" = "linux" ]] && [[ "$GOLANG_SYS_BUILD" != "docker" ]]; then - echo 1>&2 "In the Docker based build system, mkerrors should not be called directly." - echo 1>&2 "See README.md" - exit 1 -fi - -if [[ "$GOOS" = "aix" ]]; then - CC=${CC:-gcc} -else - CC=${CC:-cc} -fi - -if [[ "$GOOS" = "solaris" ]]; then - # Assumes GNU versions of utilities in PATH. - export PATH=/usr/gnu/bin:$PATH -fi - -uname=$(uname) - -includes_AIX=' -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define AF_LOCAL AF_UNIX -' - -includes_Darwin=' -#define _DARWIN_C_SOURCE -#define KERNEL -#define _DARWIN_USE_64_BIT_INODE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -' - -includes_DragonFly=' -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -' - -includes_FreeBSD=' -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if __FreeBSD__ >= 10 -#define IFT_CARP 0xf8 // IFT_CARP is deprecated in FreeBSD 10 -#undef SIOCAIFADDR -#define SIOCAIFADDR _IOW(105, 26, struct oifaliasreq) // ifaliasreq contains if_data -#undef SIOCSIFPHYADDR -#define SIOCSIFPHYADDR _IOW(105, 70, struct oifaliasreq) // ifaliasreq contains if_data -#endif -' - -includes_Linux=' -#define _LARGEFILE_SOURCE -#define _LARGEFILE64_SOURCE -#ifndef __LP64__ -#define _FILE_OFFSET_BITS 64 -#endif -#define _GNU_SOURCE - -// is broken on powerpc64, as it fails to include definitions of -// these structures. We just include them copied from . -#if defined(__powerpc__) -struct sgttyb { - char sg_ispeed; - char sg_ospeed; - char sg_erase; - char sg_kill; - short sg_flags; -}; - -struct tchars { - char t_intrc; - char t_quitc; - char t_startc; - char t_stopc; - char t_eofc; - char t_brkc; -}; - -struct ltchars { - char t_suspc; - char t_dsuspc; - char t_rprntc; - char t_flushc; - char t_werasc; - char t_lnextc; -}; -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#if defined(__sparc__) -// On sparc{,64}, the kernel defines struct termios2 itself which clashes with the -// definition in glibc. As only the error constants are needed here, include the -// generic termibits.h (which is included by termbits.h on sparc). -#include -#else -#include -#endif - -#ifndef MSG_FASTOPEN -#define MSG_FASTOPEN 0x20000000 -#endif - -#ifndef PTRACE_GETREGS -#define PTRACE_GETREGS 0xc -#endif - -#ifndef PTRACE_SETREGS -#define PTRACE_SETREGS 0xd -#endif - -#ifndef SOL_NETLINK -#define SOL_NETLINK 270 -#endif - -#ifdef SOL_BLUETOOTH -// SPARC includes this in /usr/include/sparc64-linux-gnu/bits/socket.h -// but it is already in bluetooth_linux.go -#undef SOL_BLUETOOTH -#endif - -// Certain constants are missing from the fs/crypto UAPI -#define FS_KEY_DESC_PREFIX "fscrypt:" -#define FS_KEY_DESC_PREFIX_SIZE 8 -#define FS_MAX_KEY_SIZE 64 - -// The code generator produces -0x1 for (~0), but an unsigned value is necessary -// for the tipc_subscr timeout __u32 field. -#undef TIPC_WAIT_FOREVER -#define TIPC_WAIT_FOREVER 0xffffffff - -// Copied from linux/l2tp.h -// Including linux/l2tp.h here causes conflicts between linux/in.h -// and netinet/in.h included via net/route.h above. -#define IPPROTO_L2TP 115 -' - -includes_NetBSD=' -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Needed since refers to it... -#define schedppq 1 -' - -includes_OpenBSD=' -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// We keep some constants not supported in OpenBSD 5.5 and beyond for -// the promise of compatibility. -#define EMUL_ENABLED 0x1 -#define EMUL_NATIVE 0x2 -#define IPV6_FAITH 0x1d -#define IPV6_OPTIONS 0x1 -#define IPV6_RTHDR_STRICT 0x1 -#define IPV6_SOCKOPT_RESERVED1 0x3 -#define SIOCGIFGENERIC 0xc020693a -#define SIOCSIFGENERIC 0x80206939 -#define WALTSIG 0x4 -' - -includes_SunOS=' -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -' - - -includes=' -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -' -ccflags="$@" - -# Write go tool cgo -godefs input. -( - echo package unix - echo - echo '/*' - indirect="includes_$(uname)" - echo "${!indirect} $includes" - echo '*/' - echo 'import "C"' - echo 'import "syscall"' - echo - echo 'const (' - - # The gcc command line prints all the #defines - # it encounters while processing the input - echo "${!indirect} $includes" | $CC -x c - -E -dM $ccflags | - awk ' - $1 != "#define" || $2 ~ /\(/ || $3 == "" {next} - - $2 ~ /^E([ABCD]X|[BIS]P|[SD]I|S|FL)$/ {next} # 386 registers - $2 ~ /^(SIGEV_|SIGSTKSZ|SIGRT(MIN|MAX))/ {next} - $2 ~ /^(SCM_SRCRT)$/ {next} - $2 ~ /^(MAP_FAILED)$/ {next} - $2 ~ /^ELF_.*$/ {next}# contains ELF_ARCH, etc. - - $2 ~ /^EXTATTR_NAMESPACE_NAMES/ || - $2 ~ /^EXTATTR_NAMESPACE_[A-Z]+_STRING/ {next} - - $2 !~ /^ECCAPBITS/ && - $2 !~ /^ETH_/ && - $2 !~ /^EPROC_/ && - $2 !~ /^EQUIV_/ && - $2 !~ /^EXPR_/ && - $2 ~ /^E[A-Z0-9_]+$/ || - $2 ~ /^B[0-9_]+$/ || - $2 ~ /^(OLD|NEW)DEV$/ || - $2 == "BOTHER" || - $2 ~ /^CI?BAUD(EX)?$/ || - $2 == "IBSHIFT" || - $2 ~ /^V[A-Z0-9]+$/ || - $2 ~ /^CS[A-Z0-9]/ || - $2 ~ /^I(SIG|CANON|CRNL|UCLC|EXTEN|MAXBEL|STRIP|UTF8)$/ || - $2 ~ /^IGN/ || - $2 ~ /^IX(ON|ANY|OFF)$/ || - $2 ~ /^IN(LCR|PCK)$/ || - $2 !~ "X86_CR3_PCID_NOFLUSH" && - $2 ~ /(^FLU?SH)|(FLU?SH$)/ || - $2 ~ /^C(LOCAL|READ|MSPAR|RTSCTS)$/ || - $2 == "BRKINT" || - $2 == "HUPCL" || - $2 == "PENDIN" || - $2 == "TOSTOP" || - $2 == "XCASE" || - $2 == "ALTWERASE" || - $2 == "NOKERNINFO" || - $2 == "NFDBITS" || - $2 ~ /^PAR/ || - $2 ~ /^SIG[^_]/ || - $2 ~ /^O[CNPFPL][A-Z]+[^_][A-Z]+$/ || - $2 ~ /^(NL|CR|TAB|BS|VT|FF)DLY$/ || - $2 ~ /^(NL|CR|TAB|BS|VT|FF)[0-9]$/ || - $2 ~ /^O?XTABS$/ || - $2 ~ /^TC[IO](ON|OFF)$/ || - $2 ~ /^IN_/ || - $2 ~ /^LOCK_(SH|EX|NB|UN)$/ || - $2 ~ /^LO_(KEY|NAME)_SIZE$/ || - $2 ~ /^LOOP_(CLR|CTL|GET|SET)_/ || - $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|MCAST|EVFILT|NOTE|EV|SHUT|PROT|MAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR)_/ || - $2 ~ /^TP_STATUS_/ || - $2 ~ /^FALLOC_/ || - $2 == "ICMPV6_FILTER" || - $2 == "SOMAXCONN" || - $2 == "NAME_MAX" || - $2 == "IFNAMSIZ" || - $2 ~ /^CTL_(HW|KERN|MAXNAME|NET|QUERY)$/ || - $2 ~ /^KERN_(HOSTNAME|OS(RELEASE|TYPE)|VERSION)$/ || - $2 ~ /^HW_MACHINE$/ || - $2 ~ /^SYSCTL_VERS/ || - $2 !~ "MNT_BITS" && - $2 ~ /^(MS|MNT|UMOUNT)_/ || - $2 ~ /^NS_GET_/ || - $2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ || - $2 ~ /^(O|F|[ES]?FD|NAME|S|PTRACE|PT)_/ || - $2 ~ /^KEXEC_/ || - $2 ~ /^LINUX_REBOOT_CMD_/ || - $2 ~ /^LINUX_REBOOT_MAGIC[12]$/ || - $2 ~ /^MODULE_INIT_/ || - $2 !~ "NLA_TYPE_MASK" && - $2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTC|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P|NETNSA)_/ || - $2 ~ /^SIOC/ || - $2 ~ /^TIOC/ || - $2 ~ /^TCGET/ || - $2 ~ /^TCSET/ || - $2 ~ /^TC(FLSH|SBRKP?|XONC)$/ || - $2 !~ "RTF_BITS" && - $2 ~ /^(IFF|IFT|NET_RT|RTM(GRP)?|RTF|RTV|RTA|RTAX)_/ || - $2 ~ /^BIOC/ || - $2 ~ /^DIOC/ || - $2 ~ /^RUSAGE_(SELF|CHILDREN|THREAD)/ || - $2 ~ /^RLIMIT_(AS|CORE|CPU|DATA|FSIZE|LOCKS|MEMLOCK|MSGQUEUE|NICE|NOFILE|NPROC|RSS|RTPRIO|RTTIME|SIGPENDING|STACK)|RLIM_INFINITY/ || - $2 ~ /^PRIO_(PROCESS|PGRP|USER)/ || - $2 ~ /^CLONE_[A-Z_]+/ || - $2 !~ /^(BPF_TIMEVAL|BPF_FIB_LOOKUP_[A-Z]+)$/ && - $2 ~ /^(BPF|DLT)_/ || - $2 ~ /^(CLOCK|TIMER)_/ || - $2 ~ /^CAN_/ || - $2 ~ /^CAP_/ || - $2 ~ /^ALG_/ || - $2 ~ /^FS_(POLICY_FLAGS|KEY_DESC|ENCRYPTION_MODE|[A-Z0-9_]+_KEY_SIZE)/ || - $2 ~ /^FS_IOC_.*ENCRYPTION/ || - $2 ~ /^FSCRYPT_/ || - $2 ~ /^GRND_/ || - $2 ~ /^RND/ || - $2 ~ /^KEY_(SPEC|REQKEY_DEFL)_/ || - $2 ~ /^KEYCTL_/ || - $2 ~ /^PERF_EVENT_IOC_/ || - $2 ~ /^SECCOMP_MODE_/ || - $2 ~ /^SPLICE_/ || - $2 ~ /^SYNC_FILE_RANGE_/ || - $2 !~ /^AUDIT_RECORD_MAGIC/ && - $2 !~ /IOC_MAGIC/ && - $2 ~ /^[A-Z][A-Z0-9_]+_MAGIC2?$/ || - $2 ~ /^(VM|VMADDR)_/ || - $2 ~ /^IOCTL_VM_SOCKETS_/ || - $2 ~ /^(TASKSTATS|TS)_/ || - $2 ~ /^CGROUPSTATS_/ || - $2 ~ /^GENL_/ || - $2 ~ /^STATX_/ || - $2 ~ /^RENAME/ || - $2 ~ /^UBI_IOC[A-Z]/ || - $2 ~ /^UTIME_/ || - $2 ~ /^XATTR_(CREATE|REPLACE|NO(DEFAULT|FOLLOW|SECURITY)|SHOWCOMPRESSION)/ || - $2 ~ /^ATTR_(BIT_MAP_COUNT|(CMN|VOL|FILE)_)/ || - $2 ~ /^FSOPT_/ || - $2 ~ /^WDIOC_/ || - $2 ~ /^NFN/ || - $2 ~ /^XDP_/ || - $2 ~ /^RWF_/ || - $2 ~ /^(HDIO|WIN|SMART)_/ || - $2 ~ /^CRYPTO_/ || - $2 ~ /^TIPC_/ || - $2 ~ /^DEVLINK_/ || - $2 !~ "WMESGLEN" && - $2 ~ /^W[A-Z0-9]+$/ || - $2 ~/^PPPIOC/ || - $2 ~ /^FAN_|FANOTIFY_/ || - $2 ~ /^BLK[A-Z]*(GET$|SET$|BUF$|PART$|SIZE)/ {printf("\t%s = C.%s\n", $2, $2)} - $2 ~ /^__WCOREFLAG$/ {next} - $2 ~ /^__W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", substr($2,3), $2)} - - {next} - ' | sort - - echo ')' -) >_const.go - -# Pull out the error names for later. -errors=$( - echo '#include ' | $CC -x c - -E -dM $ccflags | - awk '$1=="#define" && $2 ~ /^E[A-Z0-9_]+$/ { print $2 }' | - sort -) - -# Pull out the signal names for later. -signals=$( - echo '#include ' | $CC -x c - -E -dM $ccflags | - awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print $2 }' | - egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' | - sort -) - -# Again, writing regexps to a file. -echo '#include ' | $CC -x c - -E -dM $ccflags | - awk '$1=="#define" && $2 ~ /^E[A-Z0-9_]+$/ { print "^\t" $2 "[ \t]*=" }' | - sort >_error.grep -echo '#include ' | $CC -x c - -E -dM $ccflags | - awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print "^\t" $2 "[ \t]*=" }' | - egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' | - sort >_signal.grep - -echo '// mkerrors.sh' "$@" -echo '// Code generated by the command above; see README.md. DO NOT EDIT.' -echo -echo "// +build ${GOARCH},${GOOS}" -echo -go tool cgo -godefs -- "$@" _const.go >_error.out -cat _error.out | grep -vf _error.grep | grep -vf _signal.grep -echo -echo '// Errors' -echo 'const (' -cat _error.out | grep -f _error.grep | sed 's/=\(.*\)/= syscall.Errno(\1)/' -echo ')' - -echo -echo '// Signals' -echo 'const (' -cat _error.out | grep -f _signal.grep | sed 's/=\(.*\)/= syscall.Signal(\1)/' -echo ')' - -# Run C program to print error and syscall strings. -( - echo -E " -#include -#include -#include -#include -#include -#include - -#define nelem(x) (sizeof(x)/sizeof((x)[0])) - -enum { A = 'A', Z = 'Z', a = 'a', z = 'z' }; // avoid need for single quotes below - -struct tuple { - int num; - const char *name; -}; - -struct tuple errors[] = { -" - for i in $errors - do - echo -E ' {'$i', "'$i'" },' - done - - echo -E " -}; - -struct tuple signals[] = { -" - for i in $signals - do - echo -E ' {'$i', "'$i'" },' - done - - # Use -E because on some systems bash builtin interprets \n itself. - echo -E ' -}; - -static int -tuplecmp(const void *a, const void *b) -{ - return ((struct tuple *)a)->num - ((struct tuple *)b)->num; -} - -int -main(void) -{ - int i, e; - char buf[1024], *p; - - printf("\n\n// Error table\n"); - printf("var errorList = [...]struct {\n"); - printf("\tnum syscall.Errno\n"); - printf("\tname string\n"); - printf("\tdesc string\n"); - printf("} {\n"); - qsort(errors, nelem(errors), sizeof errors[0], tuplecmp); - for(i=0; i 0 && errors[i-1].num == e) - continue; - strcpy(buf, strerror(e)); - // lowercase first letter: Bad -> bad, but STREAM -> STREAM. - if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z) - buf[0] += a - A; - printf("\t{ %d, \"%s\", \"%s\" },\n", e, errors[i].name, buf); - } - printf("}\n\n"); - - printf("\n\n// Signal table\n"); - printf("var signalList = [...]struct {\n"); - printf("\tnum syscall.Signal\n"); - printf("\tname string\n"); - printf("\tdesc string\n"); - printf("} {\n"); - qsort(signals, nelem(signals), sizeof signals[0], tuplecmp); - for(i=0; i 0 && signals[i-1].num == e) - continue; - strcpy(buf, strsignal(e)); - // lowercase first letter: Bad -> bad, but STREAM -> STREAM. - if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z) - buf[0] += a - A; - // cut trailing : number. - p = strrchr(buf, ":"[0]); - if(p) - *p = '\0'; - printf("\t{ %d, \"%s\", \"%s\" },\n", e, signals[i].name, buf); - } - printf("}\n\n"); - - return 0; -} - -' -) >_errors.c - -$CC $ccflags -o _errors _errors.c && $GORUN ./_errors && rm -f _errors.c _errors _const.go _error.grep _signal.grep _error.out diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go index bbe1abb..2b151eb 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -133,6 +133,12 @@ func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) return openat(dirfd, path, flags|O_LARGEFILE, mode) } +//sys openat2(dirfd int, path string, open_how *OpenHow, size int) (fd int, err error) + +func Openat2(dirfd int, path string, how *OpenHow) (fd int, err error) { + return openat2(dirfd, path, how, SizeofOpenHow) +} + //sys ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) func Ppoll(fds []PollFd, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { diff --git a/vendor/golang.org/x/sys/unix/syscall_unix.go b/vendor/golang.org/x/sys/unix/syscall_unix.go index 3de3756..8f710d0 100644 --- a/vendor/golang.org/x/sys/unix/syscall_unix.go +++ b/vendor/golang.org/x/sys/unix/syscall_unix.go @@ -76,7 +76,7 @@ func SignalName(s syscall.Signal) string { // The signal name should start with "SIG". func SignalNum(s string) syscall.Signal { signalNameMapOnce.Do(func() { - signalNameMap = make(map[string]syscall.Signal) + signalNameMap = make(map[string]syscall.Signal, len(signalList)) for _, signal := range signalList { signalNameMap[signal.name] = signal.num } diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go index 84c599c..2197394 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -216,6 +216,7 @@ const ( BPF_F_RDONLY = 0x8 BPF_F_RDONLY_PROG = 0x80 BPF_F_RECOMPUTE_CSUM = 0x1 + BPF_F_REPLACE = 0x4 BPF_F_REUSE_STACKID = 0x400 BPF_F_SEQ_NUMBER = 0x8 BPF_F_SKIP_FIELD_MASK = 0xff @@ -389,6 +390,7 @@ const ( CLONE_NEWNET = 0x40000000 CLONE_NEWNS = 0x20000 CLONE_NEWPID = 0x20000000 + CLONE_NEWTIME = 0x80 CLONE_NEWUSER = 0x10000000 CLONE_NEWUTS = 0x4000000 CLONE_PARENT = 0x8000 @@ -671,6 +673,7 @@ const ( FS_IOC_ADD_ENCRYPTION_KEY = 0xc0506617 FS_IOC_GET_ENCRYPTION_KEY_STATUS = 0xc080661a FS_IOC_GET_ENCRYPTION_POLICY_EX = 0xc0096616 + FS_IOC_MEASURE_VERITY = 0xc0046686 FS_IOC_REMOVE_ENCRYPTION_KEY = 0xc0406618 FS_IOC_REMOVE_ENCRYPTION_KEY_ALL_USERS = 0xc0406619 FS_KEY_DESCRIPTOR_SIZE = 0x8 @@ -683,6 +686,9 @@ const ( FS_POLICY_FLAGS_PAD_8 = 0x1 FS_POLICY_FLAGS_PAD_MASK = 0x3 FS_POLICY_FLAGS_VALID = 0xf + FS_VERITY_FL = 0x100000 + FS_VERITY_HASH_ALG_SHA256 = 0x1 + FS_VERITY_HASH_ALG_SHA512 = 0x2 FUTEXFS_SUPER_MAGIC = 0xbad1dea F_ADD_SEALS = 0x409 F_DUPFD = 0x0 @@ -733,6 +739,7 @@ const ( GENL_NAMSIZ = 0x10 GENL_START_ALLOC = 0x13 GENL_UNS_ADMIN_PERM = 0x10 + GRND_INSECURE = 0x4 GRND_NONBLOCK = 0x1 GRND_RANDOM = 0x2 HDIO_DRIVE_CMD = 0x31f @@ -1483,6 +1490,7 @@ const ( PR_GET_FPEMU = 0x9 PR_GET_FPEXC = 0xb PR_GET_FP_MODE = 0x2e + PR_GET_IO_FLUSHER = 0x3a PR_GET_KEEPCAPS = 0x7 PR_GET_NAME = 0x10 PR_GET_NO_NEW_PRIVS = 0x27 @@ -1518,6 +1526,7 @@ const ( PR_SET_FPEMU = 0xa PR_SET_FPEXC = 0xc PR_SET_FP_MODE = 0x2d + PR_SET_IO_FLUSHER = 0x39 PR_SET_KEEPCAPS = 0x8 PR_SET_MM = 0x23 PR_SET_MM_ARG_END = 0x9 @@ -1746,12 +1755,15 @@ const ( RTM_DELRULE = 0x21 RTM_DELTCLASS = 0x29 RTM_DELTFILTER = 0x2d + RTM_DELVLAN = 0x71 RTM_F_CLONED = 0x200 RTM_F_EQUALIZE = 0x400 RTM_F_FIB_MATCH = 0x2000 RTM_F_LOOKUP_TABLE = 0x1000 RTM_F_NOTIFY = 0x100 + RTM_F_OFFLOAD = 0x4000 RTM_F_PREFIX = 0x800 + RTM_F_TRAP = 0x8000 RTM_GETACTION = 0x32 RTM_GETADDR = 0x16 RTM_GETADDRLABEL = 0x4a @@ -1773,7 +1785,8 @@ const ( RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e - RTM_MAX = 0x6f + RTM_GETVLAN = 0x72 + RTM_MAX = 0x73 RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 @@ -1788,6 +1801,7 @@ const ( RTM_NEWNETCONF = 0x50 RTM_NEWNEXTHOP = 0x68 RTM_NEWNSID = 0x58 + RTM_NEWNVLAN = 0x70 RTM_NEWPREFIX = 0x34 RTM_NEWQDISC = 0x24 RTM_NEWROUTE = 0x18 @@ -1795,8 +1809,8 @@ const ( RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x18 - RTM_NR_MSGTYPES = 0x60 + RTM_NR_FAMILIES = 0x19 + RTM_NR_MSGTYPES = 0x64 RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 @@ -2086,7 +2100,7 @@ const ( TASKSTATS_GENL_NAME = "TASKSTATS" TASKSTATS_GENL_VERSION = 0x1 TASKSTATS_TYPE_MAX = 0x6 - TASKSTATS_VERSION = 0x9 + TASKSTATS_VERSION = 0xa TCIFLUSH = 0x0 TCIOFF = 0x2 TCIOFLUSH = 0x2 @@ -2267,7 +2281,7 @@ const ( VMADDR_CID_ANY = 0xffffffff VMADDR_CID_HOST = 0x2 VMADDR_CID_HYPERVISOR = 0x0 - VMADDR_CID_RESERVED = 0x1 + VMADDR_CID_LOCAL = 0x1 VMADDR_PORT_ANY = 0xffffffff VM_SOCKETS_INVALID_VERSION = 0xffffffff VQUIT = 0x1 @@ -2394,6 +2408,7 @@ const ( XENFS_SUPER_MAGIC = 0xabba1974 XFS_SUPER_MAGIC = 0x58465342 Z3FOLD_MAGIC = 0x33 + ZONEFS_MAGIC = 0x5a4f4653 ZSMALLOC_MAGIC = 0x58295829 ) diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index 0876cf9..028c9d8 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -73,6 +73,8 @@ const ( FFDLY = 0x8000 FLUSHO = 0x1000 FP_XSTATE_MAGIC2 = 0x46505845 + FS_IOC_ENABLE_VERITY = 0x40806685 + FS_IOC_GETFLAGS = 0x80046601 FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index d5be2e8..005970f 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -73,6 +73,8 @@ const ( FFDLY = 0x8000 FLUSHO = 0x1000 FP_XSTATE_MAGIC2 = 0x46505845 + FS_IOC_ENABLE_VERITY = 0x40806685 + FS_IOC_GETFLAGS = 0x80086601 FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go index fbeef83..0541f36 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -72,6 +72,8 @@ const ( FF1 = 0x8000 FFDLY = 0x8000 FLUSHO = 0x1000 + FS_IOC_ENABLE_VERITY = 0x40806685 + FS_IOC_GETFLAGS = 0x80046601 FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index 06daa50..9ee8d1b 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -75,6 +75,8 @@ const ( FFDLY = 0x8000 FLUSHO = 0x1000 FPSIMD_MAGIC = 0x46508001 + FS_IOC_ENABLE_VERITY = 0x40806685 + FS_IOC_GETFLAGS = 0x80086601 FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go index 7c866b8..4826bd7 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -72,6 +72,8 @@ const ( FF1 = 0x8000 FFDLY = 0x8000 FLUSHO = 0x2000 + FS_IOC_ENABLE_VERITY = 0x80806685 + FS_IOC_GETFLAGS = 0x40046601 FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go index c42966d..2346dc5 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -72,6 +72,8 @@ const ( FF1 = 0x8000 FFDLY = 0x8000 FLUSHO = 0x2000 + FS_IOC_ENABLE_VERITY = 0x80806685 + FS_IOC_GETFLAGS = 0x40086601 FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go index a5b2b42..e758b61 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -72,6 +72,8 @@ const ( FF1 = 0x8000 FFDLY = 0x8000 FLUSHO = 0x2000 + FS_IOC_ENABLE_VERITY = 0x80806685 + FS_IOC_GETFLAGS = 0x40086601 FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go index 7f91881..2dfe6bb 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -72,6 +72,8 @@ const ( FF1 = 0x8000 FFDLY = 0x8000 FLUSHO = 0x2000 + FS_IOC_ENABLE_VERITY = 0x80806685 + FS_IOC_GETFLAGS = 0x40046601 FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go index 63df355..5185866 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -72,6 +72,8 @@ const ( FF1 = 0x4000 FFDLY = 0x4000 FLUSHO = 0x800000 + FS_IOC_ENABLE_VERITY = 0x80806685 + FS_IOC_GETFLAGS = 0x40086601 FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go index 7ab68f7..4231b20 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -72,6 +72,8 @@ const ( FF1 = 0x4000 FFDLY = 0x4000 FLUSHO = 0x800000 + FS_IOC_ENABLE_VERITY = 0x80806685 + FS_IOC_GETFLAGS = 0x40086601 FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go index f99cf1b..6a0b2d2 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go @@ -72,6 +72,8 @@ const ( FF1 = 0x8000 FFDLY = 0x8000 FLUSHO = 0x1000 + FS_IOC_ENABLE_VERITY = 0x40806685 + FS_IOC_GETFLAGS = 0x80086601 FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index 613ee23..95e950f 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -72,6 +72,8 @@ const ( FF1 = 0x8000 FFDLY = 0x8000 FLUSHO = 0x1000 + FS_IOC_ENABLE_VERITY = 0x40806685 + FS_IOC_GETFLAGS = 0x80086601 FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go index 1f7a68d..079762f 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -76,6 +76,8 @@ const ( FF1 = 0x8000 FFDLY = 0x8000 FLUSHO = 0x1000 + FS_IOC_ENABLE_VERITY = 0x80806685 + FS_IOC_GETFLAGS = 0x40086601 FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux.go b/vendor/golang.org/x/sys/unix/zsyscall_linux.go index fd2dae8..5c5b742 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux.go @@ -83,6 +83,22 @@ func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func openat2(dirfd int, path string, open_how *OpenHow, size int) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_OPENAT2, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(open_how)), uintptr(size), 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := Syscall6(SYS_PPOLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go index 7aae554..54559a8 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go @@ -431,4 +431,6 @@ const ( SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLONE3 = 435 + SYS_OPENAT2 = 437 + SYS_PIDFD_GETFD = 438 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go index 7968439..054a741 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go @@ -353,4 +353,6 @@ const ( SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLONE3 = 435 + SYS_OPENAT2 = 437 + SYS_PIDFD_GETFD = 438 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go index 3c663c6..307f2ba 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go @@ -395,4 +395,6 @@ const ( SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLONE3 = 435 + SYS_OPENAT2 = 437 + SYS_PIDFD_GETFD = 438 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go index 1f3b4d1..e9404dd 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go @@ -298,4 +298,6 @@ const ( SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLONE3 = 435 + SYS_OPENAT2 = 437 + SYS_PIDFD_GETFD = 438 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go index 00da3de..68bb6d2 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go @@ -416,4 +416,6 @@ const ( SYS_FSPICK = 4433 SYS_PIDFD_OPEN = 4434 SYS_CLONE3 = 4435 + SYS_OPENAT2 = 4437 + SYS_PIDFD_GETFD = 4438 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go index d404fbd..4e52511 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go @@ -346,4 +346,6 @@ const ( SYS_FSPICK = 5433 SYS_PIDFD_OPEN = 5434 SYS_CLONE3 = 5435 + SYS_OPENAT2 = 5437 + SYS_PIDFD_GETFD = 5438 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go index bfbf242..4d9aa30 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go @@ -346,4 +346,6 @@ const ( SYS_FSPICK = 5433 SYS_PIDFD_OPEN = 5434 SYS_CLONE3 = 5435 + SYS_OPENAT2 = 5437 + SYS_PIDFD_GETFD = 5438 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go index 3826f49..64af070 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go @@ -416,4 +416,6 @@ const ( SYS_FSPICK = 4433 SYS_PIDFD_OPEN = 4434 SYS_CLONE3 = 4435 + SYS_OPENAT2 = 4437 + SYS_PIDFD_GETFD = 4438 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go index 52e3da6..cc3c067 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go @@ -395,4 +395,6 @@ const ( SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLONE3 = 435 + SYS_OPENAT2 = 437 + SYS_PIDFD_GETFD = 438 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go index 6141f90..4050ff9 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go @@ -395,4 +395,6 @@ const ( SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLONE3 = 435 + SYS_OPENAT2 = 437 + SYS_PIDFD_GETFD = 438 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go index 4f7261a..529abb6 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go @@ -297,4 +297,6 @@ const ( SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLONE3 = 435 + SYS_OPENAT2 = 437 + SYS_PIDFD_GETFD = 438 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go index f47014a..2766500 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go @@ -360,4 +360,6 @@ const ( SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLONE3 = 435 + SYS_OPENAT2 = 437 + SYS_PIDFD_GETFD = 438 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go index dd78abb..4dc82bb 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go @@ -374,4 +374,6 @@ const ( SYS_FSMOUNT = 432 SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 + SYS_OPENAT2 = 437 + SYS_PIDFD_GETFD = 438 ) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go index cb5e06c..1620ad0 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -114,7 +114,8 @@ type FscryptKeySpecifier struct { type FscryptAddKeyArg struct { Key_spec FscryptKeySpecifier Raw_size uint32 - _ [9]uint32 + Key_id uint32 + _ [8]uint32 } type FscryptRemoveKeyArg struct { @@ -479,7 +480,7 @@ const ( IFLA_NEW_IFINDEX = 0x31 IFLA_MIN_MTU = 0x32 IFLA_MAX_MTU = 0x33 - IFLA_MAX = 0x35 + IFLA_MAX = 0x36 IFLA_INFO_KIND = 0x1 IFLA_INFO_DATA = 0x2 IFLA_INFO_XSTATS = 0x3 @@ -690,6 +691,22 @@ const ( AT_EACCESS = 0x200 ) +type OpenHow struct { + Flags uint64 + Mode uint64 + Resolve uint64 +} + +const SizeofOpenHow = 0x18 + +const ( + RESOLVE_BENEATH = 0x8 + RESOLVE_IN_ROOT = 0x10 + RESOLVE_NO_MAGICLINKS = 0x2 + RESOLVE_NO_SYMLINKS = 0x4 + RESOLVE_NO_XDEV = 0x1 +) + type PollFd struct { Fd int32 Events int16 @@ -2291,3 +2308,49 @@ const ( DEVLINK_DPIPE_HEADER_IPV4 = 0x1 DEVLINK_DPIPE_HEADER_IPV6 = 0x2 ) + +type FsverityDigest struct { + Algorithm uint16 + Size uint16 +} + +type FsverityEnableArg struct { + Version uint32 + Hash_algorithm uint32 + Block_size uint32 + Salt_size uint32 + Salt_ptr uint64 + Sig_size uint32 + _ uint32 + Sig_ptr uint64 + _ [11]uint64 +} + +type Nhmsg struct { + Family uint8 + Scope uint8 + Protocol uint8 + Resvd uint8 + Flags uint32 +} + +type NexthopGrp struct { + Id uint32 + Weight uint8 + Resvd1 uint8 + Resvd2 uint16 +} + +const ( + NHA_UNSPEC = 0x0 + NHA_ID = 0x1 + NHA_GROUP = 0x2 + NHA_GROUP_TYPE = 0x3 + NHA_BLACKHOLE = 0x4 + NHA_OIF = 0x5 + NHA_GATEWAY = 0x6 + NHA_ENCAP_TYPE = 0x7 + NHA_ENCAP = 0x8 + NHA_GROUPS = 0x9 + NHA_MASTER = 0xa +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go index fc6b3fb..761b67c 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go @@ -287,6 +287,7 @@ type Taskstats struct { Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Ac_btime64 uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go index 26c30b8..201fb34 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go @@ -298,6 +298,7 @@ type Taskstats struct { Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Ac_btime64 uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go index 814d42d..8051b56 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go @@ -276,6 +276,7 @@ type Taskstats struct { Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Ac_btime64 uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go index d9664c7..a936f21 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go @@ -277,6 +277,7 @@ type Taskstats struct { Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Ac_btime64 uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go index 0d72145..aaca03d 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go @@ -281,6 +281,7 @@ type Taskstats struct { Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Ac_btime64 uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go index ef69768..2e7f3b8 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go @@ -280,6 +280,7 @@ type Taskstats struct { Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Ac_btime64 uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go index 485fda7..16add5a 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go @@ -280,6 +280,7 @@ type Taskstats struct { Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Ac_btime64 uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go index 569477e..4ed2c8e 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go @@ -281,6 +281,7 @@ type Taskstats struct { Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Ac_btime64 uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go index 602d8b4..7415190 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go @@ -287,6 +287,7 @@ type Taskstats struct { Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Ac_btime64 uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go index 6db9a7b..046c2de 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go @@ -287,6 +287,7 @@ type Taskstats struct { Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Ac_btime64 uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go index 52b5348..0f2f61a 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go @@ -305,6 +305,7 @@ type Taskstats struct { Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Ac_btime64 uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go index a111387..cca1b6b 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go @@ -300,6 +300,7 @@ type Taskstats struct { Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Ac_btime64 uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go index 8153af1..33a73bf 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go @@ -282,6 +282,7 @@ type Taskstats struct { Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Ac_btime64 uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/windows/mkerrors.bash b/vendor/golang.org/x/sys/windows/mkerrors.bash deleted file mode 100755 index 2163843..0000000 --- a/vendor/golang.org/x/sys/windows/mkerrors.bash +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash - -# Copyright 2019 The Go Authors. All rights reserved. -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file. - -set -e -shopt -s nullglob - -winerror="$(printf '%s\n' "/mnt/c/Program Files (x86)/Windows Kits/"/*/Include/*/shared/winerror.h | sort -Vr | head -n 1)" -[[ -n $winerror ]] || { echo "Unable to find winerror.h" >&2; exit 1; } - -declare -A errors - -{ - echo "// Code generated by 'mkerrors.bash'; DO NOT EDIT." - echo - echo "package windows" - echo "import \"syscall\"" - echo "const (" - - while read -r line; do - unset vtype - if [[ $line =~ ^#define\ +([A-Z0-9_]+k?)\ +([A-Z0-9_]+\()?([A-Z][A-Z0-9_]+k?)\)? ]]; then - key="${BASH_REMATCH[1]}" - value="${BASH_REMATCH[3]}" - elif [[ $line =~ ^#define\ +([A-Z0-9_]+k?)\ +([A-Z0-9_]+\()?((0x)?[0-9A-Fa-f]+)L?\)? ]]; then - key="${BASH_REMATCH[1]}" - value="${BASH_REMATCH[3]}" - vtype="${BASH_REMATCH[2]}" - elif [[ $line =~ ^#define\ +([A-Z0-9_]+k?)\ +\(\(([A-Z]+)\)((0x)?[0-9A-Fa-f]+)L?\) ]]; then - key="${BASH_REMATCH[1]}" - value="${BASH_REMATCH[3]}" - vtype="${BASH_REMATCH[2]}" - else - continue - fi - [[ -n $key && -n $value ]] || continue - [[ -z ${errors["$key"]} ]] || continue - errors["$key"]="$value" - if [[ -v vtype ]]; then - if [[ $key == FACILITY_* || $key == NO_ERROR ]]; then - vtype="" - elif [[ $vtype == *HANDLE* || $vtype == *HRESULT* ]]; then - vtype="Handle" - else - vtype="syscall.Errno" - fi - last_vtype="$vtype" - else - vtype="" - if [[ $last_vtype == Handle && $value == NO_ERROR ]]; then - value="S_OK" - elif [[ $last_vtype == syscall.Errno && $value == NO_ERROR ]]; then - value="ERROR_SUCCESS" - fi - fi - - echo "$key $vtype = $value" - done < "$winerror" - - echo ")" -} | gofmt > "zerrors_windows.go" diff --git a/vendor/golang.org/x/sys/windows/mkknownfolderids.bash b/vendor/golang.org/x/sys/windows/mkknownfolderids.bash deleted file mode 100755 index ab8924e..0000000 --- a/vendor/golang.org/x/sys/windows/mkknownfolderids.bash +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -# Copyright 2019 The Go Authors. All rights reserved. -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file. - -set -e -shopt -s nullglob - -knownfolders="$(printf '%s\n' "/mnt/c/Program Files (x86)/Windows Kits/"/*/Include/*/um/KnownFolders.h | sort -Vr | head -n 1)" -[[ -n $knownfolders ]] || { echo "Unable to find KnownFolders.h" >&2; exit 1; } - -{ - echo "// Code generated by 'mkknownfolderids.bash'; DO NOT EDIT." - echo - echo "package windows" - echo "type KNOWNFOLDERID GUID" - echo "var (" - while read -r line; do - [[ $line =~ DEFINE_KNOWN_FOLDER\((FOLDERID_[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+)\) ]] || continue - printf "%s = &KNOWNFOLDERID{0x%08x, 0x%04x, 0x%04x, [8]byte{0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x}}\n" \ - "${BASH_REMATCH[1]}" $(( "${BASH_REMATCH[2]}" )) $(( "${BASH_REMATCH[3]}" )) $(( "${BASH_REMATCH[4]}" )) \ - $(( "${BASH_REMATCH[5]}" )) $(( "${BASH_REMATCH[6]}" )) $(( "${BASH_REMATCH[7]}" )) $(( "${BASH_REMATCH[8]}" )) \ - $(( "${BASH_REMATCH[9]}" )) $(( "${BASH_REMATCH[10]}" )) $(( "${BASH_REMATCH[11]}" )) $(( "${BASH_REMATCH[12]}" )) - done < "$knownfolders" - echo ")" -} | gofmt > "zknownfolderids_windows.go" diff --git a/vendor/golang.org/x/text/width/gen.go b/vendor/golang.org/x/text/width/gen.go deleted file mode 100644 index 092277e..0000000 --- a/vendor/golang.org/x/text/width/gen.go +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// This program generates the trie for width operations. The generated table -// includes width category information as well as the normalization mappings. -package main - -import ( - "bytes" - "fmt" - "io" - "log" - "math" - "unicode/utf8" - - "golang.org/x/text/internal/gen" - "golang.org/x/text/internal/triegen" -) - -// See gen_common.go for flags. - -func main() { - gen.Init() - genTables() - genTests() - gen.Repackage("gen_trieval.go", "trieval.go", "width") - gen.Repackage("gen_common.go", "common_test.go", "width") -} - -func genTables() { - t := triegen.NewTrie("width") - // fold and inverse mappings. See mapComment for a description of the format - // of each entry. Add dummy value to make an index of 0 mean no mapping. - inverse := [][4]byte{{}} - mapping := map[[4]byte]int{[4]byte{}: 0} - - getWidthData(func(r rune, tag elem, alt rune) { - idx := 0 - if alt != 0 { - var buf [4]byte - buf[0] = byte(utf8.EncodeRune(buf[1:], alt)) - s := string(r) - buf[buf[0]] ^= s[len(s)-1] - var ok bool - if idx, ok = mapping[buf]; !ok { - idx = len(mapping) - if idx > math.MaxUint8 { - log.Fatalf("Index %d does not fit in a byte.", idx) - } - mapping[buf] = idx - inverse = append(inverse, buf) - } - } - t.Insert(r, uint64(tag|elem(idx))) - }) - - w := &bytes.Buffer{} - gen.WriteUnicodeVersion(w) - - sz, err := t.Gen(w) - if err != nil { - log.Fatal(err) - } - - sz += writeMappings(w, inverse) - - fmt.Fprintf(w, "// Total table size %d bytes (%dKiB)\n", sz, sz/1024) - - gen.WriteVersionedGoFile(*outputFile, "width", w.Bytes()) -} - -const inverseDataComment = ` -// inverseData contains 4-byte entries of the following format: -// <0 padding> -// The last byte of the UTF-8-encoded rune is xor-ed with the last byte of the -// UTF-8 encoding of the original rune. Mappings often have the following -// pattern: -// A -> A (U+FF21 -> U+0041) -// B -> B (U+FF22 -> U+0042) -// ... -// By xor-ing the last byte the same entry can be shared by many mappings. This -// reduces the total number of distinct entries by about two thirds. -// The resulting entry for the aforementioned mappings is -// { 0x01, 0xE0, 0x00, 0x00 } -// Using this entry to map U+FF21 (UTF-8 [EF BC A1]), we get -// E0 ^ A1 = 41. -// Similarly, for U+FF22 (UTF-8 [EF BC A2]), we get -// E0 ^ A2 = 42. -// Note that because of the xor-ing, the byte sequence stored in the entry is -// not valid UTF-8.` - -func writeMappings(w io.Writer, data [][4]byte) int { - fmt.Fprintln(w, inverseDataComment) - fmt.Fprintf(w, "var inverseData = [%d][4]byte{\n", len(data)) - for _, x := range data { - fmt.Fprintf(w, "{ 0x%02x, 0x%02x, 0x%02x, 0x%02x },\n", x[0], x[1], x[2], x[3]) - } - fmt.Fprintln(w, "}") - return len(data) * 4 -} - -func genTests() { - w := &bytes.Buffer{} - fmt.Fprintf(w, "\nvar mapRunes = map[rune]struct{r rune; e elem}{\n") - getWidthData(func(r rune, tag elem, alt rune) { - if alt != 0 { - fmt.Fprintf(w, "\t0x%X: {0x%X, 0x%X},\n", r, alt, tag) - } - }) - fmt.Fprintln(w, "}") - gen.WriteGoFile("runes_test.go", "width", w.Bytes()) -} diff --git a/vendor/golang.org/x/text/width/gen_common.go b/vendor/golang.org/x/text/width/gen_common.go deleted file mode 100644 index 601e752..0000000 --- a/vendor/golang.org/x/text/width/gen_common.go +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -// This code is shared between the main code generator and the test code. - -import ( - "flag" - "log" - "strconv" - "strings" - - "golang.org/x/text/internal/gen" - "golang.org/x/text/internal/ucd" -) - -var ( - outputFile = flag.String("out", "tables.go", "output file") -) - -var typeMap = map[string]elem{ - "A": tagAmbiguous, - "N": tagNeutral, - "Na": tagNarrow, - "W": tagWide, - "F": tagFullwidth, - "H": tagHalfwidth, -} - -// getWidthData calls f for every entry for which it is defined. -// -// f may be called multiple times for the same rune. The last call to f is the -// correct value. f is not called for all runes. The default tag type is -// Neutral. -func getWidthData(f func(r rune, tag elem, alt rune)) { - // Set the default values for Unified Ideographs. In line with Annex 11, - // we encode full ranges instead of the defined runes in Unified_Ideograph. - for _, b := range []struct{ lo, hi rune }{ - {0x4E00, 0x9FFF}, // the CJK Unified Ideographs block, - {0x3400, 0x4DBF}, // the CJK Unified Ideographs Externsion A block, - {0xF900, 0xFAFF}, // the CJK Compatibility Ideographs block, - {0x20000, 0x2FFFF}, // the Supplementary Ideographic Plane, - {0x30000, 0x3FFFF}, // the Tertiary Ideographic Plane, - } { - for r := b.lo; r <= b.hi; r++ { - f(r, tagWide, 0) - } - } - - inverse := map[rune]rune{} - maps := map[string]bool{ - "": true, - "": true, - } - - // We cannot reuse package norm's decomposition, as we need an unexpanded - // decomposition. We make use of the opportunity to verify that the - // decomposition type is as expected. - ucd.Parse(gen.OpenUCDFile("UnicodeData.txt"), func(p *ucd.Parser) { - r := p.Rune(0) - s := strings.SplitN(p.String(ucd.DecompMapping), " ", 2) - if !maps[s[0]] { - return - } - x, err := strconv.ParseUint(s[1], 16, 32) - if err != nil { - log.Fatalf("Error parsing rune %q", s[1]) - } - if inverse[r] != 0 || inverse[rune(x)] != 0 { - log.Fatalf("Circular dependency in mapping between %U and %U", r, x) - } - inverse[r] = rune(x) - inverse[rune(x)] = r - }) - - // ; - ucd.Parse(gen.OpenUCDFile("EastAsianWidth.txt"), func(p *ucd.Parser) { - tag, ok := typeMap[p.String(1)] - if !ok { - log.Fatalf("Unknown width type %q", p.String(1)) - } - r := p.Rune(0) - alt, ok := inverse[r] - if tag == tagFullwidth || tag == tagHalfwidth && r != wonSign { - tag |= tagNeedsFold - if !ok { - log.Fatalf("Narrow or wide rune %U has no decomposition", r) - } - } - f(r, tag, alt) - }) -} diff --git a/vendor/golang.org/x/text/width/gen_trieval.go b/vendor/golang.org/x/text/width/gen_trieval.go deleted file mode 100644 index c17334a..0000000 --- a/vendor/golang.org/x/text/width/gen_trieval.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -// elem is an entry of the width trie. The high byte is used to encode the type -// of the rune. The low byte is used to store the index to a mapping entry in -// the inverseData array. -type elem uint16 - -const ( - tagNeutral elem = iota << typeShift - tagAmbiguous - tagWide - tagNarrow - tagFullwidth - tagHalfwidth -) - -const ( - numTypeBits = 3 - typeShift = 16 - numTypeBits - - // tagNeedsFold is true for all fullwidth and halfwidth runes except for - // the Won sign U+20A9. - tagNeedsFold = 0x1000 - - // The Korean Won sign is halfwidth, but SHOULD NOT be mapped to a wide - // variant. - wonSign rune = 0x20A9 -) diff --git a/vendor/golang.org/x/text/width/kind_string.go b/vendor/golang.org/x/text/width/kind_string.go deleted file mode 100644 index dd3febd..0000000 --- a/vendor/golang.org/x/text/width/kind_string.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by "stringer -type=Kind"; DO NOT EDIT. - -package width - -import "strconv" - -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - // Re-run the stringer command to generate them again. - var x [1]struct{} - _ = x[Neutral-0] - _ = x[EastAsianAmbiguous-1] - _ = x[EastAsianWide-2] - _ = x[EastAsianNarrow-3] - _ = x[EastAsianFullwidth-4] - _ = x[EastAsianHalfwidth-5] -} - -const _Kind_name = "NeutralEastAsianAmbiguousEastAsianWideEastAsianNarrowEastAsianFullwidthEastAsianHalfwidth" - -var _Kind_index = [...]uint8{0, 7, 25, 38, 53, 71, 89} - -func (i Kind) String() string { - if i < 0 || i >= Kind(len(_Kind_index)-1) { - return "Kind(" + strconv.FormatInt(int64(i), 10) + ")" - } - return _Kind_name[_Kind_index[i]:_Kind_index[i+1]] -} diff --git a/vendor/golang.org/x/text/width/tables10.0.0.go b/vendor/golang.org/x/text/width/tables10.0.0.go deleted file mode 100644 index decb8e4..0000000 --- a/vendor/golang.org/x/text/width/tables10.0.0.go +++ /dev/null @@ -1,1318 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -// +build go1.10,!go1.13 - -package width - -// UnicodeVersion is the Unicode version from which the tables in this package are derived. -const UnicodeVersion = "10.0.0" - -// lookup returns the trie value for the first UTF-8 encoding in s and -// the width in bytes of this encoding. The size will be 0 if s does not -// hold enough bytes to complete the encoding. len(s) must be greater than 0. -func (t *widthTrie) lookup(s []byte) (v uint16, sz int) { - c0 := s[0] - switch { - case c0 < 0x80: // is ASCII - return widthValues[c0], 1 - case c0 < 0xC2: - return 0, 1 // Illegal UTF-8: not a starter, not ASCII. - case c0 < 0xE0: // 2-byte UTF-8 - if len(s) < 2 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c1), 2 - case c0 < 0xF0: // 3-byte UTF-8 - if len(s) < 3 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c2), 3 - case c0 < 0xF8: // 4-byte UTF-8 - if len(s) < 4 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - o = uint32(i)<<6 + uint32(c2) - i = widthIndex[o] - c3 := s[3] - if c3 < 0x80 || 0xC0 <= c3 { - return 0, 3 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c3), 4 - } - // Illegal rune - return 0, 1 -} - -// lookupUnsafe returns the trie value for the first UTF-8 encoding in s. -// s must start with a full and valid UTF-8 encoded rune. -func (t *widthTrie) lookupUnsafe(s []byte) uint16 { - c0 := s[0] - if c0 < 0x80 { // is ASCII - return widthValues[c0] - } - i := widthIndex[c0] - if c0 < 0xE0 { // 2-byte UTF-8 - return t.lookupValue(uint32(i), s[1]) - } - i = widthIndex[uint32(i)<<6+uint32(s[1])] - if c0 < 0xF0 { // 3-byte UTF-8 - return t.lookupValue(uint32(i), s[2]) - } - i = widthIndex[uint32(i)<<6+uint32(s[2])] - if c0 < 0xF8 { // 4-byte UTF-8 - return t.lookupValue(uint32(i), s[3]) - } - return 0 -} - -// lookupString returns the trie value for the first UTF-8 encoding in s and -// the width in bytes of this encoding. The size will be 0 if s does not -// hold enough bytes to complete the encoding. len(s) must be greater than 0. -func (t *widthTrie) lookupString(s string) (v uint16, sz int) { - c0 := s[0] - switch { - case c0 < 0x80: // is ASCII - return widthValues[c0], 1 - case c0 < 0xC2: - return 0, 1 // Illegal UTF-8: not a starter, not ASCII. - case c0 < 0xE0: // 2-byte UTF-8 - if len(s) < 2 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c1), 2 - case c0 < 0xF0: // 3-byte UTF-8 - if len(s) < 3 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c2), 3 - case c0 < 0xF8: // 4-byte UTF-8 - if len(s) < 4 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - o = uint32(i)<<6 + uint32(c2) - i = widthIndex[o] - c3 := s[3] - if c3 < 0x80 || 0xC0 <= c3 { - return 0, 3 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c3), 4 - } - // Illegal rune - return 0, 1 -} - -// lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. -// s must start with a full and valid UTF-8 encoded rune. -func (t *widthTrie) lookupStringUnsafe(s string) uint16 { - c0 := s[0] - if c0 < 0x80 { // is ASCII - return widthValues[c0] - } - i := widthIndex[c0] - if c0 < 0xE0 { // 2-byte UTF-8 - return t.lookupValue(uint32(i), s[1]) - } - i = widthIndex[uint32(i)<<6+uint32(s[1])] - if c0 < 0xF0 { // 3-byte UTF-8 - return t.lookupValue(uint32(i), s[2]) - } - i = widthIndex[uint32(i)<<6+uint32(s[2])] - if c0 < 0xF8 { // 4-byte UTF-8 - return t.lookupValue(uint32(i), s[3]) - } - return 0 -} - -// widthTrie. Total size: 14336 bytes (14.00 KiB). Checksum: c59df54630d3dc4a. -type widthTrie struct{} - -func newWidthTrie(i int) *widthTrie { - return &widthTrie{} -} - -// lookupValue determines the type of block n and looks up the value for b. -func (t *widthTrie) lookupValue(n uint32, b byte) uint16 { - switch { - default: - return uint16(widthValues[n<<6+uint32(b)]) - } -} - -// widthValues: 101 blocks, 6464 entries, 12928 bytes -// The third block is the zero block. -var widthValues = [6464]uint16{ - // Block 0x0, offset 0x0 - 0x20: 0x6001, 0x21: 0x6002, 0x22: 0x6002, 0x23: 0x6002, - 0x24: 0x6002, 0x25: 0x6002, 0x26: 0x6002, 0x27: 0x6002, 0x28: 0x6002, 0x29: 0x6002, - 0x2a: 0x6002, 0x2b: 0x6002, 0x2c: 0x6002, 0x2d: 0x6002, 0x2e: 0x6002, 0x2f: 0x6002, - 0x30: 0x6002, 0x31: 0x6002, 0x32: 0x6002, 0x33: 0x6002, 0x34: 0x6002, 0x35: 0x6002, - 0x36: 0x6002, 0x37: 0x6002, 0x38: 0x6002, 0x39: 0x6002, 0x3a: 0x6002, 0x3b: 0x6002, - 0x3c: 0x6002, 0x3d: 0x6002, 0x3e: 0x6002, 0x3f: 0x6002, - // Block 0x1, offset 0x40 - 0x40: 0x6003, 0x41: 0x6003, 0x42: 0x6003, 0x43: 0x6003, 0x44: 0x6003, 0x45: 0x6003, - 0x46: 0x6003, 0x47: 0x6003, 0x48: 0x6003, 0x49: 0x6003, 0x4a: 0x6003, 0x4b: 0x6003, - 0x4c: 0x6003, 0x4d: 0x6003, 0x4e: 0x6003, 0x4f: 0x6003, 0x50: 0x6003, 0x51: 0x6003, - 0x52: 0x6003, 0x53: 0x6003, 0x54: 0x6003, 0x55: 0x6003, 0x56: 0x6003, 0x57: 0x6003, - 0x58: 0x6003, 0x59: 0x6003, 0x5a: 0x6003, 0x5b: 0x6003, 0x5c: 0x6003, 0x5d: 0x6003, - 0x5e: 0x6003, 0x5f: 0x6003, 0x60: 0x6004, 0x61: 0x6004, 0x62: 0x6004, 0x63: 0x6004, - 0x64: 0x6004, 0x65: 0x6004, 0x66: 0x6004, 0x67: 0x6004, 0x68: 0x6004, 0x69: 0x6004, - 0x6a: 0x6004, 0x6b: 0x6004, 0x6c: 0x6004, 0x6d: 0x6004, 0x6e: 0x6004, 0x6f: 0x6004, - 0x70: 0x6004, 0x71: 0x6004, 0x72: 0x6004, 0x73: 0x6004, 0x74: 0x6004, 0x75: 0x6004, - 0x76: 0x6004, 0x77: 0x6004, 0x78: 0x6004, 0x79: 0x6004, 0x7a: 0x6004, 0x7b: 0x6004, - 0x7c: 0x6004, 0x7d: 0x6004, 0x7e: 0x6004, - // Block 0x2, offset 0x80 - // Block 0x3, offset 0xc0 - 0xe1: 0x2000, 0xe2: 0x6005, 0xe3: 0x6005, - 0xe4: 0x2000, 0xe5: 0x6006, 0xe6: 0x6005, 0xe7: 0x2000, 0xe8: 0x2000, - 0xea: 0x2000, 0xec: 0x6007, 0xed: 0x2000, 0xee: 0x2000, 0xef: 0x6008, - 0xf0: 0x2000, 0xf1: 0x2000, 0xf2: 0x2000, 0xf3: 0x2000, 0xf4: 0x2000, - 0xf6: 0x2000, 0xf7: 0x2000, 0xf8: 0x2000, 0xf9: 0x2000, 0xfa: 0x2000, - 0xfc: 0x2000, 0xfd: 0x2000, 0xfe: 0x2000, 0xff: 0x2000, - // Block 0x4, offset 0x100 - 0x106: 0x2000, - 0x110: 0x2000, - 0x117: 0x2000, - 0x118: 0x2000, - 0x11e: 0x2000, 0x11f: 0x2000, 0x120: 0x2000, 0x121: 0x2000, - 0x126: 0x2000, 0x128: 0x2000, 0x129: 0x2000, - 0x12a: 0x2000, 0x12c: 0x2000, 0x12d: 0x2000, - 0x130: 0x2000, 0x132: 0x2000, 0x133: 0x2000, - 0x137: 0x2000, 0x138: 0x2000, 0x139: 0x2000, 0x13a: 0x2000, - 0x13c: 0x2000, 0x13e: 0x2000, - // Block 0x5, offset 0x140 - 0x141: 0x2000, - 0x151: 0x2000, - 0x153: 0x2000, - 0x15b: 0x2000, - 0x166: 0x2000, 0x167: 0x2000, - 0x16b: 0x2000, - 0x171: 0x2000, 0x172: 0x2000, 0x173: 0x2000, - 0x178: 0x2000, - 0x17f: 0x2000, - // Block 0x6, offset 0x180 - 0x180: 0x2000, 0x181: 0x2000, 0x182: 0x2000, 0x184: 0x2000, - 0x188: 0x2000, 0x189: 0x2000, 0x18a: 0x2000, 0x18b: 0x2000, - 0x18d: 0x2000, - 0x192: 0x2000, 0x193: 0x2000, - 0x1a6: 0x2000, 0x1a7: 0x2000, - 0x1ab: 0x2000, - // Block 0x7, offset 0x1c0 - 0x1ce: 0x2000, 0x1d0: 0x2000, - 0x1d2: 0x2000, 0x1d4: 0x2000, 0x1d6: 0x2000, - 0x1d8: 0x2000, 0x1da: 0x2000, 0x1dc: 0x2000, - // Block 0x8, offset 0x200 - 0x211: 0x2000, - 0x221: 0x2000, - // Block 0x9, offset 0x240 - 0x244: 0x2000, - 0x247: 0x2000, 0x249: 0x2000, 0x24a: 0x2000, 0x24b: 0x2000, - 0x24d: 0x2000, 0x250: 0x2000, - 0x258: 0x2000, 0x259: 0x2000, 0x25a: 0x2000, 0x25b: 0x2000, 0x25d: 0x2000, - 0x25f: 0x2000, - // Block 0xa, offset 0x280 - 0x280: 0x2000, 0x281: 0x2000, 0x282: 0x2000, 0x283: 0x2000, 0x284: 0x2000, 0x285: 0x2000, - 0x286: 0x2000, 0x287: 0x2000, 0x288: 0x2000, 0x289: 0x2000, 0x28a: 0x2000, 0x28b: 0x2000, - 0x28c: 0x2000, 0x28d: 0x2000, 0x28e: 0x2000, 0x28f: 0x2000, 0x290: 0x2000, 0x291: 0x2000, - 0x292: 0x2000, 0x293: 0x2000, 0x294: 0x2000, 0x295: 0x2000, 0x296: 0x2000, 0x297: 0x2000, - 0x298: 0x2000, 0x299: 0x2000, 0x29a: 0x2000, 0x29b: 0x2000, 0x29c: 0x2000, 0x29d: 0x2000, - 0x29e: 0x2000, 0x29f: 0x2000, 0x2a0: 0x2000, 0x2a1: 0x2000, 0x2a2: 0x2000, 0x2a3: 0x2000, - 0x2a4: 0x2000, 0x2a5: 0x2000, 0x2a6: 0x2000, 0x2a7: 0x2000, 0x2a8: 0x2000, 0x2a9: 0x2000, - 0x2aa: 0x2000, 0x2ab: 0x2000, 0x2ac: 0x2000, 0x2ad: 0x2000, 0x2ae: 0x2000, 0x2af: 0x2000, - 0x2b0: 0x2000, 0x2b1: 0x2000, 0x2b2: 0x2000, 0x2b3: 0x2000, 0x2b4: 0x2000, 0x2b5: 0x2000, - 0x2b6: 0x2000, 0x2b7: 0x2000, 0x2b8: 0x2000, 0x2b9: 0x2000, 0x2ba: 0x2000, 0x2bb: 0x2000, - 0x2bc: 0x2000, 0x2bd: 0x2000, 0x2be: 0x2000, 0x2bf: 0x2000, - // Block 0xb, offset 0x2c0 - 0x2c0: 0x2000, 0x2c1: 0x2000, 0x2c2: 0x2000, 0x2c3: 0x2000, 0x2c4: 0x2000, 0x2c5: 0x2000, - 0x2c6: 0x2000, 0x2c7: 0x2000, 0x2c8: 0x2000, 0x2c9: 0x2000, 0x2ca: 0x2000, 0x2cb: 0x2000, - 0x2cc: 0x2000, 0x2cd: 0x2000, 0x2ce: 0x2000, 0x2cf: 0x2000, 0x2d0: 0x2000, 0x2d1: 0x2000, - 0x2d2: 0x2000, 0x2d3: 0x2000, 0x2d4: 0x2000, 0x2d5: 0x2000, 0x2d6: 0x2000, 0x2d7: 0x2000, - 0x2d8: 0x2000, 0x2d9: 0x2000, 0x2da: 0x2000, 0x2db: 0x2000, 0x2dc: 0x2000, 0x2dd: 0x2000, - 0x2de: 0x2000, 0x2df: 0x2000, 0x2e0: 0x2000, 0x2e1: 0x2000, 0x2e2: 0x2000, 0x2e3: 0x2000, - 0x2e4: 0x2000, 0x2e5: 0x2000, 0x2e6: 0x2000, 0x2e7: 0x2000, 0x2e8: 0x2000, 0x2e9: 0x2000, - 0x2ea: 0x2000, 0x2eb: 0x2000, 0x2ec: 0x2000, 0x2ed: 0x2000, 0x2ee: 0x2000, 0x2ef: 0x2000, - // Block 0xc, offset 0x300 - 0x311: 0x2000, - 0x312: 0x2000, 0x313: 0x2000, 0x314: 0x2000, 0x315: 0x2000, 0x316: 0x2000, 0x317: 0x2000, - 0x318: 0x2000, 0x319: 0x2000, 0x31a: 0x2000, 0x31b: 0x2000, 0x31c: 0x2000, 0x31d: 0x2000, - 0x31e: 0x2000, 0x31f: 0x2000, 0x320: 0x2000, 0x321: 0x2000, 0x323: 0x2000, - 0x324: 0x2000, 0x325: 0x2000, 0x326: 0x2000, 0x327: 0x2000, 0x328: 0x2000, 0x329: 0x2000, - 0x331: 0x2000, 0x332: 0x2000, 0x333: 0x2000, 0x334: 0x2000, 0x335: 0x2000, - 0x336: 0x2000, 0x337: 0x2000, 0x338: 0x2000, 0x339: 0x2000, 0x33a: 0x2000, 0x33b: 0x2000, - 0x33c: 0x2000, 0x33d: 0x2000, 0x33e: 0x2000, 0x33f: 0x2000, - // Block 0xd, offset 0x340 - 0x340: 0x2000, 0x341: 0x2000, 0x343: 0x2000, 0x344: 0x2000, 0x345: 0x2000, - 0x346: 0x2000, 0x347: 0x2000, 0x348: 0x2000, 0x349: 0x2000, - // Block 0xe, offset 0x380 - 0x381: 0x2000, - 0x390: 0x2000, 0x391: 0x2000, - 0x392: 0x2000, 0x393: 0x2000, 0x394: 0x2000, 0x395: 0x2000, 0x396: 0x2000, 0x397: 0x2000, - 0x398: 0x2000, 0x399: 0x2000, 0x39a: 0x2000, 0x39b: 0x2000, 0x39c: 0x2000, 0x39d: 0x2000, - 0x39e: 0x2000, 0x39f: 0x2000, 0x3a0: 0x2000, 0x3a1: 0x2000, 0x3a2: 0x2000, 0x3a3: 0x2000, - 0x3a4: 0x2000, 0x3a5: 0x2000, 0x3a6: 0x2000, 0x3a7: 0x2000, 0x3a8: 0x2000, 0x3a9: 0x2000, - 0x3aa: 0x2000, 0x3ab: 0x2000, 0x3ac: 0x2000, 0x3ad: 0x2000, 0x3ae: 0x2000, 0x3af: 0x2000, - 0x3b0: 0x2000, 0x3b1: 0x2000, 0x3b2: 0x2000, 0x3b3: 0x2000, 0x3b4: 0x2000, 0x3b5: 0x2000, - 0x3b6: 0x2000, 0x3b7: 0x2000, 0x3b8: 0x2000, 0x3b9: 0x2000, 0x3ba: 0x2000, 0x3bb: 0x2000, - 0x3bc: 0x2000, 0x3bd: 0x2000, 0x3be: 0x2000, 0x3bf: 0x2000, - // Block 0xf, offset 0x3c0 - 0x3c0: 0x2000, 0x3c1: 0x2000, 0x3c2: 0x2000, 0x3c3: 0x2000, 0x3c4: 0x2000, 0x3c5: 0x2000, - 0x3c6: 0x2000, 0x3c7: 0x2000, 0x3c8: 0x2000, 0x3c9: 0x2000, 0x3ca: 0x2000, 0x3cb: 0x2000, - 0x3cc: 0x2000, 0x3cd: 0x2000, 0x3ce: 0x2000, 0x3cf: 0x2000, 0x3d1: 0x2000, - // Block 0x10, offset 0x400 - 0x400: 0x4000, 0x401: 0x4000, 0x402: 0x4000, 0x403: 0x4000, 0x404: 0x4000, 0x405: 0x4000, - 0x406: 0x4000, 0x407: 0x4000, 0x408: 0x4000, 0x409: 0x4000, 0x40a: 0x4000, 0x40b: 0x4000, - 0x40c: 0x4000, 0x40d: 0x4000, 0x40e: 0x4000, 0x40f: 0x4000, 0x410: 0x4000, 0x411: 0x4000, - 0x412: 0x4000, 0x413: 0x4000, 0x414: 0x4000, 0x415: 0x4000, 0x416: 0x4000, 0x417: 0x4000, - 0x418: 0x4000, 0x419: 0x4000, 0x41a: 0x4000, 0x41b: 0x4000, 0x41c: 0x4000, 0x41d: 0x4000, - 0x41e: 0x4000, 0x41f: 0x4000, 0x420: 0x4000, 0x421: 0x4000, 0x422: 0x4000, 0x423: 0x4000, - 0x424: 0x4000, 0x425: 0x4000, 0x426: 0x4000, 0x427: 0x4000, 0x428: 0x4000, 0x429: 0x4000, - 0x42a: 0x4000, 0x42b: 0x4000, 0x42c: 0x4000, 0x42d: 0x4000, 0x42e: 0x4000, 0x42f: 0x4000, - 0x430: 0x4000, 0x431: 0x4000, 0x432: 0x4000, 0x433: 0x4000, 0x434: 0x4000, 0x435: 0x4000, - 0x436: 0x4000, 0x437: 0x4000, 0x438: 0x4000, 0x439: 0x4000, 0x43a: 0x4000, 0x43b: 0x4000, - 0x43c: 0x4000, 0x43d: 0x4000, 0x43e: 0x4000, 0x43f: 0x4000, - // Block 0x11, offset 0x440 - 0x440: 0x4000, 0x441: 0x4000, 0x442: 0x4000, 0x443: 0x4000, 0x444: 0x4000, 0x445: 0x4000, - 0x446: 0x4000, 0x447: 0x4000, 0x448: 0x4000, 0x449: 0x4000, 0x44a: 0x4000, 0x44b: 0x4000, - 0x44c: 0x4000, 0x44d: 0x4000, 0x44e: 0x4000, 0x44f: 0x4000, 0x450: 0x4000, 0x451: 0x4000, - 0x452: 0x4000, 0x453: 0x4000, 0x454: 0x4000, 0x455: 0x4000, 0x456: 0x4000, 0x457: 0x4000, - 0x458: 0x4000, 0x459: 0x4000, 0x45a: 0x4000, 0x45b: 0x4000, 0x45c: 0x4000, 0x45d: 0x4000, - 0x45e: 0x4000, 0x45f: 0x4000, - // Block 0x12, offset 0x480 - 0x490: 0x2000, - 0x493: 0x2000, 0x494: 0x2000, 0x495: 0x2000, 0x496: 0x2000, - 0x498: 0x2000, 0x499: 0x2000, 0x49c: 0x2000, 0x49d: 0x2000, - 0x4a0: 0x2000, 0x4a1: 0x2000, 0x4a2: 0x2000, - 0x4a4: 0x2000, 0x4a5: 0x2000, 0x4a6: 0x2000, 0x4a7: 0x2000, - 0x4b0: 0x2000, 0x4b2: 0x2000, 0x4b3: 0x2000, 0x4b5: 0x2000, - 0x4bb: 0x2000, - 0x4be: 0x2000, - // Block 0x13, offset 0x4c0 - 0x4f4: 0x2000, - 0x4ff: 0x2000, - // Block 0x14, offset 0x500 - 0x501: 0x2000, 0x502: 0x2000, 0x503: 0x2000, 0x504: 0x2000, - 0x529: 0xa009, - 0x52c: 0x2000, - // Block 0x15, offset 0x540 - 0x543: 0x2000, 0x545: 0x2000, - 0x549: 0x2000, - 0x553: 0x2000, 0x556: 0x2000, - 0x561: 0x2000, 0x562: 0x2000, - 0x566: 0x2000, - 0x56b: 0x2000, - // Block 0x16, offset 0x580 - 0x593: 0x2000, 0x594: 0x2000, - 0x59b: 0x2000, 0x59c: 0x2000, 0x59d: 0x2000, - 0x59e: 0x2000, 0x5a0: 0x2000, 0x5a1: 0x2000, 0x5a2: 0x2000, 0x5a3: 0x2000, - 0x5a4: 0x2000, 0x5a5: 0x2000, 0x5a6: 0x2000, 0x5a7: 0x2000, 0x5a8: 0x2000, 0x5a9: 0x2000, - 0x5aa: 0x2000, 0x5ab: 0x2000, - 0x5b0: 0x2000, 0x5b1: 0x2000, 0x5b2: 0x2000, 0x5b3: 0x2000, 0x5b4: 0x2000, 0x5b5: 0x2000, - 0x5b6: 0x2000, 0x5b7: 0x2000, 0x5b8: 0x2000, 0x5b9: 0x2000, - // Block 0x17, offset 0x5c0 - 0x5c9: 0x2000, - 0x5d0: 0x200a, 0x5d1: 0x200b, - 0x5d2: 0x200a, 0x5d3: 0x200c, 0x5d4: 0x2000, 0x5d5: 0x2000, 0x5d6: 0x2000, 0x5d7: 0x2000, - 0x5d8: 0x2000, 0x5d9: 0x2000, - 0x5f8: 0x2000, 0x5f9: 0x2000, - // Block 0x18, offset 0x600 - 0x612: 0x2000, 0x614: 0x2000, - 0x627: 0x2000, - // Block 0x19, offset 0x640 - 0x640: 0x2000, 0x642: 0x2000, 0x643: 0x2000, - 0x647: 0x2000, 0x648: 0x2000, 0x64b: 0x2000, - 0x64f: 0x2000, 0x651: 0x2000, - 0x655: 0x2000, - 0x65a: 0x2000, 0x65d: 0x2000, - 0x65e: 0x2000, 0x65f: 0x2000, 0x660: 0x2000, 0x663: 0x2000, - 0x665: 0x2000, 0x667: 0x2000, 0x668: 0x2000, 0x669: 0x2000, - 0x66a: 0x2000, 0x66b: 0x2000, 0x66c: 0x2000, 0x66e: 0x2000, - 0x674: 0x2000, 0x675: 0x2000, - 0x676: 0x2000, 0x677: 0x2000, - 0x67c: 0x2000, 0x67d: 0x2000, - // Block 0x1a, offset 0x680 - 0x688: 0x2000, - 0x68c: 0x2000, - 0x692: 0x2000, - 0x6a0: 0x2000, 0x6a1: 0x2000, - 0x6a4: 0x2000, 0x6a5: 0x2000, 0x6a6: 0x2000, 0x6a7: 0x2000, - 0x6aa: 0x2000, 0x6ab: 0x2000, 0x6ae: 0x2000, 0x6af: 0x2000, - // Block 0x1b, offset 0x6c0 - 0x6c2: 0x2000, 0x6c3: 0x2000, - 0x6c6: 0x2000, 0x6c7: 0x2000, - 0x6d5: 0x2000, - 0x6d9: 0x2000, - 0x6e5: 0x2000, - 0x6ff: 0x2000, - // Block 0x1c, offset 0x700 - 0x712: 0x2000, - 0x71a: 0x4000, 0x71b: 0x4000, - 0x729: 0x4000, - 0x72a: 0x4000, - // Block 0x1d, offset 0x740 - 0x769: 0x4000, - 0x76a: 0x4000, 0x76b: 0x4000, 0x76c: 0x4000, - 0x770: 0x4000, 0x773: 0x4000, - // Block 0x1e, offset 0x780 - 0x7a0: 0x2000, 0x7a1: 0x2000, 0x7a2: 0x2000, 0x7a3: 0x2000, - 0x7a4: 0x2000, 0x7a5: 0x2000, 0x7a6: 0x2000, 0x7a7: 0x2000, 0x7a8: 0x2000, 0x7a9: 0x2000, - 0x7aa: 0x2000, 0x7ab: 0x2000, 0x7ac: 0x2000, 0x7ad: 0x2000, 0x7ae: 0x2000, 0x7af: 0x2000, - 0x7b0: 0x2000, 0x7b1: 0x2000, 0x7b2: 0x2000, 0x7b3: 0x2000, 0x7b4: 0x2000, 0x7b5: 0x2000, - 0x7b6: 0x2000, 0x7b7: 0x2000, 0x7b8: 0x2000, 0x7b9: 0x2000, 0x7ba: 0x2000, 0x7bb: 0x2000, - 0x7bc: 0x2000, 0x7bd: 0x2000, 0x7be: 0x2000, 0x7bf: 0x2000, - // Block 0x1f, offset 0x7c0 - 0x7c0: 0x2000, 0x7c1: 0x2000, 0x7c2: 0x2000, 0x7c3: 0x2000, 0x7c4: 0x2000, 0x7c5: 0x2000, - 0x7c6: 0x2000, 0x7c7: 0x2000, 0x7c8: 0x2000, 0x7c9: 0x2000, 0x7ca: 0x2000, 0x7cb: 0x2000, - 0x7cc: 0x2000, 0x7cd: 0x2000, 0x7ce: 0x2000, 0x7cf: 0x2000, 0x7d0: 0x2000, 0x7d1: 0x2000, - 0x7d2: 0x2000, 0x7d3: 0x2000, 0x7d4: 0x2000, 0x7d5: 0x2000, 0x7d6: 0x2000, 0x7d7: 0x2000, - 0x7d8: 0x2000, 0x7d9: 0x2000, 0x7da: 0x2000, 0x7db: 0x2000, 0x7dc: 0x2000, 0x7dd: 0x2000, - 0x7de: 0x2000, 0x7df: 0x2000, 0x7e0: 0x2000, 0x7e1: 0x2000, 0x7e2: 0x2000, 0x7e3: 0x2000, - 0x7e4: 0x2000, 0x7e5: 0x2000, 0x7e6: 0x2000, 0x7e7: 0x2000, 0x7e8: 0x2000, 0x7e9: 0x2000, - 0x7eb: 0x2000, 0x7ec: 0x2000, 0x7ed: 0x2000, 0x7ee: 0x2000, 0x7ef: 0x2000, - 0x7f0: 0x2000, 0x7f1: 0x2000, 0x7f2: 0x2000, 0x7f3: 0x2000, 0x7f4: 0x2000, 0x7f5: 0x2000, - 0x7f6: 0x2000, 0x7f7: 0x2000, 0x7f8: 0x2000, 0x7f9: 0x2000, 0x7fa: 0x2000, 0x7fb: 0x2000, - 0x7fc: 0x2000, 0x7fd: 0x2000, 0x7fe: 0x2000, 0x7ff: 0x2000, - // Block 0x20, offset 0x800 - 0x800: 0x2000, 0x801: 0x2000, 0x802: 0x200d, 0x803: 0x2000, 0x804: 0x2000, 0x805: 0x2000, - 0x806: 0x2000, 0x807: 0x2000, 0x808: 0x2000, 0x809: 0x2000, 0x80a: 0x2000, 0x80b: 0x2000, - 0x80c: 0x2000, 0x80d: 0x2000, 0x80e: 0x2000, 0x80f: 0x2000, 0x810: 0x2000, 0x811: 0x2000, - 0x812: 0x2000, 0x813: 0x2000, 0x814: 0x2000, 0x815: 0x2000, 0x816: 0x2000, 0x817: 0x2000, - 0x818: 0x2000, 0x819: 0x2000, 0x81a: 0x2000, 0x81b: 0x2000, 0x81c: 0x2000, 0x81d: 0x2000, - 0x81e: 0x2000, 0x81f: 0x2000, 0x820: 0x2000, 0x821: 0x2000, 0x822: 0x2000, 0x823: 0x2000, - 0x824: 0x2000, 0x825: 0x2000, 0x826: 0x2000, 0x827: 0x2000, 0x828: 0x2000, 0x829: 0x2000, - 0x82a: 0x2000, 0x82b: 0x2000, 0x82c: 0x2000, 0x82d: 0x2000, 0x82e: 0x2000, 0x82f: 0x2000, - 0x830: 0x2000, 0x831: 0x2000, 0x832: 0x2000, 0x833: 0x2000, 0x834: 0x2000, 0x835: 0x2000, - 0x836: 0x2000, 0x837: 0x2000, 0x838: 0x2000, 0x839: 0x2000, 0x83a: 0x2000, 0x83b: 0x2000, - 0x83c: 0x2000, 0x83d: 0x2000, 0x83e: 0x2000, 0x83f: 0x2000, - // Block 0x21, offset 0x840 - 0x840: 0x2000, 0x841: 0x2000, 0x842: 0x2000, 0x843: 0x2000, 0x844: 0x2000, 0x845: 0x2000, - 0x846: 0x2000, 0x847: 0x2000, 0x848: 0x2000, 0x849: 0x2000, 0x84a: 0x2000, 0x84b: 0x2000, - 0x850: 0x2000, 0x851: 0x2000, - 0x852: 0x2000, 0x853: 0x2000, 0x854: 0x2000, 0x855: 0x2000, 0x856: 0x2000, 0x857: 0x2000, - 0x858: 0x2000, 0x859: 0x2000, 0x85a: 0x2000, 0x85b: 0x2000, 0x85c: 0x2000, 0x85d: 0x2000, - 0x85e: 0x2000, 0x85f: 0x2000, 0x860: 0x2000, 0x861: 0x2000, 0x862: 0x2000, 0x863: 0x2000, - 0x864: 0x2000, 0x865: 0x2000, 0x866: 0x2000, 0x867: 0x2000, 0x868: 0x2000, 0x869: 0x2000, - 0x86a: 0x2000, 0x86b: 0x2000, 0x86c: 0x2000, 0x86d: 0x2000, 0x86e: 0x2000, 0x86f: 0x2000, - 0x870: 0x2000, 0x871: 0x2000, 0x872: 0x2000, 0x873: 0x2000, - // Block 0x22, offset 0x880 - 0x880: 0x2000, 0x881: 0x2000, 0x882: 0x2000, 0x883: 0x2000, 0x884: 0x2000, 0x885: 0x2000, - 0x886: 0x2000, 0x887: 0x2000, 0x888: 0x2000, 0x889: 0x2000, 0x88a: 0x2000, 0x88b: 0x2000, - 0x88c: 0x2000, 0x88d: 0x2000, 0x88e: 0x2000, 0x88f: 0x2000, - 0x892: 0x2000, 0x893: 0x2000, 0x894: 0x2000, 0x895: 0x2000, - 0x8a0: 0x200e, 0x8a1: 0x2000, 0x8a3: 0x2000, - 0x8a4: 0x2000, 0x8a5: 0x2000, 0x8a6: 0x2000, 0x8a7: 0x2000, 0x8a8: 0x2000, 0x8a9: 0x2000, - 0x8b2: 0x2000, 0x8b3: 0x2000, - 0x8b6: 0x2000, 0x8b7: 0x2000, - 0x8bc: 0x2000, 0x8bd: 0x2000, - // Block 0x23, offset 0x8c0 - 0x8c0: 0x2000, 0x8c1: 0x2000, - 0x8c6: 0x2000, 0x8c7: 0x2000, 0x8c8: 0x2000, 0x8cb: 0x200f, - 0x8ce: 0x2000, 0x8cf: 0x2000, 0x8d0: 0x2000, 0x8d1: 0x2000, - 0x8e2: 0x2000, 0x8e3: 0x2000, - 0x8e4: 0x2000, 0x8e5: 0x2000, - 0x8ef: 0x2000, - 0x8fd: 0x4000, 0x8fe: 0x4000, - // Block 0x24, offset 0x900 - 0x905: 0x2000, - 0x906: 0x2000, 0x909: 0x2000, - 0x90e: 0x2000, 0x90f: 0x2000, - 0x914: 0x4000, 0x915: 0x4000, - 0x91c: 0x2000, - 0x91e: 0x2000, - // Block 0x25, offset 0x940 - 0x940: 0x2000, 0x942: 0x2000, - 0x948: 0x4000, 0x949: 0x4000, 0x94a: 0x4000, 0x94b: 0x4000, - 0x94c: 0x4000, 0x94d: 0x4000, 0x94e: 0x4000, 0x94f: 0x4000, 0x950: 0x4000, 0x951: 0x4000, - 0x952: 0x4000, 0x953: 0x4000, - 0x960: 0x2000, 0x961: 0x2000, 0x963: 0x2000, - 0x964: 0x2000, 0x965: 0x2000, 0x967: 0x2000, 0x968: 0x2000, 0x969: 0x2000, - 0x96a: 0x2000, 0x96c: 0x2000, 0x96d: 0x2000, 0x96f: 0x2000, - 0x97f: 0x4000, - // Block 0x26, offset 0x980 - 0x993: 0x4000, - 0x99e: 0x2000, 0x99f: 0x2000, 0x9a1: 0x4000, - 0x9aa: 0x4000, 0x9ab: 0x4000, - 0x9bd: 0x4000, 0x9be: 0x4000, 0x9bf: 0x2000, - // Block 0x27, offset 0x9c0 - 0x9c4: 0x4000, 0x9c5: 0x4000, - 0x9c6: 0x2000, 0x9c7: 0x2000, 0x9c8: 0x2000, 0x9c9: 0x2000, 0x9ca: 0x2000, 0x9cb: 0x2000, - 0x9cc: 0x2000, 0x9cd: 0x2000, 0x9ce: 0x4000, 0x9cf: 0x2000, 0x9d0: 0x2000, 0x9d1: 0x2000, - 0x9d2: 0x2000, 0x9d3: 0x2000, 0x9d4: 0x4000, 0x9d5: 0x2000, 0x9d6: 0x2000, 0x9d7: 0x2000, - 0x9d8: 0x2000, 0x9d9: 0x2000, 0x9da: 0x2000, 0x9db: 0x2000, 0x9dc: 0x2000, 0x9dd: 0x2000, - 0x9de: 0x2000, 0x9df: 0x2000, 0x9e0: 0x2000, 0x9e1: 0x2000, 0x9e3: 0x2000, - 0x9e8: 0x2000, 0x9e9: 0x2000, - 0x9ea: 0x4000, 0x9eb: 0x2000, 0x9ec: 0x2000, 0x9ed: 0x2000, 0x9ee: 0x2000, 0x9ef: 0x2000, - 0x9f0: 0x2000, 0x9f1: 0x2000, 0x9f2: 0x4000, 0x9f3: 0x4000, 0x9f4: 0x2000, 0x9f5: 0x4000, - 0x9f6: 0x2000, 0x9f7: 0x2000, 0x9f8: 0x2000, 0x9f9: 0x2000, 0x9fa: 0x4000, 0x9fb: 0x2000, - 0x9fc: 0x2000, 0x9fd: 0x4000, 0x9fe: 0x2000, 0x9ff: 0x2000, - // Block 0x28, offset 0xa00 - 0xa05: 0x4000, - 0xa0a: 0x4000, 0xa0b: 0x4000, - 0xa28: 0x4000, - 0xa3d: 0x2000, - // Block 0x29, offset 0xa40 - 0xa4c: 0x4000, 0xa4e: 0x4000, - 0xa53: 0x4000, 0xa54: 0x4000, 0xa55: 0x4000, 0xa57: 0x4000, - 0xa76: 0x2000, 0xa77: 0x2000, 0xa78: 0x2000, 0xa79: 0x2000, 0xa7a: 0x2000, 0xa7b: 0x2000, - 0xa7c: 0x2000, 0xa7d: 0x2000, 0xa7e: 0x2000, 0xa7f: 0x2000, - // Block 0x2a, offset 0xa80 - 0xa95: 0x4000, 0xa96: 0x4000, 0xa97: 0x4000, - 0xab0: 0x4000, - 0xabf: 0x4000, - // Block 0x2b, offset 0xac0 - 0xae6: 0x6000, 0xae7: 0x6000, 0xae8: 0x6000, 0xae9: 0x6000, - 0xaea: 0x6000, 0xaeb: 0x6000, 0xaec: 0x6000, 0xaed: 0x6000, - // Block 0x2c, offset 0xb00 - 0xb05: 0x6010, - 0xb06: 0x6011, - // Block 0x2d, offset 0xb40 - 0xb5b: 0x4000, 0xb5c: 0x4000, - // Block 0x2e, offset 0xb80 - 0xb90: 0x4000, - 0xb95: 0x4000, 0xb96: 0x2000, 0xb97: 0x2000, - 0xb98: 0x2000, 0xb99: 0x2000, - // Block 0x2f, offset 0xbc0 - 0xbc0: 0x4000, 0xbc1: 0x4000, 0xbc2: 0x4000, 0xbc3: 0x4000, 0xbc4: 0x4000, 0xbc5: 0x4000, - 0xbc6: 0x4000, 0xbc7: 0x4000, 0xbc8: 0x4000, 0xbc9: 0x4000, 0xbca: 0x4000, 0xbcb: 0x4000, - 0xbcc: 0x4000, 0xbcd: 0x4000, 0xbce: 0x4000, 0xbcf: 0x4000, 0xbd0: 0x4000, 0xbd1: 0x4000, - 0xbd2: 0x4000, 0xbd3: 0x4000, 0xbd4: 0x4000, 0xbd5: 0x4000, 0xbd6: 0x4000, 0xbd7: 0x4000, - 0xbd8: 0x4000, 0xbd9: 0x4000, 0xbdb: 0x4000, 0xbdc: 0x4000, 0xbdd: 0x4000, - 0xbde: 0x4000, 0xbdf: 0x4000, 0xbe0: 0x4000, 0xbe1: 0x4000, 0xbe2: 0x4000, 0xbe3: 0x4000, - 0xbe4: 0x4000, 0xbe5: 0x4000, 0xbe6: 0x4000, 0xbe7: 0x4000, 0xbe8: 0x4000, 0xbe9: 0x4000, - 0xbea: 0x4000, 0xbeb: 0x4000, 0xbec: 0x4000, 0xbed: 0x4000, 0xbee: 0x4000, 0xbef: 0x4000, - 0xbf0: 0x4000, 0xbf1: 0x4000, 0xbf2: 0x4000, 0xbf3: 0x4000, 0xbf4: 0x4000, 0xbf5: 0x4000, - 0xbf6: 0x4000, 0xbf7: 0x4000, 0xbf8: 0x4000, 0xbf9: 0x4000, 0xbfa: 0x4000, 0xbfb: 0x4000, - 0xbfc: 0x4000, 0xbfd: 0x4000, 0xbfe: 0x4000, 0xbff: 0x4000, - // Block 0x30, offset 0xc00 - 0xc00: 0x4000, 0xc01: 0x4000, 0xc02: 0x4000, 0xc03: 0x4000, 0xc04: 0x4000, 0xc05: 0x4000, - 0xc06: 0x4000, 0xc07: 0x4000, 0xc08: 0x4000, 0xc09: 0x4000, 0xc0a: 0x4000, 0xc0b: 0x4000, - 0xc0c: 0x4000, 0xc0d: 0x4000, 0xc0e: 0x4000, 0xc0f: 0x4000, 0xc10: 0x4000, 0xc11: 0x4000, - 0xc12: 0x4000, 0xc13: 0x4000, 0xc14: 0x4000, 0xc15: 0x4000, 0xc16: 0x4000, 0xc17: 0x4000, - 0xc18: 0x4000, 0xc19: 0x4000, 0xc1a: 0x4000, 0xc1b: 0x4000, 0xc1c: 0x4000, 0xc1d: 0x4000, - 0xc1e: 0x4000, 0xc1f: 0x4000, 0xc20: 0x4000, 0xc21: 0x4000, 0xc22: 0x4000, 0xc23: 0x4000, - 0xc24: 0x4000, 0xc25: 0x4000, 0xc26: 0x4000, 0xc27: 0x4000, 0xc28: 0x4000, 0xc29: 0x4000, - 0xc2a: 0x4000, 0xc2b: 0x4000, 0xc2c: 0x4000, 0xc2d: 0x4000, 0xc2e: 0x4000, 0xc2f: 0x4000, - 0xc30: 0x4000, 0xc31: 0x4000, 0xc32: 0x4000, 0xc33: 0x4000, - // Block 0x31, offset 0xc40 - 0xc40: 0x4000, 0xc41: 0x4000, 0xc42: 0x4000, 0xc43: 0x4000, 0xc44: 0x4000, 0xc45: 0x4000, - 0xc46: 0x4000, 0xc47: 0x4000, 0xc48: 0x4000, 0xc49: 0x4000, 0xc4a: 0x4000, 0xc4b: 0x4000, - 0xc4c: 0x4000, 0xc4d: 0x4000, 0xc4e: 0x4000, 0xc4f: 0x4000, 0xc50: 0x4000, 0xc51: 0x4000, - 0xc52: 0x4000, 0xc53: 0x4000, 0xc54: 0x4000, 0xc55: 0x4000, - 0xc70: 0x4000, 0xc71: 0x4000, 0xc72: 0x4000, 0xc73: 0x4000, 0xc74: 0x4000, 0xc75: 0x4000, - 0xc76: 0x4000, 0xc77: 0x4000, 0xc78: 0x4000, 0xc79: 0x4000, 0xc7a: 0x4000, 0xc7b: 0x4000, - // Block 0x32, offset 0xc80 - 0xc80: 0x9012, 0xc81: 0x4013, 0xc82: 0x4014, 0xc83: 0x4000, 0xc84: 0x4000, 0xc85: 0x4000, - 0xc86: 0x4000, 0xc87: 0x4000, 0xc88: 0x4000, 0xc89: 0x4000, 0xc8a: 0x4000, 0xc8b: 0x4000, - 0xc8c: 0x4015, 0xc8d: 0x4015, 0xc8e: 0x4000, 0xc8f: 0x4000, 0xc90: 0x4000, 0xc91: 0x4000, - 0xc92: 0x4000, 0xc93: 0x4000, 0xc94: 0x4000, 0xc95: 0x4000, 0xc96: 0x4000, 0xc97: 0x4000, - 0xc98: 0x4000, 0xc99: 0x4000, 0xc9a: 0x4000, 0xc9b: 0x4000, 0xc9c: 0x4000, 0xc9d: 0x4000, - 0xc9e: 0x4000, 0xc9f: 0x4000, 0xca0: 0x4000, 0xca1: 0x4000, 0xca2: 0x4000, 0xca3: 0x4000, - 0xca4: 0x4000, 0xca5: 0x4000, 0xca6: 0x4000, 0xca7: 0x4000, 0xca8: 0x4000, 0xca9: 0x4000, - 0xcaa: 0x4000, 0xcab: 0x4000, 0xcac: 0x4000, 0xcad: 0x4000, 0xcae: 0x4000, 0xcaf: 0x4000, - 0xcb0: 0x4000, 0xcb1: 0x4000, 0xcb2: 0x4000, 0xcb3: 0x4000, 0xcb4: 0x4000, 0xcb5: 0x4000, - 0xcb6: 0x4000, 0xcb7: 0x4000, 0xcb8: 0x4000, 0xcb9: 0x4000, 0xcba: 0x4000, 0xcbb: 0x4000, - 0xcbc: 0x4000, 0xcbd: 0x4000, 0xcbe: 0x4000, - // Block 0x33, offset 0xcc0 - 0xcc1: 0x4000, 0xcc2: 0x4000, 0xcc3: 0x4000, 0xcc4: 0x4000, 0xcc5: 0x4000, - 0xcc6: 0x4000, 0xcc7: 0x4000, 0xcc8: 0x4000, 0xcc9: 0x4000, 0xcca: 0x4000, 0xccb: 0x4000, - 0xccc: 0x4000, 0xccd: 0x4000, 0xcce: 0x4000, 0xccf: 0x4000, 0xcd0: 0x4000, 0xcd1: 0x4000, - 0xcd2: 0x4000, 0xcd3: 0x4000, 0xcd4: 0x4000, 0xcd5: 0x4000, 0xcd6: 0x4000, 0xcd7: 0x4000, - 0xcd8: 0x4000, 0xcd9: 0x4000, 0xcda: 0x4000, 0xcdb: 0x4000, 0xcdc: 0x4000, 0xcdd: 0x4000, - 0xcde: 0x4000, 0xcdf: 0x4000, 0xce0: 0x4000, 0xce1: 0x4000, 0xce2: 0x4000, 0xce3: 0x4000, - 0xce4: 0x4000, 0xce5: 0x4000, 0xce6: 0x4000, 0xce7: 0x4000, 0xce8: 0x4000, 0xce9: 0x4000, - 0xcea: 0x4000, 0xceb: 0x4000, 0xcec: 0x4000, 0xced: 0x4000, 0xcee: 0x4000, 0xcef: 0x4000, - 0xcf0: 0x4000, 0xcf1: 0x4000, 0xcf2: 0x4000, 0xcf3: 0x4000, 0xcf4: 0x4000, 0xcf5: 0x4000, - 0xcf6: 0x4000, 0xcf7: 0x4000, 0xcf8: 0x4000, 0xcf9: 0x4000, 0xcfa: 0x4000, 0xcfb: 0x4000, - 0xcfc: 0x4000, 0xcfd: 0x4000, 0xcfe: 0x4000, 0xcff: 0x4000, - // Block 0x34, offset 0xd00 - 0xd00: 0x4000, 0xd01: 0x4000, 0xd02: 0x4000, 0xd03: 0x4000, 0xd04: 0x4000, 0xd05: 0x4000, - 0xd06: 0x4000, 0xd07: 0x4000, 0xd08: 0x4000, 0xd09: 0x4000, 0xd0a: 0x4000, 0xd0b: 0x4000, - 0xd0c: 0x4000, 0xd0d: 0x4000, 0xd0e: 0x4000, 0xd0f: 0x4000, 0xd10: 0x4000, 0xd11: 0x4000, - 0xd12: 0x4000, 0xd13: 0x4000, 0xd14: 0x4000, 0xd15: 0x4000, 0xd16: 0x4000, - 0xd19: 0x4016, 0xd1a: 0x4017, 0xd1b: 0x4000, 0xd1c: 0x4000, 0xd1d: 0x4000, - 0xd1e: 0x4000, 0xd1f: 0x4000, 0xd20: 0x4000, 0xd21: 0x4018, 0xd22: 0x4019, 0xd23: 0x401a, - 0xd24: 0x401b, 0xd25: 0x401c, 0xd26: 0x401d, 0xd27: 0x401e, 0xd28: 0x401f, 0xd29: 0x4020, - 0xd2a: 0x4021, 0xd2b: 0x4022, 0xd2c: 0x4000, 0xd2d: 0x4010, 0xd2e: 0x4000, 0xd2f: 0x4023, - 0xd30: 0x4000, 0xd31: 0x4024, 0xd32: 0x4000, 0xd33: 0x4025, 0xd34: 0x4000, 0xd35: 0x4026, - 0xd36: 0x4000, 0xd37: 0x401a, 0xd38: 0x4000, 0xd39: 0x4027, 0xd3a: 0x4000, 0xd3b: 0x4028, - 0xd3c: 0x4000, 0xd3d: 0x4020, 0xd3e: 0x4000, 0xd3f: 0x4029, - // Block 0x35, offset 0xd40 - 0xd40: 0x4000, 0xd41: 0x402a, 0xd42: 0x4000, 0xd43: 0x402b, 0xd44: 0x402c, 0xd45: 0x4000, - 0xd46: 0x4017, 0xd47: 0x4000, 0xd48: 0x402d, 0xd49: 0x4000, 0xd4a: 0x402e, 0xd4b: 0x402f, - 0xd4c: 0x4030, 0xd4d: 0x4017, 0xd4e: 0x4016, 0xd4f: 0x4017, 0xd50: 0x4000, 0xd51: 0x4000, - 0xd52: 0x4031, 0xd53: 0x4000, 0xd54: 0x4000, 0xd55: 0x4031, 0xd56: 0x4000, 0xd57: 0x4000, - 0xd58: 0x4032, 0xd59: 0x4000, 0xd5a: 0x4000, 0xd5b: 0x4032, 0xd5c: 0x4000, 0xd5d: 0x4000, - 0xd5e: 0x4033, 0xd5f: 0x402e, 0xd60: 0x4034, 0xd61: 0x4035, 0xd62: 0x4034, 0xd63: 0x4036, - 0xd64: 0x4037, 0xd65: 0x4024, 0xd66: 0x4035, 0xd67: 0x4025, 0xd68: 0x4038, 0xd69: 0x4038, - 0xd6a: 0x4039, 0xd6b: 0x4039, 0xd6c: 0x403a, 0xd6d: 0x403a, 0xd6e: 0x4000, 0xd6f: 0x4035, - 0xd70: 0x4000, 0xd71: 0x4000, 0xd72: 0x403b, 0xd73: 0x403c, 0xd74: 0x4000, 0xd75: 0x4000, - 0xd76: 0x4000, 0xd77: 0x4000, 0xd78: 0x4000, 0xd79: 0x4000, 0xd7a: 0x4000, 0xd7b: 0x403d, - 0xd7c: 0x401c, 0xd7d: 0x4000, 0xd7e: 0x4000, 0xd7f: 0x4000, - // Block 0x36, offset 0xd80 - 0xd85: 0x4000, - 0xd86: 0x4000, 0xd87: 0x4000, 0xd88: 0x4000, 0xd89: 0x4000, 0xd8a: 0x4000, 0xd8b: 0x4000, - 0xd8c: 0x4000, 0xd8d: 0x4000, 0xd8e: 0x4000, 0xd8f: 0x4000, 0xd90: 0x4000, 0xd91: 0x4000, - 0xd92: 0x4000, 0xd93: 0x4000, 0xd94: 0x4000, 0xd95: 0x4000, 0xd96: 0x4000, 0xd97: 0x4000, - 0xd98: 0x4000, 0xd99: 0x4000, 0xd9a: 0x4000, 0xd9b: 0x4000, 0xd9c: 0x4000, 0xd9d: 0x4000, - 0xd9e: 0x4000, 0xd9f: 0x4000, 0xda0: 0x4000, 0xda1: 0x4000, 0xda2: 0x4000, 0xda3: 0x4000, - 0xda4: 0x4000, 0xda5: 0x4000, 0xda6: 0x4000, 0xda7: 0x4000, 0xda8: 0x4000, 0xda9: 0x4000, - 0xdaa: 0x4000, 0xdab: 0x4000, 0xdac: 0x4000, 0xdad: 0x4000, 0xdae: 0x4000, - 0xdb1: 0x403e, 0xdb2: 0x403e, 0xdb3: 0x403e, 0xdb4: 0x403e, 0xdb5: 0x403e, - 0xdb6: 0x403e, 0xdb7: 0x403e, 0xdb8: 0x403e, 0xdb9: 0x403e, 0xdba: 0x403e, 0xdbb: 0x403e, - 0xdbc: 0x403e, 0xdbd: 0x403e, 0xdbe: 0x403e, 0xdbf: 0x403e, - // Block 0x37, offset 0xdc0 - 0xdc0: 0x4037, 0xdc1: 0x4037, 0xdc2: 0x4037, 0xdc3: 0x4037, 0xdc4: 0x4037, 0xdc5: 0x4037, - 0xdc6: 0x4037, 0xdc7: 0x4037, 0xdc8: 0x4037, 0xdc9: 0x4037, 0xdca: 0x4037, 0xdcb: 0x4037, - 0xdcc: 0x4037, 0xdcd: 0x4037, 0xdce: 0x4037, 0xdcf: 0x400e, 0xdd0: 0x403f, 0xdd1: 0x4040, - 0xdd2: 0x4041, 0xdd3: 0x4040, 0xdd4: 0x403f, 0xdd5: 0x4042, 0xdd6: 0x4043, 0xdd7: 0x4044, - 0xdd8: 0x4040, 0xdd9: 0x4041, 0xdda: 0x4040, 0xddb: 0x4045, 0xddc: 0x4009, 0xddd: 0x4045, - 0xdde: 0x4046, 0xddf: 0x4045, 0xde0: 0x4047, 0xde1: 0x400b, 0xde2: 0x400a, 0xde3: 0x400c, - 0xde4: 0x4048, 0xde5: 0x4000, 0xde6: 0x4000, 0xde7: 0x4000, 0xde8: 0x4000, 0xde9: 0x4000, - 0xdea: 0x4000, 0xdeb: 0x4000, 0xdec: 0x4000, 0xded: 0x4000, 0xdee: 0x4000, 0xdef: 0x4000, - 0xdf0: 0x4000, 0xdf1: 0x4000, 0xdf2: 0x4000, 0xdf3: 0x4000, 0xdf4: 0x4000, 0xdf5: 0x4000, - 0xdf6: 0x4000, 0xdf7: 0x4000, 0xdf8: 0x4000, 0xdf9: 0x4000, 0xdfa: 0x4000, 0xdfb: 0x4000, - 0xdfc: 0x4000, 0xdfd: 0x4000, 0xdfe: 0x4000, 0xdff: 0x4000, - // Block 0x38, offset 0xe00 - 0xe00: 0x4000, 0xe01: 0x4000, 0xe02: 0x4000, 0xe03: 0x4000, 0xe04: 0x4000, 0xe05: 0x4000, - 0xe06: 0x4000, 0xe07: 0x4000, 0xe08: 0x4000, 0xe09: 0x4000, 0xe0a: 0x4000, 0xe0b: 0x4000, - 0xe0c: 0x4000, 0xe0d: 0x4000, 0xe0e: 0x4000, 0xe10: 0x4000, 0xe11: 0x4000, - 0xe12: 0x4000, 0xe13: 0x4000, 0xe14: 0x4000, 0xe15: 0x4000, 0xe16: 0x4000, 0xe17: 0x4000, - 0xe18: 0x4000, 0xe19: 0x4000, 0xe1a: 0x4000, 0xe1b: 0x4000, 0xe1c: 0x4000, 0xe1d: 0x4000, - 0xe1e: 0x4000, 0xe1f: 0x4000, 0xe20: 0x4000, 0xe21: 0x4000, 0xe22: 0x4000, 0xe23: 0x4000, - 0xe24: 0x4000, 0xe25: 0x4000, 0xe26: 0x4000, 0xe27: 0x4000, 0xe28: 0x4000, 0xe29: 0x4000, - 0xe2a: 0x4000, 0xe2b: 0x4000, 0xe2c: 0x4000, 0xe2d: 0x4000, 0xe2e: 0x4000, 0xe2f: 0x4000, - 0xe30: 0x4000, 0xe31: 0x4000, 0xe32: 0x4000, 0xe33: 0x4000, 0xe34: 0x4000, 0xe35: 0x4000, - 0xe36: 0x4000, 0xe37: 0x4000, 0xe38: 0x4000, 0xe39: 0x4000, 0xe3a: 0x4000, - // Block 0x39, offset 0xe40 - 0xe40: 0x4000, 0xe41: 0x4000, 0xe42: 0x4000, 0xe43: 0x4000, 0xe44: 0x4000, 0xe45: 0x4000, - 0xe46: 0x4000, 0xe47: 0x4000, 0xe48: 0x4000, 0xe49: 0x4000, 0xe4a: 0x4000, 0xe4b: 0x4000, - 0xe4c: 0x4000, 0xe4d: 0x4000, 0xe4e: 0x4000, 0xe4f: 0x4000, 0xe50: 0x4000, 0xe51: 0x4000, - 0xe52: 0x4000, 0xe53: 0x4000, 0xe54: 0x4000, 0xe55: 0x4000, 0xe56: 0x4000, 0xe57: 0x4000, - 0xe58: 0x4000, 0xe59: 0x4000, 0xe5a: 0x4000, 0xe5b: 0x4000, 0xe5c: 0x4000, 0xe5d: 0x4000, - 0xe5e: 0x4000, 0xe5f: 0x4000, 0xe60: 0x4000, 0xe61: 0x4000, 0xe62: 0x4000, 0xe63: 0x4000, - 0xe70: 0x4000, 0xe71: 0x4000, 0xe72: 0x4000, 0xe73: 0x4000, 0xe74: 0x4000, 0xe75: 0x4000, - 0xe76: 0x4000, 0xe77: 0x4000, 0xe78: 0x4000, 0xe79: 0x4000, 0xe7a: 0x4000, 0xe7b: 0x4000, - 0xe7c: 0x4000, 0xe7d: 0x4000, 0xe7e: 0x4000, 0xe7f: 0x4000, - // Block 0x3a, offset 0xe80 - 0xe80: 0x4000, 0xe81: 0x4000, 0xe82: 0x4000, 0xe83: 0x4000, 0xe84: 0x4000, 0xe85: 0x4000, - 0xe86: 0x4000, 0xe87: 0x4000, 0xe88: 0x4000, 0xe89: 0x4000, 0xe8a: 0x4000, 0xe8b: 0x4000, - 0xe8c: 0x4000, 0xe8d: 0x4000, 0xe8e: 0x4000, 0xe8f: 0x4000, 0xe90: 0x4000, 0xe91: 0x4000, - 0xe92: 0x4000, 0xe93: 0x4000, 0xe94: 0x4000, 0xe95: 0x4000, 0xe96: 0x4000, 0xe97: 0x4000, - 0xe98: 0x4000, 0xe99: 0x4000, 0xe9a: 0x4000, 0xe9b: 0x4000, 0xe9c: 0x4000, 0xe9d: 0x4000, - 0xe9e: 0x4000, 0xea0: 0x4000, 0xea1: 0x4000, 0xea2: 0x4000, 0xea3: 0x4000, - 0xea4: 0x4000, 0xea5: 0x4000, 0xea6: 0x4000, 0xea7: 0x4000, 0xea8: 0x4000, 0xea9: 0x4000, - 0xeaa: 0x4000, 0xeab: 0x4000, 0xeac: 0x4000, 0xead: 0x4000, 0xeae: 0x4000, 0xeaf: 0x4000, - 0xeb0: 0x4000, 0xeb1: 0x4000, 0xeb2: 0x4000, 0xeb3: 0x4000, 0xeb4: 0x4000, 0xeb5: 0x4000, - 0xeb6: 0x4000, 0xeb7: 0x4000, 0xeb8: 0x4000, 0xeb9: 0x4000, 0xeba: 0x4000, 0xebb: 0x4000, - 0xebc: 0x4000, 0xebd: 0x4000, 0xebe: 0x4000, 0xebf: 0x4000, - // Block 0x3b, offset 0xec0 - 0xec0: 0x4000, 0xec1: 0x4000, 0xec2: 0x4000, 0xec3: 0x4000, 0xec4: 0x4000, 0xec5: 0x4000, - 0xec6: 0x4000, 0xec7: 0x4000, 0xec8: 0x2000, 0xec9: 0x2000, 0xeca: 0x2000, 0xecb: 0x2000, - 0xecc: 0x2000, 0xecd: 0x2000, 0xece: 0x2000, 0xecf: 0x2000, 0xed0: 0x4000, 0xed1: 0x4000, - 0xed2: 0x4000, 0xed3: 0x4000, 0xed4: 0x4000, 0xed5: 0x4000, 0xed6: 0x4000, 0xed7: 0x4000, - 0xed8: 0x4000, 0xed9: 0x4000, 0xeda: 0x4000, 0xedb: 0x4000, 0xedc: 0x4000, 0xedd: 0x4000, - 0xede: 0x4000, 0xedf: 0x4000, 0xee0: 0x4000, 0xee1: 0x4000, 0xee2: 0x4000, 0xee3: 0x4000, - 0xee4: 0x4000, 0xee5: 0x4000, 0xee6: 0x4000, 0xee7: 0x4000, 0xee8: 0x4000, 0xee9: 0x4000, - 0xeea: 0x4000, 0xeeb: 0x4000, 0xeec: 0x4000, 0xeed: 0x4000, 0xeee: 0x4000, 0xeef: 0x4000, - 0xef0: 0x4000, 0xef1: 0x4000, 0xef2: 0x4000, 0xef3: 0x4000, 0xef4: 0x4000, 0xef5: 0x4000, - 0xef6: 0x4000, 0xef7: 0x4000, 0xef8: 0x4000, 0xef9: 0x4000, 0xefa: 0x4000, 0xefb: 0x4000, - 0xefc: 0x4000, 0xefd: 0x4000, 0xefe: 0x4000, 0xeff: 0x4000, - // Block 0x3c, offset 0xf00 - 0xf00: 0x4000, 0xf01: 0x4000, 0xf02: 0x4000, 0xf03: 0x4000, 0xf04: 0x4000, 0xf05: 0x4000, - 0xf06: 0x4000, 0xf07: 0x4000, 0xf08: 0x4000, 0xf09: 0x4000, 0xf0a: 0x4000, 0xf0b: 0x4000, - 0xf0c: 0x4000, 0xf0d: 0x4000, 0xf0e: 0x4000, 0xf0f: 0x4000, 0xf10: 0x4000, 0xf11: 0x4000, - 0xf12: 0x4000, 0xf13: 0x4000, 0xf14: 0x4000, 0xf15: 0x4000, 0xf16: 0x4000, 0xf17: 0x4000, - 0xf18: 0x4000, 0xf19: 0x4000, 0xf1a: 0x4000, 0xf1b: 0x4000, 0xf1c: 0x4000, 0xf1d: 0x4000, - 0xf1e: 0x4000, 0xf1f: 0x4000, 0xf20: 0x4000, 0xf21: 0x4000, 0xf22: 0x4000, 0xf23: 0x4000, - 0xf24: 0x4000, 0xf25: 0x4000, 0xf26: 0x4000, 0xf27: 0x4000, 0xf28: 0x4000, 0xf29: 0x4000, - 0xf2a: 0x4000, 0xf2b: 0x4000, 0xf2c: 0x4000, 0xf2d: 0x4000, 0xf2e: 0x4000, 0xf2f: 0x4000, - 0xf30: 0x4000, 0xf31: 0x4000, 0xf32: 0x4000, 0xf33: 0x4000, 0xf34: 0x4000, 0xf35: 0x4000, - 0xf36: 0x4000, 0xf37: 0x4000, 0xf38: 0x4000, 0xf39: 0x4000, 0xf3a: 0x4000, 0xf3b: 0x4000, - 0xf3c: 0x4000, 0xf3d: 0x4000, 0xf3e: 0x4000, - // Block 0x3d, offset 0xf40 - 0xf40: 0x4000, 0xf41: 0x4000, 0xf42: 0x4000, 0xf43: 0x4000, 0xf44: 0x4000, 0xf45: 0x4000, - 0xf46: 0x4000, 0xf47: 0x4000, 0xf48: 0x4000, 0xf49: 0x4000, 0xf4a: 0x4000, 0xf4b: 0x4000, - 0xf4c: 0x4000, 0xf50: 0x4000, 0xf51: 0x4000, - 0xf52: 0x4000, 0xf53: 0x4000, 0xf54: 0x4000, 0xf55: 0x4000, 0xf56: 0x4000, 0xf57: 0x4000, - 0xf58: 0x4000, 0xf59: 0x4000, 0xf5a: 0x4000, 0xf5b: 0x4000, 0xf5c: 0x4000, 0xf5d: 0x4000, - 0xf5e: 0x4000, 0xf5f: 0x4000, 0xf60: 0x4000, 0xf61: 0x4000, 0xf62: 0x4000, 0xf63: 0x4000, - 0xf64: 0x4000, 0xf65: 0x4000, 0xf66: 0x4000, 0xf67: 0x4000, 0xf68: 0x4000, 0xf69: 0x4000, - 0xf6a: 0x4000, 0xf6b: 0x4000, 0xf6c: 0x4000, 0xf6d: 0x4000, 0xf6e: 0x4000, 0xf6f: 0x4000, - 0xf70: 0x4000, 0xf71: 0x4000, 0xf72: 0x4000, 0xf73: 0x4000, 0xf74: 0x4000, 0xf75: 0x4000, - 0xf76: 0x4000, 0xf77: 0x4000, 0xf78: 0x4000, 0xf79: 0x4000, 0xf7a: 0x4000, 0xf7b: 0x4000, - 0xf7c: 0x4000, 0xf7d: 0x4000, 0xf7e: 0x4000, 0xf7f: 0x4000, - // Block 0x3e, offset 0xf80 - 0xf80: 0x4000, 0xf81: 0x4000, 0xf82: 0x4000, 0xf83: 0x4000, 0xf84: 0x4000, 0xf85: 0x4000, - 0xf86: 0x4000, - // Block 0x3f, offset 0xfc0 - 0xfe0: 0x4000, 0xfe1: 0x4000, 0xfe2: 0x4000, 0xfe3: 0x4000, - 0xfe4: 0x4000, 0xfe5: 0x4000, 0xfe6: 0x4000, 0xfe7: 0x4000, 0xfe8: 0x4000, 0xfe9: 0x4000, - 0xfea: 0x4000, 0xfeb: 0x4000, 0xfec: 0x4000, 0xfed: 0x4000, 0xfee: 0x4000, 0xfef: 0x4000, - 0xff0: 0x4000, 0xff1: 0x4000, 0xff2: 0x4000, 0xff3: 0x4000, 0xff4: 0x4000, 0xff5: 0x4000, - 0xff6: 0x4000, 0xff7: 0x4000, 0xff8: 0x4000, 0xff9: 0x4000, 0xffa: 0x4000, 0xffb: 0x4000, - 0xffc: 0x4000, - // Block 0x40, offset 0x1000 - 0x1000: 0x4000, 0x1001: 0x4000, 0x1002: 0x4000, 0x1003: 0x4000, 0x1004: 0x4000, 0x1005: 0x4000, - 0x1006: 0x4000, 0x1007: 0x4000, 0x1008: 0x4000, 0x1009: 0x4000, 0x100a: 0x4000, 0x100b: 0x4000, - 0x100c: 0x4000, 0x100d: 0x4000, 0x100e: 0x4000, 0x100f: 0x4000, 0x1010: 0x4000, 0x1011: 0x4000, - 0x1012: 0x4000, 0x1013: 0x4000, 0x1014: 0x4000, 0x1015: 0x4000, 0x1016: 0x4000, 0x1017: 0x4000, - 0x1018: 0x4000, 0x1019: 0x4000, 0x101a: 0x4000, 0x101b: 0x4000, 0x101c: 0x4000, 0x101d: 0x4000, - 0x101e: 0x4000, 0x101f: 0x4000, 0x1020: 0x4000, 0x1021: 0x4000, 0x1022: 0x4000, 0x1023: 0x4000, - // Block 0x41, offset 0x1040 - 0x1040: 0x2000, 0x1041: 0x2000, 0x1042: 0x2000, 0x1043: 0x2000, 0x1044: 0x2000, 0x1045: 0x2000, - 0x1046: 0x2000, 0x1047: 0x2000, 0x1048: 0x2000, 0x1049: 0x2000, 0x104a: 0x2000, 0x104b: 0x2000, - 0x104c: 0x2000, 0x104d: 0x2000, 0x104e: 0x2000, 0x104f: 0x2000, 0x1050: 0x4000, 0x1051: 0x4000, - 0x1052: 0x4000, 0x1053: 0x4000, 0x1054: 0x4000, 0x1055: 0x4000, 0x1056: 0x4000, 0x1057: 0x4000, - 0x1058: 0x4000, 0x1059: 0x4000, - 0x1070: 0x4000, 0x1071: 0x4000, 0x1072: 0x4000, 0x1073: 0x4000, 0x1074: 0x4000, 0x1075: 0x4000, - 0x1076: 0x4000, 0x1077: 0x4000, 0x1078: 0x4000, 0x1079: 0x4000, 0x107a: 0x4000, 0x107b: 0x4000, - 0x107c: 0x4000, 0x107d: 0x4000, 0x107e: 0x4000, 0x107f: 0x4000, - // Block 0x42, offset 0x1080 - 0x1080: 0x4000, 0x1081: 0x4000, 0x1082: 0x4000, 0x1083: 0x4000, 0x1084: 0x4000, 0x1085: 0x4000, - 0x1086: 0x4000, 0x1087: 0x4000, 0x1088: 0x4000, 0x1089: 0x4000, 0x108a: 0x4000, 0x108b: 0x4000, - 0x108c: 0x4000, 0x108d: 0x4000, 0x108e: 0x4000, 0x108f: 0x4000, 0x1090: 0x4000, 0x1091: 0x4000, - 0x1092: 0x4000, 0x1094: 0x4000, 0x1095: 0x4000, 0x1096: 0x4000, 0x1097: 0x4000, - 0x1098: 0x4000, 0x1099: 0x4000, 0x109a: 0x4000, 0x109b: 0x4000, 0x109c: 0x4000, 0x109d: 0x4000, - 0x109e: 0x4000, 0x109f: 0x4000, 0x10a0: 0x4000, 0x10a1: 0x4000, 0x10a2: 0x4000, 0x10a3: 0x4000, - 0x10a4: 0x4000, 0x10a5: 0x4000, 0x10a6: 0x4000, 0x10a8: 0x4000, 0x10a9: 0x4000, - 0x10aa: 0x4000, 0x10ab: 0x4000, - // Block 0x43, offset 0x10c0 - 0x10c1: 0x9012, 0x10c2: 0x9012, 0x10c3: 0x9012, 0x10c4: 0x9012, 0x10c5: 0x9012, - 0x10c6: 0x9012, 0x10c7: 0x9012, 0x10c8: 0x9012, 0x10c9: 0x9012, 0x10ca: 0x9012, 0x10cb: 0x9012, - 0x10cc: 0x9012, 0x10cd: 0x9012, 0x10ce: 0x9012, 0x10cf: 0x9012, 0x10d0: 0x9012, 0x10d1: 0x9012, - 0x10d2: 0x9012, 0x10d3: 0x9012, 0x10d4: 0x9012, 0x10d5: 0x9012, 0x10d6: 0x9012, 0x10d7: 0x9012, - 0x10d8: 0x9012, 0x10d9: 0x9012, 0x10da: 0x9012, 0x10db: 0x9012, 0x10dc: 0x9012, 0x10dd: 0x9012, - 0x10de: 0x9012, 0x10df: 0x9012, 0x10e0: 0x9049, 0x10e1: 0x9049, 0x10e2: 0x9049, 0x10e3: 0x9049, - 0x10e4: 0x9049, 0x10e5: 0x9049, 0x10e6: 0x9049, 0x10e7: 0x9049, 0x10e8: 0x9049, 0x10e9: 0x9049, - 0x10ea: 0x9049, 0x10eb: 0x9049, 0x10ec: 0x9049, 0x10ed: 0x9049, 0x10ee: 0x9049, 0x10ef: 0x9049, - 0x10f0: 0x9049, 0x10f1: 0x9049, 0x10f2: 0x9049, 0x10f3: 0x9049, 0x10f4: 0x9049, 0x10f5: 0x9049, - 0x10f6: 0x9049, 0x10f7: 0x9049, 0x10f8: 0x9049, 0x10f9: 0x9049, 0x10fa: 0x9049, 0x10fb: 0x9049, - 0x10fc: 0x9049, 0x10fd: 0x9049, 0x10fe: 0x9049, 0x10ff: 0x9049, - // Block 0x44, offset 0x1100 - 0x1100: 0x9049, 0x1101: 0x9049, 0x1102: 0x9049, 0x1103: 0x9049, 0x1104: 0x9049, 0x1105: 0x9049, - 0x1106: 0x9049, 0x1107: 0x9049, 0x1108: 0x9049, 0x1109: 0x9049, 0x110a: 0x9049, 0x110b: 0x9049, - 0x110c: 0x9049, 0x110d: 0x9049, 0x110e: 0x9049, 0x110f: 0x9049, 0x1110: 0x9049, 0x1111: 0x9049, - 0x1112: 0x9049, 0x1113: 0x9049, 0x1114: 0x9049, 0x1115: 0x9049, 0x1116: 0x9049, 0x1117: 0x9049, - 0x1118: 0x9049, 0x1119: 0x9049, 0x111a: 0x9049, 0x111b: 0x9049, 0x111c: 0x9049, 0x111d: 0x9049, - 0x111e: 0x9049, 0x111f: 0x904a, 0x1120: 0x904b, 0x1121: 0xb04c, 0x1122: 0xb04d, 0x1123: 0xb04d, - 0x1124: 0xb04e, 0x1125: 0xb04f, 0x1126: 0xb050, 0x1127: 0xb051, 0x1128: 0xb052, 0x1129: 0xb053, - 0x112a: 0xb054, 0x112b: 0xb055, 0x112c: 0xb056, 0x112d: 0xb057, 0x112e: 0xb058, 0x112f: 0xb059, - 0x1130: 0xb05a, 0x1131: 0xb05b, 0x1132: 0xb05c, 0x1133: 0xb05d, 0x1134: 0xb05e, 0x1135: 0xb05f, - 0x1136: 0xb060, 0x1137: 0xb061, 0x1138: 0xb062, 0x1139: 0xb063, 0x113a: 0xb064, 0x113b: 0xb065, - 0x113c: 0xb052, 0x113d: 0xb066, 0x113e: 0xb067, 0x113f: 0xb055, - // Block 0x45, offset 0x1140 - 0x1140: 0xb068, 0x1141: 0xb069, 0x1142: 0xb06a, 0x1143: 0xb06b, 0x1144: 0xb05a, 0x1145: 0xb056, - 0x1146: 0xb06c, 0x1147: 0xb06d, 0x1148: 0xb06b, 0x1149: 0xb06e, 0x114a: 0xb06b, 0x114b: 0xb06f, - 0x114c: 0xb06f, 0x114d: 0xb070, 0x114e: 0xb070, 0x114f: 0xb071, 0x1150: 0xb056, 0x1151: 0xb072, - 0x1152: 0xb073, 0x1153: 0xb072, 0x1154: 0xb074, 0x1155: 0xb073, 0x1156: 0xb075, 0x1157: 0xb075, - 0x1158: 0xb076, 0x1159: 0xb076, 0x115a: 0xb077, 0x115b: 0xb077, 0x115c: 0xb073, 0x115d: 0xb078, - 0x115e: 0xb079, 0x115f: 0xb067, 0x1160: 0xb07a, 0x1161: 0xb07b, 0x1162: 0xb07b, 0x1163: 0xb07b, - 0x1164: 0xb07b, 0x1165: 0xb07b, 0x1166: 0xb07b, 0x1167: 0xb07b, 0x1168: 0xb07b, 0x1169: 0xb07b, - 0x116a: 0xb07b, 0x116b: 0xb07b, 0x116c: 0xb07b, 0x116d: 0xb07b, 0x116e: 0xb07b, 0x116f: 0xb07b, - 0x1170: 0xb07c, 0x1171: 0xb07c, 0x1172: 0xb07c, 0x1173: 0xb07c, 0x1174: 0xb07c, 0x1175: 0xb07c, - 0x1176: 0xb07c, 0x1177: 0xb07c, 0x1178: 0xb07c, 0x1179: 0xb07c, 0x117a: 0xb07c, 0x117b: 0xb07c, - 0x117c: 0xb07c, 0x117d: 0xb07c, 0x117e: 0xb07c, - // Block 0x46, offset 0x1180 - 0x1182: 0xb07d, 0x1183: 0xb07e, 0x1184: 0xb07f, 0x1185: 0xb080, - 0x1186: 0xb07f, 0x1187: 0xb07e, 0x118a: 0xb081, 0x118b: 0xb082, - 0x118c: 0xb083, 0x118d: 0xb07f, 0x118e: 0xb080, 0x118f: 0xb07f, - 0x1192: 0xb084, 0x1193: 0xb085, 0x1194: 0xb084, 0x1195: 0xb086, 0x1196: 0xb084, 0x1197: 0xb087, - 0x119a: 0xb088, 0x119b: 0xb089, 0x119c: 0xb08a, - 0x11a0: 0x908b, 0x11a1: 0x908b, 0x11a2: 0x908c, 0x11a3: 0x908d, - 0x11a4: 0x908b, 0x11a5: 0x908e, 0x11a6: 0x908f, 0x11a8: 0xb090, 0x11a9: 0xb091, - 0x11aa: 0xb092, 0x11ab: 0xb091, 0x11ac: 0xb093, 0x11ad: 0xb094, 0x11ae: 0xb095, - 0x11bd: 0x2000, - // Block 0x47, offset 0x11c0 - 0x11e0: 0x4000, 0x11e1: 0x4000, - // Block 0x48, offset 0x1200 - 0x1200: 0x4000, 0x1201: 0x4000, 0x1202: 0x4000, 0x1203: 0x4000, 0x1204: 0x4000, 0x1205: 0x4000, - 0x1206: 0x4000, 0x1207: 0x4000, 0x1208: 0x4000, 0x1209: 0x4000, 0x120a: 0x4000, 0x120b: 0x4000, - 0x120c: 0x4000, 0x120d: 0x4000, 0x120e: 0x4000, 0x120f: 0x4000, 0x1210: 0x4000, 0x1211: 0x4000, - 0x1212: 0x4000, 0x1213: 0x4000, 0x1214: 0x4000, 0x1215: 0x4000, 0x1216: 0x4000, 0x1217: 0x4000, - 0x1218: 0x4000, 0x1219: 0x4000, 0x121a: 0x4000, 0x121b: 0x4000, 0x121c: 0x4000, 0x121d: 0x4000, - 0x121e: 0x4000, 0x121f: 0x4000, 0x1220: 0x4000, 0x1221: 0x4000, 0x1222: 0x4000, 0x1223: 0x4000, - 0x1224: 0x4000, 0x1225: 0x4000, 0x1226: 0x4000, 0x1227: 0x4000, 0x1228: 0x4000, 0x1229: 0x4000, - 0x122a: 0x4000, 0x122b: 0x4000, 0x122c: 0x4000, - // Block 0x49, offset 0x1240 - 0x1240: 0x4000, 0x1241: 0x4000, 0x1242: 0x4000, 0x1243: 0x4000, 0x1244: 0x4000, 0x1245: 0x4000, - 0x1246: 0x4000, 0x1247: 0x4000, 0x1248: 0x4000, 0x1249: 0x4000, 0x124a: 0x4000, 0x124b: 0x4000, - 0x124c: 0x4000, 0x124d: 0x4000, 0x124e: 0x4000, 0x124f: 0x4000, 0x1250: 0x4000, 0x1251: 0x4000, - 0x1252: 0x4000, 0x1253: 0x4000, 0x1254: 0x4000, 0x1255: 0x4000, 0x1256: 0x4000, 0x1257: 0x4000, - 0x1258: 0x4000, 0x1259: 0x4000, 0x125a: 0x4000, 0x125b: 0x4000, 0x125c: 0x4000, 0x125d: 0x4000, - 0x125e: 0x4000, 0x125f: 0x4000, 0x1260: 0x4000, 0x1261: 0x4000, 0x1262: 0x4000, 0x1263: 0x4000, - 0x1264: 0x4000, 0x1265: 0x4000, 0x1266: 0x4000, 0x1267: 0x4000, 0x1268: 0x4000, 0x1269: 0x4000, - 0x126a: 0x4000, 0x126b: 0x4000, 0x126c: 0x4000, 0x126d: 0x4000, 0x126e: 0x4000, 0x126f: 0x4000, - 0x1270: 0x4000, 0x1271: 0x4000, 0x1272: 0x4000, - // Block 0x4a, offset 0x1280 - 0x1280: 0x4000, 0x1281: 0x4000, 0x1282: 0x4000, 0x1283: 0x4000, 0x1284: 0x4000, 0x1285: 0x4000, - 0x1286: 0x4000, 0x1287: 0x4000, 0x1288: 0x4000, 0x1289: 0x4000, 0x128a: 0x4000, 0x128b: 0x4000, - 0x128c: 0x4000, 0x128d: 0x4000, 0x128e: 0x4000, 0x128f: 0x4000, 0x1290: 0x4000, 0x1291: 0x4000, - 0x1292: 0x4000, 0x1293: 0x4000, 0x1294: 0x4000, 0x1295: 0x4000, 0x1296: 0x4000, 0x1297: 0x4000, - 0x1298: 0x4000, 0x1299: 0x4000, 0x129a: 0x4000, 0x129b: 0x4000, 0x129c: 0x4000, 0x129d: 0x4000, - 0x129e: 0x4000, - // Block 0x4b, offset 0x12c0 - 0x12f0: 0x4000, 0x12f1: 0x4000, 0x12f2: 0x4000, 0x12f3: 0x4000, 0x12f4: 0x4000, 0x12f5: 0x4000, - 0x12f6: 0x4000, 0x12f7: 0x4000, 0x12f8: 0x4000, 0x12f9: 0x4000, 0x12fa: 0x4000, 0x12fb: 0x4000, - 0x12fc: 0x4000, 0x12fd: 0x4000, 0x12fe: 0x4000, 0x12ff: 0x4000, - // Block 0x4c, offset 0x1300 - 0x1300: 0x4000, 0x1301: 0x4000, 0x1302: 0x4000, 0x1303: 0x4000, 0x1304: 0x4000, 0x1305: 0x4000, - 0x1306: 0x4000, 0x1307: 0x4000, 0x1308: 0x4000, 0x1309: 0x4000, 0x130a: 0x4000, 0x130b: 0x4000, - 0x130c: 0x4000, 0x130d: 0x4000, 0x130e: 0x4000, 0x130f: 0x4000, 0x1310: 0x4000, 0x1311: 0x4000, - 0x1312: 0x4000, 0x1313: 0x4000, 0x1314: 0x4000, 0x1315: 0x4000, 0x1316: 0x4000, 0x1317: 0x4000, - 0x1318: 0x4000, 0x1319: 0x4000, 0x131a: 0x4000, 0x131b: 0x4000, 0x131c: 0x4000, 0x131d: 0x4000, - 0x131e: 0x4000, 0x131f: 0x4000, 0x1320: 0x4000, 0x1321: 0x4000, 0x1322: 0x4000, 0x1323: 0x4000, - 0x1324: 0x4000, 0x1325: 0x4000, 0x1326: 0x4000, 0x1327: 0x4000, 0x1328: 0x4000, 0x1329: 0x4000, - 0x132a: 0x4000, 0x132b: 0x4000, 0x132c: 0x4000, 0x132d: 0x4000, 0x132e: 0x4000, 0x132f: 0x4000, - 0x1330: 0x4000, 0x1331: 0x4000, 0x1332: 0x4000, 0x1333: 0x4000, 0x1334: 0x4000, 0x1335: 0x4000, - 0x1336: 0x4000, 0x1337: 0x4000, 0x1338: 0x4000, 0x1339: 0x4000, 0x133a: 0x4000, 0x133b: 0x4000, - // Block 0x4d, offset 0x1340 - 0x1344: 0x4000, - // Block 0x4e, offset 0x1380 - 0x138f: 0x4000, - // Block 0x4f, offset 0x13c0 - 0x13c0: 0x2000, 0x13c1: 0x2000, 0x13c2: 0x2000, 0x13c3: 0x2000, 0x13c4: 0x2000, 0x13c5: 0x2000, - 0x13c6: 0x2000, 0x13c7: 0x2000, 0x13c8: 0x2000, 0x13c9: 0x2000, 0x13ca: 0x2000, - 0x13d0: 0x2000, 0x13d1: 0x2000, - 0x13d2: 0x2000, 0x13d3: 0x2000, 0x13d4: 0x2000, 0x13d5: 0x2000, 0x13d6: 0x2000, 0x13d7: 0x2000, - 0x13d8: 0x2000, 0x13d9: 0x2000, 0x13da: 0x2000, 0x13db: 0x2000, 0x13dc: 0x2000, 0x13dd: 0x2000, - 0x13de: 0x2000, 0x13df: 0x2000, 0x13e0: 0x2000, 0x13e1: 0x2000, 0x13e2: 0x2000, 0x13e3: 0x2000, - 0x13e4: 0x2000, 0x13e5: 0x2000, 0x13e6: 0x2000, 0x13e7: 0x2000, 0x13e8: 0x2000, 0x13e9: 0x2000, - 0x13ea: 0x2000, 0x13eb: 0x2000, 0x13ec: 0x2000, 0x13ed: 0x2000, - 0x13f0: 0x2000, 0x13f1: 0x2000, 0x13f2: 0x2000, 0x13f3: 0x2000, 0x13f4: 0x2000, 0x13f5: 0x2000, - 0x13f6: 0x2000, 0x13f7: 0x2000, 0x13f8: 0x2000, 0x13f9: 0x2000, 0x13fa: 0x2000, 0x13fb: 0x2000, - 0x13fc: 0x2000, 0x13fd: 0x2000, 0x13fe: 0x2000, 0x13ff: 0x2000, - // Block 0x50, offset 0x1400 - 0x1400: 0x2000, 0x1401: 0x2000, 0x1402: 0x2000, 0x1403: 0x2000, 0x1404: 0x2000, 0x1405: 0x2000, - 0x1406: 0x2000, 0x1407: 0x2000, 0x1408: 0x2000, 0x1409: 0x2000, 0x140a: 0x2000, 0x140b: 0x2000, - 0x140c: 0x2000, 0x140d: 0x2000, 0x140e: 0x2000, 0x140f: 0x2000, 0x1410: 0x2000, 0x1411: 0x2000, - 0x1412: 0x2000, 0x1413: 0x2000, 0x1414: 0x2000, 0x1415: 0x2000, 0x1416: 0x2000, 0x1417: 0x2000, - 0x1418: 0x2000, 0x1419: 0x2000, 0x141a: 0x2000, 0x141b: 0x2000, 0x141c: 0x2000, 0x141d: 0x2000, - 0x141e: 0x2000, 0x141f: 0x2000, 0x1420: 0x2000, 0x1421: 0x2000, 0x1422: 0x2000, 0x1423: 0x2000, - 0x1424: 0x2000, 0x1425: 0x2000, 0x1426: 0x2000, 0x1427: 0x2000, 0x1428: 0x2000, 0x1429: 0x2000, - 0x1430: 0x2000, 0x1431: 0x2000, 0x1432: 0x2000, 0x1433: 0x2000, 0x1434: 0x2000, 0x1435: 0x2000, - 0x1436: 0x2000, 0x1437: 0x2000, 0x1438: 0x2000, 0x1439: 0x2000, 0x143a: 0x2000, 0x143b: 0x2000, - 0x143c: 0x2000, 0x143d: 0x2000, 0x143e: 0x2000, 0x143f: 0x2000, - // Block 0x51, offset 0x1440 - 0x1440: 0x2000, 0x1441: 0x2000, 0x1442: 0x2000, 0x1443: 0x2000, 0x1444: 0x2000, 0x1445: 0x2000, - 0x1446: 0x2000, 0x1447: 0x2000, 0x1448: 0x2000, 0x1449: 0x2000, 0x144a: 0x2000, 0x144b: 0x2000, - 0x144c: 0x2000, 0x144d: 0x2000, 0x144e: 0x4000, 0x144f: 0x2000, 0x1450: 0x2000, 0x1451: 0x4000, - 0x1452: 0x4000, 0x1453: 0x4000, 0x1454: 0x4000, 0x1455: 0x4000, 0x1456: 0x4000, 0x1457: 0x4000, - 0x1458: 0x4000, 0x1459: 0x4000, 0x145a: 0x4000, 0x145b: 0x2000, 0x145c: 0x2000, 0x145d: 0x2000, - 0x145e: 0x2000, 0x145f: 0x2000, 0x1460: 0x2000, 0x1461: 0x2000, 0x1462: 0x2000, 0x1463: 0x2000, - 0x1464: 0x2000, 0x1465: 0x2000, 0x1466: 0x2000, 0x1467: 0x2000, 0x1468: 0x2000, 0x1469: 0x2000, - 0x146a: 0x2000, 0x146b: 0x2000, 0x146c: 0x2000, - // Block 0x52, offset 0x1480 - 0x1480: 0x4000, 0x1481: 0x4000, 0x1482: 0x4000, - 0x1490: 0x4000, 0x1491: 0x4000, - 0x1492: 0x4000, 0x1493: 0x4000, 0x1494: 0x4000, 0x1495: 0x4000, 0x1496: 0x4000, 0x1497: 0x4000, - 0x1498: 0x4000, 0x1499: 0x4000, 0x149a: 0x4000, 0x149b: 0x4000, 0x149c: 0x4000, 0x149d: 0x4000, - 0x149e: 0x4000, 0x149f: 0x4000, 0x14a0: 0x4000, 0x14a1: 0x4000, 0x14a2: 0x4000, 0x14a3: 0x4000, - 0x14a4: 0x4000, 0x14a5: 0x4000, 0x14a6: 0x4000, 0x14a7: 0x4000, 0x14a8: 0x4000, 0x14a9: 0x4000, - 0x14aa: 0x4000, 0x14ab: 0x4000, 0x14ac: 0x4000, 0x14ad: 0x4000, 0x14ae: 0x4000, 0x14af: 0x4000, - 0x14b0: 0x4000, 0x14b1: 0x4000, 0x14b2: 0x4000, 0x14b3: 0x4000, 0x14b4: 0x4000, 0x14b5: 0x4000, - 0x14b6: 0x4000, 0x14b7: 0x4000, 0x14b8: 0x4000, 0x14b9: 0x4000, 0x14ba: 0x4000, 0x14bb: 0x4000, - // Block 0x53, offset 0x14c0 - 0x14c0: 0x4000, 0x14c1: 0x4000, 0x14c2: 0x4000, 0x14c3: 0x4000, 0x14c4: 0x4000, 0x14c5: 0x4000, - 0x14c6: 0x4000, 0x14c7: 0x4000, 0x14c8: 0x4000, - 0x14d0: 0x4000, 0x14d1: 0x4000, - 0x14e0: 0x4000, 0x14e1: 0x4000, 0x14e2: 0x4000, 0x14e3: 0x4000, - 0x14e4: 0x4000, 0x14e5: 0x4000, - // Block 0x54, offset 0x1500 - 0x1500: 0x4000, 0x1501: 0x4000, 0x1502: 0x4000, 0x1503: 0x4000, 0x1504: 0x4000, 0x1505: 0x4000, - 0x1506: 0x4000, 0x1507: 0x4000, 0x1508: 0x4000, 0x1509: 0x4000, 0x150a: 0x4000, 0x150b: 0x4000, - 0x150c: 0x4000, 0x150d: 0x4000, 0x150e: 0x4000, 0x150f: 0x4000, 0x1510: 0x4000, 0x1511: 0x4000, - 0x1512: 0x4000, 0x1513: 0x4000, 0x1514: 0x4000, 0x1515: 0x4000, 0x1516: 0x4000, 0x1517: 0x4000, - 0x1518: 0x4000, 0x1519: 0x4000, 0x151a: 0x4000, 0x151b: 0x4000, 0x151c: 0x4000, 0x151d: 0x4000, - 0x151e: 0x4000, 0x151f: 0x4000, 0x1520: 0x4000, - 0x152d: 0x4000, 0x152e: 0x4000, 0x152f: 0x4000, - 0x1530: 0x4000, 0x1531: 0x4000, 0x1532: 0x4000, 0x1533: 0x4000, 0x1534: 0x4000, 0x1535: 0x4000, - 0x1537: 0x4000, 0x1538: 0x4000, 0x1539: 0x4000, 0x153a: 0x4000, 0x153b: 0x4000, - 0x153c: 0x4000, 0x153d: 0x4000, 0x153e: 0x4000, 0x153f: 0x4000, - // Block 0x55, offset 0x1540 - 0x1540: 0x4000, 0x1541: 0x4000, 0x1542: 0x4000, 0x1543: 0x4000, 0x1544: 0x4000, 0x1545: 0x4000, - 0x1546: 0x4000, 0x1547: 0x4000, 0x1548: 0x4000, 0x1549: 0x4000, 0x154a: 0x4000, 0x154b: 0x4000, - 0x154c: 0x4000, 0x154d: 0x4000, 0x154e: 0x4000, 0x154f: 0x4000, 0x1550: 0x4000, 0x1551: 0x4000, - 0x1552: 0x4000, 0x1553: 0x4000, 0x1554: 0x4000, 0x1555: 0x4000, 0x1556: 0x4000, 0x1557: 0x4000, - 0x1558: 0x4000, 0x1559: 0x4000, 0x155a: 0x4000, 0x155b: 0x4000, 0x155c: 0x4000, 0x155d: 0x4000, - 0x155e: 0x4000, 0x155f: 0x4000, 0x1560: 0x4000, 0x1561: 0x4000, 0x1562: 0x4000, 0x1563: 0x4000, - 0x1564: 0x4000, 0x1565: 0x4000, 0x1566: 0x4000, 0x1567: 0x4000, 0x1568: 0x4000, 0x1569: 0x4000, - 0x156a: 0x4000, 0x156b: 0x4000, 0x156c: 0x4000, 0x156d: 0x4000, 0x156e: 0x4000, 0x156f: 0x4000, - 0x1570: 0x4000, 0x1571: 0x4000, 0x1572: 0x4000, 0x1573: 0x4000, 0x1574: 0x4000, 0x1575: 0x4000, - 0x1576: 0x4000, 0x1577: 0x4000, 0x1578: 0x4000, 0x1579: 0x4000, 0x157a: 0x4000, 0x157b: 0x4000, - 0x157c: 0x4000, 0x157e: 0x4000, 0x157f: 0x4000, - // Block 0x56, offset 0x1580 - 0x1580: 0x4000, 0x1581: 0x4000, 0x1582: 0x4000, 0x1583: 0x4000, 0x1584: 0x4000, 0x1585: 0x4000, - 0x1586: 0x4000, 0x1587: 0x4000, 0x1588: 0x4000, 0x1589: 0x4000, 0x158a: 0x4000, 0x158b: 0x4000, - 0x158c: 0x4000, 0x158d: 0x4000, 0x158e: 0x4000, 0x158f: 0x4000, 0x1590: 0x4000, 0x1591: 0x4000, - 0x1592: 0x4000, 0x1593: 0x4000, - 0x15a0: 0x4000, 0x15a1: 0x4000, 0x15a2: 0x4000, 0x15a3: 0x4000, - 0x15a4: 0x4000, 0x15a5: 0x4000, 0x15a6: 0x4000, 0x15a7: 0x4000, 0x15a8: 0x4000, 0x15a9: 0x4000, - 0x15aa: 0x4000, 0x15ab: 0x4000, 0x15ac: 0x4000, 0x15ad: 0x4000, 0x15ae: 0x4000, 0x15af: 0x4000, - 0x15b0: 0x4000, 0x15b1: 0x4000, 0x15b2: 0x4000, 0x15b3: 0x4000, 0x15b4: 0x4000, 0x15b5: 0x4000, - 0x15b6: 0x4000, 0x15b7: 0x4000, 0x15b8: 0x4000, 0x15b9: 0x4000, 0x15ba: 0x4000, 0x15bb: 0x4000, - 0x15bc: 0x4000, 0x15bd: 0x4000, 0x15be: 0x4000, 0x15bf: 0x4000, - // Block 0x57, offset 0x15c0 - 0x15c0: 0x4000, 0x15c1: 0x4000, 0x15c2: 0x4000, 0x15c3: 0x4000, 0x15c4: 0x4000, 0x15c5: 0x4000, - 0x15c6: 0x4000, 0x15c7: 0x4000, 0x15c8: 0x4000, 0x15c9: 0x4000, 0x15ca: 0x4000, - 0x15cf: 0x4000, 0x15d0: 0x4000, 0x15d1: 0x4000, - 0x15d2: 0x4000, 0x15d3: 0x4000, - 0x15e0: 0x4000, 0x15e1: 0x4000, 0x15e2: 0x4000, 0x15e3: 0x4000, - 0x15e4: 0x4000, 0x15e5: 0x4000, 0x15e6: 0x4000, 0x15e7: 0x4000, 0x15e8: 0x4000, 0x15e9: 0x4000, - 0x15ea: 0x4000, 0x15eb: 0x4000, 0x15ec: 0x4000, 0x15ed: 0x4000, 0x15ee: 0x4000, 0x15ef: 0x4000, - 0x15f0: 0x4000, 0x15f4: 0x4000, - 0x15f8: 0x4000, 0x15f9: 0x4000, 0x15fa: 0x4000, 0x15fb: 0x4000, - 0x15fc: 0x4000, 0x15fd: 0x4000, 0x15fe: 0x4000, 0x15ff: 0x4000, - // Block 0x58, offset 0x1600 - 0x1600: 0x4000, 0x1602: 0x4000, 0x1603: 0x4000, 0x1604: 0x4000, 0x1605: 0x4000, - 0x1606: 0x4000, 0x1607: 0x4000, 0x1608: 0x4000, 0x1609: 0x4000, 0x160a: 0x4000, 0x160b: 0x4000, - 0x160c: 0x4000, 0x160d: 0x4000, 0x160e: 0x4000, 0x160f: 0x4000, 0x1610: 0x4000, 0x1611: 0x4000, - 0x1612: 0x4000, 0x1613: 0x4000, 0x1614: 0x4000, 0x1615: 0x4000, 0x1616: 0x4000, 0x1617: 0x4000, - 0x1618: 0x4000, 0x1619: 0x4000, 0x161a: 0x4000, 0x161b: 0x4000, 0x161c: 0x4000, 0x161d: 0x4000, - 0x161e: 0x4000, 0x161f: 0x4000, 0x1620: 0x4000, 0x1621: 0x4000, 0x1622: 0x4000, 0x1623: 0x4000, - 0x1624: 0x4000, 0x1625: 0x4000, 0x1626: 0x4000, 0x1627: 0x4000, 0x1628: 0x4000, 0x1629: 0x4000, - 0x162a: 0x4000, 0x162b: 0x4000, 0x162c: 0x4000, 0x162d: 0x4000, 0x162e: 0x4000, 0x162f: 0x4000, - 0x1630: 0x4000, 0x1631: 0x4000, 0x1632: 0x4000, 0x1633: 0x4000, 0x1634: 0x4000, 0x1635: 0x4000, - 0x1636: 0x4000, 0x1637: 0x4000, 0x1638: 0x4000, 0x1639: 0x4000, 0x163a: 0x4000, 0x163b: 0x4000, - 0x163c: 0x4000, 0x163d: 0x4000, 0x163e: 0x4000, 0x163f: 0x4000, - // Block 0x59, offset 0x1640 - 0x1640: 0x4000, 0x1641: 0x4000, 0x1642: 0x4000, 0x1643: 0x4000, 0x1644: 0x4000, 0x1645: 0x4000, - 0x1646: 0x4000, 0x1647: 0x4000, 0x1648: 0x4000, 0x1649: 0x4000, 0x164a: 0x4000, 0x164b: 0x4000, - 0x164c: 0x4000, 0x164d: 0x4000, 0x164e: 0x4000, 0x164f: 0x4000, 0x1650: 0x4000, 0x1651: 0x4000, - 0x1652: 0x4000, 0x1653: 0x4000, 0x1654: 0x4000, 0x1655: 0x4000, 0x1656: 0x4000, 0x1657: 0x4000, - 0x1658: 0x4000, 0x1659: 0x4000, 0x165a: 0x4000, 0x165b: 0x4000, 0x165c: 0x4000, 0x165d: 0x4000, - 0x165e: 0x4000, 0x165f: 0x4000, 0x1660: 0x4000, 0x1661: 0x4000, 0x1662: 0x4000, 0x1663: 0x4000, - 0x1664: 0x4000, 0x1665: 0x4000, 0x1666: 0x4000, 0x1667: 0x4000, 0x1668: 0x4000, 0x1669: 0x4000, - 0x166a: 0x4000, 0x166b: 0x4000, 0x166c: 0x4000, 0x166d: 0x4000, 0x166e: 0x4000, 0x166f: 0x4000, - 0x1670: 0x4000, 0x1671: 0x4000, 0x1672: 0x4000, 0x1673: 0x4000, 0x1674: 0x4000, 0x1675: 0x4000, - 0x1676: 0x4000, 0x1677: 0x4000, 0x1678: 0x4000, 0x1679: 0x4000, 0x167a: 0x4000, 0x167b: 0x4000, - 0x167c: 0x4000, 0x167f: 0x4000, - // Block 0x5a, offset 0x1680 - 0x1680: 0x4000, 0x1681: 0x4000, 0x1682: 0x4000, 0x1683: 0x4000, 0x1684: 0x4000, 0x1685: 0x4000, - 0x1686: 0x4000, 0x1687: 0x4000, 0x1688: 0x4000, 0x1689: 0x4000, 0x168a: 0x4000, 0x168b: 0x4000, - 0x168c: 0x4000, 0x168d: 0x4000, 0x168e: 0x4000, 0x168f: 0x4000, 0x1690: 0x4000, 0x1691: 0x4000, - 0x1692: 0x4000, 0x1693: 0x4000, 0x1694: 0x4000, 0x1695: 0x4000, 0x1696: 0x4000, 0x1697: 0x4000, - 0x1698: 0x4000, 0x1699: 0x4000, 0x169a: 0x4000, 0x169b: 0x4000, 0x169c: 0x4000, 0x169d: 0x4000, - 0x169e: 0x4000, 0x169f: 0x4000, 0x16a0: 0x4000, 0x16a1: 0x4000, 0x16a2: 0x4000, 0x16a3: 0x4000, - 0x16a4: 0x4000, 0x16a5: 0x4000, 0x16a6: 0x4000, 0x16a7: 0x4000, 0x16a8: 0x4000, 0x16a9: 0x4000, - 0x16aa: 0x4000, 0x16ab: 0x4000, 0x16ac: 0x4000, 0x16ad: 0x4000, 0x16ae: 0x4000, 0x16af: 0x4000, - 0x16b0: 0x4000, 0x16b1: 0x4000, 0x16b2: 0x4000, 0x16b3: 0x4000, 0x16b4: 0x4000, 0x16b5: 0x4000, - 0x16b6: 0x4000, 0x16b7: 0x4000, 0x16b8: 0x4000, 0x16b9: 0x4000, 0x16ba: 0x4000, 0x16bb: 0x4000, - 0x16bc: 0x4000, 0x16bd: 0x4000, - // Block 0x5b, offset 0x16c0 - 0x16cb: 0x4000, - 0x16cc: 0x4000, 0x16cd: 0x4000, 0x16ce: 0x4000, 0x16d0: 0x4000, 0x16d1: 0x4000, - 0x16d2: 0x4000, 0x16d3: 0x4000, 0x16d4: 0x4000, 0x16d5: 0x4000, 0x16d6: 0x4000, 0x16d7: 0x4000, - 0x16d8: 0x4000, 0x16d9: 0x4000, 0x16da: 0x4000, 0x16db: 0x4000, 0x16dc: 0x4000, 0x16dd: 0x4000, - 0x16de: 0x4000, 0x16df: 0x4000, 0x16e0: 0x4000, 0x16e1: 0x4000, 0x16e2: 0x4000, 0x16e3: 0x4000, - 0x16e4: 0x4000, 0x16e5: 0x4000, 0x16e6: 0x4000, 0x16e7: 0x4000, - 0x16fa: 0x4000, - // Block 0x5c, offset 0x1700 - 0x1715: 0x4000, 0x1716: 0x4000, - 0x1724: 0x4000, - // Block 0x5d, offset 0x1740 - 0x177b: 0x4000, - 0x177c: 0x4000, 0x177d: 0x4000, 0x177e: 0x4000, 0x177f: 0x4000, - // Block 0x5e, offset 0x1780 - 0x1780: 0x4000, 0x1781: 0x4000, 0x1782: 0x4000, 0x1783: 0x4000, 0x1784: 0x4000, 0x1785: 0x4000, - 0x1786: 0x4000, 0x1787: 0x4000, 0x1788: 0x4000, 0x1789: 0x4000, 0x178a: 0x4000, 0x178b: 0x4000, - 0x178c: 0x4000, 0x178d: 0x4000, 0x178e: 0x4000, 0x178f: 0x4000, - // Block 0x5f, offset 0x17c0 - 0x17c0: 0x4000, 0x17c1: 0x4000, 0x17c2: 0x4000, 0x17c3: 0x4000, 0x17c4: 0x4000, 0x17c5: 0x4000, - 0x17cc: 0x4000, 0x17d0: 0x4000, 0x17d1: 0x4000, - 0x17d2: 0x4000, - 0x17eb: 0x4000, 0x17ec: 0x4000, - 0x17f4: 0x4000, 0x17f5: 0x4000, - 0x17f6: 0x4000, 0x17f7: 0x4000, 0x17f8: 0x4000, - // Block 0x60, offset 0x1800 - 0x1810: 0x4000, 0x1811: 0x4000, - 0x1812: 0x4000, 0x1813: 0x4000, 0x1814: 0x4000, 0x1815: 0x4000, 0x1816: 0x4000, 0x1817: 0x4000, - 0x1818: 0x4000, 0x1819: 0x4000, 0x181a: 0x4000, 0x181b: 0x4000, 0x181c: 0x4000, 0x181d: 0x4000, - 0x181e: 0x4000, 0x181f: 0x4000, 0x1820: 0x4000, 0x1821: 0x4000, 0x1822: 0x4000, 0x1823: 0x4000, - 0x1824: 0x4000, 0x1825: 0x4000, 0x1826: 0x4000, 0x1827: 0x4000, 0x1828: 0x4000, 0x1829: 0x4000, - 0x182a: 0x4000, 0x182b: 0x4000, 0x182c: 0x4000, 0x182d: 0x4000, 0x182e: 0x4000, 0x182f: 0x4000, - 0x1830: 0x4000, 0x1831: 0x4000, 0x1832: 0x4000, 0x1833: 0x4000, 0x1834: 0x4000, 0x1835: 0x4000, - 0x1836: 0x4000, 0x1837: 0x4000, 0x1838: 0x4000, 0x1839: 0x4000, 0x183a: 0x4000, 0x183b: 0x4000, - 0x183c: 0x4000, 0x183d: 0x4000, 0x183e: 0x4000, - // Block 0x61, offset 0x1840 - 0x1840: 0x4000, 0x1841: 0x4000, 0x1842: 0x4000, 0x1843: 0x4000, 0x1844: 0x4000, 0x1845: 0x4000, - 0x1846: 0x4000, 0x1847: 0x4000, 0x1848: 0x4000, 0x1849: 0x4000, 0x184a: 0x4000, 0x184b: 0x4000, - 0x184c: 0x4000, 0x1850: 0x4000, 0x1851: 0x4000, - 0x1852: 0x4000, 0x1853: 0x4000, 0x1854: 0x4000, 0x1855: 0x4000, 0x1856: 0x4000, 0x1857: 0x4000, - 0x1858: 0x4000, 0x1859: 0x4000, 0x185a: 0x4000, 0x185b: 0x4000, 0x185c: 0x4000, 0x185d: 0x4000, - 0x185e: 0x4000, 0x185f: 0x4000, 0x1860: 0x4000, 0x1861: 0x4000, 0x1862: 0x4000, 0x1863: 0x4000, - 0x1864: 0x4000, 0x1865: 0x4000, 0x1866: 0x4000, 0x1867: 0x4000, 0x1868: 0x4000, 0x1869: 0x4000, - 0x186a: 0x4000, 0x186b: 0x4000, - // Block 0x62, offset 0x1880 - 0x1880: 0x4000, 0x1881: 0x4000, 0x1882: 0x4000, 0x1883: 0x4000, 0x1884: 0x4000, 0x1885: 0x4000, - 0x1886: 0x4000, 0x1887: 0x4000, 0x1888: 0x4000, 0x1889: 0x4000, 0x188a: 0x4000, 0x188b: 0x4000, - 0x188c: 0x4000, 0x188d: 0x4000, 0x188e: 0x4000, 0x188f: 0x4000, 0x1890: 0x4000, 0x1891: 0x4000, - 0x1892: 0x4000, 0x1893: 0x4000, 0x1894: 0x4000, 0x1895: 0x4000, 0x1896: 0x4000, 0x1897: 0x4000, - // Block 0x63, offset 0x18c0 - 0x18c0: 0x4000, - 0x18d0: 0x4000, 0x18d1: 0x4000, - 0x18d2: 0x4000, 0x18d3: 0x4000, 0x18d4: 0x4000, 0x18d5: 0x4000, 0x18d6: 0x4000, 0x18d7: 0x4000, - 0x18d8: 0x4000, 0x18d9: 0x4000, 0x18da: 0x4000, 0x18db: 0x4000, 0x18dc: 0x4000, 0x18dd: 0x4000, - 0x18de: 0x4000, 0x18df: 0x4000, 0x18e0: 0x4000, 0x18e1: 0x4000, 0x18e2: 0x4000, 0x18e3: 0x4000, - 0x18e4: 0x4000, 0x18e5: 0x4000, 0x18e6: 0x4000, - // Block 0x64, offset 0x1900 - 0x1900: 0x2000, 0x1901: 0x2000, 0x1902: 0x2000, 0x1903: 0x2000, 0x1904: 0x2000, 0x1905: 0x2000, - 0x1906: 0x2000, 0x1907: 0x2000, 0x1908: 0x2000, 0x1909: 0x2000, 0x190a: 0x2000, 0x190b: 0x2000, - 0x190c: 0x2000, 0x190d: 0x2000, 0x190e: 0x2000, 0x190f: 0x2000, 0x1910: 0x2000, 0x1911: 0x2000, - 0x1912: 0x2000, 0x1913: 0x2000, 0x1914: 0x2000, 0x1915: 0x2000, 0x1916: 0x2000, 0x1917: 0x2000, - 0x1918: 0x2000, 0x1919: 0x2000, 0x191a: 0x2000, 0x191b: 0x2000, 0x191c: 0x2000, 0x191d: 0x2000, - 0x191e: 0x2000, 0x191f: 0x2000, 0x1920: 0x2000, 0x1921: 0x2000, 0x1922: 0x2000, 0x1923: 0x2000, - 0x1924: 0x2000, 0x1925: 0x2000, 0x1926: 0x2000, 0x1927: 0x2000, 0x1928: 0x2000, 0x1929: 0x2000, - 0x192a: 0x2000, 0x192b: 0x2000, 0x192c: 0x2000, 0x192d: 0x2000, 0x192e: 0x2000, 0x192f: 0x2000, - 0x1930: 0x2000, 0x1931: 0x2000, 0x1932: 0x2000, 0x1933: 0x2000, 0x1934: 0x2000, 0x1935: 0x2000, - 0x1936: 0x2000, 0x1937: 0x2000, 0x1938: 0x2000, 0x1939: 0x2000, 0x193a: 0x2000, 0x193b: 0x2000, - 0x193c: 0x2000, 0x193d: 0x2000, -} - -// widthIndex: 22 blocks, 1408 entries, 1408 bytes -// Block 0 is the zero block. -var widthIndex = [1408]uint8{ - // Block 0x0, offset 0x0 - // Block 0x1, offset 0x40 - // Block 0x2, offset 0x80 - // Block 0x3, offset 0xc0 - 0xc2: 0x01, 0xc3: 0x02, 0xc4: 0x03, 0xc5: 0x04, 0xc7: 0x05, - 0xc9: 0x06, 0xcb: 0x07, 0xcc: 0x08, 0xcd: 0x09, 0xce: 0x0a, 0xcf: 0x0b, - 0xd0: 0x0c, 0xd1: 0x0d, - 0xe1: 0x02, 0xe2: 0x03, 0xe3: 0x04, 0xe4: 0x05, 0xe5: 0x06, 0xe6: 0x06, 0xe7: 0x06, - 0xe8: 0x06, 0xe9: 0x06, 0xea: 0x07, 0xeb: 0x06, 0xec: 0x06, 0xed: 0x08, 0xee: 0x09, 0xef: 0x0a, - 0xf0: 0x0f, 0xf3: 0x12, 0xf4: 0x13, - // Block 0x4, offset 0x100 - 0x104: 0x0e, 0x105: 0x0f, - // Block 0x5, offset 0x140 - 0x140: 0x10, 0x141: 0x11, 0x142: 0x12, 0x144: 0x13, 0x145: 0x14, 0x146: 0x15, 0x147: 0x16, - 0x148: 0x17, 0x149: 0x18, 0x14a: 0x19, 0x14c: 0x1a, 0x14f: 0x1b, - 0x151: 0x1c, 0x152: 0x08, 0x153: 0x1d, 0x154: 0x1e, 0x155: 0x1f, 0x156: 0x20, 0x157: 0x21, - 0x158: 0x22, 0x159: 0x23, 0x15a: 0x24, 0x15b: 0x25, 0x15c: 0x26, 0x15d: 0x27, 0x15e: 0x28, 0x15f: 0x29, - 0x166: 0x2a, - 0x16c: 0x2b, 0x16d: 0x2c, - 0x17a: 0x2d, 0x17b: 0x2e, 0x17c: 0x0e, 0x17d: 0x0e, 0x17e: 0x0e, 0x17f: 0x2f, - // Block 0x6, offset 0x180 - 0x180: 0x30, 0x181: 0x31, 0x182: 0x32, 0x183: 0x33, 0x184: 0x34, 0x185: 0x35, 0x186: 0x36, 0x187: 0x37, - 0x188: 0x38, 0x189: 0x39, 0x18a: 0x0e, 0x18b: 0x3a, 0x18c: 0x0e, 0x18d: 0x0e, 0x18e: 0x0e, 0x18f: 0x0e, - 0x190: 0x0e, 0x191: 0x0e, 0x192: 0x0e, 0x193: 0x0e, 0x194: 0x0e, 0x195: 0x0e, 0x196: 0x0e, 0x197: 0x0e, - 0x198: 0x0e, 0x199: 0x0e, 0x19a: 0x0e, 0x19b: 0x0e, 0x19c: 0x0e, 0x19d: 0x0e, 0x19e: 0x0e, 0x19f: 0x0e, - 0x1a0: 0x0e, 0x1a1: 0x0e, 0x1a2: 0x0e, 0x1a3: 0x0e, 0x1a4: 0x0e, 0x1a5: 0x0e, 0x1a6: 0x0e, 0x1a7: 0x0e, - 0x1a8: 0x0e, 0x1a9: 0x0e, 0x1aa: 0x0e, 0x1ab: 0x0e, 0x1ac: 0x0e, 0x1ad: 0x0e, 0x1ae: 0x0e, 0x1af: 0x0e, - 0x1b0: 0x0e, 0x1b1: 0x0e, 0x1b2: 0x0e, 0x1b3: 0x0e, 0x1b4: 0x0e, 0x1b5: 0x0e, 0x1b6: 0x0e, 0x1b7: 0x0e, - 0x1b8: 0x0e, 0x1b9: 0x0e, 0x1ba: 0x0e, 0x1bb: 0x0e, 0x1bc: 0x0e, 0x1bd: 0x0e, 0x1be: 0x0e, 0x1bf: 0x0e, - // Block 0x7, offset 0x1c0 - 0x1c0: 0x0e, 0x1c1: 0x0e, 0x1c2: 0x0e, 0x1c3: 0x0e, 0x1c4: 0x0e, 0x1c5: 0x0e, 0x1c6: 0x0e, 0x1c7: 0x0e, - 0x1c8: 0x0e, 0x1c9: 0x0e, 0x1ca: 0x0e, 0x1cb: 0x0e, 0x1cc: 0x0e, 0x1cd: 0x0e, 0x1ce: 0x0e, 0x1cf: 0x0e, - 0x1d0: 0x0e, 0x1d1: 0x0e, 0x1d2: 0x0e, 0x1d3: 0x0e, 0x1d4: 0x0e, 0x1d5: 0x0e, 0x1d6: 0x0e, 0x1d7: 0x0e, - 0x1d8: 0x0e, 0x1d9: 0x0e, 0x1da: 0x0e, 0x1db: 0x0e, 0x1dc: 0x0e, 0x1dd: 0x0e, 0x1de: 0x0e, 0x1df: 0x0e, - 0x1e0: 0x0e, 0x1e1: 0x0e, 0x1e2: 0x0e, 0x1e3: 0x0e, 0x1e4: 0x0e, 0x1e5: 0x0e, 0x1e6: 0x0e, 0x1e7: 0x0e, - 0x1e8: 0x0e, 0x1e9: 0x0e, 0x1ea: 0x0e, 0x1eb: 0x0e, 0x1ec: 0x0e, 0x1ed: 0x0e, 0x1ee: 0x0e, 0x1ef: 0x0e, - 0x1f0: 0x0e, 0x1f1: 0x0e, 0x1f2: 0x0e, 0x1f3: 0x0e, 0x1f4: 0x0e, 0x1f5: 0x0e, 0x1f6: 0x0e, - 0x1f8: 0x0e, 0x1f9: 0x0e, 0x1fa: 0x0e, 0x1fb: 0x0e, 0x1fc: 0x0e, 0x1fd: 0x0e, 0x1fe: 0x0e, 0x1ff: 0x0e, - // Block 0x8, offset 0x200 - 0x200: 0x0e, 0x201: 0x0e, 0x202: 0x0e, 0x203: 0x0e, 0x204: 0x0e, 0x205: 0x0e, 0x206: 0x0e, 0x207: 0x0e, - 0x208: 0x0e, 0x209: 0x0e, 0x20a: 0x0e, 0x20b: 0x0e, 0x20c: 0x0e, 0x20d: 0x0e, 0x20e: 0x0e, 0x20f: 0x0e, - 0x210: 0x0e, 0x211: 0x0e, 0x212: 0x0e, 0x213: 0x0e, 0x214: 0x0e, 0x215: 0x0e, 0x216: 0x0e, 0x217: 0x0e, - 0x218: 0x0e, 0x219: 0x0e, 0x21a: 0x0e, 0x21b: 0x0e, 0x21c: 0x0e, 0x21d: 0x0e, 0x21e: 0x0e, 0x21f: 0x0e, - 0x220: 0x0e, 0x221: 0x0e, 0x222: 0x0e, 0x223: 0x0e, 0x224: 0x0e, 0x225: 0x0e, 0x226: 0x0e, 0x227: 0x0e, - 0x228: 0x0e, 0x229: 0x0e, 0x22a: 0x0e, 0x22b: 0x0e, 0x22c: 0x0e, 0x22d: 0x0e, 0x22e: 0x0e, 0x22f: 0x0e, - 0x230: 0x0e, 0x231: 0x0e, 0x232: 0x0e, 0x233: 0x0e, 0x234: 0x0e, 0x235: 0x0e, 0x236: 0x0e, 0x237: 0x0e, - 0x238: 0x0e, 0x239: 0x0e, 0x23a: 0x0e, 0x23b: 0x0e, 0x23c: 0x0e, 0x23d: 0x0e, 0x23e: 0x0e, 0x23f: 0x0e, - // Block 0x9, offset 0x240 - 0x240: 0x0e, 0x241: 0x0e, 0x242: 0x0e, 0x243: 0x0e, 0x244: 0x0e, 0x245: 0x0e, 0x246: 0x0e, 0x247: 0x0e, - 0x248: 0x0e, 0x249: 0x0e, 0x24a: 0x0e, 0x24b: 0x0e, 0x24c: 0x0e, 0x24d: 0x0e, 0x24e: 0x0e, 0x24f: 0x0e, - 0x250: 0x0e, 0x251: 0x0e, 0x252: 0x3b, 0x253: 0x3c, - 0x265: 0x3d, - 0x270: 0x0e, 0x271: 0x0e, 0x272: 0x0e, 0x273: 0x0e, 0x274: 0x0e, 0x275: 0x0e, 0x276: 0x0e, 0x277: 0x0e, - 0x278: 0x0e, 0x279: 0x0e, 0x27a: 0x0e, 0x27b: 0x0e, 0x27c: 0x0e, 0x27d: 0x0e, 0x27e: 0x0e, 0x27f: 0x0e, - // Block 0xa, offset 0x280 - 0x280: 0x0e, 0x281: 0x0e, 0x282: 0x0e, 0x283: 0x0e, 0x284: 0x0e, 0x285: 0x0e, 0x286: 0x0e, 0x287: 0x0e, - 0x288: 0x0e, 0x289: 0x0e, 0x28a: 0x0e, 0x28b: 0x0e, 0x28c: 0x0e, 0x28d: 0x0e, 0x28e: 0x0e, 0x28f: 0x0e, - 0x290: 0x0e, 0x291: 0x0e, 0x292: 0x0e, 0x293: 0x0e, 0x294: 0x0e, 0x295: 0x0e, 0x296: 0x0e, 0x297: 0x0e, - 0x298: 0x0e, 0x299: 0x0e, 0x29a: 0x0e, 0x29b: 0x0e, 0x29c: 0x0e, 0x29d: 0x0e, 0x29e: 0x3e, - // Block 0xb, offset 0x2c0 - 0x2c0: 0x08, 0x2c1: 0x08, 0x2c2: 0x08, 0x2c3: 0x08, 0x2c4: 0x08, 0x2c5: 0x08, 0x2c6: 0x08, 0x2c7: 0x08, - 0x2c8: 0x08, 0x2c9: 0x08, 0x2ca: 0x08, 0x2cb: 0x08, 0x2cc: 0x08, 0x2cd: 0x08, 0x2ce: 0x08, 0x2cf: 0x08, - 0x2d0: 0x08, 0x2d1: 0x08, 0x2d2: 0x08, 0x2d3: 0x08, 0x2d4: 0x08, 0x2d5: 0x08, 0x2d6: 0x08, 0x2d7: 0x08, - 0x2d8: 0x08, 0x2d9: 0x08, 0x2da: 0x08, 0x2db: 0x08, 0x2dc: 0x08, 0x2dd: 0x08, 0x2de: 0x08, 0x2df: 0x08, - 0x2e0: 0x08, 0x2e1: 0x08, 0x2e2: 0x08, 0x2e3: 0x08, 0x2e4: 0x08, 0x2e5: 0x08, 0x2e6: 0x08, 0x2e7: 0x08, - 0x2e8: 0x08, 0x2e9: 0x08, 0x2ea: 0x08, 0x2eb: 0x08, 0x2ec: 0x08, 0x2ed: 0x08, 0x2ee: 0x08, 0x2ef: 0x08, - 0x2f0: 0x08, 0x2f1: 0x08, 0x2f2: 0x08, 0x2f3: 0x08, 0x2f4: 0x08, 0x2f5: 0x08, 0x2f6: 0x08, 0x2f7: 0x08, - 0x2f8: 0x08, 0x2f9: 0x08, 0x2fa: 0x08, 0x2fb: 0x08, 0x2fc: 0x08, 0x2fd: 0x08, 0x2fe: 0x08, 0x2ff: 0x08, - // Block 0xc, offset 0x300 - 0x300: 0x08, 0x301: 0x08, 0x302: 0x08, 0x303: 0x08, 0x304: 0x08, 0x305: 0x08, 0x306: 0x08, 0x307: 0x08, - 0x308: 0x08, 0x309: 0x08, 0x30a: 0x08, 0x30b: 0x08, 0x30c: 0x08, 0x30d: 0x08, 0x30e: 0x08, 0x30f: 0x08, - 0x310: 0x08, 0x311: 0x08, 0x312: 0x08, 0x313: 0x08, 0x314: 0x08, 0x315: 0x08, 0x316: 0x08, 0x317: 0x08, - 0x318: 0x08, 0x319: 0x08, 0x31a: 0x08, 0x31b: 0x08, 0x31c: 0x08, 0x31d: 0x08, 0x31e: 0x08, 0x31f: 0x08, - 0x320: 0x08, 0x321: 0x08, 0x322: 0x08, 0x323: 0x08, 0x324: 0x0e, 0x325: 0x0e, 0x326: 0x0e, 0x327: 0x0e, - 0x328: 0x0e, 0x329: 0x0e, 0x32a: 0x0e, 0x32b: 0x0e, - 0x338: 0x3f, 0x339: 0x40, 0x33c: 0x41, 0x33d: 0x42, 0x33e: 0x43, 0x33f: 0x44, - // Block 0xd, offset 0x340 - 0x37f: 0x45, - // Block 0xe, offset 0x380 - 0x380: 0x0e, 0x381: 0x0e, 0x382: 0x0e, 0x383: 0x0e, 0x384: 0x0e, 0x385: 0x0e, 0x386: 0x0e, 0x387: 0x0e, - 0x388: 0x0e, 0x389: 0x0e, 0x38a: 0x0e, 0x38b: 0x0e, 0x38c: 0x0e, 0x38d: 0x0e, 0x38e: 0x0e, 0x38f: 0x0e, - 0x390: 0x0e, 0x391: 0x0e, 0x392: 0x0e, 0x393: 0x0e, 0x394: 0x0e, 0x395: 0x0e, 0x396: 0x0e, 0x397: 0x0e, - 0x398: 0x0e, 0x399: 0x0e, 0x39a: 0x0e, 0x39b: 0x0e, 0x39c: 0x0e, 0x39d: 0x0e, 0x39e: 0x0e, 0x39f: 0x46, - 0x3a0: 0x0e, 0x3a1: 0x0e, 0x3a2: 0x0e, 0x3a3: 0x0e, 0x3a4: 0x0e, 0x3a5: 0x0e, 0x3a6: 0x0e, 0x3a7: 0x0e, - 0x3a8: 0x0e, 0x3a9: 0x0e, 0x3aa: 0x0e, 0x3ab: 0x47, - // Block 0xf, offset 0x3c0 - 0x3c0: 0x0e, 0x3c1: 0x0e, 0x3c2: 0x0e, 0x3c3: 0x0e, 0x3c4: 0x48, 0x3c5: 0x49, 0x3c6: 0x0e, 0x3c7: 0x0e, - 0x3c8: 0x0e, 0x3c9: 0x0e, 0x3ca: 0x0e, 0x3cb: 0x4a, - // Block 0x10, offset 0x400 - 0x400: 0x4b, 0x403: 0x4c, 0x404: 0x4d, 0x405: 0x4e, 0x406: 0x4f, - 0x408: 0x50, 0x409: 0x51, 0x40c: 0x52, 0x40d: 0x53, 0x40e: 0x54, 0x40f: 0x55, - 0x410: 0x3a, 0x411: 0x56, 0x412: 0x0e, 0x413: 0x57, 0x414: 0x58, 0x415: 0x59, 0x416: 0x5a, 0x417: 0x5b, - 0x418: 0x0e, 0x419: 0x5c, 0x41a: 0x0e, 0x41b: 0x5d, - 0x424: 0x5e, 0x425: 0x5f, 0x426: 0x60, 0x427: 0x61, - // Block 0x11, offset 0x440 - 0x456: 0x0b, 0x457: 0x06, - 0x458: 0x0c, 0x45b: 0x0d, 0x45f: 0x0e, - 0x460: 0x06, 0x461: 0x06, 0x462: 0x06, 0x463: 0x06, 0x464: 0x06, 0x465: 0x06, 0x466: 0x06, 0x467: 0x06, - 0x468: 0x06, 0x469: 0x06, 0x46a: 0x06, 0x46b: 0x06, 0x46c: 0x06, 0x46d: 0x06, 0x46e: 0x06, 0x46f: 0x06, - 0x470: 0x06, 0x471: 0x06, 0x472: 0x06, 0x473: 0x06, 0x474: 0x06, 0x475: 0x06, 0x476: 0x06, 0x477: 0x06, - 0x478: 0x06, 0x479: 0x06, 0x47a: 0x06, 0x47b: 0x06, 0x47c: 0x06, 0x47d: 0x06, 0x47e: 0x06, 0x47f: 0x06, - // Block 0x12, offset 0x480 - 0x484: 0x08, 0x485: 0x08, 0x486: 0x08, 0x487: 0x09, - // Block 0x13, offset 0x4c0 - 0x4c0: 0x08, 0x4c1: 0x08, 0x4c2: 0x08, 0x4c3: 0x08, 0x4c4: 0x08, 0x4c5: 0x08, 0x4c6: 0x08, 0x4c7: 0x08, - 0x4c8: 0x08, 0x4c9: 0x08, 0x4ca: 0x08, 0x4cb: 0x08, 0x4cc: 0x08, 0x4cd: 0x08, 0x4ce: 0x08, 0x4cf: 0x08, - 0x4d0: 0x08, 0x4d1: 0x08, 0x4d2: 0x08, 0x4d3: 0x08, 0x4d4: 0x08, 0x4d5: 0x08, 0x4d6: 0x08, 0x4d7: 0x08, - 0x4d8: 0x08, 0x4d9: 0x08, 0x4da: 0x08, 0x4db: 0x08, 0x4dc: 0x08, 0x4dd: 0x08, 0x4de: 0x08, 0x4df: 0x08, - 0x4e0: 0x08, 0x4e1: 0x08, 0x4e2: 0x08, 0x4e3: 0x08, 0x4e4: 0x08, 0x4e5: 0x08, 0x4e6: 0x08, 0x4e7: 0x08, - 0x4e8: 0x08, 0x4e9: 0x08, 0x4ea: 0x08, 0x4eb: 0x08, 0x4ec: 0x08, 0x4ed: 0x08, 0x4ee: 0x08, 0x4ef: 0x08, - 0x4f0: 0x08, 0x4f1: 0x08, 0x4f2: 0x08, 0x4f3: 0x08, 0x4f4: 0x08, 0x4f5: 0x08, 0x4f6: 0x08, 0x4f7: 0x08, - 0x4f8: 0x08, 0x4f9: 0x08, 0x4fa: 0x08, 0x4fb: 0x08, 0x4fc: 0x08, 0x4fd: 0x08, 0x4fe: 0x08, 0x4ff: 0x62, - // Block 0x14, offset 0x500 - 0x520: 0x10, - 0x530: 0x09, 0x531: 0x09, 0x532: 0x09, 0x533: 0x09, 0x534: 0x09, 0x535: 0x09, 0x536: 0x09, 0x537: 0x09, - 0x538: 0x09, 0x539: 0x09, 0x53a: 0x09, 0x53b: 0x09, 0x53c: 0x09, 0x53d: 0x09, 0x53e: 0x09, 0x53f: 0x11, - // Block 0x15, offset 0x540 - 0x540: 0x09, 0x541: 0x09, 0x542: 0x09, 0x543: 0x09, 0x544: 0x09, 0x545: 0x09, 0x546: 0x09, 0x547: 0x09, - 0x548: 0x09, 0x549: 0x09, 0x54a: 0x09, 0x54b: 0x09, 0x54c: 0x09, 0x54d: 0x09, 0x54e: 0x09, 0x54f: 0x11, -} - -// inverseData contains 4-byte entries of the following format: -// <0 padding> -// The last byte of the UTF-8-encoded rune is xor-ed with the last byte of the -// UTF-8 encoding of the original rune. Mappings often have the following -// pattern: -// A -> A (U+FF21 -> U+0041) -// B -> B (U+FF22 -> U+0042) -// ... -// By xor-ing the last byte the same entry can be shared by many mappings. This -// reduces the total number of distinct entries by about two thirds. -// The resulting entry for the aforementioned mappings is -// { 0x01, 0xE0, 0x00, 0x00 } -// Using this entry to map U+FF21 (UTF-8 [EF BC A1]), we get -// E0 ^ A1 = 41. -// Similarly, for U+FF22 (UTF-8 [EF BC A2]), we get -// E0 ^ A2 = 42. -// Note that because of the xor-ing, the byte sequence stored in the entry is -// not valid UTF-8. -var inverseData = [150][4]byte{ - {0x00, 0x00, 0x00, 0x00}, - {0x03, 0xe3, 0x80, 0xa0}, - {0x03, 0xef, 0xbc, 0xa0}, - {0x03, 0xef, 0xbc, 0xe0}, - {0x03, 0xef, 0xbd, 0xe0}, - {0x03, 0xef, 0xbf, 0x02}, - {0x03, 0xef, 0xbf, 0x00}, - {0x03, 0xef, 0xbf, 0x0e}, - {0x03, 0xef, 0xbf, 0x0c}, - {0x03, 0xef, 0xbf, 0x0f}, - {0x03, 0xef, 0xbf, 0x39}, - {0x03, 0xef, 0xbf, 0x3b}, - {0x03, 0xef, 0xbf, 0x3f}, - {0x03, 0xef, 0xbf, 0x2a}, - {0x03, 0xef, 0xbf, 0x0d}, - {0x03, 0xef, 0xbf, 0x25}, - {0x03, 0xef, 0xbd, 0x1a}, - {0x03, 0xef, 0xbd, 0x26}, - {0x01, 0xa0, 0x00, 0x00}, - {0x03, 0xef, 0xbd, 0x25}, - {0x03, 0xef, 0xbd, 0x23}, - {0x03, 0xef, 0xbd, 0x2e}, - {0x03, 0xef, 0xbe, 0x07}, - {0x03, 0xef, 0xbe, 0x05}, - {0x03, 0xef, 0xbd, 0x06}, - {0x03, 0xef, 0xbd, 0x13}, - {0x03, 0xef, 0xbd, 0x0b}, - {0x03, 0xef, 0xbd, 0x16}, - {0x03, 0xef, 0xbd, 0x0c}, - {0x03, 0xef, 0xbd, 0x15}, - {0x03, 0xef, 0xbd, 0x0d}, - {0x03, 0xef, 0xbd, 0x1c}, - {0x03, 0xef, 0xbd, 0x02}, - {0x03, 0xef, 0xbd, 0x1f}, - {0x03, 0xef, 0xbd, 0x1d}, - {0x03, 0xef, 0xbd, 0x17}, - {0x03, 0xef, 0xbd, 0x08}, - {0x03, 0xef, 0xbd, 0x09}, - {0x03, 0xef, 0xbd, 0x0e}, - {0x03, 0xef, 0xbd, 0x04}, - {0x03, 0xef, 0xbd, 0x05}, - {0x03, 0xef, 0xbe, 0x3f}, - {0x03, 0xef, 0xbe, 0x00}, - {0x03, 0xef, 0xbd, 0x2c}, - {0x03, 0xef, 0xbe, 0x06}, - {0x03, 0xef, 0xbe, 0x0c}, - {0x03, 0xef, 0xbe, 0x0f}, - {0x03, 0xef, 0xbe, 0x0d}, - {0x03, 0xef, 0xbe, 0x0b}, - {0x03, 0xef, 0xbe, 0x19}, - {0x03, 0xef, 0xbe, 0x15}, - {0x03, 0xef, 0xbe, 0x11}, - {0x03, 0xef, 0xbe, 0x31}, - {0x03, 0xef, 0xbe, 0x33}, - {0x03, 0xef, 0xbd, 0x0f}, - {0x03, 0xef, 0xbe, 0x30}, - {0x03, 0xef, 0xbe, 0x3e}, - {0x03, 0xef, 0xbe, 0x32}, - {0x03, 0xef, 0xbe, 0x36}, - {0x03, 0xef, 0xbd, 0x14}, - {0x03, 0xef, 0xbe, 0x2e}, - {0x03, 0xef, 0xbd, 0x1e}, - {0x03, 0xef, 0xbe, 0x10}, - {0x03, 0xef, 0xbf, 0x13}, - {0x03, 0xef, 0xbf, 0x15}, - {0x03, 0xef, 0xbf, 0x17}, - {0x03, 0xef, 0xbf, 0x1f}, - {0x03, 0xef, 0xbf, 0x1d}, - {0x03, 0xef, 0xbf, 0x1b}, - {0x03, 0xef, 0xbf, 0x09}, - {0x03, 0xef, 0xbf, 0x0b}, - {0x03, 0xef, 0xbf, 0x37}, - {0x03, 0xef, 0xbe, 0x04}, - {0x01, 0xe0, 0x00, 0x00}, - {0x03, 0xe2, 0xa6, 0x1a}, - {0x03, 0xe2, 0xa6, 0x26}, - {0x03, 0xe3, 0x80, 0x23}, - {0x03, 0xe3, 0x80, 0x2e}, - {0x03, 0xe3, 0x80, 0x25}, - {0x03, 0xe3, 0x83, 0x1e}, - {0x03, 0xe3, 0x83, 0x14}, - {0x03, 0xe3, 0x82, 0x06}, - {0x03, 0xe3, 0x82, 0x0b}, - {0x03, 0xe3, 0x82, 0x0c}, - {0x03, 0xe3, 0x82, 0x0d}, - {0x03, 0xe3, 0x82, 0x02}, - {0x03, 0xe3, 0x83, 0x0f}, - {0x03, 0xe3, 0x83, 0x08}, - {0x03, 0xe3, 0x83, 0x09}, - {0x03, 0xe3, 0x83, 0x2c}, - {0x03, 0xe3, 0x83, 0x0c}, - {0x03, 0xe3, 0x82, 0x13}, - {0x03, 0xe3, 0x82, 0x16}, - {0x03, 0xe3, 0x82, 0x15}, - {0x03, 0xe3, 0x82, 0x1c}, - {0x03, 0xe3, 0x82, 0x1f}, - {0x03, 0xe3, 0x82, 0x1d}, - {0x03, 0xe3, 0x82, 0x1a}, - {0x03, 0xe3, 0x82, 0x17}, - {0x03, 0xe3, 0x82, 0x08}, - {0x03, 0xe3, 0x82, 0x09}, - {0x03, 0xe3, 0x82, 0x0e}, - {0x03, 0xe3, 0x82, 0x04}, - {0x03, 0xe3, 0x82, 0x05}, - {0x03, 0xe3, 0x82, 0x3f}, - {0x03, 0xe3, 0x83, 0x00}, - {0x03, 0xe3, 0x83, 0x06}, - {0x03, 0xe3, 0x83, 0x05}, - {0x03, 0xe3, 0x83, 0x0d}, - {0x03, 0xe3, 0x83, 0x0b}, - {0x03, 0xe3, 0x83, 0x07}, - {0x03, 0xe3, 0x83, 0x19}, - {0x03, 0xe3, 0x83, 0x15}, - {0x03, 0xe3, 0x83, 0x11}, - {0x03, 0xe3, 0x83, 0x31}, - {0x03, 0xe3, 0x83, 0x33}, - {0x03, 0xe3, 0x83, 0x30}, - {0x03, 0xe3, 0x83, 0x3e}, - {0x03, 0xe3, 0x83, 0x32}, - {0x03, 0xe3, 0x83, 0x36}, - {0x03, 0xe3, 0x83, 0x2e}, - {0x03, 0xe3, 0x82, 0x07}, - {0x03, 0xe3, 0x85, 0x04}, - {0x03, 0xe3, 0x84, 0x10}, - {0x03, 0xe3, 0x85, 0x30}, - {0x03, 0xe3, 0x85, 0x0d}, - {0x03, 0xe3, 0x85, 0x13}, - {0x03, 0xe3, 0x85, 0x15}, - {0x03, 0xe3, 0x85, 0x17}, - {0x03, 0xe3, 0x85, 0x1f}, - {0x03, 0xe3, 0x85, 0x1d}, - {0x03, 0xe3, 0x85, 0x1b}, - {0x03, 0xe3, 0x85, 0x09}, - {0x03, 0xe3, 0x85, 0x0f}, - {0x03, 0xe3, 0x85, 0x0b}, - {0x03, 0xe3, 0x85, 0x37}, - {0x03, 0xe3, 0x85, 0x3b}, - {0x03, 0xe3, 0x85, 0x39}, - {0x03, 0xe3, 0x85, 0x3f}, - {0x02, 0xc2, 0x02, 0x00}, - {0x02, 0xc2, 0x0e, 0x00}, - {0x02, 0xc2, 0x0c, 0x00}, - {0x02, 0xc2, 0x00, 0x00}, - {0x03, 0xe2, 0x82, 0x0f}, - {0x03, 0xe2, 0x94, 0x2a}, - {0x03, 0xe2, 0x86, 0x39}, - {0x03, 0xe2, 0x86, 0x3b}, - {0x03, 0xe2, 0x86, 0x3f}, - {0x03, 0xe2, 0x96, 0x0d}, - {0x03, 0xe2, 0x97, 0x25}, -} - -// Total table size 14936 bytes (14KiB) diff --git a/vendor/golang.org/x/text/width/tables11.0.0.go b/vendor/golang.org/x/text/width/tables11.0.0.go deleted file mode 100644 index d6def0e..0000000 --- a/vendor/golang.org/x/text/width/tables11.0.0.go +++ /dev/null @@ -1,1330 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -// +build go1.13 - -package width - -// UnicodeVersion is the Unicode version from which the tables in this package are derived. -const UnicodeVersion = "11.0.0" - -// lookup returns the trie value for the first UTF-8 encoding in s and -// the width in bytes of this encoding. The size will be 0 if s does not -// hold enough bytes to complete the encoding. len(s) must be greater than 0. -func (t *widthTrie) lookup(s []byte) (v uint16, sz int) { - c0 := s[0] - switch { - case c0 < 0x80: // is ASCII - return widthValues[c0], 1 - case c0 < 0xC2: - return 0, 1 // Illegal UTF-8: not a starter, not ASCII. - case c0 < 0xE0: // 2-byte UTF-8 - if len(s) < 2 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c1), 2 - case c0 < 0xF0: // 3-byte UTF-8 - if len(s) < 3 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c2), 3 - case c0 < 0xF8: // 4-byte UTF-8 - if len(s) < 4 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - o = uint32(i)<<6 + uint32(c2) - i = widthIndex[o] - c3 := s[3] - if c3 < 0x80 || 0xC0 <= c3 { - return 0, 3 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c3), 4 - } - // Illegal rune - return 0, 1 -} - -// lookupUnsafe returns the trie value for the first UTF-8 encoding in s. -// s must start with a full and valid UTF-8 encoded rune. -func (t *widthTrie) lookupUnsafe(s []byte) uint16 { - c0 := s[0] - if c0 < 0x80 { // is ASCII - return widthValues[c0] - } - i := widthIndex[c0] - if c0 < 0xE0 { // 2-byte UTF-8 - return t.lookupValue(uint32(i), s[1]) - } - i = widthIndex[uint32(i)<<6+uint32(s[1])] - if c0 < 0xF0 { // 3-byte UTF-8 - return t.lookupValue(uint32(i), s[2]) - } - i = widthIndex[uint32(i)<<6+uint32(s[2])] - if c0 < 0xF8 { // 4-byte UTF-8 - return t.lookupValue(uint32(i), s[3]) - } - return 0 -} - -// lookupString returns the trie value for the first UTF-8 encoding in s and -// the width in bytes of this encoding. The size will be 0 if s does not -// hold enough bytes to complete the encoding. len(s) must be greater than 0. -func (t *widthTrie) lookupString(s string) (v uint16, sz int) { - c0 := s[0] - switch { - case c0 < 0x80: // is ASCII - return widthValues[c0], 1 - case c0 < 0xC2: - return 0, 1 // Illegal UTF-8: not a starter, not ASCII. - case c0 < 0xE0: // 2-byte UTF-8 - if len(s) < 2 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c1), 2 - case c0 < 0xF0: // 3-byte UTF-8 - if len(s) < 3 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c2), 3 - case c0 < 0xF8: // 4-byte UTF-8 - if len(s) < 4 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - o = uint32(i)<<6 + uint32(c2) - i = widthIndex[o] - c3 := s[3] - if c3 < 0x80 || 0xC0 <= c3 { - return 0, 3 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c3), 4 - } - // Illegal rune - return 0, 1 -} - -// lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. -// s must start with a full and valid UTF-8 encoded rune. -func (t *widthTrie) lookupStringUnsafe(s string) uint16 { - c0 := s[0] - if c0 < 0x80 { // is ASCII - return widthValues[c0] - } - i := widthIndex[c0] - if c0 < 0xE0 { // 2-byte UTF-8 - return t.lookupValue(uint32(i), s[1]) - } - i = widthIndex[uint32(i)<<6+uint32(s[1])] - if c0 < 0xF0 { // 3-byte UTF-8 - return t.lookupValue(uint32(i), s[2]) - } - i = widthIndex[uint32(i)<<6+uint32(s[2])] - if c0 < 0xF8 { // 4-byte UTF-8 - return t.lookupValue(uint32(i), s[3]) - } - return 0 -} - -// widthTrie. Total size: 14336 bytes (14.00 KiB). Checksum: c0f7712776e71cd4. -type widthTrie struct{} - -func newWidthTrie(i int) *widthTrie { - return &widthTrie{} -} - -// lookupValue determines the type of block n and looks up the value for b. -func (t *widthTrie) lookupValue(n uint32, b byte) uint16 { - switch { - default: - return uint16(widthValues[n<<6+uint32(b)]) - } -} - -// widthValues: 101 blocks, 6464 entries, 12928 bytes -// The third block is the zero block. -var widthValues = [6464]uint16{ - // Block 0x0, offset 0x0 - 0x20: 0x6001, 0x21: 0x6002, 0x22: 0x6002, 0x23: 0x6002, - 0x24: 0x6002, 0x25: 0x6002, 0x26: 0x6002, 0x27: 0x6002, 0x28: 0x6002, 0x29: 0x6002, - 0x2a: 0x6002, 0x2b: 0x6002, 0x2c: 0x6002, 0x2d: 0x6002, 0x2e: 0x6002, 0x2f: 0x6002, - 0x30: 0x6002, 0x31: 0x6002, 0x32: 0x6002, 0x33: 0x6002, 0x34: 0x6002, 0x35: 0x6002, - 0x36: 0x6002, 0x37: 0x6002, 0x38: 0x6002, 0x39: 0x6002, 0x3a: 0x6002, 0x3b: 0x6002, - 0x3c: 0x6002, 0x3d: 0x6002, 0x3e: 0x6002, 0x3f: 0x6002, - // Block 0x1, offset 0x40 - 0x40: 0x6003, 0x41: 0x6003, 0x42: 0x6003, 0x43: 0x6003, 0x44: 0x6003, 0x45: 0x6003, - 0x46: 0x6003, 0x47: 0x6003, 0x48: 0x6003, 0x49: 0x6003, 0x4a: 0x6003, 0x4b: 0x6003, - 0x4c: 0x6003, 0x4d: 0x6003, 0x4e: 0x6003, 0x4f: 0x6003, 0x50: 0x6003, 0x51: 0x6003, - 0x52: 0x6003, 0x53: 0x6003, 0x54: 0x6003, 0x55: 0x6003, 0x56: 0x6003, 0x57: 0x6003, - 0x58: 0x6003, 0x59: 0x6003, 0x5a: 0x6003, 0x5b: 0x6003, 0x5c: 0x6003, 0x5d: 0x6003, - 0x5e: 0x6003, 0x5f: 0x6003, 0x60: 0x6004, 0x61: 0x6004, 0x62: 0x6004, 0x63: 0x6004, - 0x64: 0x6004, 0x65: 0x6004, 0x66: 0x6004, 0x67: 0x6004, 0x68: 0x6004, 0x69: 0x6004, - 0x6a: 0x6004, 0x6b: 0x6004, 0x6c: 0x6004, 0x6d: 0x6004, 0x6e: 0x6004, 0x6f: 0x6004, - 0x70: 0x6004, 0x71: 0x6004, 0x72: 0x6004, 0x73: 0x6004, 0x74: 0x6004, 0x75: 0x6004, - 0x76: 0x6004, 0x77: 0x6004, 0x78: 0x6004, 0x79: 0x6004, 0x7a: 0x6004, 0x7b: 0x6004, - 0x7c: 0x6004, 0x7d: 0x6004, 0x7e: 0x6004, - // Block 0x2, offset 0x80 - // Block 0x3, offset 0xc0 - 0xe1: 0x2000, 0xe2: 0x6005, 0xe3: 0x6005, - 0xe4: 0x2000, 0xe5: 0x6006, 0xe6: 0x6005, 0xe7: 0x2000, 0xe8: 0x2000, - 0xea: 0x2000, 0xec: 0x6007, 0xed: 0x2000, 0xee: 0x2000, 0xef: 0x6008, - 0xf0: 0x2000, 0xf1: 0x2000, 0xf2: 0x2000, 0xf3: 0x2000, 0xf4: 0x2000, - 0xf6: 0x2000, 0xf7: 0x2000, 0xf8: 0x2000, 0xf9: 0x2000, 0xfa: 0x2000, - 0xfc: 0x2000, 0xfd: 0x2000, 0xfe: 0x2000, 0xff: 0x2000, - // Block 0x4, offset 0x100 - 0x106: 0x2000, - 0x110: 0x2000, - 0x117: 0x2000, - 0x118: 0x2000, - 0x11e: 0x2000, 0x11f: 0x2000, 0x120: 0x2000, 0x121: 0x2000, - 0x126: 0x2000, 0x128: 0x2000, 0x129: 0x2000, - 0x12a: 0x2000, 0x12c: 0x2000, 0x12d: 0x2000, - 0x130: 0x2000, 0x132: 0x2000, 0x133: 0x2000, - 0x137: 0x2000, 0x138: 0x2000, 0x139: 0x2000, 0x13a: 0x2000, - 0x13c: 0x2000, 0x13e: 0x2000, - // Block 0x5, offset 0x140 - 0x141: 0x2000, - 0x151: 0x2000, - 0x153: 0x2000, - 0x15b: 0x2000, - 0x166: 0x2000, 0x167: 0x2000, - 0x16b: 0x2000, - 0x171: 0x2000, 0x172: 0x2000, 0x173: 0x2000, - 0x178: 0x2000, - 0x17f: 0x2000, - // Block 0x6, offset 0x180 - 0x180: 0x2000, 0x181: 0x2000, 0x182: 0x2000, 0x184: 0x2000, - 0x188: 0x2000, 0x189: 0x2000, 0x18a: 0x2000, 0x18b: 0x2000, - 0x18d: 0x2000, - 0x192: 0x2000, 0x193: 0x2000, - 0x1a6: 0x2000, 0x1a7: 0x2000, - 0x1ab: 0x2000, - // Block 0x7, offset 0x1c0 - 0x1ce: 0x2000, 0x1d0: 0x2000, - 0x1d2: 0x2000, 0x1d4: 0x2000, 0x1d6: 0x2000, - 0x1d8: 0x2000, 0x1da: 0x2000, 0x1dc: 0x2000, - // Block 0x8, offset 0x200 - 0x211: 0x2000, - 0x221: 0x2000, - // Block 0x9, offset 0x240 - 0x244: 0x2000, - 0x247: 0x2000, 0x249: 0x2000, 0x24a: 0x2000, 0x24b: 0x2000, - 0x24d: 0x2000, 0x250: 0x2000, - 0x258: 0x2000, 0x259: 0x2000, 0x25a: 0x2000, 0x25b: 0x2000, 0x25d: 0x2000, - 0x25f: 0x2000, - // Block 0xa, offset 0x280 - 0x280: 0x2000, 0x281: 0x2000, 0x282: 0x2000, 0x283: 0x2000, 0x284: 0x2000, 0x285: 0x2000, - 0x286: 0x2000, 0x287: 0x2000, 0x288: 0x2000, 0x289: 0x2000, 0x28a: 0x2000, 0x28b: 0x2000, - 0x28c: 0x2000, 0x28d: 0x2000, 0x28e: 0x2000, 0x28f: 0x2000, 0x290: 0x2000, 0x291: 0x2000, - 0x292: 0x2000, 0x293: 0x2000, 0x294: 0x2000, 0x295: 0x2000, 0x296: 0x2000, 0x297: 0x2000, - 0x298: 0x2000, 0x299: 0x2000, 0x29a: 0x2000, 0x29b: 0x2000, 0x29c: 0x2000, 0x29d: 0x2000, - 0x29e: 0x2000, 0x29f: 0x2000, 0x2a0: 0x2000, 0x2a1: 0x2000, 0x2a2: 0x2000, 0x2a3: 0x2000, - 0x2a4: 0x2000, 0x2a5: 0x2000, 0x2a6: 0x2000, 0x2a7: 0x2000, 0x2a8: 0x2000, 0x2a9: 0x2000, - 0x2aa: 0x2000, 0x2ab: 0x2000, 0x2ac: 0x2000, 0x2ad: 0x2000, 0x2ae: 0x2000, 0x2af: 0x2000, - 0x2b0: 0x2000, 0x2b1: 0x2000, 0x2b2: 0x2000, 0x2b3: 0x2000, 0x2b4: 0x2000, 0x2b5: 0x2000, - 0x2b6: 0x2000, 0x2b7: 0x2000, 0x2b8: 0x2000, 0x2b9: 0x2000, 0x2ba: 0x2000, 0x2bb: 0x2000, - 0x2bc: 0x2000, 0x2bd: 0x2000, 0x2be: 0x2000, 0x2bf: 0x2000, - // Block 0xb, offset 0x2c0 - 0x2c0: 0x2000, 0x2c1: 0x2000, 0x2c2: 0x2000, 0x2c3: 0x2000, 0x2c4: 0x2000, 0x2c5: 0x2000, - 0x2c6: 0x2000, 0x2c7: 0x2000, 0x2c8: 0x2000, 0x2c9: 0x2000, 0x2ca: 0x2000, 0x2cb: 0x2000, - 0x2cc: 0x2000, 0x2cd: 0x2000, 0x2ce: 0x2000, 0x2cf: 0x2000, 0x2d0: 0x2000, 0x2d1: 0x2000, - 0x2d2: 0x2000, 0x2d3: 0x2000, 0x2d4: 0x2000, 0x2d5: 0x2000, 0x2d6: 0x2000, 0x2d7: 0x2000, - 0x2d8: 0x2000, 0x2d9: 0x2000, 0x2da: 0x2000, 0x2db: 0x2000, 0x2dc: 0x2000, 0x2dd: 0x2000, - 0x2de: 0x2000, 0x2df: 0x2000, 0x2e0: 0x2000, 0x2e1: 0x2000, 0x2e2: 0x2000, 0x2e3: 0x2000, - 0x2e4: 0x2000, 0x2e5: 0x2000, 0x2e6: 0x2000, 0x2e7: 0x2000, 0x2e8: 0x2000, 0x2e9: 0x2000, - 0x2ea: 0x2000, 0x2eb: 0x2000, 0x2ec: 0x2000, 0x2ed: 0x2000, 0x2ee: 0x2000, 0x2ef: 0x2000, - // Block 0xc, offset 0x300 - 0x311: 0x2000, - 0x312: 0x2000, 0x313: 0x2000, 0x314: 0x2000, 0x315: 0x2000, 0x316: 0x2000, 0x317: 0x2000, - 0x318: 0x2000, 0x319: 0x2000, 0x31a: 0x2000, 0x31b: 0x2000, 0x31c: 0x2000, 0x31d: 0x2000, - 0x31e: 0x2000, 0x31f: 0x2000, 0x320: 0x2000, 0x321: 0x2000, 0x323: 0x2000, - 0x324: 0x2000, 0x325: 0x2000, 0x326: 0x2000, 0x327: 0x2000, 0x328: 0x2000, 0x329: 0x2000, - 0x331: 0x2000, 0x332: 0x2000, 0x333: 0x2000, 0x334: 0x2000, 0x335: 0x2000, - 0x336: 0x2000, 0x337: 0x2000, 0x338: 0x2000, 0x339: 0x2000, 0x33a: 0x2000, 0x33b: 0x2000, - 0x33c: 0x2000, 0x33d: 0x2000, 0x33e: 0x2000, 0x33f: 0x2000, - // Block 0xd, offset 0x340 - 0x340: 0x2000, 0x341: 0x2000, 0x343: 0x2000, 0x344: 0x2000, 0x345: 0x2000, - 0x346: 0x2000, 0x347: 0x2000, 0x348: 0x2000, 0x349: 0x2000, - // Block 0xe, offset 0x380 - 0x381: 0x2000, - 0x390: 0x2000, 0x391: 0x2000, - 0x392: 0x2000, 0x393: 0x2000, 0x394: 0x2000, 0x395: 0x2000, 0x396: 0x2000, 0x397: 0x2000, - 0x398: 0x2000, 0x399: 0x2000, 0x39a: 0x2000, 0x39b: 0x2000, 0x39c: 0x2000, 0x39d: 0x2000, - 0x39e: 0x2000, 0x39f: 0x2000, 0x3a0: 0x2000, 0x3a1: 0x2000, 0x3a2: 0x2000, 0x3a3: 0x2000, - 0x3a4: 0x2000, 0x3a5: 0x2000, 0x3a6: 0x2000, 0x3a7: 0x2000, 0x3a8: 0x2000, 0x3a9: 0x2000, - 0x3aa: 0x2000, 0x3ab: 0x2000, 0x3ac: 0x2000, 0x3ad: 0x2000, 0x3ae: 0x2000, 0x3af: 0x2000, - 0x3b0: 0x2000, 0x3b1: 0x2000, 0x3b2: 0x2000, 0x3b3: 0x2000, 0x3b4: 0x2000, 0x3b5: 0x2000, - 0x3b6: 0x2000, 0x3b7: 0x2000, 0x3b8: 0x2000, 0x3b9: 0x2000, 0x3ba: 0x2000, 0x3bb: 0x2000, - 0x3bc: 0x2000, 0x3bd: 0x2000, 0x3be: 0x2000, 0x3bf: 0x2000, - // Block 0xf, offset 0x3c0 - 0x3c0: 0x2000, 0x3c1: 0x2000, 0x3c2: 0x2000, 0x3c3: 0x2000, 0x3c4: 0x2000, 0x3c5: 0x2000, - 0x3c6: 0x2000, 0x3c7: 0x2000, 0x3c8: 0x2000, 0x3c9: 0x2000, 0x3ca: 0x2000, 0x3cb: 0x2000, - 0x3cc: 0x2000, 0x3cd: 0x2000, 0x3ce: 0x2000, 0x3cf: 0x2000, 0x3d1: 0x2000, - // Block 0x10, offset 0x400 - 0x400: 0x4000, 0x401: 0x4000, 0x402: 0x4000, 0x403: 0x4000, 0x404: 0x4000, 0x405: 0x4000, - 0x406: 0x4000, 0x407: 0x4000, 0x408: 0x4000, 0x409: 0x4000, 0x40a: 0x4000, 0x40b: 0x4000, - 0x40c: 0x4000, 0x40d: 0x4000, 0x40e: 0x4000, 0x40f: 0x4000, 0x410: 0x4000, 0x411: 0x4000, - 0x412: 0x4000, 0x413: 0x4000, 0x414: 0x4000, 0x415: 0x4000, 0x416: 0x4000, 0x417: 0x4000, - 0x418: 0x4000, 0x419: 0x4000, 0x41a: 0x4000, 0x41b: 0x4000, 0x41c: 0x4000, 0x41d: 0x4000, - 0x41e: 0x4000, 0x41f: 0x4000, 0x420: 0x4000, 0x421: 0x4000, 0x422: 0x4000, 0x423: 0x4000, - 0x424: 0x4000, 0x425: 0x4000, 0x426: 0x4000, 0x427: 0x4000, 0x428: 0x4000, 0x429: 0x4000, - 0x42a: 0x4000, 0x42b: 0x4000, 0x42c: 0x4000, 0x42d: 0x4000, 0x42e: 0x4000, 0x42f: 0x4000, - 0x430: 0x4000, 0x431: 0x4000, 0x432: 0x4000, 0x433: 0x4000, 0x434: 0x4000, 0x435: 0x4000, - 0x436: 0x4000, 0x437: 0x4000, 0x438: 0x4000, 0x439: 0x4000, 0x43a: 0x4000, 0x43b: 0x4000, - 0x43c: 0x4000, 0x43d: 0x4000, 0x43e: 0x4000, 0x43f: 0x4000, - // Block 0x11, offset 0x440 - 0x440: 0x4000, 0x441: 0x4000, 0x442: 0x4000, 0x443: 0x4000, 0x444: 0x4000, 0x445: 0x4000, - 0x446: 0x4000, 0x447: 0x4000, 0x448: 0x4000, 0x449: 0x4000, 0x44a: 0x4000, 0x44b: 0x4000, - 0x44c: 0x4000, 0x44d: 0x4000, 0x44e: 0x4000, 0x44f: 0x4000, 0x450: 0x4000, 0x451: 0x4000, - 0x452: 0x4000, 0x453: 0x4000, 0x454: 0x4000, 0x455: 0x4000, 0x456: 0x4000, 0x457: 0x4000, - 0x458: 0x4000, 0x459: 0x4000, 0x45a: 0x4000, 0x45b: 0x4000, 0x45c: 0x4000, 0x45d: 0x4000, - 0x45e: 0x4000, 0x45f: 0x4000, - // Block 0x12, offset 0x480 - 0x490: 0x2000, - 0x493: 0x2000, 0x494: 0x2000, 0x495: 0x2000, 0x496: 0x2000, - 0x498: 0x2000, 0x499: 0x2000, 0x49c: 0x2000, 0x49d: 0x2000, - 0x4a0: 0x2000, 0x4a1: 0x2000, 0x4a2: 0x2000, - 0x4a4: 0x2000, 0x4a5: 0x2000, 0x4a6: 0x2000, 0x4a7: 0x2000, - 0x4b0: 0x2000, 0x4b2: 0x2000, 0x4b3: 0x2000, 0x4b5: 0x2000, - 0x4bb: 0x2000, - 0x4be: 0x2000, - // Block 0x13, offset 0x4c0 - 0x4f4: 0x2000, - 0x4ff: 0x2000, - // Block 0x14, offset 0x500 - 0x501: 0x2000, 0x502: 0x2000, 0x503: 0x2000, 0x504: 0x2000, - 0x529: 0xa009, - 0x52c: 0x2000, - // Block 0x15, offset 0x540 - 0x543: 0x2000, 0x545: 0x2000, - 0x549: 0x2000, - 0x553: 0x2000, 0x556: 0x2000, - 0x561: 0x2000, 0x562: 0x2000, - 0x566: 0x2000, - 0x56b: 0x2000, - // Block 0x16, offset 0x580 - 0x593: 0x2000, 0x594: 0x2000, - 0x59b: 0x2000, 0x59c: 0x2000, 0x59d: 0x2000, - 0x59e: 0x2000, 0x5a0: 0x2000, 0x5a1: 0x2000, 0x5a2: 0x2000, 0x5a3: 0x2000, - 0x5a4: 0x2000, 0x5a5: 0x2000, 0x5a6: 0x2000, 0x5a7: 0x2000, 0x5a8: 0x2000, 0x5a9: 0x2000, - 0x5aa: 0x2000, 0x5ab: 0x2000, - 0x5b0: 0x2000, 0x5b1: 0x2000, 0x5b2: 0x2000, 0x5b3: 0x2000, 0x5b4: 0x2000, 0x5b5: 0x2000, - 0x5b6: 0x2000, 0x5b7: 0x2000, 0x5b8: 0x2000, 0x5b9: 0x2000, - // Block 0x17, offset 0x5c0 - 0x5c9: 0x2000, - 0x5d0: 0x200a, 0x5d1: 0x200b, - 0x5d2: 0x200a, 0x5d3: 0x200c, 0x5d4: 0x2000, 0x5d5: 0x2000, 0x5d6: 0x2000, 0x5d7: 0x2000, - 0x5d8: 0x2000, 0x5d9: 0x2000, - 0x5f8: 0x2000, 0x5f9: 0x2000, - // Block 0x18, offset 0x600 - 0x612: 0x2000, 0x614: 0x2000, - 0x627: 0x2000, - // Block 0x19, offset 0x640 - 0x640: 0x2000, 0x642: 0x2000, 0x643: 0x2000, - 0x647: 0x2000, 0x648: 0x2000, 0x64b: 0x2000, - 0x64f: 0x2000, 0x651: 0x2000, - 0x655: 0x2000, - 0x65a: 0x2000, 0x65d: 0x2000, - 0x65e: 0x2000, 0x65f: 0x2000, 0x660: 0x2000, 0x663: 0x2000, - 0x665: 0x2000, 0x667: 0x2000, 0x668: 0x2000, 0x669: 0x2000, - 0x66a: 0x2000, 0x66b: 0x2000, 0x66c: 0x2000, 0x66e: 0x2000, - 0x674: 0x2000, 0x675: 0x2000, - 0x676: 0x2000, 0x677: 0x2000, - 0x67c: 0x2000, 0x67d: 0x2000, - // Block 0x1a, offset 0x680 - 0x688: 0x2000, - 0x68c: 0x2000, - 0x692: 0x2000, - 0x6a0: 0x2000, 0x6a1: 0x2000, - 0x6a4: 0x2000, 0x6a5: 0x2000, 0x6a6: 0x2000, 0x6a7: 0x2000, - 0x6aa: 0x2000, 0x6ab: 0x2000, 0x6ae: 0x2000, 0x6af: 0x2000, - // Block 0x1b, offset 0x6c0 - 0x6c2: 0x2000, 0x6c3: 0x2000, - 0x6c6: 0x2000, 0x6c7: 0x2000, - 0x6d5: 0x2000, - 0x6d9: 0x2000, - 0x6e5: 0x2000, - 0x6ff: 0x2000, - // Block 0x1c, offset 0x700 - 0x712: 0x2000, - 0x71a: 0x4000, 0x71b: 0x4000, - 0x729: 0x4000, - 0x72a: 0x4000, - // Block 0x1d, offset 0x740 - 0x769: 0x4000, - 0x76a: 0x4000, 0x76b: 0x4000, 0x76c: 0x4000, - 0x770: 0x4000, 0x773: 0x4000, - // Block 0x1e, offset 0x780 - 0x7a0: 0x2000, 0x7a1: 0x2000, 0x7a2: 0x2000, 0x7a3: 0x2000, - 0x7a4: 0x2000, 0x7a5: 0x2000, 0x7a6: 0x2000, 0x7a7: 0x2000, 0x7a8: 0x2000, 0x7a9: 0x2000, - 0x7aa: 0x2000, 0x7ab: 0x2000, 0x7ac: 0x2000, 0x7ad: 0x2000, 0x7ae: 0x2000, 0x7af: 0x2000, - 0x7b0: 0x2000, 0x7b1: 0x2000, 0x7b2: 0x2000, 0x7b3: 0x2000, 0x7b4: 0x2000, 0x7b5: 0x2000, - 0x7b6: 0x2000, 0x7b7: 0x2000, 0x7b8: 0x2000, 0x7b9: 0x2000, 0x7ba: 0x2000, 0x7bb: 0x2000, - 0x7bc: 0x2000, 0x7bd: 0x2000, 0x7be: 0x2000, 0x7bf: 0x2000, - // Block 0x1f, offset 0x7c0 - 0x7c0: 0x2000, 0x7c1: 0x2000, 0x7c2: 0x2000, 0x7c3: 0x2000, 0x7c4: 0x2000, 0x7c5: 0x2000, - 0x7c6: 0x2000, 0x7c7: 0x2000, 0x7c8: 0x2000, 0x7c9: 0x2000, 0x7ca: 0x2000, 0x7cb: 0x2000, - 0x7cc: 0x2000, 0x7cd: 0x2000, 0x7ce: 0x2000, 0x7cf: 0x2000, 0x7d0: 0x2000, 0x7d1: 0x2000, - 0x7d2: 0x2000, 0x7d3: 0x2000, 0x7d4: 0x2000, 0x7d5: 0x2000, 0x7d6: 0x2000, 0x7d7: 0x2000, - 0x7d8: 0x2000, 0x7d9: 0x2000, 0x7da: 0x2000, 0x7db: 0x2000, 0x7dc: 0x2000, 0x7dd: 0x2000, - 0x7de: 0x2000, 0x7df: 0x2000, 0x7e0: 0x2000, 0x7e1: 0x2000, 0x7e2: 0x2000, 0x7e3: 0x2000, - 0x7e4: 0x2000, 0x7e5: 0x2000, 0x7e6: 0x2000, 0x7e7: 0x2000, 0x7e8: 0x2000, 0x7e9: 0x2000, - 0x7eb: 0x2000, 0x7ec: 0x2000, 0x7ed: 0x2000, 0x7ee: 0x2000, 0x7ef: 0x2000, - 0x7f0: 0x2000, 0x7f1: 0x2000, 0x7f2: 0x2000, 0x7f3: 0x2000, 0x7f4: 0x2000, 0x7f5: 0x2000, - 0x7f6: 0x2000, 0x7f7: 0x2000, 0x7f8: 0x2000, 0x7f9: 0x2000, 0x7fa: 0x2000, 0x7fb: 0x2000, - 0x7fc: 0x2000, 0x7fd: 0x2000, 0x7fe: 0x2000, 0x7ff: 0x2000, - // Block 0x20, offset 0x800 - 0x800: 0x2000, 0x801: 0x2000, 0x802: 0x200d, 0x803: 0x2000, 0x804: 0x2000, 0x805: 0x2000, - 0x806: 0x2000, 0x807: 0x2000, 0x808: 0x2000, 0x809: 0x2000, 0x80a: 0x2000, 0x80b: 0x2000, - 0x80c: 0x2000, 0x80d: 0x2000, 0x80e: 0x2000, 0x80f: 0x2000, 0x810: 0x2000, 0x811: 0x2000, - 0x812: 0x2000, 0x813: 0x2000, 0x814: 0x2000, 0x815: 0x2000, 0x816: 0x2000, 0x817: 0x2000, - 0x818: 0x2000, 0x819: 0x2000, 0x81a: 0x2000, 0x81b: 0x2000, 0x81c: 0x2000, 0x81d: 0x2000, - 0x81e: 0x2000, 0x81f: 0x2000, 0x820: 0x2000, 0x821: 0x2000, 0x822: 0x2000, 0x823: 0x2000, - 0x824: 0x2000, 0x825: 0x2000, 0x826: 0x2000, 0x827: 0x2000, 0x828: 0x2000, 0x829: 0x2000, - 0x82a: 0x2000, 0x82b: 0x2000, 0x82c: 0x2000, 0x82d: 0x2000, 0x82e: 0x2000, 0x82f: 0x2000, - 0x830: 0x2000, 0x831: 0x2000, 0x832: 0x2000, 0x833: 0x2000, 0x834: 0x2000, 0x835: 0x2000, - 0x836: 0x2000, 0x837: 0x2000, 0x838: 0x2000, 0x839: 0x2000, 0x83a: 0x2000, 0x83b: 0x2000, - 0x83c: 0x2000, 0x83d: 0x2000, 0x83e: 0x2000, 0x83f: 0x2000, - // Block 0x21, offset 0x840 - 0x840: 0x2000, 0x841: 0x2000, 0x842: 0x2000, 0x843: 0x2000, 0x844: 0x2000, 0x845: 0x2000, - 0x846: 0x2000, 0x847: 0x2000, 0x848: 0x2000, 0x849: 0x2000, 0x84a: 0x2000, 0x84b: 0x2000, - 0x850: 0x2000, 0x851: 0x2000, - 0x852: 0x2000, 0x853: 0x2000, 0x854: 0x2000, 0x855: 0x2000, 0x856: 0x2000, 0x857: 0x2000, - 0x858: 0x2000, 0x859: 0x2000, 0x85a: 0x2000, 0x85b: 0x2000, 0x85c: 0x2000, 0x85d: 0x2000, - 0x85e: 0x2000, 0x85f: 0x2000, 0x860: 0x2000, 0x861: 0x2000, 0x862: 0x2000, 0x863: 0x2000, - 0x864: 0x2000, 0x865: 0x2000, 0x866: 0x2000, 0x867: 0x2000, 0x868: 0x2000, 0x869: 0x2000, - 0x86a: 0x2000, 0x86b: 0x2000, 0x86c: 0x2000, 0x86d: 0x2000, 0x86e: 0x2000, 0x86f: 0x2000, - 0x870: 0x2000, 0x871: 0x2000, 0x872: 0x2000, 0x873: 0x2000, - // Block 0x22, offset 0x880 - 0x880: 0x2000, 0x881: 0x2000, 0x882: 0x2000, 0x883: 0x2000, 0x884: 0x2000, 0x885: 0x2000, - 0x886: 0x2000, 0x887: 0x2000, 0x888: 0x2000, 0x889: 0x2000, 0x88a: 0x2000, 0x88b: 0x2000, - 0x88c: 0x2000, 0x88d: 0x2000, 0x88e: 0x2000, 0x88f: 0x2000, - 0x892: 0x2000, 0x893: 0x2000, 0x894: 0x2000, 0x895: 0x2000, - 0x8a0: 0x200e, 0x8a1: 0x2000, 0x8a3: 0x2000, - 0x8a4: 0x2000, 0x8a5: 0x2000, 0x8a6: 0x2000, 0x8a7: 0x2000, 0x8a8: 0x2000, 0x8a9: 0x2000, - 0x8b2: 0x2000, 0x8b3: 0x2000, - 0x8b6: 0x2000, 0x8b7: 0x2000, - 0x8bc: 0x2000, 0x8bd: 0x2000, - // Block 0x23, offset 0x8c0 - 0x8c0: 0x2000, 0x8c1: 0x2000, - 0x8c6: 0x2000, 0x8c7: 0x2000, 0x8c8: 0x2000, 0x8cb: 0x200f, - 0x8ce: 0x2000, 0x8cf: 0x2000, 0x8d0: 0x2000, 0x8d1: 0x2000, - 0x8e2: 0x2000, 0x8e3: 0x2000, - 0x8e4: 0x2000, 0x8e5: 0x2000, - 0x8ef: 0x2000, - 0x8fd: 0x4000, 0x8fe: 0x4000, - // Block 0x24, offset 0x900 - 0x905: 0x2000, - 0x906: 0x2000, 0x909: 0x2000, - 0x90e: 0x2000, 0x90f: 0x2000, - 0x914: 0x4000, 0x915: 0x4000, - 0x91c: 0x2000, - 0x91e: 0x2000, - // Block 0x25, offset 0x940 - 0x940: 0x2000, 0x942: 0x2000, - 0x948: 0x4000, 0x949: 0x4000, 0x94a: 0x4000, 0x94b: 0x4000, - 0x94c: 0x4000, 0x94d: 0x4000, 0x94e: 0x4000, 0x94f: 0x4000, 0x950: 0x4000, 0x951: 0x4000, - 0x952: 0x4000, 0x953: 0x4000, - 0x960: 0x2000, 0x961: 0x2000, 0x963: 0x2000, - 0x964: 0x2000, 0x965: 0x2000, 0x967: 0x2000, 0x968: 0x2000, 0x969: 0x2000, - 0x96a: 0x2000, 0x96c: 0x2000, 0x96d: 0x2000, 0x96f: 0x2000, - 0x97f: 0x4000, - // Block 0x26, offset 0x980 - 0x993: 0x4000, - 0x99e: 0x2000, 0x99f: 0x2000, 0x9a1: 0x4000, - 0x9aa: 0x4000, 0x9ab: 0x4000, - 0x9bd: 0x4000, 0x9be: 0x4000, 0x9bf: 0x2000, - // Block 0x27, offset 0x9c0 - 0x9c4: 0x4000, 0x9c5: 0x4000, - 0x9c6: 0x2000, 0x9c7: 0x2000, 0x9c8: 0x2000, 0x9c9: 0x2000, 0x9ca: 0x2000, 0x9cb: 0x2000, - 0x9cc: 0x2000, 0x9cd: 0x2000, 0x9ce: 0x4000, 0x9cf: 0x2000, 0x9d0: 0x2000, 0x9d1: 0x2000, - 0x9d2: 0x2000, 0x9d3: 0x2000, 0x9d4: 0x4000, 0x9d5: 0x2000, 0x9d6: 0x2000, 0x9d7: 0x2000, - 0x9d8: 0x2000, 0x9d9: 0x2000, 0x9da: 0x2000, 0x9db: 0x2000, 0x9dc: 0x2000, 0x9dd: 0x2000, - 0x9de: 0x2000, 0x9df: 0x2000, 0x9e0: 0x2000, 0x9e1: 0x2000, 0x9e3: 0x2000, - 0x9e8: 0x2000, 0x9e9: 0x2000, - 0x9ea: 0x4000, 0x9eb: 0x2000, 0x9ec: 0x2000, 0x9ed: 0x2000, 0x9ee: 0x2000, 0x9ef: 0x2000, - 0x9f0: 0x2000, 0x9f1: 0x2000, 0x9f2: 0x4000, 0x9f3: 0x4000, 0x9f4: 0x2000, 0x9f5: 0x4000, - 0x9f6: 0x2000, 0x9f7: 0x2000, 0x9f8: 0x2000, 0x9f9: 0x2000, 0x9fa: 0x4000, 0x9fb: 0x2000, - 0x9fc: 0x2000, 0x9fd: 0x4000, 0x9fe: 0x2000, 0x9ff: 0x2000, - // Block 0x28, offset 0xa00 - 0xa05: 0x4000, - 0xa0a: 0x4000, 0xa0b: 0x4000, - 0xa28: 0x4000, - 0xa3d: 0x2000, - // Block 0x29, offset 0xa40 - 0xa4c: 0x4000, 0xa4e: 0x4000, - 0xa53: 0x4000, 0xa54: 0x4000, 0xa55: 0x4000, 0xa57: 0x4000, - 0xa76: 0x2000, 0xa77: 0x2000, 0xa78: 0x2000, 0xa79: 0x2000, 0xa7a: 0x2000, 0xa7b: 0x2000, - 0xa7c: 0x2000, 0xa7d: 0x2000, 0xa7e: 0x2000, 0xa7f: 0x2000, - // Block 0x2a, offset 0xa80 - 0xa95: 0x4000, 0xa96: 0x4000, 0xa97: 0x4000, - 0xab0: 0x4000, - 0xabf: 0x4000, - // Block 0x2b, offset 0xac0 - 0xae6: 0x6000, 0xae7: 0x6000, 0xae8: 0x6000, 0xae9: 0x6000, - 0xaea: 0x6000, 0xaeb: 0x6000, 0xaec: 0x6000, 0xaed: 0x6000, - // Block 0x2c, offset 0xb00 - 0xb05: 0x6010, - 0xb06: 0x6011, - // Block 0x2d, offset 0xb40 - 0xb5b: 0x4000, 0xb5c: 0x4000, - // Block 0x2e, offset 0xb80 - 0xb90: 0x4000, - 0xb95: 0x4000, 0xb96: 0x2000, 0xb97: 0x2000, - 0xb98: 0x2000, 0xb99: 0x2000, - // Block 0x2f, offset 0xbc0 - 0xbc0: 0x4000, 0xbc1: 0x4000, 0xbc2: 0x4000, 0xbc3: 0x4000, 0xbc4: 0x4000, 0xbc5: 0x4000, - 0xbc6: 0x4000, 0xbc7: 0x4000, 0xbc8: 0x4000, 0xbc9: 0x4000, 0xbca: 0x4000, 0xbcb: 0x4000, - 0xbcc: 0x4000, 0xbcd: 0x4000, 0xbce: 0x4000, 0xbcf: 0x4000, 0xbd0: 0x4000, 0xbd1: 0x4000, - 0xbd2: 0x4000, 0xbd3: 0x4000, 0xbd4: 0x4000, 0xbd5: 0x4000, 0xbd6: 0x4000, 0xbd7: 0x4000, - 0xbd8: 0x4000, 0xbd9: 0x4000, 0xbdb: 0x4000, 0xbdc: 0x4000, 0xbdd: 0x4000, - 0xbde: 0x4000, 0xbdf: 0x4000, 0xbe0: 0x4000, 0xbe1: 0x4000, 0xbe2: 0x4000, 0xbe3: 0x4000, - 0xbe4: 0x4000, 0xbe5: 0x4000, 0xbe6: 0x4000, 0xbe7: 0x4000, 0xbe8: 0x4000, 0xbe9: 0x4000, - 0xbea: 0x4000, 0xbeb: 0x4000, 0xbec: 0x4000, 0xbed: 0x4000, 0xbee: 0x4000, 0xbef: 0x4000, - 0xbf0: 0x4000, 0xbf1: 0x4000, 0xbf2: 0x4000, 0xbf3: 0x4000, 0xbf4: 0x4000, 0xbf5: 0x4000, - 0xbf6: 0x4000, 0xbf7: 0x4000, 0xbf8: 0x4000, 0xbf9: 0x4000, 0xbfa: 0x4000, 0xbfb: 0x4000, - 0xbfc: 0x4000, 0xbfd: 0x4000, 0xbfe: 0x4000, 0xbff: 0x4000, - // Block 0x30, offset 0xc00 - 0xc00: 0x4000, 0xc01: 0x4000, 0xc02: 0x4000, 0xc03: 0x4000, 0xc04: 0x4000, 0xc05: 0x4000, - 0xc06: 0x4000, 0xc07: 0x4000, 0xc08: 0x4000, 0xc09: 0x4000, 0xc0a: 0x4000, 0xc0b: 0x4000, - 0xc0c: 0x4000, 0xc0d: 0x4000, 0xc0e: 0x4000, 0xc0f: 0x4000, 0xc10: 0x4000, 0xc11: 0x4000, - 0xc12: 0x4000, 0xc13: 0x4000, 0xc14: 0x4000, 0xc15: 0x4000, 0xc16: 0x4000, 0xc17: 0x4000, - 0xc18: 0x4000, 0xc19: 0x4000, 0xc1a: 0x4000, 0xc1b: 0x4000, 0xc1c: 0x4000, 0xc1d: 0x4000, - 0xc1e: 0x4000, 0xc1f: 0x4000, 0xc20: 0x4000, 0xc21: 0x4000, 0xc22: 0x4000, 0xc23: 0x4000, - 0xc24: 0x4000, 0xc25: 0x4000, 0xc26: 0x4000, 0xc27: 0x4000, 0xc28: 0x4000, 0xc29: 0x4000, - 0xc2a: 0x4000, 0xc2b: 0x4000, 0xc2c: 0x4000, 0xc2d: 0x4000, 0xc2e: 0x4000, 0xc2f: 0x4000, - 0xc30: 0x4000, 0xc31: 0x4000, 0xc32: 0x4000, 0xc33: 0x4000, - // Block 0x31, offset 0xc40 - 0xc40: 0x4000, 0xc41: 0x4000, 0xc42: 0x4000, 0xc43: 0x4000, 0xc44: 0x4000, 0xc45: 0x4000, - 0xc46: 0x4000, 0xc47: 0x4000, 0xc48: 0x4000, 0xc49: 0x4000, 0xc4a: 0x4000, 0xc4b: 0x4000, - 0xc4c: 0x4000, 0xc4d: 0x4000, 0xc4e: 0x4000, 0xc4f: 0x4000, 0xc50: 0x4000, 0xc51: 0x4000, - 0xc52: 0x4000, 0xc53: 0x4000, 0xc54: 0x4000, 0xc55: 0x4000, - 0xc70: 0x4000, 0xc71: 0x4000, 0xc72: 0x4000, 0xc73: 0x4000, 0xc74: 0x4000, 0xc75: 0x4000, - 0xc76: 0x4000, 0xc77: 0x4000, 0xc78: 0x4000, 0xc79: 0x4000, 0xc7a: 0x4000, 0xc7b: 0x4000, - // Block 0x32, offset 0xc80 - 0xc80: 0x9012, 0xc81: 0x4013, 0xc82: 0x4014, 0xc83: 0x4000, 0xc84: 0x4000, 0xc85: 0x4000, - 0xc86: 0x4000, 0xc87: 0x4000, 0xc88: 0x4000, 0xc89: 0x4000, 0xc8a: 0x4000, 0xc8b: 0x4000, - 0xc8c: 0x4015, 0xc8d: 0x4015, 0xc8e: 0x4000, 0xc8f: 0x4000, 0xc90: 0x4000, 0xc91: 0x4000, - 0xc92: 0x4000, 0xc93: 0x4000, 0xc94: 0x4000, 0xc95: 0x4000, 0xc96: 0x4000, 0xc97: 0x4000, - 0xc98: 0x4000, 0xc99: 0x4000, 0xc9a: 0x4000, 0xc9b: 0x4000, 0xc9c: 0x4000, 0xc9d: 0x4000, - 0xc9e: 0x4000, 0xc9f: 0x4000, 0xca0: 0x4000, 0xca1: 0x4000, 0xca2: 0x4000, 0xca3: 0x4000, - 0xca4: 0x4000, 0xca5: 0x4000, 0xca6: 0x4000, 0xca7: 0x4000, 0xca8: 0x4000, 0xca9: 0x4000, - 0xcaa: 0x4000, 0xcab: 0x4000, 0xcac: 0x4000, 0xcad: 0x4000, 0xcae: 0x4000, 0xcaf: 0x4000, - 0xcb0: 0x4000, 0xcb1: 0x4000, 0xcb2: 0x4000, 0xcb3: 0x4000, 0xcb4: 0x4000, 0xcb5: 0x4000, - 0xcb6: 0x4000, 0xcb7: 0x4000, 0xcb8: 0x4000, 0xcb9: 0x4000, 0xcba: 0x4000, 0xcbb: 0x4000, - 0xcbc: 0x4000, 0xcbd: 0x4000, 0xcbe: 0x4000, - // Block 0x33, offset 0xcc0 - 0xcc1: 0x4000, 0xcc2: 0x4000, 0xcc3: 0x4000, 0xcc4: 0x4000, 0xcc5: 0x4000, - 0xcc6: 0x4000, 0xcc7: 0x4000, 0xcc8: 0x4000, 0xcc9: 0x4000, 0xcca: 0x4000, 0xccb: 0x4000, - 0xccc: 0x4000, 0xccd: 0x4000, 0xcce: 0x4000, 0xccf: 0x4000, 0xcd0: 0x4000, 0xcd1: 0x4000, - 0xcd2: 0x4000, 0xcd3: 0x4000, 0xcd4: 0x4000, 0xcd5: 0x4000, 0xcd6: 0x4000, 0xcd7: 0x4000, - 0xcd8: 0x4000, 0xcd9: 0x4000, 0xcda: 0x4000, 0xcdb: 0x4000, 0xcdc: 0x4000, 0xcdd: 0x4000, - 0xcde: 0x4000, 0xcdf: 0x4000, 0xce0: 0x4000, 0xce1: 0x4000, 0xce2: 0x4000, 0xce3: 0x4000, - 0xce4: 0x4000, 0xce5: 0x4000, 0xce6: 0x4000, 0xce7: 0x4000, 0xce8: 0x4000, 0xce9: 0x4000, - 0xcea: 0x4000, 0xceb: 0x4000, 0xcec: 0x4000, 0xced: 0x4000, 0xcee: 0x4000, 0xcef: 0x4000, - 0xcf0: 0x4000, 0xcf1: 0x4000, 0xcf2: 0x4000, 0xcf3: 0x4000, 0xcf4: 0x4000, 0xcf5: 0x4000, - 0xcf6: 0x4000, 0xcf7: 0x4000, 0xcf8: 0x4000, 0xcf9: 0x4000, 0xcfa: 0x4000, 0xcfb: 0x4000, - 0xcfc: 0x4000, 0xcfd: 0x4000, 0xcfe: 0x4000, 0xcff: 0x4000, - // Block 0x34, offset 0xd00 - 0xd00: 0x4000, 0xd01: 0x4000, 0xd02: 0x4000, 0xd03: 0x4000, 0xd04: 0x4000, 0xd05: 0x4000, - 0xd06: 0x4000, 0xd07: 0x4000, 0xd08: 0x4000, 0xd09: 0x4000, 0xd0a: 0x4000, 0xd0b: 0x4000, - 0xd0c: 0x4000, 0xd0d: 0x4000, 0xd0e: 0x4000, 0xd0f: 0x4000, 0xd10: 0x4000, 0xd11: 0x4000, - 0xd12: 0x4000, 0xd13: 0x4000, 0xd14: 0x4000, 0xd15: 0x4000, 0xd16: 0x4000, - 0xd19: 0x4016, 0xd1a: 0x4017, 0xd1b: 0x4000, 0xd1c: 0x4000, 0xd1d: 0x4000, - 0xd1e: 0x4000, 0xd1f: 0x4000, 0xd20: 0x4000, 0xd21: 0x4018, 0xd22: 0x4019, 0xd23: 0x401a, - 0xd24: 0x401b, 0xd25: 0x401c, 0xd26: 0x401d, 0xd27: 0x401e, 0xd28: 0x401f, 0xd29: 0x4020, - 0xd2a: 0x4021, 0xd2b: 0x4022, 0xd2c: 0x4000, 0xd2d: 0x4010, 0xd2e: 0x4000, 0xd2f: 0x4023, - 0xd30: 0x4000, 0xd31: 0x4024, 0xd32: 0x4000, 0xd33: 0x4025, 0xd34: 0x4000, 0xd35: 0x4026, - 0xd36: 0x4000, 0xd37: 0x401a, 0xd38: 0x4000, 0xd39: 0x4027, 0xd3a: 0x4000, 0xd3b: 0x4028, - 0xd3c: 0x4000, 0xd3d: 0x4020, 0xd3e: 0x4000, 0xd3f: 0x4029, - // Block 0x35, offset 0xd40 - 0xd40: 0x4000, 0xd41: 0x402a, 0xd42: 0x4000, 0xd43: 0x402b, 0xd44: 0x402c, 0xd45: 0x4000, - 0xd46: 0x4017, 0xd47: 0x4000, 0xd48: 0x402d, 0xd49: 0x4000, 0xd4a: 0x402e, 0xd4b: 0x402f, - 0xd4c: 0x4030, 0xd4d: 0x4017, 0xd4e: 0x4016, 0xd4f: 0x4017, 0xd50: 0x4000, 0xd51: 0x4000, - 0xd52: 0x4031, 0xd53: 0x4000, 0xd54: 0x4000, 0xd55: 0x4031, 0xd56: 0x4000, 0xd57: 0x4000, - 0xd58: 0x4032, 0xd59: 0x4000, 0xd5a: 0x4000, 0xd5b: 0x4032, 0xd5c: 0x4000, 0xd5d: 0x4000, - 0xd5e: 0x4033, 0xd5f: 0x402e, 0xd60: 0x4034, 0xd61: 0x4035, 0xd62: 0x4034, 0xd63: 0x4036, - 0xd64: 0x4037, 0xd65: 0x4024, 0xd66: 0x4035, 0xd67: 0x4025, 0xd68: 0x4038, 0xd69: 0x4038, - 0xd6a: 0x4039, 0xd6b: 0x4039, 0xd6c: 0x403a, 0xd6d: 0x403a, 0xd6e: 0x4000, 0xd6f: 0x4035, - 0xd70: 0x4000, 0xd71: 0x4000, 0xd72: 0x403b, 0xd73: 0x403c, 0xd74: 0x4000, 0xd75: 0x4000, - 0xd76: 0x4000, 0xd77: 0x4000, 0xd78: 0x4000, 0xd79: 0x4000, 0xd7a: 0x4000, 0xd7b: 0x403d, - 0xd7c: 0x401c, 0xd7d: 0x4000, 0xd7e: 0x4000, 0xd7f: 0x4000, - // Block 0x36, offset 0xd80 - 0xd85: 0x4000, - 0xd86: 0x4000, 0xd87: 0x4000, 0xd88: 0x4000, 0xd89: 0x4000, 0xd8a: 0x4000, 0xd8b: 0x4000, - 0xd8c: 0x4000, 0xd8d: 0x4000, 0xd8e: 0x4000, 0xd8f: 0x4000, 0xd90: 0x4000, 0xd91: 0x4000, - 0xd92: 0x4000, 0xd93: 0x4000, 0xd94: 0x4000, 0xd95: 0x4000, 0xd96: 0x4000, 0xd97: 0x4000, - 0xd98: 0x4000, 0xd99: 0x4000, 0xd9a: 0x4000, 0xd9b: 0x4000, 0xd9c: 0x4000, 0xd9d: 0x4000, - 0xd9e: 0x4000, 0xd9f: 0x4000, 0xda0: 0x4000, 0xda1: 0x4000, 0xda2: 0x4000, 0xda3: 0x4000, - 0xda4: 0x4000, 0xda5: 0x4000, 0xda6: 0x4000, 0xda7: 0x4000, 0xda8: 0x4000, 0xda9: 0x4000, - 0xdaa: 0x4000, 0xdab: 0x4000, 0xdac: 0x4000, 0xdad: 0x4000, 0xdae: 0x4000, 0xdaf: 0x4000, - 0xdb1: 0x403e, 0xdb2: 0x403e, 0xdb3: 0x403e, 0xdb4: 0x403e, 0xdb5: 0x403e, - 0xdb6: 0x403e, 0xdb7: 0x403e, 0xdb8: 0x403e, 0xdb9: 0x403e, 0xdba: 0x403e, 0xdbb: 0x403e, - 0xdbc: 0x403e, 0xdbd: 0x403e, 0xdbe: 0x403e, 0xdbf: 0x403e, - // Block 0x37, offset 0xdc0 - 0xdc0: 0x4037, 0xdc1: 0x4037, 0xdc2: 0x4037, 0xdc3: 0x4037, 0xdc4: 0x4037, 0xdc5: 0x4037, - 0xdc6: 0x4037, 0xdc7: 0x4037, 0xdc8: 0x4037, 0xdc9: 0x4037, 0xdca: 0x4037, 0xdcb: 0x4037, - 0xdcc: 0x4037, 0xdcd: 0x4037, 0xdce: 0x4037, 0xdcf: 0x400e, 0xdd0: 0x403f, 0xdd1: 0x4040, - 0xdd2: 0x4041, 0xdd3: 0x4040, 0xdd4: 0x403f, 0xdd5: 0x4042, 0xdd6: 0x4043, 0xdd7: 0x4044, - 0xdd8: 0x4040, 0xdd9: 0x4041, 0xdda: 0x4040, 0xddb: 0x4045, 0xddc: 0x4009, 0xddd: 0x4045, - 0xdde: 0x4046, 0xddf: 0x4045, 0xde0: 0x4047, 0xde1: 0x400b, 0xde2: 0x400a, 0xde3: 0x400c, - 0xde4: 0x4048, 0xde5: 0x4000, 0xde6: 0x4000, 0xde7: 0x4000, 0xde8: 0x4000, 0xde9: 0x4000, - 0xdea: 0x4000, 0xdeb: 0x4000, 0xdec: 0x4000, 0xded: 0x4000, 0xdee: 0x4000, 0xdef: 0x4000, - 0xdf0: 0x4000, 0xdf1: 0x4000, 0xdf2: 0x4000, 0xdf3: 0x4000, 0xdf4: 0x4000, 0xdf5: 0x4000, - 0xdf6: 0x4000, 0xdf7: 0x4000, 0xdf8: 0x4000, 0xdf9: 0x4000, 0xdfa: 0x4000, 0xdfb: 0x4000, - 0xdfc: 0x4000, 0xdfd: 0x4000, 0xdfe: 0x4000, 0xdff: 0x4000, - // Block 0x38, offset 0xe00 - 0xe00: 0x4000, 0xe01: 0x4000, 0xe02: 0x4000, 0xe03: 0x4000, 0xe04: 0x4000, 0xe05: 0x4000, - 0xe06: 0x4000, 0xe07: 0x4000, 0xe08: 0x4000, 0xe09: 0x4000, 0xe0a: 0x4000, 0xe0b: 0x4000, - 0xe0c: 0x4000, 0xe0d: 0x4000, 0xe0e: 0x4000, 0xe10: 0x4000, 0xe11: 0x4000, - 0xe12: 0x4000, 0xe13: 0x4000, 0xe14: 0x4000, 0xe15: 0x4000, 0xe16: 0x4000, 0xe17: 0x4000, - 0xe18: 0x4000, 0xe19: 0x4000, 0xe1a: 0x4000, 0xe1b: 0x4000, 0xe1c: 0x4000, 0xe1d: 0x4000, - 0xe1e: 0x4000, 0xe1f: 0x4000, 0xe20: 0x4000, 0xe21: 0x4000, 0xe22: 0x4000, 0xe23: 0x4000, - 0xe24: 0x4000, 0xe25: 0x4000, 0xe26: 0x4000, 0xe27: 0x4000, 0xe28: 0x4000, 0xe29: 0x4000, - 0xe2a: 0x4000, 0xe2b: 0x4000, 0xe2c: 0x4000, 0xe2d: 0x4000, 0xe2e: 0x4000, 0xe2f: 0x4000, - 0xe30: 0x4000, 0xe31: 0x4000, 0xe32: 0x4000, 0xe33: 0x4000, 0xe34: 0x4000, 0xe35: 0x4000, - 0xe36: 0x4000, 0xe37: 0x4000, 0xe38: 0x4000, 0xe39: 0x4000, 0xe3a: 0x4000, - // Block 0x39, offset 0xe40 - 0xe40: 0x4000, 0xe41: 0x4000, 0xe42: 0x4000, 0xe43: 0x4000, 0xe44: 0x4000, 0xe45: 0x4000, - 0xe46: 0x4000, 0xe47: 0x4000, 0xe48: 0x4000, 0xe49: 0x4000, 0xe4a: 0x4000, 0xe4b: 0x4000, - 0xe4c: 0x4000, 0xe4d: 0x4000, 0xe4e: 0x4000, 0xe4f: 0x4000, 0xe50: 0x4000, 0xe51: 0x4000, - 0xe52: 0x4000, 0xe53: 0x4000, 0xe54: 0x4000, 0xe55: 0x4000, 0xe56: 0x4000, 0xe57: 0x4000, - 0xe58: 0x4000, 0xe59: 0x4000, 0xe5a: 0x4000, 0xe5b: 0x4000, 0xe5c: 0x4000, 0xe5d: 0x4000, - 0xe5e: 0x4000, 0xe5f: 0x4000, 0xe60: 0x4000, 0xe61: 0x4000, 0xe62: 0x4000, 0xe63: 0x4000, - 0xe70: 0x4000, 0xe71: 0x4000, 0xe72: 0x4000, 0xe73: 0x4000, 0xe74: 0x4000, 0xe75: 0x4000, - 0xe76: 0x4000, 0xe77: 0x4000, 0xe78: 0x4000, 0xe79: 0x4000, 0xe7a: 0x4000, 0xe7b: 0x4000, - 0xe7c: 0x4000, 0xe7d: 0x4000, 0xe7e: 0x4000, 0xe7f: 0x4000, - // Block 0x3a, offset 0xe80 - 0xe80: 0x4000, 0xe81: 0x4000, 0xe82: 0x4000, 0xe83: 0x4000, 0xe84: 0x4000, 0xe85: 0x4000, - 0xe86: 0x4000, 0xe87: 0x4000, 0xe88: 0x4000, 0xe89: 0x4000, 0xe8a: 0x4000, 0xe8b: 0x4000, - 0xe8c: 0x4000, 0xe8d: 0x4000, 0xe8e: 0x4000, 0xe8f: 0x4000, 0xe90: 0x4000, 0xe91: 0x4000, - 0xe92: 0x4000, 0xe93: 0x4000, 0xe94: 0x4000, 0xe95: 0x4000, 0xe96: 0x4000, 0xe97: 0x4000, - 0xe98: 0x4000, 0xe99: 0x4000, 0xe9a: 0x4000, 0xe9b: 0x4000, 0xe9c: 0x4000, 0xe9d: 0x4000, - 0xe9e: 0x4000, 0xea0: 0x4000, 0xea1: 0x4000, 0xea2: 0x4000, 0xea3: 0x4000, - 0xea4: 0x4000, 0xea5: 0x4000, 0xea6: 0x4000, 0xea7: 0x4000, 0xea8: 0x4000, 0xea9: 0x4000, - 0xeaa: 0x4000, 0xeab: 0x4000, 0xeac: 0x4000, 0xead: 0x4000, 0xeae: 0x4000, 0xeaf: 0x4000, - 0xeb0: 0x4000, 0xeb1: 0x4000, 0xeb2: 0x4000, 0xeb3: 0x4000, 0xeb4: 0x4000, 0xeb5: 0x4000, - 0xeb6: 0x4000, 0xeb7: 0x4000, 0xeb8: 0x4000, 0xeb9: 0x4000, 0xeba: 0x4000, 0xebb: 0x4000, - 0xebc: 0x4000, 0xebd: 0x4000, 0xebe: 0x4000, 0xebf: 0x4000, - // Block 0x3b, offset 0xec0 - 0xec0: 0x4000, 0xec1: 0x4000, 0xec2: 0x4000, 0xec3: 0x4000, 0xec4: 0x4000, 0xec5: 0x4000, - 0xec6: 0x4000, 0xec7: 0x4000, 0xec8: 0x2000, 0xec9: 0x2000, 0xeca: 0x2000, 0xecb: 0x2000, - 0xecc: 0x2000, 0xecd: 0x2000, 0xece: 0x2000, 0xecf: 0x2000, 0xed0: 0x4000, 0xed1: 0x4000, - 0xed2: 0x4000, 0xed3: 0x4000, 0xed4: 0x4000, 0xed5: 0x4000, 0xed6: 0x4000, 0xed7: 0x4000, - 0xed8: 0x4000, 0xed9: 0x4000, 0xeda: 0x4000, 0xedb: 0x4000, 0xedc: 0x4000, 0xedd: 0x4000, - 0xede: 0x4000, 0xedf: 0x4000, 0xee0: 0x4000, 0xee1: 0x4000, 0xee2: 0x4000, 0xee3: 0x4000, - 0xee4: 0x4000, 0xee5: 0x4000, 0xee6: 0x4000, 0xee7: 0x4000, 0xee8: 0x4000, 0xee9: 0x4000, - 0xeea: 0x4000, 0xeeb: 0x4000, 0xeec: 0x4000, 0xeed: 0x4000, 0xeee: 0x4000, 0xeef: 0x4000, - 0xef0: 0x4000, 0xef1: 0x4000, 0xef2: 0x4000, 0xef3: 0x4000, 0xef4: 0x4000, 0xef5: 0x4000, - 0xef6: 0x4000, 0xef7: 0x4000, 0xef8: 0x4000, 0xef9: 0x4000, 0xefa: 0x4000, 0xefb: 0x4000, - 0xefc: 0x4000, 0xefd: 0x4000, 0xefe: 0x4000, 0xeff: 0x4000, - // Block 0x3c, offset 0xf00 - 0xf00: 0x4000, 0xf01: 0x4000, 0xf02: 0x4000, 0xf03: 0x4000, 0xf04: 0x4000, 0xf05: 0x4000, - 0xf06: 0x4000, 0xf07: 0x4000, 0xf08: 0x4000, 0xf09: 0x4000, 0xf0a: 0x4000, 0xf0b: 0x4000, - 0xf0c: 0x4000, 0xf0d: 0x4000, 0xf0e: 0x4000, 0xf0f: 0x4000, 0xf10: 0x4000, 0xf11: 0x4000, - 0xf12: 0x4000, 0xf13: 0x4000, 0xf14: 0x4000, 0xf15: 0x4000, 0xf16: 0x4000, 0xf17: 0x4000, - 0xf18: 0x4000, 0xf19: 0x4000, 0xf1a: 0x4000, 0xf1b: 0x4000, 0xf1c: 0x4000, 0xf1d: 0x4000, - 0xf1e: 0x4000, 0xf1f: 0x4000, 0xf20: 0x4000, 0xf21: 0x4000, 0xf22: 0x4000, 0xf23: 0x4000, - 0xf24: 0x4000, 0xf25: 0x4000, 0xf26: 0x4000, 0xf27: 0x4000, 0xf28: 0x4000, 0xf29: 0x4000, - 0xf2a: 0x4000, 0xf2b: 0x4000, 0xf2c: 0x4000, 0xf2d: 0x4000, 0xf2e: 0x4000, 0xf2f: 0x4000, - 0xf30: 0x4000, 0xf31: 0x4000, 0xf32: 0x4000, 0xf33: 0x4000, 0xf34: 0x4000, 0xf35: 0x4000, - 0xf36: 0x4000, 0xf37: 0x4000, 0xf38: 0x4000, 0xf39: 0x4000, 0xf3a: 0x4000, 0xf3b: 0x4000, - 0xf3c: 0x4000, 0xf3d: 0x4000, 0xf3e: 0x4000, - // Block 0x3d, offset 0xf40 - 0xf40: 0x4000, 0xf41: 0x4000, 0xf42: 0x4000, 0xf43: 0x4000, 0xf44: 0x4000, 0xf45: 0x4000, - 0xf46: 0x4000, 0xf47: 0x4000, 0xf48: 0x4000, 0xf49: 0x4000, 0xf4a: 0x4000, 0xf4b: 0x4000, - 0xf4c: 0x4000, 0xf50: 0x4000, 0xf51: 0x4000, - 0xf52: 0x4000, 0xf53: 0x4000, 0xf54: 0x4000, 0xf55: 0x4000, 0xf56: 0x4000, 0xf57: 0x4000, - 0xf58: 0x4000, 0xf59: 0x4000, 0xf5a: 0x4000, 0xf5b: 0x4000, 0xf5c: 0x4000, 0xf5d: 0x4000, - 0xf5e: 0x4000, 0xf5f: 0x4000, 0xf60: 0x4000, 0xf61: 0x4000, 0xf62: 0x4000, 0xf63: 0x4000, - 0xf64: 0x4000, 0xf65: 0x4000, 0xf66: 0x4000, 0xf67: 0x4000, 0xf68: 0x4000, 0xf69: 0x4000, - 0xf6a: 0x4000, 0xf6b: 0x4000, 0xf6c: 0x4000, 0xf6d: 0x4000, 0xf6e: 0x4000, 0xf6f: 0x4000, - 0xf70: 0x4000, 0xf71: 0x4000, 0xf72: 0x4000, 0xf73: 0x4000, 0xf74: 0x4000, 0xf75: 0x4000, - 0xf76: 0x4000, 0xf77: 0x4000, 0xf78: 0x4000, 0xf79: 0x4000, 0xf7a: 0x4000, 0xf7b: 0x4000, - 0xf7c: 0x4000, 0xf7d: 0x4000, 0xf7e: 0x4000, 0xf7f: 0x4000, - // Block 0x3e, offset 0xf80 - 0xf80: 0x4000, 0xf81: 0x4000, 0xf82: 0x4000, 0xf83: 0x4000, 0xf84: 0x4000, 0xf85: 0x4000, - 0xf86: 0x4000, - // Block 0x3f, offset 0xfc0 - 0xfe0: 0x4000, 0xfe1: 0x4000, 0xfe2: 0x4000, 0xfe3: 0x4000, - 0xfe4: 0x4000, 0xfe5: 0x4000, 0xfe6: 0x4000, 0xfe7: 0x4000, 0xfe8: 0x4000, 0xfe9: 0x4000, - 0xfea: 0x4000, 0xfeb: 0x4000, 0xfec: 0x4000, 0xfed: 0x4000, 0xfee: 0x4000, 0xfef: 0x4000, - 0xff0: 0x4000, 0xff1: 0x4000, 0xff2: 0x4000, 0xff3: 0x4000, 0xff4: 0x4000, 0xff5: 0x4000, - 0xff6: 0x4000, 0xff7: 0x4000, 0xff8: 0x4000, 0xff9: 0x4000, 0xffa: 0x4000, 0xffb: 0x4000, - 0xffc: 0x4000, - // Block 0x40, offset 0x1000 - 0x1000: 0x4000, 0x1001: 0x4000, 0x1002: 0x4000, 0x1003: 0x4000, 0x1004: 0x4000, 0x1005: 0x4000, - 0x1006: 0x4000, 0x1007: 0x4000, 0x1008: 0x4000, 0x1009: 0x4000, 0x100a: 0x4000, 0x100b: 0x4000, - 0x100c: 0x4000, 0x100d: 0x4000, 0x100e: 0x4000, 0x100f: 0x4000, 0x1010: 0x4000, 0x1011: 0x4000, - 0x1012: 0x4000, 0x1013: 0x4000, 0x1014: 0x4000, 0x1015: 0x4000, 0x1016: 0x4000, 0x1017: 0x4000, - 0x1018: 0x4000, 0x1019: 0x4000, 0x101a: 0x4000, 0x101b: 0x4000, 0x101c: 0x4000, 0x101d: 0x4000, - 0x101e: 0x4000, 0x101f: 0x4000, 0x1020: 0x4000, 0x1021: 0x4000, 0x1022: 0x4000, 0x1023: 0x4000, - // Block 0x41, offset 0x1040 - 0x1040: 0x2000, 0x1041: 0x2000, 0x1042: 0x2000, 0x1043: 0x2000, 0x1044: 0x2000, 0x1045: 0x2000, - 0x1046: 0x2000, 0x1047: 0x2000, 0x1048: 0x2000, 0x1049: 0x2000, 0x104a: 0x2000, 0x104b: 0x2000, - 0x104c: 0x2000, 0x104d: 0x2000, 0x104e: 0x2000, 0x104f: 0x2000, 0x1050: 0x4000, 0x1051: 0x4000, - 0x1052: 0x4000, 0x1053: 0x4000, 0x1054: 0x4000, 0x1055: 0x4000, 0x1056: 0x4000, 0x1057: 0x4000, - 0x1058: 0x4000, 0x1059: 0x4000, - 0x1070: 0x4000, 0x1071: 0x4000, 0x1072: 0x4000, 0x1073: 0x4000, 0x1074: 0x4000, 0x1075: 0x4000, - 0x1076: 0x4000, 0x1077: 0x4000, 0x1078: 0x4000, 0x1079: 0x4000, 0x107a: 0x4000, 0x107b: 0x4000, - 0x107c: 0x4000, 0x107d: 0x4000, 0x107e: 0x4000, 0x107f: 0x4000, - // Block 0x42, offset 0x1080 - 0x1080: 0x4000, 0x1081: 0x4000, 0x1082: 0x4000, 0x1083: 0x4000, 0x1084: 0x4000, 0x1085: 0x4000, - 0x1086: 0x4000, 0x1087: 0x4000, 0x1088: 0x4000, 0x1089: 0x4000, 0x108a: 0x4000, 0x108b: 0x4000, - 0x108c: 0x4000, 0x108d: 0x4000, 0x108e: 0x4000, 0x108f: 0x4000, 0x1090: 0x4000, 0x1091: 0x4000, - 0x1092: 0x4000, 0x1094: 0x4000, 0x1095: 0x4000, 0x1096: 0x4000, 0x1097: 0x4000, - 0x1098: 0x4000, 0x1099: 0x4000, 0x109a: 0x4000, 0x109b: 0x4000, 0x109c: 0x4000, 0x109d: 0x4000, - 0x109e: 0x4000, 0x109f: 0x4000, 0x10a0: 0x4000, 0x10a1: 0x4000, 0x10a2: 0x4000, 0x10a3: 0x4000, - 0x10a4: 0x4000, 0x10a5: 0x4000, 0x10a6: 0x4000, 0x10a8: 0x4000, 0x10a9: 0x4000, - 0x10aa: 0x4000, 0x10ab: 0x4000, - // Block 0x43, offset 0x10c0 - 0x10c1: 0x9012, 0x10c2: 0x9012, 0x10c3: 0x9012, 0x10c4: 0x9012, 0x10c5: 0x9012, - 0x10c6: 0x9012, 0x10c7: 0x9012, 0x10c8: 0x9012, 0x10c9: 0x9012, 0x10ca: 0x9012, 0x10cb: 0x9012, - 0x10cc: 0x9012, 0x10cd: 0x9012, 0x10ce: 0x9012, 0x10cf: 0x9012, 0x10d0: 0x9012, 0x10d1: 0x9012, - 0x10d2: 0x9012, 0x10d3: 0x9012, 0x10d4: 0x9012, 0x10d5: 0x9012, 0x10d6: 0x9012, 0x10d7: 0x9012, - 0x10d8: 0x9012, 0x10d9: 0x9012, 0x10da: 0x9012, 0x10db: 0x9012, 0x10dc: 0x9012, 0x10dd: 0x9012, - 0x10de: 0x9012, 0x10df: 0x9012, 0x10e0: 0x9049, 0x10e1: 0x9049, 0x10e2: 0x9049, 0x10e3: 0x9049, - 0x10e4: 0x9049, 0x10e5: 0x9049, 0x10e6: 0x9049, 0x10e7: 0x9049, 0x10e8: 0x9049, 0x10e9: 0x9049, - 0x10ea: 0x9049, 0x10eb: 0x9049, 0x10ec: 0x9049, 0x10ed: 0x9049, 0x10ee: 0x9049, 0x10ef: 0x9049, - 0x10f0: 0x9049, 0x10f1: 0x9049, 0x10f2: 0x9049, 0x10f3: 0x9049, 0x10f4: 0x9049, 0x10f5: 0x9049, - 0x10f6: 0x9049, 0x10f7: 0x9049, 0x10f8: 0x9049, 0x10f9: 0x9049, 0x10fa: 0x9049, 0x10fb: 0x9049, - 0x10fc: 0x9049, 0x10fd: 0x9049, 0x10fe: 0x9049, 0x10ff: 0x9049, - // Block 0x44, offset 0x1100 - 0x1100: 0x9049, 0x1101: 0x9049, 0x1102: 0x9049, 0x1103: 0x9049, 0x1104: 0x9049, 0x1105: 0x9049, - 0x1106: 0x9049, 0x1107: 0x9049, 0x1108: 0x9049, 0x1109: 0x9049, 0x110a: 0x9049, 0x110b: 0x9049, - 0x110c: 0x9049, 0x110d: 0x9049, 0x110e: 0x9049, 0x110f: 0x9049, 0x1110: 0x9049, 0x1111: 0x9049, - 0x1112: 0x9049, 0x1113: 0x9049, 0x1114: 0x9049, 0x1115: 0x9049, 0x1116: 0x9049, 0x1117: 0x9049, - 0x1118: 0x9049, 0x1119: 0x9049, 0x111a: 0x9049, 0x111b: 0x9049, 0x111c: 0x9049, 0x111d: 0x9049, - 0x111e: 0x9049, 0x111f: 0x904a, 0x1120: 0x904b, 0x1121: 0xb04c, 0x1122: 0xb04d, 0x1123: 0xb04d, - 0x1124: 0xb04e, 0x1125: 0xb04f, 0x1126: 0xb050, 0x1127: 0xb051, 0x1128: 0xb052, 0x1129: 0xb053, - 0x112a: 0xb054, 0x112b: 0xb055, 0x112c: 0xb056, 0x112d: 0xb057, 0x112e: 0xb058, 0x112f: 0xb059, - 0x1130: 0xb05a, 0x1131: 0xb05b, 0x1132: 0xb05c, 0x1133: 0xb05d, 0x1134: 0xb05e, 0x1135: 0xb05f, - 0x1136: 0xb060, 0x1137: 0xb061, 0x1138: 0xb062, 0x1139: 0xb063, 0x113a: 0xb064, 0x113b: 0xb065, - 0x113c: 0xb052, 0x113d: 0xb066, 0x113e: 0xb067, 0x113f: 0xb055, - // Block 0x45, offset 0x1140 - 0x1140: 0xb068, 0x1141: 0xb069, 0x1142: 0xb06a, 0x1143: 0xb06b, 0x1144: 0xb05a, 0x1145: 0xb056, - 0x1146: 0xb06c, 0x1147: 0xb06d, 0x1148: 0xb06b, 0x1149: 0xb06e, 0x114a: 0xb06b, 0x114b: 0xb06f, - 0x114c: 0xb06f, 0x114d: 0xb070, 0x114e: 0xb070, 0x114f: 0xb071, 0x1150: 0xb056, 0x1151: 0xb072, - 0x1152: 0xb073, 0x1153: 0xb072, 0x1154: 0xb074, 0x1155: 0xb073, 0x1156: 0xb075, 0x1157: 0xb075, - 0x1158: 0xb076, 0x1159: 0xb076, 0x115a: 0xb077, 0x115b: 0xb077, 0x115c: 0xb073, 0x115d: 0xb078, - 0x115e: 0xb079, 0x115f: 0xb067, 0x1160: 0xb07a, 0x1161: 0xb07b, 0x1162: 0xb07b, 0x1163: 0xb07b, - 0x1164: 0xb07b, 0x1165: 0xb07b, 0x1166: 0xb07b, 0x1167: 0xb07b, 0x1168: 0xb07b, 0x1169: 0xb07b, - 0x116a: 0xb07b, 0x116b: 0xb07b, 0x116c: 0xb07b, 0x116d: 0xb07b, 0x116e: 0xb07b, 0x116f: 0xb07b, - 0x1170: 0xb07c, 0x1171: 0xb07c, 0x1172: 0xb07c, 0x1173: 0xb07c, 0x1174: 0xb07c, 0x1175: 0xb07c, - 0x1176: 0xb07c, 0x1177: 0xb07c, 0x1178: 0xb07c, 0x1179: 0xb07c, 0x117a: 0xb07c, 0x117b: 0xb07c, - 0x117c: 0xb07c, 0x117d: 0xb07c, 0x117e: 0xb07c, - // Block 0x46, offset 0x1180 - 0x1182: 0xb07d, 0x1183: 0xb07e, 0x1184: 0xb07f, 0x1185: 0xb080, - 0x1186: 0xb07f, 0x1187: 0xb07e, 0x118a: 0xb081, 0x118b: 0xb082, - 0x118c: 0xb083, 0x118d: 0xb07f, 0x118e: 0xb080, 0x118f: 0xb07f, - 0x1192: 0xb084, 0x1193: 0xb085, 0x1194: 0xb084, 0x1195: 0xb086, 0x1196: 0xb084, 0x1197: 0xb087, - 0x119a: 0xb088, 0x119b: 0xb089, 0x119c: 0xb08a, - 0x11a0: 0x908b, 0x11a1: 0x908b, 0x11a2: 0x908c, 0x11a3: 0x908d, - 0x11a4: 0x908b, 0x11a5: 0x908e, 0x11a6: 0x908f, 0x11a8: 0xb090, 0x11a9: 0xb091, - 0x11aa: 0xb092, 0x11ab: 0xb091, 0x11ac: 0xb093, 0x11ad: 0xb094, 0x11ae: 0xb095, - 0x11bd: 0x2000, - // Block 0x47, offset 0x11c0 - 0x11e0: 0x4000, 0x11e1: 0x4000, - // Block 0x48, offset 0x1200 - 0x1200: 0x4000, 0x1201: 0x4000, 0x1202: 0x4000, 0x1203: 0x4000, 0x1204: 0x4000, 0x1205: 0x4000, - 0x1206: 0x4000, 0x1207: 0x4000, 0x1208: 0x4000, 0x1209: 0x4000, 0x120a: 0x4000, 0x120b: 0x4000, - 0x120c: 0x4000, 0x120d: 0x4000, 0x120e: 0x4000, 0x120f: 0x4000, 0x1210: 0x4000, 0x1211: 0x4000, - 0x1212: 0x4000, 0x1213: 0x4000, 0x1214: 0x4000, 0x1215: 0x4000, 0x1216: 0x4000, 0x1217: 0x4000, - 0x1218: 0x4000, 0x1219: 0x4000, 0x121a: 0x4000, 0x121b: 0x4000, 0x121c: 0x4000, 0x121d: 0x4000, - 0x121e: 0x4000, 0x121f: 0x4000, 0x1220: 0x4000, 0x1221: 0x4000, 0x1222: 0x4000, 0x1223: 0x4000, - 0x1224: 0x4000, 0x1225: 0x4000, 0x1226: 0x4000, 0x1227: 0x4000, 0x1228: 0x4000, 0x1229: 0x4000, - 0x122a: 0x4000, 0x122b: 0x4000, 0x122c: 0x4000, 0x122d: 0x4000, 0x122e: 0x4000, 0x122f: 0x4000, - 0x1230: 0x4000, 0x1231: 0x4000, - // Block 0x49, offset 0x1240 - 0x1240: 0x4000, 0x1241: 0x4000, 0x1242: 0x4000, 0x1243: 0x4000, 0x1244: 0x4000, 0x1245: 0x4000, - 0x1246: 0x4000, 0x1247: 0x4000, 0x1248: 0x4000, 0x1249: 0x4000, 0x124a: 0x4000, 0x124b: 0x4000, - 0x124c: 0x4000, 0x124d: 0x4000, 0x124e: 0x4000, 0x124f: 0x4000, 0x1250: 0x4000, 0x1251: 0x4000, - 0x1252: 0x4000, 0x1253: 0x4000, 0x1254: 0x4000, 0x1255: 0x4000, 0x1256: 0x4000, 0x1257: 0x4000, - 0x1258: 0x4000, 0x1259: 0x4000, 0x125a: 0x4000, 0x125b: 0x4000, 0x125c: 0x4000, 0x125d: 0x4000, - 0x125e: 0x4000, 0x125f: 0x4000, 0x1260: 0x4000, 0x1261: 0x4000, 0x1262: 0x4000, 0x1263: 0x4000, - 0x1264: 0x4000, 0x1265: 0x4000, 0x1266: 0x4000, 0x1267: 0x4000, 0x1268: 0x4000, 0x1269: 0x4000, - 0x126a: 0x4000, 0x126b: 0x4000, 0x126c: 0x4000, 0x126d: 0x4000, 0x126e: 0x4000, 0x126f: 0x4000, - 0x1270: 0x4000, 0x1271: 0x4000, 0x1272: 0x4000, - // Block 0x4a, offset 0x1280 - 0x1280: 0x4000, 0x1281: 0x4000, 0x1282: 0x4000, 0x1283: 0x4000, 0x1284: 0x4000, 0x1285: 0x4000, - 0x1286: 0x4000, 0x1287: 0x4000, 0x1288: 0x4000, 0x1289: 0x4000, 0x128a: 0x4000, 0x128b: 0x4000, - 0x128c: 0x4000, 0x128d: 0x4000, 0x128e: 0x4000, 0x128f: 0x4000, 0x1290: 0x4000, 0x1291: 0x4000, - 0x1292: 0x4000, 0x1293: 0x4000, 0x1294: 0x4000, 0x1295: 0x4000, 0x1296: 0x4000, 0x1297: 0x4000, - 0x1298: 0x4000, 0x1299: 0x4000, 0x129a: 0x4000, 0x129b: 0x4000, 0x129c: 0x4000, 0x129d: 0x4000, - 0x129e: 0x4000, - // Block 0x4b, offset 0x12c0 - 0x12f0: 0x4000, 0x12f1: 0x4000, 0x12f2: 0x4000, 0x12f3: 0x4000, 0x12f4: 0x4000, 0x12f5: 0x4000, - 0x12f6: 0x4000, 0x12f7: 0x4000, 0x12f8: 0x4000, 0x12f9: 0x4000, 0x12fa: 0x4000, 0x12fb: 0x4000, - 0x12fc: 0x4000, 0x12fd: 0x4000, 0x12fe: 0x4000, 0x12ff: 0x4000, - // Block 0x4c, offset 0x1300 - 0x1300: 0x4000, 0x1301: 0x4000, 0x1302: 0x4000, 0x1303: 0x4000, 0x1304: 0x4000, 0x1305: 0x4000, - 0x1306: 0x4000, 0x1307: 0x4000, 0x1308: 0x4000, 0x1309: 0x4000, 0x130a: 0x4000, 0x130b: 0x4000, - 0x130c: 0x4000, 0x130d: 0x4000, 0x130e: 0x4000, 0x130f: 0x4000, 0x1310: 0x4000, 0x1311: 0x4000, - 0x1312: 0x4000, 0x1313: 0x4000, 0x1314: 0x4000, 0x1315: 0x4000, 0x1316: 0x4000, 0x1317: 0x4000, - 0x1318: 0x4000, 0x1319: 0x4000, 0x131a: 0x4000, 0x131b: 0x4000, 0x131c: 0x4000, 0x131d: 0x4000, - 0x131e: 0x4000, 0x131f: 0x4000, 0x1320: 0x4000, 0x1321: 0x4000, 0x1322: 0x4000, 0x1323: 0x4000, - 0x1324: 0x4000, 0x1325: 0x4000, 0x1326: 0x4000, 0x1327: 0x4000, 0x1328: 0x4000, 0x1329: 0x4000, - 0x132a: 0x4000, 0x132b: 0x4000, 0x132c: 0x4000, 0x132d: 0x4000, 0x132e: 0x4000, 0x132f: 0x4000, - 0x1330: 0x4000, 0x1331: 0x4000, 0x1332: 0x4000, 0x1333: 0x4000, 0x1334: 0x4000, 0x1335: 0x4000, - 0x1336: 0x4000, 0x1337: 0x4000, 0x1338: 0x4000, 0x1339: 0x4000, 0x133a: 0x4000, 0x133b: 0x4000, - // Block 0x4d, offset 0x1340 - 0x1344: 0x4000, - // Block 0x4e, offset 0x1380 - 0x138f: 0x4000, - // Block 0x4f, offset 0x13c0 - 0x13c0: 0x2000, 0x13c1: 0x2000, 0x13c2: 0x2000, 0x13c3: 0x2000, 0x13c4: 0x2000, 0x13c5: 0x2000, - 0x13c6: 0x2000, 0x13c7: 0x2000, 0x13c8: 0x2000, 0x13c9: 0x2000, 0x13ca: 0x2000, - 0x13d0: 0x2000, 0x13d1: 0x2000, - 0x13d2: 0x2000, 0x13d3: 0x2000, 0x13d4: 0x2000, 0x13d5: 0x2000, 0x13d6: 0x2000, 0x13d7: 0x2000, - 0x13d8: 0x2000, 0x13d9: 0x2000, 0x13da: 0x2000, 0x13db: 0x2000, 0x13dc: 0x2000, 0x13dd: 0x2000, - 0x13de: 0x2000, 0x13df: 0x2000, 0x13e0: 0x2000, 0x13e1: 0x2000, 0x13e2: 0x2000, 0x13e3: 0x2000, - 0x13e4: 0x2000, 0x13e5: 0x2000, 0x13e6: 0x2000, 0x13e7: 0x2000, 0x13e8: 0x2000, 0x13e9: 0x2000, - 0x13ea: 0x2000, 0x13eb: 0x2000, 0x13ec: 0x2000, 0x13ed: 0x2000, - 0x13f0: 0x2000, 0x13f1: 0x2000, 0x13f2: 0x2000, 0x13f3: 0x2000, 0x13f4: 0x2000, 0x13f5: 0x2000, - 0x13f6: 0x2000, 0x13f7: 0x2000, 0x13f8: 0x2000, 0x13f9: 0x2000, 0x13fa: 0x2000, 0x13fb: 0x2000, - 0x13fc: 0x2000, 0x13fd: 0x2000, 0x13fe: 0x2000, 0x13ff: 0x2000, - // Block 0x50, offset 0x1400 - 0x1400: 0x2000, 0x1401: 0x2000, 0x1402: 0x2000, 0x1403: 0x2000, 0x1404: 0x2000, 0x1405: 0x2000, - 0x1406: 0x2000, 0x1407: 0x2000, 0x1408: 0x2000, 0x1409: 0x2000, 0x140a: 0x2000, 0x140b: 0x2000, - 0x140c: 0x2000, 0x140d: 0x2000, 0x140e: 0x2000, 0x140f: 0x2000, 0x1410: 0x2000, 0x1411: 0x2000, - 0x1412: 0x2000, 0x1413: 0x2000, 0x1414: 0x2000, 0x1415: 0x2000, 0x1416: 0x2000, 0x1417: 0x2000, - 0x1418: 0x2000, 0x1419: 0x2000, 0x141a: 0x2000, 0x141b: 0x2000, 0x141c: 0x2000, 0x141d: 0x2000, - 0x141e: 0x2000, 0x141f: 0x2000, 0x1420: 0x2000, 0x1421: 0x2000, 0x1422: 0x2000, 0x1423: 0x2000, - 0x1424: 0x2000, 0x1425: 0x2000, 0x1426: 0x2000, 0x1427: 0x2000, 0x1428: 0x2000, 0x1429: 0x2000, - 0x1430: 0x2000, 0x1431: 0x2000, 0x1432: 0x2000, 0x1433: 0x2000, 0x1434: 0x2000, 0x1435: 0x2000, - 0x1436: 0x2000, 0x1437: 0x2000, 0x1438: 0x2000, 0x1439: 0x2000, 0x143a: 0x2000, 0x143b: 0x2000, - 0x143c: 0x2000, 0x143d: 0x2000, 0x143e: 0x2000, 0x143f: 0x2000, - // Block 0x51, offset 0x1440 - 0x1440: 0x2000, 0x1441: 0x2000, 0x1442: 0x2000, 0x1443: 0x2000, 0x1444: 0x2000, 0x1445: 0x2000, - 0x1446: 0x2000, 0x1447: 0x2000, 0x1448: 0x2000, 0x1449: 0x2000, 0x144a: 0x2000, 0x144b: 0x2000, - 0x144c: 0x2000, 0x144d: 0x2000, 0x144e: 0x4000, 0x144f: 0x2000, 0x1450: 0x2000, 0x1451: 0x4000, - 0x1452: 0x4000, 0x1453: 0x4000, 0x1454: 0x4000, 0x1455: 0x4000, 0x1456: 0x4000, 0x1457: 0x4000, - 0x1458: 0x4000, 0x1459: 0x4000, 0x145a: 0x4000, 0x145b: 0x2000, 0x145c: 0x2000, 0x145d: 0x2000, - 0x145e: 0x2000, 0x145f: 0x2000, 0x1460: 0x2000, 0x1461: 0x2000, 0x1462: 0x2000, 0x1463: 0x2000, - 0x1464: 0x2000, 0x1465: 0x2000, 0x1466: 0x2000, 0x1467: 0x2000, 0x1468: 0x2000, 0x1469: 0x2000, - 0x146a: 0x2000, 0x146b: 0x2000, 0x146c: 0x2000, - // Block 0x52, offset 0x1480 - 0x1480: 0x4000, 0x1481: 0x4000, 0x1482: 0x4000, - 0x1490: 0x4000, 0x1491: 0x4000, - 0x1492: 0x4000, 0x1493: 0x4000, 0x1494: 0x4000, 0x1495: 0x4000, 0x1496: 0x4000, 0x1497: 0x4000, - 0x1498: 0x4000, 0x1499: 0x4000, 0x149a: 0x4000, 0x149b: 0x4000, 0x149c: 0x4000, 0x149d: 0x4000, - 0x149e: 0x4000, 0x149f: 0x4000, 0x14a0: 0x4000, 0x14a1: 0x4000, 0x14a2: 0x4000, 0x14a3: 0x4000, - 0x14a4: 0x4000, 0x14a5: 0x4000, 0x14a6: 0x4000, 0x14a7: 0x4000, 0x14a8: 0x4000, 0x14a9: 0x4000, - 0x14aa: 0x4000, 0x14ab: 0x4000, 0x14ac: 0x4000, 0x14ad: 0x4000, 0x14ae: 0x4000, 0x14af: 0x4000, - 0x14b0: 0x4000, 0x14b1: 0x4000, 0x14b2: 0x4000, 0x14b3: 0x4000, 0x14b4: 0x4000, 0x14b5: 0x4000, - 0x14b6: 0x4000, 0x14b7: 0x4000, 0x14b8: 0x4000, 0x14b9: 0x4000, 0x14ba: 0x4000, 0x14bb: 0x4000, - // Block 0x53, offset 0x14c0 - 0x14c0: 0x4000, 0x14c1: 0x4000, 0x14c2: 0x4000, 0x14c3: 0x4000, 0x14c4: 0x4000, 0x14c5: 0x4000, - 0x14c6: 0x4000, 0x14c7: 0x4000, 0x14c8: 0x4000, - 0x14d0: 0x4000, 0x14d1: 0x4000, - 0x14e0: 0x4000, 0x14e1: 0x4000, 0x14e2: 0x4000, 0x14e3: 0x4000, - 0x14e4: 0x4000, 0x14e5: 0x4000, - // Block 0x54, offset 0x1500 - 0x1500: 0x4000, 0x1501: 0x4000, 0x1502: 0x4000, 0x1503: 0x4000, 0x1504: 0x4000, 0x1505: 0x4000, - 0x1506: 0x4000, 0x1507: 0x4000, 0x1508: 0x4000, 0x1509: 0x4000, 0x150a: 0x4000, 0x150b: 0x4000, - 0x150c: 0x4000, 0x150d: 0x4000, 0x150e: 0x4000, 0x150f: 0x4000, 0x1510: 0x4000, 0x1511: 0x4000, - 0x1512: 0x4000, 0x1513: 0x4000, 0x1514: 0x4000, 0x1515: 0x4000, 0x1516: 0x4000, 0x1517: 0x4000, - 0x1518: 0x4000, 0x1519: 0x4000, 0x151a: 0x4000, 0x151b: 0x4000, 0x151c: 0x4000, 0x151d: 0x4000, - 0x151e: 0x4000, 0x151f: 0x4000, 0x1520: 0x4000, - 0x152d: 0x4000, 0x152e: 0x4000, 0x152f: 0x4000, - 0x1530: 0x4000, 0x1531: 0x4000, 0x1532: 0x4000, 0x1533: 0x4000, 0x1534: 0x4000, 0x1535: 0x4000, - 0x1537: 0x4000, 0x1538: 0x4000, 0x1539: 0x4000, 0x153a: 0x4000, 0x153b: 0x4000, - 0x153c: 0x4000, 0x153d: 0x4000, 0x153e: 0x4000, 0x153f: 0x4000, - // Block 0x55, offset 0x1540 - 0x1540: 0x4000, 0x1541: 0x4000, 0x1542: 0x4000, 0x1543: 0x4000, 0x1544: 0x4000, 0x1545: 0x4000, - 0x1546: 0x4000, 0x1547: 0x4000, 0x1548: 0x4000, 0x1549: 0x4000, 0x154a: 0x4000, 0x154b: 0x4000, - 0x154c: 0x4000, 0x154d: 0x4000, 0x154e: 0x4000, 0x154f: 0x4000, 0x1550: 0x4000, 0x1551: 0x4000, - 0x1552: 0x4000, 0x1553: 0x4000, 0x1554: 0x4000, 0x1555: 0x4000, 0x1556: 0x4000, 0x1557: 0x4000, - 0x1558: 0x4000, 0x1559: 0x4000, 0x155a: 0x4000, 0x155b: 0x4000, 0x155c: 0x4000, 0x155d: 0x4000, - 0x155e: 0x4000, 0x155f: 0x4000, 0x1560: 0x4000, 0x1561: 0x4000, 0x1562: 0x4000, 0x1563: 0x4000, - 0x1564: 0x4000, 0x1565: 0x4000, 0x1566: 0x4000, 0x1567: 0x4000, 0x1568: 0x4000, 0x1569: 0x4000, - 0x156a: 0x4000, 0x156b: 0x4000, 0x156c: 0x4000, 0x156d: 0x4000, 0x156e: 0x4000, 0x156f: 0x4000, - 0x1570: 0x4000, 0x1571: 0x4000, 0x1572: 0x4000, 0x1573: 0x4000, 0x1574: 0x4000, 0x1575: 0x4000, - 0x1576: 0x4000, 0x1577: 0x4000, 0x1578: 0x4000, 0x1579: 0x4000, 0x157a: 0x4000, 0x157b: 0x4000, - 0x157c: 0x4000, 0x157e: 0x4000, 0x157f: 0x4000, - // Block 0x56, offset 0x1580 - 0x1580: 0x4000, 0x1581: 0x4000, 0x1582: 0x4000, 0x1583: 0x4000, 0x1584: 0x4000, 0x1585: 0x4000, - 0x1586: 0x4000, 0x1587: 0x4000, 0x1588: 0x4000, 0x1589: 0x4000, 0x158a: 0x4000, 0x158b: 0x4000, - 0x158c: 0x4000, 0x158d: 0x4000, 0x158e: 0x4000, 0x158f: 0x4000, 0x1590: 0x4000, 0x1591: 0x4000, - 0x1592: 0x4000, 0x1593: 0x4000, - 0x15a0: 0x4000, 0x15a1: 0x4000, 0x15a2: 0x4000, 0x15a3: 0x4000, - 0x15a4: 0x4000, 0x15a5: 0x4000, 0x15a6: 0x4000, 0x15a7: 0x4000, 0x15a8: 0x4000, 0x15a9: 0x4000, - 0x15aa: 0x4000, 0x15ab: 0x4000, 0x15ac: 0x4000, 0x15ad: 0x4000, 0x15ae: 0x4000, 0x15af: 0x4000, - 0x15b0: 0x4000, 0x15b1: 0x4000, 0x15b2: 0x4000, 0x15b3: 0x4000, 0x15b4: 0x4000, 0x15b5: 0x4000, - 0x15b6: 0x4000, 0x15b7: 0x4000, 0x15b8: 0x4000, 0x15b9: 0x4000, 0x15ba: 0x4000, 0x15bb: 0x4000, - 0x15bc: 0x4000, 0x15bd: 0x4000, 0x15be: 0x4000, 0x15bf: 0x4000, - // Block 0x57, offset 0x15c0 - 0x15c0: 0x4000, 0x15c1: 0x4000, 0x15c2: 0x4000, 0x15c3: 0x4000, 0x15c4: 0x4000, 0x15c5: 0x4000, - 0x15c6: 0x4000, 0x15c7: 0x4000, 0x15c8: 0x4000, 0x15c9: 0x4000, 0x15ca: 0x4000, - 0x15cf: 0x4000, 0x15d0: 0x4000, 0x15d1: 0x4000, - 0x15d2: 0x4000, 0x15d3: 0x4000, - 0x15e0: 0x4000, 0x15e1: 0x4000, 0x15e2: 0x4000, 0x15e3: 0x4000, - 0x15e4: 0x4000, 0x15e5: 0x4000, 0x15e6: 0x4000, 0x15e7: 0x4000, 0x15e8: 0x4000, 0x15e9: 0x4000, - 0x15ea: 0x4000, 0x15eb: 0x4000, 0x15ec: 0x4000, 0x15ed: 0x4000, 0x15ee: 0x4000, 0x15ef: 0x4000, - 0x15f0: 0x4000, 0x15f4: 0x4000, - 0x15f8: 0x4000, 0x15f9: 0x4000, 0x15fa: 0x4000, 0x15fb: 0x4000, - 0x15fc: 0x4000, 0x15fd: 0x4000, 0x15fe: 0x4000, 0x15ff: 0x4000, - // Block 0x58, offset 0x1600 - 0x1600: 0x4000, 0x1602: 0x4000, 0x1603: 0x4000, 0x1604: 0x4000, 0x1605: 0x4000, - 0x1606: 0x4000, 0x1607: 0x4000, 0x1608: 0x4000, 0x1609: 0x4000, 0x160a: 0x4000, 0x160b: 0x4000, - 0x160c: 0x4000, 0x160d: 0x4000, 0x160e: 0x4000, 0x160f: 0x4000, 0x1610: 0x4000, 0x1611: 0x4000, - 0x1612: 0x4000, 0x1613: 0x4000, 0x1614: 0x4000, 0x1615: 0x4000, 0x1616: 0x4000, 0x1617: 0x4000, - 0x1618: 0x4000, 0x1619: 0x4000, 0x161a: 0x4000, 0x161b: 0x4000, 0x161c: 0x4000, 0x161d: 0x4000, - 0x161e: 0x4000, 0x161f: 0x4000, 0x1620: 0x4000, 0x1621: 0x4000, 0x1622: 0x4000, 0x1623: 0x4000, - 0x1624: 0x4000, 0x1625: 0x4000, 0x1626: 0x4000, 0x1627: 0x4000, 0x1628: 0x4000, 0x1629: 0x4000, - 0x162a: 0x4000, 0x162b: 0x4000, 0x162c: 0x4000, 0x162d: 0x4000, 0x162e: 0x4000, 0x162f: 0x4000, - 0x1630: 0x4000, 0x1631: 0x4000, 0x1632: 0x4000, 0x1633: 0x4000, 0x1634: 0x4000, 0x1635: 0x4000, - 0x1636: 0x4000, 0x1637: 0x4000, 0x1638: 0x4000, 0x1639: 0x4000, 0x163a: 0x4000, 0x163b: 0x4000, - 0x163c: 0x4000, 0x163d: 0x4000, 0x163e: 0x4000, 0x163f: 0x4000, - // Block 0x59, offset 0x1640 - 0x1640: 0x4000, 0x1641: 0x4000, 0x1642: 0x4000, 0x1643: 0x4000, 0x1644: 0x4000, 0x1645: 0x4000, - 0x1646: 0x4000, 0x1647: 0x4000, 0x1648: 0x4000, 0x1649: 0x4000, 0x164a: 0x4000, 0x164b: 0x4000, - 0x164c: 0x4000, 0x164d: 0x4000, 0x164e: 0x4000, 0x164f: 0x4000, 0x1650: 0x4000, 0x1651: 0x4000, - 0x1652: 0x4000, 0x1653: 0x4000, 0x1654: 0x4000, 0x1655: 0x4000, 0x1656: 0x4000, 0x1657: 0x4000, - 0x1658: 0x4000, 0x1659: 0x4000, 0x165a: 0x4000, 0x165b: 0x4000, 0x165c: 0x4000, 0x165d: 0x4000, - 0x165e: 0x4000, 0x165f: 0x4000, 0x1660: 0x4000, 0x1661: 0x4000, 0x1662: 0x4000, 0x1663: 0x4000, - 0x1664: 0x4000, 0x1665: 0x4000, 0x1666: 0x4000, 0x1667: 0x4000, 0x1668: 0x4000, 0x1669: 0x4000, - 0x166a: 0x4000, 0x166b: 0x4000, 0x166c: 0x4000, 0x166d: 0x4000, 0x166e: 0x4000, 0x166f: 0x4000, - 0x1670: 0x4000, 0x1671: 0x4000, 0x1672: 0x4000, 0x1673: 0x4000, 0x1674: 0x4000, 0x1675: 0x4000, - 0x1676: 0x4000, 0x1677: 0x4000, 0x1678: 0x4000, 0x1679: 0x4000, 0x167a: 0x4000, 0x167b: 0x4000, - 0x167c: 0x4000, 0x167f: 0x4000, - // Block 0x5a, offset 0x1680 - 0x1680: 0x4000, 0x1681: 0x4000, 0x1682: 0x4000, 0x1683: 0x4000, 0x1684: 0x4000, 0x1685: 0x4000, - 0x1686: 0x4000, 0x1687: 0x4000, 0x1688: 0x4000, 0x1689: 0x4000, 0x168a: 0x4000, 0x168b: 0x4000, - 0x168c: 0x4000, 0x168d: 0x4000, 0x168e: 0x4000, 0x168f: 0x4000, 0x1690: 0x4000, 0x1691: 0x4000, - 0x1692: 0x4000, 0x1693: 0x4000, 0x1694: 0x4000, 0x1695: 0x4000, 0x1696: 0x4000, 0x1697: 0x4000, - 0x1698: 0x4000, 0x1699: 0x4000, 0x169a: 0x4000, 0x169b: 0x4000, 0x169c: 0x4000, 0x169d: 0x4000, - 0x169e: 0x4000, 0x169f: 0x4000, 0x16a0: 0x4000, 0x16a1: 0x4000, 0x16a2: 0x4000, 0x16a3: 0x4000, - 0x16a4: 0x4000, 0x16a5: 0x4000, 0x16a6: 0x4000, 0x16a7: 0x4000, 0x16a8: 0x4000, 0x16a9: 0x4000, - 0x16aa: 0x4000, 0x16ab: 0x4000, 0x16ac: 0x4000, 0x16ad: 0x4000, 0x16ae: 0x4000, 0x16af: 0x4000, - 0x16b0: 0x4000, 0x16b1: 0x4000, 0x16b2: 0x4000, 0x16b3: 0x4000, 0x16b4: 0x4000, 0x16b5: 0x4000, - 0x16b6: 0x4000, 0x16b7: 0x4000, 0x16b8: 0x4000, 0x16b9: 0x4000, 0x16ba: 0x4000, 0x16bb: 0x4000, - 0x16bc: 0x4000, 0x16bd: 0x4000, - // Block 0x5b, offset 0x16c0 - 0x16cb: 0x4000, - 0x16cc: 0x4000, 0x16cd: 0x4000, 0x16ce: 0x4000, 0x16d0: 0x4000, 0x16d1: 0x4000, - 0x16d2: 0x4000, 0x16d3: 0x4000, 0x16d4: 0x4000, 0x16d5: 0x4000, 0x16d6: 0x4000, 0x16d7: 0x4000, - 0x16d8: 0x4000, 0x16d9: 0x4000, 0x16da: 0x4000, 0x16db: 0x4000, 0x16dc: 0x4000, 0x16dd: 0x4000, - 0x16de: 0x4000, 0x16df: 0x4000, 0x16e0: 0x4000, 0x16e1: 0x4000, 0x16e2: 0x4000, 0x16e3: 0x4000, - 0x16e4: 0x4000, 0x16e5: 0x4000, 0x16e6: 0x4000, 0x16e7: 0x4000, - 0x16fa: 0x4000, - // Block 0x5c, offset 0x1700 - 0x1715: 0x4000, 0x1716: 0x4000, - 0x1724: 0x4000, - // Block 0x5d, offset 0x1740 - 0x177b: 0x4000, - 0x177c: 0x4000, 0x177d: 0x4000, 0x177e: 0x4000, 0x177f: 0x4000, - // Block 0x5e, offset 0x1780 - 0x1780: 0x4000, 0x1781: 0x4000, 0x1782: 0x4000, 0x1783: 0x4000, 0x1784: 0x4000, 0x1785: 0x4000, - 0x1786: 0x4000, 0x1787: 0x4000, 0x1788: 0x4000, 0x1789: 0x4000, 0x178a: 0x4000, 0x178b: 0x4000, - 0x178c: 0x4000, 0x178d: 0x4000, 0x178e: 0x4000, 0x178f: 0x4000, - // Block 0x5f, offset 0x17c0 - 0x17c0: 0x4000, 0x17c1: 0x4000, 0x17c2: 0x4000, 0x17c3: 0x4000, 0x17c4: 0x4000, 0x17c5: 0x4000, - 0x17cc: 0x4000, 0x17d0: 0x4000, 0x17d1: 0x4000, - 0x17d2: 0x4000, - 0x17eb: 0x4000, 0x17ec: 0x4000, - 0x17f4: 0x4000, 0x17f5: 0x4000, - 0x17f6: 0x4000, 0x17f7: 0x4000, 0x17f8: 0x4000, 0x17f9: 0x4000, - // Block 0x60, offset 0x1800 - 0x1810: 0x4000, 0x1811: 0x4000, - 0x1812: 0x4000, 0x1813: 0x4000, 0x1814: 0x4000, 0x1815: 0x4000, 0x1816: 0x4000, 0x1817: 0x4000, - 0x1818: 0x4000, 0x1819: 0x4000, 0x181a: 0x4000, 0x181b: 0x4000, 0x181c: 0x4000, 0x181d: 0x4000, - 0x181e: 0x4000, 0x181f: 0x4000, 0x1820: 0x4000, 0x1821: 0x4000, 0x1822: 0x4000, 0x1823: 0x4000, - 0x1824: 0x4000, 0x1825: 0x4000, 0x1826: 0x4000, 0x1827: 0x4000, 0x1828: 0x4000, 0x1829: 0x4000, - 0x182a: 0x4000, 0x182b: 0x4000, 0x182c: 0x4000, 0x182d: 0x4000, 0x182e: 0x4000, 0x182f: 0x4000, - 0x1830: 0x4000, 0x1831: 0x4000, 0x1832: 0x4000, 0x1833: 0x4000, 0x1834: 0x4000, 0x1835: 0x4000, - 0x1836: 0x4000, 0x1837: 0x4000, 0x1838: 0x4000, 0x1839: 0x4000, 0x183a: 0x4000, 0x183b: 0x4000, - 0x183c: 0x4000, 0x183d: 0x4000, 0x183e: 0x4000, - // Block 0x61, offset 0x1840 - 0x1840: 0x4000, 0x1841: 0x4000, 0x1842: 0x4000, 0x1843: 0x4000, 0x1844: 0x4000, 0x1845: 0x4000, - 0x1846: 0x4000, 0x1847: 0x4000, 0x1848: 0x4000, 0x1849: 0x4000, 0x184a: 0x4000, 0x184b: 0x4000, - 0x184c: 0x4000, 0x184d: 0x4000, 0x184e: 0x4000, 0x184f: 0x4000, 0x1850: 0x4000, 0x1851: 0x4000, - 0x1852: 0x4000, 0x1853: 0x4000, 0x1854: 0x4000, 0x1855: 0x4000, 0x1856: 0x4000, 0x1857: 0x4000, - 0x1858: 0x4000, 0x1859: 0x4000, 0x185a: 0x4000, 0x185b: 0x4000, 0x185c: 0x4000, 0x185d: 0x4000, - 0x185e: 0x4000, 0x185f: 0x4000, 0x1860: 0x4000, 0x1861: 0x4000, 0x1862: 0x4000, 0x1863: 0x4000, - 0x1864: 0x4000, 0x1865: 0x4000, 0x1866: 0x4000, 0x1867: 0x4000, 0x1868: 0x4000, 0x1869: 0x4000, - 0x186a: 0x4000, 0x186b: 0x4000, 0x186c: 0x4000, 0x186d: 0x4000, 0x186e: 0x4000, 0x186f: 0x4000, - 0x1870: 0x4000, 0x1873: 0x4000, 0x1874: 0x4000, 0x1875: 0x4000, - 0x1876: 0x4000, 0x187a: 0x4000, - 0x187c: 0x4000, 0x187d: 0x4000, 0x187e: 0x4000, 0x187f: 0x4000, - // Block 0x62, offset 0x1880 - 0x1880: 0x4000, 0x1881: 0x4000, 0x1882: 0x4000, 0x1883: 0x4000, 0x1884: 0x4000, 0x1885: 0x4000, - 0x1886: 0x4000, 0x1887: 0x4000, 0x1888: 0x4000, 0x1889: 0x4000, 0x188a: 0x4000, 0x188b: 0x4000, - 0x188c: 0x4000, 0x188d: 0x4000, 0x188e: 0x4000, 0x188f: 0x4000, 0x1890: 0x4000, 0x1891: 0x4000, - 0x1892: 0x4000, 0x1893: 0x4000, 0x1894: 0x4000, 0x1895: 0x4000, 0x1896: 0x4000, 0x1897: 0x4000, - 0x1898: 0x4000, 0x1899: 0x4000, 0x189a: 0x4000, 0x189b: 0x4000, 0x189c: 0x4000, 0x189d: 0x4000, - 0x189e: 0x4000, 0x189f: 0x4000, 0x18a0: 0x4000, 0x18a1: 0x4000, 0x18a2: 0x4000, - 0x18b0: 0x4000, 0x18b1: 0x4000, 0x18b2: 0x4000, 0x18b3: 0x4000, 0x18b4: 0x4000, 0x18b5: 0x4000, - 0x18b6: 0x4000, 0x18b7: 0x4000, 0x18b8: 0x4000, 0x18b9: 0x4000, - // Block 0x63, offset 0x18c0 - 0x18c0: 0x4000, 0x18c1: 0x4000, 0x18c2: 0x4000, - 0x18d0: 0x4000, 0x18d1: 0x4000, - 0x18d2: 0x4000, 0x18d3: 0x4000, 0x18d4: 0x4000, 0x18d5: 0x4000, 0x18d6: 0x4000, 0x18d7: 0x4000, - 0x18d8: 0x4000, 0x18d9: 0x4000, 0x18da: 0x4000, 0x18db: 0x4000, 0x18dc: 0x4000, 0x18dd: 0x4000, - 0x18de: 0x4000, 0x18df: 0x4000, 0x18e0: 0x4000, 0x18e1: 0x4000, 0x18e2: 0x4000, 0x18e3: 0x4000, - 0x18e4: 0x4000, 0x18e5: 0x4000, 0x18e6: 0x4000, 0x18e7: 0x4000, 0x18e8: 0x4000, 0x18e9: 0x4000, - 0x18ea: 0x4000, 0x18eb: 0x4000, 0x18ec: 0x4000, 0x18ed: 0x4000, 0x18ee: 0x4000, 0x18ef: 0x4000, - 0x18f0: 0x4000, 0x18f1: 0x4000, 0x18f2: 0x4000, 0x18f3: 0x4000, 0x18f4: 0x4000, 0x18f5: 0x4000, - 0x18f6: 0x4000, 0x18f7: 0x4000, 0x18f8: 0x4000, 0x18f9: 0x4000, 0x18fa: 0x4000, 0x18fb: 0x4000, - 0x18fc: 0x4000, 0x18fd: 0x4000, 0x18fe: 0x4000, 0x18ff: 0x4000, - // Block 0x64, offset 0x1900 - 0x1900: 0x2000, 0x1901: 0x2000, 0x1902: 0x2000, 0x1903: 0x2000, 0x1904: 0x2000, 0x1905: 0x2000, - 0x1906: 0x2000, 0x1907: 0x2000, 0x1908: 0x2000, 0x1909: 0x2000, 0x190a: 0x2000, 0x190b: 0x2000, - 0x190c: 0x2000, 0x190d: 0x2000, 0x190e: 0x2000, 0x190f: 0x2000, 0x1910: 0x2000, 0x1911: 0x2000, - 0x1912: 0x2000, 0x1913: 0x2000, 0x1914: 0x2000, 0x1915: 0x2000, 0x1916: 0x2000, 0x1917: 0x2000, - 0x1918: 0x2000, 0x1919: 0x2000, 0x191a: 0x2000, 0x191b: 0x2000, 0x191c: 0x2000, 0x191d: 0x2000, - 0x191e: 0x2000, 0x191f: 0x2000, 0x1920: 0x2000, 0x1921: 0x2000, 0x1922: 0x2000, 0x1923: 0x2000, - 0x1924: 0x2000, 0x1925: 0x2000, 0x1926: 0x2000, 0x1927: 0x2000, 0x1928: 0x2000, 0x1929: 0x2000, - 0x192a: 0x2000, 0x192b: 0x2000, 0x192c: 0x2000, 0x192d: 0x2000, 0x192e: 0x2000, 0x192f: 0x2000, - 0x1930: 0x2000, 0x1931: 0x2000, 0x1932: 0x2000, 0x1933: 0x2000, 0x1934: 0x2000, 0x1935: 0x2000, - 0x1936: 0x2000, 0x1937: 0x2000, 0x1938: 0x2000, 0x1939: 0x2000, 0x193a: 0x2000, 0x193b: 0x2000, - 0x193c: 0x2000, 0x193d: 0x2000, -} - -// widthIndex: 22 blocks, 1408 entries, 1408 bytes -// Block 0 is the zero block. -var widthIndex = [1408]uint8{ - // Block 0x0, offset 0x0 - // Block 0x1, offset 0x40 - // Block 0x2, offset 0x80 - // Block 0x3, offset 0xc0 - 0xc2: 0x01, 0xc3: 0x02, 0xc4: 0x03, 0xc5: 0x04, 0xc7: 0x05, - 0xc9: 0x06, 0xcb: 0x07, 0xcc: 0x08, 0xcd: 0x09, 0xce: 0x0a, 0xcf: 0x0b, - 0xd0: 0x0c, 0xd1: 0x0d, - 0xe1: 0x02, 0xe2: 0x03, 0xe3: 0x04, 0xe4: 0x05, 0xe5: 0x06, 0xe6: 0x06, 0xe7: 0x06, - 0xe8: 0x06, 0xe9: 0x06, 0xea: 0x07, 0xeb: 0x06, 0xec: 0x06, 0xed: 0x08, 0xee: 0x09, 0xef: 0x0a, - 0xf0: 0x0f, 0xf3: 0x12, 0xf4: 0x13, - // Block 0x4, offset 0x100 - 0x104: 0x0e, 0x105: 0x0f, - // Block 0x5, offset 0x140 - 0x140: 0x10, 0x141: 0x11, 0x142: 0x12, 0x144: 0x13, 0x145: 0x14, 0x146: 0x15, 0x147: 0x16, - 0x148: 0x17, 0x149: 0x18, 0x14a: 0x19, 0x14c: 0x1a, 0x14f: 0x1b, - 0x151: 0x1c, 0x152: 0x08, 0x153: 0x1d, 0x154: 0x1e, 0x155: 0x1f, 0x156: 0x20, 0x157: 0x21, - 0x158: 0x22, 0x159: 0x23, 0x15a: 0x24, 0x15b: 0x25, 0x15c: 0x26, 0x15d: 0x27, 0x15e: 0x28, 0x15f: 0x29, - 0x166: 0x2a, - 0x16c: 0x2b, 0x16d: 0x2c, - 0x17a: 0x2d, 0x17b: 0x2e, 0x17c: 0x0e, 0x17d: 0x0e, 0x17e: 0x0e, 0x17f: 0x2f, - // Block 0x6, offset 0x180 - 0x180: 0x30, 0x181: 0x31, 0x182: 0x32, 0x183: 0x33, 0x184: 0x34, 0x185: 0x35, 0x186: 0x36, 0x187: 0x37, - 0x188: 0x38, 0x189: 0x39, 0x18a: 0x0e, 0x18b: 0x3a, 0x18c: 0x0e, 0x18d: 0x0e, 0x18e: 0x0e, 0x18f: 0x0e, - 0x190: 0x0e, 0x191: 0x0e, 0x192: 0x0e, 0x193: 0x0e, 0x194: 0x0e, 0x195: 0x0e, 0x196: 0x0e, 0x197: 0x0e, - 0x198: 0x0e, 0x199: 0x0e, 0x19a: 0x0e, 0x19b: 0x0e, 0x19c: 0x0e, 0x19d: 0x0e, 0x19e: 0x0e, 0x19f: 0x0e, - 0x1a0: 0x0e, 0x1a1: 0x0e, 0x1a2: 0x0e, 0x1a3: 0x0e, 0x1a4: 0x0e, 0x1a5: 0x0e, 0x1a6: 0x0e, 0x1a7: 0x0e, - 0x1a8: 0x0e, 0x1a9: 0x0e, 0x1aa: 0x0e, 0x1ab: 0x0e, 0x1ac: 0x0e, 0x1ad: 0x0e, 0x1ae: 0x0e, 0x1af: 0x0e, - 0x1b0: 0x0e, 0x1b1: 0x0e, 0x1b2: 0x0e, 0x1b3: 0x0e, 0x1b4: 0x0e, 0x1b5: 0x0e, 0x1b6: 0x0e, 0x1b7: 0x0e, - 0x1b8: 0x0e, 0x1b9: 0x0e, 0x1ba: 0x0e, 0x1bb: 0x0e, 0x1bc: 0x0e, 0x1bd: 0x0e, 0x1be: 0x0e, 0x1bf: 0x0e, - // Block 0x7, offset 0x1c0 - 0x1c0: 0x0e, 0x1c1: 0x0e, 0x1c2: 0x0e, 0x1c3: 0x0e, 0x1c4: 0x0e, 0x1c5: 0x0e, 0x1c6: 0x0e, 0x1c7: 0x0e, - 0x1c8: 0x0e, 0x1c9: 0x0e, 0x1ca: 0x0e, 0x1cb: 0x0e, 0x1cc: 0x0e, 0x1cd: 0x0e, 0x1ce: 0x0e, 0x1cf: 0x0e, - 0x1d0: 0x0e, 0x1d1: 0x0e, 0x1d2: 0x0e, 0x1d3: 0x0e, 0x1d4: 0x0e, 0x1d5: 0x0e, 0x1d6: 0x0e, 0x1d7: 0x0e, - 0x1d8: 0x0e, 0x1d9: 0x0e, 0x1da: 0x0e, 0x1db: 0x0e, 0x1dc: 0x0e, 0x1dd: 0x0e, 0x1de: 0x0e, 0x1df: 0x0e, - 0x1e0: 0x0e, 0x1e1: 0x0e, 0x1e2: 0x0e, 0x1e3: 0x0e, 0x1e4: 0x0e, 0x1e5: 0x0e, 0x1e6: 0x0e, 0x1e7: 0x0e, - 0x1e8: 0x0e, 0x1e9: 0x0e, 0x1ea: 0x0e, 0x1eb: 0x0e, 0x1ec: 0x0e, 0x1ed: 0x0e, 0x1ee: 0x0e, 0x1ef: 0x0e, - 0x1f0: 0x0e, 0x1f1: 0x0e, 0x1f2: 0x0e, 0x1f3: 0x0e, 0x1f4: 0x0e, 0x1f5: 0x0e, 0x1f6: 0x0e, - 0x1f8: 0x0e, 0x1f9: 0x0e, 0x1fa: 0x0e, 0x1fb: 0x0e, 0x1fc: 0x0e, 0x1fd: 0x0e, 0x1fe: 0x0e, 0x1ff: 0x0e, - // Block 0x8, offset 0x200 - 0x200: 0x0e, 0x201: 0x0e, 0x202: 0x0e, 0x203: 0x0e, 0x204: 0x0e, 0x205: 0x0e, 0x206: 0x0e, 0x207: 0x0e, - 0x208: 0x0e, 0x209: 0x0e, 0x20a: 0x0e, 0x20b: 0x0e, 0x20c: 0x0e, 0x20d: 0x0e, 0x20e: 0x0e, 0x20f: 0x0e, - 0x210: 0x0e, 0x211: 0x0e, 0x212: 0x0e, 0x213: 0x0e, 0x214: 0x0e, 0x215: 0x0e, 0x216: 0x0e, 0x217: 0x0e, - 0x218: 0x0e, 0x219: 0x0e, 0x21a: 0x0e, 0x21b: 0x0e, 0x21c: 0x0e, 0x21d: 0x0e, 0x21e: 0x0e, 0x21f: 0x0e, - 0x220: 0x0e, 0x221: 0x0e, 0x222: 0x0e, 0x223: 0x0e, 0x224: 0x0e, 0x225: 0x0e, 0x226: 0x0e, 0x227: 0x0e, - 0x228: 0x0e, 0x229: 0x0e, 0x22a: 0x0e, 0x22b: 0x0e, 0x22c: 0x0e, 0x22d: 0x0e, 0x22e: 0x0e, 0x22f: 0x0e, - 0x230: 0x0e, 0x231: 0x0e, 0x232: 0x0e, 0x233: 0x0e, 0x234: 0x0e, 0x235: 0x0e, 0x236: 0x0e, 0x237: 0x0e, - 0x238: 0x0e, 0x239: 0x0e, 0x23a: 0x0e, 0x23b: 0x0e, 0x23c: 0x0e, 0x23d: 0x0e, 0x23e: 0x0e, 0x23f: 0x0e, - // Block 0x9, offset 0x240 - 0x240: 0x0e, 0x241: 0x0e, 0x242: 0x0e, 0x243: 0x0e, 0x244: 0x0e, 0x245: 0x0e, 0x246: 0x0e, 0x247: 0x0e, - 0x248: 0x0e, 0x249: 0x0e, 0x24a: 0x0e, 0x24b: 0x0e, 0x24c: 0x0e, 0x24d: 0x0e, 0x24e: 0x0e, 0x24f: 0x0e, - 0x250: 0x0e, 0x251: 0x0e, 0x252: 0x3b, 0x253: 0x3c, - 0x265: 0x3d, - 0x270: 0x0e, 0x271: 0x0e, 0x272: 0x0e, 0x273: 0x0e, 0x274: 0x0e, 0x275: 0x0e, 0x276: 0x0e, 0x277: 0x0e, - 0x278: 0x0e, 0x279: 0x0e, 0x27a: 0x0e, 0x27b: 0x0e, 0x27c: 0x0e, 0x27d: 0x0e, 0x27e: 0x0e, 0x27f: 0x0e, - // Block 0xa, offset 0x280 - 0x280: 0x0e, 0x281: 0x0e, 0x282: 0x0e, 0x283: 0x0e, 0x284: 0x0e, 0x285: 0x0e, 0x286: 0x0e, 0x287: 0x0e, - 0x288: 0x0e, 0x289: 0x0e, 0x28a: 0x0e, 0x28b: 0x0e, 0x28c: 0x0e, 0x28d: 0x0e, 0x28e: 0x0e, 0x28f: 0x0e, - 0x290: 0x0e, 0x291: 0x0e, 0x292: 0x0e, 0x293: 0x0e, 0x294: 0x0e, 0x295: 0x0e, 0x296: 0x0e, 0x297: 0x0e, - 0x298: 0x0e, 0x299: 0x0e, 0x29a: 0x0e, 0x29b: 0x0e, 0x29c: 0x0e, 0x29d: 0x0e, 0x29e: 0x3e, - // Block 0xb, offset 0x2c0 - 0x2c0: 0x08, 0x2c1: 0x08, 0x2c2: 0x08, 0x2c3: 0x08, 0x2c4: 0x08, 0x2c5: 0x08, 0x2c6: 0x08, 0x2c7: 0x08, - 0x2c8: 0x08, 0x2c9: 0x08, 0x2ca: 0x08, 0x2cb: 0x08, 0x2cc: 0x08, 0x2cd: 0x08, 0x2ce: 0x08, 0x2cf: 0x08, - 0x2d0: 0x08, 0x2d1: 0x08, 0x2d2: 0x08, 0x2d3: 0x08, 0x2d4: 0x08, 0x2d5: 0x08, 0x2d6: 0x08, 0x2d7: 0x08, - 0x2d8: 0x08, 0x2d9: 0x08, 0x2da: 0x08, 0x2db: 0x08, 0x2dc: 0x08, 0x2dd: 0x08, 0x2de: 0x08, 0x2df: 0x08, - 0x2e0: 0x08, 0x2e1: 0x08, 0x2e2: 0x08, 0x2e3: 0x08, 0x2e4: 0x08, 0x2e5: 0x08, 0x2e6: 0x08, 0x2e7: 0x08, - 0x2e8: 0x08, 0x2e9: 0x08, 0x2ea: 0x08, 0x2eb: 0x08, 0x2ec: 0x08, 0x2ed: 0x08, 0x2ee: 0x08, 0x2ef: 0x08, - 0x2f0: 0x08, 0x2f1: 0x08, 0x2f2: 0x08, 0x2f3: 0x08, 0x2f4: 0x08, 0x2f5: 0x08, 0x2f6: 0x08, 0x2f7: 0x08, - 0x2f8: 0x08, 0x2f9: 0x08, 0x2fa: 0x08, 0x2fb: 0x08, 0x2fc: 0x08, 0x2fd: 0x08, 0x2fe: 0x08, 0x2ff: 0x08, - // Block 0xc, offset 0x300 - 0x300: 0x08, 0x301: 0x08, 0x302: 0x08, 0x303: 0x08, 0x304: 0x08, 0x305: 0x08, 0x306: 0x08, 0x307: 0x08, - 0x308: 0x08, 0x309: 0x08, 0x30a: 0x08, 0x30b: 0x08, 0x30c: 0x08, 0x30d: 0x08, 0x30e: 0x08, 0x30f: 0x08, - 0x310: 0x08, 0x311: 0x08, 0x312: 0x08, 0x313: 0x08, 0x314: 0x08, 0x315: 0x08, 0x316: 0x08, 0x317: 0x08, - 0x318: 0x08, 0x319: 0x08, 0x31a: 0x08, 0x31b: 0x08, 0x31c: 0x08, 0x31d: 0x08, 0x31e: 0x08, 0x31f: 0x08, - 0x320: 0x08, 0x321: 0x08, 0x322: 0x08, 0x323: 0x08, 0x324: 0x0e, 0x325: 0x0e, 0x326: 0x0e, 0x327: 0x0e, - 0x328: 0x0e, 0x329: 0x0e, 0x32a: 0x0e, 0x32b: 0x0e, - 0x338: 0x3f, 0x339: 0x40, 0x33c: 0x41, 0x33d: 0x42, 0x33e: 0x43, 0x33f: 0x44, - // Block 0xd, offset 0x340 - 0x37f: 0x45, - // Block 0xe, offset 0x380 - 0x380: 0x0e, 0x381: 0x0e, 0x382: 0x0e, 0x383: 0x0e, 0x384: 0x0e, 0x385: 0x0e, 0x386: 0x0e, 0x387: 0x0e, - 0x388: 0x0e, 0x389: 0x0e, 0x38a: 0x0e, 0x38b: 0x0e, 0x38c: 0x0e, 0x38d: 0x0e, 0x38e: 0x0e, 0x38f: 0x0e, - 0x390: 0x0e, 0x391: 0x0e, 0x392: 0x0e, 0x393: 0x0e, 0x394: 0x0e, 0x395: 0x0e, 0x396: 0x0e, 0x397: 0x0e, - 0x398: 0x0e, 0x399: 0x0e, 0x39a: 0x0e, 0x39b: 0x0e, 0x39c: 0x0e, 0x39d: 0x0e, 0x39e: 0x0e, 0x39f: 0x46, - 0x3a0: 0x0e, 0x3a1: 0x0e, 0x3a2: 0x0e, 0x3a3: 0x0e, 0x3a4: 0x0e, 0x3a5: 0x0e, 0x3a6: 0x0e, 0x3a7: 0x0e, - 0x3a8: 0x0e, 0x3a9: 0x0e, 0x3aa: 0x0e, 0x3ab: 0x47, - // Block 0xf, offset 0x3c0 - 0x3c0: 0x0e, 0x3c1: 0x0e, 0x3c2: 0x0e, 0x3c3: 0x0e, 0x3c4: 0x48, 0x3c5: 0x49, 0x3c6: 0x0e, 0x3c7: 0x0e, - 0x3c8: 0x0e, 0x3c9: 0x0e, 0x3ca: 0x0e, 0x3cb: 0x4a, - // Block 0x10, offset 0x400 - 0x400: 0x4b, 0x403: 0x4c, 0x404: 0x4d, 0x405: 0x4e, 0x406: 0x4f, - 0x408: 0x50, 0x409: 0x51, 0x40c: 0x52, 0x40d: 0x53, 0x40e: 0x54, 0x40f: 0x55, - 0x410: 0x3a, 0x411: 0x56, 0x412: 0x0e, 0x413: 0x57, 0x414: 0x58, 0x415: 0x59, 0x416: 0x5a, 0x417: 0x5b, - 0x418: 0x0e, 0x419: 0x5c, 0x41a: 0x0e, 0x41b: 0x5d, - 0x424: 0x5e, 0x425: 0x5f, 0x426: 0x60, 0x427: 0x61, - // Block 0x11, offset 0x440 - 0x456: 0x0b, 0x457: 0x06, - 0x458: 0x0c, 0x45b: 0x0d, 0x45f: 0x0e, - 0x460: 0x06, 0x461: 0x06, 0x462: 0x06, 0x463: 0x06, 0x464: 0x06, 0x465: 0x06, 0x466: 0x06, 0x467: 0x06, - 0x468: 0x06, 0x469: 0x06, 0x46a: 0x06, 0x46b: 0x06, 0x46c: 0x06, 0x46d: 0x06, 0x46e: 0x06, 0x46f: 0x06, - 0x470: 0x06, 0x471: 0x06, 0x472: 0x06, 0x473: 0x06, 0x474: 0x06, 0x475: 0x06, 0x476: 0x06, 0x477: 0x06, - 0x478: 0x06, 0x479: 0x06, 0x47a: 0x06, 0x47b: 0x06, 0x47c: 0x06, 0x47d: 0x06, 0x47e: 0x06, 0x47f: 0x06, - // Block 0x12, offset 0x480 - 0x484: 0x08, 0x485: 0x08, 0x486: 0x08, 0x487: 0x09, - // Block 0x13, offset 0x4c0 - 0x4c0: 0x08, 0x4c1: 0x08, 0x4c2: 0x08, 0x4c3: 0x08, 0x4c4: 0x08, 0x4c5: 0x08, 0x4c6: 0x08, 0x4c7: 0x08, - 0x4c8: 0x08, 0x4c9: 0x08, 0x4ca: 0x08, 0x4cb: 0x08, 0x4cc: 0x08, 0x4cd: 0x08, 0x4ce: 0x08, 0x4cf: 0x08, - 0x4d0: 0x08, 0x4d1: 0x08, 0x4d2: 0x08, 0x4d3: 0x08, 0x4d4: 0x08, 0x4d5: 0x08, 0x4d6: 0x08, 0x4d7: 0x08, - 0x4d8: 0x08, 0x4d9: 0x08, 0x4da: 0x08, 0x4db: 0x08, 0x4dc: 0x08, 0x4dd: 0x08, 0x4de: 0x08, 0x4df: 0x08, - 0x4e0: 0x08, 0x4e1: 0x08, 0x4e2: 0x08, 0x4e3: 0x08, 0x4e4: 0x08, 0x4e5: 0x08, 0x4e6: 0x08, 0x4e7: 0x08, - 0x4e8: 0x08, 0x4e9: 0x08, 0x4ea: 0x08, 0x4eb: 0x08, 0x4ec: 0x08, 0x4ed: 0x08, 0x4ee: 0x08, 0x4ef: 0x08, - 0x4f0: 0x08, 0x4f1: 0x08, 0x4f2: 0x08, 0x4f3: 0x08, 0x4f4: 0x08, 0x4f5: 0x08, 0x4f6: 0x08, 0x4f7: 0x08, - 0x4f8: 0x08, 0x4f9: 0x08, 0x4fa: 0x08, 0x4fb: 0x08, 0x4fc: 0x08, 0x4fd: 0x08, 0x4fe: 0x08, 0x4ff: 0x62, - // Block 0x14, offset 0x500 - 0x520: 0x10, - 0x530: 0x09, 0x531: 0x09, 0x532: 0x09, 0x533: 0x09, 0x534: 0x09, 0x535: 0x09, 0x536: 0x09, 0x537: 0x09, - 0x538: 0x09, 0x539: 0x09, 0x53a: 0x09, 0x53b: 0x09, 0x53c: 0x09, 0x53d: 0x09, 0x53e: 0x09, 0x53f: 0x11, - // Block 0x15, offset 0x540 - 0x540: 0x09, 0x541: 0x09, 0x542: 0x09, 0x543: 0x09, 0x544: 0x09, 0x545: 0x09, 0x546: 0x09, 0x547: 0x09, - 0x548: 0x09, 0x549: 0x09, 0x54a: 0x09, 0x54b: 0x09, 0x54c: 0x09, 0x54d: 0x09, 0x54e: 0x09, 0x54f: 0x11, -} - -// inverseData contains 4-byte entries of the following format: -// <0 padding> -// The last byte of the UTF-8-encoded rune is xor-ed with the last byte of the -// UTF-8 encoding of the original rune. Mappings often have the following -// pattern: -// A -> A (U+FF21 -> U+0041) -// B -> B (U+FF22 -> U+0042) -// ... -// By xor-ing the last byte the same entry can be shared by many mappings. This -// reduces the total number of distinct entries by about two thirds. -// The resulting entry for the aforementioned mappings is -// { 0x01, 0xE0, 0x00, 0x00 } -// Using this entry to map U+FF21 (UTF-8 [EF BC A1]), we get -// E0 ^ A1 = 41. -// Similarly, for U+FF22 (UTF-8 [EF BC A2]), we get -// E0 ^ A2 = 42. -// Note that because of the xor-ing, the byte sequence stored in the entry is -// not valid UTF-8. -var inverseData = [150][4]byte{ - {0x00, 0x00, 0x00, 0x00}, - {0x03, 0xe3, 0x80, 0xa0}, - {0x03, 0xef, 0xbc, 0xa0}, - {0x03, 0xef, 0xbc, 0xe0}, - {0x03, 0xef, 0xbd, 0xe0}, - {0x03, 0xef, 0xbf, 0x02}, - {0x03, 0xef, 0xbf, 0x00}, - {0x03, 0xef, 0xbf, 0x0e}, - {0x03, 0xef, 0xbf, 0x0c}, - {0x03, 0xef, 0xbf, 0x0f}, - {0x03, 0xef, 0xbf, 0x39}, - {0x03, 0xef, 0xbf, 0x3b}, - {0x03, 0xef, 0xbf, 0x3f}, - {0x03, 0xef, 0xbf, 0x2a}, - {0x03, 0xef, 0xbf, 0x0d}, - {0x03, 0xef, 0xbf, 0x25}, - {0x03, 0xef, 0xbd, 0x1a}, - {0x03, 0xef, 0xbd, 0x26}, - {0x01, 0xa0, 0x00, 0x00}, - {0x03, 0xef, 0xbd, 0x25}, - {0x03, 0xef, 0xbd, 0x23}, - {0x03, 0xef, 0xbd, 0x2e}, - {0x03, 0xef, 0xbe, 0x07}, - {0x03, 0xef, 0xbe, 0x05}, - {0x03, 0xef, 0xbd, 0x06}, - {0x03, 0xef, 0xbd, 0x13}, - {0x03, 0xef, 0xbd, 0x0b}, - {0x03, 0xef, 0xbd, 0x16}, - {0x03, 0xef, 0xbd, 0x0c}, - {0x03, 0xef, 0xbd, 0x15}, - {0x03, 0xef, 0xbd, 0x0d}, - {0x03, 0xef, 0xbd, 0x1c}, - {0x03, 0xef, 0xbd, 0x02}, - {0x03, 0xef, 0xbd, 0x1f}, - {0x03, 0xef, 0xbd, 0x1d}, - {0x03, 0xef, 0xbd, 0x17}, - {0x03, 0xef, 0xbd, 0x08}, - {0x03, 0xef, 0xbd, 0x09}, - {0x03, 0xef, 0xbd, 0x0e}, - {0x03, 0xef, 0xbd, 0x04}, - {0x03, 0xef, 0xbd, 0x05}, - {0x03, 0xef, 0xbe, 0x3f}, - {0x03, 0xef, 0xbe, 0x00}, - {0x03, 0xef, 0xbd, 0x2c}, - {0x03, 0xef, 0xbe, 0x06}, - {0x03, 0xef, 0xbe, 0x0c}, - {0x03, 0xef, 0xbe, 0x0f}, - {0x03, 0xef, 0xbe, 0x0d}, - {0x03, 0xef, 0xbe, 0x0b}, - {0x03, 0xef, 0xbe, 0x19}, - {0x03, 0xef, 0xbe, 0x15}, - {0x03, 0xef, 0xbe, 0x11}, - {0x03, 0xef, 0xbe, 0x31}, - {0x03, 0xef, 0xbe, 0x33}, - {0x03, 0xef, 0xbd, 0x0f}, - {0x03, 0xef, 0xbe, 0x30}, - {0x03, 0xef, 0xbe, 0x3e}, - {0x03, 0xef, 0xbe, 0x32}, - {0x03, 0xef, 0xbe, 0x36}, - {0x03, 0xef, 0xbd, 0x14}, - {0x03, 0xef, 0xbe, 0x2e}, - {0x03, 0xef, 0xbd, 0x1e}, - {0x03, 0xef, 0xbe, 0x10}, - {0x03, 0xef, 0xbf, 0x13}, - {0x03, 0xef, 0xbf, 0x15}, - {0x03, 0xef, 0xbf, 0x17}, - {0x03, 0xef, 0xbf, 0x1f}, - {0x03, 0xef, 0xbf, 0x1d}, - {0x03, 0xef, 0xbf, 0x1b}, - {0x03, 0xef, 0xbf, 0x09}, - {0x03, 0xef, 0xbf, 0x0b}, - {0x03, 0xef, 0xbf, 0x37}, - {0x03, 0xef, 0xbe, 0x04}, - {0x01, 0xe0, 0x00, 0x00}, - {0x03, 0xe2, 0xa6, 0x1a}, - {0x03, 0xe2, 0xa6, 0x26}, - {0x03, 0xe3, 0x80, 0x23}, - {0x03, 0xe3, 0x80, 0x2e}, - {0x03, 0xe3, 0x80, 0x25}, - {0x03, 0xe3, 0x83, 0x1e}, - {0x03, 0xe3, 0x83, 0x14}, - {0x03, 0xe3, 0x82, 0x06}, - {0x03, 0xe3, 0x82, 0x0b}, - {0x03, 0xe3, 0x82, 0x0c}, - {0x03, 0xe3, 0x82, 0x0d}, - {0x03, 0xe3, 0x82, 0x02}, - {0x03, 0xe3, 0x83, 0x0f}, - {0x03, 0xe3, 0x83, 0x08}, - {0x03, 0xe3, 0x83, 0x09}, - {0x03, 0xe3, 0x83, 0x2c}, - {0x03, 0xe3, 0x83, 0x0c}, - {0x03, 0xe3, 0x82, 0x13}, - {0x03, 0xe3, 0x82, 0x16}, - {0x03, 0xe3, 0x82, 0x15}, - {0x03, 0xe3, 0x82, 0x1c}, - {0x03, 0xe3, 0x82, 0x1f}, - {0x03, 0xe3, 0x82, 0x1d}, - {0x03, 0xe3, 0x82, 0x1a}, - {0x03, 0xe3, 0x82, 0x17}, - {0x03, 0xe3, 0x82, 0x08}, - {0x03, 0xe3, 0x82, 0x09}, - {0x03, 0xe3, 0x82, 0x0e}, - {0x03, 0xe3, 0x82, 0x04}, - {0x03, 0xe3, 0x82, 0x05}, - {0x03, 0xe3, 0x82, 0x3f}, - {0x03, 0xe3, 0x83, 0x00}, - {0x03, 0xe3, 0x83, 0x06}, - {0x03, 0xe3, 0x83, 0x05}, - {0x03, 0xe3, 0x83, 0x0d}, - {0x03, 0xe3, 0x83, 0x0b}, - {0x03, 0xe3, 0x83, 0x07}, - {0x03, 0xe3, 0x83, 0x19}, - {0x03, 0xe3, 0x83, 0x15}, - {0x03, 0xe3, 0x83, 0x11}, - {0x03, 0xe3, 0x83, 0x31}, - {0x03, 0xe3, 0x83, 0x33}, - {0x03, 0xe3, 0x83, 0x30}, - {0x03, 0xe3, 0x83, 0x3e}, - {0x03, 0xe3, 0x83, 0x32}, - {0x03, 0xe3, 0x83, 0x36}, - {0x03, 0xe3, 0x83, 0x2e}, - {0x03, 0xe3, 0x82, 0x07}, - {0x03, 0xe3, 0x85, 0x04}, - {0x03, 0xe3, 0x84, 0x10}, - {0x03, 0xe3, 0x85, 0x30}, - {0x03, 0xe3, 0x85, 0x0d}, - {0x03, 0xe3, 0x85, 0x13}, - {0x03, 0xe3, 0x85, 0x15}, - {0x03, 0xe3, 0x85, 0x17}, - {0x03, 0xe3, 0x85, 0x1f}, - {0x03, 0xe3, 0x85, 0x1d}, - {0x03, 0xe3, 0x85, 0x1b}, - {0x03, 0xe3, 0x85, 0x09}, - {0x03, 0xe3, 0x85, 0x0f}, - {0x03, 0xe3, 0x85, 0x0b}, - {0x03, 0xe3, 0x85, 0x37}, - {0x03, 0xe3, 0x85, 0x3b}, - {0x03, 0xe3, 0x85, 0x39}, - {0x03, 0xe3, 0x85, 0x3f}, - {0x02, 0xc2, 0x02, 0x00}, - {0x02, 0xc2, 0x0e, 0x00}, - {0x02, 0xc2, 0x0c, 0x00}, - {0x02, 0xc2, 0x00, 0x00}, - {0x03, 0xe2, 0x82, 0x0f}, - {0x03, 0xe2, 0x94, 0x2a}, - {0x03, 0xe2, 0x86, 0x39}, - {0x03, 0xe2, 0x86, 0x3b}, - {0x03, 0xe2, 0x86, 0x3f}, - {0x03, 0xe2, 0x96, 0x0d}, - {0x03, 0xe2, 0x97, 0x25}, -} - -// Total table size 14936 bytes (14KiB) diff --git a/vendor/golang.org/x/text/width/tables9.0.0.go b/vendor/golang.org/x/text/width/tables9.0.0.go deleted file mode 100644 index 7069e26..0000000 --- a/vendor/golang.org/x/text/width/tables9.0.0.go +++ /dev/null @@ -1,1286 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -// +build !go1.10 - -package width - -// UnicodeVersion is the Unicode version from which the tables in this package are derived. -const UnicodeVersion = "9.0.0" - -// lookup returns the trie value for the first UTF-8 encoding in s and -// the width in bytes of this encoding. The size will be 0 if s does not -// hold enough bytes to complete the encoding. len(s) must be greater than 0. -func (t *widthTrie) lookup(s []byte) (v uint16, sz int) { - c0 := s[0] - switch { - case c0 < 0x80: // is ASCII - return widthValues[c0], 1 - case c0 < 0xC2: - return 0, 1 // Illegal UTF-8: not a starter, not ASCII. - case c0 < 0xE0: // 2-byte UTF-8 - if len(s) < 2 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c1), 2 - case c0 < 0xF0: // 3-byte UTF-8 - if len(s) < 3 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c2), 3 - case c0 < 0xF8: // 4-byte UTF-8 - if len(s) < 4 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - o = uint32(i)<<6 + uint32(c2) - i = widthIndex[o] - c3 := s[3] - if c3 < 0x80 || 0xC0 <= c3 { - return 0, 3 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c3), 4 - } - // Illegal rune - return 0, 1 -} - -// lookupUnsafe returns the trie value for the first UTF-8 encoding in s. -// s must start with a full and valid UTF-8 encoded rune. -func (t *widthTrie) lookupUnsafe(s []byte) uint16 { - c0 := s[0] - if c0 < 0x80 { // is ASCII - return widthValues[c0] - } - i := widthIndex[c0] - if c0 < 0xE0 { // 2-byte UTF-8 - return t.lookupValue(uint32(i), s[1]) - } - i = widthIndex[uint32(i)<<6+uint32(s[1])] - if c0 < 0xF0 { // 3-byte UTF-8 - return t.lookupValue(uint32(i), s[2]) - } - i = widthIndex[uint32(i)<<6+uint32(s[2])] - if c0 < 0xF8 { // 4-byte UTF-8 - return t.lookupValue(uint32(i), s[3]) - } - return 0 -} - -// lookupString returns the trie value for the first UTF-8 encoding in s and -// the width in bytes of this encoding. The size will be 0 if s does not -// hold enough bytes to complete the encoding. len(s) must be greater than 0. -func (t *widthTrie) lookupString(s string) (v uint16, sz int) { - c0 := s[0] - switch { - case c0 < 0x80: // is ASCII - return widthValues[c0], 1 - case c0 < 0xC2: - return 0, 1 // Illegal UTF-8: not a starter, not ASCII. - case c0 < 0xE0: // 2-byte UTF-8 - if len(s) < 2 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c1), 2 - case c0 < 0xF0: // 3-byte UTF-8 - if len(s) < 3 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c2), 3 - case c0 < 0xF8: // 4-byte UTF-8 - if len(s) < 4 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - o = uint32(i)<<6 + uint32(c2) - i = widthIndex[o] - c3 := s[3] - if c3 < 0x80 || 0xC0 <= c3 { - return 0, 3 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c3), 4 - } - // Illegal rune - return 0, 1 -} - -// lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. -// s must start with a full and valid UTF-8 encoded rune. -func (t *widthTrie) lookupStringUnsafe(s string) uint16 { - c0 := s[0] - if c0 < 0x80 { // is ASCII - return widthValues[c0] - } - i := widthIndex[c0] - if c0 < 0xE0 { // 2-byte UTF-8 - return t.lookupValue(uint32(i), s[1]) - } - i = widthIndex[uint32(i)<<6+uint32(s[1])] - if c0 < 0xF0 { // 3-byte UTF-8 - return t.lookupValue(uint32(i), s[2]) - } - i = widthIndex[uint32(i)<<6+uint32(s[2])] - if c0 < 0xF8 { // 4-byte UTF-8 - return t.lookupValue(uint32(i), s[3]) - } - return 0 -} - -// widthTrie. Total size: 14080 bytes (13.75 KiB). Checksum: 3b8aeb3dc03667a3. -type widthTrie struct{} - -func newWidthTrie(i int) *widthTrie { - return &widthTrie{} -} - -// lookupValue determines the type of block n and looks up the value for b. -func (t *widthTrie) lookupValue(n uint32, b byte) uint16 { - switch { - default: - return uint16(widthValues[n<<6+uint32(b)]) - } -} - -// widthValues: 99 blocks, 6336 entries, 12672 bytes -// The third block is the zero block. -var widthValues = [6336]uint16{ - // Block 0x0, offset 0x0 - 0x20: 0x6001, 0x21: 0x6002, 0x22: 0x6002, 0x23: 0x6002, - 0x24: 0x6002, 0x25: 0x6002, 0x26: 0x6002, 0x27: 0x6002, 0x28: 0x6002, 0x29: 0x6002, - 0x2a: 0x6002, 0x2b: 0x6002, 0x2c: 0x6002, 0x2d: 0x6002, 0x2e: 0x6002, 0x2f: 0x6002, - 0x30: 0x6002, 0x31: 0x6002, 0x32: 0x6002, 0x33: 0x6002, 0x34: 0x6002, 0x35: 0x6002, - 0x36: 0x6002, 0x37: 0x6002, 0x38: 0x6002, 0x39: 0x6002, 0x3a: 0x6002, 0x3b: 0x6002, - 0x3c: 0x6002, 0x3d: 0x6002, 0x3e: 0x6002, 0x3f: 0x6002, - // Block 0x1, offset 0x40 - 0x40: 0x6003, 0x41: 0x6003, 0x42: 0x6003, 0x43: 0x6003, 0x44: 0x6003, 0x45: 0x6003, - 0x46: 0x6003, 0x47: 0x6003, 0x48: 0x6003, 0x49: 0x6003, 0x4a: 0x6003, 0x4b: 0x6003, - 0x4c: 0x6003, 0x4d: 0x6003, 0x4e: 0x6003, 0x4f: 0x6003, 0x50: 0x6003, 0x51: 0x6003, - 0x52: 0x6003, 0x53: 0x6003, 0x54: 0x6003, 0x55: 0x6003, 0x56: 0x6003, 0x57: 0x6003, - 0x58: 0x6003, 0x59: 0x6003, 0x5a: 0x6003, 0x5b: 0x6003, 0x5c: 0x6003, 0x5d: 0x6003, - 0x5e: 0x6003, 0x5f: 0x6003, 0x60: 0x6004, 0x61: 0x6004, 0x62: 0x6004, 0x63: 0x6004, - 0x64: 0x6004, 0x65: 0x6004, 0x66: 0x6004, 0x67: 0x6004, 0x68: 0x6004, 0x69: 0x6004, - 0x6a: 0x6004, 0x6b: 0x6004, 0x6c: 0x6004, 0x6d: 0x6004, 0x6e: 0x6004, 0x6f: 0x6004, - 0x70: 0x6004, 0x71: 0x6004, 0x72: 0x6004, 0x73: 0x6004, 0x74: 0x6004, 0x75: 0x6004, - 0x76: 0x6004, 0x77: 0x6004, 0x78: 0x6004, 0x79: 0x6004, 0x7a: 0x6004, 0x7b: 0x6004, - 0x7c: 0x6004, 0x7d: 0x6004, 0x7e: 0x6004, - // Block 0x2, offset 0x80 - // Block 0x3, offset 0xc0 - 0xe1: 0x2000, 0xe2: 0x6005, 0xe3: 0x6005, - 0xe4: 0x2000, 0xe5: 0x6006, 0xe6: 0x6005, 0xe7: 0x2000, 0xe8: 0x2000, - 0xea: 0x2000, 0xec: 0x6007, 0xed: 0x2000, 0xee: 0x2000, 0xef: 0x6008, - 0xf0: 0x2000, 0xf1: 0x2000, 0xf2: 0x2000, 0xf3: 0x2000, 0xf4: 0x2000, - 0xf6: 0x2000, 0xf7: 0x2000, 0xf8: 0x2000, 0xf9: 0x2000, 0xfa: 0x2000, - 0xfc: 0x2000, 0xfd: 0x2000, 0xfe: 0x2000, 0xff: 0x2000, - // Block 0x4, offset 0x100 - 0x106: 0x2000, - 0x110: 0x2000, - 0x117: 0x2000, - 0x118: 0x2000, - 0x11e: 0x2000, 0x11f: 0x2000, 0x120: 0x2000, 0x121: 0x2000, - 0x126: 0x2000, 0x128: 0x2000, 0x129: 0x2000, - 0x12a: 0x2000, 0x12c: 0x2000, 0x12d: 0x2000, - 0x130: 0x2000, 0x132: 0x2000, 0x133: 0x2000, - 0x137: 0x2000, 0x138: 0x2000, 0x139: 0x2000, 0x13a: 0x2000, - 0x13c: 0x2000, 0x13e: 0x2000, - // Block 0x5, offset 0x140 - 0x141: 0x2000, - 0x151: 0x2000, - 0x153: 0x2000, - 0x15b: 0x2000, - 0x166: 0x2000, 0x167: 0x2000, - 0x16b: 0x2000, - 0x171: 0x2000, 0x172: 0x2000, 0x173: 0x2000, - 0x178: 0x2000, - 0x17f: 0x2000, - // Block 0x6, offset 0x180 - 0x180: 0x2000, 0x181: 0x2000, 0x182: 0x2000, 0x184: 0x2000, - 0x188: 0x2000, 0x189: 0x2000, 0x18a: 0x2000, 0x18b: 0x2000, - 0x18d: 0x2000, - 0x192: 0x2000, 0x193: 0x2000, - 0x1a6: 0x2000, 0x1a7: 0x2000, - 0x1ab: 0x2000, - // Block 0x7, offset 0x1c0 - 0x1ce: 0x2000, 0x1d0: 0x2000, - 0x1d2: 0x2000, 0x1d4: 0x2000, 0x1d6: 0x2000, - 0x1d8: 0x2000, 0x1da: 0x2000, 0x1dc: 0x2000, - // Block 0x8, offset 0x200 - 0x211: 0x2000, - 0x221: 0x2000, - // Block 0x9, offset 0x240 - 0x244: 0x2000, - 0x247: 0x2000, 0x249: 0x2000, 0x24a: 0x2000, 0x24b: 0x2000, - 0x24d: 0x2000, 0x250: 0x2000, - 0x258: 0x2000, 0x259: 0x2000, 0x25a: 0x2000, 0x25b: 0x2000, 0x25d: 0x2000, - 0x25f: 0x2000, - // Block 0xa, offset 0x280 - 0x280: 0x2000, 0x281: 0x2000, 0x282: 0x2000, 0x283: 0x2000, 0x284: 0x2000, 0x285: 0x2000, - 0x286: 0x2000, 0x287: 0x2000, 0x288: 0x2000, 0x289: 0x2000, 0x28a: 0x2000, 0x28b: 0x2000, - 0x28c: 0x2000, 0x28d: 0x2000, 0x28e: 0x2000, 0x28f: 0x2000, 0x290: 0x2000, 0x291: 0x2000, - 0x292: 0x2000, 0x293: 0x2000, 0x294: 0x2000, 0x295: 0x2000, 0x296: 0x2000, 0x297: 0x2000, - 0x298: 0x2000, 0x299: 0x2000, 0x29a: 0x2000, 0x29b: 0x2000, 0x29c: 0x2000, 0x29d: 0x2000, - 0x29e: 0x2000, 0x29f: 0x2000, 0x2a0: 0x2000, 0x2a1: 0x2000, 0x2a2: 0x2000, 0x2a3: 0x2000, - 0x2a4: 0x2000, 0x2a5: 0x2000, 0x2a6: 0x2000, 0x2a7: 0x2000, 0x2a8: 0x2000, 0x2a9: 0x2000, - 0x2aa: 0x2000, 0x2ab: 0x2000, 0x2ac: 0x2000, 0x2ad: 0x2000, 0x2ae: 0x2000, 0x2af: 0x2000, - 0x2b0: 0x2000, 0x2b1: 0x2000, 0x2b2: 0x2000, 0x2b3: 0x2000, 0x2b4: 0x2000, 0x2b5: 0x2000, - 0x2b6: 0x2000, 0x2b7: 0x2000, 0x2b8: 0x2000, 0x2b9: 0x2000, 0x2ba: 0x2000, 0x2bb: 0x2000, - 0x2bc: 0x2000, 0x2bd: 0x2000, 0x2be: 0x2000, 0x2bf: 0x2000, - // Block 0xb, offset 0x2c0 - 0x2c0: 0x2000, 0x2c1: 0x2000, 0x2c2: 0x2000, 0x2c3: 0x2000, 0x2c4: 0x2000, 0x2c5: 0x2000, - 0x2c6: 0x2000, 0x2c7: 0x2000, 0x2c8: 0x2000, 0x2c9: 0x2000, 0x2ca: 0x2000, 0x2cb: 0x2000, - 0x2cc: 0x2000, 0x2cd: 0x2000, 0x2ce: 0x2000, 0x2cf: 0x2000, 0x2d0: 0x2000, 0x2d1: 0x2000, - 0x2d2: 0x2000, 0x2d3: 0x2000, 0x2d4: 0x2000, 0x2d5: 0x2000, 0x2d6: 0x2000, 0x2d7: 0x2000, - 0x2d8: 0x2000, 0x2d9: 0x2000, 0x2da: 0x2000, 0x2db: 0x2000, 0x2dc: 0x2000, 0x2dd: 0x2000, - 0x2de: 0x2000, 0x2df: 0x2000, 0x2e0: 0x2000, 0x2e1: 0x2000, 0x2e2: 0x2000, 0x2e3: 0x2000, - 0x2e4: 0x2000, 0x2e5: 0x2000, 0x2e6: 0x2000, 0x2e7: 0x2000, 0x2e8: 0x2000, 0x2e9: 0x2000, - 0x2ea: 0x2000, 0x2eb: 0x2000, 0x2ec: 0x2000, 0x2ed: 0x2000, 0x2ee: 0x2000, 0x2ef: 0x2000, - // Block 0xc, offset 0x300 - 0x311: 0x2000, - 0x312: 0x2000, 0x313: 0x2000, 0x314: 0x2000, 0x315: 0x2000, 0x316: 0x2000, 0x317: 0x2000, - 0x318: 0x2000, 0x319: 0x2000, 0x31a: 0x2000, 0x31b: 0x2000, 0x31c: 0x2000, 0x31d: 0x2000, - 0x31e: 0x2000, 0x31f: 0x2000, 0x320: 0x2000, 0x321: 0x2000, 0x323: 0x2000, - 0x324: 0x2000, 0x325: 0x2000, 0x326: 0x2000, 0x327: 0x2000, 0x328: 0x2000, 0x329: 0x2000, - 0x331: 0x2000, 0x332: 0x2000, 0x333: 0x2000, 0x334: 0x2000, 0x335: 0x2000, - 0x336: 0x2000, 0x337: 0x2000, 0x338: 0x2000, 0x339: 0x2000, 0x33a: 0x2000, 0x33b: 0x2000, - 0x33c: 0x2000, 0x33d: 0x2000, 0x33e: 0x2000, 0x33f: 0x2000, - // Block 0xd, offset 0x340 - 0x340: 0x2000, 0x341: 0x2000, 0x343: 0x2000, 0x344: 0x2000, 0x345: 0x2000, - 0x346: 0x2000, 0x347: 0x2000, 0x348: 0x2000, 0x349: 0x2000, - // Block 0xe, offset 0x380 - 0x381: 0x2000, - 0x390: 0x2000, 0x391: 0x2000, - 0x392: 0x2000, 0x393: 0x2000, 0x394: 0x2000, 0x395: 0x2000, 0x396: 0x2000, 0x397: 0x2000, - 0x398: 0x2000, 0x399: 0x2000, 0x39a: 0x2000, 0x39b: 0x2000, 0x39c: 0x2000, 0x39d: 0x2000, - 0x39e: 0x2000, 0x39f: 0x2000, 0x3a0: 0x2000, 0x3a1: 0x2000, 0x3a2: 0x2000, 0x3a3: 0x2000, - 0x3a4: 0x2000, 0x3a5: 0x2000, 0x3a6: 0x2000, 0x3a7: 0x2000, 0x3a8: 0x2000, 0x3a9: 0x2000, - 0x3aa: 0x2000, 0x3ab: 0x2000, 0x3ac: 0x2000, 0x3ad: 0x2000, 0x3ae: 0x2000, 0x3af: 0x2000, - 0x3b0: 0x2000, 0x3b1: 0x2000, 0x3b2: 0x2000, 0x3b3: 0x2000, 0x3b4: 0x2000, 0x3b5: 0x2000, - 0x3b6: 0x2000, 0x3b7: 0x2000, 0x3b8: 0x2000, 0x3b9: 0x2000, 0x3ba: 0x2000, 0x3bb: 0x2000, - 0x3bc: 0x2000, 0x3bd: 0x2000, 0x3be: 0x2000, 0x3bf: 0x2000, - // Block 0xf, offset 0x3c0 - 0x3c0: 0x2000, 0x3c1: 0x2000, 0x3c2: 0x2000, 0x3c3: 0x2000, 0x3c4: 0x2000, 0x3c5: 0x2000, - 0x3c6: 0x2000, 0x3c7: 0x2000, 0x3c8: 0x2000, 0x3c9: 0x2000, 0x3ca: 0x2000, 0x3cb: 0x2000, - 0x3cc: 0x2000, 0x3cd: 0x2000, 0x3ce: 0x2000, 0x3cf: 0x2000, 0x3d1: 0x2000, - // Block 0x10, offset 0x400 - 0x400: 0x4000, 0x401: 0x4000, 0x402: 0x4000, 0x403: 0x4000, 0x404: 0x4000, 0x405: 0x4000, - 0x406: 0x4000, 0x407: 0x4000, 0x408: 0x4000, 0x409: 0x4000, 0x40a: 0x4000, 0x40b: 0x4000, - 0x40c: 0x4000, 0x40d: 0x4000, 0x40e: 0x4000, 0x40f: 0x4000, 0x410: 0x4000, 0x411: 0x4000, - 0x412: 0x4000, 0x413: 0x4000, 0x414: 0x4000, 0x415: 0x4000, 0x416: 0x4000, 0x417: 0x4000, - 0x418: 0x4000, 0x419: 0x4000, 0x41a: 0x4000, 0x41b: 0x4000, 0x41c: 0x4000, 0x41d: 0x4000, - 0x41e: 0x4000, 0x41f: 0x4000, 0x420: 0x4000, 0x421: 0x4000, 0x422: 0x4000, 0x423: 0x4000, - 0x424: 0x4000, 0x425: 0x4000, 0x426: 0x4000, 0x427: 0x4000, 0x428: 0x4000, 0x429: 0x4000, - 0x42a: 0x4000, 0x42b: 0x4000, 0x42c: 0x4000, 0x42d: 0x4000, 0x42e: 0x4000, 0x42f: 0x4000, - 0x430: 0x4000, 0x431: 0x4000, 0x432: 0x4000, 0x433: 0x4000, 0x434: 0x4000, 0x435: 0x4000, - 0x436: 0x4000, 0x437: 0x4000, 0x438: 0x4000, 0x439: 0x4000, 0x43a: 0x4000, 0x43b: 0x4000, - 0x43c: 0x4000, 0x43d: 0x4000, 0x43e: 0x4000, 0x43f: 0x4000, - // Block 0x11, offset 0x440 - 0x440: 0x4000, 0x441: 0x4000, 0x442: 0x4000, 0x443: 0x4000, 0x444: 0x4000, 0x445: 0x4000, - 0x446: 0x4000, 0x447: 0x4000, 0x448: 0x4000, 0x449: 0x4000, 0x44a: 0x4000, 0x44b: 0x4000, - 0x44c: 0x4000, 0x44d: 0x4000, 0x44e: 0x4000, 0x44f: 0x4000, 0x450: 0x4000, 0x451: 0x4000, - 0x452: 0x4000, 0x453: 0x4000, 0x454: 0x4000, 0x455: 0x4000, 0x456: 0x4000, 0x457: 0x4000, - 0x458: 0x4000, 0x459: 0x4000, 0x45a: 0x4000, 0x45b: 0x4000, 0x45c: 0x4000, 0x45d: 0x4000, - 0x45e: 0x4000, 0x45f: 0x4000, - // Block 0x12, offset 0x480 - 0x490: 0x2000, - 0x493: 0x2000, 0x494: 0x2000, 0x495: 0x2000, 0x496: 0x2000, - 0x498: 0x2000, 0x499: 0x2000, 0x49c: 0x2000, 0x49d: 0x2000, - 0x4a0: 0x2000, 0x4a1: 0x2000, 0x4a2: 0x2000, - 0x4a4: 0x2000, 0x4a5: 0x2000, 0x4a6: 0x2000, 0x4a7: 0x2000, - 0x4b0: 0x2000, 0x4b2: 0x2000, 0x4b3: 0x2000, 0x4b5: 0x2000, - 0x4bb: 0x2000, - 0x4be: 0x2000, - // Block 0x13, offset 0x4c0 - 0x4f4: 0x2000, - 0x4ff: 0x2000, - // Block 0x14, offset 0x500 - 0x501: 0x2000, 0x502: 0x2000, 0x503: 0x2000, 0x504: 0x2000, - 0x529: 0xa009, - 0x52c: 0x2000, - // Block 0x15, offset 0x540 - 0x543: 0x2000, 0x545: 0x2000, - 0x549: 0x2000, - 0x553: 0x2000, 0x556: 0x2000, - 0x561: 0x2000, 0x562: 0x2000, - 0x566: 0x2000, - 0x56b: 0x2000, - // Block 0x16, offset 0x580 - 0x593: 0x2000, 0x594: 0x2000, - 0x59b: 0x2000, 0x59c: 0x2000, 0x59d: 0x2000, - 0x59e: 0x2000, 0x5a0: 0x2000, 0x5a1: 0x2000, 0x5a2: 0x2000, 0x5a3: 0x2000, - 0x5a4: 0x2000, 0x5a5: 0x2000, 0x5a6: 0x2000, 0x5a7: 0x2000, 0x5a8: 0x2000, 0x5a9: 0x2000, - 0x5aa: 0x2000, 0x5ab: 0x2000, - 0x5b0: 0x2000, 0x5b1: 0x2000, 0x5b2: 0x2000, 0x5b3: 0x2000, 0x5b4: 0x2000, 0x5b5: 0x2000, - 0x5b6: 0x2000, 0x5b7: 0x2000, 0x5b8: 0x2000, 0x5b9: 0x2000, - // Block 0x17, offset 0x5c0 - 0x5c9: 0x2000, - 0x5d0: 0x200a, 0x5d1: 0x200b, - 0x5d2: 0x200a, 0x5d3: 0x200c, 0x5d4: 0x2000, 0x5d5: 0x2000, 0x5d6: 0x2000, 0x5d7: 0x2000, - 0x5d8: 0x2000, 0x5d9: 0x2000, - 0x5f8: 0x2000, 0x5f9: 0x2000, - // Block 0x18, offset 0x600 - 0x612: 0x2000, 0x614: 0x2000, - 0x627: 0x2000, - // Block 0x19, offset 0x640 - 0x640: 0x2000, 0x642: 0x2000, 0x643: 0x2000, - 0x647: 0x2000, 0x648: 0x2000, 0x64b: 0x2000, - 0x64f: 0x2000, 0x651: 0x2000, - 0x655: 0x2000, - 0x65a: 0x2000, 0x65d: 0x2000, - 0x65e: 0x2000, 0x65f: 0x2000, 0x660: 0x2000, 0x663: 0x2000, - 0x665: 0x2000, 0x667: 0x2000, 0x668: 0x2000, 0x669: 0x2000, - 0x66a: 0x2000, 0x66b: 0x2000, 0x66c: 0x2000, 0x66e: 0x2000, - 0x674: 0x2000, 0x675: 0x2000, - 0x676: 0x2000, 0x677: 0x2000, - 0x67c: 0x2000, 0x67d: 0x2000, - // Block 0x1a, offset 0x680 - 0x688: 0x2000, - 0x68c: 0x2000, - 0x692: 0x2000, - 0x6a0: 0x2000, 0x6a1: 0x2000, - 0x6a4: 0x2000, 0x6a5: 0x2000, 0x6a6: 0x2000, 0x6a7: 0x2000, - 0x6aa: 0x2000, 0x6ab: 0x2000, 0x6ae: 0x2000, 0x6af: 0x2000, - // Block 0x1b, offset 0x6c0 - 0x6c2: 0x2000, 0x6c3: 0x2000, - 0x6c6: 0x2000, 0x6c7: 0x2000, - 0x6d5: 0x2000, - 0x6d9: 0x2000, - 0x6e5: 0x2000, - 0x6ff: 0x2000, - // Block 0x1c, offset 0x700 - 0x712: 0x2000, - 0x71a: 0x4000, 0x71b: 0x4000, - 0x729: 0x4000, - 0x72a: 0x4000, - // Block 0x1d, offset 0x740 - 0x769: 0x4000, - 0x76a: 0x4000, 0x76b: 0x4000, 0x76c: 0x4000, - 0x770: 0x4000, 0x773: 0x4000, - // Block 0x1e, offset 0x780 - 0x7a0: 0x2000, 0x7a1: 0x2000, 0x7a2: 0x2000, 0x7a3: 0x2000, - 0x7a4: 0x2000, 0x7a5: 0x2000, 0x7a6: 0x2000, 0x7a7: 0x2000, 0x7a8: 0x2000, 0x7a9: 0x2000, - 0x7aa: 0x2000, 0x7ab: 0x2000, 0x7ac: 0x2000, 0x7ad: 0x2000, 0x7ae: 0x2000, 0x7af: 0x2000, - 0x7b0: 0x2000, 0x7b1: 0x2000, 0x7b2: 0x2000, 0x7b3: 0x2000, 0x7b4: 0x2000, 0x7b5: 0x2000, - 0x7b6: 0x2000, 0x7b7: 0x2000, 0x7b8: 0x2000, 0x7b9: 0x2000, 0x7ba: 0x2000, 0x7bb: 0x2000, - 0x7bc: 0x2000, 0x7bd: 0x2000, 0x7be: 0x2000, 0x7bf: 0x2000, - // Block 0x1f, offset 0x7c0 - 0x7c0: 0x2000, 0x7c1: 0x2000, 0x7c2: 0x2000, 0x7c3: 0x2000, 0x7c4: 0x2000, 0x7c5: 0x2000, - 0x7c6: 0x2000, 0x7c7: 0x2000, 0x7c8: 0x2000, 0x7c9: 0x2000, 0x7ca: 0x2000, 0x7cb: 0x2000, - 0x7cc: 0x2000, 0x7cd: 0x2000, 0x7ce: 0x2000, 0x7cf: 0x2000, 0x7d0: 0x2000, 0x7d1: 0x2000, - 0x7d2: 0x2000, 0x7d3: 0x2000, 0x7d4: 0x2000, 0x7d5: 0x2000, 0x7d6: 0x2000, 0x7d7: 0x2000, - 0x7d8: 0x2000, 0x7d9: 0x2000, 0x7da: 0x2000, 0x7db: 0x2000, 0x7dc: 0x2000, 0x7dd: 0x2000, - 0x7de: 0x2000, 0x7df: 0x2000, 0x7e0: 0x2000, 0x7e1: 0x2000, 0x7e2: 0x2000, 0x7e3: 0x2000, - 0x7e4: 0x2000, 0x7e5: 0x2000, 0x7e6: 0x2000, 0x7e7: 0x2000, 0x7e8: 0x2000, 0x7e9: 0x2000, - 0x7eb: 0x2000, 0x7ec: 0x2000, 0x7ed: 0x2000, 0x7ee: 0x2000, 0x7ef: 0x2000, - 0x7f0: 0x2000, 0x7f1: 0x2000, 0x7f2: 0x2000, 0x7f3: 0x2000, 0x7f4: 0x2000, 0x7f5: 0x2000, - 0x7f6: 0x2000, 0x7f7: 0x2000, 0x7f8: 0x2000, 0x7f9: 0x2000, 0x7fa: 0x2000, 0x7fb: 0x2000, - 0x7fc: 0x2000, 0x7fd: 0x2000, 0x7fe: 0x2000, 0x7ff: 0x2000, - // Block 0x20, offset 0x800 - 0x800: 0x2000, 0x801: 0x2000, 0x802: 0x200d, 0x803: 0x2000, 0x804: 0x2000, 0x805: 0x2000, - 0x806: 0x2000, 0x807: 0x2000, 0x808: 0x2000, 0x809: 0x2000, 0x80a: 0x2000, 0x80b: 0x2000, - 0x80c: 0x2000, 0x80d: 0x2000, 0x80e: 0x2000, 0x80f: 0x2000, 0x810: 0x2000, 0x811: 0x2000, - 0x812: 0x2000, 0x813: 0x2000, 0x814: 0x2000, 0x815: 0x2000, 0x816: 0x2000, 0x817: 0x2000, - 0x818: 0x2000, 0x819: 0x2000, 0x81a: 0x2000, 0x81b: 0x2000, 0x81c: 0x2000, 0x81d: 0x2000, - 0x81e: 0x2000, 0x81f: 0x2000, 0x820: 0x2000, 0x821: 0x2000, 0x822: 0x2000, 0x823: 0x2000, - 0x824: 0x2000, 0x825: 0x2000, 0x826: 0x2000, 0x827: 0x2000, 0x828: 0x2000, 0x829: 0x2000, - 0x82a: 0x2000, 0x82b: 0x2000, 0x82c: 0x2000, 0x82d: 0x2000, 0x82e: 0x2000, 0x82f: 0x2000, - 0x830: 0x2000, 0x831: 0x2000, 0x832: 0x2000, 0x833: 0x2000, 0x834: 0x2000, 0x835: 0x2000, - 0x836: 0x2000, 0x837: 0x2000, 0x838: 0x2000, 0x839: 0x2000, 0x83a: 0x2000, 0x83b: 0x2000, - 0x83c: 0x2000, 0x83d: 0x2000, 0x83e: 0x2000, 0x83f: 0x2000, - // Block 0x21, offset 0x840 - 0x840: 0x2000, 0x841: 0x2000, 0x842: 0x2000, 0x843: 0x2000, 0x844: 0x2000, 0x845: 0x2000, - 0x846: 0x2000, 0x847: 0x2000, 0x848: 0x2000, 0x849: 0x2000, 0x84a: 0x2000, 0x84b: 0x2000, - 0x850: 0x2000, 0x851: 0x2000, - 0x852: 0x2000, 0x853: 0x2000, 0x854: 0x2000, 0x855: 0x2000, 0x856: 0x2000, 0x857: 0x2000, - 0x858: 0x2000, 0x859: 0x2000, 0x85a: 0x2000, 0x85b: 0x2000, 0x85c: 0x2000, 0x85d: 0x2000, - 0x85e: 0x2000, 0x85f: 0x2000, 0x860: 0x2000, 0x861: 0x2000, 0x862: 0x2000, 0x863: 0x2000, - 0x864: 0x2000, 0x865: 0x2000, 0x866: 0x2000, 0x867: 0x2000, 0x868: 0x2000, 0x869: 0x2000, - 0x86a: 0x2000, 0x86b: 0x2000, 0x86c: 0x2000, 0x86d: 0x2000, 0x86e: 0x2000, 0x86f: 0x2000, - 0x870: 0x2000, 0x871: 0x2000, 0x872: 0x2000, 0x873: 0x2000, - // Block 0x22, offset 0x880 - 0x880: 0x2000, 0x881: 0x2000, 0x882: 0x2000, 0x883: 0x2000, 0x884: 0x2000, 0x885: 0x2000, - 0x886: 0x2000, 0x887: 0x2000, 0x888: 0x2000, 0x889: 0x2000, 0x88a: 0x2000, 0x88b: 0x2000, - 0x88c: 0x2000, 0x88d: 0x2000, 0x88e: 0x2000, 0x88f: 0x2000, - 0x892: 0x2000, 0x893: 0x2000, 0x894: 0x2000, 0x895: 0x2000, - 0x8a0: 0x200e, 0x8a1: 0x2000, 0x8a3: 0x2000, - 0x8a4: 0x2000, 0x8a5: 0x2000, 0x8a6: 0x2000, 0x8a7: 0x2000, 0x8a8: 0x2000, 0x8a9: 0x2000, - 0x8b2: 0x2000, 0x8b3: 0x2000, - 0x8b6: 0x2000, 0x8b7: 0x2000, - 0x8bc: 0x2000, 0x8bd: 0x2000, - // Block 0x23, offset 0x8c0 - 0x8c0: 0x2000, 0x8c1: 0x2000, - 0x8c6: 0x2000, 0x8c7: 0x2000, 0x8c8: 0x2000, 0x8cb: 0x200f, - 0x8ce: 0x2000, 0x8cf: 0x2000, 0x8d0: 0x2000, 0x8d1: 0x2000, - 0x8e2: 0x2000, 0x8e3: 0x2000, - 0x8e4: 0x2000, 0x8e5: 0x2000, - 0x8ef: 0x2000, - 0x8fd: 0x4000, 0x8fe: 0x4000, - // Block 0x24, offset 0x900 - 0x905: 0x2000, - 0x906: 0x2000, 0x909: 0x2000, - 0x90e: 0x2000, 0x90f: 0x2000, - 0x914: 0x4000, 0x915: 0x4000, - 0x91c: 0x2000, - 0x91e: 0x2000, - // Block 0x25, offset 0x940 - 0x940: 0x2000, 0x942: 0x2000, - 0x948: 0x4000, 0x949: 0x4000, 0x94a: 0x4000, 0x94b: 0x4000, - 0x94c: 0x4000, 0x94d: 0x4000, 0x94e: 0x4000, 0x94f: 0x4000, 0x950: 0x4000, 0x951: 0x4000, - 0x952: 0x4000, 0x953: 0x4000, - 0x960: 0x2000, 0x961: 0x2000, 0x963: 0x2000, - 0x964: 0x2000, 0x965: 0x2000, 0x967: 0x2000, 0x968: 0x2000, 0x969: 0x2000, - 0x96a: 0x2000, 0x96c: 0x2000, 0x96d: 0x2000, 0x96f: 0x2000, - 0x97f: 0x4000, - // Block 0x26, offset 0x980 - 0x993: 0x4000, - 0x99e: 0x2000, 0x99f: 0x2000, 0x9a1: 0x4000, - 0x9aa: 0x4000, 0x9ab: 0x4000, - 0x9bd: 0x4000, 0x9be: 0x4000, 0x9bf: 0x2000, - // Block 0x27, offset 0x9c0 - 0x9c4: 0x4000, 0x9c5: 0x4000, - 0x9c6: 0x2000, 0x9c7: 0x2000, 0x9c8: 0x2000, 0x9c9: 0x2000, 0x9ca: 0x2000, 0x9cb: 0x2000, - 0x9cc: 0x2000, 0x9cd: 0x2000, 0x9ce: 0x4000, 0x9cf: 0x2000, 0x9d0: 0x2000, 0x9d1: 0x2000, - 0x9d2: 0x2000, 0x9d3: 0x2000, 0x9d4: 0x4000, 0x9d5: 0x2000, 0x9d6: 0x2000, 0x9d7: 0x2000, - 0x9d8: 0x2000, 0x9d9: 0x2000, 0x9da: 0x2000, 0x9db: 0x2000, 0x9dc: 0x2000, 0x9dd: 0x2000, - 0x9de: 0x2000, 0x9df: 0x2000, 0x9e0: 0x2000, 0x9e1: 0x2000, 0x9e3: 0x2000, - 0x9e8: 0x2000, 0x9e9: 0x2000, - 0x9ea: 0x4000, 0x9eb: 0x2000, 0x9ec: 0x2000, 0x9ed: 0x2000, 0x9ee: 0x2000, 0x9ef: 0x2000, - 0x9f0: 0x2000, 0x9f1: 0x2000, 0x9f2: 0x4000, 0x9f3: 0x4000, 0x9f4: 0x2000, 0x9f5: 0x4000, - 0x9f6: 0x2000, 0x9f7: 0x2000, 0x9f8: 0x2000, 0x9f9: 0x2000, 0x9fa: 0x4000, 0x9fb: 0x2000, - 0x9fc: 0x2000, 0x9fd: 0x4000, 0x9fe: 0x2000, 0x9ff: 0x2000, - // Block 0x28, offset 0xa00 - 0xa05: 0x4000, - 0xa0a: 0x4000, 0xa0b: 0x4000, - 0xa28: 0x4000, - 0xa3d: 0x2000, - // Block 0x29, offset 0xa40 - 0xa4c: 0x4000, 0xa4e: 0x4000, - 0xa53: 0x4000, 0xa54: 0x4000, 0xa55: 0x4000, 0xa57: 0x4000, - 0xa76: 0x2000, 0xa77: 0x2000, 0xa78: 0x2000, 0xa79: 0x2000, 0xa7a: 0x2000, 0xa7b: 0x2000, - 0xa7c: 0x2000, 0xa7d: 0x2000, 0xa7e: 0x2000, 0xa7f: 0x2000, - // Block 0x2a, offset 0xa80 - 0xa95: 0x4000, 0xa96: 0x4000, 0xa97: 0x4000, - 0xab0: 0x4000, - 0xabf: 0x4000, - // Block 0x2b, offset 0xac0 - 0xae6: 0x6000, 0xae7: 0x6000, 0xae8: 0x6000, 0xae9: 0x6000, - 0xaea: 0x6000, 0xaeb: 0x6000, 0xaec: 0x6000, 0xaed: 0x6000, - // Block 0x2c, offset 0xb00 - 0xb05: 0x6010, - 0xb06: 0x6011, - // Block 0x2d, offset 0xb40 - 0xb5b: 0x4000, 0xb5c: 0x4000, - // Block 0x2e, offset 0xb80 - 0xb90: 0x4000, - 0xb95: 0x4000, 0xb96: 0x2000, 0xb97: 0x2000, - 0xb98: 0x2000, 0xb99: 0x2000, - // Block 0x2f, offset 0xbc0 - 0xbc0: 0x4000, 0xbc1: 0x4000, 0xbc2: 0x4000, 0xbc3: 0x4000, 0xbc4: 0x4000, 0xbc5: 0x4000, - 0xbc6: 0x4000, 0xbc7: 0x4000, 0xbc8: 0x4000, 0xbc9: 0x4000, 0xbca: 0x4000, 0xbcb: 0x4000, - 0xbcc: 0x4000, 0xbcd: 0x4000, 0xbce: 0x4000, 0xbcf: 0x4000, 0xbd0: 0x4000, 0xbd1: 0x4000, - 0xbd2: 0x4000, 0xbd3: 0x4000, 0xbd4: 0x4000, 0xbd5: 0x4000, 0xbd6: 0x4000, 0xbd7: 0x4000, - 0xbd8: 0x4000, 0xbd9: 0x4000, 0xbdb: 0x4000, 0xbdc: 0x4000, 0xbdd: 0x4000, - 0xbde: 0x4000, 0xbdf: 0x4000, 0xbe0: 0x4000, 0xbe1: 0x4000, 0xbe2: 0x4000, 0xbe3: 0x4000, - 0xbe4: 0x4000, 0xbe5: 0x4000, 0xbe6: 0x4000, 0xbe7: 0x4000, 0xbe8: 0x4000, 0xbe9: 0x4000, - 0xbea: 0x4000, 0xbeb: 0x4000, 0xbec: 0x4000, 0xbed: 0x4000, 0xbee: 0x4000, 0xbef: 0x4000, - 0xbf0: 0x4000, 0xbf1: 0x4000, 0xbf2: 0x4000, 0xbf3: 0x4000, 0xbf4: 0x4000, 0xbf5: 0x4000, - 0xbf6: 0x4000, 0xbf7: 0x4000, 0xbf8: 0x4000, 0xbf9: 0x4000, 0xbfa: 0x4000, 0xbfb: 0x4000, - 0xbfc: 0x4000, 0xbfd: 0x4000, 0xbfe: 0x4000, 0xbff: 0x4000, - // Block 0x30, offset 0xc00 - 0xc00: 0x4000, 0xc01: 0x4000, 0xc02: 0x4000, 0xc03: 0x4000, 0xc04: 0x4000, 0xc05: 0x4000, - 0xc06: 0x4000, 0xc07: 0x4000, 0xc08: 0x4000, 0xc09: 0x4000, 0xc0a: 0x4000, 0xc0b: 0x4000, - 0xc0c: 0x4000, 0xc0d: 0x4000, 0xc0e: 0x4000, 0xc0f: 0x4000, 0xc10: 0x4000, 0xc11: 0x4000, - 0xc12: 0x4000, 0xc13: 0x4000, 0xc14: 0x4000, 0xc15: 0x4000, 0xc16: 0x4000, 0xc17: 0x4000, - 0xc18: 0x4000, 0xc19: 0x4000, 0xc1a: 0x4000, 0xc1b: 0x4000, 0xc1c: 0x4000, 0xc1d: 0x4000, - 0xc1e: 0x4000, 0xc1f: 0x4000, 0xc20: 0x4000, 0xc21: 0x4000, 0xc22: 0x4000, 0xc23: 0x4000, - 0xc24: 0x4000, 0xc25: 0x4000, 0xc26: 0x4000, 0xc27: 0x4000, 0xc28: 0x4000, 0xc29: 0x4000, - 0xc2a: 0x4000, 0xc2b: 0x4000, 0xc2c: 0x4000, 0xc2d: 0x4000, 0xc2e: 0x4000, 0xc2f: 0x4000, - 0xc30: 0x4000, 0xc31: 0x4000, 0xc32: 0x4000, 0xc33: 0x4000, - // Block 0x31, offset 0xc40 - 0xc40: 0x4000, 0xc41: 0x4000, 0xc42: 0x4000, 0xc43: 0x4000, 0xc44: 0x4000, 0xc45: 0x4000, - 0xc46: 0x4000, 0xc47: 0x4000, 0xc48: 0x4000, 0xc49: 0x4000, 0xc4a: 0x4000, 0xc4b: 0x4000, - 0xc4c: 0x4000, 0xc4d: 0x4000, 0xc4e: 0x4000, 0xc4f: 0x4000, 0xc50: 0x4000, 0xc51: 0x4000, - 0xc52: 0x4000, 0xc53: 0x4000, 0xc54: 0x4000, 0xc55: 0x4000, - 0xc70: 0x4000, 0xc71: 0x4000, 0xc72: 0x4000, 0xc73: 0x4000, 0xc74: 0x4000, 0xc75: 0x4000, - 0xc76: 0x4000, 0xc77: 0x4000, 0xc78: 0x4000, 0xc79: 0x4000, 0xc7a: 0x4000, 0xc7b: 0x4000, - // Block 0x32, offset 0xc80 - 0xc80: 0x9012, 0xc81: 0x4013, 0xc82: 0x4014, 0xc83: 0x4000, 0xc84: 0x4000, 0xc85: 0x4000, - 0xc86: 0x4000, 0xc87: 0x4000, 0xc88: 0x4000, 0xc89: 0x4000, 0xc8a: 0x4000, 0xc8b: 0x4000, - 0xc8c: 0x4015, 0xc8d: 0x4015, 0xc8e: 0x4000, 0xc8f: 0x4000, 0xc90: 0x4000, 0xc91: 0x4000, - 0xc92: 0x4000, 0xc93: 0x4000, 0xc94: 0x4000, 0xc95: 0x4000, 0xc96: 0x4000, 0xc97: 0x4000, - 0xc98: 0x4000, 0xc99: 0x4000, 0xc9a: 0x4000, 0xc9b: 0x4000, 0xc9c: 0x4000, 0xc9d: 0x4000, - 0xc9e: 0x4000, 0xc9f: 0x4000, 0xca0: 0x4000, 0xca1: 0x4000, 0xca2: 0x4000, 0xca3: 0x4000, - 0xca4: 0x4000, 0xca5: 0x4000, 0xca6: 0x4000, 0xca7: 0x4000, 0xca8: 0x4000, 0xca9: 0x4000, - 0xcaa: 0x4000, 0xcab: 0x4000, 0xcac: 0x4000, 0xcad: 0x4000, 0xcae: 0x4000, 0xcaf: 0x4000, - 0xcb0: 0x4000, 0xcb1: 0x4000, 0xcb2: 0x4000, 0xcb3: 0x4000, 0xcb4: 0x4000, 0xcb5: 0x4000, - 0xcb6: 0x4000, 0xcb7: 0x4000, 0xcb8: 0x4000, 0xcb9: 0x4000, 0xcba: 0x4000, 0xcbb: 0x4000, - 0xcbc: 0x4000, 0xcbd: 0x4000, 0xcbe: 0x4000, - // Block 0x33, offset 0xcc0 - 0xcc1: 0x4000, 0xcc2: 0x4000, 0xcc3: 0x4000, 0xcc4: 0x4000, 0xcc5: 0x4000, - 0xcc6: 0x4000, 0xcc7: 0x4000, 0xcc8: 0x4000, 0xcc9: 0x4000, 0xcca: 0x4000, 0xccb: 0x4000, - 0xccc: 0x4000, 0xccd: 0x4000, 0xcce: 0x4000, 0xccf: 0x4000, 0xcd0: 0x4000, 0xcd1: 0x4000, - 0xcd2: 0x4000, 0xcd3: 0x4000, 0xcd4: 0x4000, 0xcd5: 0x4000, 0xcd6: 0x4000, 0xcd7: 0x4000, - 0xcd8: 0x4000, 0xcd9: 0x4000, 0xcda: 0x4000, 0xcdb: 0x4000, 0xcdc: 0x4000, 0xcdd: 0x4000, - 0xcde: 0x4000, 0xcdf: 0x4000, 0xce0: 0x4000, 0xce1: 0x4000, 0xce2: 0x4000, 0xce3: 0x4000, - 0xce4: 0x4000, 0xce5: 0x4000, 0xce6: 0x4000, 0xce7: 0x4000, 0xce8: 0x4000, 0xce9: 0x4000, - 0xcea: 0x4000, 0xceb: 0x4000, 0xcec: 0x4000, 0xced: 0x4000, 0xcee: 0x4000, 0xcef: 0x4000, - 0xcf0: 0x4000, 0xcf1: 0x4000, 0xcf2: 0x4000, 0xcf3: 0x4000, 0xcf4: 0x4000, 0xcf5: 0x4000, - 0xcf6: 0x4000, 0xcf7: 0x4000, 0xcf8: 0x4000, 0xcf9: 0x4000, 0xcfa: 0x4000, 0xcfb: 0x4000, - 0xcfc: 0x4000, 0xcfd: 0x4000, 0xcfe: 0x4000, 0xcff: 0x4000, - // Block 0x34, offset 0xd00 - 0xd00: 0x4000, 0xd01: 0x4000, 0xd02: 0x4000, 0xd03: 0x4000, 0xd04: 0x4000, 0xd05: 0x4000, - 0xd06: 0x4000, 0xd07: 0x4000, 0xd08: 0x4000, 0xd09: 0x4000, 0xd0a: 0x4000, 0xd0b: 0x4000, - 0xd0c: 0x4000, 0xd0d: 0x4000, 0xd0e: 0x4000, 0xd0f: 0x4000, 0xd10: 0x4000, 0xd11: 0x4000, - 0xd12: 0x4000, 0xd13: 0x4000, 0xd14: 0x4000, 0xd15: 0x4000, 0xd16: 0x4000, - 0xd19: 0x4016, 0xd1a: 0x4017, 0xd1b: 0x4000, 0xd1c: 0x4000, 0xd1d: 0x4000, - 0xd1e: 0x4000, 0xd1f: 0x4000, 0xd20: 0x4000, 0xd21: 0x4018, 0xd22: 0x4019, 0xd23: 0x401a, - 0xd24: 0x401b, 0xd25: 0x401c, 0xd26: 0x401d, 0xd27: 0x401e, 0xd28: 0x401f, 0xd29: 0x4020, - 0xd2a: 0x4021, 0xd2b: 0x4022, 0xd2c: 0x4000, 0xd2d: 0x4010, 0xd2e: 0x4000, 0xd2f: 0x4023, - 0xd30: 0x4000, 0xd31: 0x4024, 0xd32: 0x4000, 0xd33: 0x4025, 0xd34: 0x4000, 0xd35: 0x4026, - 0xd36: 0x4000, 0xd37: 0x401a, 0xd38: 0x4000, 0xd39: 0x4027, 0xd3a: 0x4000, 0xd3b: 0x4028, - 0xd3c: 0x4000, 0xd3d: 0x4020, 0xd3e: 0x4000, 0xd3f: 0x4029, - // Block 0x35, offset 0xd40 - 0xd40: 0x4000, 0xd41: 0x402a, 0xd42: 0x4000, 0xd43: 0x402b, 0xd44: 0x402c, 0xd45: 0x4000, - 0xd46: 0x4017, 0xd47: 0x4000, 0xd48: 0x402d, 0xd49: 0x4000, 0xd4a: 0x402e, 0xd4b: 0x402f, - 0xd4c: 0x4030, 0xd4d: 0x4017, 0xd4e: 0x4016, 0xd4f: 0x4017, 0xd50: 0x4000, 0xd51: 0x4000, - 0xd52: 0x4031, 0xd53: 0x4000, 0xd54: 0x4000, 0xd55: 0x4031, 0xd56: 0x4000, 0xd57: 0x4000, - 0xd58: 0x4032, 0xd59: 0x4000, 0xd5a: 0x4000, 0xd5b: 0x4032, 0xd5c: 0x4000, 0xd5d: 0x4000, - 0xd5e: 0x4033, 0xd5f: 0x402e, 0xd60: 0x4034, 0xd61: 0x4035, 0xd62: 0x4034, 0xd63: 0x4036, - 0xd64: 0x4037, 0xd65: 0x4024, 0xd66: 0x4035, 0xd67: 0x4025, 0xd68: 0x4038, 0xd69: 0x4038, - 0xd6a: 0x4039, 0xd6b: 0x4039, 0xd6c: 0x403a, 0xd6d: 0x403a, 0xd6e: 0x4000, 0xd6f: 0x4035, - 0xd70: 0x4000, 0xd71: 0x4000, 0xd72: 0x403b, 0xd73: 0x403c, 0xd74: 0x4000, 0xd75: 0x4000, - 0xd76: 0x4000, 0xd77: 0x4000, 0xd78: 0x4000, 0xd79: 0x4000, 0xd7a: 0x4000, 0xd7b: 0x403d, - 0xd7c: 0x401c, 0xd7d: 0x4000, 0xd7e: 0x4000, 0xd7f: 0x4000, - // Block 0x36, offset 0xd80 - 0xd85: 0x4000, - 0xd86: 0x4000, 0xd87: 0x4000, 0xd88: 0x4000, 0xd89: 0x4000, 0xd8a: 0x4000, 0xd8b: 0x4000, - 0xd8c: 0x4000, 0xd8d: 0x4000, 0xd8e: 0x4000, 0xd8f: 0x4000, 0xd90: 0x4000, 0xd91: 0x4000, - 0xd92: 0x4000, 0xd93: 0x4000, 0xd94: 0x4000, 0xd95: 0x4000, 0xd96: 0x4000, 0xd97: 0x4000, - 0xd98: 0x4000, 0xd99: 0x4000, 0xd9a: 0x4000, 0xd9b: 0x4000, 0xd9c: 0x4000, 0xd9d: 0x4000, - 0xd9e: 0x4000, 0xd9f: 0x4000, 0xda0: 0x4000, 0xda1: 0x4000, 0xda2: 0x4000, 0xda3: 0x4000, - 0xda4: 0x4000, 0xda5: 0x4000, 0xda6: 0x4000, 0xda7: 0x4000, 0xda8: 0x4000, 0xda9: 0x4000, - 0xdaa: 0x4000, 0xdab: 0x4000, 0xdac: 0x4000, 0xdad: 0x4000, - 0xdb1: 0x403e, 0xdb2: 0x403e, 0xdb3: 0x403e, 0xdb4: 0x403e, 0xdb5: 0x403e, - 0xdb6: 0x403e, 0xdb7: 0x403e, 0xdb8: 0x403e, 0xdb9: 0x403e, 0xdba: 0x403e, 0xdbb: 0x403e, - 0xdbc: 0x403e, 0xdbd: 0x403e, 0xdbe: 0x403e, 0xdbf: 0x403e, - // Block 0x37, offset 0xdc0 - 0xdc0: 0x4037, 0xdc1: 0x4037, 0xdc2: 0x4037, 0xdc3: 0x4037, 0xdc4: 0x4037, 0xdc5: 0x4037, - 0xdc6: 0x4037, 0xdc7: 0x4037, 0xdc8: 0x4037, 0xdc9: 0x4037, 0xdca: 0x4037, 0xdcb: 0x4037, - 0xdcc: 0x4037, 0xdcd: 0x4037, 0xdce: 0x4037, 0xdcf: 0x400e, 0xdd0: 0x403f, 0xdd1: 0x4040, - 0xdd2: 0x4041, 0xdd3: 0x4040, 0xdd4: 0x403f, 0xdd5: 0x4042, 0xdd6: 0x4043, 0xdd7: 0x4044, - 0xdd8: 0x4040, 0xdd9: 0x4041, 0xdda: 0x4040, 0xddb: 0x4045, 0xddc: 0x4009, 0xddd: 0x4045, - 0xdde: 0x4046, 0xddf: 0x4045, 0xde0: 0x4047, 0xde1: 0x400b, 0xde2: 0x400a, 0xde3: 0x400c, - 0xde4: 0x4048, 0xde5: 0x4000, 0xde6: 0x4000, 0xde7: 0x4000, 0xde8: 0x4000, 0xde9: 0x4000, - 0xdea: 0x4000, 0xdeb: 0x4000, 0xdec: 0x4000, 0xded: 0x4000, 0xdee: 0x4000, 0xdef: 0x4000, - 0xdf0: 0x4000, 0xdf1: 0x4000, 0xdf2: 0x4000, 0xdf3: 0x4000, 0xdf4: 0x4000, 0xdf5: 0x4000, - 0xdf6: 0x4000, 0xdf7: 0x4000, 0xdf8: 0x4000, 0xdf9: 0x4000, 0xdfa: 0x4000, 0xdfb: 0x4000, - 0xdfc: 0x4000, 0xdfd: 0x4000, 0xdfe: 0x4000, 0xdff: 0x4000, - // Block 0x38, offset 0xe00 - 0xe00: 0x4000, 0xe01: 0x4000, 0xe02: 0x4000, 0xe03: 0x4000, 0xe04: 0x4000, 0xe05: 0x4000, - 0xe06: 0x4000, 0xe07: 0x4000, 0xe08: 0x4000, 0xe09: 0x4000, 0xe0a: 0x4000, 0xe0b: 0x4000, - 0xe0c: 0x4000, 0xe0d: 0x4000, 0xe0e: 0x4000, 0xe10: 0x4000, 0xe11: 0x4000, - 0xe12: 0x4000, 0xe13: 0x4000, 0xe14: 0x4000, 0xe15: 0x4000, 0xe16: 0x4000, 0xe17: 0x4000, - 0xe18: 0x4000, 0xe19: 0x4000, 0xe1a: 0x4000, 0xe1b: 0x4000, 0xe1c: 0x4000, 0xe1d: 0x4000, - 0xe1e: 0x4000, 0xe1f: 0x4000, 0xe20: 0x4000, 0xe21: 0x4000, 0xe22: 0x4000, 0xe23: 0x4000, - 0xe24: 0x4000, 0xe25: 0x4000, 0xe26: 0x4000, 0xe27: 0x4000, 0xe28: 0x4000, 0xe29: 0x4000, - 0xe2a: 0x4000, 0xe2b: 0x4000, 0xe2c: 0x4000, 0xe2d: 0x4000, 0xe2e: 0x4000, 0xe2f: 0x4000, - 0xe30: 0x4000, 0xe31: 0x4000, 0xe32: 0x4000, 0xe33: 0x4000, 0xe34: 0x4000, 0xe35: 0x4000, - 0xe36: 0x4000, 0xe37: 0x4000, 0xe38: 0x4000, 0xe39: 0x4000, 0xe3a: 0x4000, - // Block 0x39, offset 0xe40 - 0xe40: 0x4000, 0xe41: 0x4000, 0xe42: 0x4000, 0xe43: 0x4000, 0xe44: 0x4000, 0xe45: 0x4000, - 0xe46: 0x4000, 0xe47: 0x4000, 0xe48: 0x4000, 0xe49: 0x4000, 0xe4a: 0x4000, 0xe4b: 0x4000, - 0xe4c: 0x4000, 0xe4d: 0x4000, 0xe4e: 0x4000, 0xe4f: 0x4000, 0xe50: 0x4000, 0xe51: 0x4000, - 0xe52: 0x4000, 0xe53: 0x4000, 0xe54: 0x4000, 0xe55: 0x4000, 0xe56: 0x4000, 0xe57: 0x4000, - 0xe58: 0x4000, 0xe59: 0x4000, 0xe5a: 0x4000, 0xe5b: 0x4000, 0xe5c: 0x4000, 0xe5d: 0x4000, - 0xe5e: 0x4000, 0xe5f: 0x4000, 0xe60: 0x4000, 0xe61: 0x4000, 0xe62: 0x4000, 0xe63: 0x4000, - 0xe70: 0x4000, 0xe71: 0x4000, 0xe72: 0x4000, 0xe73: 0x4000, 0xe74: 0x4000, 0xe75: 0x4000, - 0xe76: 0x4000, 0xe77: 0x4000, 0xe78: 0x4000, 0xe79: 0x4000, 0xe7a: 0x4000, 0xe7b: 0x4000, - 0xe7c: 0x4000, 0xe7d: 0x4000, 0xe7e: 0x4000, 0xe7f: 0x4000, - // Block 0x3a, offset 0xe80 - 0xe80: 0x4000, 0xe81: 0x4000, 0xe82: 0x4000, 0xe83: 0x4000, 0xe84: 0x4000, 0xe85: 0x4000, - 0xe86: 0x4000, 0xe87: 0x4000, 0xe88: 0x4000, 0xe89: 0x4000, 0xe8a: 0x4000, 0xe8b: 0x4000, - 0xe8c: 0x4000, 0xe8d: 0x4000, 0xe8e: 0x4000, 0xe8f: 0x4000, 0xe90: 0x4000, 0xe91: 0x4000, - 0xe92: 0x4000, 0xe93: 0x4000, 0xe94: 0x4000, 0xe95: 0x4000, 0xe96: 0x4000, 0xe97: 0x4000, - 0xe98: 0x4000, 0xe99: 0x4000, 0xe9a: 0x4000, 0xe9b: 0x4000, 0xe9c: 0x4000, 0xe9d: 0x4000, - 0xe9e: 0x4000, 0xea0: 0x4000, 0xea1: 0x4000, 0xea2: 0x4000, 0xea3: 0x4000, - 0xea4: 0x4000, 0xea5: 0x4000, 0xea6: 0x4000, 0xea7: 0x4000, 0xea8: 0x4000, 0xea9: 0x4000, - 0xeaa: 0x4000, 0xeab: 0x4000, 0xeac: 0x4000, 0xead: 0x4000, 0xeae: 0x4000, 0xeaf: 0x4000, - 0xeb0: 0x4000, 0xeb1: 0x4000, 0xeb2: 0x4000, 0xeb3: 0x4000, 0xeb4: 0x4000, 0xeb5: 0x4000, - 0xeb6: 0x4000, 0xeb7: 0x4000, 0xeb8: 0x4000, 0xeb9: 0x4000, 0xeba: 0x4000, 0xebb: 0x4000, - 0xebc: 0x4000, 0xebd: 0x4000, 0xebe: 0x4000, 0xebf: 0x4000, - // Block 0x3b, offset 0xec0 - 0xec0: 0x4000, 0xec1: 0x4000, 0xec2: 0x4000, 0xec3: 0x4000, 0xec4: 0x4000, 0xec5: 0x4000, - 0xec6: 0x4000, 0xec7: 0x4000, 0xec8: 0x2000, 0xec9: 0x2000, 0xeca: 0x2000, 0xecb: 0x2000, - 0xecc: 0x2000, 0xecd: 0x2000, 0xece: 0x2000, 0xecf: 0x2000, 0xed0: 0x4000, 0xed1: 0x4000, - 0xed2: 0x4000, 0xed3: 0x4000, 0xed4: 0x4000, 0xed5: 0x4000, 0xed6: 0x4000, 0xed7: 0x4000, - 0xed8: 0x4000, 0xed9: 0x4000, 0xeda: 0x4000, 0xedb: 0x4000, 0xedc: 0x4000, 0xedd: 0x4000, - 0xede: 0x4000, 0xedf: 0x4000, 0xee0: 0x4000, 0xee1: 0x4000, 0xee2: 0x4000, 0xee3: 0x4000, - 0xee4: 0x4000, 0xee5: 0x4000, 0xee6: 0x4000, 0xee7: 0x4000, 0xee8: 0x4000, 0xee9: 0x4000, - 0xeea: 0x4000, 0xeeb: 0x4000, 0xeec: 0x4000, 0xeed: 0x4000, 0xeee: 0x4000, 0xeef: 0x4000, - 0xef0: 0x4000, 0xef1: 0x4000, 0xef2: 0x4000, 0xef3: 0x4000, 0xef4: 0x4000, 0xef5: 0x4000, - 0xef6: 0x4000, 0xef7: 0x4000, 0xef8: 0x4000, 0xef9: 0x4000, 0xefa: 0x4000, 0xefb: 0x4000, - 0xefc: 0x4000, 0xefd: 0x4000, 0xefe: 0x4000, 0xeff: 0x4000, - // Block 0x3c, offset 0xf00 - 0xf00: 0x4000, 0xf01: 0x4000, 0xf02: 0x4000, 0xf03: 0x4000, 0xf04: 0x4000, 0xf05: 0x4000, - 0xf06: 0x4000, 0xf07: 0x4000, 0xf08: 0x4000, 0xf09: 0x4000, 0xf0a: 0x4000, 0xf0b: 0x4000, - 0xf0c: 0x4000, 0xf0d: 0x4000, 0xf0e: 0x4000, 0xf0f: 0x4000, 0xf10: 0x4000, 0xf11: 0x4000, - 0xf12: 0x4000, 0xf13: 0x4000, 0xf14: 0x4000, 0xf15: 0x4000, 0xf16: 0x4000, 0xf17: 0x4000, - 0xf18: 0x4000, 0xf19: 0x4000, 0xf1a: 0x4000, 0xf1b: 0x4000, 0xf1c: 0x4000, 0xf1d: 0x4000, - 0xf1e: 0x4000, 0xf1f: 0x4000, 0xf20: 0x4000, 0xf21: 0x4000, 0xf22: 0x4000, 0xf23: 0x4000, - 0xf24: 0x4000, 0xf25: 0x4000, 0xf26: 0x4000, 0xf27: 0x4000, 0xf28: 0x4000, 0xf29: 0x4000, - 0xf2a: 0x4000, 0xf2b: 0x4000, 0xf2c: 0x4000, 0xf2d: 0x4000, 0xf2e: 0x4000, 0xf2f: 0x4000, - 0xf30: 0x4000, 0xf31: 0x4000, 0xf32: 0x4000, 0xf33: 0x4000, 0xf34: 0x4000, 0xf35: 0x4000, - 0xf36: 0x4000, 0xf37: 0x4000, 0xf38: 0x4000, 0xf39: 0x4000, 0xf3a: 0x4000, 0xf3b: 0x4000, - 0xf3c: 0x4000, 0xf3d: 0x4000, 0xf3e: 0x4000, - // Block 0x3d, offset 0xf40 - 0xf40: 0x4000, 0xf41: 0x4000, 0xf42: 0x4000, 0xf43: 0x4000, 0xf44: 0x4000, 0xf45: 0x4000, - 0xf46: 0x4000, 0xf47: 0x4000, 0xf48: 0x4000, 0xf49: 0x4000, 0xf4a: 0x4000, 0xf4b: 0x4000, - 0xf4c: 0x4000, 0xf50: 0x4000, 0xf51: 0x4000, - 0xf52: 0x4000, 0xf53: 0x4000, 0xf54: 0x4000, 0xf55: 0x4000, 0xf56: 0x4000, 0xf57: 0x4000, - 0xf58: 0x4000, 0xf59: 0x4000, 0xf5a: 0x4000, 0xf5b: 0x4000, 0xf5c: 0x4000, 0xf5d: 0x4000, - 0xf5e: 0x4000, 0xf5f: 0x4000, 0xf60: 0x4000, 0xf61: 0x4000, 0xf62: 0x4000, 0xf63: 0x4000, - 0xf64: 0x4000, 0xf65: 0x4000, 0xf66: 0x4000, 0xf67: 0x4000, 0xf68: 0x4000, 0xf69: 0x4000, - 0xf6a: 0x4000, 0xf6b: 0x4000, 0xf6c: 0x4000, 0xf6d: 0x4000, 0xf6e: 0x4000, 0xf6f: 0x4000, - 0xf70: 0x4000, 0xf71: 0x4000, 0xf72: 0x4000, 0xf73: 0x4000, 0xf74: 0x4000, 0xf75: 0x4000, - 0xf76: 0x4000, 0xf77: 0x4000, 0xf78: 0x4000, 0xf79: 0x4000, 0xf7a: 0x4000, 0xf7b: 0x4000, - 0xf7c: 0x4000, 0xf7d: 0x4000, 0xf7e: 0x4000, 0xf7f: 0x4000, - // Block 0x3e, offset 0xf80 - 0xf80: 0x4000, 0xf81: 0x4000, 0xf82: 0x4000, 0xf83: 0x4000, 0xf84: 0x4000, 0xf85: 0x4000, - 0xf86: 0x4000, - // Block 0x3f, offset 0xfc0 - 0xfe0: 0x4000, 0xfe1: 0x4000, 0xfe2: 0x4000, 0xfe3: 0x4000, - 0xfe4: 0x4000, 0xfe5: 0x4000, 0xfe6: 0x4000, 0xfe7: 0x4000, 0xfe8: 0x4000, 0xfe9: 0x4000, - 0xfea: 0x4000, 0xfeb: 0x4000, 0xfec: 0x4000, 0xfed: 0x4000, 0xfee: 0x4000, 0xfef: 0x4000, - 0xff0: 0x4000, 0xff1: 0x4000, 0xff2: 0x4000, 0xff3: 0x4000, 0xff4: 0x4000, 0xff5: 0x4000, - 0xff6: 0x4000, 0xff7: 0x4000, 0xff8: 0x4000, 0xff9: 0x4000, 0xffa: 0x4000, 0xffb: 0x4000, - 0xffc: 0x4000, - // Block 0x40, offset 0x1000 - 0x1000: 0x4000, 0x1001: 0x4000, 0x1002: 0x4000, 0x1003: 0x4000, 0x1004: 0x4000, 0x1005: 0x4000, - 0x1006: 0x4000, 0x1007: 0x4000, 0x1008: 0x4000, 0x1009: 0x4000, 0x100a: 0x4000, 0x100b: 0x4000, - 0x100c: 0x4000, 0x100d: 0x4000, 0x100e: 0x4000, 0x100f: 0x4000, 0x1010: 0x4000, 0x1011: 0x4000, - 0x1012: 0x4000, 0x1013: 0x4000, 0x1014: 0x4000, 0x1015: 0x4000, 0x1016: 0x4000, 0x1017: 0x4000, - 0x1018: 0x4000, 0x1019: 0x4000, 0x101a: 0x4000, 0x101b: 0x4000, 0x101c: 0x4000, 0x101d: 0x4000, - 0x101e: 0x4000, 0x101f: 0x4000, 0x1020: 0x4000, 0x1021: 0x4000, 0x1022: 0x4000, 0x1023: 0x4000, - // Block 0x41, offset 0x1040 - 0x1040: 0x2000, 0x1041: 0x2000, 0x1042: 0x2000, 0x1043: 0x2000, 0x1044: 0x2000, 0x1045: 0x2000, - 0x1046: 0x2000, 0x1047: 0x2000, 0x1048: 0x2000, 0x1049: 0x2000, 0x104a: 0x2000, 0x104b: 0x2000, - 0x104c: 0x2000, 0x104d: 0x2000, 0x104e: 0x2000, 0x104f: 0x2000, 0x1050: 0x4000, 0x1051: 0x4000, - 0x1052: 0x4000, 0x1053: 0x4000, 0x1054: 0x4000, 0x1055: 0x4000, 0x1056: 0x4000, 0x1057: 0x4000, - 0x1058: 0x4000, 0x1059: 0x4000, - 0x1070: 0x4000, 0x1071: 0x4000, 0x1072: 0x4000, 0x1073: 0x4000, 0x1074: 0x4000, 0x1075: 0x4000, - 0x1076: 0x4000, 0x1077: 0x4000, 0x1078: 0x4000, 0x1079: 0x4000, 0x107a: 0x4000, 0x107b: 0x4000, - 0x107c: 0x4000, 0x107d: 0x4000, 0x107e: 0x4000, 0x107f: 0x4000, - // Block 0x42, offset 0x1080 - 0x1080: 0x4000, 0x1081: 0x4000, 0x1082: 0x4000, 0x1083: 0x4000, 0x1084: 0x4000, 0x1085: 0x4000, - 0x1086: 0x4000, 0x1087: 0x4000, 0x1088: 0x4000, 0x1089: 0x4000, 0x108a: 0x4000, 0x108b: 0x4000, - 0x108c: 0x4000, 0x108d: 0x4000, 0x108e: 0x4000, 0x108f: 0x4000, 0x1090: 0x4000, 0x1091: 0x4000, - 0x1092: 0x4000, 0x1094: 0x4000, 0x1095: 0x4000, 0x1096: 0x4000, 0x1097: 0x4000, - 0x1098: 0x4000, 0x1099: 0x4000, 0x109a: 0x4000, 0x109b: 0x4000, 0x109c: 0x4000, 0x109d: 0x4000, - 0x109e: 0x4000, 0x109f: 0x4000, 0x10a0: 0x4000, 0x10a1: 0x4000, 0x10a2: 0x4000, 0x10a3: 0x4000, - 0x10a4: 0x4000, 0x10a5: 0x4000, 0x10a6: 0x4000, 0x10a8: 0x4000, 0x10a9: 0x4000, - 0x10aa: 0x4000, 0x10ab: 0x4000, - // Block 0x43, offset 0x10c0 - 0x10c1: 0x9012, 0x10c2: 0x9012, 0x10c3: 0x9012, 0x10c4: 0x9012, 0x10c5: 0x9012, - 0x10c6: 0x9012, 0x10c7: 0x9012, 0x10c8: 0x9012, 0x10c9: 0x9012, 0x10ca: 0x9012, 0x10cb: 0x9012, - 0x10cc: 0x9012, 0x10cd: 0x9012, 0x10ce: 0x9012, 0x10cf: 0x9012, 0x10d0: 0x9012, 0x10d1: 0x9012, - 0x10d2: 0x9012, 0x10d3: 0x9012, 0x10d4: 0x9012, 0x10d5: 0x9012, 0x10d6: 0x9012, 0x10d7: 0x9012, - 0x10d8: 0x9012, 0x10d9: 0x9012, 0x10da: 0x9012, 0x10db: 0x9012, 0x10dc: 0x9012, 0x10dd: 0x9012, - 0x10de: 0x9012, 0x10df: 0x9012, 0x10e0: 0x9049, 0x10e1: 0x9049, 0x10e2: 0x9049, 0x10e3: 0x9049, - 0x10e4: 0x9049, 0x10e5: 0x9049, 0x10e6: 0x9049, 0x10e7: 0x9049, 0x10e8: 0x9049, 0x10e9: 0x9049, - 0x10ea: 0x9049, 0x10eb: 0x9049, 0x10ec: 0x9049, 0x10ed: 0x9049, 0x10ee: 0x9049, 0x10ef: 0x9049, - 0x10f0: 0x9049, 0x10f1: 0x9049, 0x10f2: 0x9049, 0x10f3: 0x9049, 0x10f4: 0x9049, 0x10f5: 0x9049, - 0x10f6: 0x9049, 0x10f7: 0x9049, 0x10f8: 0x9049, 0x10f9: 0x9049, 0x10fa: 0x9049, 0x10fb: 0x9049, - 0x10fc: 0x9049, 0x10fd: 0x9049, 0x10fe: 0x9049, 0x10ff: 0x9049, - // Block 0x44, offset 0x1100 - 0x1100: 0x9049, 0x1101: 0x9049, 0x1102: 0x9049, 0x1103: 0x9049, 0x1104: 0x9049, 0x1105: 0x9049, - 0x1106: 0x9049, 0x1107: 0x9049, 0x1108: 0x9049, 0x1109: 0x9049, 0x110a: 0x9049, 0x110b: 0x9049, - 0x110c: 0x9049, 0x110d: 0x9049, 0x110e: 0x9049, 0x110f: 0x9049, 0x1110: 0x9049, 0x1111: 0x9049, - 0x1112: 0x9049, 0x1113: 0x9049, 0x1114: 0x9049, 0x1115: 0x9049, 0x1116: 0x9049, 0x1117: 0x9049, - 0x1118: 0x9049, 0x1119: 0x9049, 0x111a: 0x9049, 0x111b: 0x9049, 0x111c: 0x9049, 0x111d: 0x9049, - 0x111e: 0x9049, 0x111f: 0x904a, 0x1120: 0x904b, 0x1121: 0xb04c, 0x1122: 0xb04d, 0x1123: 0xb04d, - 0x1124: 0xb04e, 0x1125: 0xb04f, 0x1126: 0xb050, 0x1127: 0xb051, 0x1128: 0xb052, 0x1129: 0xb053, - 0x112a: 0xb054, 0x112b: 0xb055, 0x112c: 0xb056, 0x112d: 0xb057, 0x112e: 0xb058, 0x112f: 0xb059, - 0x1130: 0xb05a, 0x1131: 0xb05b, 0x1132: 0xb05c, 0x1133: 0xb05d, 0x1134: 0xb05e, 0x1135: 0xb05f, - 0x1136: 0xb060, 0x1137: 0xb061, 0x1138: 0xb062, 0x1139: 0xb063, 0x113a: 0xb064, 0x113b: 0xb065, - 0x113c: 0xb052, 0x113d: 0xb066, 0x113e: 0xb067, 0x113f: 0xb055, - // Block 0x45, offset 0x1140 - 0x1140: 0xb068, 0x1141: 0xb069, 0x1142: 0xb06a, 0x1143: 0xb06b, 0x1144: 0xb05a, 0x1145: 0xb056, - 0x1146: 0xb06c, 0x1147: 0xb06d, 0x1148: 0xb06b, 0x1149: 0xb06e, 0x114a: 0xb06b, 0x114b: 0xb06f, - 0x114c: 0xb06f, 0x114d: 0xb070, 0x114e: 0xb070, 0x114f: 0xb071, 0x1150: 0xb056, 0x1151: 0xb072, - 0x1152: 0xb073, 0x1153: 0xb072, 0x1154: 0xb074, 0x1155: 0xb073, 0x1156: 0xb075, 0x1157: 0xb075, - 0x1158: 0xb076, 0x1159: 0xb076, 0x115a: 0xb077, 0x115b: 0xb077, 0x115c: 0xb073, 0x115d: 0xb078, - 0x115e: 0xb079, 0x115f: 0xb067, 0x1160: 0xb07a, 0x1161: 0xb07b, 0x1162: 0xb07b, 0x1163: 0xb07b, - 0x1164: 0xb07b, 0x1165: 0xb07b, 0x1166: 0xb07b, 0x1167: 0xb07b, 0x1168: 0xb07b, 0x1169: 0xb07b, - 0x116a: 0xb07b, 0x116b: 0xb07b, 0x116c: 0xb07b, 0x116d: 0xb07b, 0x116e: 0xb07b, 0x116f: 0xb07b, - 0x1170: 0xb07c, 0x1171: 0xb07c, 0x1172: 0xb07c, 0x1173: 0xb07c, 0x1174: 0xb07c, 0x1175: 0xb07c, - 0x1176: 0xb07c, 0x1177: 0xb07c, 0x1178: 0xb07c, 0x1179: 0xb07c, 0x117a: 0xb07c, 0x117b: 0xb07c, - 0x117c: 0xb07c, 0x117d: 0xb07c, 0x117e: 0xb07c, - // Block 0x46, offset 0x1180 - 0x1182: 0xb07d, 0x1183: 0xb07e, 0x1184: 0xb07f, 0x1185: 0xb080, - 0x1186: 0xb07f, 0x1187: 0xb07e, 0x118a: 0xb081, 0x118b: 0xb082, - 0x118c: 0xb083, 0x118d: 0xb07f, 0x118e: 0xb080, 0x118f: 0xb07f, - 0x1192: 0xb084, 0x1193: 0xb085, 0x1194: 0xb084, 0x1195: 0xb086, 0x1196: 0xb084, 0x1197: 0xb087, - 0x119a: 0xb088, 0x119b: 0xb089, 0x119c: 0xb08a, - 0x11a0: 0x908b, 0x11a1: 0x908b, 0x11a2: 0x908c, 0x11a3: 0x908d, - 0x11a4: 0x908b, 0x11a5: 0x908e, 0x11a6: 0x908f, 0x11a8: 0xb090, 0x11a9: 0xb091, - 0x11aa: 0xb092, 0x11ab: 0xb091, 0x11ac: 0xb093, 0x11ad: 0xb094, 0x11ae: 0xb095, - 0x11bd: 0x2000, - // Block 0x47, offset 0x11c0 - 0x11e0: 0x4000, - // Block 0x48, offset 0x1200 - 0x1200: 0x4000, 0x1201: 0x4000, 0x1202: 0x4000, 0x1203: 0x4000, 0x1204: 0x4000, 0x1205: 0x4000, - 0x1206: 0x4000, 0x1207: 0x4000, 0x1208: 0x4000, 0x1209: 0x4000, 0x120a: 0x4000, 0x120b: 0x4000, - 0x120c: 0x4000, 0x120d: 0x4000, 0x120e: 0x4000, 0x120f: 0x4000, 0x1210: 0x4000, 0x1211: 0x4000, - 0x1212: 0x4000, 0x1213: 0x4000, 0x1214: 0x4000, 0x1215: 0x4000, 0x1216: 0x4000, 0x1217: 0x4000, - 0x1218: 0x4000, 0x1219: 0x4000, 0x121a: 0x4000, 0x121b: 0x4000, 0x121c: 0x4000, 0x121d: 0x4000, - 0x121e: 0x4000, 0x121f: 0x4000, 0x1220: 0x4000, 0x1221: 0x4000, 0x1222: 0x4000, 0x1223: 0x4000, - 0x1224: 0x4000, 0x1225: 0x4000, 0x1226: 0x4000, 0x1227: 0x4000, 0x1228: 0x4000, 0x1229: 0x4000, - 0x122a: 0x4000, 0x122b: 0x4000, 0x122c: 0x4000, - // Block 0x49, offset 0x1240 - 0x1240: 0x4000, 0x1241: 0x4000, 0x1242: 0x4000, 0x1243: 0x4000, 0x1244: 0x4000, 0x1245: 0x4000, - 0x1246: 0x4000, 0x1247: 0x4000, 0x1248: 0x4000, 0x1249: 0x4000, 0x124a: 0x4000, 0x124b: 0x4000, - 0x124c: 0x4000, 0x124d: 0x4000, 0x124e: 0x4000, 0x124f: 0x4000, 0x1250: 0x4000, 0x1251: 0x4000, - 0x1252: 0x4000, 0x1253: 0x4000, 0x1254: 0x4000, 0x1255: 0x4000, 0x1256: 0x4000, 0x1257: 0x4000, - 0x1258: 0x4000, 0x1259: 0x4000, 0x125a: 0x4000, 0x125b: 0x4000, 0x125c: 0x4000, 0x125d: 0x4000, - 0x125e: 0x4000, 0x125f: 0x4000, 0x1260: 0x4000, 0x1261: 0x4000, 0x1262: 0x4000, 0x1263: 0x4000, - 0x1264: 0x4000, 0x1265: 0x4000, 0x1266: 0x4000, 0x1267: 0x4000, 0x1268: 0x4000, 0x1269: 0x4000, - 0x126a: 0x4000, 0x126b: 0x4000, 0x126c: 0x4000, 0x126d: 0x4000, 0x126e: 0x4000, 0x126f: 0x4000, - 0x1270: 0x4000, 0x1271: 0x4000, 0x1272: 0x4000, - // Block 0x4a, offset 0x1280 - 0x1280: 0x4000, 0x1281: 0x4000, - // Block 0x4b, offset 0x12c0 - 0x12c4: 0x4000, - // Block 0x4c, offset 0x1300 - 0x130f: 0x4000, - // Block 0x4d, offset 0x1340 - 0x1340: 0x2000, 0x1341: 0x2000, 0x1342: 0x2000, 0x1343: 0x2000, 0x1344: 0x2000, 0x1345: 0x2000, - 0x1346: 0x2000, 0x1347: 0x2000, 0x1348: 0x2000, 0x1349: 0x2000, 0x134a: 0x2000, - 0x1350: 0x2000, 0x1351: 0x2000, - 0x1352: 0x2000, 0x1353: 0x2000, 0x1354: 0x2000, 0x1355: 0x2000, 0x1356: 0x2000, 0x1357: 0x2000, - 0x1358: 0x2000, 0x1359: 0x2000, 0x135a: 0x2000, 0x135b: 0x2000, 0x135c: 0x2000, 0x135d: 0x2000, - 0x135e: 0x2000, 0x135f: 0x2000, 0x1360: 0x2000, 0x1361: 0x2000, 0x1362: 0x2000, 0x1363: 0x2000, - 0x1364: 0x2000, 0x1365: 0x2000, 0x1366: 0x2000, 0x1367: 0x2000, 0x1368: 0x2000, 0x1369: 0x2000, - 0x136a: 0x2000, 0x136b: 0x2000, 0x136c: 0x2000, 0x136d: 0x2000, - 0x1370: 0x2000, 0x1371: 0x2000, 0x1372: 0x2000, 0x1373: 0x2000, 0x1374: 0x2000, 0x1375: 0x2000, - 0x1376: 0x2000, 0x1377: 0x2000, 0x1378: 0x2000, 0x1379: 0x2000, 0x137a: 0x2000, 0x137b: 0x2000, - 0x137c: 0x2000, 0x137d: 0x2000, 0x137e: 0x2000, 0x137f: 0x2000, - // Block 0x4e, offset 0x1380 - 0x1380: 0x2000, 0x1381: 0x2000, 0x1382: 0x2000, 0x1383: 0x2000, 0x1384: 0x2000, 0x1385: 0x2000, - 0x1386: 0x2000, 0x1387: 0x2000, 0x1388: 0x2000, 0x1389: 0x2000, 0x138a: 0x2000, 0x138b: 0x2000, - 0x138c: 0x2000, 0x138d: 0x2000, 0x138e: 0x2000, 0x138f: 0x2000, 0x1390: 0x2000, 0x1391: 0x2000, - 0x1392: 0x2000, 0x1393: 0x2000, 0x1394: 0x2000, 0x1395: 0x2000, 0x1396: 0x2000, 0x1397: 0x2000, - 0x1398: 0x2000, 0x1399: 0x2000, 0x139a: 0x2000, 0x139b: 0x2000, 0x139c: 0x2000, 0x139d: 0x2000, - 0x139e: 0x2000, 0x139f: 0x2000, 0x13a0: 0x2000, 0x13a1: 0x2000, 0x13a2: 0x2000, 0x13a3: 0x2000, - 0x13a4: 0x2000, 0x13a5: 0x2000, 0x13a6: 0x2000, 0x13a7: 0x2000, 0x13a8: 0x2000, 0x13a9: 0x2000, - 0x13b0: 0x2000, 0x13b1: 0x2000, 0x13b2: 0x2000, 0x13b3: 0x2000, 0x13b4: 0x2000, 0x13b5: 0x2000, - 0x13b6: 0x2000, 0x13b7: 0x2000, 0x13b8: 0x2000, 0x13b9: 0x2000, 0x13ba: 0x2000, 0x13bb: 0x2000, - 0x13bc: 0x2000, 0x13bd: 0x2000, 0x13be: 0x2000, 0x13bf: 0x2000, - // Block 0x4f, offset 0x13c0 - 0x13c0: 0x2000, 0x13c1: 0x2000, 0x13c2: 0x2000, 0x13c3: 0x2000, 0x13c4: 0x2000, 0x13c5: 0x2000, - 0x13c6: 0x2000, 0x13c7: 0x2000, 0x13c8: 0x2000, 0x13c9: 0x2000, 0x13ca: 0x2000, 0x13cb: 0x2000, - 0x13cc: 0x2000, 0x13cd: 0x2000, 0x13ce: 0x4000, 0x13cf: 0x2000, 0x13d0: 0x2000, 0x13d1: 0x4000, - 0x13d2: 0x4000, 0x13d3: 0x4000, 0x13d4: 0x4000, 0x13d5: 0x4000, 0x13d6: 0x4000, 0x13d7: 0x4000, - 0x13d8: 0x4000, 0x13d9: 0x4000, 0x13da: 0x4000, 0x13db: 0x2000, 0x13dc: 0x2000, 0x13dd: 0x2000, - 0x13de: 0x2000, 0x13df: 0x2000, 0x13e0: 0x2000, 0x13e1: 0x2000, 0x13e2: 0x2000, 0x13e3: 0x2000, - 0x13e4: 0x2000, 0x13e5: 0x2000, 0x13e6: 0x2000, 0x13e7: 0x2000, 0x13e8: 0x2000, 0x13e9: 0x2000, - 0x13ea: 0x2000, 0x13eb: 0x2000, 0x13ec: 0x2000, - // Block 0x50, offset 0x1400 - 0x1400: 0x4000, 0x1401: 0x4000, 0x1402: 0x4000, - 0x1410: 0x4000, 0x1411: 0x4000, - 0x1412: 0x4000, 0x1413: 0x4000, 0x1414: 0x4000, 0x1415: 0x4000, 0x1416: 0x4000, 0x1417: 0x4000, - 0x1418: 0x4000, 0x1419: 0x4000, 0x141a: 0x4000, 0x141b: 0x4000, 0x141c: 0x4000, 0x141d: 0x4000, - 0x141e: 0x4000, 0x141f: 0x4000, 0x1420: 0x4000, 0x1421: 0x4000, 0x1422: 0x4000, 0x1423: 0x4000, - 0x1424: 0x4000, 0x1425: 0x4000, 0x1426: 0x4000, 0x1427: 0x4000, 0x1428: 0x4000, 0x1429: 0x4000, - 0x142a: 0x4000, 0x142b: 0x4000, 0x142c: 0x4000, 0x142d: 0x4000, 0x142e: 0x4000, 0x142f: 0x4000, - 0x1430: 0x4000, 0x1431: 0x4000, 0x1432: 0x4000, 0x1433: 0x4000, 0x1434: 0x4000, 0x1435: 0x4000, - 0x1436: 0x4000, 0x1437: 0x4000, 0x1438: 0x4000, 0x1439: 0x4000, 0x143a: 0x4000, 0x143b: 0x4000, - // Block 0x51, offset 0x1440 - 0x1440: 0x4000, 0x1441: 0x4000, 0x1442: 0x4000, 0x1443: 0x4000, 0x1444: 0x4000, 0x1445: 0x4000, - 0x1446: 0x4000, 0x1447: 0x4000, 0x1448: 0x4000, - 0x1450: 0x4000, 0x1451: 0x4000, - // Block 0x52, offset 0x1480 - 0x1480: 0x4000, 0x1481: 0x4000, 0x1482: 0x4000, 0x1483: 0x4000, 0x1484: 0x4000, 0x1485: 0x4000, - 0x1486: 0x4000, 0x1487: 0x4000, 0x1488: 0x4000, 0x1489: 0x4000, 0x148a: 0x4000, 0x148b: 0x4000, - 0x148c: 0x4000, 0x148d: 0x4000, 0x148e: 0x4000, 0x148f: 0x4000, 0x1490: 0x4000, 0x1491: 0x4000, - 0x1492: 0x4000, 0x1493: 0x4000, 0x1494: 0x4000, 0x1495: 0x4000, 0x1496: 0x4000, 0x1497: 0x4000, - 0x1498: 0x4000, 0x1499: 0x4000, 0x149a: 0x4000, 0x149b: 0x4000, 0x149c: 0x4000, 0x149d: 0x4000, - 0x149e: 0x4000, 0x149f: 0x4000, 0x14a0: 0x4000, - 0x14ad: 0x4000, 0x14ae: 0x4000, 0x14af: 0x4000, - 0x14b0: 0x4000, 0x14b1: 0x4000, 0x14b2: 0x4000, 0x14b3: 0x4000, 0x14b4: 0x4000, 0x14b5: 0x4000, - 0x14b7: 0x4000, 0x14b8: 0x4000, 0x14b9: 0x4000, 0x14ba: 0x4000, 0x14bb: 0x4000, - 0x14bc: 0x4000, 0x14bd: 0x4000, 0x14be: 0x4000, 0x14bf: 0x4000, - // Block 0x53, offset 0x14c0 - 0x14c0: 0x4000, 0x14c1: 0x4000, 0x14c2: 0x4000, 0x14c3: 0x4000, 0x14c4: 0x4000, 0x14c5: 0x4000, - 0x14c6: 0x4000, 0x14c7: 0x4000, 0x14c8: 0x4000, 0x14c9: 0x4000, 0x14ca: 0x4000, 0x14cb: 0x4000, - 0x14cc: 0x4000, 0x14cd: 0x4000, 0x14ce: 0x4000, 0x14cf: 0x4000, 0x14d0: 0x4000, 0x14d1: 0x4000, - 0x14d2: 0x4000, 0x14d3: 0x4000, 0x14d4: 0x4000, 0x14d5: 0x4000, 0x14d6: 0x4000, 0x14d7: 0x4000, - 0x14d8: 0x4000, 0x14d9: 0x4000, 0x14da: 0x4000, 0x14db: 0x4000, 0x14dc: 0x4000, 0x14dd: 0x4000, - 0x14de: 0x4000, 0x14df: 0x4000, 0x14e0: 0x4000, 0x14e1: 0x4000, 0x14e2: 0x4000, 0x14e3: 0x4000, - 0x14e4: 0x4000, 0x14e5: 0x4000, 0x14e6: 0x4000, 0x14e7: 0x4000, 0x14e8: 0x4000, 0x14e9: 0x4000, - 0x14ea: 0x4000, 0x14eb: 0x4000, 0x14ec: 0x4000, 0x14ed: 0x4000, 0x14ee: 0x4000, 0x14ef: 0x4000, - 0x14f0: 0x4000, 0x14f1: 0x4000, 0x14f2: 0x4000, 0x14f3: 0x4000, 0x14f4: 0x4000, 0x14f5: 0x4000, - 0x14f6: 0x4000, 0x14f7: 0x4000, 0x14f8: 0x4000, 0x14f9: 0x4000, 0x14fa: 0x4000, 0x14fb: 0x4000, - 0x14fc: 0x4000, 0x14fe: 0x4000, 0x14ff: 0x4000, - // Block 0x54, offset 0x1500 - 0x1500: 0x4000, 0x1501: 0x4000, 0x1502: 0x4000, 0x1503: 0x4000, 0x1504: 0x4000, 0x1505: 0x4000, - 0x1506: 0x4000, 0x1507: 0x4000, 0x1508: 0x4000, 0x1509: 0x4000, 0x150a: 0x4000, 0x150b: 0x4000, - 0x150c: 0x4000, 0x150d: 0x4000, 0x150e: 0x4000, 0x150f: 0x4000, 0x1510: 0x4000, 0x1511: 0x4000, - 0x1512: 0x4000, 0x1513: 0x4000, - 0x1520: 0x4000, 0x1521: 0x4000, 0x1522: 0x4000, 0x1523: 0x4000, - 0x1524: 0x4000, 0x1525: 0x4000, 0x1526: 0x4000, 0x1527: 0x4000, 0x1528: 0x4000, 0x1529: 0x4000, - 0x152a: 0x4000, 0x152b: 0x4000, 0x152c: 0x4000, 0x152d: 0x4000, 0x152e: 0x4000, 0x152f: 0x4000, - 0x1530: 0x4000, 0x1531: 0x4000, 0x1532: 0x4000, 0x1533: 0x4000, 0x1534: 0x4000, 0x1535: 0x4000, - 0x1536: 0x4000, 0x1537: 0x4000, 0x1538: 0x4000, 0x1539: 0x4000, 0x153a: 0x4000, 0x153b: 0x4000, - 0x153c: 0x4000, 0x153d: 0x4000, 0x153e: 0x4000, 0x153f: 0x4000, - // Block 0x55, offset 0x1540 - 0x1540: 0x4000, 0x1541: 0x4000, 0x1542: 0x4000, 0x1543: 0x4000, 0x1544: 0x4000, 0x1545: 0x4000, - 0x1546: 0x4000, 0x1547: 0x4000, 0x1548: 0x4000, 0x1549: 0x4000, 0x154a: 0x4000, - 0x154f: 0x4000, 0x1550: 0x4000, 0x1551: 0x4000, - 0x1552: 0x4000, 0x1553: 0x4000, - 0x1560: 0x4000, 0x1561: 0x4000, 0x1562: 0x4000, 0x1563: 0x4000, - 0x1564: 0x4000, 0x1565: 0x4000, 0x1566: 0x4000, 0x1567: 0x4000, 0x1568: 0x4000, 0x1569: 0x4000, - 0x156a: 0x4000, 0x156b: 0x4000, 0x156c: 0x4000, 0x156d: 0x4000, 0x156e: 0x4000, 0x156f: 0x4000, - 0x1570: 0x4000, 0x1574: 0x4000, - 0x1578: 0x4000, 0x1579: 0x4000, 0x157a: 0x4000, 0x157b: 0x4000, - 0x157c: 0x4000, 0x157d: 0x4000, 0x157e: 0x4000, 0x157f: 0x4000, - // Block 0x56, offset 0x1580 - 0x1580: 0x4000, 0x1582: 0x4000, 0x1583: 0x4000, 0x1584: 0x4000, 0x1585: 0x4000, - 0x1586: 0x4000, 0x1587: 0x4000, 0x1588: 0x4000, 0x1589: 0x4000, 0x158a: 0x4000, 0x158b: 0x4000, - 0x158c: 0x4000, 0x158d: 0x4000, 0x158e: 0x4000, 0x158f: 0x4000, 0x1590: 0x4000, 0x1591: 0x4000, - 0x1592: 0x4000, 0x1593: 0x4000, 0x1594: 0x4000, 0x1595: 0x4000, 0x1596: 0x4000, 0x1597: 0x4000, - 0x1598: 0x4000, 0x1599: 0x4000, 0x159a: 0x4000, 0x159b: 0x4000, 0x159c: 0x4000, 0x159d: 0x4000, - 0x159e: 0x4000, 0x159f: 0x4000, 0x15a0: 0x4000, 0x15a1: 0x4000, 0x15a2: 0x4000, 0x15a3: 0x4000, - 0x15a4: 0x4000, 0x15a5: 0x4000, 0x15a6: 0x4000, 0x15a7: 0x4000, 0x15a8: 0x4000, 0x15a9: 0x4000, - 0x15aa: 0x4000, 0x15ab: 0x4000, 0x15ac: 0x4000, 0x15ad: 0x4000, 0x15ae: 0x4000, 0x15af: 0x4000, - 0x15b0: 0x4000, 0x15b1: 0x4000, 0x15b2: 0x4000, 0x15b3: 0x4000, 0x15b4: 0x4000, 0x15b5: 0x4000, - 0x15b6: 0x4000, 0x15b7: 0x4000, 0x15b8: 0x4000, 0x15b9: 0x4000, 0x15ba: 0x4000, 0x15bb: 0x4000, - 0x15bc: 0x4000, 0x15bd: 0x4000, 0x15be: 0x4000, 0x15bf: 0x4000, - // Block 0x57, offset 0x15c0 - 0x15c0: 0x4000, 0x15c1: 0x4000, 0x15c2: 0x4000, 0x15c3: 0x4000, 0x15c4: 0x4000, 0x15c5: 0x4000, - 0x15c6: 0x4000, 0x15c7: 0x4000, 0x15c8: 0x4000, 0x15c9: 0x4000, 0x15ca: 0x4000, 0x15cb: 0x4000, - 0x15cc: 0x4000, 0x15cd: 0x4000, 0x15ce: 0x4000, 0x15cf: 0x4000, 0x15d0: 0x4000, 0x15d1: 0x4000, - 0x15d2: 0x4000, 0x15d3: 0x4000, 0x15d4: 0x4000, 0x15d5: 0x4000, 0x15d6: 0x4000, 0x15d7: 0x4000, - 0x15d8: 0x4000, 0x15d9: 0x4000, 0x15da: 0x4000, 0x15db: 0x4000, 0x15dc: 0x4000, 0x15dd: 0x4000, - 0x15de: 0x4000, 0x15df: 0x4000, 0x15e0: 0x4000, 0x15e1: 0x4000, 0x15e2: 0x4000, 0x15e3: 0x4000, - 0x15e4: 0x4000, 0x15e5: 0x4000, 0x15e6: 0x4000, 0x15e7: 0x4000, 0x15e8: 0x4000, 0x15e9: 0x4000, - 0x15ea: 0x4000, 0x15eb: 0x4000, 0x15ec: 0x4000, 0x15ed: 0x4000, 0x15ee: 0x4000, 0x15ef: 0x4000, - 0x15f0: 0x4000, 0x15f1: 0x4000, 0x15f2: 0x4000, 0x15f3: 0x4000, 0x15f4: 0x4000, 0x15f5: 0x4000, - 0x15f6: 0x4000, 0x15f7: 0x4000, 0x15f8: 0x4000, 0x15f9: 0x4000, 0x15fa: 0x4000, 0x15fb: 0x4000, - 0x15fc: 0x4000, 0x15ff: 0x4000, - // Block 0x58, offset 0x1600 - 0x1600: 0x4000, 0x1601: 0x4000, 0x1602: 0x4000, 0x1603: 0x4000, 0x1604: 0x4000, 0x1605: 0x4000, - 0x1606: 0x4000, 0x1607: 0x4000, 0x1608: 0x4000, 0x1609: 0x4000, 0x160a: 0x4000, 0x160b: 0x4000, - 0x160c: 0x4000, 0x160d: 0x4000, 0x160e: 0x4000, 0x160f: 0x4000, 0x1610: 0x4000, 0x1611: 0x4000, - 0x1612: 0x4000, 0x1613: 0x4000, 0x1614: 0x4000, 0x1615: 0x4000, 0x1616: 0x4000, 0x1617: 0x4000, - 0x1618: 0x4000, 0x1619: 0x4000, 0x161a: 0x4000, 0x161b: 0x4000, 0x161c: 0x4000, 0x161d: 0x4000, - 0x161e: 0x4000, 0x161f: 0x4000, 0x1620: 0x4000, 0x1621: 0x4000, 0x1622: 0x4000, 0x1623: 0x4000, - 0x1624: 0x4000, 0x1625: 0x4000, 0x1626: 0x4000, 0x1627: 0x4000, 0x1628: 0x4000, 0x1629: 0x4000, - 0x162a: 0x4000, 0x162b: 0x4000, 0x162c: 0x4000, 0x162d: 0x4000, 0x162e: 0x4000, 0x162f: 0x4000, - 0x1630: 0x4000, 0x1631: 0x4000, 0x1632: 0x4000, 0x1633: 0x4000, 0x1634: 0x4000, 0x1635: 0x4000, - 0x1636: 0x4000, 0x1637: 0x4000, 0x1638: 0x4000, 0x1639: 0x4000, 0x163a: 0x4000, 0x163b: 0x4000, - 0x163c: 0x4000, 0x163d: 0x4000, - // Block 0x59, offset 0x1640 - 0x164b: 0x4000, - 0x164c: 0x4000, 0x164d: 0x4000, 0x164e: 0x4000, 0x1650: 0x4000, 0x1651: 0x4000, - 0x1652: 0x4000, 0x1653: 0x4000, 0x1654: 0x4000, 0x1655: 0x4000, 0x1656: 0x4000, 0x1657: 0x4000, - 0x1658: 0x4000, 0x1659: 0x4000, 0x165a: 0x4000, 0x165b: 0x4000, 0x165c: 0x4000, 0x165d: 0x4000, - 0x165e: 0x4000, 0x165f: 0x4000, 0x1660: 0x4000, 0x1661: 0x4000, 0x1662: 0x4000, 0x1663: 0x4000, - 0x1664: 0x4000, 0x1665: 0x4000, 0x1666: 0x4000, 0x1667: 0x4000, - 0x167a: 0x4000, - // Block 0x5a, offset 0x1680 - 0x1695: 0x4000, 0x1696: 0x4000, - 0x16a4: 0x4000, - // Block 0x5b, offset 0x16c0 - 0x16fb: 0x4000, - 0x16fc: 0x4000, 0x16fd: 0x4000, 0x16fe: 0x4000, 0x16ff: 0x4000, - // Block 0x5c, offset 0x1700 - 0x1700: 0x4000, 0x1701: 0x4000, 0x1702: 0x4000, 0x1703: 0x4000, 0x1704: 0x4000, 0x1705: 0x4000, - 0x1706: 0x4000, 0x1707: 0x4000, 0x1708: 0x4000, 0x1709: 0x4000, 0x170a: 0x4000, 0x170b: 0x4000, - 0x170c: 0x4000, 0x170d: 0x4000, 0x170e: 0x4000, 0x170f: 0x4000, - // Block 0x5d, offset 0x1740 - 0x1740: 0x4000, 0x1741: 0x4000, 0x1742: 0x4000, 0x1743: 0x4000, 0x1744: 0x4000, 0x1745: 0x4000, - 0x174c: 0x4000, 0x1750: 0x4000, 0x1751: 0x4000, - 0x1752: 0x4000, - 0x176b: 0x4000, 0x176c: 0x4000, - 0x1774: 0x4000, 0x1775: 0x4000, - 0x1776: 0x4000, - // Block 0x5e, offset 0x1780 - 0x1790: 0x4000, 0x1791: 0x4000, - 0x1792: 0x4000, 0x1793: 0x4000, 0x1794: 0x4000, 0x1795: 0x4000, 0x1796: 0x4000, 0x1797: 0x4000, - 0x1798: 0x4000, 0x1799: 0x4000, 0x179a: 0x4000, 0x179b: 0x4000, 0x179c: 0x4000, 0x179d: 0x4000, - 0x179e: 0x4000, 0x17a0: 0x4000, 0x17a1: 0x4000, 0x17a2: 0x4000, 0x17a3: 0x4000, - 0x17a4: 0x4000, 0x17a5: 0x4000, 0x17a6: 0x4000, 0x17a7: 0x4000, - 0x17b0: 0x4000, 0x17b3: 0x4000, 0x17b4: 0x4000, 0x17b5: 0x4000, - 0x17b6: 0x4000, 0x17b7: 0x4000, 0x17b8: 0x4000, 0x17b9: 0x4000, 0x17ba: 0x4000, 0x17bb: 0x4000, - 0x17bc: 0x4000, 0x17bd: 0x4000, 0x17be: 0x4000, - // Block 0x5f, offset 0x17c0 - 0x17c0: 0x4000, 0x17c1: 0x4000, 0x17c2: 0x4000, 0x17c3: 0x4000, 0x17c4: 0x4000, 0x17c5: 0x4000, - 0x17c6: 0x4000, 0x17c7: 0x4000, 0x17c8: 0x4000, 0x17c9: 0x4000, 0x17ca: 0x4000, 0x17cb: 0x4000, - 0x17d0: 0x4000, 0x17d1: 0x4000, - 0x17d2: 0x4000, 0x17d3: 0x4000, 0x17d4: 0x4000, 0x17d5: 0x4000, 0x17d6: 0x4000, 0x17d7: 0x4000, - 0x17d8: 0x4000, 0x17d9: 0x4000, 0x17da: 0x4000, 0x17db: 0x4000, 0x17dc: 0x4000, 0x17dd: 0x4000, - 0x17de: 0x4000, - // Block 0x60, offset 0x1800 - 0x1800: 0x4000, 0x1801: 0x4000, 0x1802: 0x4000, 0x1803: 0x4000, 0x1804: 0x4000, 0x1805: 0x4000, - 0x1806: 0x4000, 0x1807: 0x4000, 0x1808: 0x4000, 0x1809: 0x4000, 0x180a: 0x4000, 0x180b: 0x4000, - 0x180c: 0x4000, 0x180d: 0x4000, 0x180e: 0x4000, 0x180f: 0x4000, 0x1810: 0x4000, 0x1811: 0x4000, - // Block 0x61, offset 0x1840 - 0x1840: 0x4000, - // Block 0x62, offset 0x1880 - 0x1880: 0x2000, 0x1881: 0x2000, 0x1882: 0x2000, 0x1883: 0x2000, 0x1884: 0x2000, 0x1885: 0x2000, - 0x1886: 0x2000, 0x1887: 0x2000, 0x1888: 0x2000, 0x1889: 0x2000, 0x188a: 0x2000, 0x188b: 0x2000, - 0x188c: 0x2000, 0x188d: 0x2000, 0x188e: 0x2000, 0x188f: 0x2000, 0x1890: 0x2000, 0x1891: 0x2000, - 0x1892: 0x2000, 0x1893: 0x2000, 0x1894: 0x2000, 0x1895: 0x2000, 0x1896: 0x2000, 0x1897: 0x2000, - 0x1898: 0x2000, 0x1899: 0x2000, 0x189a: 0x2000, 0x189b: 0x2000, 0x189c: 0x2000, 0x189d: 0x2000, - 0x189e: 0x2000, 0x189f: 0x2000, 0x18a0: 0x2000, 0x18a1: 0x2000, 0x18a2: 0x2000, 0x18a3: 0x2000, - 0x18a4: 0x2000, 0x18a5: 0x2000, 0x18a6: 0x2000, 0x18a7: 0x2000, 0x18a8: 0x2000, 0x18a9: 0x2000, - 0x18aa: 0x2000, 0x18ab: 0x2000, 0x18ac: 0x2000, 0x18ad: 0x2000, 0x18ae: 0x2000, 0x18af: 0x2000, - 0x18b0: 0x2000, 0x18b1: 0x2000, 0x18b2: 0x2000, 0x18b3: 0x2000, 0x18b4: 0x2000, 0x18b5: 0x2000, - 0x18b6: 0x2000, 0x18b7: 0x2000, 0x18b8: 0x2000, 0x18b9: 0x2000, 0x18ba: 0x2000, 0x18bb: 0x2000, - 0x18bc: 0x2000, 0x18bd: 0x2000, -} - -// widthIndex: 22 blocks, 1408 entries, 1408 bytes -// Block 0 is the zero block. -var widthIndex = [1408]uint8{ - // Block 0x0, offset 0x0 - // Block 0x1, offset 0x40 - // Block 0x2, offset 0x80 - // Block 0x3, offset 0xc0 - 0xc2: 0x01, 0xc3: 0x02, 0xc4: 0x03, 0xc5: 0x04, 0xc7: 0x05, - 0xc9: 0x06, 0xcb: 0x07, 0xcc: 0x08, 0xcd: 0x09, 0xce: 0x0a, 0xcf: 0x0b, - 0xd0: 0x0c, 0xd1: 0x0d, - 0xe1: 0x02, 0xe2: 0x03, 0xe3: 0x04, 0xe4: 0x05, 0xe5: 0x06, 0xe6: 0x06, 0xe7: 0x06, - 0xe8: 0x06, 0xe9: 0x06, 0xea: 0x07, 0xeb: 0x06, 0xec: 0x06, 0xed: 0x08, 0xee: 0x09, 0xef: 0x0a, - 0xf0: 0x0f, 0xf3: 0x12, 0xf4: 0x13, - // Block 0x4, offset 0x100 - 0x104: 0x0e, 0x105: 0x0f, - // Block 0x5, offset 0x140 - 0x140: 0x10, 0x141: 0x11, 0x142: 0x12, 0x144: 0x13, 0x145: 0x14, 0x146: 0x15, 0x147: 0x16, - 0x148: 0x17, 0x149: 0x18, 0x14a: 0x19, 0x14c: 0x1a, 0x14f: 0x1b, - 0x151: 0x1c, 0x152: 0x08, 0x153: 0x1d, 0x154: 0x1e, 0x155: 0x1f, 0x156: 0x20, 0x157: 0x21, - 0x158: 0x22, 0x159: 0x23, 0x15a: 0x24, 0x15b: 0x25, 0x15c: 0x26, 0x15d: 0x27, 0x15e: 0x28, 0x15f: 0x29, - 0x166: 0x2a, - 0x16c: 0x2b, 0x16d: 0x2c, - 0x17a: 0x2d, 0x17b: 0x2e, 0x17c: 0x0e, 0x17d: 0x0e, 0x17e: 0x0e, 0x17f: 0x2f, - // Block 0x6, offset 0x180 - 0x180: 0x30, 0x181: 0x31, 0x182: 0x32, 0x183: 0x33, 0x184: 0x34, 0x185: 0x35, 0x186: 0x36, 0x187: 0x37, - 0x188: 0x38, 0x189: 0x39, 0x18a: 0x0e, 0x18b: 0x3a, 0x18c: 0x0e, 0x18d: 0x0e, 0x18e: 0x0e, 0x18f: 0x0e, - 0x190: 0x0e, 0x191: 0x0e, 0x192: 0x0e, 0x193: 0x0e, 0x194: 0x0e, 0x195: 0x0e, 0x196: 0x0e, 0x197: 0x0e, - 0x198: 0x0e, 0x199: 0x0e, 0x19a: 0x0e, 0x19b: 0x0e, 0x19c: 0x0e, 0x19d: 0x0e, 0x19e: 0x0e, 0x19f: 0x0e, - 0x1a0: 0x0e, 0x1a1: 0x0e, 0x1a2: 0x0e, 0x1a3: 0x0e, 0x1a4: 0x0e, 0x1a5: 0x0e, 0x1a6: 0x0e, 0x1a7: 0x0e, - 0x1a8: 0x0e, 0x1a9: 0x0e, 0x1aa: 0x0e, 0x1ab: 0x0e, 0x1ac: 0x0e, 0x1ad: 0x0e, 0x1ae: 0x0e, 0x1af: 0x0e, - 0x1b0: 0x0e, 0x1b1: 0x0e, 0x1b2: 0x0e, 0x1b3: 0x0e, 0x1b4: 0x0e, 0x1b5: 0x0e, 0x1b6: 0x0e, 0x1b7: 0x0e, - 0x1b8: 0x0e, 0x1b9: 0x0e, 0x1ba: 0x0e, 0x1bb: 0x0e, 0x1bc: 0x0e, 0x1bd: 0x0e, 0x1be: 0x0e, 0x1bf: 0x0e, - // Block 0x7, offset 0x1c0 - 0x1c0: 0x0e, 0x1c1: 0x0e, 0x1c2: 0x0e, 0x1c3: 0x0e, 0x1c4: 0x0e, 0x1c5: 0x0e, 0x1c6: 0x0e, 0x1c7: 0x0e, - 0x1c8: 0x0e, 0x1c9: 0x0e, 0x1ca: 0x0e, 0x1cb: 0x0e, 0x1cc: 0x0e, 0x1cd: 0x0e, 0x1ce: 0x0e, 0x1cf: 0x0e, - 0x1d0: 0x0e, 0x1d1: 0x0e, 0x1d2: 0x0e, 0x1d3: 0x0e, 0x1d4: 0x0e, 0x1d5: 0x0e, 0x1d6: 0x0e, 0x1d7: 0x0e, - 0x1d8: 0x0e, 0x1d9: 0x0e, 0x1da: 0x0e, 0x1db: 0x0e, 0x1dc: 0x0e, 0x1dd: 0x0e, 0x1de: 0x0e, 0x1df: 0x0e, - 0x1e0: 0x0e, 0x1e1: 0x0e, 0x1e2: 0x0e, 0x1e3: 0x0e, 0x1e4: 0x0e, 0x1e5: 0x0e, 0x1e6: 0x0e, 0x1e7: 0x0e, - 0x1e8: 0x0e, 0x1e9: 0x0e, 0x1ea: 0x0e, 0x1eb: 0x0e, 0x1ec: 0x0e, 0x1ed: 0x0e, 0x1ee: 0x0e, 0x1ef: 0x0e, - 0x1f0: 0x0e, 0x1f1: 0x0e, 0x1f2: 0x0e, 0x1f3: 0x0e, 0x1f4: 0x0e, 0x1f5: 0x0e, 0x1f6: 0x0e, - 0x1f8: 0x0e, 0x1f9: 0x0e, 0x1fa: 0x0e, 0x1fb: 0x0e, 0x1fc: 0x0e, 0x1fd: 0x0e, 0x1fe: 0x0e, 0x1ff: 0x0e, - // Block 0x8, offset 0x200 - 0x200: 0x0e, 0x201: 0x0e, 0x202: 0x0e, 0x203: 0x0e, 0x204: 0x0e, 0x205: 0x0e, 0x206: 0x0e, 0x207: 0x0e, - 0x208: 0x0e, 0x209: 0x0e, 0x20a: 0x0e, 0x20b: 0x0e, 0x20c: 0x0e, 0x20d: 0x0e, 0x20e: 0x0e, 0x20f: 0x0e, - 0x210: 0x0e, 0x211: 0x0e, 0x212: 0x0e, 0x213: 0x0e, 0x214: 0x0e, 0x215: 0x0e, 0x216: 0x0e, 0x217: 0x0e, - 0x218: 0x0e, 0x219: 0x0e, 0x21a: 0x0e, 0x21b: 0x0e, 0x21c: 0x0e, 0x21d: 0x0e, 0x21e: 0x0e, 0x21f: 0x0e, - 0x220: 0x0e, 0x221: 0x0e, 0x222: 0x0e, 0x223: 0x0e, 0x224: 0x0e, 0x225: 0x0e, 0x226: 0x0e, 0x227: 0x0e, - 0x228: 0x0e, 0x229: 0x0e, 0x22a: 0x0e, 0x22b: 0x0e, 0x22c: 0x0e, 0x22d: 0x0e, 0x22e: 0x0e, 0x22f: 0x0e, - 0x230: 0x0e, 0x231: 0x0e, 0x232: 0x0e, 0x233: 0x0e, 0x234: 0x0e, 0x235: 0x0e, 0x236: 0x0e, 0x237: 0x0e, - 0x238: 0x0e, 0x239: 0x0e, 0x23a: 0x0e, 0x23b: 0x0e, 0x23c: 0x0e, 0x23d: 0x0e, 0x23e: 0x0e, 0x23f: 0x0e, - // Block 0x9, offset 0x240 - 0x240: 0x0e, 0x241: 0x0e, 0x242: 0x0e, 0x243: 0x0e, 0x244: 0x0e, 0x245: 0x0e, 0x246: 0x0e, 0x247: 0x0e, - 0x248: 0x0e, 0x249: 0x0e, 0x24a: 0x0e, 0x24b: 0x0e, 0x24c: 0x0e, 0x24d: 0x0e, 0x24e: 0x0e, 0x24f: 0x0e, - 0x250: 0x0e, 0x251: 0x0e, 0x252: 0x3b, 0x253: 0x3c, - 0x265: 0x3d, - 0x270: 0x0e, 0x271: 0x0e, 0x272: 0x0e, 0x273: 0x0e, 0x274: 0x0e, 0x275: 0x0e, 0x276: 0x0e, 0x277: 0x0e, - 0x278: 0x0e, 0x279: 0x0e, 0x27a: 0x0e, 0x27b: 0x0e, 0x27c: 0x0e, 0x27d: 0x0e, 0x27e: 0x0e, 0x27f: 0x0e, - // Block 0xa, offset 0x280 - 0x280: 0x0e, 0x281: 0x0e, 0x282: 0x0e, 0x283: 0x0e, 0x284: 0x0e, 0x285: 0x0e, 0x286: 0x0e, 0x287: 0x0e, - 0x288: 0x0e, 0x289: 0x0e, 0x28a: 0x0e, 0x28b: 0x0e, 0x28c: 0x0e, 0x28d: 0x0e, 0x28e: 0x0e, 0x28f: 0x0e, - 0x290: 0x0e, 0x291: 0x0e, 0x292: 0x0e, 0x293: 0x0e, 0x294: 0x0e, 0x295: 0x0e, 0x296: 0x0e, 0x297: 0x0e, - 0x298: 0x0e, 0x299: 0x0e, 0x29a: 0x0e, 0x29b: 0x0e, 0x29c: 0x0e, 0x29d: 0x0e, 0x29e: 0x3e, - // Block 0xb, offset 0x2c0 - 0x2c0: 0x08, 0x2c1: 0x08, 0x2c2: 0x08, 0x2c3: 0x08, 0x2c4: 0x08, 0x2c5: 0x08, 0x2c6: 0x08, 0x2c7: 0x08, - 0x2c8: 0x08, 0x2c9: 0x08, 0x2ca: 0x08, 0x2cb: 0x08, 0x2cc: 0x08, 0x2cd: 0x08, 0x2ce: 0x08, 0x2cf: 0x08, - 0x2d0: 0x08, 0x2d1: 0x08, 0x2d2: 0x08, 0x2d3: 0x08, 0x2d4: 0x08, 0x2d5: 0x08, 0x2d6: 0x08, 0x2d7: 0x08, - 0x2d8: 0x08, 0x2d9: 0x08, 0x2da: 0x08, 0x2db: 0x08, 0x2dc: 0x08, 0x2dd: 0x08, 0x2de: 0x08, 0x2df: 0x08, - 0x2e0: 0x08, 0x2e1: 0x08, 0x2e2: 0x08, 0x2e3: 0x08, 0x2e4: 0x08, 0x2e5: 0x08, 0x2e6: 0x08, 0x2e7: 0x08, - 0x2e8: 0x08, 0x2e9: 0x08, 0x2ea: 0x08, 0x2eb: 0x08, 0x2ec: 0x08, 0x2ed: 0x08, 0x2ee: 0x08, 0x2ef: 0x08, - 0x2f0: 0x08, 0x2f1: 0x08, 0x2f2: 0x08, 0x2f3: 0x08, 0x2f4: 0x08, 0x2f5: 0x08, 0x2f6: 0x08, 0x2f7: 0x08, - 0x2f8: 0x08, 0x2f9: 0x08, 0x2fa: 0x08, 0x2fb: 0x08, 0x2fc: 0x08, 0x2fd: 0x08, 0x2fe: 0x08, 0x2ff: 0x08, - // Block 0xc, offset 0x300 - 0x300: 0x08, 0x301: 0x08, 0x302: 0x08, 0x303: 0x08, 0x304: 0x08, 0x305: 0x08, 0x306: 0x08, 0x307: 0x08, - 0x308: 0x08, 0x309: 0x08, 0x30a: 0x08, 0x30b: 0x08, 0x30c: 0x08, 0x30d: 0x08, 0x30e: 0x08, 0x30f: 0x08, - 0x310: 0x08, 0x311: 0x08, 0x312: 0x08, 0x313: 0x08, 0x314: 0x08, 0x315: 0x08, 0x316: 0x08, 0x317: 0x08, - 0x318: 0x08, 0x319: 0x08, 0x31a: 0x08, 0x31b: 0x08, 0x31c: 0x08, 0x31d: 0x08, 0x31e: 0x08, 0x31f: 0x08, - 0x320: 0x08, 0x321: 0x08, 0x322: 0x08, 0x323: 0x08, 0x324: 0x0e, 0x325: 0x0e, 0x326: 0x0e, 0x327: 0x0e, - 0x328: 0x0e, 0x329: 0x0e, 0x32a: 0x0e, 0x32b: 0x0e, - 0x338: 0x3f, 0x339: 0x40, 0x33c: 0x41, 0x33d: 0x42, 0x33e: 0x43, 0x33f: 0x44, - // Block 0xd, offset 0x340 - 0x37f: 0x45, - // Block 0xe, offset 0x380 - 0x380: 0x0e, 0x381: 0x0e, 0x382: 0x0e, 0x383: 0x0e, 0x384: 0x0e, 0x385: 0x0e, 0x386: 0x0e, 0x387: 0x0e, - 0x388: 0x0e, 0x389: 0x0e, 0x38a: 0x0e, 0x38b: 0x0e, 0x38c: 0x0e, 0x38d: 0x0e, 0x38e: 0x0e, 0x38f: 0x0e, - 0x390: 0x0e, 0x391: 0x0e, 0x392: 0x0e, 0x393: 0x0e, 0x394: 0x0e, 0x395: 0x0e, 0x396: 0x0e, 0x397: 0x0e, - 0x398: 0x0e, 0x399: 0x0e, 0x39a: 0x0e, 0x39b: 0x0e, 0x39c: 0x0e, 0x39d: 0x0e, 0x39e: 0x0e, 0x39f: 0x46, - 0x3a0: 0x0e, 0x3a1: 0x0e, 0x3a2: 0x0e, 0x3a3: 0x0e, 0x3a4: 0x0e, 0x3a5: 0x0e, 0x3a6: 0x0e, 0x3a7: 0x0e, - 0x3a8: 0x0e, 0x3a9: 0x0e, 0x3aa: 0x0e, 0x3ab: 0x47, - // Block 0xf, offset 0x3c0 - 0x3c0: 0x48, - // Block 0x10, offset 0x400 - 0x400: 0x49, 0x403: 0x4a, 0x404: 0x4b, 0x405: 0x4c, 0x406: 0x4d, - 0x408: 0x4e, 0x409: 0x4f, 0x40c: 0x50, 0x40d: 0x51, 0x40e: 0x52, 0x40f: 0x53, - 0x410: 0x3a, 0x411: 0x54, 0x412: 0x0e, 0x413: 0x55, 0x414: 0x56, 0x415: 0x57, 0x416: 0x58, 0x417: 0x59, - 0x418: 0x0e, 0x419: 0x5a, 0x41a: 0x0e, 0x41b: 0x5b, - 0x424: 0x5c, 0x425: 0x5d, 0x426: 0x5e, 0x427: 0x5f, - // Block 0x11, offset 0x440 - 0x456: 0x0b, 0x457: 0x06, - 0x458: 0x0c, 0x45b: 0x0d, 0x45f: 0x0e, - 0x460: 0x06, 0x461: 0x06, 0x462: 0x06, 0x463: 0x06, 0x464: 0x06, 0x465: 0x06, 0x466: 0x06, 0x467: 0x06, - 0x468: 0x06, 0x469: 0x06, 0x46a: 0x06, 0x46b: 0x06, 0x46c: 0x06, 0x46d: 0x06, 0x46e: 0x06, 0x46f: 0x06, - 0x470: 0x06, 0x471: 0x06, 0x472: 0x06, 0x473: 0x06, 0x474: 0x06, 0x475: 0x06, 0x476: 0x06, 0x477: 0x06, - 0x478: 0x06, 0x479: 0x06, 0x47a: 0x06, 0x47b: 0x06, 0x47c: 0x06, 0x47d: 0x06, 0x47e: 0x06, 0x47f: 0x06, - // Block 0x12, offset 0x480 - 0x484: 0x08, 0x485: 0x08, 0x486: 0x08, 0x487: 0x09, - // Block 0x13, offset 0x4c0 - 0x4c0: 0x08, 0x4c1: 0x08, 0x4c2: 0x08, 0x4c3: 0x08, 0x4c4: 0x08, 0x4c5: 0x08, 0x4c6: 0x08, 0x4c7: 0x08, - 0x4c8: 0x08, 0x4c9: 0x08, 0x4ca: 0x08, 0x4cb: 0x08, 0x4cc: 0x08, 0x4cd: 0x08, 0x4ce: 0x08, 0x4cf: 0x08, - 0x4d0: 0x08, 0x4d1: 0x08, 0x4d2: 0x08, 0x4d3: 0x08, 0x4d4: 0x08, 0x4d5: 0x08, 0x4d6: 0x08, 0x4d7: 0x08, - 0x4d8: 0x08, 0x4d9: 0x08, 0x4da: 0x08, 0x4db: 0x08, 0x4dc: 0x08, 0x4dd: 0x08, 0x4de: 0x08, 0x4df: 0x08, - 0x4e0: 0x08, 0x4e1: 0x08, 0x4e2: 0x08, 0x4e3: 0x08, 0x4e4: 0x08, 0x4e5: 0x08, 0x4e6: 0x08, 0x4e7: 0x08, - 0x4e8: 0x08, 0x4e9: 0x08, 0x4ea: 0x08, 0x4eb: 0x08, 0x4ec: 0x08, 0x4ed: 0x08, 0x4ee: 0x08, 0x4ef: 0x08, - 0x4f0: 0x08, 0x4f1: 0x08, 0x4f2: 0x08, 0x4f3: 0x08, 0x4f4: 0x08, 0x4f5: 0x08, 0x4f6: 0x08, 0x4f7: 0x08, - 0x4f8: 0x08, 0x4f9: 0x08, 0x4fa: 0x08, 0x4fb: 0x08, 0x4fc: 0x08, 0x4fd: 0x08, 0x4fe: 0x08, 0x4ff: 0x60, - // Block 0x14, offset 0x500 - 0x520: 0x10, - 0x530: 0x09, 0x531: 0x09, 0x532: 0x09, 0x533: 0x09, 0x534: 0x09, 0x535: 0x09, 0x536: 0x09, 0x537: 0x09, - 0x538: 0x09, 0x539: 0x09, 0x53a: 0x09, 0x53b: 0x09, 0x53c: 0x09, 0x53d: 0x09, 0x53e: 0x09, 0x53f: 0x11, - // Block 0x15, offset 0x540 - 0x540: 0x09, 0x541: 0x09, 0x542: 0x09, 0x543: 0x09, 0x544: 0x09, 0x545: 0x09, 0x546: 0x09, 0x547: 0x09, - 0x548: 0x09, 0x549: 0x09, 0x54a: 0x09, 0x54b: 0x09, 0x54c: 0x09, 0x54d: 0x09, 0x54e: 0x09, 0x54f: 0x11, -} - -// inverseData contains 4-byte entries of the following format: -// <0 padding> -// The last byte of the UTF-8-encoded rune is xor-ed with the last byte of the -// UTF-8 encoding of the original rune. Mappings often have the following -// pattern: -// A -> A (U+FF21 -> U+0041) -// B -> B (U+FF22 -> U+0042) -// ... -// By xor-ing the last byte the same entry can be shared by many mappings. This -// reduces the total number of distinct entries by about two thirds. -// The resulting entry for the aforementioned mappings is -// { 0x01, 0xE0, 0x00, 0x00 } -// Using this entry to map U+FF21 (UTF-8 [EF BC A1]), we get -// E0 ^ A1 = 41. -// Similarly, for U+FF22 (UTF-8 [EF BC A2]), we get -// E0 ^ A2 = 42. -// Note that because of the xor-ing, the byte sequence stored in the entry is -// not valid UTF-8. -var inverseData = [150][4]byte{ - {0x00, 0x00, 0x00, 0x00}, - {0x03, 0xe3, 0x80, 0xa0}, - {0x03, 0xef, 0xbc, 0xa0}, - {0x03, 0xef, 0xbc, 0xe0}, - {0x03, 0xef, 0xbd, 0xe0}, - {0x03, 0xef, 0xbf, 0x02}, - {0x03, 0xef, 0xbf, 0x00}, - {0x03, 0xef, 0xbf, 0x0e}, - {0x03, 0xef, 0xbf, 0x0c}, - {0x03, 0xef, 0xbf, 0x0f}, - {0x03, 0xef, 0xbf, 0x39}, - {0x03, 0xef, 0xbf, 0x3b}, - {0x03, 0xef, 0xbf, 0x3f}, - {0x03, 0xef, 0xbf, 0x2a}, - {0x03, 0xef, 0xbf, 0x0d}, - {0x03, 0xef, 0xbf, 0x25}, - {0x03, 0xef, 0xbd, 0x1a}, - {0x03, 0xef, 0xbd, 0x26}, - {0x01, 0xa0, 0x00, 0x00}, - {0x03, 0xef, 0xbd, 0x25}, - {0x03, 0xef, 0xbd, 0x23}, - {0x03, 0xef, 0xbd, 0x2e}, - {0x03, 0xef, 0xbe, 0x07}, - {0x03, 0xef, 0xbe, 0x05}, - {0x03, 0xef, 0xbd, 0x06}, - {0x03, 0xef, 0xbd, 0x13}, - {0x03, 0xef, 0xbd, 0x0b}, - {0x03, 0xef, 0xbd, 0x16}, - {0x03, 0xef, 0xbd, 0x0c}, - {0x03, 0xef, 0xbd, 0x15}, - {0x03, 0xef, 0xbd, 0x0d}, - {0x03, 0xef, 0xbd, 0x1c}, - {0x03, 0xef, 0xbd, 0x02}, - {0x03, 0xef, 0xbd, 0x1f}, - {0x03, 0xef, 0xbd, 0x1d}, - {0x03, 0xef, 0xbd, 0x17}, - {0x03, 0xef, 0xbd, 0x08}, - {0x03, 0xef, 0xbd, 0x09}, - {0x03, 0xef, 0xbd, 0x0e}, - {0x03, 0xef, 0xbd, 0x04}, - {0x03, 0xef, 0xbd, 0x05}, - {0x03, 0xef, 0xbe, 0x3f}, - {0x03, 0xef, 0xbe, 0x00}, - {0x03, 0xef, 0xbd, 0x2c}, - {0x03, 0xef, 0xbe, 0x06}, - {0x03, 0xef, 0xbe, 0x0c}, - {0x03, 0xef, 0xbe, 0x0f}, - {0x03, 0xef, 0xbe, 0x0d}, - {0x03, 0xef, 0xbe, 0x0b}, - {0x03, 0xef, 0xbe, 0x19}, - {0x03, 0xef, 0xbe, 0x15}, - {0x03, 0xef, 0xbe, 0x11}, - {0x03, 0xef, 0xbe, 0x31}, - {0x03, 0xef, 0xbe, 0x33}, - {0x03, 0xef, 0xbd, 0x0f}, - {0x03, 0xef, 0xbe, 0x30}, - {0x03, 0xef, 0xbe, 0x3e}, - {0x03, 0xef, 0xbe, 0x32}, - {0x03, 0xef, 0xbe, 0x36}, - {0x03, 0xef, 0xbd, 0x14}, - {0x03, 0xef, 0xbe, 0x2e}, - {0x03, 0xef, 0xbd, 0x1e}, - {0x03, 0xef, 0xbe, 0x10}, - {0x03, 0xef, 0xbf, 0x13}, - {0x03, 0xef, 0xbf, 0x15}, - {0x03, 0xef, 0xbf, 0x17}, - {0x03, 0xef, 0xbf, 0x1f}, - {0x03, 0xef, 0xbf, 0x1d}, - {0x03, 0xef, 0xbf, 0x1b}, - {0x03, 0xef, 0xbf, 0x09}, - {0x03, 0xef, 0xbf, 0x0b}, - {0x03, 0xef, 0xbf, 0x37}, - {0x03, 0xef, 0xbe, 0x04}, - {0x01, 0xe0, 0x00, 0x00}, - {0x03, 0xe2, 0xa6, 0x1a}, - {0x03, 0xe2, 0xa6, 0x26}, - {0x03, 0xe3, 0x80, 0x23}, - {0x03, 0xe3, 0x80, 0x2e}, - {0x03, 0xe3, 0x80, 0x25}, - {0x03, 0xe3, 0x83, 0x1e}, - {0x03, 0xe3, 0x83, 0x14}, - {0x03, 0xe3, 0x82, 0x06}, - {0x03, 0xe3, 0x82, 0x0b}, - {0x03, 0xe3, 0x82, 0x0c}, - {0x03, 0xe3, 0x82, 0x0d}, - {0x03, 0xe3, 0x82, 0x02}, - {0x03, 0xe3, 0x83, 0x0f}, - {0x03, 0xe3, 0x83, 0x08}, - {0x03, 0xe3, 0x83, 0x09}, - {0x03, 0xe3, 0x83, 0x2c}, - {0x03, 0xe3, 0x83, 0x0c}, - {0x03, 0xe3, 0x82, 0x13}, - {0x03, 0xe3, 0x82, 0x16}, - {0x03, 0xe3, 0x82, 0x15}, - {0x03, 0xe3, 0x82, 0x1c}, - {0x03, 0xe3, 0x82, 0x1f}, - {0x03, 0xe3, 0x82, 0x1d}, - {0x03, 0xe3, 0x82, 0x1a}, - {0x03, 0xe3, 0x82, 0x17}, - {0x03, 0xe3, 0x82, 0x08}, - {0x03, 0xe3, 0x82, 0x09}, - {0x03, 0xe3, 0x82, 0x0e}, - {0x03, 0xe3, 0x82, 0x04}, - {0x03, 0xe3, 0x82, 0x05}, - {0x03, 0xe3, 0x82, 0x3f}, - {0x03, 0xe3, 0x83, 0x00}, - {0x03, 0xe3, 0x83, 0x06}, - {0x03, 0xe3, 0x83, 0x05}, - {0x03, 0xe3, 0x83, 0x0d}, - {0x03, 0xe3, 0x83, 0x0b}, - {0x03, 0xe3, 0x83, 0x07}, - {0x03, 0xe3, 0x83, 0x19}, - {0x03, 0xe3, 0x83, 0x15}, - {0x03, 0xe3, 0x83, 0x11}, - {0x03, 0xe3, 0x83, 0x31}, - {0x03, 0xe3, 0x83, 0x33}, - {0x03, 0xe3, 0x83, 0x30}, - {0x03, 0xe3, 0x83, 0x3e}, - {0x03, 0xe3, 0x83, 0x32}, - {0x03, 0xe3, 0x83, 0x36}, - {0x03, 0xe3, 0x83, 0x2e}, - {0x03, 0xe3, 0x82, 0x07}, - {0x03, 0xe3, 0x85, 0x04}, - {0x03, 0xe3, 0x84, 0x10}, - {0x03, 0xe3, 0x85, 0x30}, - {0x03, 0xe3, 0x85, 0x0d}, - {0x03, 0xe3, 0x85, 0x13}, - {0x03, 0xe3, 0x85, 0x15}, - {0x03, 0xe3, 0x85, 0x17}, - {0x03, 0xe3, 0x85, 0x1f}, - {0x03, 0xe3, 0x85, 0x1d}, - {0x03, 0xe3, 0x85, 0x1b}, - {0x03, 0xe3, 0x85, 0x09}, - {0x03, 0xe3, 0x85, 0x0f}, - {0x03, 0xe3, 0x85, 0x0b}, - {0x03, 0xe3, 0x85, 0x37}, - {0x03, 0xe3, 0x85, 0x3b}, - {0x03, 0xe3, 0x85, 0x39}, - {0x03, 0xe3, 0x85, 0x3f}, - {0x02, 0xc2, 0x02, 0x00}, - {0x02, 0xc2, 0x0e, 0x00}, - {0x02, 0xc2, 0x0c, 0x00}, - {0x02, 0xc2, 0x00, 0x00}, - {0x03, 0xe2, 0x82, 0x0f}, - {0x03, 0xe2, 0x94, 0x2a}, - {0x03, 0xe2, 0x86, 0x39}, - {0x03, 0xe2, 0x86, 0x3b}, - {0x03, 0xe2, 0x86, 0x3f}, - {0x03, 0xe2, 0x96, 0x0d}, - {0x03, 0xe2, 0x97, 0x25}, -} - -// Total table size 14680 bytes (14KiB) diff --git a/vendor/golang.org/x/text/width/transform.go b/vendor/golang.org/x/text/width/transform.go deleted file mode 100644 index 0049f70..0000000 --- a/vendor/golang.org/x/text/width/transform.go +++ /dev/null @@ -1,239 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package width - -import ( - "unicode/utf8" - - "golang.org/x/text/transform" -) - -type foldTransform struct { - transform.NopResetter -} - -func (foldTransform) Span(src []byte, atEOF bool) (n int, err error) { - for n < len(src) { - if src[n] < utf8.RuneSelf { - // ASCII fast path. - for n++; n < len(src) && src[n] < utf8.RuneSelf; n++ { - } - continue - } - v, size := trie.lookup(src[n:]) - if size == 0 { // incomplete UTF-8 encoding - if !atEOF { - err = transform.ErrShortSrc - } else { - n = len(src) - } - break - } - if elem(v)&tagNeedsFold != 0 { - err = transform.ErrEndOfSpan - break - } - n += size - } - return n, err -} - -func (foldTransform) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) { - for nSrc < len(src) { - if src[nSrc] < utf8.RuneSelf { - // ASCII fast path. - start, end := nSrc, len(src) - if d := len(dst) - nDst; d < end-start { - end = nSrc + d - } - for nSrc++; nSrc < end && src[nSrc] < utf8.RuneSelf; nSrc++ { - } - n := copy(dst[nDst:], src[start:nSrc]) - if nDst += n; nDst == len(dst) { - nSrc = start + n - if nSrc == len(src) { - return nDst, nSrc, nil - } - if src[nSrc] < utf8.RuneSelf { - return nDst, nSrc, transform.ErrShortDst - } - } - continue - } - v, size := trie.lookup(src[nSrc:]) - if size == 0 { // incomplete UTF-8 encoding - if !atEOF { - return nDst, nSrc, transform.ErrShortSrc - } - size = 1 // gobble 1 byte - } - if elem(v)&tagNeedsFold == 0 { - if size != copy(dst[nDst:], src[nSrc:nSrc+size]) { - return nDst, nSrc, transform.ErrShortDst - } - nDst += size - } else { - data := inverseData[byte(v)] - if len(dst)-nDst < int(data[0]) { - return nDst, nSrc, transform.ErrShortDst - } - i := 1 - for end := int(data[0]); i < end; i++ { - dst[nDst] = data[i] - nDst++ - } - dst[nDst] = data[i] ^ src[nSrc+size-1] - nDst++ - } - nSrc += size - } - return nDst, nSrc, nil -} - -type narrowTransform struct { - transform.NopResetter -} - -func (narrowTransform) Span(src []byte, atEOF bool) (n int, err error) { - for n < len(src) { - if src[n] < utf8.RuneSelf { - // ASCII fast path. - for n++; n < len(src) && src[n] < utf8.RuneSelf; n++ { - } - continue - } - v, size := trie.lookup(src[n:]) - if size == 0 { // incomplete UTF-8 encoding - if !atEOF { - err = transform.ErrShortSrc - } else { - n = len(src) - } - break - } - if k := elem(v).kind(); byte(v) == 0 || k != EastAsianFullwidth && k != EastAsianWide && k != EastAsianAmbiguous { - } else { - err = transform.ErrEndOfSpan - break - } - n += size - } - return n, err -} - -func (narrowTransform) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) { - for nSrc < len(src) { - if src[nSrc] < utf8.RuneSelf { - // ASCII fast path. - start, end := nSrc, len(src) - if d := len(dst) - nDst; d < end-start { - end = nSrc + d - } - for nSrc++; nSrc < end && src[nSrc] < utf8.RuneSelf; nSrc++ { - } - n := copy(dst[nDst:], src[start:nSrc]) - if nDst += n; nDst == len(dst) { - nSrc = start + n - if nSrc == len(src) { - return nDst, nSrc, nil - } - if src[nSrc] < utf8.RuneSelf { - return nDst, nSrc, transform.ErrShortDst - } - } - continue - } - v, size := trie.lookup(src[nSrc:]) - if size == 0 { // incomplete UTF-8 encoding - if !atEOF { - return nDst, nSrc, transform.ErrShortSrc - } - size = 1 // gobble 1 byte - } - if k := elem(v).kind(); byte(v) == 0 || k != EastAsianFullwidth && k != EastAsianWide && k != EastAsianAmbiguous { - if size != copy(dst[nDst:], src[nSrc:nSrc+size]) { - return nDst, nSrc, transform.ErrShortDst - } - nDst += size - } else { - data := inverseData[byte(v)] - if len(dst)-nDst < int(data[0]) { - return nDst, nSrc, transform.ErrShortDst - } - i := 1 - for end := int(data[0]); i < end; i++ { - dst[nDst] = data[i] - nDst++ - } - dst[nDst] = data[i] ^ src[nSrc+size-1] - nDst++ - } - nSrc += size - } - return nDst, nSrc, nil -} - -type wideTransform struct { - transform.NopResetter -} - -func (wideTransform) Span(src []byte, atEOF bool) (n int, err error) { - for n < len(src) { - // TODO: Consider ASCII fast path. Special-casing ASCII handling can - // reduce the ns/op of BenchmarkWideASCII by about 30%. This is probably - // not enough to warrant the extra code and complexity. - v, size := trie.lookup(src[n:]) - if size == 0 { // incomplete UTF-8 encoding - if !atEOF { - err = transform.ErrShortSrc - } else { - n = len(src) - } - break - } - if k := elem(v).kind(); byte(v) == 0 || k != EastAsianHalfwidth && k != EastAsianNarrow { - } else { - err = transform.ErrEndOfSpan - break - } - n += size - } - return n, err -} - -func (wideTransform) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) { - for nSrc < len(src) { - // TODO: Consider ASCII fast path. Special-casing ASCII handling can - // reduce the ns/op of BenchmarkWideASCII by about 30%. This is probably - // not enough to warrant the extra code and complexity. - v, size := trie.lookup(src[nSrc:]) - if size == 0 { // incomplete UTF-8 encoding - if !atEOF { - return nDst, nSrc, transform.ErrShortSrc - } - size = 1 // gobble 1 byte - } - if k := elem(v).kind(); byte(v) == 0 || k != EastAsianHalfwidth && k != EastAsianNarrow { - if size != copy(dst[nDst:], src[nSrc:nSrc+size]) { - return nDst, nSrc, transform.ErrShortDst - } - nDst += size - } else { - data := inverseData[byte(v)] - if len(dst)-nDst < int(data[0]) { - return nDst, nSrc, transform.ErrShortDst - } - i := 1 - for end := int(data[0]); i < end; i++ { - dst[nDst] = data[i] - nDst++ - } - dst[nDst] = data[i] ^ src[nSrc+size-1] - nDst++ - } - nSrc += size - } - return nDst, nSrc, nil -} diff --git a/vendor/golang.org/x/text/width/trieval.go b/vendor/golang.org/x/text/width/trieval.go deleted file mode 100644 index ca8e45f..0000000 --- a/vendor/golang.org/x/text/width/trieval.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -package width - -// elem is an entry of the width trie. The high byte is used to encode the type -// of the rune. The low byte is used to store the index to a mapping entry in -// the inverseData array. -type elem uint16 - -const ( - tagNeutral elem = iota << typeShift - tagAmbiguous - tagWide - tagNarrow - tagFullwidth - tagHalfwidth -) - -const ( - numTypeBits = 3 - typeShift = 16 - numTypeBits - - // tagNeedsFold is true for all fullwidth and halfwidth runes except for - // the Won sign U+20A9. - tagNeedsFold = 0x1000 - - // The Korean Won sign is halfwidth, but SHOULD NOT be mapped to a wide - // variant. - wonSign rune = 0x20A9 -) diff --git a/vendor/golang.org/x/text/width/width.go b/vendor/golang.org/x/text/width/width.go deleted file mode 100644 index 29c7509..0000000 --- a/vendor/golang.org/x/text/width/width.go +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:generate stringer -type=Kind -//go:generate go run gen.go gen_common.go gen_trieval.go - -// Package width provides functionality for handling different widths in text. -// -// Wide characters behave like ideographs; they tend to allow line breaks after -// each character and remain upright in vertical text layout. Narrow characters -// are kept together in words or runs that are rotated sideways in vertical text -// layout. -// -// For more information, see https://unicode.org/reports/tr11/. -package width // import "golang.org/x/text/width" - -import ( - "unicode/utf8" - - "golang.org/x/text/transform" -) - -// TODO -// 1) Reduce table size by compressing blocks. -// 2) API proposition for computing display length -// (approximation, fixed pitch only). -// 3) Implement display length. - -// Kind indicates the type of width property as defined in https://unicode.org/reports/tr11/. -type Kind int - -const ( - // Neutral characters do not occur in legacy East Asian character sets. - Neutral Kind = iota - - // EastAsianAmbiguous characters that can be sometimes wide and sometimes - // narrow and require additional information not contained in the character - // code to further resolve their width. - EastAsianAmbiguous - - // EastAsianWide characters are wide in its usual form. They occur only in - // the context of East Asian typography. These runes may have explicit - // halfwidth counterparts. - EastAsianWide - - // EastAsianNarrow characters are narrow in its usual form. They often have - // fullwidth counterparts. - EastAsianNarrow - - // Note: there exist Narrow runes that do not have fullwidth or wide - // counterparts, despite what the definition says (e.g. U+27E6). - - // EastAsianFullwidth characters have a compatibility decompositions of type - // wide that map to a narrow counterpart. - EastAsianFullwidth - - // EastAsianHalfwidth characters have a compatibility decomposition of type - // narrow that map to a wide or ambiguous counterpart, plus U+20A9 ₩ WON - // SIGN. - EastAsianHalfwidth - - // Note: there exist runes that have a halfwidth counterparts but that are - // classified as Ambiguous, rather than wide (e.g. U+2190). -) - -// TODO: the generated tries need to return size 1 for invalid runes for the -// width to be computed correctly (each byte should render width 1) - -var trie = newWidthTrie(0) - -// Lookup reports the Properties of the first rune in b and the number of bytes -// of its UTF-8 encoding. -func Lookup(b []byte) (p Properties, size int) { - v, sz := trie.lookup(b) - return Properties{elem(v), b[sz-1]}, sz -} - -// LookupString reports the Properties of the first rune in s and the number of -// bytes of its UTF-8 encoding. -func LookupString(s string) (p Properties, size int) { - v, sz := trie.lookupString(s) - return Properties{elem(v), s[sz-1]}, sz -} - -// LookupRune reports the Properties of rune r. -func LookupRune(r rune) Properties { - var buf [4]byte - n := utf8.EncodeRune(buf[:], r) - v, _ := trie.lookup(buf[:n]) - last := byte(r) - if r >= utf8.RuneSelf { - last = 0x80 + byte(r&0x3f) - } - return Properties{elem(v), last} -} - -// Properties provides access to width properties of a rune. -type Properties struct { - elem elem - last byte -} - -func (e elem) kind() Kind { - return Kind(e >> typeShift) -} - -// Kind returns the Kind of a rune as defined in Unicode TR #11. -// See https://unicode.org/reports/tr11/ for more details. -func (p Properties) Kind() Kind { - return p.elem.kind() -} - -// Folded returns the folded variant of a rune or 0 if the rune is canonical. -func (p Properties) Folded() rune { - if p.elem&tagNeedsFold != 0 { - buf := inverseData[byte(p.elem)] - buf[buf[0]] ^= p.last - r, _ := utf8.DecodeRune(buf[1 : 1+buf[0]]) - return r - } - return 0 -} - -// Narrow returns the narrow variant of a rune or 0 if the rune is already -// narrow or doesn't have a narrow variant. -func (p Properties) Narrow() rune { - if k := p.elem.kind(); byte(p.elem) != 0 && (k == EastAsianFullwidth || k == EastAsianWide || k == EastAsianAmbiguous) { - buf := inverseData[byte(p.elem)] - buf[buf[0]] ^= p.last - r, _ := utf8.DecodeRune(buf[1 : 1+buf[0]]) - return r - } - return 0 -} - -// Wide returns the wide variant of a rune or 0 if the rune is already -// wide or doesn't have a wide variant. -func (p Properties) Wide() rune { - if k := p.elem.kind(); byte(p.elem) != 0 && (k == EastAsianHalfwidth || k == EastAsianNarrow) { - buf := inverseData[byte(p.elem)] - buf[buf[0]] ^= p.last - r, _ := utf8.DecodeRune(buf[1 : 1+buf[0]]) - return r - } - return 0 -} - -// TODO for Properties: -// - Add Fullwidth/Halfwidth or Inverted methods for computing variants -// mapping. -// - Add width information (including information on non-spacing runes). - -// Transformer implements the transform.Transformer interface. -type Transformer struct { - t transform.SpanningTransformer -} - -// Reset implements the transform.Transformer interface. -func (t Transformer) Reset() { t.t.Reset() } - -// Transform implements the transform.Transformer interface. -func (t Transformer) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) { - return t.t.Transform(dst, src, atEOF) -} - -// Span implements the transform.SpanningTransformer interface. -func (t Transformer) Span(src []byte, atEOF bool) (n int, err error) { - return t.t.Span(src, atEOF) -} - -// Bytes returns a new byte slice with the result of applying t to b. -func (t Transformer) Bytes(b []byte) []byte { - b, _, _ = transform.Bytes(t, b) - return b -} - -// String returns a string with the result of applying t to s. -func (t Transformer) String(s string) string { - s, _, _ = transform.String(t, s) - return s -} - -var ( - // Fold is a transform that maps all runes to their canonical width. - // - // Note that the NFKC and NFKD transforms in golang.org/x/text/unicode/norm - // provide a more generic folding mechanism. - Fold Transformer = Transformer{foldTransform{}} - - // Widen is a transform that maps runes to their wide variant, if - // available. - Widen Transformer = Transformer{wideTransform{}} - - // Narrow is a transform that maps runes to their narrow variant, if - // available. - Narrow Transformer = Transformer{narrowTransform{}} -) - -// TODO: Consider the following options: -// - Treat Ambiguous runes that have a halfwidth counterpart as wide, or some -// generalized variant of this. -// - Consider a wide Won character to be the default width (or some generalized -// variant of this). -// - Filter the set of characters that gets converted (the preferred approach is -// to allow applying filters to transforms). diff --git a/vendor/golang.org/x/time/rate/rate.go b/vendor/golang.org/x/time/rate/rate.go index 563f704..ae93e24 100644 --- a/vendor/golang.org/x/time/rate/rate.go +++ b/vendor/golang.org/x/time/rate/rate.go @@ -223,12 +223,7 @@ func (lim *Limiter) Wait(ctx context.Context) (err error) { // canceled, or the expected wait time exceeds the Context's Deadline. // The burst limit is ignored if the rate limit is Inf. func (lim *Limiter) WaitN(ctx context.Context, n int) (err error) { - lim.mu.Lock() - burst := lim.burst - limit := lim.limit - lim.mu.Unlock() - - if n > burst && limit != Inf { + if n > lim.burst && lim.limit != Inf { return fmt.Errorf("rate: Wait(n=%d) exceeds limiter's burst %d", n, lim.burst) } // Check if ctx is already cancelled @@ -286,23 +281,6 @@ func (lim *Limiter) SetLimitAt(now time.Time, newLimit Limit) { lim.limit = newLimit } -// SetBurst is shorthand for SetBurstAt(time.Now(), newBurst). -func (lim *Limiter) SetBurst(newBurst int) { - lim.SetBurstAt(time.Now(), newBurst) -} - -// SetBurstAt sets a new burst size for the limiter. -func (lim *Limiter) SetBurstAt(now time.Time, newBurst int) { - lim.mu.Lock() - defer lim.mu.Unlock() - - now, _, tokens := lim.advance(now) - - lim.last = now - lim.tokens = tokens - lim.burst = newBurst -} - // reserveN is a helper method for AllowN, ReserveN, and WaitN. // maxFutureReserve specifies the maximum reservation wait duration allowed. // reserveN returns Reservation, not *Reservation, to avoid allocation in AllowN and WaitN. @@ -392,9 +370,5 @@ func (limit Limit) durationFromTokens(tokens float64) time.Duration { // tokensFromDuration is a unit conversion function from a time duration to the number of tokens // which could be accumulated during that duration at a rate of limit tokens per second. func (limit Limit) tokensFromDuration(d time.Duration) float64 { - // Split the integer and fractional parts ourself to minimize rounding errors. - // See golang.org/issues/34861. - sec := float64(d/time.Second) * float64(limit) - nsec := float64(d%time.Second) * float64(limit) - return sec + nsec/1e9 + return d.Seconds() * float64(limit) } diff --git a/vendor/golang.org/x/tools/AUTHORS b/vendor/golang.org/x/tools/AUTHORS deleted file mode 100644 index 15167cd..0000000 --- a/vendor/golang.org/x/tools/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code refers to The Go Authors for copyright purposes. -# The master list of authors is in the main Go distribution, -# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/golang.org/x/tools/CONTRIBUTORS b/vendor/golang.org/x/tools/CONTRIBUTORS deleted file mode 100644 index 1c4577e..0000000 --- a/vendor/golang.org/x/tools/CONTRIBUTORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code was written by the Go contributors. -# The master list of contributors is in the main Go distribution, -# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/golang.org/x/tools/LICENSE b/vendor/golang.org/x/tools/LICENSE deleted file mode 100644 index 6a66aea..0000000 --- a/vendor/golang.org/x/tools/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/tools/PATENTS b/vendor/golang.org/x/tools/PATENTS deleted file mode 100644 index 7330990..0000000 --- a/vendor/golang.org/x/tools/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Go project. - -Google hereby grants to You a perpetual, worldwide, non-exclusive, -no-charge, royalty-free, irrevocable (except as stated in this section) -patent license to make, have made, use, offer to sell, sell, import, -transfer and otherwise run, modify and propagate the contents of this -implementation of Go, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of Go. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of Go or any code incorporated within this -implementation of Go constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of Go -shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/tools/cmd/getgo/LICENSE b/vendor/golang.org/x/tools/cmd/getgo/LICENSE deleted file mode 100644 index 32017f8..0000000 --- a/vendor/golang.org/x/tools/cmd/getgo/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2017 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go b/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go deleted file mode 100644 index 6b7052b..0000000 --- a/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go +++ /dev/null @@ -1,627 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package astutil - -// This file defines utilities for working with source positions. - -import ( - "fmt" - "go/ast" - "go/token" - "sort" -) - -// PathEnclosingInterval returns the node that encloses the source -// interval [start, end), and all its ancestors up to the AST root. -// -// The definition of "enclosing" used by this function considers -// additional whitespace abutting a node to be enclosed by it. -// In this example: -// -// z := x + y // add them -// <-A-> -// <----B-----> -// -// the ast.BinaryExpr(+) node is considered to enclose interval B -// even though its [Pos()..End()) is actually only interval A. -// This behaviour makes user interfaces more tolerant of imperfect -// input. -// -// This function treats tokens as nodes, though they are not included -// in the result. e.g. PathEnclosingInterval("+") returns the -// enclosing ast.BinaryExpr("x + y"). -// -// If start==end, the 1-char interval following start is used instead. -// -// The 'exact' result is true if the interval contains only path[0] -// and perhaps some adjacent whitespace. It is false if the interval -// overlaps multiple children of path[0], or if it contains only -// interior whitespace of path[0]. -// In this example: -// -// z := x + y // add them -// <--C--> <---E--> -// ^ -// D -// -// intervals C, D and E are inexact. C is contained by the -// z-assignment statement, because it spans three of its children (:=, -// x, +). So too is the 1-char interval D, because it contains only -// interior whitespace of the assignment. E is considered interior -// whitespace of the BlockStmt containing the assignment. -// -// Precondition: [start, end) both lie within the same file as root. -// TODO(adonovan): return (nil, false) in this case and remove precond. -// Requires FileSet; see loader.tokenFileContainsPos. -// -// Postcondition: path is never nil; it always contains at least 'root'. -// -func PathEnclosingInterval(root *ast.File, start, end token.Pos) (path []ast.Node, exact bool) { - // fmt.Printf("EnclosingInterval %d %d\n", start, end) // debugging - - // Precondition: node.[Pos..End) and adjoining whitespace contain [start, end). - var visit func(node ast.Node) bool - visit = func(node ast.Node) bool { - path = append(path, node) - - nodePos := node.Pos() - nodeEnd := node.End() - - // fmt.Printf("visit(%T, %d, %d)\n", node, nodePos, nodeEnd) // debugging - - // Intersect [start, end) with interval of node. - if start < nodePos { - start = nodePos - } - if end > nodeEnd { - end = nodeEnd - } - - // Find sole child that contains [start, end). - children := childrenOf(node) - l := len(children) - for i, child := range children { - // [childPos, childEnd) is unaugmented interval of child. - childPos := child.Pos() - childEnd := child.End() - - // [augPos, augEnd) is whitespace-augmented interval of child. - augPos := childPos - augEnd := childEnd - if i > 0 { - augPos = children[i-1].End() // start of preceding whitespace - } - if i < l-1 { - nextChildPos := children[i+1].Pos() - // Does [start, end) lie between child and next child? - if start >= augEnd && end <= nextChildPos { - return false // inexact match - } - augEnd = nextChildPos // end of following whitespace - } - - // fmt.Printf("\tchild %d: [%d..%d)\tcontains interval [%d..%d)?\n", - // i, augPos, augEnd, start, end) // debugging - - // Does augmented child strictly contain [start, end)? - if augPos <= start && end <= augEnd { - _, isToken := child.(tokenNode) - return isToken || visit(child) - } - - // Does [start, end) overlap multiple children? - // i.e. left-augmented child contains start - // but LR-augmented child does not contain end. - if start < childEnd && end > augEnd { - break - } - } - - // No single child contained [start, end), - // so node is the result. Is it exact? - - // (It's tempting to put this condition before the - // child loop, but it gives the wrong result in the - // case where a node (e.g. ExprStmt) and its sole - // child have equal intervals.) - if start == nodePos && end == nodeEnd { - return true // exact match - } - - return false // inexact: overlaps multiple children - } - - if start > end { - start, end = end, start - } - - if start < root.End() && end > root.Pos() { - if start == end { - end = start + 1 // empty interval => interval of size 1 - } - exact = visit(root) - - // Reverse the path: - for i, l := 0, len(path); i < l/2; i++ { - path[i], path[l-1-i] = path[l-1-i], path[i] - } - } else { - // Selection lies within whitespace preceding the - // first (or following the last) declaration in the file. - // The result nonetheless always includes the ast.File. - path = append(path, root) - } - - return -} - -// tokenNode is a dummy implementation of ast.Node for a single token. -// They are used transiently by PathEnclosingInterval but never escape -// this package. -// -type tokenNode struct { - pos token.Pos - end token.Pos -} - -func (n tokenNode) Pos() token.Pos { - return n.pos -} - -func (n tokenNode) End() token.Pos { - return n.end -} - -func tok(pos token.Pos, len int) ast.Node { - return tokenNode{pos, pos + token.Pos(len)} -} - -// childrenOf returns the direct non-nil children of ast.Node n. -// It may include fake ast.Node implementations for bare tokens. -// it is not safe to call (e.g.) ast.Walk on such nodes. -// -func childrenOf(n ast.Node) []ast.Node { - var children []ast.Node - - // First add nodes for all true subtrees. - ast.Inspect(n, func(node ast.Node) bool { - if node == n { // push n - return true // recur - } - if node != nil { // push child - children = append(children, node) - } - return false // no recursion - }) - - // Then add fake Nodes for bare tokens. - switch n := n.(type) { - case *ast.ArrayType: - children = append(children, - tok(n.Lbrack, len("[")), - tok(n.Elt.End(), len("]"))) - - case *ast.AssignStmt: - children = append(children, - tok(n.TokPos, len(n.Tok.String()))) - - case *ast.BasicLit: - children = append(children, - tok(n.ValuePos, len(n.Value))) - - case *ast.BinaryExpr: - children = append(children, tok(n.OpPos, len(n.Op.String()))) - - case *ast.BlockStmt: - children = append(children, - tok(n.Lbrace, len("{")), - tok(n.Rbrace, len("}"))) - - case *ast.BranchStmt: - children = append(children, - tok(n.TokPos, len(n.Tok.String()))) - - case *ast.CallExpr: - children = append(children, - tok(n.Lparen, len("(")), - tok(n.Rparen, len(")"))) - if n.Ellipsis != 0 { - children = append(children, tok(n.Ellipsis, len("..."))) - } - - case *ast.CaseClause: - if n.List == nil { - children = append(children, - tok(n.Case, len("default"))) - } else { - children = append(children, - tok(n.Case, len("case"))) - } - children = append(children, tok(n.Colon, len(":"))) - - case *ast.ChanType: - switch n.Dir { - case ast.RECV: - children = append(children, tok(n.Begin, len("<-chan"))) - case ast.SEND: - children = append(children, tok(n.Begin, len("chan<-"))) - case ast.RECV | ast.SEND: - children = append(children, tok(n.Begin, len("chan"))) - } - - case *ast.CommClause: - if n.Comm == nil { - children = append(children, - tok(n.Case, len("default"))) - } else { - children = append(children, - tok(n.Case, len("case"))) - } - children = append(children, tok(n.Colon, len(":"))) - - case *ast.Comment: - // nop - - case *ast.CommentGroup: - // nop - - case *ast.CompositeLit: - children = append(children, - tok(n.Lbrace, len("{")), - tok(n.Rbrace, len("{"))) - - case *ast.DeclStmt: - // nop - - case *ast.DeferStmt: - children = append(children, - tok(n.Defer, len("defer"))) - - case *ast.Ellipsis: - children = append(children, - tok(n.Ellipsis, len("..."))) - - case *ast.EmptyStmt: - // nop - - case *ast.ExprStmt: - // nop - - case *ast.Field: - // TODO(adonovan): Field.{Doc,Comment,Tag}? - - case *ast.FieldList: - children = append(children, - tok(n.Opening, len("(")), - tok(n.Closing, len(")"))) - - case *ast.File: - // TODO test: Doc - children = append(children, - tok(n.Package, len("package"))) - - case *ast.ForStmt: - children = append(children, - tok(n.For, len("for"))) - - case *ast.FuncDecl: - // TODO(adonovan): FuncDecl.Comment? - - // Uniquely, FuncDecl breaks the invariant that - // preorder traversal yields tokens in lexical order: - // in fact, FuncDecl.Recv precedes FuncDecl.Type.Func. - // - // As a workaround, we inline the case for FuncType - // here and order things correctly. - // - children = nil // discard ast.Walk(FuncDecl) info subtrees - children = append(children, tok(n.Type.Func, len("func"))) - if n.Recv != nil { - children = append(children, n.Recv) - } - children = append(children, n.Name) - if n.Type.Params != nil { - children = append(children, n.Type.Params) - } - if n.Type.Results != nil { - children = append(children, n.Type.Results) - } - if n.Body != nil { - children = append(children, n.Body) - } - - case *ast.FuncLit: - // nop - - case *ast.FuncType: - if n.Func != 0 { - children = append(children, - tok(n.Func, len("func"))) - } - - case *ast.GenDecl: - children = append(children, - tok(n.TokPos, len(n.Tok.String()))) - if n.Lparen != 0 { - children = append(children, - tok(n.Lparen, len("(")), - tok(n.Rparen, len(")"))) - } - - case *ast.GoStmt: - children = append(children, - tok(n.Go, len("go"))) - - case *ast.Ident: - children = append(children, - tok(n.NamePos, len(n.Name))) - - case *ast.IfStmt: - children = append(children, - tok(n.If, len("if"))) - - case *ast.ImportSpec: - // TODO(adonovan): ImportSpec.{Doc,EndPos}? - - case *ast.IncDecStmt: - children = append(children, - tok(n.TokPos, len(n.Tok.String()))) - - case *ast.IndexExpr: - children = append(children, - tok(n.Lbrack, len("{")), - tok(n.Rbrack, len("}"))) - - case *ast.InterfaceType: - children = append(children, - tok(n.Interface, len("interface"))) - - case *ast.KeyValueExpr: - children = append(children, - tok(n.Colon, len(":"))) - - case *ast.LabeledStmt: - children = append(children, - tok(n.Colon, len(":"))) - - case *ast.MapType: - children = append(children, - tok(n.Map, len("map"))) - - case *ast.ParenExpr: - children = append(children, - tok(n.Lparen, len("(")), - tok(n.Rparen, len(")"))) - - case *ast.RangeStmt: - children = append(children, - tok(n.For, len("for")), - tok(n.TokPos, len(n.Tok.String()))) - - case *ast.ReturnStmt: - children = append(children, - tok(n.Return, len("return"))) - - case *ast.SelectStmt: - children = append(children, - tok(n.Select, len("select"))) - - case *ast.SelectorExpr: - // nop - - case *ast.SendStmt: - children = append(children, - tok(n.Arrow, len("<-"))) - - case *ast.SliceExpr: - children = append(children, - tok(n.Lbrack, len("[")), - tok(n.Rbrack, len("]"))) - - case *ast.StarExpr: - children = append(children, tok(n.Star, len("*"))) - - case *ast.StructType: - children = append(children, tok(n.Struct, len("struct"))) - - case *ast.SwitchStmt: - children = append(children, tok(n.Switch, len("switch"))) - - case *ast.TypeAssertExpr: - children = append(children, - tok(n.Lparen-1, len(".")), - tok(n.Lparen, len("(")), - tok(n.Rparen, len(")"))) - - case *ast.TypeSpec: - // TODO(adonovan): TypeSpec.{Doc,Comment}? - - case *ast.TypeSwitchStmt: - children = append(children, tok(n.Switch, len("switch"))) - - case *ast.UnaryExpr: - children = append(children, tok(n.OpPos, len(n.Op.String()))) - - case *ast.ValueSpec: - // TODO(adonovan): ValueSpec.{Doc,Comment}? - - case *ast.BadDecl, *ast.BadExpr, *ast.BadStmt: - // nop - } - - // TODO(adonovan): opt: merge the logic of ast.Inspect() into - // the switch above so we can make interleaved callbacks for - // both Nodes and Tokens in the right order and avoid the need - // to sort. - sort.Sort(byPos(children)) - - return children -} - -type byPos []ast.Node - -func (sl byPos) Len() int { - return len(sl) -} -func (sl byPos) Less(i, j int) bool { - return sl[i].Pos() < sl[j].Pos() -} -func (sl byPos) Swap(i, j int) { - sl[i], sl[j] = sl[j], sl[i] -} - -// NodeDescription returns a description of the concrete type of n suitable -// for a user interface. -// -// TODO(adonovan): in some cases (e.g. Field, FieldList, Ident, -// StarExpr) we could be much more specific given the path to the AST -// root. Perhaps we should do that. -// -func NodeDescription(n ast.Node) string { - switch n := n.(type) { - case *ast.ArrayType: - return "array type" - case *ast.AssignStmt: - return "assignment" - case *ast.BadDecl: - return "bad declaration" - case *ast.BadExpr: - return "bad expression" - case *ast.BadStmt: - return "bad statement" - case *ast.BasicLit: - return "basic literal" - case *ast.BinaryExpr: - return fmt.Sprintf("binary %s operation", n.Op) - case *ast.BlockStmt: - return "block" - case *ast.BranchStmt: - switch n.Tok { - case token.BREAK: - return "break statement" - case token.CONTINUE: - return "continue statement" - case token.GOTO: - return "goto statement" - case token.FALLTHROUGH: - return "fall-through statement" - } - case *ast.CallExpr: - if len(n.Args) == 1 && !n.Ellipsis.IsValid() { - return "function call (or conversion)" - } - return "function call" - case *ast.CaseClause: - return "case clause" - case *ast.ChanType: - return "channel type" - case *ast.CommClause: - return "communication clause" - case *ast.Comment: - return "comment" - case *ast.CommentGroup: - return "comment group" - case *ast.CompositeLit: - return "composite literal" - case *ast.DeclStmt: - return NodeDescription(n.Decl) + " statement" - case *ast.DeferStmt: - return "defer statement" - case *ast.Ellipsis: - return "ellipsis" - case *ast.EmptyStmt: - return "empty statement" - case *ast.ExprStmt: - return "expression statement" - case *ast.Field: - // Can be any of these: - // struct {x, y int} -- struct field(s) - // struct {T} -- anon struct field - // interface {I} -- interface embedding - // interface {f()} -- interface method - // func (A) func(B) C -- receiver, param(s), result(s) - return "field/method/parameter" - case *ast.FieldList: - return "field/method/parameter list" - case *ast.File: - return "source file" - case *ast.ForStmt: - return "for loop" - case *ast.FuncDecl: - return "function declaration" - case *ast.FuncLit: - return "function literal" - case *ast.FuncType: - return "function type" - case *ast.GenDecl: - switch n.Tok { - case token.IMPORT: - return "import declaration" - case token.CONST: - return "constant declaration" - case token.TYPE: - return "type declaration" - case token.VAR: - return "variable declaration" - } - case *ast.GoStmt: - return "go statement" - case *ast.Ident: - return "identifier" - case *ast.IfStmt: - return "if statement" - case *ast.ImportSpec: - return "import specification" - case *ast.IncDecStmt: - if n.Tok == token.INC { - return "increment statement" - } - return "decrement statement" - case *ast.IndexExpr: - return "index expression" - case *ast.InterfaceType: - return "interface type" - case *ast.KeyValueExpr: - return "key/value association" - case *ast.LabeledStmt: - return "statement label" - case *ast.MapType: - return "map type" - case *ast.Package: - return "package" - case *ast.ParenExpr: - return "parenthesized " + NodeDescription(n.X) - case *ast.RangeStmt: - return "range loop" - case *ast.ReturnStmt: - return "return statement" - case *ast.SelectStmt: - return "select statement" - case *ast.SelectorExpr: - return "selector" - case *ast.SendStmt: - return "channel send" - case *ast.SliceExpr: - return "slice expression" - case *ast.StarExpr: - return "*-operation" // load/store expr or pointer type - case *ast.StructType: - return "struct type" - case *ast.SwitchStmt: - return "switch statement" - case *ast.TypeAssertExpr: - return "type assertion" - case *ast.TypeSpec: - return "type specification" - case *ast.TypeSwitchStmt: - return "type switch" - case *ast.UnaryExpr: - return fmt.Sprintf("unary %s operation", n.Op) - case *ast.ValueSpec: - return "value specification" - - } - panic(fmt.Sprintf("unexpected node type: %T", n)) -} diff --git a/vendor/golang.org/x/tools/go/ast/astutil/imports.go b/vendor/golang.org/x/tools/go/ast/astutil/imports.go deleted file mode 100644 index 2087cee..0000000 --- a/vendor/golang.org/x/tools/go/ast/astutil/imports.go +++ /dev/null @@ -1,482 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package astutil contains common utilities for working with the Go AST. -package astutil // import "golang.org/x/tools/go/ast/astutil" - -import ( - "fmt" - "go/ast" - "go/token" - "strconv" - "strings" -) - -// AddImport adds the import path to the file f, if absent. -func AddImport(fset *token.FileSet, f *ast.File, path string) (added bool) { - return AddNamedImport(fset, f, "", path) -} - -// AddNamedImport adds the import with the given name and path to the file f, if absent. -// If name is not empty, it is used to rename the import. -// -// For example, calling -// AddNamedImport(fset, f, "pathpkg", "path") -// adds -// import pathpkg "path" -func AddNamedImport(fset *token.FileSet, f *ast.File, name, path string) (added bool) { - if imports(f, name, path) { - return false - } - - newImport := &ast.ImportSpec{ - Path: &ast.BasicLit{ - Kind: token.STRING, - Value: strconv.Quote(path), - }, - } - if name != "" { - newImport.Name = &ast.Ident{Name: name} - } - - // Find an import decl to add to. - // The goal is to find an existing import - // whose import path has the longest shared - // prefix with path. - var ( - bestMatch = -1 // length of longest shared prefix - lastImport = -1 // index in f.Decls of the file's final import decl - impDecl *ast.GenDecl // import decl containing the best match - impIndex = -1 // spec index in impDecl containing the best match - - isThirdPartyPath = isThirdParty(path) - ) - for i, decl := range f.Decls { - gen, ok := decl.(*ast.GenDecl) - if ok && gen.Tok == token.IMPORT { - lastImport = i - // Do not add to import "C", to avoid disrupting the - // association with its doc comment, breaking cgo. - if declImports(gen, "C") { - continue - } - - // Match an empty import decl if that's all that is available. - if len(gen.Specs) == 0 && bestMatch == -1 { - impDecl = gen - } - - // Compute longest shared prefix with imports in this group and find best - // matched import spec. - // 1. Always prefer import spec with longest shared prefix. - // 2. While match length is 0, - // - for stdlib package: prefer first import spec. - // - for third party package: prefer first third party import spec. - // We cannot use last import spec as best match for third party package - // because grouped imports are usually placed last by goimports -local - // flag. - // See issue #19190. - seenAnyThirdParty := false - for j, spec := range gen.Specs { - impspec := spec.(*ast.ImportSpec) - p := importPath(impspec) - n := matchLen(p, path) - if n > bestMatch || (bestMatch == 0 && !seenAnyThirdParty && isThirdPartyPath) { - bestMatch = n - impDecl = gen - impIndex = j - } - seenAnyThirdParty = seenAnyThirdParty || isThirdParty(p) - } - } - } - - // If no import decl found, add one after the last import. - if impDecl == nil { - impDecl = &ast.GenDecl{ - Tok: token.IMPORT, - } - if lastImport >= 0 { - impDecl.TokPos = f.Decls[lastImport].End() - } else { - // There are no existing imports. - // Our new import, preceded by a blank line, goes after the package declaration - // and after the comment, if any, that starts on the same line as the - // package declaration. - impDecl.TokPos = f.Package - - file := fset.File(f.Package) - pkgLine := file.Line(f.Package) - for _, c := range f.Comments { - if file.Line(c.Pos()) > pkgLine { - break - } - // +2 for a blank line - impDecl.TokPos = c.End() + 2 - } - } - f.Decls = append(f.Decls, nil) - copy(f.Decls[lastImport+2:], f.Decls[lastImport+1:]) - f.Decls[lastImport+1] = impDecl - } - - // Insert new import at insertAt. - insertAt := 0 - if impIndex >= 0 { - // insert after the found import - insertAt = impIndex + 1 - } - impDecl.Specs = append(impDecl.Specs, nil) - copy(impDecl.Specs[insertAt+1:], impDecl.Specs[insertAt:]) - impDecl.Specs[insertAt] = newImport - pos := impDecl.Pos() - if insertAt > 0 { - // If there is a comment after an existing import, preserve the comment - // position by adding the new import after the comment. - if spec, ok := impDecl.Specs[insertAt-1].(*ast.ImportSpec); ok && spec.Comment != nil { - pos = spec.Comment.End() - } else { - // Assign same position as the previous import, - // so that the sorter sees it as being in the same block. - pos = impDecl.Specs[insertAt-1].Pos() - } - } - if newImport.Name != nil { - newImport.Name.NamePos = pos - } - newImport.Path.ValuePos = pos - newImport.EndPos = pos - - // Clean up parens. impDecl contains at least one spec. - if len(impDecl.Specs) == 1 { - // Remove unneeded parens. - impDecl.Lparen = token.NoPos - } else if !impDecl.Lparen.IsValid() { - // impDecl needs parens added. - impDecl.Lparen = impDecl.Specs[0].Pos() - } - - f.Imports = append(f.Imports, newImport) - - if len(f.Decls) <= 1 { - return true - } - - // Merge all the import declarations into the first one. - var first *ast.GenDecl - for i := 0; i < len(f.Decls); i++ { - decl := f.Decls[i] - gen, ok := decl.(*ast.GenDecl) - if !ok || gen.Tok != token.IMPORT || declImports(gen, "C") { - continue - } - if first == nil { - first = gen - continue // Don't touch the first one. - } - // We now know there is more than one package in this import - // declaration. Ensure that it ends up parenthesized. - first.Lparen = first.Pos() - // Move the imports of the other import declaration to the first one. - for _, spec := range gen.Specs { - spec.(*ast.ImportSpec).Path.ValuePos = first.Pos() - first.Specs = append(first.Specs, spec) - } - f.Decls = append(f.Decls[:i], f.Decls[i+1:]...) - i-- - } - - return true -} - -func isThirdParty(importPath string) bool { - // Third party package import path usually contains "." (".com", ".org", ...) - // This logic is taken from golang.org/x/tools/imports package. - return strings.Contains(importPath, ".") -} - -// DeleteImport deletes the import path from the file f, if present. -// If there are duplicate import declarations, all matching ones are deleted. -func DeleteImport(fset *token.FileSet, f *ast.File, path string) (deleted bool) { - return DeleteNamedImport(fset, f, "", path) -} - -// DeleteNamedImport deletes the import with the given name and path from the file f, if present. -// If there are duplicate import declarations, all matching ones are deleted. -func DeleteNamedImport(fset *token.FileSet, f *ast.File, name, path string) (deleted bool) { - var delspecs []*ast.ImportSpec - var delcomments []*ast.CommentGroup - - // Find the import nodes that import path, if any. - for i := 0; i < len(f.Decls); i++ { - decl := f.Decls[i] - gen, ok := decl.(*ast.GenDecl) - if !ok || gen.Tok != token.IMPORT { - continue - } - for j := 0; j < len(gen.Specs); j++ { - spec := gen.Specs[j] - impspec := spec.(*ast.ImportSpec) - if importName(impspec) != name || importPath(impspec) != path { - continue - } - - // We found an import spec that imports path. - // Delete it. - delspecs = append(delspecs, impspec) - deleted = true - copy(gen.Specs[j:], gen.Specs[j+1:]) - gen.Specs = gen.Specs[:len(gen.Specs)-1] - - // If this was the last import spec in this decl, - // delete the decl, too. - if len(gen.Specs) == 0 { - copy(f.Decls[i:], f.Decls[i+1:]) - f.Decls = f.Decls[:len(f.Decls)-1] - i-- - break - } else if len(gen.Specs) == 1 { - if impspec.Doc != nil { - delcomments = append(delcomments, impspec.Doc) - } - if impspec.Comment != nil { - delcomments = append(delcomments, impspec.Comment) - } - for _, cg := range f.Comments { - // Found comment on the same line as the import spec. - if cg.End() < impspec.Pos() && fset.Position(cg.End()).Line == fset.Position(impspec.Pos()).Line { - delcomments = append(delcomments, cg) - break - } - } - - spec := gen.Specs[0].(*ast.ImportSpec) - - // Move the documentation right after the import decl. - if spec.Doc != nil { - for fset.Position(gen.TokPos).Line+1 < fset.Position(spec.Doc.Pos()).Line { - fset.File(gen.TokPos).MergeLine(fset.Position(gen.TokPos).Line) - } - } - for _, cg := range f.Comments { - if cg.End() < spec.Pos() && fset.Position(cg.End()).Line == fset.Position(spec.Pos()).Line { - for fset.Position(gen.TokPos).Line+1 < fset.Position(spec.Pos()).Line { - fset.File(gen.TokPos).MergeLine(fset.Position(gen.TokPos).Line) - } - break - } - } - } - if j > 0 { - lastImpspec := gen.Specs[j-1].(*ast.ImportSpec) - lastLine := fset.Position(lastImpspec.Path.ValuePos).Line - line := fset.Position(impspec.Path.ValuePos).Line - - // We deleted an entry but now there may be - // a blank line-sized hole where the import was. - if line-lastLine > 1 || !gen.Rparen.IsValid() { - // There was a blank line immediately preceding the deleted import, - // so there's no need to close the hole. The right parenthesis is - // invalid after AddImport to an import statement without parenthesis. - // Do nothing. - } else if line != fset.File(gen.Rparen).LineCount() { - // There was no blank line. Close the hole. - fset.File(gen.Rparen).MergeLine(line) - } - } - j-- - } - } - - // Delete imports from f.Imports. - for i := 0; i < len(f.Imports); i++ { - imp := f.Imports[i] - for j, del := range delspecs { - if imp == del { - copy(f.Imports[i:], f.Imports[i+1:]) - f.Imports = f.Imports[:len(f.Imports)-1] - copy(delspecs[j:], delspecs[j+1:]) - delspecs = delspecs[:len(delspecs)-1] - i-- - break - } - } - } - - // Delete comments from f.Comments. - for i := 0; i < len(f.Comments); i++ { - cg := f.Comments[i] - for j, del := range delcomments { - if cg == del { - copy(f.Comments[i:], f.Comments[i+1:]) - f.Comments = f.Comments[:len(f.Comments)-1] - copy(delcomments[j:], delcomments[j+1:]) - delcomments = delcomments[:len(delcomments)-1] - i-- - break - } - } - } - - if len(delspecs) > 0 { - panic(fmt.Sprintf("deleted specs from Decls but not Imports: %v", delspecs)) - } - - return -} - -// RewriteImport rewrites any import of path oldPath to path newPath. -func RewriteImport(fset *token.FileSet, f *ast.File, oldPath, newPath string) (rewrote bool) { - for _, imp := range f.Imports { - if importPath(imp) == oldPath { - rewrote = true - // record old End, because the default is to compute - // it using the length of imp.Path.Value. - imp.EndPos = imp.End() - imp.Path.Value = strconv.Quote(newPath) - } - } - return -} - -// UsesImport reports whether a given import is used. -func UsesImport(f *ast.File, path string) (used bool) { - spec := importSpec(f, path) - if spec == nil { - return - } - - name := spec.Name.String() - switch name { - case "": - // If the package name is not explicitly specified, - // make an educated guess. This is not guaranteed to be correct. - lastSlash := strings.LastIndex(path, "/") - if lastSlash == -1 { - name = path - } else { - name = path[lastSlash+1:] - } - case "_", ".": - // Not sure if this import is used - err on the side of caution. - return true - } - - ast.Walk(visitFn(func(n ast.Node) { - sel, ok := n.(*ast.SelectorExpr) - if ok && isTopName(sel.X, name) { - used = true - } - }), f) - - return -} - -type visitFn func(node ast.Node) - -func (fn visitFn) Visit(node ast.Node) ast.Visitor { - fn(node) - return fn -} - -// imports reports whether f has an import with the specified name and path. -func imports(f *ast.File, name, path string) bool { - for _, s := range f.Imports { - if importName(s) == name && importPath(s) == path { - return true - } - } - return false -} - -// importSpec returns the import spec if f imports path, -// or nil otherwise. -func importSpec(f *ast.File, path string) *ast.ImportSpec { - for _, s := range f.Imports { - if importPath(s) == path { - return s - } - } - return nil -} - -// importName returns the name of s, -// or "" if the import is not named. -func importName(s *ast.ImportSpec) string { - if s.Name == nil { - return "" - } - return s.Name.Name -} - -// importPath returns the unquoted import path of s, -// or "" if the path is not properly quoted. -func importPath(s *ast.ImportSpec) string { - t, err := strconv.Unquote(s.Path.Value) - if err != nil { - return "" - } - return t -} - -// declImports reports whether gen contains an import of path. -func declImports(gen *ast.GenDecl, path string) bool { - if gen.Tok != token.IMPORT { - return false - } - for _, spec := range gen.Specs { - impspec := spec.(*ast.ImportSpec) - if importPath(impspec) == path { - return true - } - } - return false -} - -// matchLen returns the length of the longest path segment prefix shared by x and y. -func matchLen(x, y string) int { - n := 0 - for i := 0; i < len(x) && i < len(y) && x[i] == y[i]; i++ { - if x[i] == '/' { - n++ - } - } - return n -} - -// isTopName returns true if n is a top-level unresolved identifier with the given name. -func isTopName(n ast.Expr, name string) bool { - id, ok := n.(*ast.Ident) - return ok && id.Name == name && id.Obj == nil -} - -// Imports returns the file imports grouped by paragraph. -func Imports(fset *token.FileSet, f *ast.File) [][]*ast.ImportSpec { - var groups [][]*ast.ImportSpec - - for _, decl := range f.Decls { - genDecl, ok := decl.(*ast.GenDecl) - if !ok || genDecl.Tok != token.IMPORT { - break - } - - group := []*ast.ImportSpec{} - - var lastLine int - for _, spec := range genDecl.Specs { - importSpec := spec.(*ast.ImportSpec) - pos := importSpec.Path.ValuePos - line := fset.Position(pos).Line - if lastLine > 0 && pos > 0 && line-lastLine > 1 { - groups = append(groups, group) - group = []*ast.ImportSpec{} - } - group = append(group, importSpec) - lastLine = line - } - groups = append(groups, group) - } - - return groups -} diff --git a/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go b/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go deleted file mode 100644 index cf72ea9..0000000 --- a/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go +++ /dev/null @@ -1,477 +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 astutil - -import ( - "fmt" - "go/ast" - "reflect" - "sort" -) - -// An ApplyFunc is invoked by Apply for each node n, even if n is nil, -// before and/or after the node's children, using a Cursor describing -// the current node and providing operations on it. -// -// The return value of ApplyFunc controls the syntax tree traversal. -// See Apply for details. -type ApplyFunc func(*Cursor) bool - -// Apply traverses a syntax tree recursively, starting with root, -// and calling pre and post for each node as described below. -// Apply returns the syntax tree, possibly modified. -// -// If pre is not nil, it is called for each node before the node's -// children are traversed (pre-order). If pre returns false, no -// children are traversed, and post is not called for that node. -// -// If post is not nil, and a prior call of pre didn't return false, -// post is called for each node after its children are traversed -// (post-order). If post returns false, traversal is terminated and -// Apply returns immediately. -// -// Only fields that refer to AST nodes are considered children; -// i.e., token.Pos, Scopes, Objects, and fields of basic types -// (strings, etc.) are ignored. -// -// Children are traversed in the order in which they appear in the -// respective node's struct definition. A package's files are -// traversed in the filenames' alphabetical order. -// -func Apply(root ast.Node, pre, post ApplyFunc) (result ast.Node) { - parent := &struct{ ast.Node }{root} - defer func() { - if r := recover(); r != nil && r != abort { - panic(r) - } - result = parent.Node - }() - a := &application{pre: pre, post: post} - a.apply(parent, "Node", nil, root) - return -} - -var abort = new(int) // singleton, to signal termination of Apply - -// A Cursor describes a node encountered during Apply. -// Information about the node and its parent is available -// from the Node, Parent, Name, and Index methods. -// -// If p is a variable of type and value of the current parent node -// c.Parent(), and f is the field identifier with name c.Name(), -// the following invariants hold: -// -// p.f == c.Node() if c.Index() < 0 -// p.f[c.Index()] == c.Node() if c.Index() >= 0 -// -// The methods Replace, Delete, InsertBefore, and InsertAfter -// can be used to change the AST without disrupting Apply. -type Cursor struct { - parent ast.Node - name string - iter *iterator // valid if non-nil - node ast.Node -} - -// Node returns the current Node. -func (c *Cursor) Node() ast.Node { return c.node } - -// Parent returns the parent of the current Node. -func (c *Cursor) Parent() ast.Node { return c.parent } - -// Name returns the name of the parent Node field that contains the current Node. -// If the parent is a *ast.Package and the current Node is a *ast.File, Name returns -// the filename for the current Node. -func (c *Cursor) Name() string { return c.name } - -// Index reports the index >= 0 of the current Node in the slice of Nodes that -// contains it, or a value < 0 if the current Node is not part of a slice. -// The index of the current node changes if InsertBefore is called while -// processing the current node. -func (c *Cursor) Index() int { - if c.iter != nil { - return c.iter.index - } - return -1 -} - -// field returns the current node's parent field value. -func (c *Cursor) field() reflect.Value { - return reflect.Indirect(reflect.ValueOf(c.parent)).FieldByName(c.name) -} - -// Replace replaces the current Node with n. -// The replacement node is not walked by Apply. -func (c *Cursor) Replace(n ast.Node) { - if _, ok := c.node.(*ast.File); ok { - file, ok := n.(*ast.File) - if !ok { - panic("attempt to replace *ast.File with non-*ast.File") - } - c.parent.(*ast.Package).Files[c.name] = file - return - } - - v := c.field() - if i := c.Index(); i >= 0 { - v = v.Index(i) - } - v.Set(reflect.ValueOf(n)) -} - -// Delete deletes the current Node from its containing slice. -// If the current Node is not part of a slice, Delete panics. -// As a special case, if the current node is a package file, -// Delete removes it from the package's Files map. -func (c *Cursor) Delete() { - if _, ok := c.node.(*ast.File); ok { - delete(c.parent.(*ast.Package).Files, c.name) - return - } - - i := c.Index() - if i < 0 { - panic("Delete node not contained in slice") - } - v := c.field() - l := v.Len() - reflect.Copy(v.Slice(i, l), v.Slice(i+1, l)) - v.Index(l - 1).Set(reflect.Zero(v.Type().Elem())) - v.SetLen(l - 1) - c.iter.step-- -} - -// InsertAfter inserts n after the current Node in its containing slice. -// If the current Node is not part of a slice, InsertAfter panics. -// Apply does not walk n. -func (c *Cursor) InsertAfter(n ast.Node) { - i := c.Index() - if i < 0 { - panic("InsertAfter node not contained in slice") - } - v := c.field() - v.Set(reflect.Append(v, reflect.Zero(v.Type().Elem()))) - l := v.Len() - reflect.Copy(v.Slice(i+2, l), v.Slice(i+1, l)) - v.Index(i + 1).Set(reflect.ValueOf(n)) - c.iter.step++ -} - -// InsertBefore inserts n before the current Node in its containing slice. -// If the current Node is not part of a slice, InsertBefore panics. -// Apply will not walk n. -func (c *Cursor) InsertBefore(n ast.Node) { - i := c.Index() - if i < 0 { - panic("InsertBefore node not contained in slice") - } - v := c.field() - v.Set(reflect.Append(v, reflect.Zero(v.Type().Elem()))) - l := v.Len() - reflect.Copy(v.Slice(i+1, l), v.Slice(i, l)) - v.Index(i).Set(reflect.ValueOf(n)) - c.iter.index++ -} - -// application carries all the shared data so we can pass it around cheaply. -type application struct { - pre, post ApplyFunc - cursor Cursor - iter iterator -} - -func (a *application) apply(parent ast.Node, name string, iter *iterator, n ast.Node) { - // convert typed nil into untyped nil - if v := reflect.ValueOf(n); v.Kind() == reflect.Ptr && v.IsNil() { - n = nil - } - - // avoid heap-allocating a new cursor for each apply call; reuse a.cursor instead - saved := a.cursor - a.cursor.parent = parent - a.cursor.name = name - a.cursor.iter = iter - a.cursor.node = n - - if a.pre != nil && !a.pre(&a.cursor) { - a.cursor = saved - return - } - - // walk children - // (the order of the cases matches the order of the corresponding node types in go/ast) - switch n := n.(type) { - case nil: - // nothing to do - - // Comments and fields - case *ast.Comment: - // nothing to do - - case *ast.CommentGroup: - if n != nil { - a.applyList(n, "List") - } - - case *ast.Field: - a.apply(n, "Doc", nil, n.Doc) - a.applyList(n, "Names") - a.apply(n, "Type", nil, n.Type) - a.apply(n, "Tag", nil, n.Tag) - a.apply(n, "Comment", nil, n.Comment) - - case *ast.FieldList: - a.applyList(n, "List") - - // Expressions - case *ast.BadExpr, *ast.Ident, *ast.BasicLit: - // nothing to do - - case *ast.Ellipsis: - a.apply(n, "Elt", nil, n.Elt) - - case *ast.FuncLit: - a.apply(n, "Type", nil, n.Type) - a.apply(n, "Body", nil, n.Body) - - case *ast.CompositeLit: - a.apply(n, "Type", nil, n.Type) - a.applyList(n, "Elts") - - case *ast.ParenExpr: - a.apply(n, "X", nil, n.X) - - case *ast.SelectorExpr: - a.apply(n, "X", nil, n.X) - a.apply(n, "Sel", nil, n.Sel) - - case *ast.IndexExpr: - a.apply(n, "X", nil, n.X) - a.apply(n, "Index", nil, n.Index) - - case *ast.SliceExpr: - a.apply(n, "X", nil, n.X) - a.apply(n, "Low", nil, n.Low) - a.apply(n, "High", nil, n.High) - a.apply(n, "Max", nil, n.Max) - - case *ast.TypeAssertExpr: - a.apply(n, "X", nil, n.X) - a.apply(n, "Type", nil, n.Type) - - case *ast.CallExpr: - a.apply(n, "Fun", nil, n.Fun) - a.applyList(n, "Args") - - case *ast.StarExpr: - a.apply(n, "X", nil, n.X) - - case *ast.UnaryExpr: - a.apply(n, "X", nil, n.X) - - case *ast.BinaryExpr: - a.apply(n, "X", nil, n.X) - a.apply(n, "Y", nil, n.Y) - - case *ast.KeyValueExpr: - a.apply(n, "Key", nil, n.Key) - a.apply(n, "Value", nil, n.Value) - - // Types - case *ast.ArrayType: - a.apply(n, "Len", nil, n.Len) - a.apply(n, "Elt", nil, n.Elt) - - case *ast.StructType: - a.apply(n, "Fields", nil, n.Fields) - - case *ast.FuncType: - a.apply(n, "Params", nil, n.Params) - a.apply(n, "Results", nil, n.Results) - - case *ast.InterfaceType: - a.apply(n, "Methods", nil, n.Methods) - - case *ast.MapType: - a.apply(n, "Key", nil, n.Key) - a.apply(n, "Value", nil, n.Value) - - case *ast.ChanType: - a.apply(n, "Value", nil, n.Value) - - // Statements - case *ast.BadStmt: - // nothing to do - - case *ast.DeclStmt: - a.apply(n, "Decl", nil, n.Decl) - - case *ast.EmptyStmt: - // nothing to do - - case *ast.LabeledStmt: - a.apply(n, "Label", nil, n.Label) - a.apply(n, "Stmt", nil, n.Stmt) - - case *ast.ExprStmt: - a.apply(n, "X", nil, n.X) - - case *ast.SendStmt: - a.apply(n, "Chan", nil, n.Chan) - a.apply(n, "Value", nil, n.Value) - - case *ast.IncDecStmt: - a.apply(n, "X", nil, n.X) - - case *ast.AssignStmt: - a.applyList(n, "Lhs") - a.applyList(n, "Rhs") - - case *ast.GoStmt: - a.apply(n, "Call", nil, n.Call) - - case *ast.DeferStmt: - a.apply(n, "Call", nil, n.Call) - - case *ast.ReturnStmt: - a.applyList(n, "Results") - - case *ast.BranchStmt: - a.apply(n, "Label", nil, n.Label) - - case *ast.BlockStmt: - a.applyList(n, "List") - - case *ast.IfStmt: - a.apply(n, "Init", nil, n.Init) - a.apply(n, "Cond", nil, n.Cond) - a.apply(n, "Body", nil, n.Body) - a.apply(n, "Else", nil, n.Else) - - case *ast.CaseClause: - a.applyList(n, "List") - a.applyList(n, "Body") - - case *ast.SwitchStmt: - a.apply(n, "Init", nil, n.Init) - a.apply(n, "Tag", nil, n.Tag) - a.apply(n, "Body", nil, n.Body) - - case *ast.TypeSwitchStmt: - a.apply(n, "Init", nil, n.Init) - a.apply(n, "Assign", nil, n.Assign) - a.apply(n, "Body", nil, n.Body) - - case *ast.CommClause: - a.apply(n, "Comm", nil, n.Comm) - a.applyList(n, "Body") - - case *ast.SelectStmt: - a.apply(n, "Body", nil, n.Body) - - case *ast.ForStmt: - a.apply(n, "Init", nil, n.Init) - a.apply(n, "Cond", nil, n.Cond) - a.apply(n, "Post", nil, n.Post) - a.apply(n, "Body", nil, n.Body) - - case *ast.RangeStmt: - a.apply(n, "Key", nil, n.Key) - a.apply(n, "Value", nil, n.Value) - a.apply(n, "X", nil, n.X) - a.apply(n, "Body", nil, n.Body) - - // Declarations - case *ast.ImportSpec: - a.apply(n, "Doc", nil, n.Doc) - a.apply(n, "Name", nil, n.Name) - a.apply(n, "Path", nil, n.Path) - a.apply(n, "Comment", nil, n.Comment) - - case *ast.ValueSpec: - a.apply(n, "Doc", nil, n.Doc) - a.applyList(n, "Names") - a.apply(n, "Type", nil, n.Type) - a.applyList(n, "Values") - a.apply(n, "Comment", nil, n.Comment) - - case *ast.TypeSpec: - a.apply(n, "Doc", nil, n.Doc) - a.apply(n, "Name", nil, n.Name) - a.apply(n, "Type", nil, n.Type) - a.apply(n, "Comment", nil, n.Comment) - - case *ast.BadDecl: - // nothing to do - - case *ast.GenDecl: - a.apply(n, "Doc", nil, n.Doc) - a.applyList(n, "Specs") - - case *ast.FuncDecl: - a.apply(n, "Doc", nil, n.Doc) - a.apply(n, "Recv", nil, n.Recv) - a.apply(n, "Name", nil, n.Name) - a.apply(n, "Type", nil, n.Type) - a.apply(n, "Body", nil, n.Body) - - // Files and packages - case *ast.File: - a.apply(n, "Doc", nil, n.Doc) - a.apply(n, "Name", nil, n.Name) - a.applyList(n, "Decls") - // Don't walk n.Comments; they have either been walked already if - // they are Doc comments, or they can be easily walked explicitly. - - case *ast.Package: - // collect and sort names for reproducible behavior - var names []string - for name := range n.Files { - names = append(names, name) - } - sort.Strings(names) - for _, name := range names { - a.apply(n, name, nil, n.Files[name]) - } - - default: - panic(fmt.Sprintf("Apply: unexpected node type %T", n)) - } - - if a.post != nil && !a.post(&a.cursor) { - panic(abort) - } - - a.cursor = saved -} - -// An iterator controls iteration over a slice of nodes. -type iterator struct { - index, step int -} - -func (a *application) applyList(parent ast.Node, name string) { - // avoid heap-allocating a new iterator for each applyList call; reuse a.iter instead - saved := a.iter - a.iter.index = 0 - for { - // must reload parent.name each time, since cursor modifications might change it - v := reflect.Indirect(reflect.ValueOf(parent)).FieldByName(name) - if a.iter.index >= v.Len() { - break - } - - // element x may be nil in a bad AST - be cautious - var x ast.Node - if e := v.Index(a.iter.index); e.IsValid() { - x = e.Interface().(ast.Node) - } - - a.iter.step = 1 - a.apply(parent, name, &a.iter, x) - a.iter.index += a.iter.step - } - a.iter = saved -} diff --git a/vendor/golang.org/x/tools/go/ast/astutil/util.go b/vendor/golang.org/x/tools/go/ast/astutil/util.go deleted file mode 100644 index 7630629..0000000 --- a/vendor/golang.org/x/tools/go/ast/astutil/util.go +++ /dev/null @@ -1,14 +0,0 @@ -package astutil - -import "go/ast" - -// Unparen returns e with any enclosing parentheses stripped. -func Unparen(e ast.Expr) ast.Expr { - for { - p, ok := e.(*ast.ParenExpr) - if !ok { - return e - } - e = p.X - } -} diff --git a/vendor/golang.org/x/tools/imports/forward.go b/vendor/golang.org/x/tools/imports/forward.go deleted file mode 100644 index dbe5b49..0000000 --- a/vendor/golang.org/x/tools/imports/forward.go +++ /dev/null @@ -1,70 +0,0 @@ -// Package imports implements a Go pretty-printer (like package "go/format") -// that also adds or removes import statements as necessary. -package imports // import "golang.org/x/tools/imports" - -import ( - "go/build" - "log" - "os" - - intimp "golang.org/x/tools/internal/imports" -) - -// Options specifies options for processing files. -type Options struct { - Fragment bool // Accept fragment of a source file (no package statement) - AllErrors bool // Report all errors (not just the first 10 on different lines) - - Comments bool // Print comments (true if nil *Options provided) - TabIndent bool // Use tabs for indent (true if nil *Options provided) - TabWidth int // Tab width (8 if nil *Options provided) - - FormatOnly bool // Disable the insertion and deletion of imports -} - -// Debug controls verbose logging. -var Debug = false - -// LocalPrefix is a comma-separated string of import path prefixes, which, if -// set, instructs Process to sort the import paths with the given prefixes -// into another group after 3rd-party packages. -var LocalPrefix string - -// Process formats and adjusts imports for the provided file. -// If opt is nil the defaults are used. -// -// Note that filename's directory influences which imports can be chosen, -// so it is important that filename be accurate. -// To process data ``as if'' it were in filename, pass the data as a non-nil src. -func Process(filename string, src []byte, opt *Options) ([]byte, error) { - if opt == nil { - opt = &Options{Comments: true, TabIndent: true, TabWidth: 8} - } - intopt := &intimp.Options{ - Env: &intimp.ProcessEnv{ - GOPATH: build.Default.GOPATH, - GOROOT: build.Default.GOROOT, - GOFLAGS: os.Getenv("GOFLAGS"), - GO111MODULE: os.Getenv("GO111MODULE"), - GOPROXY: os.Getenv("GOPROXY"), - GOSUMDB: os.Getenv("GOSUMDB"), - LocalPrefix: LocalPrefix, - }, - AllErrors: opt.AllErrors, - Comments: opt.Comments, - FormatOnly: opt.FormatOnly, - Fragment: opt.Fragment, - TabIndent: opt.TabIndent, - TabWidth: opt.TabWidth, - } - if Debug { - intopt.Env.Logf = log.Printf - } - return intimp.Process(filename, src, intopt) -} - -// VendorlessPath returns the devendorized version of the import path ipath. -// For example, VendorlessPath("foo/bar/vendor/a/b") returns "a/b". -func VendorlessPath(ipath string) string { - return intimp.VendorlessPath(ipath) -} diff --git a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk.go b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk.go deleted file mode 100644 index 9887f7e..0000000 --- a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk.go +++ /dev/null @@ -1,196 +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 fastwalk provides a faster version of filepath.Walk for file system -// scanning tools. -package fastwalk - -import ( - "errors" - "os" - "path/filepath" - "runtime" - "sync" -) - -// ErrTraverseLink is used as a return value from WalkFuncs to indicate that the -// symlink named in the call may be traversed. -var ErrTraverseLink = errors.New("fastwalk: traverse symlink, assuming target is a directory") - -// ErrSkipFiles is a used as a return value from WalkFuncs to indicate that the -// callback should not be called for any other files in the current directory. -// Child directories will still be traversed. -var ErrSkipFiles = errors.New("fastwalk: skip remaining files in directory") - -// Walk is a faster implementation of filepath.Walk. -// -// filepath.Walk's design necessarily calls os.Lstat on each file, -// even if the caller needs less info. -// Many tools need only the type of each file. -// On some platforms, this information is provided directly by the readdir -// system call, avoiding the need to stat each file individually. -// fastwalk_unix.go contains a fork of the syscall routines. -// -// See golang.org/issue/16399 -// -// Walk walks the file tree rooted at root, calling walkFn for -// each file or directory in the tree, including root. -// -// If fastWalk returns filepath.SkipDir, the directory is skipped. -// -// Unlike filepath.Walk: -// * file stat calls must be done by the user. -// The only provided metadata is the file type, which does not include -// any permission bits. -// * multiple goroutines stat the filesystem concurrently. The provided -// walkFn must be safe for concurrent use. -// * fastWalk can follow symlinks if walkFn returns the TraverseLink -// sentinel error. It is the walkFn's responsibility to prevent -// fastWalk from going into symlink cycles. -func Walk(root string, walkFn func(path string, typ os.FileMode) error) error { - // TODO(bradfitz): make numWorkers configurable? We used a - // minimum of 4 to give the kernel more info about multiple - // things we want, in hopes its I/O scheduling can take - // advantage of that. Hopefully most are in cache. Maybe 4 is - // even too low of a minimum. Profile more. - numWorkers := 4 - if n := runtime.NumCPU(); n > numWorkers { - numWorkers = n - } - - // Make sure to wait for all workers to finish, otherwise - // walkFn could still be called after returning. This Wait call - // runs after close(e.donec) below. - var wg sync.WaitGroup - defer wg.Wait() - - w := &walker{ - fn: walkFn, - enqueuec: make(chan walkItem, numWorkers), // buffered for performance - workc: make(chan walkItem, numWorkers), // buffered for performance - donec: make(chan struct{}), - - // buffered for correctness & not leaking goroutines: - resc: make(chan error, numWorkers), - } - defer close(w.donec) - - for i := 0; i < numWorkers; i++ { - wg.Add(1) - go w.doWork(&wg) - } - todo := []walkItem{{dir: root}} - out := 0 - for { - workc := w.workc - var workItem walkItem - if len(todo) == 0 { - workc = nil - } else { - workItem = todo[len(todo)-1] - } - select { - case workc <- workItem: - todo = todo[:len(todo)-1] - out++ - case it := <-w.enqueuec: - todo = append(todo, it) - case err := <-w.resc: - out-- - if err != nil { - return err - } - if out == 0 && len(todo) == 0 { - // It's safe to quit here, as long as the buffered - // enqueue channel isn't also readable, which might - // happen if the worker sends both another unit of - // work and its result before the other select was - // scheduled and both w.resc and w.enqueuec were - // readable. - select { - case it := <-w.enqueuec: - todo = append(todo, it) - default: - return nil - } - } - } - } -} - -// doWork reads directories as instructed (via workc) and runs the -// user's callback function. -func (w *walker) doWork(wg *sync.WaitGroup) { - defer wg.Done() - for { - select { - case <-w.donec: - return - case it := <-w.workc: - select { - case <-w.donec: - return - case w.resc <- w.walk(it.dir, !it.callbackDone): - } - } - } -} - -type walker struct { - fn func(path string, typ os.FileMode) error - - donec chan struct{} // closed on fastWalk's return - workc chan walkItem // to workers - enqueuec chan walkItem // from workers - resc chan error // from workers -} - -type walkItem struct { - dir string - callbackDone bool // callback already called; don't do it again -} - -func (w *walker) enqueue(it walkItem) { - select { - case w.enqueuec <- it: - case <-w.donec: - } -} - -func (w *walker) onDirEnt(dirName, baseName string, typ os.FileMode) error { - joined := dirName + string(os.PathSeparator) + baseName - if typ == os.ModeDir { - w.enqueue(walkItem{dir: joined}) - return nil - } - - err := w.fn(joined, typ) - if typ == os.ModeSymlink { - if err == ErrTraverseLink { - // Set callbackDone so we don't call it twice for both the - // symlink-as-symlink and the symlink-as-directory later: - w.enqueue(walkItem{dir: joined, callbackDone: true}) - return nil - } - if err == filepath.SkipDir { - // Permit SkipDir on symlinks too. - return nil - } - } - return err -} - -func (w *walker) walk(root string, runUserCallback bool) error { - if runUserCallback { - err := w.fn(root, os.ModeDir) - if err == filepath.SkipDir { - return nil - } - if err != nil { - return err - } - } - - return readDir(root, w.onDirEnt) -} diff --git a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_fileno.go b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_fileno.go deleted file mode 100644 index ccffec5..0000000 --- a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_fileno.go +++ /dev/null @@ -1,13 +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. - -// +build freebsd openbsd netbsd - -package fastwalk - -import "syscall" - -func direntInode(dirent *syscall.Dirent) uint64 { - return uint64(dirent.Fileno) -} diff --git a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_ino.go b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_ino.go deleted file mode 100644 index ab7fbc0..0000000 --- a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_ino.go +++ /dev/null @@ -1,14 +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. - -// +build linux darwin -// +build !appengine - -package fastwalk - -import "syscall" - -func direntInode(dirent *syscall.Dirent) uint64 { - return uint64(dirent.Ino) -} diff --git a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_bsd.go b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_bsd.go deleted file mode 100644 index a3b26a7..0000000 --- a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_bsd.go +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin freebsd openbsd netbsd - -package fastwalk - -import "syscall" - -func direntNamlen(dirent *syscall.Dirent) uint64 { - return uint64(dirent.Namlen) -} diff --git a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_linux.go b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_linux.go deleted file mode 100644 index e880d35..0000000 --- a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_linux.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build linux -// +build !appengine - -package fastwalk - -import ( - "bytes" - "syscall" - "unsafe" -) - -func direntNamlen(dirent *syscall.Dirent) uint64 { - const fixedHdr = uint16(unsafe.Offsetof(syscall.Dirent{}.Name)) - nameBuf := (*[unsafe.Sizeof(dirent.Name)]byte)(unsafe.Pointer(&dirent.Name[0])) - const nameBufLen = uint16(len(nameBuf)) - limit := dirent.Reclen - fixedHdr - if limit > nameBufLen { - limit = nameBufLen - } - nameLen := bytes.IndexByte(nameBuf[:limit], 0) - if nameLen < 0 { - panic("failed to find terminating 0 byte in dirent") - } - return uint64(nameLen) -} diff --git a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_portable.go b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_portable.go deleted file mode 100644 index b0d6327..0000000 --- a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_portable.go +++ /dev/null @@ -1,37 +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. - -// +build appengine !linux,!darwin,!freebsd,!openbsd,!netbsd - -package fastwalk - -import ( - "io/ioutil" - "os" -) - -// readDir calls fn for each directory entry in dirName. -// It does not descend into directories or follow symlinks. -// If fn returns a non-nil error, readDir returns with that error -// immediately. -func readDir(dirName string, fn func(dirName, entName string, typ os.FileMode) error) error { - fis, err := ioutil.ReadDir(dirName) - if err != nil { - return err - } - skipFiles := false - for _, fi := range fis { - if fi.Mode().IsRegular() && skipFiles { - continue - } - if err := fn(dirName, fi.Name(), fi.Mode()&os.ModeType); err != nil { - if err == ErrSkipFiles { - skipFiles = true - continue - } - return err - } - } - return nil -} diff --git a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go b/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go deleted file mode 100644 index 5901a8f..0000000 --- a/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go +++ /dev/null @@ -1,128 +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. - -// +build linux darwin freebsd openbsd netbsd -// +build !appengine - -package fastwalk - -import ( - "fmt" - "os" - "syscall" - "unsafe" -) - -const blockSize = 8 << 10 - -// unknownFileMode is a sentinel (and bogus) os.FileMode -// value used to represent a syscall.DT_UNKNOWN Dirent.Type. -const unknownFileMode os.FileMode = os.ModeNamedPipe | os.ModeSocket | os.ModeDevice - -func readDir(dirName string, fn func(dirName, entName string, typ os.FileMode) error) error { - fd, err := syscall.Open(dirName, 0, 0) - if err != nil { - return &os.PathError{Op: "open", Path: dirName, Err: err} - } - defer syscall.Close(fd) - - // The buffer must be at least a block long. - buf := make([]byte, blockSize) // stack-allocated; doesn't escape - bufp := 0 // starting read position in buf - nbuf := 0 // end valid data in buf - skipFiles := false - for { - if bufp >= nbuf { - bufp = 0 - nbuf, err = syscall.ReadDirent(fd, buf) - if err != nil { - return os.NewSyscallError("readdirent", err) - } - if nbuf <= 0 { - return nil - } - } - consumed, name, typ := parseDirEnt(buf[bufp:nbuf]) - bufp += consumed - if name == "" || name == "." || name == ".." { - continue - } - // Fallback for filesystems (like old XFS) that don't - // support Dirent.Type and have DT_UNKNOWN (0) there - // instead. - if typ == unknownFileMode { - fi, err := os.Lstat(dirName + "/" + name) - if err != nil { - // It got deleted in the meantime. - if os.IsNotExist(err) { - continue - } - return err - } - typ = fi.Mode() & os.ModeType - } - if skipFiles && typ.IsRegular() { - continue - } - if err := fn(dirName, name, typ); err != nil { - if err == ErrSkipFiles { - skipFiles = true - continue - } - return err - } - } -} - -func parseDirEnt(buf []byte) (consumed int, name string, typ os.FileMode) { - // golang.org/issue/37269 - dirent := &syscall.Dirent{} - copy((*[unsafe.Sizeof(syscall.Dirent{})]byte)(unsafe.Pointer(dirent))[:], buf) - if v := unsafe.Offsetof(dirent.Reclen) + unsafe.Sizeof(dirent.Reclen); uintptr(len(buf)) < v { - panic(fmt.Sprintf("buf size of %d smaller than dirent header size %d", len(buf), v)) - } - if len(buf) < int(dirent.Reclen) { - panic(fmt.Sprintf("buf size %d < record length %d", len(buf), dirent.Reclen)) - } - consumed = int(dirent.Reclen) - if direntInode(dirent) == 0 { // File absent in directory. - return - } - switch dirent.Type { - case syscall.DT_REG: - typ = 0 - case syscall.DT_DIR: - typ = os.ModeDir - case syscall.DT_LNK: - typ = os.ModeSymlink - case syscall.DT_BLK: - typ = os.ModeDevice - case syscall.DT_FIFO: - typ = os.ModeNamedPipe - case syscall.DT_SOCK: - typ = os.ModeSocket - case syscall.DT_UNKNOWN: - typ = unknownFileMode - default: - // Skip weird things. - // It's probably a DT_WHT (http://lwn.net/Articles/325369/) - // or something. Revisit if/when this package is moved outside - // of goimports. goimports only cares about regular files, - // symlinks, and directories. - return - } - - nameBuf := (*[unsafe.Sizeof(dirent.Name)]byte)(unsafe.Pointer(&dirent.Name[0])) - nameLen := direntNamlen(dirent) - - // Special cases for common things: - if nameLen == 1 && nameBuf[0] == '.' { - name = "." - } else if nameLen == 2 && nameBuf[0] == '.' && nameBuf[1] == '.' { - name = ".." - } else { - name = string(nameBuf[:nameLen]) - } - return -} diff --git a/vendor/golang.org/x/tools/internal/gocommand/invoke.go b/vendor/golang.org/x/tools/internal/gocommand/invoke.go deleted file mode 100644 index 468db40..0000000 --- a/vendor/golang.org/x/tools/internal/gocommand/invoke.go +++ /dev/null @@ -1,126 +0,0 @@ -// Package gocommand is a helper for calling the go command. -package gocommand - -import ( - "bytes" - "context" - "fmt" - "io" - "os" - "os/exec" - "strings" - "time" -) - -// An Invocation represents a call to the go command. -type Invocation struct { - Verb string - Args []string - BuildFlags []string - Env []string - WorkingDir string - Logf func(format string, args ...interface{}) -} - -// Run runs the invocation, returning its stdout and an error suitable for -// human consumption, including stderr. -func (i *Invocation) Run(ctx context.Context) (*bytes.Buffer, error) { - stdout, _, friendly, _ := i.RunRaw(ctx) - return stdout, friendly -} - -// RunRaw is like RunPiped, but also returns the raw stderr and error for callers -// that want to do low-level error handling/recovery. -func (i *Invocation) RunRaw(ctx context.Context) (stdout *bytes.Buffer, stderr *bytes.Buffer, friendlyError error, rawError error) { - stdout = &bytes.Buffer{} - stderr = &bytes.Buffer{} - rawError = i.RunPiped(ctx, stdout, stderr) - if rawError != nil { - // Check for 'go' executable not being found. - if ee, ok := rawError.(*exec.Error); ok && ee.Err == exec.ErrNotFound { - friendlyError = fmt.Errorf("go command required, not found: %v", ee) - } - if ctx.Err() != nil { - friendlyError = ctx.Err() - } - friendlyError = fmt.Errorf("err: %v: stderr: %s", rawError, stderr) - } - return -} - -// RunPiped is like Run, but relies on the given stdout/stderr -func (i *Invocation) RunPiped(ctx context.Context, stdout, stderr io.Writer) error { - log := i.Logf - if log == nil { - log = func(string, ...interface{}) {} - } - - goArgs := []string{i.Verb} - switch i.Verb { - case "mod": - // mod needs the sub-verb before build flags. - goArgs = append(goArgs, i.Args[0]) - goArgs = append(goArgs, i.BuildFlags...) - goArgs = append(goArgs, i.Args[1:]...) - case "env": - // env doesn't take build flags. - goArgs = append(goArgs, i.Args...) - default: - goArgs = append(goArgs, i.BuildFlags...) - goArgs = append(goArgs, i.Args...) - } - cmd := exec.Command("go", goArgs...) - cmd.Stdout = stdout - cmd.Stderr = stderr - // On darwin the cwd gets resolved to the real path, which breaks anything that - // expects the working directory to keep the original path, including the - // go command when dealing with modules. - // The Go stdlib has a special feature where if the cwd and the PWD are the - // same node then it trusts the PWD, so by setting it in the env for the child - // process we fix up all the paths returned by the go command. - cmd.Env = append(append([]string{}, i.Env...), "PWD="+i.WorkingDir) - cmd.Dir = i.WorkingDir - - defer func(start time.Time) { log("%s for %v", time.Since(start), cmdDebugStr(cmd)) }(time.Now()) - - return runCmdContext(ctx, cmd) -} - -// runCmdContext is like exec.CommandContext except it sends os.Interrupt -// before os.Kill. -func runCmdContext(ctx context.Context, cmd *exec.Cmd) error { - if err := cmd.Start(); err != nil { - return err - } - resChan := make(chan error, 1) - go func() { - resChan <- cmd.Wait() - }() - - select { - case err := <-resChan: - return err - case <-ctx.Done(): - } - // Cancelled. Interrupt and see if it ends voluntarily. - cmd.Process.Signal(os.Interrupt) - select { - case err := <-resChan: - return err - case <-time.After(time.Second): - } - // Didn't shut down in response to interrupt. Kill it hard. - cmd.Process.Kill() - return <-resChan -} - -func cmdDebugStr(cmd *exec.Cmd) string { - env := make(map[string]string) - for _, kv := range cmd.Env { - split := strings.Split(kv, "=") - k, v := split[0], split[1] - env[k] = v - } - - return fmt.Sprintf("GOROOT=%v GOPATH=%v GO111MODULE=%v GOPROXY=%v PWD=%v go %v", env["GOROOT"], env["GOPATH"], env["GO111MODULE"], env["GOPROXY"], env["PWD"], cmd.Args) -} diff --git a/vendor/golang.org/x/tools/internal/gopathwalk/walk.go b/vendor/golang.org/x/tools/internal/gopathwalk/walk.go deleted file mode 100644 index 390cb9d..0000000 --- a/vendor/golang.org/x/tools/internal/gopathwalk/walk.go +++ /dev/null @@ -1,275 +0,0 @@ -// 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 gopathwalk is like filepath.Walk but specialized for finding Go -// packages, particularly in $GOPATH and $GOROOT. -package gopathwalk - -import ( - "bufio" - "bytes" - "fmt" - "go/build" - "io/ioutil" - "log" - "os" - "path/filepath" - "strings" - "time" - - "golang.org/x/tools/internal/fastwalk" -) - -// Options controls the behavior of a Walk call. -type Options struct { - // If Logf is non-nil, debug logging is enabled through this function. - Logf func(format string, args ...interface{}) - // Search module caches. Also disables legacy goimports ignore rules. - ModulesEnabled bool -} - -// RootType indicates the type of a Root. -type RootType int - -const ( - RootUnknown RootType = iota - RootGOROOT - RootGOPATH - RootCurrentModule - RootModuleCache - RootOther -) - -// A Root is a starting point for a Walk. -type Root struct { - Path string - Type RootType -} - -// SrcDirsRoots returns the roots from build.Default.SrcDirs(). Not modules-compatible. -func SrcDirsRoots(ctx *build.Context) []Root { - var roots []Root - roots = append(roots, Root{filepath.Join(ctx.GOROOT, "src"), RootGOROOT}) - for _, p := range filepath.SplitList(ctx.GOPATH) { - roots = append(roots, Root{filepath.Join(p, "src"), RootGOPATH}) - } - return roots -} - -// Walk walks Go source directories ($GOROOT, $GOPATH, etc) to find packages. -// For each package found, add will be called (concurrently) with the absolute -// paths of the containing source directory and the package directory. -// add will be called concurrently. -func Walk(roots []Root, add func(root Root, dir string), opts Options) { - WalkSkip(roots, add, func(Root, string) bool { return false }, opts) -} - -// WalkSkip walks Go source directories ($GOROOT, $GOPATH, etc) to find packages. -// For each package found, add will be called (concurrently) with the absolute -// paths of the containing source directory and the package directory. -// For each directory that will be scanned, skip will be called (concurrently) -// with the absolute paths of the containing source directory and the directory. -// If skip returns false on a directory it will be processed. -// add will be called concurrently. -// skip will be called concurrently. -func WalkSkip(roots []Root, add func(root Root, dir string), skip func(root Root, dir string) bool, opts Options) { - for _, root := range roots { - walkDir(root, add, skip, opts) - } -} - -// walkDir creates a walker and starts fastwalk with this walker. -func walkDir(root Root, add func(Root, string), skip func(root Root, dir string) bool, opts Options) { - if _, err := os.Stat(root.Path); os.IsNotExist(err) { - if opts.Logf != nil { - opts.Logf("skipping nonexistent directory: %v", root.Path) - } - return - } - start := time.Now() - if opts.Logf != nil { - opts.Logf("gopathwalk: scanning %s", root.Path) - } - w := &walker{ - root: root, - add: add, - skip: skip, - opts: opts, - } - w.init() - if err := fastwalk.Walk(root.Path, w.walk); err != nil { - log.Printf("gopathwalk: scanning directory %v: %v", root.Path, err) - } - - if opts.Logf != nil { - opts.Logf("gopathwalk: scanned %s in %v", root.Path, time.Since(start)) - } -} - -// walker is the callback for fastwalk.Walk. -type walker struct { - root Root // The source directory to scan. - add func(Root, string) // The callback that will be invoked for every possible Go package dir. - skip func(Root, string) bool // The callback that will be invoked for every dir. dir is skipped if it returns true. - opts Options // Options passed to Walk by the user. - - ignoredDirs []os.FileInfo // The ignored directories, loaded from .goimportsignore files. -} - -// init initializes the walker based on its Options -func (w *walker) init() { - var ignoredPaths []string - if w.root.Type == RootModuleCache { - ignoredPaths = []string{"cache"} - } - if !w.opts.ModulesEnabled && w.root.Type == RootGOPATH { - ignoredPaths = w.getIgnoredDirs(w.root.Path) - ignoredPaths = append(ignoredPaths, "v", "mod") - } - - for _, p := range ignoredPaths { - full := filepath.Join(w.root.Path, p) - if fi, err := os.Stat(full); err == nil { - w.ignoredDirs = append(w.ignoredDirs, fi) - if w.opts.Logf != nil { - w.opts.Logf("Directory added to ignore list: %s", full) - } - } else if w.opts.Logf != nil { - w.opts.Logf("Error statting ignored directory: %v", err) - } - } -} - -// getIgnoredDirs reads an optional config file at /.goimportsignore -// of relative directories to ignore when scanning for go files. -// The provided path is one of the $GOPATH entries with "src" appended. -func (w *walker) getIgnoredDirs(path string) []string { - file := filepath.Join(path, ".goimportsignore") - slurp, err := ioutil.ReadFile(file) - if w.opts.Logf != nil { - if err != nil { - w.opts.Logf("%v", err) - } else { - w.opts.Logf("Read %s", file) - } - } - if err != nil { - return nil - } - - var ignoredDirs []string - bs := bufio.NewScanner(bytes.NewReader(slurp)) - for bs.Scan() { - line := strings.TrimSpace(bs.Text()) - if line == "" || strings.HasPrefix(line, "#") { - continue - } - ignoredDirs = append(ignoredDirs, line) - } - return ignoredDirs -} - -// shouldSkipDir reports whether the file should be skipped or not. -func (w *walker) shouldSkipDir(fi os.FileInfo, dir string) bool { - for _, ignoredDir := range w.ignoredDirs { - if os.SameFile(fi, ignoredDir) { - return true - } - } - if w.skip != nil { - // Check with the user specified callback. - return w.skip(w.root, dir) - } - return false -} - -// walk walks through the given path. -func (w *walker) walk(path string, typ os.FileMode) error { - dir := filepath.Dir(path) - if typ.IsRegular() { - if dir == w.root.Path && (w.root.Type == RootGOROOT || w.root.Type == RootGOPATH) { - // Doesn't make sense to have regular files - // directly in your $GOPATH/src or $GOROOT/src. - return fastwalk.ErrSkipFiles - } - if !strings.HasSuffix(path, ".go") { - return nil - } - - w.add(w.root, dir) - return fastwalk.ErrSkipFiles - } - if typ == os.ModeDir { - base := filepath.Base(path) - if base == "" || base[0] == '.' || base[0] == '_' || - base == "testdata" || - (w.root.Type == RootGOROOT && w.opts.ModulesEnabled && base == "vendor") || - (!w.opts.ModulesEnabled && base == "node_modules") { - return filepath.SkipDir - } - fi, err := os.Lstat(path) - if err == nil && w.shouldSkipDir(fi, path) { - return filepath.SkipDir - } - return nil - } - if typ == os.ModeSymlink { - base := filepath.Base(path) - if strings.HasPrefix(base, ".#") { - // Emacs noise. - return nil - } - fi, err := os.Lstat(path) - if err != nil { - // Just ignore it. - return nil - } - if w.shouldTraverse(dir, fi) { - return fastwalk.ErrTraverseLink - } - } - return nil -} - -// shouldTraverse reports whether the symlink fi, found in dir, -// should be followed. It makes sure symlinks were never visited -// before to avoid symlink loops. -func (w *walker) shouldTraverse(dir string, fi os.FileInfo) bool { - path := filepath.Join(dir, fi.Name()) - target, err := filepath.EvalSymlinks(path) - if err != nil { - return false - } - ts, err := os.Stat(target) - if err != nil { - fmt.Fprintln(os.Stderr, err) - return false - } - if !ts.IsDir() { - return false - } - if w.shouldSkipDir(ts, dir) { - return false - } - // Check for symlink loops by statting each directory component - // and seeing if any are the same file as ts. - for { - parent := filepath.Dir(path) - if parent == path { - // Made it to the root without seeing a cycle. - // Use this symlink. - return true - } - parentInfo, err := os.Stat(parent) - if err != nil { - return false - } - if os.SameFile(ts, parentInfo) { - // Cycle. Don't traverse. - return false - } - path = parent - } - -} diff --git a/vendor/golang.org/x/tools/internal/imports/fix.go b/vendor/golang.org/x/tools/internal/imports/fix.go deleted file mode 100644 index 92a2343..0000000 --- a/vendor/golang.org/x/tools/internal/imports/fix.go +++ /dev/null @@ -1,1578 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package imports - -import ( - "bytes" - "context" - "fmt" - "go/ast" - "go/build" - "go/parser" - "go/token" - "io/ioutil" - "os" - "path" - "path/filepath" - "reflect" - "sort" - "strconv" - "strings" - "sync" - "unicode" - "unicode/utf8" - - "golang.org/x/tools/go/ast/astutil" - "golang.org/x/tools/internal/gocommand" - "golang.org/x/tools/internal/gopathwalk" -) - -// importToGroup is a list of functions which map from an import path to -// a group number. -var importToGroup = []func(env *ProcessEnv, importPath string) (num int, ok bool){ - func(env *ProcessEnv, importPath string) (num int, ok bool) { - if env.LocalPrefix == "" { - return - } - for _, p := range strings.Split(env.LocalPrefix, ",") { - if strings.HasPrefix(importPath, p) || strings.TrimSuffix(p, "/") == importPath { - return 3, true - } - } - return - }, - func(_ *ProcessEnv, importPath string) (num int, ok bool) { - if strings.HasPrefix(importPath, "appengine") { - return 2, true - } - return - }, - func(_ *ProcessEnv, importPath string) (num int, ok bool) { - if strings.Contains(importPath, ".") { - return 1, true - } - return - }, -} - -func importGroup(env *ProcessEnv, importPath string) int { - for _, fn := range importToGroup { - if n, ok := fn(env, importPath); ok { - return n - } - } - return 0 -} - -type ImportFixType int - -const ( - AddImport ImportFixType = iota - DeleteImport - SetImportName -) - -type ImportFix struct { - // StmtInfo represents the import statement this fix will add, remove, or change. - StmtInfo ImportInfo - // IdentName is the identifier that this fix will add or remove. - IdentName string - // FixType is the type of fix this is (AddImport, DeleteImport, SetImportName). - FixType ImportFixType - Relevance int // see pkg -} - -// An ImportInfo represents a single import statement. -type ImportInfo struct { - ImportPath string // import path, e.g. "crypto/rand". - Name string // import name, e.g. "crand", or "" if none. -} - -// A packageInfo represents what's known about a package. -type packageInfo struct { - name string // real package name, if known. - exports map[string]bool // known exports. -} - -// parseOtherFiles parses all the Go files in srcDir except filename, including -// test files if filename looks like a test. -func parseOtherFiles(fset *token.FileSet, srcDir, filename string) []*ast.File { - // This could use go/packages but it doesn't buy much, and it fails - // with https://golang.org/issue/26296 in LoadFiles mode in some cases. - considerTests := strings.HasSuffix(filename, "_test.go") - - fileBase := filepath.Base(filename) - packageFileInfos, err := ioutil.ReadDir(srcDir) - if err != nil { - return nil - } - - var files []*ast.File - for _, fi := range packageFileInfos { - if fi.Name() == fileBase || !strings.HasSuffix(fi.Name(), ".go") { - continue - } - if !considerTests && strings.HasSuffix(fi.Name(), "_test.go") { - continue - } - - f, err := parser.ParseFile(fset, filepath.Join(srcDir, fi.Name()), nil, 0) - if err != nil { - continue - } - - files = append(files, f) - } - - return files -} - -// addGlobals puts the names of package vars into the provided map. -func addGlobals(f *ast.File, globals map[string]bool) { - for _, decl := range f.Decls { - genDecl, ok := decl.(*ast.GenDecl) - if !ok { - continue - } - - for _, spec := range genDecl.Specs { - valueSpec, ok := spec.(*ast.ValueSpec) - if !ok { - continue - } - globals[valueSpec.Names[0].Name] = true - } - } -} - -// collectReferences builds a map of selector expressions, from -// left hand side (X) to a set of right hand sides (Sel). -func collectReferences(f *ast.File) references { - refs := references{} - - var visitor visitFn - visitor = func(node ast.Node) ast.Visitor { - if node == nil { - return visitor - } - switch v := node.(type) { - case *ast.SelectorExpr: - xident, ok := v.X.(*ast.Ident) - if !ok { - break - } - if xident.Obj != nil { - // If the parser can resolve it, it's not a package ref. - break - } - if !ast.IsExported(v.Sel.Name) { - // Whatever this is, it's not exported from a package. - break - } - pkgName := xident.Name - r := refs[pkgName] - if r == nil { - r = make(map[string]bool) - refs[pkgName] = r - } - r[v.Sel.Name] = true - } - return visitor - } - ast.Walk(visitor, f) - return refs -} - -// collectImports returns all the imports in f. -// Unnamed imports (., _) and "C" are ignored. -func collectImports(f *ast.File) []*ImportInfo { - var imports []*ImportInfo - for _, imp := range f.Imports { - var name string - if imp.Name != nil { - name = imp.Name.Name - } - if imp.Path.Value == `"C"` || name == "_" || name == "." { - continue - } - path := strings.Trim(imp.Path.Value, `"`) - imports = append(imports, &ImportInfo{ - Name: name, - ImportPath: path, - }) - } - return imports -} - -// findMissingImport searches pass's candidates for an import that provides -// pkg, containing all of syms. -func (p *pass) findMissingImport(pkg string, syms map[string]bool) *ImportInfo { - for _, candidate := range p.candidates { - pkgInfo, ok := p.knownPackages[candidate.ImportPath] - if !ok { - continue - } - if p.importIdentifier(candidate) != pkg { - continue - } - - allFound := true - for right := range syms { - if !pkgInfo.exports[right] { - allFound = false - break - } - } - - if allFound { - return candidate - } - } - return nil -} - -// references is set of references found in a Go file. The first map key is the -// left hand side of a selector expression, the second key is the right hand -// side, and the value should always be true. -type references map[string]map[string]bool - -// A pass contains all the inputs and state necessary to fix a file's imports. -// It can be modified in some ways during use; see comments below. -type pass struct { - // Inputs. These must be set before a call to load, and not modified after. - fset *token.FileSet // fset used to parse f and its siblings. - f *ast.File // the file being fixed. - srcDir string // the directory containing f. - env *ProcessEnv // the environment to use for go commands, etc. - loadRealPackageNames bool // if true, load package names from disk rather than guessing them. - otherFiles []*ast.File // sibling files. - - // Intermediate state, generated by load. - existingImports map[string]*ImportInfo - allRefs references - missingRefs references - - // Inputs to fix. These can be augmented between successive fix calls. - lastTry bool // indicates that this is the last call and fix should clean up as best it can. - candidates []*ImportInfo // candidate imports in priority order. - knownPackages map[string]*packageInfo // information about all known packages. -} - -// loadPackageNames saves the package names for everything referenced by imports. -func (p *pass) loadPackageNames(imports []*ImportInfo) error { - if p.env.Logf != nil { - p.env.Logf("loading package names for %v packages", len(imports)) - defer func() { - p.env.Logf("done loading package names for %v packages", len(imports)) - }() - } - var unknown []string - for _, imp := range imports { - if _, ok := p.knownPackages[imp.ImportPath]; ok { - continue - } - unknown = append(unknown, imp.ImportPath) - } - - names, err := p.env.GetResolver().loadPackageNames(unknown, p.srcDir) - if err != nil { - return err - } - - for path, name := range names { - p.knownPackages[path] = &packageInfo{ - name: name, - exports: map[string]bool{}, - } - } - return nil -} - -// importIdentifier returns the identifier that imp will introduce. It will -// guess if the package name has not been loaded, e.g. because the source -// is not available. -func (p *pass) importIdentifier(imp *ImportInfo) string { - if imp.Name != "" { - return imp.Name - } - known := p.knownPackages[imp.ImportPath] - if known != nil && known.name != "" { - return known.name - } - return ImportPathToAssumedName(imp.ImportPath) -} - -// load reads in everything necessary to run a pass, and reports whether the -// file already has all the imports it needs. It fills in p.missingRefs with the -// file's missing symbols, if any, or removes unused imports if not. -func (p *pass) load() ([]*ImportFix, bool) { - p.knownPackages = map[string]*packageInfo{} - p.missingRefs = references{} - p.existingImports = map[string]*ImportInfo{} - - // Load basic information about the file in question. - p.allRefs = collectReferences(p.f) - - // Load stuff from other files in the same package: - // global variables so we know they don't need resolving, and imports - // that we might want to mimic. - globals := map[string]bool{} - for _, otherFile := range p.otherFiles { - // Don't load globals from files that are in the same directory - // but a different package. Using them to suggest imports is OK. - if p.f.Name.Name == otherFile.Name.Name { - addGlobals(otherFile, globals) - } - p.candidates = append(p.candidates, collectImports(otherFile)...) - } - - // Resolve all the import paths we've seen to package names, and store - // f's imports by the identifier they introduce. - imports := collectImports(p.f) - if p.loadRealPackageNames { - err := p.loadPackageNames(append(imports, p.candidates...)) - if err != nil { - if p.env.Logf != nil { - p.env.Logf("loading package names: %v", err) - } - return nil, false - } - } - for _, imp := range imports { - p.existingImports[p.importIdentifier(imp)] = imp - } - - // Find missing references. - for left, rights := range p.allRefs { - if globals[left] { - continue - } - _, ok := p.existingImports[left] - if !ok { - p.missingRefs[left] = rights - continue - } - } - if len(p.missingRefs) != 0 { - return nil, false - } - - return p.fix() -} - -// fix attempts to satisfy missing imports using p.candidates. If it finds -// everything, or if p.lastTry is true, it updates fixes to add the imports it found, -// delete anything unused, and update import names, and returns true. -func (p *pass) fix() ([]*ImportFix, bool) { - // Find missing imports. - var selected []*ImportInfo - for left, rights := range p.missingRefs { - if imp := p.findMissingImport(left, rights); imp != nil { - selected = append(selected, imp) - } - } - - if !p.lastTry && len(selected) != len(p.missingRefs) { - return nil, false - } - - // Found everything, or giving up. Add the new imports and remove any unused. - var fixes []*ImportFix - for _, imp := range p.existingImports { - // We deliberately ignore globals here, because we can't be sure - // they're in the same package. People do things like put multiple - // main packages in the same directory, and we don't want to - // remove imports if they happen to have the same name as a var in - // a different package. - if _, ok := p.allRefs[p.importIdentifier(imp)]; !ok { - fixes = append(fixes, &ImportFix{ - StmtInfo: *imp, - IdentName: p.importIdentifier(imp), - FixType: DeleteImport, - }) - continue - } - - // An existing import may need to update its import name to be correct. - if name := p.importSpecName(imp); name != imp.Name { - fixes = append(fixes, &ImportFix{ - StmtInfo: ImportInfo{ - Name: name, - ImportPath: imp.ImportPath, - }, - IdentName: p.importIdentifier(imp), - FixType: SetImportName, - }) - } - } - - for _, imp := range selected { - fixes = append(fixes, &ImportFix{ - StmtInfo: ImportInfo{ - Name: p.importSpecName(imp), - ImportPath: imp.ImportPath, - }, - IdentName: p.importIdentifier(imp), - FixType: AddImport, - }) - } - - return fixes, true -} - -// importSpecName gets the import name of imp in the import spec. -// -// When the import identifier matches the assumed import name, the import name does -// not appear in the import spec. -func (p *pass) importSpecName(imp *ImportInfo) string { - // If we did not load the real package names, or the name is already set, - // we just return the existing name. - if !p.loadRealPackageNames || imp.Name != "" { - return imp.Name - } - - ident := p.importIdentifier(imp) - if ident == ImportPathToAssumedName(imp.ImportPath) { - return "" // ident not needed since the assumed and real names are the same. - } - return ident -} - -// apply will perform the fixes on f in order. -func apply(fset *token.FileSet, f *ast.File, fixes []*ImportFix) { - for _, fix := range fixes { - switch fix.FixType { - case DeleteImport: - astutil.DeleteNamedImport(fset, f, fix.StmtInfo.Name, fix.StmtInfo.ImportPath) - case AddImport: - astutil.AddNamedImport(fset, f, fix.StmtInfo.Name, fix.StmtInfo.ImportPath) - case SetImportName: - // Find the matching import path and change the name. - for _, spec := range f.Imports { - path := strings.Trim(spec.Path.Value, `"`) - if path == fix.StmtInfo.ImportPath { - spec.Name = &ast.Ident{ - Name: fix.StmtInfo.Name, - NamePos: spec.Pos(), - } - } - } - } - } -} - -// assumeSiblingImportsValid assumes that siblings' use of packages is valid, -// adding the exports they use. -func (p *pass) assumeSiblingImportsValid() { - for _, f := range p.otherFiles { - refs := collectReferences(f) - imports := collectImports(f) - importsByName := map[string]*ImportInfo{} - for _, imp := range imports { - importsByName[p.importIdentifier(imp)] = imp - } - for left, rights := range refs { - if imp, ok := importsByName[left]; ok { - if m, ok := stdlib[imp.ImportPath]; ok { - // We have the stdlib in memory; no need to guess. - rights = copyExports(m) - } - p.addCandidate(imp, &packageInfo{ - // no name; we already know it. - exports: rights, - }) - } - } - } -} - -// addCandidate adds a candidate import to p, and merges in the information -// in pkg. -func (p *pass) addCandidate(imp *ImportInfo, pkg *packageInfo) { - p.candidates = append(p.candidates, imp) - if existing, ok := p.knownPackages[imp.ImportPath]; ok { - if existing.name == "" { - existing.name = pkg.name - } - for export := range pkg.exports { - existing.exports[export] = true - } - } else { - p.knownPackages[imp.ImportPath] = pkg - } -} - -// fixImports adds and removes imports from f so that all its references are -// satisfied and there are no unused imports. -// -// This is declared as a variable rather than a function so goimports can -// easily be extended by adding a file with an init function. -var fixImports = fixImportsDefault - -func fixImportsDefault(fset *token.FileSet, f *ast.File, filename string, env *ProcessEnv) error { - fixes, err := getFixes(fset, f, filename, env) - if err != nil { - return err - } - apply(fset, f, fixes) - return err -} - -// getFixes gets the import fixes that need to be made to f in order to fix the imports. -// It does not modify the ast. -func getFixes(fset *token.FileSet, f *ast.File, filename string, env *ProcessEnv) ([]*ImportFix, error) { - abs, err := filepath.Abs(filename) - if err != nil { - return nil, err - } - srcDir := filepath.Dir(abs) - if env.Logf != nil { - env.Logf("fixImports(filename=%q), abs=%q, srcDir=%q ...", filename, abs, srcDir) - } - - // First pass: looking only at f, and using the naive algorithm to - // derive package names from import paths, see if the file is already - // complete. We can't add any imports yet, because we don't know - // if missing references are actually package vars. - p := &pass{fset: fset, f: f, srcDir: srcDir, env: env} - if fixes, done := p.load(); done { - return fixes, nil - } - - otherFiles := parseOtherFiles(fset, srcDir, filename) - - // Second pass: add information from other files in the same package, - // like their package vars and imports. - p.otherFiles = otherFiles - if fixes, done := p.load(); done { - return fixes, nil - } - - // Now we can try adding imports from the stdlib. - p.assumeSiblingImportsValid() - addStdlibCandidates(p, p.missingRefs) - if fixes, done := p.fix(); done { - return fixes, nil - } - - // Third pass: get real package names where we had previously used - // the naive algorithm. - p = &pass{fset: fset, f: f, srcDir: srcDir, env: env} - p.loadRealPackageNames = true - p.otherFiles = otherFiles - if fixes, done := p.load(); done { - return fixes, nil - } - - addStdlibCandidates(p, p.missingRefs) - p.assumeSiblingImportsValid() - if fixes, done := p.fix(); done { - return fixes, nil - } - - // Go look for candidates in $GOPATH, etc. We don't necessarily load - // the real exports of sibling imports, so keep assuming their contents. - if err := addExternalCandidates(p, p.missingRefs, filename); err != nil { - return nil, err - } - - p.lastTry = true - fixes, _ := p.fix() - return fixes, nil -} - -// Highest relevance, used for the standard library. Chosen arbitrarily to -// match pre-existing gopls code. -const MaxRelevance = 7 - -// getCandidatePkgs works with the passed callback to find all acceptable packages. -// It deduplicates by import path, and uses a cached stdlib rather than reading -// from disk. -func getCandidatePkgs(ctx context.Context, wrappedCallback *scanCallback, filename, filePkg string, env *ProcessEnv) error { - notSelf := func(p *pkg) bool { - return p.packageName != filePkg || p.dir != filepath.Dir(filename) - } - // Start off with the standard library. - for importPath, exports := range stdlib { - p := &pkg{ - dir: filepath.Join(env.GOROOT, "src", importPath), - importPathShort: importPath, - packageName: path.Base(importPath), - relevance: MaxRelevance, - } - if notSelf(p) && wrappedCallback.packageNameLoaded(p) { - wrappedCallback.exportsLoaded(p, exports) - } - } - - var mu sync.Mutex - dupCheck := map[string]struct{}{} - - scanFilter := &scanCallback{ - rootFound: func(root gopathwalk.Root) bool { - // Exclude goroot results -- getting them is relatively expensive, not cached, - // and generally redundant with the in-memory version. - return root.Type != gopathwalk.RootGOROOT && wrappedCallback.rootFound(root) - }, - dirFound: wrappedCallback.dirFound, - packageNameLoaded: func(pkg *pkg) bool { - mu.Lock() - defer mu.Unlock() - if _, ok := dupCheck[pkg.importPathShort]; ok { - return false - } - dupCheck[pkg.importPathShort] = struct{}{} - return notSelf(pkg) && wrappedCallback.packageNameLoaded(pkg) - }, - exportsLoaded: func(pkg *pkg, exports []string) { - // If we're an x_test, load the package under test's test variant. - if strings.HasSuffix(filePkg, "_test") && pkg.dir == filepath.Dir(filename) { - var err error - _, exports, err = loadExportsFromFiles(ctx, env, pkg.dir, true) - if err != nil { - return - } - } - wrappedCallback.exportsLoaded(pkg, exports) - }, - } - return env.GetResolver().scan(ctx, scanFilter) -} - -func ScoreImportPaths(ctx context.Context, env *ProcessEnv, paths []string) map[string]int { - result := make(map[string]int) - for _, path := range paths { - result[path] = env.GetResolver().scoreImportPath(ctx, path) - } - return result -} - -func PrimeCache(ctx context.Context, env *ProcessEnv) error { - // Fully scan the disk for directories, but don't actually read any Go files. - callback := &scanCallback{ - rootFound: func(gopathwalk.Root) bool { - return true - }, - dirFound: func(pkg *pkg) bool { - return false - }, - packageNameLoaded: func(pkg *pkg) bool { - return false - }, - } - return getCandidatePkgs(ctx, callback, "", "", env) -} - -func candidateImportName(pkg *pkg) string { - if ImportPathToAssumedName(pkg.importPathShort) != pkg.packageName { - return pkg.packageName - } - return "" -} - -// getAllCandidates gets all of the candidates to be imported, regardless of if they are needed. -func getAllCandidates(ctx context.Context, wrapped func(ImportFix), searchPrefix, filename, filePkg string, env *ProcessEnv) error { - callback := &scanCallback{ - rootFound: func(gopathwalk.Root) bool { - return true - }, - dirFound: func(pkg *pkg) bool { - if !canUse(filename, pkg.dir) { - return false - } - // Try the assumed package name first, then a simpler path match - // in case of packages named vN, which are not uncommon. - return strings.HasPrefix(ImportPathToAssumedName(pkg.importPathShort), searchPrefix) || - strings.HasPrefix(path.Base(pkg.importPathShort), searchPrefix) - }, - packageNameLoaded: func(pkg *pkg) bool { - if !strings.HasPrefix(pkg.packageName, searchPrefix) { - return false - } - wrapped(ImportFix{ - StmtInfo: ImportInfo{ - ImportPath: pkg.importPathShort, - Name: candidateImportName(pkg), - }, - IdentName: pkg.packageName, - FixType: AddImport, - Relevance: pkg.relevance, - }) - return false - }, - } - return getCandidatePkgs(ctx, callback, filename, filePkg, env) -} - -// A PackageExport is a package and its exports. -type PackageExport struct { - Fix *ImportFix - Exports []string -} - -func getPackageExports(ctx context.Context, wrapped func(PackageExport), searchPkg, filename, filePkg string, env *ProcessEnv) error { - callback := &scanCallback{ - rootFound: func(gopathwalk.Root) bool { - return true - }, - dirFound: func(pkg *pkg) bool { - return pkgIsCandidate(filename, references{searchPkg: nil}, pkg) - }, - packageNameLoaded: func(pkg *pkg) bool { - return pkg.packageName == searchPkg - }, - exportsLoaded: func(pkg *pkg, exports []string) { - sort.Strings(exports) - wrapped(PackageExport{ - Fix: &ImportFix{ - StmtInfo: ImportInfo{ - ImportPath: pkg.importPathShort, - Name: candidateImportName(pkg), - }, - IdentName: pkg.packageName, - FixType: AddImport, - Relevance: pkg.relevance, - }, - Exports: exports, - }) - }, - } - return getCandidatePkgs(ctx, callback, filename, filePkg, env) -} - -// ProcessEnv contains environment variables and settings that affect the use of -// the go command, the go/build package, etc. -type ProcessEnv struct { - LocalPrefix string - - BuildFlags []string - - // If non-empty, these will be used instead of the - // process-wide values. - GOPATH, GOROOT, GO111MODULE, GOPROXY, GOFLAGS, GOSUMDB string - WorkingDir string - - // If Logf is non-nil, debug logging is enabled through this function. - Logf func(format string, args ...interface{}) - - resolver Resolver -} - -// CopyConfig copies the env's configuration into a new env. -func (e *ProcessEnv) CopyConfig() *ProcessEnv { - copy := *e - copy.resolver = nil - return © -} - -func (e *ProcessEnv) env() []string { - env := os.Environ() - add := func(k, v string) { - if v != "" { - env = append(env, k+"="+v) - } - } - add("GOPATH", e.GOPATH) - add("GOROOT", e.GOROOT) - add("GO111MODULE", e.GO111MODULE) - add("GOPROXY", e.GOPROXY) - add("GOFLAGS", e.GOFLAGS) - add("GOSUMDB", e.GOSUMDB) - if e.WorkingDir != "" { - add("PWD", e.WorkingDir) - } - return env -} - -func (e *ProcessEnv) GetResolver() Resolver { - if e.resolver != nil { - return e.resolver - } - out, err := e.invokeGo(context.TODO(), "env", "GOMOD") - if err != nil || len(bytes.TrimSpace(out.Bytes())) == 0 { - e.resolver = newGopathResolver(e) - return e.resolver - } - e.resolver = newModuleResolver(e) - return e.resolver -} - -func (e *ProcessEnv) buildContext() *build.Context { - ctx := build.Default - ctx.GOROOT = e.GOROOT - ctx.GOPATH = e.GOPATH - - // As of Go 1.14, build.Context has a Dir field - // (see golang.org/issue/34860). - // Populate it only if present. - rc := reflect.ValueOf(&ctx).Elem() - dir := rc.FieldByName("Dir") - if !dir.IsValid() { - // Working drafts of Go 1.14 named the field "WorkingDir" instead. - // TODO(bcmills): Remove this case after the Go 1.14 beta has been released. - dir = rc.FieldByName("WorkingDir") - } - if dir.IsValid() && dir.Kind() == reflect.String { - dir.SetString(e.WorkingDir) - } - - return &ctx -} - -func (e *ProcessEnv) invokeGo(ctx context.Context, verb string, args ...string) (*bytes.Buffer, error) { - inv := gocommand.Invocation{ - Verb: verb, - Args: args, - BuildFlags: e.BuildFlags, - Env: e.env(), - Logf: e.Logf, - WorkingDir: e.WorkingDir, - } - return inv.Run(ctx) -} - -func addStdlibCandidates(pass *pass, refs references) { - add := func(pkg string) { - // Prevent self-imports. - if path.Base(pkg) == pass.f.Name.Name && filepath.Join(pass.env.GOROOT, "src", pkg) == pass.srcDir { - return - } - exports := copyExports(stdlib[pkg]) - pass.addCandidate( - &ImportInfo{ImportPath: pkg}, - &packageInfo{name: path.Base(pkg), exports: exports}) - } - for left := range refs { - if left == "rand" { - // Make sure we try crypto/rand before math/rand. - add("crypto/rand") - add("math/rand") - continue - } - for importPath := range stdlib { - if path.Base(importPath) == left { - add(importPath) - } - } - } -} - -// A Resolver does the build-system-specific parts of goimports. -type Resolver interface { - // loadPackageNames loads the package names in importPaths. - loadPackageNames(importPaths []string, srcDir string) (map[string]string, error) - // scan works with callback to search for packages. See scanCallback for details. - scan(ctx context.Context, callback *scanCallback) error - // loadExports returns the set of exported symbols in the package at dir. - // loadExports may be called concurrently. - loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []string, error) - // scoreImportPath returns the relevance for an import path. - scoreImportPath(ctx context.Context, path string) int - - ClearForNewScan() -} - -// A scanCallback controls a call to scan and receives its results. -// In general, minor errors will be silently discarded; a user should not -// expect to receive a full series of calls for everything. -type scanCallback struct { - // rootFound is called before scanning a new root dir. If it returns true, - // the root will be scanned. Returning false will not necessarily prevent - // directories from that root making it to dirFound. - rootFound func(gopathwalk.Root) bool - // dirFound is called when a directory is found that is possibly a Go package. - // pkg will be populated with everything except packageName. - // If it returns true, the package's name will be loaded. - dirFound func(pkg *pkg) bool - // packageNameLoaded is called when a package is found and its name is loaded. - // If it returns true, the package's exports will be loaded. - packageNameLoaded func(pkg *pkg) bool - // exportsLoaded is called when a package's exports have been loaded. - exportsLoaded func(pkg *pkg, exports []string) -} - -func addExternalCandidates(pass *pass, refs references, filename string) error { - var mu sync.Mutex - found := make(map[string][]pkgDistance) - callback := &scanCallback{ - rootFound: func(gopathwalk.Root) bool { - return true // We want everything. - }, - dirFound: func(pkg *pkg) bool { - return pkgIsCandidate(filename, refs, pkg) - }, - packageNameLoaded: func(pkg *pkg) bool { - if _, want := refs[pkg.packageName]; !want { - return false - } - if pkg.dir == pass.srcDir && pass.f.Name.Name == pkg.packageName { - // The candidate is in the same directory and has the - // same package name. Don't try to import ourselves. - return false - } - if !canUse(filename, pkg.dir) { - return false - } - mu.Lock() - defer mu.Unlock() - found[pkg.packageName] = append(found[pkg.packageName], pkgDistance{pkg, distance(pass.srcDir, pkg.dir)}) - return false // We'll do our own loading after we sort. - }, - } - err := pass.env.GetResolver().scan(context.Background(), callback) - if err != nil { - return err - } - - // Search for imports matching potential package references. - type result struct { - imp *ImportInfo - pkg *packageInfo - } - results := make(chan result, len(refs)) - - ctx, cancel := context.WithCancel(context.TODO()) - var wg sync.WaitGroup - defer func() { - cancel() - wg.Wait() - }() - var ( - firstErr error - firstErrOnce sync.Once - ) - for pkgName, symbols := range refs { - wg.Add(1) - go func(pkgName string, symbols map[string]bool) { - defer wg.Done() - - found, err := findImport(ctx, pass, found[pkgName], pkgName, symbols, filename) - - if err != nil { - firstErrOnce.Do(func() { - firstErr = err - cancel() - }) - return - } - - if found == nil { - return // No matching package. - } - - imp := &ImportInfo{ - ImportPath: found.importPathShort, - } - - pkg := &packageInfo{ - name: pkgName, - exports: symbols, - } - results <- result{imp, pkg} - }(pkgName, symbols) - } - go func() { - wg.Wait() - close(results) - }() - - for result := range results { - pass.addCandidate(result.imp, result.pkg) - } - return firstErr -} - -// notIdentifier reports whether ch is an invalid identifier character. -func notIdentifier(ch rune) bool { - return !('a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || - '0' <= ch && ch <= '9' || - ch == '_' || - ch >= utf8.RuneSelf && (unicode.IsLetter(ch) || unicode.IsDigit(ch))) -} - -// ImportPathToAssumedName returns the assumed package name of an import path. -// It does this using only string parsing of the import path. -// It picks the last element of the path that does not look like a major -// version, and then picks the valid identifier off the start of that element. -// It is used to determine if a local rename should be added to an import for -// clarity. -// This function could be moved to a standard package and exported if we want -// for use in other tools. -func ImportPathToAssumedName(importPath string) string { - base := path.Base(importPath) - if strings.HasPrefix(base, "v") { - if _, err := strconv.Atoi(base[1:]); err == nil { - dir := path.Dir(importPath) - if dir != "." { - base = path.Base(dir) - } - } - } - base = strings.TrimPrefix(base, "go-") - if i := strings.IndexFunc(base, notIdentifier); i >= 0 { - base = base[:i] - } - return base -} - -// gopathResolver implements resolver for GOPATH workspaces. -type gopathResolver struct { - env *ProcessEnv - walked bool - cache *dirInfoCache - scanSema chan struct{} // scanSema prevents concurrent scans. -} - -func newGopathResolver(env *ProcessEnv) *gopathResolver { - r := &gopathResolver{ - env: env, - cache: &dirInfoCache{ - dirs: map[string]*directoryPackageInfo{}, - listeners: map[*int]cacheListener{}, - }, - scanSema: make(chan struct{}, 1), - } - r.scanSema <- struct{}{} - return r -} - -func (r *gopathResolver) ClearForNewScan() { - <-r.scanSema - r.cache = &dirInfoCache{ - dirs: map[string]*directoryPackageInfo{}, - listeners: map[*int]cacheListener{}, - } - r.walked = false - r.scanSema <- struct{}{} -} - -func (r *gopathResolver) loadPackageNames(importPaths []string, srcDir string) (map[string]string, error) { - names := map[string]string{} - for _, path := range importPaths { - names[path] = importPathToName(r.env, path, srcDir) - } - return names, nil -} - -// importPathToName finds out the actual package name, as declared in its .go files. -// If there's a problem, it returns "". -func importPathToName(env *ProcessEnv, importPath, srcDir string) (packageName string) { - // Fast path for standard library without going to disk. - if _, ok := stdlib[importPath]; ok { - return path.Base(importPath) // stdlib packages always match their paths. - } - - buildPkg, err := env.buildContext().Import(importPath, srcDir, build.FindOnly) - if err != nil { - return "" - } - pkgName, err := packageDirToName(buildPkg.Dir) - if err != nil { - return "" - } - return pkgName -} - -// packageDirToName is a faster version of build.Import if -// the only thing desired is the package name. Given a directory, -// packageDirToName then only parses one file in the package, -// trusting that the files in the directory are consistent. -func packageDirToName(dir string) (packageName string, err error) { - d, err := os.Open(dir) - if err != nil { - return "", err - } - names, err := d.Readdirnames(-1) - d.Close() - if err != nil { - return "", err - } - sort.Strings(names) // to have predictable behavior - var lastErr error - var nfile int - for _, name := range names { - if !strings.HasSuffix(name, ".go") { - continue - } - if strings.HasSuffix(name, "_test.go") { - continue - } - nfile++ - fullFile := filepath.Join(dir, name) - - fset := token.NewFileSet() - f, err := parser.ParseFile(fset, fullFile, nil, parser.PackageClauseOnly) - if err != nil { - lastErr = err - continue - } - pkgName := f.Name.Name - if pkgName == "documentation" { - // Special case from go/build.ImportDir, not - // handled by ctx.MatchFile. - continue - } - if pkgName == "main" { - // Also skip package main, assuming it's a +build ignore generator or example. - // Since you can't import a package main anyway, there's no harm here. - continue - } - return pkgName, nil - } - if lastErr != nil { - return "", lastErr - } - return "", fmt.Errorf("no importable package found in %d Go files", nfile) -} - -type pkg struct { - dir string // absolute file path to pkg directory ("/usr/lib/go/src/net/http") - importPathShort string // vendorless import path ("net/http", "a/b") - packageName string // package name loaded from source if requested - relevance int // a weakly-defined score of how relevant a package is. 0 is most relevant. -} - -type pkgDistance struct { - pkg *pkg - distance int // relative distance to target -} - -// byDistanceOrImportPathShortLength sorts by relative distance breaking ties -// on the short import path length and then the import string itself. -type byDistanceOrImportPathShortLength []pkgDistance - -func (s byDistanceOrImportPathShortLength) Len() int { return len(s) } -func (s byDistanceOrImportPathShortLength) Less(i, j int) bool { - di, dj := s[i].distance, s[j].distance - if di == -1 { - return false - } - if dj == -1 { - return true - } - if di != dj { - return di < dj - } - - vi, vj := s[i].pkg.importPathShort, s[j].pkg.importPathShort - if len(vi) != len(vj) { - return len(vi) < len(vj) - } - return vi < vj -} -func (s byDistanceOrImportPathShortLength) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -func distance(basepath, targetpath string) int { - p, err := filepath.Rel(basepath, targetpath) - if err != nil { - return -1 - } - if p == "." { - return 0 - } - return strings.Count(p, string(filepath.Separator)) + 1 -} - -func (r *gopathResolver) scan(ctx context.Context, callback *scanCallback) error { - add := func(root gopathwalk.Root, dir string) { - // We assume cached directories have not changed. We can skip them and their - // children. - if _, ok := r.cache.Load(dir); ok { - return - } - - importpath := filepath.ToSlash(dir[len(root.Path)+len("/"):]) - info := directoryPackageInfo{ - status: directoryScanned, - dir: dir, - rootType: root.Type, - nonCanonicalImportPath: VendorlessPath(importpath), - } - r.cache.Store(dir, info) - } - processDir := func(info directoryPackageInfo) { - // Skip this directory if we were not able to get the package information successfully. - if scanned, err := info.reachedStatus(directoryScanned); !scanned || err != nil { - return - } - - p := &pkg{ - importPathShort: info.nonCanonicalImportPath, - dir: info.dir, - relevance: MaxRelevance - 1, - } - if info.rootType == gopathwalk.RootGOROOT { - p.relevance = MaxRelevance - } - - if !callback.dirFound(p) { - return - } - var err error - p.packageName, err = r.cache.CachePackageName(info) - if err != nil { - return - } - - if !callback.packageNameLoaded(p) { - return - } - if _, exports, err := r.loadExports(ctx, p, false); err == nil { - callback.exportsLoaded(p, exports) - } - } - stop := r.cache.ScanAndListen(ctx, processDir) - defer stop() - // The callback is not necessarily safe to use in the goroutine below. Process roots eagerly. - roots := filterRoots(gopathwalk.SrcDirsRoots(r.env.buildContext()), callback.rootFound) - // We can't cancel walks, because we need them to finish to have a usable - // cache. Instead, run them in a separate goroutine and detach. - scanDone := make(chan struct{}) - go func() { - select { - case <-ctx.Done(): - return - case <-r.scanSema: - } - defer func() { r.scanSema <- struct{}{} }() - gopathwalk.Walk(roots, add, gopathwalk.Options{Logf: r.env.Logf, ModulesEnabled: false}) - close(scanDone) - }() - select { - case <-ctx.Done(): - case <-scanDone: - } - return nil -} - -func (r *gopathResolver) scoreImportPath(ctx context.Context, path string) int { - if _, ok := stdlib[path]; ok { - return MaxRelevance - } - return MaxRelevance - 1 -} - -func filterRoots(roots []gopathwalk.Root, include func(gopathwalk.Root) bool) []gopathwalk.Root { - var result []gopathwalk.Root - for _, root := range roots { - if !include(root) { - continue - } - result = append(result, root) - } - return result -} - -func (r *gopathResolver) loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []string, error) { - if info, ok := r.cache.Load(pkg.dir); ok && !includeTest { - return r.cache.CacheExports(ctx, r.env, info) - } - return loadExportsFromFiles(ctx, r.env, pkg.dir, includeTest) -} - -// VendorlessPath returns the devendorized version of the import path ipath. -// For example, VendorlessPath("foo/bar/vendor/a/b") returns "a/b". -func VendorlessPath(ipath string) string { - // Devendorize for use in import statement. - if i := strings.LastIndex(ipath, "/vendor/"); i >= 0 { - return ipath[i+len("/vendor/"):] - } - if strings.HasPrefix(ipath, "vendor/") { - return ipath[len("vendor/"):] - } - return ipath -} - -func loadExportsFromFiles(ctx context.Context, env *ProcessEnv, dir string, includeTest bool) (string, []string, error) { - var exports []string - - // Look for non-test, buildable .go files which could provide exports. - all, err := ioutil.ReadDir(dir) - if err != nil { - return "", nil, err - } - var files []os.FileInfo - for _, fi := range all { - name := fi.Name() - if !strings.HasSuffix(name, ".go") || (!includeTest && strings.HasSuffix(name, "_test.go")) { - continue - } - match, err := env.buildContext().MatchFile(dir, fi.Name()) - if err != nil || !match { - continue - } - files = append(files, fi) - } - - if len(files) == 0 { - return "", nil, fmt.Errorf("dir %v contains no buildable, non-test .go files", dir) - } - - var pkgName string - fset := token.NewFileSet() - for _, fi := range files { - select { - case <-ctx.Done(): - return "", nil, ctx.Err() - default: - } - - fullFile := filepath.Join(dir, fi.Name()) - f, err := parser.ParseFile(fset, fullFile, nil, 0) - if err != nil { - return "", nil, fmt.Errorf("parsing %s: %v", fullFile, err) - } - if f.Name.Name == "documentation" { - // Special case from go/build.ImportDir, not - // handled by MatchFile above. - continue - } - if includeTest && strings.HasSuffix(f.Name.Name, "_test") { - // x_test package. We want internal test files only. - continue - } - pkgName = f.Name.Name - for name := range f.Scope.Objects { - if ast.IsExported(name) { - exports = append(exports, name) - } - } - } - - if env.Logf != nil { - sortedExports := append([]string(nil), exports...) - sort.Strings(sortedExports) - env.Logf("loaded exports in dir %v (package %v): %v", dir, pkgName, strings.Join(sortedExports, ", ")) - } - return pkgName, exports, nil -} - -// findImport searches for a package with the given symbols. -// If no package is found, findImport returns ("", false, nil) -func findImport(ctx context.Context, pass *pass, candidates []pkgDistance, pkgName string, symbols map[string]bool, filename string) (*pkg, error) { - // Sort the candidates by their import package length, - // assuming that shorter package names are better than long - // ones. Note that this sorts by the de-vendored name, so - // there's no "penalty" for vendoring. - sort.Sort(byDistanceOrImportPathShortLength(candidates)) - if pass.env.Logf != nil { - for i, c := range candidates { - pass.env.Logf("%s candidate %d/%d: %v in %v", pkgName, i+1, len(candidates), c.pkg.importPathShort, c.pkg.dir) - } - } - - // Collect exports for packages with matching names. - rescv := make([]chan *pkg, len(candidates)) - for i := range candidates { - rescv[i] = make(chan *pkg, 1) - } - const maxConcurrentPackageImport = 4 - loadExportsSem := make(chan struct{}, maxConcurrentPackageImport) - - ctx, cancel := context.WithCancel(ctx) - var wg sync.WaitGroup - defer func() { - cancel() - wg.Wait() - }() - - wg.Add(1) - go func() { - defer wg.Done() - for i, c := range candidates { - select { - case loadExportsSem <- struct{}{}: - case <-ctx.Done(): - return - } - - wg.Add(1) - go func(c pkgDistance, resc chan<- *pkg) { - defer func() { - <-loadExportsSem - wg.Done() - }() - - if pass.env.Logf != nil { - pass.env.Logf("loading exports in dir %s (seeking package %s)", c.pkg.dir, pkgName) - } - // If we're an x_test, load the package under test's test variant. - includeTest := strings.HasSuffix(pass.f.Name.Name, "_test") && c.pkg.dir == pass.srcDir - _, exports, err := pass.env.GetResolver().loadExports(ctx, c.pkg, includeTest) - if err != nil { - if pass.env.Logf != nil { - pass.env.Logf("loading exports in dir %s (seeking package %s): %v", c.pkg.dir, pkgName, err) - } - resc <- nil - return - } - - exportsMap := make(map[string]bool, len(exports)) - for _, sym := range exports { - exportsMap[sym] = true - } - - // If it doesn't have the right - // symbols, send nil to mean no match. - for symbol := range symbols { - if !exportsMap[symbol] { - resc <- nil - return - } - } - resc <- c.pkg - }(c, rescv[i]) - } - }() - - for _, resc := range rescv { - pkg := <-resc - if pkg == nil { - continue - } - return pkg, nil - } - return nil, nil -} - -// pkgIsCandidate reports whether pkg is a candidate for satisfying the -// finding which package pkgIdent in the file named by filename is trying -// to refer to. -// -// This check is purely lexical and is meant to be as fast as possible -// because it's run over all $GOPATH directories to filter out poor -// candidates in order to limit the CPU and I/O later parsing the -// exports in candidate packages. -// -// filename is the file being formatted. -// pkgIdent is the package being searched for, like "client" (if -// searching for "client.New") -func pkgIsCandidate(filename string, refs references, pkg *pkg) bool { - // Check "internal" and "vendor" visibility: - if !canUse(filename, pkg.dir) { - return false - } - - // Speed optimization to minimize disk I/O: - // the last two components on disk must contain the - // package name somewhere. - // - // This permits mismatch naming like directory - // "go-foo" being package "foo", or "pkg.v3" being "pkg", - // or directory "google.golang.org/api/cloudbilling/v1" - // being package "cloudbilling", but doesn't - // permit a directory "foo" to be package - // "bar", which is strongly discouraged - // anyway. There's no reason goimports needs - // to be slow just to accommodate that. - for pkgIdent := range refs { - lastTwo := lastTwoComponents(pkg.importPathShort) - if strings.Contains(lastTwo, pkgIdent) { - return true - } - if hasHyphenOrUpperASCII(lastTwo) && !hasHyphenOrUpperASCII(pkgIdent) { - lastTwo = lowerASCIIAndRemoveHyphen(lastTwo) - if strings.Contains(lastTwo, pkgIdent) { - return true - } - } - } - return false -} - -func hasHyphenOrUpperASCII(s string) bool { - for i := 0; i < len(s); i++ { - b := s[i] - if b == '-' || ('A' <= b && b <= 'Z') { - return true - } - } - return false -} - -func lowerASCIIAndRemoveHyphen(s string) (ret string) { - buf := make([]byte, 0, len(s)) - for i := 0; i < len(s); i++ { - b := s[i] - switch { - case b == '-': - continue - case 'A' <= b && b <= 'Z': - buf = append(buf, b+('a'-'A')) - default: - buf = append(buf, b) - } - } - return string(buf) -} - -// canUse reports whether the package in dir is usable from filename, -// respecting the Go "internal" and "vendor" visibility rules. -func canUse(filename, dir string) bool { - // Fast path check, before any allocations. If it doesn't contain vendor - // or internal, it's not tricky: - // Note that this can false-negative on directories like "notinternal", - // but we check it correctly below. This is just a fast path. - if !strings.Contains(dir, "vendor") && !strings.Contains(dir, "internal") { - return true - } - - dirSlash := filepath.ToSlash(dir) - if !strings.Contains(dirSlash, "/vendor/") && !strings.Contains(dirSlash, "/internal/") && !strings.HasSuffix(dirSlash, "/internal") { - return true - } - // Vendor or internal directory only visible from children of parent. - // That means the path from the current directory to the target directory - // can contain ../vendor or ../internal but not ../foo/vendor or ../foo/internal - // or bar/vendor or bar/internal. - // After stripping all the leading ../, the only okay place to see vendor or internal - // is at the very beginning of the path. - absfile, err := filepath.Abs(filename) - if err != nil { - return false - } - absdir, err := filepath.Abs(dir) - if err != nil { - return false - } - rel, err := filepath.Rel(absfile, absdir) - if err != nil { - return false - } - relSlash := filepath.ToSlash(rel) - if i := strings.LastIndex(relSlash, "../"); i >= 0 { - relSlash = relSlash[i+len("../"):] - } - return !strings.Contains(relSlash, "/vendor/") && !strings.Contains(relSlash, "/internal/") && !strings.HasSuffix(relSlash, "/internal") -} - -// lastTwoComponents returns at most the last two path components -// of v, using either / or \ as the path separator. -func lastTwoComponents(v string) string { - nslash := 0 - for i := len(v) - 1; i >= 0; i-- { - if v[i] == '/' || v[i] == '\\' { - nslash++ - if nslash == 2 { - return v[i:] - } - } - } - return v -} - -type visitFn func(node ast.Node) ast.Visitor - -func (fn visitFn) Visit(node ast.Node) ast.Visitor { - return fn(node) -} - -func copyExports(pkg []string) map[string]bool { - m := make(map[string]bool, len(pkg)) - for _, v := range pkg { - m[v] = true - } - return m -} diff --git a/vendor/golang.org/x/tools/internal/imports/imports.go b/vendor/golang.org/x/tools/internal/imports/imports.go deleted file mode 100644 index b18daea..0000000 --- a/vendor/golang.org/x/tools/internal/imports/imports.go +++ /dev/null @@ -1,408 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:generate go run mkstdlib.go - -// Package imports implements a Go pretty-printer (like package "go/format") -// that also adds or removes import statements as necessary. -package imports - -import ( - "bufio" - "bytes" - "context" - "fmt" - "go/ast" - "go/build" - "go/format" - "go/parser" - "go/printer" - "go/token" - "io" - "io/ioutil" - "os" - "regexp" - "strconv" - "strings" - - "golang.org/x/tools/go/ast/astutil" -) - -// Options is golang.org/x/tools/imports.Options with extra internal-only options. -type Options struct { - Env *ProcessEnv // The environment to use. Note: this contains the cached module and filesystem state. - - Fragment bool // Accept fragment of a source file (no package statement) - AllErrors bool // Report all errors (not just the first 10 on different lines) - - Comments bool // Print comments (true if nil *Options provided) - TabIndent bool // Use tabs for indent (true if nil *Options provided) - TabWidth int // Tab width (8 if nil *Options provided) - - FormatOnly bool // Disable the insertion and deletion of imports -} - -// Process implements golang.org/x/tools/imports.Process with explicit context in env. -func Process(filename string, src []byte, opt *Options) (formatted []byte, err error) { - src, opt, err = initialize(filename, src, opt) - if err != nil { - return nil, err - } - - fileSet := token.NewFileSet() - file, adjust, err := parse(fileSet, filename, src, opt) - if err != nil { - return nil, err - } - - if !opt.FormatOnly { - if err := fixImports(fileSet, file, filename, opt.Env); err != nil { - return nil, err - } - } - return formatFile(fileSet, file, src, adjust, opt) -} - -// FixImports returns a list of fixes to the imports that, when applied, -// will leave the imports in the same state as Process. -// -// Note that filename's directory influences which imports can be chosen, -// so it is important that filename be accurate. -func FixImports(filename string, src []byte, opt *Options) (fixes []*ImportFix, err error) { - src, opt, err = initialize(filename, src, opt) - if err != nil { - return nil, err - } - - fileSet := token.NewFileSet() - file, _, err := parse(fileSet, filename, src, opt) - if err != nil { - return nil, err - } - - return getFixes(fileSet, file, filename, opt.Env) -} - -// ApplyFixes applies all of the fixes to the file and formats it. extraMode -// is added in when parsing the file. -func ApplyFixes(fixes []*ImportFix, filename string, src []byte, opt *Options, extraMode parser.Mode) (formatted []byte, err error) { - src, opt, err = initialize(filename, src, opt) - if err != nil { - return nil, err - } - - // Don't use parse() -- we don't care about fragments or statement lists - // here, and we need to work with unparseable files. - fileSet := token.NewFileSet() - parserMode := parser.Mode(0) - if opt.Comments { - parserMode |= parser.ParseComments - } - if opt.AllErrors { - parserMode |= parser.AllErrors - } - parserMode |= extraMode - - file, err := parser.ParseFile(fileSet, filename, src, parserMode) - if file == nil { - return nil, err - } - - // Apply the fixes to the file. - apply(fileSet, file, fixes) - - return formatFile(fileSet, file, src, nil, opt) -} - -// GetAllCandidates gets all of the packages starting with prefix that can be -// imported by filename, sorted by import path. -func GetAllCandidates(ctx context.Context, callback func(ImportFix), searchPrefix, filename, filePkg string, opt *Options) error { - _, opt, err := initialize(filename, []byte{}, opt) - if err != nil { - return err - } - return getAllCandidates(ctx, callback, searchPrefix, filename, filePkg, opt.Env) -} - -// GetPackageExports returns all known packages with name pkg and their exports. -func GetPackageExports(ctx context.Context, callback func(PackageExport), searchPkg, filename, filePkg string, opt *Options) error { - _, opt, err := initialize(filename, []byte{}, opt) - if err != nil { - return err - } - return getPackageExports(ctx, callback, searchPkg, filename, filePkg, opt.Env) -} - -// initialize sets the values for opt and src. -// If they are provided, they are not changed. Otherwise opt is set to the -// default values and src is read from the file system. -func initialize(filename string, src []byte, opt *Options) ([]byte, *Options, error) { - // Use defaults if opt is nil. - if opt == nil { - opt = &Options{Comments: true, TabIndent: true, TabWidth: 8} - } - - // Set the env if the user has not provided it. - if opt.Env == nil { - opt.Env = &ProcessEnv{ - GOPATH: build.Default.GOPATH, - GOROOT: build.Default.GOROOT, - GOFLAGS: os.Getenv("GOFLAGS"), - GO111MODULE: os.Getenv("GO111MODULE"), - GOPROXY: os.Getenv("GOPROXY"), - GOSUMDB: os.Getenv("GOSUMDB"), - } - } - if src == nil { - b, err := ioutil.ReadFile(filename) - if err != nil { - return nil, nil, err - } - src = b - } - - return src, opt, nil -} - -func formatFile(fileSet *token.FileSet, file *ast.File, src []byte, adjust func(orig []byte, src []byte) []byte, opt *Options) ([]byte, error) { - mergeImports(opt.Env, fileSet, file) - sortImports(opt.Env, fileSet, file) - imps := astutil.Imports(fileSet, file) - var spacesBefore []string // import paths we need spaces before - for _, impSection := range imps { - // Within each block of contiguous imports, see if any - // import lines are in different group numbers. If so, - // we'll need to put a space between them so it's - // compatible with gofmt. - lastGroup := -1 - for _, importSpec := range impSection { - importPath, _ := strconv.Unquote(importSpec.Path.Value) - groupNum := importGroup(opt.Env, importPath) - if groupNum != lastGroup && lastGroup != -1 { - spacesBefore = append(spacesBefore, importPath) - } - lastGroup = groupNum - } - - } - - printerMode := printer.UseSpaces - if opt.TabIndent { - printerMode |= printer.TabIndent - } - printConfig := &printer.Config{Mode: printerMode, Tabwidth: opt.TabWidth} - - var buf bytes.Buffer - err := printConfig.Fprint(&buf, fileSet, file) - if err != nil { - return nil, err - } - out := buf.Bytes() - if adjust != nil { - out = adjust(src, out) - } - if len(spacesBefore) > 0 { - out, err = addImportSpaces(bytes.NewReader(out), spacesBefore) - if err != nil { - return nil, err - } - } - - out, err = format.Source(out) - if err != nil { - return nil, err - } - return out, nil -} - -// parse parses src, which was read from filename, -// as a Go source file or statement list. -func parse(fset *token.FileSet, filename string, src []byte, opt *Options) (*ast.File, func(orig, src []byte) []byte, error) { - parserMode := parser.Mode(0) - if opt.Comments { - parserMode |= parser.ParseComments - } - if opt.AllErrors { - parserMode |= parser.AllErrors - } - - // Try as whole source file. - file, err := parser.ParseFile(fset, filename, src, parserMode) - if err == nil { - return file, nil, nil - } - // If the error is that the source file didn't begin with a - // package line and we accept fragmented input, fall through to - // try as a source fragment. Stop and return on any other error. - if !opt.Fragment || !strings.Contains(err.Error(), "expected 'package'") { - return nil, nil, err - } - - // If this is a declaration list, make it a source file - // by inserting a package clause. - // Insert using a ;, not a newline, so that parse errors are on - // the correct line. - const prefix = "package main;" - psrc := append([]byte(prefix), src...) - file, err = parser.ParseFile(fset, filename, psrc, parserMode) - if err == nil { - // Gofmt will turn the ; into a \n. - // Do that ourselves now and update the file contents, - // so that positions and line numbers are correct going forward. - psrc[len(prefix)-1] = '\n' - fset.File(file.Package).SetLinesForContent(psrc) - - // If a main function exists, we will assume this is a main - // package and leave the file. - if containsMainFunc(file) { - return file, nil, nil - } - - adjust := func(orig, src []byte) []byte { - // Remove the package clause. - src = src[len(prefix):] - return matchSpace(orig, src) - } - return file, adjust, nil - } - // If the error is that the source file didn't begin with a - // declaration, fall through to try as a statement list. - // Stop and return on any other error. - if !strings.Contains(err.Error(), "expected declaration") { - return nil, nil, err - } - - // If this is a statement list, make it a source file - // by inserting a package clause and turning the list - // into a function body. This handles expressions too. - // Insert using a ;, not a newline, so that the line numbers - // in fsrc match the ones in src. - fsrc := append(append([]byte("package p; func _() {"), src...), '}') - file, err = parser.ParseFile(fset, filename, fsrc, parserMode) - if err == nil { - adjust := func(orig, src []byte) []byte { - // Remove the wrapping. - // Gofmt has turned the ; into a \n\n. - src = src[len("package p\n\nfunc _() {"):] - src = src[:len(src)-len("}\n")] - // Gofmt has also indented the function body one level. - // Remove that indent. - src = bytes.Replace(src, []byte("\n\t"), []byte("\n"), -1) - return matchSpace(orig, src) - } - return file, adjust, nil - } - - // Failed, and out of options. - return nil, nil, err -} - -// containsMainFunc checks if a file contains a function declaration with the -// function signature 'func main()' -func containsMainFunc(file *ast.File) bool { - for _, decl := range file.Decls { - if f, ok := decl.(*ast.FuncDecl); ok { - if f.Name.Name != "main" { - continue - } - - if len(f.Type.Params.List) != 0 { - continue - } - - if f.Type.Results != nil && len(f.Type.Results.List) != 0 { - continue - } - - return true - } - } - - return false -} - -func cutSpace(b []byte) (before, middle, after []byte) { - i := 0 - for i < len(b) && (b[i] == ' ' || b[i] == '\t' || b[i] == '\n') { - i++ - } - j := len(b) - for j > 0 && (b[j-1] == ' ' || b[j-1] == '\t' || b[j-1] == '\n') { - j-- - } - if i <= j { - return b[:i], b[i:j], b[j:] - } - return nil, nil, b[j:] -} - -// matchSpace reformats src to use the same space context as orig. -// 1) If orig begins with blank lines, matchSpace inserts them at the beginning of src. -// 2) matchSpace copies the indentation of the first non-blank line in orig -// to every non-blank line in src. -// 3) matchSpace copies the trailing space from orig and uses it in place -// of src's trailing space. -func matchSpace(orig []byte, src []byte) []byte { - before, _, after := cutSpace(orig) - i := bytes.LastIndex(before, []byte{'\n'}) - before, indent := before[:i+1], before[i+1:] - - _, src, _ = cutSpace(src) - - var b bytes.Buffer - b.Write(before) - for len(src) > 0 { - line := src - if i := bytes.IndexByte(line, '\n'); i >= 0 { - line, src = line[:i+1], line[i+1:] - } else { - src = nil - } - if len(line) > 0 && line[0] != '\n' { // not blank - b.Write(indent) - } - b.Write(line) - } - b.Write(after) - return b.Bytes() -} - -var impLine = regexp.MustCompile(`^\s+(?:[\w\.]+\s+)?"(.+)"`) - -func addImportSpaces(r io.Reader, breaks []string) ([]byte, error) { - var out bytes.Buffer - in := bufio.NewReader(r) - inImports := false - done := false - for { - s, err := in.ReadString('\n') - if err == io.EOF { - break - } else if err != nil { - return nil, err - } - - if !inImports && !done && strings.HasPrefix(s, "import") { - inImports = true - } - if inImports && (strings.HasPrefix(s, "var") || - strings.HasPrefix(s, "func") || - strings.HasPrefix(s, "const") || - strings.HasPrefix(s, "type")) { - done = true - inImports = false - } - if inImports && len(breaks) > 0 { - if m := impLine.FindStringSubmatch(s); m != nil { - if m[1] == breaks[0] { - out.WriteByte('\n') - breaks = breaks[1:] - } - } - } - - fmt.Fprint(&out, s) - } - return out.Bytes(), nil -} diff --git a/vendor/golang.org/x/tools/internal/imports/mkindex.go b/vendor/golang.org/x/tools/internal/imports/mkindex.go deleted file mode 100644 index ef8c0d2..0000000 --- a/vendor/golang.org/x/tools/internal/imports/mkindex.go +++ /dev/null @@ -1,173 +0,0 @@ -// +build ignore - -// 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. - -// Command mkindex creates the file "pkgindex.go" containing an index of the Go -// standard library. The file is intended to be built as part of the imports -// package, so that the package may be used in environments where a GOROOT is -// not available (such as App Engine). -package imports - -import ( - "bytes" - "fmt" - "go/ast" - "go/build" - "go/format" - "go/parser" - "go/token" - "io/ioutil" - "log" - "os" - "path" - "path/filepath" - "strings" -) - -var ( - pkgIndex = make(map[string][]pkg) - exports = make(map[string]map[string]bool) -) - -func main() { - // Don't use GOPATH. - ctx := build.Default - ctx.GOPATH = "" - - // Populate pkgIndex global from GOROOT. - for _, path := range ctx.SrcDirs() { - f, err := os.Open(path) - if err != nil { - log.Print(err) - continue - } - children, err := f.Readdir(-1) - f.Close() - if err != nil { - log.Print(err) - continue - } - for _, child := range children { - if child.IsDir() { - loadPkg(path, child.Name()) - } - } - } - // Populate exports global. - for _, ps := range pkgIndex { - for _, p := range ps { - e := loadExports(p.dir) - if e != nil { - exports[p.dir] = e - } - } - } - - // Construct source file. - var buf bytes.Buffer - fmt.Fprint(&buf, pkgIndexHead) - fmt.Fprintf(&buf, "var pkgIndexMaster = %#v\n", pkgIndex) - fmt.Fprintf(&buf, "var exportsMaster = %#v\n", exports) - src := buf.Bytes() - - // Replace main.pkg type name with pkg. - src = bytes.Replace(src, []byte("main.pkg"), []byte("pkg"), -1) - // Replace actual GOROOT with "/go". - src = bytes.Replace(src, []byte(ctx.GOROOT), []byte("/go"), -1) - // Add some line wrapping. - src = bytes.Replace(src, []byte("}, "), []byte("},\n"), -1) - src = bytes.Replace(src, []byte("true, "), []byte("true,\n"), -1) - - var err error - src, err = format.Source(src) - if err != nil { - log.Fatal(err) - } - - // Write out source file. - err = ioutil.WriteFile("pkgindex.go", src, 0644) - if err != nil { - log.Fatal(err) - } -} - -const pkgIndexHead = `package imports - -func init() { - pkgIndexOnce.Do(func() { - pkgIndex.m = pkgIndexMaster - }) - loadExports = func(dir string) map[string]bool { - return exportsMaster[dir] - } -} -` - -type pkg struct { - importpath string // full pkg import path, e.g. "net/http" - dir string // absolute file path to pkg directory e.g. "/usr/lib/go/src/fmt" -} - -var fset = token.NewFileSet() - -func loadPkg(root, importpath string) { - shortName := path.Base(importpath) - if shortName == "testdata" { - return - } - - dir := filepath.Join(root, importpath) - pkgIndex[shortName] = append(pkgIndex[shortName], pkg{ - importpath: importpath, - dir: dir, - }) - - pkgDir, err := os.Open(dir) - if err != nil { - return - } - children, err := pkgDir.Readdir(-1) - pkgDir.Close() - if err != nil { - return - } - for _, child := range children { - name := child.Name() - if name == "" { - continue - } - if c := name[0]; c == '.' || ('0' <= c && c <= '9') { - continue - } - if child.IsDir() { - loadPkg(root, filepath.Join(importpath, name)) - } - } -} - -func loadExports(dir string) map[string]bool { - exports := make(map[string]bool) - buildPkg, err := build.ImportDir(dir, 0) - if err != nil { - if strings.Contains(err.Error(), "no buildable Go source files in") { - return nil - } - log.Printf("could not import %q: %v", dir, err) - return nil - } - for _, file := range buildPkg.GoFiles { - f, err := parser.ParseFile(fset, filepath.Join(dir, file), nil, 0) - if err != nil { - log.Printf("could not parse %q: %v", file, err) - continue - } - for name := range f.Scope.Objects { - if ast.IsExported(name) { - exports[name] = true - } - } - } - return exports -} diff --git a/vendor/golang.org/x/tools/internal/imports/mkstdlib.go b/vendor/golang.org/x/tools/internal/imports/mkstdlib.go deleted file mode 100644 index 39b86cc..0000000 --- a/vendor/golang.org/x/tools/internal/imports/mkstdlib.go +++ /dev/null @@ -1,128 +0,0 @@ -// +build ignore - -// mkstdlib generates the zstdlib.go file, containing the Go standard -// library API symbols. It's baked into the binary to avoid scanning -// GOPATH in the common case. -package main - -import ( - "bufio" - "bytes" - "fmt" - "go/format" - "io" - "io/ioutil" - "log" - "os" - "os/exec" - "path/filepath" - "regexp" - "runtime" - "sort" -) - -func mustOpen(name string) io.Reader { - f, err := os.Open(name) - if err != nil { - log.Fatal(err) - } - return f -} - -func api(base string) string { - return filepath.Join(runtime.GOROOT(), "api", base) -} - -var sym = regexp.MustCompile(`^pkg (\S+).*?, (?:var|func|type|const) ([A-Z]\w*)`) - -var unsafeSyms = map[string]bool{"Alignof": true, "ArbitraryType": true, "Offsetof": true, "Pointer": true, "Sizeof": true} - -func main() { - var buf bytes.Buffer - outf := func(format string, args ...interface{}) { - fmt.Fprintf(&buf, format, args...) - } - outf("// Code generated by mkstdlib.go. DO NOT EDIT.\n\n") - outf("package imports\n") - outf("var stdlib = map[string][]string{\n") - f := io.MultiReader( - mustOpen(api("go1.txt")), - mustOpen(api("go1.1.txt")), - mustOpen(api("go1.2.txt")), - mustOpen(api("go1.3.txt")), - mustOpen(api("go1.4.txt")), - mustOpen(api("go1.5.txt")), - mustOpen(api("go1.6.txt")), - mustOpen(api("go1.7.txt")), - mustOpen(api("go1.8.txt")), - mustOpen(api("go1.9.txt")), - mustOpen(api("go1.10.txt")), - mustOpen(api("go1.11.txt")), - mustOpen(api("go1.12.txt")), - mustOpen(api("go1.13.txt")), - - // The API of the syscall/js package needs to be computed explicitly, - // because it's not included in the GOROOT/api/go1.*.txt files at this time. - syscallJSAPI(), - ) - sc := bufio.NewScanner(f) - - pkgs := map[string]map[string]bool{ - "unsafe": unsafeSyms, - } - paths := []string{"unsafe"} - - for sc.Scan() { - l := sc.Text() - if m := sym.FindStringSubmatch(l); m != nil { - path, sym := m[1], m[2] - - if _, ok := pkgs[path]; !ok { - pkgs[path] = map[string]bool{} - paths = append(paths, path) - } - pkgs[path][sym] = true - } - } - if err := sc.Err(); err != nil { - log.Fatal(err) - } - sort.Strings(paths) - for _, path := range paths { - outf("\t%q: []string{\n", path) - pkg := pkgs[path] - var syms []string - for sym := range pkg { - syms = append(syms, sym) - } - sort.Strings(syms) - for _, sym := range syms { - outf("\t\t%q,\n", sym) - } - outf("},\n") - } - outf("}\n") - fmtbuf, err := format.Source(buf.Bytes()) - if err != nil { - log.Fatal(err) - } - err = ioutil.WriteFile("zstdlib.go", fmtbuf, 0666) - if err != nil { - log.Fatal(err) - } -} - -// syscallJSAPI returns the API of the syscall/js package. -// It's computed from the contents of $(go env GOROOT)/src/syscall/js. -func syscallJSAPI() io.Reader { - var exeSuffix string - if runtime.GOOS == "windows" { - exeSuffix = ".exe" - } - cmd := exec.Command("go"+exeSuffix, "run", "cmd/api", "-contexts", "js-wasm", "syscall/js") - out, err := cmd.Output() - if err != nil { - log.Fatalln(err) - } - return bytes.NewReader(out) -} diff --git a/vendor/golang.org/x/tools/internal/imports/mod.go b/vendor/golang.org/x/tools/internal/imports/mod.go deleted file mode 100644 index 69e3eec..0000000 --- a/vendor/golang.org/x/tools/internal/imports/mod.go +++ /dev/null @@ -1,718 +0,0 @@ -package imports - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io/ioutil" - "os" - "path" - "path/filepath" - "regexp" - "sort" - "strconv" - "strings" - - "golang.org/x/mod/module" - "golang.org/x/mod/semver" - "golang.org/x/tools/internal/gopathwalk" -) - -// ModuleResolver implements resolver for modules using the go command as little -// as feasible. -type ModuleResolver struct { - env *ProcessEnv - moduleCacheDir string - dummyVendorMod *ModuleJSON // If vendoring is enabled, the pseudo-module that represents the /vendor directory. - roots []gopathwalk.Root - scanSema chan struct{} // scanSema prevents concurrent scans and guards scannedRoots. - scannedRoots map[gopathwalk.Root]bool - - initialized bool - main *ModuleJSON - modsByModPath []*ModuleJSON // All modules, ordered by # of path components in module Path... - modsByDir []*ModuleJSON // ...or Dir. - - // moduleCacheCache stores information about the module cache. - moduleCacheCache *dirInfoCache - otherCache *dirInfoCache -} - -type ModuleJSON struct { - Path string // module path - Replace *ModuleJSON // replaced by this module - Main bool // is this the main module? - Indirect bool // is this module only an indirect dependency of main module? - Dir string // directory holding files for this module, if any - GoMod string // path to go.mod file for this module, if any - GoVersion string // go version used in module -} - -func newModuleResolver(e *ProcessEnv) *ModuleResolver { - r := &ModuleResolver{ - env: e, - scanSema: make(chan struct{}, 1), - } - r.scanSema <- struct{}{} - return r -} - -func (r *ModuleResolver) init() error { - if r.initialized { - return nil - } - mainMod, vendorEnabled, err := vendorEnabled(r.env) - if err != nil { - return err - } - - if mainMod != nil && vendorEnabled { - // Vendor mode is on, so all the non-Main modules are irrelevant, - // and we need to search /vendor for everything. - r.main = mainMod - r.dummyVendorMod = &ModuleJSON{ - Path: "", - Dir: filepath.Join(mainMod.Dir, "vendor"), - } - r.modsByModPath = []*ModuleJSON{mainMod, r.dummyVendorMod} - r.modsByDir = []*ModuleJSON{mainMod, r.dummyVendorMod} - } else { - // Vendor mode is off, so run go list -m ... to find everything. - r.initAllMods() - } - - r.moduleCacheDir = filepath.Join(filepath.SplitList(r.env.GOPATH)[0], "/pkg/mod") - - sort.Slice(r.modsByModPath, func(i, j int) bool { - count := func(x int) int { - return strings.Count(r.modsByModPath[x].Path, "/") - } - return count(j) < count(i) // descending order - }) - sort.Slice(r.modsByDir, func(i, j int) bool { - count := func(x int) int { - return strings.Count(r.modsByDir[x].Dir, "/") - } - return count(j) < count(i) // descending order - }) - - r.roots = []gopathwalk.Root{ - {filepath.Join(r.env.GOROOT, "/src"), gopathwalk.RootGOROOT}, - } - if r.main != nil { - r.roots = append(r.roots, gopathwalk.Root{r.main.Dir, gopathwalk.RootCurrentModule}) - } - if vendorEnabled { - r.roots = append(r.roots, gopathwalk.Root{r.dummyVendorMod.Dir, gopathwalk.RootOther}) - } else { - addDep := func(mod *ModuleJSON) { - if mod.Replace == nil { - // This is redundant with the cache, but we'll skip it cheaply enough. - r.roots = append(r.roots, gopathwalk.Root{mod.Dir, gopathwalk.RootModuleCache}) - } else { - r.roots = append(r.roots, gopathwalk.Root{mod.Dir, gopathwalk.RootOther}) - } - } - // Walk dependent modules before scanning the full mod cache, direct deps first. - for _, mod := range r.modsByModPath { - if !mod.Indirect && !mod.Main { - addDep(mod) - } - } - for _, mod := range r.modsByModPath { - if mod.Indirect && !mod.Main { - addDep(mod) - } - } - r.roots = append(r.roots, gopathwalk.Root{r.moduleCacheDir, gopathwalk.RootModuleCache}) - } - - r.scannedRoots = map[gopathwalk.Root]bool{} - if r.moduleCacheCache == nil { - r.moduleCacheCache = &dirInfoCache{ - dirs: map[string]*directoryPackageInfo{}, - listeners: map[*int]cacheListener{}, - } - } - if r.otherCache == nil { - r.otherCache = &dirInfoCache{ - dirs: map[string]*directoryPackageInfo{}, - listeners: map[*int]cacheListener{}, - } - } - r.initialized = true - return nil -} - -func (r *ModuleResolver) initAllMods() error { - stdout, err := r.env.invokeGo(context.TODO(), "list", "-m", "-json", "...") - if err != nil { - return err - } - for dec := json.NewDecoder(stdout); dec.More(); { - mod := &ModuleJSON{} - if err := dec.Decode(mod); err != nil { - return err - } - if mod.Dir == "" { - if r.env.Logf != nil { - r.env.Logf("module %v has not been downloaded and will be ignored", mod.Path) - } - // Can't do anything with a module that's not downloaded. - continue - } - // golang/go#36193: the go command doesn't always clean paths. - mod.Dir = filepath.Clean(mod.Dir) - r.modsByModPath = append(r.modsByModPath, mod) - r.modsByDir = append(r.modsByDir, mod) - if mod.Main { - r.main = mod - } - } - return nil -} - -func (r *ModuleResolver) ClearForNewScan() { - <-r.scanSema - r.scannedRoots = map[gopathwalk.Root]bool{} - r.otherCache = &dirInfoCache{ - dirs: map[string]*directoryPackageInfo{}, - listeners: map[*int]cacheListener{}, - } - r.scanSema <- struct{}{} -} - -func (r *ModuleResolver) ClearForNewMod() { - <-r.scanSema - *r = ModuleResolver{ - env: r.env, - moduleCacheCache: r.moduleCacheCache, - otherCache: r.otherCache, - scanSema: r.scanSema, - } - r.init() - r.scanSema <- struct{}{} -} - -// findPackage returns the module and directory that contains the package at -// the given import path, or returns nil, "" if no module is in scope. -func (r *ModuleResolver) findPackage(importPath string) (*ModuleJSON, string) { - // This can't find packages in the stdlib, but that's harmless for all - // the existing code paths. - for _, m := range r.modsByModPath { - if !strings.HasPrefix(importPath, m.Path) { - continue - } - pathInModule := importPath[len(m.Path):] - pkgDir := filepath.Join(m.Dir, pathInModule) - if r.dirIsNestedModule(pkgDir, m) { - continue - } - - if info, ok := r.cacheLoad(pkgDir); ok { - if loaded, err := info.reachedStatus(nameLoaded); loaded { - if err != nil { - continue // No package in this dir. - } - return m, pkgDir - } - if scanned, err := info.reachedStatus(directoryScanned); scanned && err != nil { - continue // Dir is unreadable, etc. - } - // This is slightly wrong: a directory doesn't have to have an - // importable package to count as a package for package-to-module - // resolution. package main or _test files should count but - // don't. - // TODO(heschi): fix this. - if _, err := r.cachePackageName(info); err == nil { - return m, pkgDir - } - } - - // Not cached. Read the filesystem. - pkgFiles, err := ioutil.ReadDir(pkgDir) - if err != nil { - continue - } - // A module only contains a package if it has buildable go - // files in that directory. If not, it could be provided by an - // outer module. See #29736. - for _, fi := range pkgFiles { - if ok, _ := r.env.buildContext().MatchFile(pkgDir, fi.Name()); ok { - return m, pkgDir - } - } - } - return nil, "" -} - -func (r *ModuleResolver) cacheLoad(dir string) (directoryPackageInfo, bool) { - if info, ok := r.moduleCacheCache.Load(dir); ok { - return info, ok - } - return r.otherCache.Load(dir) -} - -func (r *ModuleResolver) cacheStore(info directoryPackageInfo) { - if info.rootType == gopathwalk.RootModuleCache { - r.moduleCacheCache.Store(info.dir, info) - } else { - r.otherCache.Store(info.dir, info) - } -} - -func (r *ModuleResolver) cacheKeys() []string { - return append(r.moduleCacheCache.Keys(), r.otherCache.Keys()...) -} - -// cachePackageName caches the package name for a dir already in the cache. -func (r *ModuleResolver) cachePackageName(info directoryPackageInfo) (string, error) { - if info.rootType == gopathwalk.RootModuleCache { - return r.moduleCacheCache.CachePackageName(info) - } - return r.otherCache.CachePackageName(info) -} - -func (r *ModuleResolver) cacheExports(ctx context.Context, env *ProcessEnv, info directoryPackageInfo) (string, []string, error) { - if info.rootType == gopathwalk.RootModuleCache { - return r.moduleCacheCache.CacheExports(ctx, env, info) - } - return r.otherCache.CacheExports(ctx, env, info) -} - -// findModuleByDir returns the module that contains dir, or nil if no such -// module is in scope. -func (r *ModuleResolver) findModuleByDir(dir string) *ModuleJSON { - // This is quite tricky and may not be correct. dir could be: - // - a package in the main module. - // - a replace target underneath the main module's directory. - // - a nested module in the above. - // - a replace target somewhere totally random. - // - a nested module in the above. - // - in the mod cache. - // - in /vendor/ in -mod=vendor mode. - // - nested module? Dunno. - // Rumor has it that replace targets cannot contain other replace targets. - for _, m := range r.modsByDir { - if !strings.HasPrefix(dir, m.Dir) { - continue - } - - if r.dirIsNestedModule(dir, m) { - continue - } - - return m - } - return nil -} - -// dirIsNestedModule reports if dir is contained in a nested module underneath -// mod, not actually in mod. -func (r *ModuleResolver) dirIsNestedModule(dir string, mod *ModuleJSON) bool { - if !strings.HasPrefix(dir, mod.Dir) { - return false - } - if r.dirInModuleCache(dir) { - // Nested modules in the module cache are pruned, - // so it cannot be a nested module. - return false - } - if mod != nil && mod == r.dummyVendorMod { - // The /vendor pseudomodule is flattened and doesn't actually count. - return false - } - modDir, _ := r.modInfo(dir) - if modDir == "" { - return false - } - return modDir != mod.Dir -} - -func (r *ModuleResolver) modInfo(dir string) (modDir string, modName string) { - readModName := func(modFile string) string { - modBytes, err := ioutil.ReadFile(modFile) - if err != nil { - return "" - } - return modulePath(modBytes) - } - - if r.dirInModuleCache(dir) { - matches := modCacheRegexp.FindStringSubmatch(dir) - index := strings.Index(dir, matches[1]+"@"+matches[2]) - modDir := filepath.Join(dir[:index], matches[1]+"@"+matches[2]) - return modDir, readModName(filepath.Join(modDir, "go.mod")) - } - for { - if info, ok := r.cacheLoad(dir); ok { - return info.moduleDir, info.moduleName - } - f := filepath.Join(dir, "go.mod") - info, err := os.Stat(f) - if err == nil && !info.IsDir() { - return dir, readModName(f) - } - - d := filepath.Dir(dir) - if len(d) >= len(dir) { - return "", "" // reached top of file system, no go.mod - } - dir = d - } -} - -func (r *ModuleResolver) dirInModuleCache(dir string) bool { - if r.moduleCacheDir == "" { - return false - } - return strings.HasPrefix(dir, r.moduleCacheDir) -} - -func (r *ModuleResolver) loadPackageNames(importPaths []string, srcDir string) (map[string]string, error) { - if err := r.init(); err != nil { - return nil, err - } - names := map[string]string{} - for _, path := range importPaths { - _, packageDir := r.findPackage(path) - if packageDir == "" { - continue - } - name, err := packageDirToName(packageDir) - if err != nil { - continue - } - names[path] = name - } - return names, nil -} - -func (r *ModuleResolver) scan(ctx context.Context, callback *scanCallback) error { - if err := r.init(); err != nil { - return err - } - - processDir := func(info directoryPackageInfo) { - // Skip this directory if we were not able to get the package information successfully. - if scanned, err := info.reachedStatus(directoryScanned); !scanned || err != nil { - return - } - pkg, err := r.canonicalize(info) - if err != nil { - return - } - - if !callback.dirFound(pkg) { - return - } - pkg.packageName, err = r.cachePackageName(info) - if err != nil { - return - } - - if !callback.packageNameLoaded(pkg) { - return - } - _, exports, err := r.loadExports(ctx, pkg, false) - if err != nil { - return - } - callback.exportsLoaded(pkg, exports) - } - - // Start processing everything in the cache, and listen for the new stuff - // we discover in the walk below. - stop1 := r.moduleCacheCache.ScanAndListen(ctx, processDir) - defer stop1() - stop2 := r.otherCache.ScanAndListen(ctx, processDir) - defer stop2() - - // We assume cached directories are fully cached, including all their - // children, and have not changed. We can skip them. - skip := func(root gopathwalk.Root, dir string) bool { - info, ok := r.cacheLoad(dir) - if !ok { - return false - } - // This directory can be skipped as long as we have already scanned it. - // Packages with errors will continue to have errors, so there is no need - // to rescan them. - packageScanned, _ := info.reachedStatus(directoryScanned) - return packageScanned - } - - // Add anything new to the cache, and process it if we're still listening. - add := func(root gopathwalk.Root, dir string) { - r.cacheStore(r.scanDirForPackage(root, dir)) - } - - // r.roots and the callback are not necessarily safe to use in the - // goroutine below. Process them eagerly. - roots := filterRoots(r.roots, callback.rootFound) - // We can't cancel walks, because we need them to finish to have a usable - // cache. Instead, run them in a separate goroutine and detach. - scanDone := make(chan struct{}) - go func() { - select { - case <-ctx.Done(): - return - case <-r.scanSema: - } - defer func() { r.scanSema <- struct{}{} }() - // We have the lock on r.scannedRoots, and no other scans can run. - for _, root := range roots { - if ctx.Err() != nil { - return - } - - if r.scannedRoots[root] { - continue - } - gopathwalk.WalkSkip([]gopathwalk.Root{root}, add, skip, gopathwalk.Options{Logf: r.env.Logf, ModulesEnabled: true}) - r.scannedRoots[root] = true - } - close(scanDone) - }() - select { - case <-ctx.Done(): - case <-scanDone: - } - return nil -} - -func (r *ModuleResolver) scoreImportPath(ctx context.Context, path string) int { - if _, ok := stdlib[path]; ok { - return MaxRelevance - } - mod, _ := r.findPackage(path) - return modRelevance(mod) -} - -func modRelevance(mod *ModuleJSON) int { - switch { - case mod == nil: // out of scope - return MaxRelevance - 4 - case mod.Indirect: - return MaxRelevance - 3 - case !mod.Main: - return MaxRelevance - 2 - default: - return MaxRelevance - 1 // main module ties with stdlib - } -} - -// canonicalize gets the result of canonicalizing the packages using the results -// of initializing the resolver from 'go list -m'. -func (r *ModuleResolver) canonicalize(info directoryPackageInfo) (*pkg, error) { - // Packages in GOROOT are already canonical, regardless of the std/cmd modules. - if info.rootType == gopathwalk.RootGOROOT { - return &pkg{ - importPathShort: info.nonCanonicalImportPath, - dir: info.dir, - packageName: path.Base(info.nonCanonicalImportPath), - relevance: MaxRelevance, - }, nil - } - - importPath := info.nonCanonicalImportPath - mod := r.findModuleByDir(info.dir) - // Check if the directory is underneath a module that's in scope. - if mod != nil { - // It is. If dir is the target of a replace directive, - // our guessed import path is wrong. Use the real one. - if mod.Dir == info.dir { - importPath = mod.Path - } else { - dirInMod := info.dir[len(mod.Dir)+len("/"):] - importPath = path.Join(mod.Path, filepath.ToSlash(dirInMod)) - } - } else if !strings.HasPrefix(importPath, info.moduleName) { - // The module's name doesn't match the package's import path. It - // probably needs a replace directive we don't have. - return nil, fmt.Errorf("package in %q is not valid without a replace statement", info.dir) - } - - res := &pkg{ - importPathShort: importPath, - dir: info.dir, - relevance: modRelevance(mod), - } - // We may have discovered a package that has a different version - // in scope already. Canonicalize to that one if possible. - if _, canonicalDir := r.findPackage(importPath); canonicalDir != "" { - res.dir = canonicalDir - } - return res, nil -} - -func (r *ModuleResolver) loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []string, error) { - if err := r.init(); err != nil { - return "", nil, err - } - if info, ok := r.cacheLoad(pkg.dir); ok && !includeTest { - return r.cacheExports(ctx, r.env, info) - } - return loadExportsFromFiles(ctx, r.env, pkg.dir, includeTest) -} - -func (r *ModuleResolver) scanDirForPackage(root gopathwalk.Root, dir string) directoryPackageInfo { - subdir := "" - if dir != root.Path { - subdir = dir[len(root.Path)+len("/"):] - } - importPath := filepath.ToSlash(subdir) - if strings.HasPrefix(importPath, "vendor/") { - // Only enter vendor directories if they're explicitly requested as a root. - return directoryPackageInfo{ - status: directoryScanned, - err: fmt.Errorf("unwanted vendor directory"), - } - } - switch root.Type { - case gopathwalk.RootCurrentModule: - importPath = path.Join(r.main.Path, filepath.ToSlash(subdir)) - case gopathwalk.RootModuleCache: - matches := modCacheRegexp.FindStringSubmatch(subdir) - if len(matches) == 0 { - return directoryPackageInfo{ - status: directoryScanned, - err: fmt.Errorf("invalid module cache path: %v", subdir), - } - } - modPath, err := module.UnescapePath(filepath.ToSlash(matches[1])) - if err != nil { - if r.env.Logf != nil { - r.env.Logf("decoding module cache path %q: %v", subdir, err) - } - return directoryPackageInfo{ - status: directoryScanned, - err: fmt.Errorf("decoding module cache path %q: %v", subdir, err), - } - } - importPath = path.Join(modPath, filepath.ToSlash(matches[3])) - } - - modDir, modName := r.modInfo(dir) - result := directoryPackageInfo{ - status: directoryScanned, - dir: dir, - rootType: root.Type, - nonCanonicalImportPath: importPath, - moduleDir: modDir, - moduleName: modName, - } - if root.Type == gopathwalk.RootGOROOT { - // stdlib packages are always in scope, despite the confusing go.mod - return result - } - return result -} - -// modCacheRegexp splits a path in a module cache into module, module version, and package. -var modCacheRegexp = regexp.MustCompile(`(.*)@([^/\\]*)(.*)`) - -var ( - slashSlash = []byte("//") - moduleStr = []byte("module") -) - -// modulePath returns the module path from the gomod file text. -// If it cannot find a module path, it returns an empty string. -// It is tolerant of unrelated problems in the go.mod file. -// -// Copied from cmd/go/internal/modfile. -func modulePath(mod []byte) string { - for len(mod) > 0 { - line := mod - mod = nil - if i := bytes.IndexByte(line, '\n'); i >= 0 { - line, mod = line[:i], line[i+1:] - } - if i := bytes.Index(line, slashSlash); i >= 0 { - line = line[:i] - } - line = bytes.TrimSpace(line) - if !bytes.HasPrefix(line, moduleStr) { - continue - } - line = line[len(moduleStr):] - n := len(line) - line = bytes.TrimSpace(line) - if len(line) == n || len(line) == 0 { - continue - } - - if line[0] == '"' || line[0] == '`' { - p, err := strconv.Unquote(string(line)) - if err != nil { - return "" // malformed quoted string or multiline module path - } - return p - } - - return string(line) - } - return "" // missing module path -} - -var modFlagRegexp = regexp.MustCompile(`-mod[ =](\w+)`) - -// vendorEnabled indicates if vendoring is enabled. -// Inspired by setDefaultBuildMod in modload/init.go -func vendorEnabled(env *ProcessEnv) (*ModuleJSON, bool, error) { - mainMod, go114, err := getMainModuleAnd114(env) - if err != nil { - return nil, false, err - } - matches := modFlagRegexp.FindStringSubmatch(env.GOFLAGS) - var modFlag string - if len(matches) != 0 { - modFlag = matches[1] - } - if modFlag != "" { - // Don't override an explicit '-mod=' argument. - return mainMod, modFlag == "vendor", nil - } - if mainMod == nil || !go114 { - return mainMod, false, nil - } - // Check 1.14's automatic vendor mode. - if fi, err := os.Stat(filepath.Join(mainMod.Dir, "vendor")); err == nil && fi.IsDir() { - if mainMod.GoVersion != "" && semver.Compare("v"+mainMod.GoVersion, "v1.14") >= 0 { - // The Go version is at least 1.14, and a vendor directory exists. - // Set -mod=vendor by default. - return mainMod, true, nil - } - } - return mainMod, false, nil -} - -// getMainModuleAnd114 gets the main module's information and whether the -// go command in use is 1.14+. This is the information needed to figure out -// if vendoring should be enabled. -func getMainModuleAnd114(env *ProcessEnv) (*ModuleJSON, bool, error) { - const format = `{{.Path}} -{{.Dir}} -{{.GoMod}} -{{.GoVersion}} -{{range context.ReleaseTags}}{{if eq . "go1.14"}}{{.}}{{end}}{{end}} -` - stdout, err := env.invokeGo(context.TODO(), "list", "-m", "-f", format) - if err != nil { - return nil, false, nil - } - lines := strings.Split(stdout.String(), "\n") - if len(lines) < 5 { - return nil, false, fmt.Errorf("unexpected stdout: %q", stdout) - } - mod := &ModuleJSON{ - Path: lines[0], - Dir: lines[1], - GoMod: lines[2], - GoVersion: lines[3], - Main: true, - } - return mod, lines[4] == "go1.14", nil -} diff --git a/vendor/golang.org/x/tools/internal/imports/mod_cache.go b/vendor/golang.org/x/tools/internal/imports/mod_cache.go deleted file mode 100644 index 5b4f03a..0000000 --- a/vendor/golang.org/x/tools/internal/imports/mod_cache.go +++ /dev/null @@ -1,232 +0,0 @@ -package imports - -import ( - "context" - "fmt" - "sync" - - "golang.org/x/tools/internal/gopathwalk" -) - -// To find packages to import, the resolver needs to know about all of the -// the packages that could be imported. This includes packages that are -// already in modules that are in (1) the current module, (2) replace targets, -// and (3) packages in the module cache. Packages in (1) and (2) may change over -// time, as the client may edit the current module and locally replaced modules. -// The module cache (which includes all of the packages in (3)) can only -// ever be added to. -// -// The resolver can thus save state about packages in the module cache -// and guarantee that this will not change over time. To obtain information -// about new modules added to the module cache, the module cache should be -// rescanned. -// -// It is OK to serve information about modules that have been deleted, -// as they do still exist. -// TODO(suzmue): can we share information with the caller about -// what module needs to be downloaded to import this package? - -type directoryPackageStatus int - -const ( - _ directoryPackageStatus = iota - directoryScanned - nameLoaded - exportsLoaded -) - -type directoryPackageInfo struct { - // status indicates the extent to which this struct has been filled in. - status directoryPackageStatus - // err is non-nil when there was an error trying to reach status. - err error - - // Set when status >= directoryScanned. - - // dir is the absolute directory of this package. - dir string - rootType gopathwalk.RootType - // nonCanonicalImportPath is the package's expected import path. It may - // not actually be importable at that path. - nonCanonicalImportPath string - - // Module-related information. - moduleDir string // The directory that is the module root of this dir. - moduleName string // The module name that contains this dir. - - // Set when status >= nameLoaded. - - packageName string // the package name, as declared in the source. - - // Set when status >= exportsLoaded. - - exports []string -} - -// reachedStatus returns true when info has a status at least target and any error associated with -// an attempt to reach target. -func (info *directoryPackageInfo) reachedStatus(target directoryPackageStatus) (bool, error) { - if info.err == nil { - return info.status >= target, nil - } - if info.status == target { - return true, info.err - } - return true, nil -} - -// dirInfoCache is a concurrency safe map for storing information about -// directories that may contain packages. -// -// The information in this cache is built incrementally. Entries are initialized in scan. -// No new keys should be added in any other functions, as all directories containing -// packages are identified in scan. -// -// Other functions, including loadExports and findPackage, may update entries in this cache -// as they discover new things about the directory. -// -// The information in the cache is not expected to change for the cache's -// lifetime, so there is no protection against competing writes. Users should -// take care not to hold the cache across changes to the underlying files. -// -// TODO(suzmue): consider other concurrency strategies and data structures (RWLocks, sync.Map, etc) -type dirInfoCache struct { - mu sync.Mutex - // dirs stores information about packages in directories, keyed by absolute path. - dirs map[string]*directoryPackageInfo - listeners map[*int]cacheListener -} - -type cacheListener func(directoryPackageInfo) - -// ScanAndListen calls listener on all the items in the cache, and on anything -// newly added. The returned stop function waits for all in-flight callbacks to -// finish and blocks new ones. -func (d *dirInfoCache) ScanAndListen(ctx context.Context, listener cacheListener) func() { - ctx, cancel := context.WithCancel(ctx) - - // Flushing out all the callbacks is tricky without knowing how many there - // are going to be. Setting an arbitrary limit makes it much easier. - const maxInFlight = 10 - sema := make(chan struct{}, maxInFlight) - for i := 0; i < maxInFlight; i++ { - sema <- struct{}{} - } - - cookie := new(int) // A unique ID we can use for the listener. - - // We can't hold mu while calling the listener. - d.mu.Lock() - var keys []string - for key := range d.dirs { - keys = append(keys, key) - } - d.listeners[cookie] = func(info directoryPackageInfo) { - select { - case <-ctx.Done(): - return - case <-sema: - } - listener(info) - sema <- struct{}{} - } - d.mu.Unlock() - - stop := func() { - cancel() - d.mu.Lock() - delete(d.listeners, cookie) - d.mu.Unlock() - for i := 0; i < maxInFlight; i++ { - <-sema - } - } - - // Process the pre-existing keys. - for _, k := range keys { - select { - case <-ctx.Done(): - return stop - default: - } - if v, ok := d.Load(k); ok { - listener(v) - } - } - - return stop -} - -// Store stores the package info for dir. -func (d *dirInfoCache) Store(dir string, info directoryPackageInfo) { - d.mu.Lock() - _, old := d.dirs[dir] - d.dirs[dir] = &info - var listeners []cacheListener - for _, l := range d.listeners { - listeners = append(listeners, l) - } - d.mu.Unlock() - - if !old { - for _, l := range listeners { - l(info) - } - } -} - -// Load returns a copy of the directoryPackageInfo for absolute directory dir. -func (d *dirInfoCache) Load(dir string) (directoryPackageInfo, bool) { - d.mu.Lock() - defer d.mu.Unlock() - info, ok := d.dirs[dir] - if !ok { - return directoryPackageInfo{}, false - } - return *info, true -} - -// Keys returns the keys currently present in d. -func (d *dirInfoCache) Keys() (keys []string) { - d.mu.Lock() - defer d.mu.Unlock() - for key := range d.dirs { - keys = append(keys, key) - } - return keys -} - -func (d *dirInfoCache) CachePackageName(info directoryPackageInfo) (string, error) { - if loaded, err := info.reachedStatus(nameLoaded); loaded { - return info.packageName, err - } - if scanned, err := info.reachedStatus(directoryScanned); !scanned || err != nil { - return "", fmt.Errorf("cannot read package name, scan error: %v", err) - } - info.packageName, info.err = packageDirToName(info.dir) - info.status = nameLoaded - d.Store(info.dir, info) - return info.packageName, info.err -} - -func (d *dirInfoCache) CacheExports(ctx context.Context, env *ProcessEnv, info directoryPackageInfo) (string, []string, error) { - if reached, _ := info.reachedStatus(exportsLoaded); reached { - return info.packageName, info.exports, info.err - } - if reached, err := info.reachedStatus(nameLoaded); reached && err != nil { - return "", nil, err - } - info.packageName, info.exports, info.err = loadExportsFromFiles(ctx, env, info.dir, false) - if info.err == context.Canceled || info.err == context.DeadlineExceeded { - return info.packageName, info.exports, info.err - } - // The cache structure wants things to proceed linearly. We can skip a - // step here, but only if we succeed. - if info.status == nameLoaded || info.err == nil { - info.status = exportsLoaded - } else { - info.status = nameLoaded - } - d.Store(info.dir, info) - return info.packageName, info.exports, info.err -} diff --git a/vendor/golang.org/x/tools/internal/imports/sortimports.go b/vendor/golang.org/x/tools/internal/imports/sortimports.go deleted file mode 100644 index 2262794..0000000 --- a/vendor/golang.org/x/tools/internal/imports/sortimports.go +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Hacked up copy of go/ast/import.go - -package imports - -import ( - "go/ast" - "go/token" - "sort" - "strconv" -) - -// sortImports sorts runs of consecutive import lines in import blocks in f. -// It also removes duplicate imports when it is possible to do so without data loss. -func sortImports(env *ProcessEnv, fset *token.FileSet, f *ast.File) { - for i, d := range f.Decls { - d, ok := d.(*ast.GenDecl) - if !ok || d.Tok != token.IMPORT { - // Not an import declaration, so we're done. - // Imports are always first. - break - } - - if len(d.Specs) == 0 { - // Empty import block, remove it. - f.Decls = append(f.Decls[:i], f.Decls[i+1:]...) - } - - if !d.Lparen.IsValid() { - // Not a block: sorted by default. - continue - } - - // Identify and sort runs of specs on successive lines. - i := 0 - specs := d.Specs[:0] - for j, s := range d.Specs { - if j > i && fset.Position(s.Pos()).Line > 1+fset.Position(d.Specs[j-1].End()).Line { - // j begins a new run. End this one. - specs = append(specs, sortSpecs(env, fset, f, d.Specs[i:j])...) - i = j - } - } - specs = append(specs, sortSpecs(env, fset, f, d.Specs[i:])...) - d.Specs = specs - - // Deduping can leave a blank line before the rparen; clean that up. - if len(d.Specs) > 0 { - lastSpec := d.Specs[len(d.Specs)-1] - lastLine := fset.Position(lastSpec.Pos()).Line - if rParenLine := fset.Position(d.Rparen).Line; rParenLine > lastLine+1 { - fset.File(d.Rparen).MergeLine(rParenLine - 1) - } - } - } -} - -// mergeImports merges all the import declarations into the first one. -// Taken from golang.org/x/tools/ast/astutil. -func mergeImports(env *ProcessEnv, fset *token.FileSet, f *ast.File) { - if len(f.Decls) <= 1 { - return - } - - // Merge all the import declarations into the first one. - var first *ast.GenDecl - for i := 0; i < len(f.Decls); i++ { - decl := f.Decls[i] - gen, ok := decl.(*ast.GenDecl) - if !ok || gen.Tok != token.IMPORT || declImports(gen, "C") { - continue - } - if first == nil { - first = gen - continue // Don't touch the first one. - } - // We now know there is more than one package in this import - // declaration. Ensure that it ends up parenthesized. - first.Lparen = first.Pos() - // Move the imports of the other import declaration to the first one. - for _, spec := range gen.Specs { - spec.(*ast.ImportSpec).Path.ValuePos = first.Pos() - first.Specs = append(first.Specs, spec) - } - f.Decls = append(f.Decls[:i], f.Decls[i+1:]...) - i-- - } -} - -// declImports reports whether gen contains an import of path. -// Taken from golang.org/x/tools/ast/astutil. -func declImports(gen *ast.GenDecl, path string) bool { - if gen.Tok != token.IMPORT { - return false - } - for _, spec := range gen.Specs { - impspec := spec.(*ast.ImportSpec) - if importPath(impspec) == path { - return true - } - } - return false -} - -func importPath(s ast.Spec) string { - t, err := strconv.Unquote(s.(*ast.ImportSpec).Path.Value) - if err == nil { - return t - } - return "" -} - -func importName(s ast.Spec) string { - n := s.(*ast.ImportSpec).Name - if n == nil { - return "" - } - return n.Name -} - -func importComment(s ast.Spec) string { - c := s.(*ast.ImportSpec).Comment - if c == nil { - return "" - } - return c.Text() -} - -// collapse indicates whether prev may be removed, leaving only next. -func collapse(prev, next ast.Spec) bool { - if importPath(next) != importPath(prev) || importName(next) != importName(prev) { - return false - } - return prev.(*ast.ImportSpec).Comment == nil -} - -type posSpan struct { - Start token.Pos - End token.Pos -} - -func sortSpecs(env *ProcessEnv, fset *token.FileSet, f *ast.File, specs []ast.Spec) []ast.Spec { - // Can't short-circuit here even if specs are already sorted, - // since they might yet need deduplication. - // A lone import, however, may be safely ignored. - if len(specs) <= 1 { - return specs - } - - // Record positions for specs. - pos := make([]posSpan, len(specs)) - for i, s := range specs { - pos[i] = posSpan{s.Pos(), s.End()} - } - - // Identify comments in this range. - // Any comment from pos[0].Start to the final line counts. - lastLine := fset.Position(pos[len(pos)-1].End).Line - cstart := len(f.Comments) - cend := len(f.Comments) - for i, g := range f.Comments { - if g.Pos() < pos[0].Start { - continue - } - if i < cstart { - cstart = i - } - if fset.Position(g.End()).Line > lastLine { - cend = i - break - } - } - comments := f.Comments[cstart:cend] - - // Assign each comment to the import spec preceding it. - importComment := map[*ast.ImportSpec][]*ast.CommentGroup{} - specIndex := 0 - for _, g := range comments { - for specIndex+1 < len(specs) && pos[specIndex+1].Start <= g.Pos() { - specIndex++ - } - s := specs[specIndex].(*ast.ImportSpec) - importComment[s] = append(importComment[s], g) - } - - // Sort the import specs by import path. - // Remove duplicates, when possible without data loss. - // Reassign the import paths to have the same position sequence. - // Reassign each comment to abut the end of its spec. - // Sort the comments by new position. - sort.Sort(byImportSpec{env, specs}) - - // Dedup. Thanks to our sorting, we can just consider - // adjacent pairs of imports. - deduped := specs[:0] - for i, s := range specs { - if i == len(specs)-1 || !collapse(s, specs[i+1]) { - deduped = append(deduped, s) - } else { - p := s.Pos() - fset.File(p).MergeLine(fset.Position(p).Line) - } - } - specs = deduped - - // Fix up comment positions - for i, s := range specs { - s := s.(*ast.ImportSpec) - if s.Name != nil { - s.Name.NamePos = pos[i].Start - } - s.Path.ValuePos = pos[i].Start - s.EndPos = pos[i].End - nextSpecPos := pos[i].End - - for _, g := range importComment[s] { - for _, c := range g.List { - c.Slash = pos[i].End - nextSpecPos = c.End() - } - } - if i < len(specs)-1 { - pos[i+1].Start = nextSpecPos - pos[i+1].End = nextSpecPos - } - } - - sort.Sort(byCommentPos(comments)) - - // Fixup comments can insert blank lines, because import specs are on different lines. - // We remove those blank lines here by merging import spec to the first import spec line. - firstSpecLine := fset.Position(specs[0].Pos()).Line - for _, s := range specs[1:] { - p := s.Pos() - line := fset.File(p).Line(p) - for previousLine := line - 1; previousLine >= firstSpecLine; { - fset.File(p).MergeLine(previousLine) - previousLine-- - } - } - return specs -} - -type byImportSpec struct { - env *ProcessEnv - specs []ast.Spec // slice of *ast.ImportSpec -} - -func (x byImportSpec) Len() int { return len(x.specs) } -func (x byImportSpec) Swap(i, j int) { x.specs[i], x.specs[j] = x.specs[j], x.specs[i] } -func (x byImportSpec) Less(i, j int) bool { - ipath := importPath(x.specs[i]) - jpath := importPath(x.specs[j]) - - igroup := importGroup(x.env, ipath) - jgroup := importGroup(x.env, jpath) - if igroup != jgroup { - return igroup < jgroup - } - - if ipath != jpath { - return ipath < jpath - } - iname := importName(x.specs[i]) - jname := importName(x.specs[j]) - - if iname != jname { - return iname < jname - } - return importComment(x.specs[i]) < importComment(x.specs[j]) -} - -type byCommentPos []*ast.CommentGroup - -func (x byCommentPos) Len() int { return len(x) } -func (x byCommentPos) Swap(i, j int) { x[i], x[j] = x[j], x[i] } -func (x byCommentPos) Less(i, j int) bool { return x[i].Pos() < x[j].Pos() } diff --git a/vendor/golang.org/x/tools/internal/imports/zstdlib.go b/vendor/golang.org/x/tools/internal/imports/zstdlib.go deleted file mode 100644 index 7e60eb0..0000000 --- a/vendor/golang.org/x/tools/internal/imports/zstdlib.go +++ /dev/null @@ -1,10377 +0,0 @@ -// Code generated by mkstdlib.go. DO NOT EDIT. - -package imports - -var stdlib = map[string][]string{ - "archive/tar": []string{ - "ErrFieldTooLong", - "ErrHeader", - "ErrWriteAfterClose", - "ErrWriteTooLong", - "FileInfoHeader", - "Format", - "FormatGNU", - "FormatPAX", - "FormatUSTAR", - "FormatUnknown", - "Header", - "NewReader", - "NewWriter", - "Reader", - "TypeBlock", - "TypeChar", - "TypeCont", - "TypeDir", - "TypeFifo", - "TypeGNULongLink", - "TypeGNULongName", - "TypeGNUSparse", - "TypeLink", - "TypeReg", - "TypeRegA", - "TypeSymlink", - "TypeXGlobalHeader", - "TypeXHeader", - "Writer", - }, - "archive/zip": []string{ - "Compressor", - "Decompressor", - "Deflate", - "ErrAlgorithm", - "ErrChecksum", - "ErrFormat", - "File", - "FileHeader", - "FileInfoHeader", - "NewReader", - "NewWriter", - "OpenReader", - "ReadCloser", - "Reader", - "RegisterCompressor", - "RegisterDecompressor", - "Store", - "Writer", - }, - "bufio": []string{ - "ErrAdvanceTooFar", - "ErrBufferFull", - "ErrFinalToken", - "ErrInvalidUnreadByte", - "ErrInvalidUnreadRune", - "ErrNegativeAdvance", - "ErrNegativeCount", - "ErrTooLong", - "MaxScanTokenSize", - "NewReadWriter", - "NewReader", - "NewReaderSize", - "NewScanner", - "NewWriter", - "NewWriterSize", - "ReadWriter", - "Reader", - "ScanBytes", - "ScanLines", - "ScanRunes", - "ScanWords", - "Scanner", - "SplitFunc", - "Writer", - }, - "bytes": []string{ - "Buffer", - "Compare", - "Contains", - "ContainsAny", - "ContainsRune", - "Count", - "Equal", - "EqualFold", - "ErrTooLarge", - "Fields", - "FieldsFunc", - "HasPrefix", - "HasSuffix", - "Index", - "IndexAny", - "IndexByte", - "IndexFunc", - "IndexRune", - "Join", - "LastIndex", - "LastIndexAny", - "LastIndexByte", - "LastIndexFunc", - "Map", - "MinRead", - "NewBuffer", - "NewBufferString", - "NewReader", - "Reader", - "Repeat", - "Replace", - "ReplaceAll", - "Runes", - "Split", - "SplitAfter", - "SplitAfterN", - "SplitN", - "Title", - "ToLower", - "ToLowerSpecial", - "ToTitle", - "ToTitleSpecial", - "ToUpper", - "ToUpperSpecial", - "ToValidUTF8", - "Trim", - "TrimFunc", - "TrimLeft", - "TrimLeftFunc", - "TrimPrefix", - "TrimRight", - "TrimRightFunc", - "TrimSpace", - "TrimSuffix", - }, - "compress/bzip2": []string{ - "NewReader", - "StructuralError", - }, - "compress/flate": []string{ - "BestCompression", - "BestSpeed", - "CorruptInputError", - "DefaultCompression", - "HuffmanOnly", - "InternalError", - "NewReader", - "NewReaderDict", - "NewWriter", - "NewWriterDict", - "NoCompression", - "ReadError", - "Reader", - "Resetter", - "WriteError", - "Writer", - }, - "compress/gzip": []string{ - "BestCompression", - "BestSpeed", - "DefaultCompression", - "ErrChecksum", - "ErrHeader", - "Header", - "HuffmanOnly", - "NewReader", - "NewWriter", - "NewWriterLevel", - "NoCompression", - "Reader", - "Writer", - }, - "compress/lzw": []string{ - "LSB", - "MSB", - "NewReader", - "NewWriter", - "Order", - }, - "compress/zlib": []string{ - "BestCompression", - "BestSpeed", - "DefaultCompression", - "ErrChecksum", - "ErrDictionary", - "ErrHeader", - "HuffmanOnly", - "NewReader", - "NewReaderDict", - "NewWriter", - "NewWriterLevel", - "NewWriterLevelDict", - "NoCompression", - "Resetter", - "Writer", - }, - "container/heap": []string{ - "Fix", - "Init", - "Interface", - "Pop", - "Push", - "Remove", - }, - "container/list": []string{ - "Element", - "List", - "New", - }, - "container/ring": []string{ - "New", - "Ring", - }, - "context": []string{ - "Background", - "CancelFunc", - "Canceled", - "Context", - "DeadlineExceeded", - "TODO", - "WithCancel", - "WithDeadline", - "WithTimeout", - "WithValue", - }, - "crypto": []string{ - "BLAKE2b_256", - "BLAKE2b_384", - "BLAKE2b_512", - "BLAKE2s_256", - "Decrypter", - "DecrypterOpts", - "Hash", - "MD4", - "MD5", - "MD5SHA1", - "PrivateKey", - "PublicKey", - "RIPEMD160", - "RegisterHash", - "SHA1", - "SHA224", - "SHA256", - "SHA384", - "SHA3_224", - "SHA3_256", - "SHA3_384", - "SHA3_512", - "SHA512", - "SHA512_224", - "SHA512_256", - "Signer", - "SignerOpts", - }, - "crypto/aes": []string{ - "BlockSize", - "KeySizeError", - "NewCipher", - }, - "crypto/cipher": []string{ - "AEAD", - "Block", - "BlockMode", - "NewCBCDecrypter", - "NewCBCEncrypter", - "NewCFBDecrypter", - "NewCFBEncrypter", - "NewCTR", - "NewGCM", - "NewGCMWithNonceSize", - "NewGCMWithTagSize", - "NewOFB", - "Stream", - "StreamReader", - "StreamWriter", - }, - "crypto/des": []string{ - "BlockSize", - "KeySizeError", - "NewCipher", - "NewTripleDESCipher", - }, - "crypto/dsa": []string{ - "ErrInvalidPublicKey", - "GenerateKey", - "GenerateParameters", - "L1024N160", - "L2048N224", - "L2048N256", - "L3072N256", - "ParameterSizes", - "Parameters", - "PrivateKey", - "PublicKey", - "Sign", - "Verify", - }, - "crypto/ecdsa": []string{ - "GenerateKey", - "PrivateKey", - "PublicKey", - "Sign", - "Verify", - }, - "crypto/ed25519": []string{ - "GenerateKey", - "NewKeyFromSeed", - "PrivateKey", - "PrivateKeySize", - "PublicKey", - "PublicKeySize", - "SeedSize", - "Sign", - "SignatureSize", - "Verify", - }, - "crypto/elliptic": []string{ - "Curve", - "CurveParams", - "GenerateKey", - "Marshal", - "P224", - "P256", - "P384", - "P521", - "Unmarshal", - }, - "crypto/hmac": []string{ - "Equal", - "New", - }, - "crypto/md5": []string{ - "BlockSize", - "New", - "Size", - "Sum", - }, - "crypto/rand": []string{ - "Int", - "Prime", - "Read", - "Reader", - }, - "crypto/rc4": []string{ - "Cipher", - "KeySizeError", - "NewCipher", - }, - "crypto/rsa": []string{ - "CRTValue", - "DecryptOAEP", - "DecryptPKCS1v15", - "DecryptPKCS1v15SessionKey", - "EncryptOAEP", - "EncryptPKCS1v15", - "ErrDecryption", - "ErrMessageTooLong", - "ErrVerification", - "GenerateKey", - "GenerateMultiPrimeKey", - "OAEPOptions", - "PKCS1v15DecryptOptions", - "PSSOptions", - "PSSSaltLengthAuto", - "PSSSaltLengthEqualsHash", - "PrecomputedValues", - "PrivateKey", - "PublicKey", - "SignPKCS1v15", - "SignPSS", - "VerifyPKCS1v15", - "VerifyPSS", - }, - "crypto/sha1": []string{ - "BlockSize", - "New", - "Size", - "Sum", - }, - "crypto/sha256": []string{ - "BlockSize", - "New", - "New224", - "Size", - "Size224", - "Sum224", - "Sum256", - }, - "crypto/sha512": []string{ - "BlockSize", - "New", - "New384", - "New512_224", - "New512_256", - "Size", - "Size224", - "Size256", - "Size384", - "Sum384", - "Sum512", - "Sum512_224", - "Sum512_256", - }, - "crypto/subtle": []string{ - "ConstantTimeByteEq", - "ConstantTimeCompare", - "ConstantTimeCopy", - "ConstantTimeEq", - "ConstantTimeLessOrEq", - "ConstantTimeSelect", - }, - "crypto/tls": []string{ - "Certificate", - "CertificateRequestInfo", - "Client", - "ClientAuthType", - "ClientHelloInfo", - "ClientSessionCache", - "ClientSessionState", - "Config", - "Conn", - "ConnectionState", - "CurveID", - "CurveP256", - "CurveP384", - "CurveP521", - "Dial", - "DialWithDialer", - "ECDSAWithP256AndSHA256", - "ECDSAWithP384AndSHA384", - "ECDSAWithP521AndSHA512", - "ECDSAWithSHA1", - "Ed25519", - "Listen", - "LoadX509KeyPair", - "NewLRUClientSessionCache", - "NewListener", - "NoClientCert", - "PKCS1WithSHA1", - "PKCS1WithSHA256", - "PKCS1WithSHA384", - "PKCS1WithSHA512", - "PSSWithSHA256", - "PSSWithSHA384", - "PSSWithSHA512", - "RecordHeaderError", - "RenegotiateFreelyAsClient", - "RenegotiateNever", - "RenegotiateOnceAsClient", - "RenegotiationSupport", - "RequestClientCert", - "RequireAndVerifyClientCert", - "RequireAnyClientCert", - "Server", - "SignatureScheme", - "TLS_AES_128_GCM_SHA256", - "TLS_AES_256_GCM_SHA384", - "TLS_CHACHA20_POLY1305_SHA256", - "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", - "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", - "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", - "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305", - "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", - "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", - "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", - "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", - "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", - "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", - "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305", - "TLS_ECDHE_RSA_WITH_RC4_128_SHA", - "TLS_FALLBACK_SCSV", - "TLS_RSA_WITH_3DES_EDE_CBC_SHA", - "TLS_RSA_WITH_AES_128_CBC_SHA", - "TLS_RSA_WITH_AES_128_CBC_SHA256", - "TLS_RSA_WITH_AES_128_GCM_SHA256", - "TLS_RSA_WITH_AES_256_CBC_SHA", - "TLS_RSA_WITH_AES_256_GCM_SHA384", - "TLS_RSA_WITH_RC4_128_SHA", - "VerifyClientCertIfGiven", - "VersionSSL30", - "VersionTLS10", - "VersionTLS11", - "VersionTLS12", - "VersionTLS13", - "X25519", - "X509KeyPair", - }, - "crypto/x509": []string{ - "CANotAuthorizedForExtKeyUsage", - "CANotAuthorizedForThisName", - "CertPool", - "Certificate", - "CertificateInvalidError", - "CertificateRequest", - "ConstraintViolationError", - "CreateCertificate", - "CreateCertificateRequest", - "DSA", - "DSAWithSHA1", - "DSAWithSHA256", - "DecryptPEMBlock", - "ECDSA", - "ECDSAWithSHA1", - "ECDSAWithSHA256", - "ECDSAWithSHA384", - "ECDSAWithSHA512", - "Ed25519", - "EncryptPEMBlock", - "ErrUnsupportedAlgorithm", - "Expired", - "ExtKeyUsage", - "ExtKeyUsageAny", - "ExtKeyUsageClientAuth", - "ExtKeyUsageCodeSigning", - "ExtKeyUsageEmailProtection", - "ExtKeyUsageIPSECEndSystem", - "ExtKeyUsageIPSECTunnel", - "ExtKeyUsageIPSECUser", - "ExtKeyUsageMicrosoftCommercialCodeSigning", - "ExtKeyUsageMicrosoftKernelCodeSigning", - "ExtKeyUsageMicrosoftServerGatedCrypto", - "ExtKeyUsageNetscapeServerGatedCrypto", - "ExtKeyUsageOCSPSigning", - "ExtKeyUsageServerAuth", - "ExtKeyUsageTimeStamping", - "HostnameError", - "IncompatibleUsage", - "IncorrectPasswordError", - "InsecureAlgorithmError", - "InvalidReason", - "IsEncryptedPEMBlock", - "KeyUsage", - "KeyUsageCRLSign", - "KeyUsageCertSign", - "KeyUsageContentCommitment", - "KeyUsageDataEncipherment", - "KeyUsageDecipherOnly", - "KeyUsageDigitalSignature", - "KeyUsageEncipherOnly", - "KeyUsageKeyAgreement", - "KeyUsageKeyEncipherment", - "MD2WithRSA", - "MD5WithRSA", - "MarshalECPrivateKey", - "MarshalPKCS1PrivateKey", - "MarshalPKCS1PublicKey", - "MarshalPKCS8PrivateKey", - "MarshalPKIXPublicKey", - "NameConstraintsWithoutSANs", - "NameMismatch", - "NewCertPool", - "NotAuthorizedToSign", - "PEMCipher", - "PEMCipher3DES", - "PEMCipherAES128", - "PEMCipherAES192", - "PEMCipherAES256", - "PEMCipherDES", - "ParseCRL", - "ParseCertificate", - "ParseCertificateRequest", - "ParseCertificates", - "ParseDERCRL", - "ParseECPrivateKey", - "ParsePKCS1PrivateKey", - "ParsePKCS1PublicKey", - "ParsePKCS8PrivateKey", - "ParsePKIXPublicKey", - "PublicKeyAlgorithm", - "PureEd25519", - "RSA", - "SHA1WithRSA", - "SHA256WithRSA", - "SHA256WithRSAPSS", - "SHA384WithRSA", - "SHA384WithRSAPSS", - "SHA512WithRSA", - "SHA512WithRSAPSS", - "SignatureAlgorithm", - "SystemCertPool", - "SystemRootsError", - "TooManyConstraints", - "TooManyIntermediates", - "UnconstrainedName", - "UnhandledCriticalExtension", - "UnknownAuthorityError", - "UnknownPublicKeyAlgorithm", - "UnknownSignatureAlgorithm", - "VerifyOptions", - }, - "crypto/x509/pkix": []string{ - "AlgorithmIdentifier", - "AttributeTypeAndValue", - "AttributeTypeAndValueSET", - "CertificateList", - "Extension", - "Name", - "RDNSequence", - "RelativeDistinguishedNameSET", - "RevokedCertificate", - "TBSCertificateList", - }, - "database/sql": []string{ - "ColumnType", - "Conn", - "DB", - "DBStats", - "Drivers", - "ErrConnDone", - "ErrNoRows", - "ErrTxDone", - "IsolationLevel", - "LevelDefault", - "LevelLinearizable", - "LevelReadCommitted", - "LevelReadUncommitted", - "LevelRepeatableRead", - "LevelSerializable", - "LevelSnapshot", - "LevelWriteCommitted", - "Named", - "NamedArg", - "NullBool", - "NullFloat64", - "NullInt32", - "NullInt64", - "NullString", - "NullTime", - "Open", - "OpenDB", - "Out", - "RawBytes", - "Register", - "Result", - "Row", - "Rows", - "Scanner", - "Stmt", - "Tx", - "TxOptions", - }, - "database/sql/driver": []string{ - "Bool", - "ColumnConverter", - "Conn", - "ConnBeginTx", - "ConnPrepareContext", - "Connector", - "DefaultParameterConverter", - "Driver", - "DriverContext", - "ErrBadConn", - "ErrRemoveArgument", - "ErrSkip", - "Execer", - "ExecerContext", - "Int32", - "IsScanValue", - "IsValue", - "IsolationLevel", - "NamedValue", - "NamedValueChecker", - "NotNull", - "Null", - "Pinger", - "Queryer", - "QueryerContext", - "Result", - "ResultNoRows", - "Rows", - "RowsAffected", - "RowsColumnTypeDatabaseTypeName", - "RowsColumnTypeLength", - "RowsColumnTypeNullable", - "RowsColumnTypePrecisionScale", - "RowsColumnTypeScanType", - "RowsNextResultSet", - "SessionResetter", - "Stmt", - "StmtExecContext", - "StmtQueryContext", - "String", - "Tx", - "TxOptions", - "Value", - "ValueConverter", - "Valuer", - }, - "debug/dwarf": []string{ - "AddrType", - "ArrayType", - "Attr", - "AttrAbstractOrigin", - "AttrAccessibility", - "AttrAddrClass", - "AttrAllocated", - "AttrArtificial", - "AttrAssociated", - "AttrBaseTypes", - "AttrBitOffset", - "AttrBitSize", - "AttrByteSize", - "AttrCallColumn", - "AttrCallFile", - "AttrCallLine", - "AttrCalling", - "AttrCommonRef", - "AttrCompDir", - "AttrConstValue", - "AttrContainingType", - "AttrCount", - "AttrDataLocation", - "AttrDataMemberLoc", - "AttrDeclColumn", - "AttrDeclFile", - "AttrDeclLine", - "AttrDeclaration", - "AttrDefaultValue", - "AttrDescription", - "AttrDiscr", - "AttrDiscrList", - "AttrDiscrValue", - "AttrEncoding", - "AttrEntrypc", - "AttrExtension", - "AttrExternal", - "AttrFrameBase", - "AttrFriend", - "AttrHighpc", - "AttrIdentifierCase", - "AttrImport", - "AttrInline", - "AttrIsOptional", - "AttrLanguage", - "AttrLocation", - "AttrLowerBound", - "AttrLowpc", - "AttrMacroInfo", - "AttrName", - "AttrNamelistItem", - "AttrOrdering", - "AttrPriority", - "AttrProducer", - "AttrPrototyped", - "AttrRanges", - "AttrReturnAddr", - "AttrSegment", - "AttrSibling", - "AttrSpecification", - "AttrStartScope", - "AttrStaticLink", - "AttrStmtList", - "AttrStride", - "AttrStrideSize", - "AttrStringLength", - "AttrTrampoline", - "AttrType", - "AttrUpperBound", - "AttrUseLocation", - "AttrUseUTF8", - "AttrVarParam", - "AttrVirtuality", - "AttrVisibility", - "AttrVtableElemLoc", - "BasicType", - "BoolType", - "CharType", - "Class", - "ClassAddress", - "ClassBlock", - "ClassConstant", - "ClassExprLoc", - "ClassFlag", - "ClassLinePtr", - "ClassLocListPtr", - "ClassMacPtr", - "ClassRangeListPtr", - "ClassReference", - "ClassReferenceAlt", - "ClassReferenceSig", - "ClassString", - "ClassStringAlt", - "ClassUnknown", - "CommonType", - "ComplexType", - "Data", - "DecodeError", - "DotDotDotType", - "Entry", - "EnumType", - "EnumValue", - "ErrUnknownPC", - "Field", - "FloatType", - "FuncType", - "IntType", - "LineEntry", - "LineFile", - "LineReader", - "LineReaderPos", - "New", - "Offset", - "PtrType", - "QualType", - "Reader", - "StructField", - "StructType", - "Tag", - "TagAccessDeclaration", - "TagArrayType", - "TagBaseType", - "TagCatchDwarfBlock", - "TagClassType", - "TagCommonDwarfBlock", - "TagCommonInclusion", - "TagCompileUnit", - "TagCondition", - "TagConstType", - "TagConstant", - "TagDwarfProcedure", - "TagEntryPoint", - "TagEnumerationType", - "TagEnumerator", - "TagFileType", - "TagFormalParameter", - "TagFriend", - "TagImportedDeclaration", - "TagImportedModule", - "TagImportedUnit", - "TagInheritance", - "TagInlinedSubroutine", - "TagInterfaceType", - "TagLabel", - "TagLexDwarfBlock", - "TagMember", - "TagModule", - "TagMutableType", - "TagNamelist", - "TagNamelistItem", - "TagNamespace", - "TagPackedType", - "TagPartialUnit", - "TagPointerType", - "TagPtrToMemberType", - "TagReferenceType", - "TagRestrictType", - "TagRvalueReferenceType", - "TagSetType", - "TagSharedType", - "TagStringType", - "TagStructType", - "TagSubprogram", - "TagSubrangeType", - "TagSubroutineType", - "TagTemplateAlias", - "TagTemplateTypeParameter", - "TagTemplateValueParameter", - "TagThrownType", - "TagTryDwarfBlock", - "TagTypeUnit", - "TagTypedef", - "TagUnionType", - "TagUnspecifiedParameters", - "TagUnspecifiedType", - "TagVariable", - "TagVariant", - "TagVariantPart", - "TagVolatileType", - "TagWithStmt", - "Type", - "TypedefType", - "UcharType", - "UintType", - "UnspecifiedType", - "UnsupportedType", - "VoidType", - }, - "debug/elf": []string{ - "ARM_MAGIC_TRAMP_NUMBER", - "COMPRESS_HIOS", - "COMPRESS_HIPROC", - "COMPRESS_LOOS", - "COMPRESS_LOPROC", - "COMPRESS_ZLIB", - "Chdr32", - "Chdr64", - "Class", - "CompressionType", - "DF_BIND_NOW", - "DF_ORIGIN", - "DF_STATIC_TLS", - "DF_SYMBOLIC", - "DF_TEXTREL", - "DT_BIND_NOW", - "DT_DEBUG", - "DT_ENCODING", - "DT_FINI", - "DT_FINI_ARRAY", - "DT_FINI_ARRAYSZ", - "DT_FLAGS", - "DT_HASH", - "DT_HIOS", - "DT_HIPROC", - "DT_INIT", - "DT_INIT_ARRAY", - "DT_INIT_ARRAYSZ", - "DT_JMPREL", - "DT_LOOS", - "DT_LOPROC", - "DT_NEEDED", - "DT_NULL", - "DT_PLTGOT", - "DT_PLTREL", - "DT_PLTRELSZ", - "DT_PREINIT_ARRAY", - "DT_PREINIT_ARRAYSZ", - "DT_REL", - "DT_RELA", - "DT_RELAENT", - "DT_RELASZ", - "DT_RELENT", - "DT_RELSZ", - "DT_RPATH", - "DT_RUNPATH", - "DT_SONAME", - "DT_STRSZ", - "DT_STRTAB", - "DT_SYMBOLIC", - "DT_SYMENT", - "DT_SYMTAB", - "DT_TEXTREL", - "DT_VERNEED", - "DT_VERNEEDNUM", - "DT_VERSYM", - "Data", - "Dyn32", - "Dyn64", - "DynFlag", - "DynTag", - "EI_ABIVERSION", - "EI_CLASS", - "EI_DATA", - "EI_NIDENT", - "EI_OSABI", - "EI_PAD", - "EI_VERSION", - "ELFCLASS32", - "ELFCLASS64", - "ELFCLASSNONE", - "ELFDATA2LSB", - "ELFDATA2MSB", - "ELFDATANONE", - "ELFMAG", - "ELFOSABI_86OPEN", - "ELFOSABI_AIX", - "ELFOSABI_ARM", - "ELFOSABI_AROS", - "ELFOSABI_CLOUDABI", - "ELFOSABI_FENIXOS", - "ELFOSABI_FREEBSD", - "ELFOSABI_HPUX", - "ELFOSABI_HURD", - "ELFOSABI_IRIX", - "ELFOSABI_LINUX", - "ELFOSABI_MODESTO", - "ELFOSABI_NETBSD", - "ELFOSABI_NONE", - "ELFOSABI_NSK", - "ELFOSABI_OPENBSD", - "ELFOSABI_OPENVMS", - "ELFOSABI_SOLARIS", - "ELFOSABI_STANDALONE", - "ELFOSABI_TRU64", - "EM_386", - "EM_486", - "EM_56800EX", - "EM_68HC05", - "EM_68HC08", - "EM_68HC11", - "EM_68HC12", - "EM_68HC16", - "EM_68K", - "EM_78KOR", - "EM_8051", - "EM_860", - "EM_88K", - "EM_960", - "EM_AARCH64", - "EM_ALPHA", - "EM_ALPHA_STD", - "EM_ALTERA_NIOS2", - "EM_AMDGPU", - "EM_ARC", - "EM_ARCA", - "EM_ARC_COMPACT", - "EM_ARC_COMPACT2", - "EM_ARM", - "EM_AVR", - "EM_AVR32", - "EM_BA1", - "EM_BA2", - "EM_BLACKFIN", - "EM_BPF", - "EM_C166", - "EM_CDP", - "EM_CE", - "EM_CLOUDSHIELD", - "EM_COGE", - "EM_COLDFIRE", - "EM_COOL", - "EM_COREA_1ST", - "EM_COREA_2ND", - "EM_CR", - "EM_CR16", - "EM_CRAYNV2", - "EM_CRIS", - "EM_CRX", - "EM_CSR_KALIMBA", - "EM_CUDA", - "EM_CYPRESS_M8C", - "EM_D10V", - "EM_D30V", - "EM_DSP24", - "EM_DSPIC30F", - "EM_DXP", - "EM_ECOG1", - "EM_ECOG16", - "EM_ECOG1X", - "EM_ECOG2", - "EM_ETPU", - "EM_EXCESS", - "EM_F2MC16", - "EM_FIREPATH", - "EM_FR20", - "EM_FR30", - "EM_FT32", - "EM_FX66", - "EM_H8S", - "EM_H8_300", - "EM_H8_300H", - "EM_H8_500", - "EM_HUANY", - "EM_IA_64", - "EM_INTEL205", - "EM_INTEL206", - "EM_INTEL207", - "EM_INTEL208", - "EM_INTEL209", - "EM_IP2K", - "EM_JAVELIN", - "EM_K10M", - "EM_KM32", - "EM_KMX16", - "EM_KMX32", - "EM_KMX8", - "EM_KVARC", - "EM_L10M", - "EM_LANAI", - "EM_LATTICEMICO32", - "EM_M16C", - "EM_M32", - "EM_M32C", - "EM_M32R", - "EM_MANIK", - "EM_MAX", - "EM_MAXQ30", - "EM_MCHP_PIC", - "EM_MCST_ELBRUS", - "EM_ME16", - "EM_METAG", - "EM_MICROBLAZE", - "EM_MIPS", - "EM_MIPS_RS3_LE", - "EM_MIPS_RS4_BE", - "EM_MIPS_X", - "EM_MMA", - "EM_MMDSP_PLUS", - "EM_MMIX", - "EM_MN10200", - "EM_MN10300", - "EM_MOXIE", - "EM_MSP430", - "EM_NCPU", - "EM_NDR1", - "EM_NDS32", - "EM_NONE", - "EM_NORC", - "EM_NS32K", - "EM_OPEN8", - "EM_OPENRISC", - "EM_PARISC", - "EM_PCP", - "EM_PDP10", - "EM_PDP11", - "EM_PDSP", - "EM_PJ", - "EM_PPC", - "EM_PPC64", - "EM_PRISM", - "EM_QDSP6", - "EM_R32C", - "EM_RCE", - "EM_RH32", - "EM_RISCV", - "EM_RL78", - "EM_RS08", - "EM_RX", - "EM_S370", - "EM_S390", - "EM_SCORE7", - "EM_SEP", - "EM_SE_C17", - "EM_SE_C33", - "EM_SH", - "EM_SHARC", - "EM_SLE9X", - "EM_SNP1K", - "EM_SPARC", - "EM_SPARC32PLUS", - "EM_SPARCV9", - "EM_ST100", - "EM_ST19", - "EM_ST200", - "EM_ST7", - "EM_ST9PLUS", - "EM_STARCORE", - "EM_STM8", - "EM_STXP7X", - "EM_SVX", - "EM_TILE64", - "EM_TILEGX", - "EM_TILEPRO", - "EM_TINYJ", - "EM_TI_ARP32", - "EM_TI_C2000", - "EM_TI_C5500", - "EM_TI_C6000", - "EM_TI_PRU", - "EM_TMM_GPP", - "EM_TPC", - "EM_TRICORE", - "EM_TRIMEDIA", - "EM_TSK3000", - "EM_UNICORE", - "EM_V800", - "EM_V850", - "EM_VAX", - "EM_VIDEOCORE", - "EM_VIDEOCORE3", - "EM_VIDEOCORE5", - "EM_VISIUM", - "EM_VPP500", - "EM_X86_64", - "EM_XCORE", - "EM_XGATE", - "EM_XIMO16", - "EM_XTENSA", - "EM_Z80", - "EM_ZSP", - "ET_CORE", - "ET_DYN", - "ET_EXEC", - "ET_HIOS", - "ET_HIPROC", - "ET_LOOS", - "ET_LOPROC", - "ET_NONE", - "ET_REL", - "EV_CURRENT", - "EV_NONE", - "ErrNoSymbols", - "File", - "FileHeader", - "FormatError", - "Header32", - "Header64", - "ImportedSymbol", - "Machine", - "NT_FPREGSET", - "NT_PRPSINFO", - "NT_PRSTATUS", - "NType", - "NewFile", - "OSABI", - "Open", - "PF_MASKOS", - "PF_MASKPROC", - "PF_R", - "PF_W", - "PF_X", - "PT_DYNAMIC", - "PT_HIOS", - "PT_HIPROC", - "PT_INTERP", - "PT_LOAD", - "PT_LOOS", - "PT_LOPROC", - "PT_NOTE", - "PT_NULL", - "PT_PHDR", - "PT_SHLIB", - "PT_TLS", - "Prog", - "Prog32", - "Prog64", - "ProgFlag", - "ProgHeader", - "ProgType", - "R_386", - "R_386_16", - "R_386_32", - "R_386_32PLT", - "R_386_8", - "R_386_COPY", - "R_386_GLOB_DAT", - "R_386_GOT32", - "R_386_GOT32X", - "R_386_GOTOFF", - "R_386_GOTPC", - "R_386_IRELATIVE", - "R_386_JMP_SLOT", - "R_386_NONE", - "R_386_PC16", - "R_386_PC32", - "R_386_PC8", - "R_386_PLT32", - "R_386_RELATIVE", - "R_386_SIZE32", - "R_386_TLS_DESC", - "R_386_TLS_DESC_CALL", - "R_386_TLS_DTPMOD32", - "R_386_TLS_DTPOFF32", - "R_386_TLS_GD", - "R_386_TLS_GD_32", - "R_386_TLS_GD_CALL", - "R_386_TLS_GD_POP", - "R_386_TLS_GD_PUSH", - "R_386_TLS_GOTDESC", - "R_386_TLS_GOTIE", - "R_386_TLS_IE", - "R_386_TLS_IE_32", - "R_386_TLS_LDM", - "R_386_TLS_LDM_32", - "R_386_TLS_LDM_CALL", - "R_386_TLS_LDM_POP", - "R_386_TLS_LDM_PUSH", - "R_386_TLS_LDO_32", - "R_386_TLS_LE", - "R_386_TLS_LE_32", - "R_386_TLS_TPOFF", - "R_386_TLS_TPOFF32", - "R_390", - "R_390_12", - "R_390_16", - "R_390_20", - "R_390_32", - "R_390_64", - "R_390_8", - "R_390_COPY", - "R_390_GLOB_DAT", - "R_390_GOT12", - "R_390_GOT16", - "R_390_GOT20", - "R_390_GOT32", - "R_390_GOT64", - "R_390_GOTENT", - "R_390_GOTOFF", - "R_390_GOTOFF16", - "R_390_GOTOFF64", - "R_390_GOTPC", - "R_390_GOTPCDBL", - "R_390_GOTPLT12", - "R_390_GOTPLT16", - "R_390_GOTPLT20", - "R_390_GOTPLT32", - "R_390_GOTPLT64", - "R_390_GOTPLTENT", - "R_390_GOTPLTOFF16", - "R_390_GOTPLTOFF32", - "R_390_GOTPLTOFF64", - "R_390_JMP_SLOT", - "R_390_NONE", - "R_390_PC16", - "R_390_PC16DBL", - "R_390_PC32", - "R_390_PC32DBL", - "R_390_PC64", - "R_390_PLT16DBL", - "R_390_PLT32", - "R_390_PLT32DBL", - "R_390_PLT64", - "R_390_RELATIVE", - "R_390_TLS_DTPMOD", - "R_390_TLS_DTPOFF", - "R_390_TLS_GD32", - "R_390_TLS_GD64", - "R_390_TLS_GDCALL", - "R_390_TLS_GOTIE12", - "R_390_TLS_GOTIE20", - "R_390_TLS_GOTIE32", - "R_390_TLS_GOTIE64", - "R_390_TLS_IE32", - "R_390_TLS_IE64", - "R_390_TLS_IEENT", - "R_390_TLS_LDCALL", - "R_390_TLS_LDM32", - "R_390_TLS_LDM64", - "R_390_TLS_LDO32", - "R_390_TLS_LDO64", - "R_390_TLS_LE32", - "R_390_TLS_LE64", - "R_390_TLS_LOAD", - "R_390_TLS_TPOFF", - "R_AARCH64", - "R_AARCH64_ABS16", - "R_AARCH64_ABS32", - "R_AARCH64_ABS64", - "R_AARCH64_ADD_ABS_LO12_NC", - "R_AARCH64_ADR_GOT_PAGE", - "R_AARCH64_ADR_PREL_LO21", - "R_AARCH64_ADR_PREL_PG_HI21", - "R_AARCH64_ADR_PREL_PG_HI21_NC", - "R_AARCH64_CALL26", - "R_AARCH64_CONDBR19", - "R_AARCH64_COPY", - "R_AARCH64_GLOB_DAT", - "R_AARCH64_GOT_LD_PREL19", - "R_AARCH64_IRELATIVE", - "R_AARCH64_JUMP26", - "R_AARCH64_JUMP_SLOT", - "R_AARCH64_LD64_GOTOFF_LO15", - "R_AARCH64_LD64_GOTPAGE_LO15", - "R_AARCH64_LD64_GOT_LO12_NC", - "R_AARCH64_LDST128_ABS_LO12_NC", - "R_AARCH64_LDST16_ABS_LO12_NC", - "R_AARCH64_LDST32_ABS_LO12_NC", - "R_AARCH64_LDST64_ABS_LO12_NC", - "R_AARCH64_LDST8_ABS_LO12_NC", - "R_AARCH64_LD_PREL_LO19", - "R_AARCH64_MOVW_SABS_G0", - "R_AARCH64_MOVW_SABS_G1", - "R_AARCH64_MOVW_SABS_G2", - "R_AARCH64_MOVW_UABS_G0", - "R_AARCH64_MOVW_UABS_G0_NC", - "R_AARCH64_MOVW_UABS_G1", - "R_AARCH64_MOVW_UABS_G1_NC", - "R_AARCH64_MOVW_UABS_G2", - "R_AARCH64_MOVW_UABS_G2_NC", - "R_AARCH64_MOVW_UABS_G3", - "R_AARCH64_NONE", - "R_AARCH64_NULL", - "R_AARCH64_P32_ABS16", - "R_AARCH64_P32_ABS32", - "R_AARCH64_P32_ADD_ABS_LO12_NC", - "R_AARCH64_P32_ADR_GOT_PAGE", - "R_AARCH64_P32_ADR_PREL_LO21", - "R_AARCH64_P32_ADR_PREL_PG_HI21", - "R_AARCH64_P32_CALL26", - "R_AARCH64_P32_CONDBR19", - "R_AARCH64_P32_COPY", - "R_AARCH64_P32_GLOB_DAT", - "R_AARCH64_P32_GOT_LD_PREL19", - "R_AARCH64_P32_IRELATIVE", - "R_AARCH64_P32_JUMP26", - "R_AARCH64_P32_JUMP_SLOT", - "R_AARCH64_P32_LD32_GOT_LO12_NC", - "R_AARCH64_P32_LDST128_ABS_LO12_NC", - "R_AARCH64_P32_LDST16_ABS_LO12_NC", - "R_AARCH64_P32_LDST32_ABS_LO12_NC", - "R_AARCH64_P32_LDST64_ABS_LO12_NC", - "R_AARCH64_P32_LDST8_ABS_LO12_NC", - "R_AARCH64_P32_LD_PREL_LO19", - "R_AARCH64_P32_MOVW_SABS_G0", - "R_AARCH64_P32_MOVW_UABS_G0", - "R_AARCH64_P32_MOVW_UABS_G0_NC", - "R_AARCH64_P32_MOVW_UABS_G1", - "R_AARCH64_P32_PREL16", - "R_AARCH64_P32_PREL32", - "R_AARCH64_P32_RELATIVE", - "R_AARCH64_P32_TLSDESC", - "R_AARCH64_P32_TLSDESC_ADD_LO12_NC", - "R_AARCH64_P32_TLSDESC_ADR_PAGE21", - "R_AARCH64_P32_TLSDESC_ADR_PREL21", - "R_AARCH64_P32_TLSDESC_CALL", - "R_AARCH64_P32_TLSDESC_LD32_LO12_NC", - "R_AARCH64_P32_TLSDESC_LD_PREL19", - "R_AARCH64_P32_TLSGD_ADD_LO12_NC", - "R_AARCH64_P32_TLSGD_ADR_PAGE21", - "R_AARCH64_P32_TLSIE_ADR_GOTTPREL_PAGE21", - "R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC", - "R_AARCH64_P32_TLSIE_LD_GOTTPREL_PREL19", - "R_AARCH64_P32_TLSLE_ADD_TPREL_HI12", - "R_AARCH64_P32_TLSLE_ADD_TPREL_LO12", - "R_AARCH64_P32_TLSLE_ADD_TPREL_LO12_NC", - "R_AARCH64_P32_TLSLE_MOVW_TPREL_G0", - "R_AARCH64_P32_TLSLE_MOVW_TPREL_G0_NC", - "R_AARCH64_P32_TLSLE_MOVW_TPREL_G1", - "R_AARCH64_P32_TLS_DTPMOD", - "R_AARCH64_P32_TLS_DTPREL", - "R_AARCH64_P32_TLS_TPREL", - "R_AARCH64_P32_TSTBR14", - "R_AARCH64_PREL16", - "R_AARCH64_PREL32", - "R_AARCH64_PREL64", - "R_AARCH64_RELATIVE", - "R_AARCH64_TLSDESC", - "R_AARCH64_TLSDESC_ADD", - "R_AARCH64_TLSDESC_ADD_LO12_NC", - "R_AARCH64_TLSDESC_ADR_PAGE21", - "R_AARCH64_TLSDESC_ADR_PREL21", - "R_AARCH64_TLSDESC_CALL", - "R_AARCH64_TLSDESC_LD64_LO12_NC", - "R_AARCH64_TLSDESC_LDR", - "R_AARCH64_TLSDESC_LD_PREL19", - "R_AARCH64_TLSDESC_OFF_G0_NC", - "R_AARCH64_TLSDESC_OFF_G1", - "R_AARCH64_TLSGD_ADD_LO12_NC", - "R_AARCH64_TLSGD_ADR_PAGE21", - "R_AARCH64_TLSGD_ADR_PREL21", - "R_AARCH64_TLSGD_MOVW_G0_NC", - "R_AARCH64_TLSGD_MOVW_G1", - "R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21", - "R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC", - "R_AARCH64_TLSIE_LD_GOTTPREL_PREL19", - "R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC", - "R_AARCH64_TLSIE_MOVW_GOTTPREL_G1", - "R_AARCH64_TLSLD_ADR_PAGE21", - "R_AARCH64_TLSLD_ADR_PREL21", - "R_AARCH64_TLSLD_LDST128_DTPREL_LO12", - "R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC", - "R_AARCH64_TLSLE_ADD_TPREL_HI12", - "R_AARCH64_TLSLE_ADD_TPREL_LO12", - "R_AARCH64_TLSLE_ADD_TPREL_LO12_NC", - "R_AARCH64_TLSLE_LDST128_TPREL_LO12", - "R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC", - "R_AARCH64_TLSLE_MOVW_TPREL_G0", - "R_AARCH64_TLSLE_MOVW_TPREL_G0_NC", - "R_AARCH64_TLSLE_MOVW_TPREL_G1", - "R_AARCH64_TLSLE_MOVW_TPREL_G1_NC", - "R_AARCH64_TLSLE_MOVW_TPREL_G2", - "R_AARCH64_TLS_DTPMOD64", - "R_AARCH64_TLS_DTPREL64", - "R_AARCH64_TLS_TPREL64", - "R_AARCH64_TSTBR14", - "R_ALPHA", - "R_ALPHA_BRADDR", - "R_ALPHA_COPY", - "R_ALPHA_GLOB_DAT", - "R_ALPHA_GPDISP", - "R_ALPHA_GPREL32", - "R_ALPHA_GPRELHIGH", - "R_ALPHA_GPRELLOW", - "R_ALPHA_GPVALUE", - "R_ALPHA_HINT", - "R_ALPHA_IMMED_BR_HI32", - "R_ALPHA_IMMED_GP_16", - "R_ALPHA_IMMED_GP_HI32", - "R_ALPHA_IMMED_LO32", - "R_ALPHA_IMMED_SCN_HI32", - "R_ALPHA_JMP_SLOT", - "R_ALPHA_LITERAL", - "R_ALPHA_LITUSE", - "R_ALPHA_NONE", - "R_ALPHA_OP_PRSHIFT", - "R_ALPHA_OP_PSUB", - "R_ALPHA_OP_PUSH", - "R_ALPHA_OP_STORE", - "R_ALPHA_REFLONG", - "R_ALPHA_REFQUAD", - "R_ALPHA_RELATIVE", - "R_ALPHA_SREL16", - "R_ALPHA_SREL32", - "R_ALPHA_SREL64", - "R_ARM", - "R_ARM_ABS12", - "R_ARM_ABS16", - "R_ARM_ABS32", - "R_ARM_ABS32_NOI", - "R_ARM_ABS8", - "R_ARM_ALU_PCREL_15_8", - "R_ARM_ALU_PCREL_23_15", - "R_ARM_ALU_PCREL_7_0", - "R_ARM_ALU_PC_G0", - "R_ARM_ALU_PC_G0_NC", - "R_ARM_ALU_PC_G1", - "R_ARM_ALU_PC_G1_NC", - "R_ARM_ALU_PC_G2", - "R_ARM_ALU_SBREL_19_12_NC", - "R_ARM_ALU_SBREL_27_20_CK", - "R_ARM_ALU_SB_G0", - "R_ARM_ALU_SB_G0_NC", - "R_ARM_ALU_SB_G1", - "R_ARM_ALU_SB_G1_NC", - "R_ARM_ALU_SB_G2", - "R_ARM_AMP_VCALL9", - "R_ARM_BASE_ABS", - "R_ARM_CALL", - "R_ARM_COPY", - "R_ARM_GLOB_DAT", - "R_ARM_GNU_VTENTRY", - "R_ARM_GNU_VTINHERIT", - "R_ARM_GOT32", - "R_ARM_GOTOFF", - "R_ARM_GOTOFF12", - "R_ARM_GOTPC", - "R_ARM_GOTRELAX", - "R_ARM_GOT_ABS", - "R_ARM_GOT_BREL12", - "R_ARM_GOT_PREL", - "R_ARM_IRELATIVE", - "R_ARM_JUMP24", - "R_ARM_JUMP_SLOT", - "R_ARM_LDC_PC_G0", - "R_ARM_LDC_PC_G1", - "R_ARM_LDC_PC_G2", - "R_ARM_LDC_SB_G0", - "R_ARM_LDC_SB_G1", - "R_ARM_LDC_SB_G2", - "R_ARM_LDRS_PC_G0", - "R_ARM_LDRS_PC_G1", - "R_ARM_LDRS_PC_G2", - "R_ARM_LDRS_SB_G0", - "R_ARM_LDRS_SB_G1", - "R_ARM_LDRS_SB_G2", - "R_ARM_LDR_PC_G1", - "R_ARM_LDR_PC_G2", - "R_ARM_LDR_SBREL_11_10_NC", - "R_ARM_LDR_SB_G0", - "R_ARM_LDR_SB_G1", - "R_ARM_LDR_SB_G2", - "R_ARM_ME_TOO", - "R_ARM_MOVT_ABS", - "R_ARM_MOVT_BREL", - "R_ARM_MOVT_PREL", - "R_ARM_MOVW_ABS_NC", - "R_ARM_MOVW_BREL", - "R_ARM_MOVW_BREL_NC", - "R_ARM_MOVW_PREL_NC", - "R_ARM_NONE", - "R_ARM_PC13", - "R_ARM_PC24", - "R_ARM_PLT32", - "R_ARM_PLT32_ABS", - "R_ARM_PREL31", - "R_ARM_PRIVATE_0", - "R_ARM_PRIVATE_1", - "R_ARM_PRIVATE_10", - "R_ARM_PRIVATE_11", - "R_ARM_PRIVATE_12", - "R_ARM_PRIVATE_13", - "R_ARM_PRIVATE_14", - "R_ARM_PRIVATE_15", - "R_ARM_PRIVATE_2", - "R_ARM_PRIVATE_3", - "R_ARM_PRIVATE_4", - "R_ARM_PRIVATE_5", - "R_ARM_PRIVATE_6", - "R_ARM_PRIVATE_7", - "R_ARM_PRIVATE_8", - "R_ARM_PRIVATE_9", - "R_ARM_RABS32", - "R_ARM_RBASE", - "R_ARM_REL32", - "R_ARM_REL32_NOI", - "R_ARM_RELATIVE", - "R_ARM_RPC24", - "R_ARM_RREL32", - "R_ARM_RSBREL32", - "R_ARM_RXPC25", - "R_ARM_SBREL31", - "R_ARM_SBREL32", - "R_ARM_SWI24", - "R_ARM_TARGET1", - "R_ARM_TARGET2", - "R_ARM_THM_ABS5", - "R_ARM_THM_ALU_ABS_G0_NC", - "R_ARM_THM_ALU_ABS_G1_NC", - "R_ARM_THM_ALU_ABS_G2_NC", - "R_ARM_THM_ALU_ABS_G3", - "R_ARM_THM_ALU_PREL_11_0", - "R_ARM_THM_GOT_BREL12", - "R_ARM_THM_JUMP11", - "R_ARM_THM_JUMP19", - "R_ARM_THM_JUMP24", - "R_ARM_THM_JUMP6", - "R_ARM_THM_JUMP8", - "R_ARM_THM_MOVT_ABS", - "R_ARM_THM_MOVT_BREL", - "R_ARM_THM_MOVT_PREL", - "R_ARM_THM_MOVW_ABS_NC", - "R_ARM_THM_MOVW_BREL", - "R_ARM_THM_MOVW_BREL_NC", - "R_ARM_THM_MOVW_PREL_NC", - "R_ARM_THM_PC12", - "R_ARM_THM_PC22", - "R_ARM_THM_PC8", - "R_ARM_THM_RPC22", - "R_ARM_THM_SWI8", - "R_ARM_THM_TLS_CALL", - "R_ARM_THM_TLS_DESCSEQ16", - "R_ARM_THM_TLS_DESCSEQ32", - "R_ARM_THM_XPC22", - "R_ARM_TLS_CALL", - "R_ARM_TLS_DESCSEQ", - "R_ARM_TLS_DTPMOD32", - "R_ARM_TLS_DTPOFF32", - "R_ARM_TLS_GD32", - "R_ARM_TLS_GOTDESC", - "R_ARM_TLS_IE12GP", - "R_ARM_TLS_IE32", - "R_ARM_TLS_LDM32", - "R_ARM_TLS_LDO12", - "R_ARM_TLS_LDO32", - "R_ARM_TLS_LE12", - "R_ARM_TLS_LE32", - "R_ARM_TLS_TPOFF32", - "R_ARM_V4BX", - "R_ARM_XPC25", - "R_INFO", - "R_INFO32", - "R_MIPS", - "R_MIPS_16", - "R_MIPS_26", - "R_MIPS_32", - "R_MIPS_64", - "R_MIPS_ADD_IMMEDIATE", - "R_MIPS_CALL16", - "R_MIPS_CALL_HI16", - "R_MIPS_CALL_LO16", - "R_MIPS_DELETE", - "R_MIPS_GOT16", - "R_MIPS_GOT_DISP", - "R_MIPS_GOT_HI16", - "R_MIPS_GOT_LO16", - "R_MIPS_GOT_OFST", - "R_MIPS_GOT_PAGE", - "R_MIPS_GPREL16", - "R_MIPS_GPREL32", - "R_MIPS_HI16", - "R_MIPS_HIGHER", - "R_MIPS_HIGHEST", - "R_MIPS_INSERT_A", - "R_MIPS_INSERT_B", - "R_MIPS_JALR", - "R_MIPS_LITERAL", - "R_MIPS_LO16", - "R_MIPS_NONE", - "R_MIPS_PC16", - "R_MIPS_PJUMP", - "R_MIPS_REL16", - "R_MIPS_REL32", - "R_MIPS_RELGOT", - "R_MIPS_SCN_DISP", - "R_MIPS_SHIFT5", - "R_MIPS_SHIFT6", - "R_MIPS_SUB", - "R_MIPS_TLS_DTPMOD32", - "R_MIPS_TLS_DTPMOD64", - "R_MIPS_TLS_DTPREL32", - "R_MIPS_TLS_DTPREL64", - "R_MIPS_TLS_DTPREL_HI16", - "R_MIPS_TLS_DTPREL_LO16", - "R_MIPS_TLS_GD", - "R_MIPS_TLS_GOTTPREL", - "R_MIPS_TLS_LDM", - "R_MIPS_TLS_TPREL32", - "R_MIPS_TLS_TPREL64", - "R_MIPS_TLS_TPREL_HI16", - "R_MIPS_TLS_TPREL_LO16", - "R_PPC", - "R_PPC64", - "R_PPC64_ADDR14", - "R_PPC64_ADDR14_BRNTAKEN", - "R_PPC64_ADDR14_BRTAKEN", - "R_PPC64_ADDR16", - "R_PPC64_ADDR16_DS", - "R_PPC64_ADDR16_HA", - "R_PPC64_ADDR16_HI", - "R_PPC64_ADDR16_HIGH", - "R_PPC64_ADDR16_HIGHA", - "R_PPC64_ADDR16_HIGHER", - "R_PPC64_ADDR16_HIGHERA", - "R_PPC64_ADDR16_HIGHEST", - "R_PPC64_ADDR16_HIGHESTA", - "R_PPC64_ADDR16_LO", - "R_PPC64_ADDR16_LO_DS", - "R_PPC64_ADDR24", - "R_PPC64_ADDR32", - "R_PPC64_ADDR64", - "R_PPC64_ADDR64_LOCAL", - "R_PPC64_DTPMOD64", - "R_PPC64_DTPREL16", - "R_PPC64_DTPREL16_DS", - "R_PPC64_DTPREL16_HA", - "R_PPC64_DTPREL16_HI", - "R_PPC64_DTPREL16_HIGH", - "R_PPC64_DTPREL16_HIGHA", - "R_PPC64_DTPREL16_HIGHER", - "R_PPC64_DTPREL16_HIGHERA", - "R_PPC64_DTPREL16_HIGHEST", - "R_PPC64_DTPREL16_HIGHESTA", - "R_PPC64_DTPREL16_LO", - "R_PPC64_DTPREL16_LO_DS", - "R_PPC64_DTPREL64", - "R_PPC64_ENTRY", - "R_PPC64_GOT16", - "R_PPC64_GOT16_DS", - "R_PPC64_GOT16_HA", - "R_PPC64_GOT16_HI", - "R_PPC64_GOT16_LO", - "R_PPC64_GOT16_LO_DS", - "R_PPC64_GOT_DTPREL16_DS", - "R_PPC64_GOT_DTPREL16_HA", - "R_PPC64_GOT_DTPREL16_HI", - "R_PPC64_GOT_DTPREL16_LO_DS", - "R_PPC64_GOT_TLSGD16", - "R_PPC64_GOT_TLSGD16_HA", - "R_PPC64_GOT_TLSGD16_HI", - "R_PPC64_GOT_TLSGD16_LO", - "R_PPC64_GOT_TLSLD16", - "R_PPC64_GOT_TLSLD16_HA", - "R_PPC64_GOT_TLSLD16_HI", - "R_PPC64_GOT_TLSLD16_LO", - "R_PPC64_GOT_TPREL16_DS", - "R_PPC64_GOT_TPREL16_HA", - "R_PPC64_GOT_TPREL16_HI", - "R_PPC64_GOT_TPREL16_LO_DS", - "R_PPC64_IRELATIVE", - "R_PPC64_JMP_IREL", - "R_PPC64_JMP_SLOT", - "R_PPC64_NONE", - "R_PPC64_PLT16_LO_DS", - "R_PPC64_PLTGOT16", - "R_PPC64_PLTGOT16_DS", - "R_PPC64_PLTGOT16_HA", - "R_PPC64_PLTGOT16_HI", - "R_PPC64_PLTGOT16_LO", - "R_PPC64_PLTGOT_LO_DS", - "R_PPC64_REL14", - "R_PPC64_REL14_BRNTAKEN", - "R_PPC64_REL14_BRTAKEN", - "R_PPC64_REL16", - "R_PPC64_REL16DX_HA", - "R_PPC64_REL16_HA", - "R_PPC64_REL16_HI", - "R_PPC64_REL16_LO", - "R_PPC64_REL24", - "R_PPC64_REL24_NOTOC", - "R_PPC64_REL32", - "R_PPC64_REL64", - "R_PPC64_SECTOFF_DS", - "R_PPC64_SECTOFF_LO_DS", - "R_PPC64_TLS", - "R_PPC64_TLSGD", - "R_PPC64_TLSLD", - "R_PPC64_TOC", - "R_PPC64_TOC16", - "R_PPC64_TOC16_DS", - "R_PPC64_TOC16_HA", - "R_PPC64_TOC16_HI", - "R_PPC64_TOC16_LO", - "R_PPC64_TOC16_LO_DS", - "R_PPC64_TOCSAVE", - "R_PPC64_TPREL16", - "R_PPC64_TPREL16_DS", - "R_PPC64_TPREL16_HA", - "R_PPC64_TPREL16_HI", - "R_PPC64_TPREL16_HIGH", - "R_PPC64_TPREL16_HIGHA", - "R_PPC64_TPREL16_HIGHER", - "R_PPC64_TPREL16_HIGHERA", - "R_PPC64_TPREL16_HIGHEST", - "R_PPC64_TPREL16_HIGHESTA", - "R_PPC64_TPREL16_LO", - "R_PPC64_TPREL16_LO_DS", - "R_PPC64_TPREL64", - "R_PPC_ADDR14", - "R_PPC_ADDR14_BRNTAKEN", - "R_PPC_ADDR14_BRTAKEN", - "R_PPC_ADDR16", - "R_PPC_ADDR16_HA", - "R_PPC_ADDR16_HI", - "R_PPC_ADDR16_LO", - "R_PPC_ADDR24", - "R_PPC_ADDR32", - "R_PPC_COPY", - "R_PPC_DTPMOD32", - "R_PPC_DTPREL16", - "R_PPC_DTPREL16_HA", - "R_PPC_DTPREL16_HI", - "R_PPC_DTPREL16_LO", - "R_PPC_DTPREL32", - "R_PPC_EMB_BIT_FLD", - "R_PPC_EMB_MRKREF", - "R_PPC_EMB_NADDR16", - "R_PPC_EMB_NADDR16_HA", - "R_PPC_EMB_NADDR16_HI", - "R_PPC_EMB_NADDR16_LO", - "R_PPC_EMB_NADDR32", - "R_PPC_EMB_RELSDA", - "R_PPC_EMB_RELSEC16", - "R_PPC_EMB_RELST_HA", - "R_PPC_EMB_RELST_HI", - "R_PPC_EMB_RELST_LO", - "R_PPC_EMB_SDA21", - "R_PPC_EMB_SDA2I16", - "R_PPC_EMB_SDA2REL", - "R_PPC_EMB_SDAI16", - "R_PPC_GLOB_DAT", - "R_PPC_GOT16", - "R_PPC_GOT16_HA", - "R_PPC_GOT16_HI", - "R_PPC_GOT16_LO", - "R_PPC_GOT_TLSGD16", - "R_PPC_GOT_TLSGD16_HA", - "R_PPC_GOT_TLSGD16_HI", - "R_PPC_GOT_TLSGD16_LO", - "R_PPC_GOT_TLSLD16", - "R_PPC_GOT_TLSLD16_HA", - "R_PPC_GOT_TLSLD16_HI", - "R_PPC_GOT_TLSLD16_LO", - "R_PPC_GOT_TPREL16", - "R_PPC_GOT_TPREL16_HA", - "R_PPC_GOT_TPREL16_HI", - "R_PPC_GOT_TPREL16_LO", - "R_PPC_JMP_SLOT", - "R_PPC_LOCAL24PC", - "R_PPC_NONE", - "R_PPC_PLT16_HA", - "R_PPC_PLT16_HI", - "R_PPC_PLT16_LO", - "R_PPC_PLT32", - "R_PPC_PLTREL24", - "R_PPC_PLTREL32", - "R_PPC_REL14", - "R_PPC_REL14_BRNTAKEN", - "R_PPC_REL14_BRTAKEN", - "R_PPC_REL24", - "R_PPC_REL32", - "R_PPC_RELATIVE", - "R_PPC_SDAREL16", - "R_PPC_SECTOFF", - "R_PPC_SECTOFF_HA", - "R_PPC_SECTOFF_HI", - "R_PPC_SECTOFF_LO", - "R_PPC_TLS", - "R_PPC_TPREL16", - "R_PPC_TPREL16_HA", - "R_PPC_TPREL16_HI", - "R_PPC_TPREL16_LO", - "R_PPC_TPREL32", - "R_PPC_UADDR16", - "R_PPC_UADDR32", - "R_RISCV", - "R_RISCV_32", - "R_RISCV_32_PCREL", - "R_RISCV_64", - "R_RISCV_ADD16", - "R_RISCV_ADD32", - "R_RISCV_ADD64", - "R_RISCV_ADD8", - "R_RISCV_ALIGN", - "R_RISCV_BRANCH", - "R_RISCV_CALL", - "R_RISCV_CALL_PLT", - "R_RISCV_COPY", - "R_RISCV_GNU_VTENTRY", - "R_RISCV_GNU_VTINHERIT", - "R_RISCV_GOT_HI20", - "R_RISCV_GPREL_I", - "R_RISCV_GPREL_S", - "R_RISCV_HI20", - "R_RISCV_JAL", - "R_RISCV_JUMP_SLOT", - "R_RISCV_LO12_I", - "R_RISCV_LO12_S", - "R_RISCV_NONE", - "R_RISCV_PCREL_HI20", - "R_RISCV_PCREL_LO12_I", - "R_RISCV_PCREL_LO12_S", - "R_RISCV_RELATIVE", - "R_RISCV_RELAX", - "R_RISCV_RVC_BRANCH", - "R_RISCV_RVC_JUMP", - "R_RISCV_RVC_LUI", - "R_RISCV_SET16", - "R_RISCV_SET32", - "R_RISCV_SET6", - "R_RISCV_SET8", - "R_RISCV_SUB16", - "R_RISCV_SUB32", - "R_RISCV_SUB6", - "R_RISCV_SUB64", - "R_RISCV_SUB8", - "R_RISCV_TLS_DTPMOD32", - "R_RISCV_TLS_DTPMOD64", - "R_RISCV_TLS_DTPREL32", - "R_RISCV_TLS_DTPREL64", - "R_RISCV_TLS_GD_HI20", - "R_RISCV_TLS_GOT_HI20", - "R_RISCV_TLS_TPREL32", - "R_RISCV_TLS_TPREL64", - "R_RISCV_TPREL_ADD", - "R_RISCV_TPREL_HI20", - "R_RISCV_TPREL_I", - "R_RISCV_TPREL_LO12_I", - "R_RISCV_TPREL_LO12_S", - "R_RISCV_TPREL_S", - "R_SPARC", - "R_SPARC_10", - "R_SPARC_11", - "R_SPARC_13", - "R_SPARC_16", - "R_SPARC_22", - "R_SPARC_32", - "R_SPARC_5", - "R_SPARC_6", - "R_SPARC_64", - "R_SPARC_7", - "R_SPARC_8", - "R_SPARC_COPY", - "R_SPARC_DISP16", - "R_SPARC_DISP32", - "R_SPARC_DISP64", - "R_SPARC_DISP8", - "R_SPARC_GLOB_DAT", - "R_SPARC_GLOB_JMP", - "R_SPARC_GOT10", - "R_SPARC_GOT13", - "R_SPARC_GOT22", - "R_SPARC_H44", - "R_SPARC_HH22", - "R_SPARC_HI22", - "R_SPARC_HIPLT22", - "R_SPARC_HIX22", - "R_SPARC_HM10", - "R_SPARC_JMP_SLOT", - "R_SPARC_L44", - "R_SPARC_LM22", - "R_SPARC_LO10", - "R_SPARC_LOPLT10", - "R_SPARC_LOX10", - "R_SPARC_M44", - "R_SPARC_NONE", - "R_SPARC_OLO10", - "R_SPARC_PC10", - "R_SPARC_PC22", - "R_SPARC_PCPLT10", - "R_SPARC_PCPLT22", - "R_SPARC_PCPLT32", - "R_SPARC_PC_HH22", - "R_SPARC_PC_HM10", - "R_SPARC_PC_LM22", - "R_SPARC_PLT32", - "R_SPARC_PLT64", - "R_SPARC_REGISTER", - "R_SPARC_RELATIVE", - "R_SPARC_UA16", - "R_SPARC_UA32", - "R_SPARC_UA64", - "R_SPARC_WDISP16", - "R_SPARC_WDISP19", - "R_SPARC_WDISP22", - "R_SPARC_WDISP30", - "R_SPARC_WPLT30", - "R_SYM32", - "R_SYM64", - "R_TYPE32", - "R_TYPE64", - "R_X86_64", - "R_X86_64_16", - "R_X86_64_32", - "R_X86_64_32S", - "R_X86_64_64", - "R_X86_64_8", - "R_X86_64_COPY", - "R_X86_64_DTPMOD64", - "R_X86_64_DTPOFF32", - "R_X86_64_DTPOFF64", - "R_X86_64_GLOB_DAT", - "R_X86_64_GOT32", - "R_X86_64_GOT64", - "R_X86_64_GOTOFF64", - "R_X86_64_GOTPC32", - "R_X86_64_GOTPC32_TLSDESC", - "R_X86_64_GOTPC64", - "R_X86_64_GOTPCREL", - "R_X86_64_GOTPCREL64", - "R_X86_64_GOTPCRELX", - "R_X86_64_GOTPLT64", - "R_X86_64_GOTTPOFF", - "R_X86_64_IRELATIVE", - "R_X86_64_JMP_SLOT", - "R_X86_64_NONE", - "R_X86_64_PC16", - "R_X86_64_PC32", - "R_X86_64_PC32_BND", - "R_X86_64_PC64", - "R_X86_64_PC8", - "R_X86_64_PLT32", - "R_X86_64_PLT32_BND", - "R_X86_64_PLTOFF64", - "R_X86_64_RELATIVE", - "R_X86_64_RELATIVE64", - "R_X86_64_REX_GOTPCRELX", - "R_X86_64_SIZE32", - "R_X86_64_SIZE64", - "R_X86_64_TLSDESC", - "R_X86_64_TLSDESC_CALL", - "R_X86_64_TLSGD", - "R_X86_64_TLSLD", - "R_X86_64_TPOFF32", - "R_X86_64_TPOFF64", - "Rel32", - "Rel64", - "Rela32", - "Rela64", - "SHF_ALLOC", - "SHF_COMPRESSED", - "SHF_EXECINSTR", - "SHF_GROUP", - "SHF_INFO_LINK", - "SHF_LINK_ORDER", - "SHF_MASKOS", - "SHF_MASKPROC", - "SHF_MERGE", - "SHF_OS_NONCONFORMING", - "SHF_STRINGS", - "SHF_TLS", - "SHF_WRITE", - "SHN_ABS", - "SHN_COMMON", - "SHN_HIOS", - "SHN_HIPROC", - "SHN_HIRESERVE", - "SHN_LOOS", - "SHN_LOPROC", - "SHN_LORESERVE", - "SHN_UNDEF", - "SHN_XINDEX", - "SHT_DYNAMIC", - "SHT_DYNSYM", - "SHT_FINI_ARRAY", - "SHT_GNU_ATTRIBUTES", - "SHT_GNU_HASH", - "SHT_GNU_LIBLIST", - "SHT_GNU_VERDEF", - "SHT_GNU_VERNEED", - "SHT_GNU_VERSYM", - "SHT_GROUP", - "SHT_HASH", - "SHT_HIOS", - "SHT_HIPROC", - "SHT_HIUSER", - "SHT_INIT_ARRAY", - "SHT_LOOS", - "SHT_LOPROC", - "SHT_LOUSER", - "SHT_NOBITS", - "SHT_NOTE", - "SHT_NULL", - "SHT_PREINIT_ARRAY", - "SHT_PROGBITS", - "SHT_REL", - "SHT_RELA", - "SHT_SHLIB", - "SHT_STRTAB", - "SHT_SYMTAB", - "SHT_SYMTAB_SHNDX", - "STB_GLOBAL", - "STB_HIOS", - "STB_HIPROC", - "STB_LOCAL", - "STB_LOOS", - "STB_LOPROC", - "STB_WEAK", - "STT_COMMON", - "STT_FILE", - "STT_FUNC", - "STT_HIOS", - "STT_HIPROC", - "STT_LOOS", - "STT_LOPROC", - "STT_NOTYPE", - "STT_OBJECT", - "STT_SECTION", - "STT_TLS", - "STV_DEFAULT", - "STV_HIDDEN", - "STV_INTERNAL", - "STV_PROTECTED", - "ST_BIND", - "ST_INFO", - "ST_TYPE", - "ST_VISIBILITY", - "Section", - "Section32", - "Section64", - "SectionFlag", - "SectionHeader", - "SectionIndex", - "SectionType", - "Sym32", - "Sym32Size", - "Sym64", - "Sym64Size", - "SymBind", - "SymType", - "SymVis", - "Symbol", - "Type", - "Version", - }, - "debug/gosym": []string{ - "DecodingError", - "Func", - "LineTable", - "NewLineTable", - "NewTable", - "Obj", - "Sym", - "Table", - "UnknownFileError", - "UnknownLineError", - }, - "debug/macho": []string{ - "ARM64_RELOC_ADDEND", - "ARM64_RELOC_BRANCH26", - "ARM64_RELOC_GOT_LOAD_PAGE21", - "ARM64_RELOC_GOT_LOAD_PAGEOFF12", - "ARM64_RELOC_PAGE21", - "ARM64_RELOC_PAGEOFF12", - "ARM64_RELOC_POINTER_TO_GOT", - "ARM64_RELOC_SUBTRACTOR", - "ARM64_RELOC_TLVP_LOAD_PAGE21", - "ARM64_RELOC_TLVP_LOAD_PAGEOFF12", - "ARM64_RELOC_UNSIGNED", - "ARM_RELOC_BR24", - "ARM_RELOC_HALF", - "ARM_RELOC_HALF_SECTDIFF", - "ARM_RELOC_LOCAL_SECTDIFF", - "ARM_RELOC_PAIR", - "ARM_RELOC_PB_LA_PTR", - "ARM_RELOC_SECTDIFF", - "ARM_RELOC_VANILLA", - "ARM_THUMB_32BIT_BRANCH", - "ARM_THUMB_RELOC_BR22", - "Cpu", - "Cpu386", - "CpuAmd64", - "CpuArm", - "CpuArm64", - "CpuPpc", - "CpuPpc64", - "Dylib", - "DylibCmd", - "Dysymtab", - "DysymtabCmd", - "ErrNotFat", - "FatArch", - "FatArchHeader", - "FatFile", - "File", - "FileHeader", - "FlagAllModsBound", - "FlagAllowStackExecution", - "FlagAppExtensionSafe", - "FlagBindAtLoad", - "FlagBindsToWeak", - "FlagCanonical", - "FlagDeadStrippableDylib", - "FlagDyldLink", - "FlagForceFlat", - "FlagHasTLVDescriptors", - "FlagIncrLink", - "FlagLazyInit", - "FlagNoFixPrebinding", - "FlagNoHeapExecution", - "FlagNoMultiDefs", - "FlagNoReexportedDylibs", - "FlagNoUndefs", - "FlagPIE", - "FlagPrebindable", - "FlagPrebound", - "FlagRootSafe", - "FlagSetuidSafe", - "FlagSplitSegs", - "FlagSubsectionsViaSymbols", - "FlagTwoLevel", - "FlagWeakDefines", - "FormatError", - "GENERIC_RELOC_LOCAL_SECTDIFF", - "GENERIC_RELOC_PAIR", - "GENERIC_RELOC_PB_LA_PTR", - "GENERIC_RELOC_SECTDIFF", - "GENERIC_RELOC_TLV", - "GENERIC_RELOC_VANILLA", - "Load", - "LoadBytes", - "LoadCmd", - "LoadCmdDylib", - "LoadCmdDylinker", - "LoadCmdDysymtab", - "LoadCmdRpath", - "LoadCmdSegment", - "LoadCmdSegment64", - "LoadCmdSymtab", - "LoadCmdThread", - "LoadCmdUnixThread", - "Magic32", - "Magic64", - "MagicFat", - "NewFatFile", - "NewFile", - "Nlist32", - "Nlist64", - "Open", - "OpenFat", - "Regs386", - "RegsAMD64", - "Reloc", - "RelocTypeARM", - "RelocTypeARM64", - "RelocTypeGeneric", - "RelocTypeX86_64", - "Rpath", - "RpathCmd", - "Section", - "Section32", - "Section64", - "SectionHeader", - "Segment", - "Segment32", - "Segment64", - "SegmentHeader", - "Symbol", - "Symtab", - "SymtabCmd", - "Thread", - "Type", - "TypeBundle", - "TypeDylib", - "TypeExec", - "TypeObj", - "X86_64_RELOC_BRANCH", - "X86_64_RELOC_GOT", - "X86_64_RELOC_GOT_LOAD", - "X86_64_RELOC_SIGNED", - "X86_64_RELOC_SIGNED_1", - "X86_64_RELOC_SIGNED_2", - "X86_64_RELOC_SIGNED_4", - "X86_64_RELOC_SUBTRACTOR", - "X86_64_RELOC_TLV", - "X86_64_RELOC_UNSIGNED", - }, - "debug/pe": []string{ - "COFFSymbol", - "COFFSymbolSize", - "DataDirectory", - "File", - "FileHeader", - "FormatError", - "IMAGE_DIRECTORY_ENTRY_ARCHITECTURE", - "IMAGE_DIRECTORY_ENTRY_BASERELOC", - "IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT", - "IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR", - "IMAGE_DIRECTORY_ENTRY_DEBUG", - "IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT", - "IMAGE_DIRECTORY_ENTRY_EXCEPTION", - "IMAGE_DIRECTORY_ENTRY_EXPORT", - "IMAGE_DIRECTORY_ENTRY_GLOBALPTR", - "IMAGE_DIRECTORY_ENTRY_IAT", - "IMAGE_DIRECTORY_ENTRY_IMPORT", - "IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG", - "IMAGE_DIRECTORY_ENTRY_RESOURCE", - "IMAGE_DIRECTORY_ENTRY_SECURITY", - "IMAGE_DIRECTORY_ENTRY_TLS", - "IMAGE_FILE_MACHINE_AM33", - "IMAGE_FILE_MACHINE_AMD64", - "IMAGE_FILE_MACHINE_ARM", - "IMAGE_FILE_MACHINE_ARM64", - "IMAGE_FILE_MACHINE_ARMNT", - "IMAGE_FILE_MACHINE_EBC", - "IMAGE_FILE_MACHINE_I386", - "IMAGE_FILE_MACHINE_IA64", - "IMAGE_FILE_MACHINE_M32R", - "IMAGE_FILE_MACHINE_MIPS16", - "IMAGE_FILE_MACHINE_MIPSFPU", - "IMAGE_FILE_MACHINE_MIPSFPU16", - "IMAGE_FILE_MACHINE_POWERPC", - "IMAGE_FILE_MACHINE_POWERPCFP", - "IMAGE_FILE_MACHINE_R4000", - "IMAGE_FILE_MACHINE_SH3", - "IMAGE_FILE_MACHINE_SH3DSP", - "IMAGE_FILE_MACHINE_SH4", - "IMAGE_FILE_MACHINE_SH5", - "IMAGE_FILE_MACHINE_THUMB", - "IMAGE_FILE_MACHINE_UNKNOWN", - "IMAGE_FILE_MACHINE_WCEMIPSV2", - "ImportDirectory", - "NewFile", - "Open", - "OptionalHeader32", - "OptionalHeader64", - "Reloc", - "Section", - "SectionHeader", - "SectionHeader32", - "StringTable", - "Symbol", - }, - "debug/plan9obj": []string{ - "File", - "FileHeader", - "Magic386", - "Magic64", - "MagicAMD64", - "MagicARM", - "NewFile", - "Open", - "Section", - "SectionHeader", - "Sym", - }, - "encoding": []string{ - "BinaryMarshaler", - "BinaryUnmarshaler", - "TextMarshaler", - "TextUnmarshaler", - }, - "encoding/ascii85": []string{ - "CorruptInputError", - "Decode", - "Encode", - "MaxEncodedLen", - "NewDecoder", - "NewEncoder", - }, - "encoding/asn1": []string{ - "BitString", - "ClassApplication", - "ClassContextSpecific", - "ClassPrivate", - "ClassUniversal", - "Enumerated", - "Flag", - "Marshal", - "MarshalWithParams", - "NullBytes", - "NullRawValue", - "ObjectIdentifier", - "RawContent", - "RawValue", - "StructuralError", - "SyntaxError", - "TagBitString", - "TagBoolean", - "TagEnum", - "TagGeneralString", - "TagGeneralizedTime", - "TagIA5String", - "TagInteger", - "TagNull", - "TagNumericString", - "TagOID", - "TagOctetString", - "TagPrintableString", - "TagSequence", - "TagSet", - "TagT61String", - "TagUTCTime", - "TagUTF8String", - "Unmarshal", - "UnmarshalWithParams", - }, - "encoding/base32": []string{ - "CorruptInputError", - "Encoding", - "HexEncoding", - "NewDecoder", - "NewEncoder", - "NewEncoding", - "NoPadding", - "StdEncoding", - "StdPadding", - }, - "encoding/base64": []string{ - "CorruptInputError", - "Encoding", - "NewDecoder", - "NewEncoder", - "NewEncoding", - "NoPadding", - "RawStdEncoding", - "RawURLEncoding", - "StdEncoding", - "StdPadding", - "URLEncoding", - }, - "encoding/binary": []string{ - "BigEndian", - "ByteOrder", - "LittleEndian", - "MaxVarintLen16", - "MaxVarintLen32", - "MaxVarintLen64", - "PutUvarint", - "PutVarint", - "Read", - "ReadUvarint", - "ReadVarint", - "Size", - "Uvarint", - "Varint", - "Write", - }, - "encoding/csv": []string{ - "ErrBareQuote", - "ErrFieldCount", - "ErrQuote", - "ErrTrailingComma", - "NewReader", - "NewWriter", - "ParseError", - "Reader", - "Writer", - }, - "encoding/gob": []string{ - "CommonType", - "Decoder", - "Encoder", - "GobDecoder", - "GobEncoder", - "NewDecoder", - "NewEncoder", - "Register", - "RegisterName", - }, - "encoding/hex": []string{ - "Decode", - "DecodeString", - "DecodedLen", - "Dump", - "Dumper", - "Encode", - "EncodeToString", - "EncodedLen", - "ErrLength", - "InvalidByteError", - "NewDecoder", - "NewEncoder", - }, - "encoding/json": []string{ - "Compact", - "Decoder", - "Delim", - "Encoder", - "HTMLEscape", - "Indent", - "InvalidUTF8Error", - "InvalidUnmarshalError", - "Marshal", - "MarshalIndent", - "Marshaler", - "MarshalerError", - "NewDecoder", - "NewEncoder", - "Number", - "RawMessage", - "SyntaxError", - "Token", - "Unmarshal", - "UnmarshalFieldError", - "UnmarshalTypeError", - "Unmarshaler", - "UnsupportedTypeError", - "UnsupportedValueError", - "Valid", - }, - "encoding/pem": []string{ - "Block", - "Decode", - "Encode", - "EncodeToMemory", - }, - "encoding/xml": []string{ - "Attr", - "CharData", - "Comment", - "CopyToken", - "Decoder", - "Directive", - "Encoder", - "EndElement", - "Escape", - "EscapeText", - "HTMLAutoClose", - "HTMLEntity", - "Header", - "Marshal", - "MarshalIndent", - "Marshaler", - "MarshalerAttr", - "Name", - "NewDecoder", - "NewEncoder", - "NewTokenDecoder", - "ProcInst", - "StartElement", - "SyntaxError", - "TagPathError", - "Token", - "TokenReader", - "Unmarshal", - "UnmarshalError", - "Unmarshaler", - "UnmarshalerAttr", - "UnsupportedTypeError", - }, - "errors": []string{ - "As", - "Is", - "New", - "Unwrap", - }, - "expvar": []string{ - "Do", - "Float", - "Func", - "Get", - "Handler", - "Int", - "KeyValue", - "Map", - "NewFloat", - "NewInt", - "NewMap", - "NewString", - "Publish", - "String", - "Var", - }, - "flag": []string{ - "Arg", - "Args", - "Bool", - "BoolVar", - "CommandLine", - "ContinueOnError", - "Duration", - "DurationVar", - "ErrHelp", - "ErrorHandling", - "ExitOnError", - "Flag", - "FlagSet", - "Float64", - "Float64Var", - "Getter", - "Int", - "Int64", - "Int64Var", - "IntVar", - "Lookup", - "NArg", - "NFlag", - "NewFlagSet", - "PanicOnError", - "Parse", - "Parsed", - "PrintDefaults", - "Set", - "String", - "StringVar", - "Uint", - "Uint64", - "Uint64Var", - "UintVar", - "UnquoteUsage", - "Usage", - "Value", - "Var", - "Visit", - "VisitAll", - }, - "fmt": []string{ - "Errorf", - "Formatter", - "Fprint", - "Fprintf", - "Fprintln", - "Fscan", - "Fscanf", - "Fscanln", - "GoStringer", - "Print", - "Printf", - "Println", - "Scan", - "ScanState", - "Scanf", - "Scanln", - "Scanner", - "Sprint", - "Sprintf", - "Sprintln", - "Sscan", - "Sscanf", - "Sscanln", - "State", - "Stringer", - }, - "go/ast": []string{ - "ArrayType", - "AssignStmt", - "Bad", - "BadDecl", - "BadExpr", - "BadStmt", - "BasicLit", - "BinaryExpr", - "BlockStmt", - "BranchStmt", - "CallExpr", - "CaseClause", - "ChanDir", - "ChanType", - "CommClause", - "Comment", - "CommentGroup", - "CommentMap", - "CompositeLit", - "Con", - "Decl", - "DeclStmt", - "DeferStmt", - "Ellipsis", - "EmptyStmt", - "Expr", - "ExprStmt", - "Field", - "FieldFilter", - "FieldList", - "File", - "FileExports", - "Filter", - "FilterDecl", - "FilterFile", - "FilterFuncDuplicates", - "FilterImportDuplicates", - "FilterPackage", - "FilterUnassociatedComments", - "ForStmt", - "Fprint", - "Fun", - "FuncDecl", - "FuncLit", - "FuncType", - "GenDecl", - "GoStmt", - "Ident", - "IfStmt", - "ImportSpec", - "Importer", - "IncDecStmt", - "IndexExpr", - "Inspect", - "InterfaceType", - "IsExported", - "KeyValueExpr", - "LabeledStmt", - "Lbl", - "MapType", - "MergeMode", - "MergePackageFiles", - "NewCommentMap", - "NewIdent", - "NewObj", - "NewPackage", - "NewScope", - "Node", - "NotNilFilter", - "ObjKind", - "Object", - "Package", - "PackageExports", - "ParenExpr", - "Pkg", - "Print", - "RECV", - "RangeStmt", - "ReturnStmt", - "SEND", - "Scope", - "SelectStmt", - "SelectorExpr", - "SendStmt", - "SliceExpr", - "SortImports", - "Spec", - "StarExpr", - "Stmt", - "StructType", - "SwitchStmt", - "Typ", - "TypeAssertExpr", - "TypeSpec", - "TypeSwitchStmt", - "UnaryExpr", - "ValueSpec", - "Var", - "Visitor", - "Walk", - }, - "go/build": []string{ - "AllowBinary", - "ArchChar", - "Context", - "Default", - "FindOnly", - "IgnoreVendor", - "Import", - "ImportComment", - "ImportDir", - "ImportMode", - "IsLocalImport", - "MultiplePackageError", - "NoGoError", - "Package", - "ToolDir", - }, - "go/constant": []string{ - "BinaryOp", - "BitLen", - "Bool", - "BoolVal", - "Bytes", - "Compare", - "Complex", - "Denom", - "Float", - "Float32Val", - "Float64Val", - "Imag", - "Int", - "Int64Val", - "Kind", - "Make", - "MakeBool", - "MakeFloat64", - "MakeFromBytes", - "MakeFromLiteral", - "MakeImag", - "MakeInt64", - "MakeString", - "MakeUint64", - "MakeUnknown", - "Num", - "Real", - "Shift", - "Sign", - "String", - "StringVal", - "ToComplex", - "ToFloat", - "ToInt", - "Uint64Val", - "UnaryOp", - "Unknown", - "Val", - "Value", - }, - "go/doc": []string{ - "AllDecls", - "AllMethods", - "Example", - "Examples", - "Filter", - "Func", - "IllegalPrefixes", - "IsPredeclared", - "Mode", - "New", - "Note", - "Package", - "PreserveAST", - "Synopsis", - "ToHTML", - "ToText", - "Type", - "Value", - }, - "go/format": []string{ - "Node", - "Source", - }, - "go/importer": []string{ - "Default", - "For", - "ForCompiler", - "Lookup", - }, - "go/parser": []string{ - "AllErrors", - "DeclarationErrors", - "ImportsOnly", - "Mode", - "PackageClauseOnly", - "ParseComments", - "ParseDir", - "ParseExpr", - "ParseExprFrom", - "ParseFile", - "SpuriousErrors", - "Trace", - }, - "go/printer": []string{ - "CommentedNode", - "Config", - "Fprint", - "Mode", - "RawFormat", - "SourcePos", - "TabIndent", - "UseSpaces", - }, - "go/scanner": []string{ - "Error", - "ErrorHandler", - "ErrorList", - "Mode", - "PrintError", - "ScanComments", - "Scanner", - }, - "go/token": []string{ - "ADD", - "ADD_ASSIGN", - "AND", - "AND_ASSIGN", - "AND_NOT", - "AND_NOT_ASSIGN", - "ARROW", - "ASSIGN", - "BREAK", - "CASE", - "CHAN", - "CHAR", - "COLON", - "COMMA", - "COMMENT", - "CONST", - "CONTINUE", - "DEC", - "DEFAULT", - "DEFER", - "DEFINE", - "ELLIPSIS", - "ELSE", - "EOF", - "EQL", - "FALLTHROUGH", - "FLOAT", - "FOR", - "FUNC", - "File", - "FileSet", - "GEQ", - "GO", - "GOTO", - "GTR", - "HighestPrec", - "IDENT", - "IF", - "ILLEGAL", - "IMAG", - "IMPORT", - "INC", - "INT", - "INTERFACE", - "IsExported", - "IsIdentifier", - "IsKeyword", - "LAND", - "LBRACE", - "LBRACK", - "LEQ", - "LOR", - "LPAREN", - "LSS", - "Lookup", - "LowestPrec", - "MAP", - "MUL", - "MUL_ASSIGN", - "NEQ", - "NOT", - "NewFileSet", - "NoPos", - "OR", - "OR_ASSIGN", - "PACKAGE", - "PERIOD", - "Pos", - "Position", - "QUO", - "QUO_ASSIGN", - "RANGE", - "RBRACE", - "RBRACK", - "REM", - "REM_ASSIGN", - "RETURN", - "RPAREN", - "SELECT", - "SEMICOLON", - "SHL", - "SHL_ASSIGN", - "SHR", - "SHR_ASSIGN", - "STRING", - "STRUCT", - "SUB", - "SUB_ASSIGN", - "SWITCH", - "TYPE", - "Token", - "UnaryPrec", - "VAR", - "XOR", - "XOR_ASSIGN", - }, - "go/types": []string{ - "Array", - "AssertableTo", - "AssignableTo", - "Basic", - "BasicInfo", - "BasicKind", - "Bool", - "Builtin", - "Byte", - "Chan", - "ChanDir", - "CheckExpr", - "Checker", - "Comparable", - "Complex128", - "Complex64", - "Config", - "Const", - "ConvertibleTo", - "DefPredeclaredTestFuncs", - "Default", - "Error", - "Eval", - "ExprString", - "FieldVal", - "Float32", - "Float64", - "Func", - "Id", - "Identical", - "IdenticalIgnoreTags", - "Implements", - "ImportMode", - "Importer", - "ImporterFrom", - "Info", - "Initializer", - "Int", - "Int16", - "Int32", - "Int64", - "Int8", - "Interface", - "Invalid", - "IsBoolean", - "IsComplex", - "IsConstType", - "IsFloat", - "IsInteger", - "IsInterface", - "IsNumeric", - "IsOrdered", - "IsString", - "IsUnsigned", - "IsUntyped", - "Label", - "LookupFieldOrMethod", - "Map", - "MethodExpr", - "MethodSet", - "MethodVal", - "MissingMethod", - "Named", - "NewArray", - "NewChan", - "NewChecker", - "NewConst", - "NewField", - "NewFunc", - "NewInterface", - "NewInterfaceType", - "NewLabel", - "NewMap", - "NewMethodSet", - "NewNamed", - "NewPackage", - "NewParam", - "NewPkgName", - "NewPointer", - "NewScope", - "NewSignature", - "NewSlice", - "NewStruct", - "NewTuple", - "NewTypeName", - "NewVar", - "Nil", - "Object", - "ObjectString", - "Package", - "PkgName", - "Pointer", - "Qualifier", - "RecvOnly", - "RelativeTo", - "Rune", - "Scope", - "Selection", - "SelectionKind", - "SelectionString", - "SendOnly", - "SendRecv", - "Signature", - "Sizes", - "SizesFor", - "Slice", - "StdSizes", - "String", - "Struct", - "Tuple", - "Typ", - "Type", - "TypeAndValue", - "TypeName", - "TypeString", - "Uint", - "Uint16", - "Uint32", - "Uint64", - "Uint8", - "Uintptr", - "Universe", - "Unsafe", - "UnsafePointer", - "UntypedBool", - "UntypedComplex", - "UntypedFloat", - "UntypedInt", - "UntypedNil", - "UntypedRune", - "UntypedString", - "Var", - "WriteExpr", - "WriteSignature", - "WriteType", - }, - "hash": []string{ - "Hash", - "Hash32", - "Hash64", - }, - "hash/adler32": []string{ - "Checksum", - "New", - "Size", - }, - "hash/crc32": []string{ - "Castagnoli", - "Checksum", - "ChecksumIEEE", - "IEEE", - "IEEETable", - "Koopman", - "MakeTable", - "New", - "NewIEEE", - "Size", - "Table", - "Update", - }, - "hash/crc64": []string{ - "Checksum", - "ECMA", - "ISO", - "MakeTable", - "New", - "Size", - "Table", - "Update", - }, - "hash/fnv": []string{ - "New128", - "New128a", - "New32", - "New32a", - "New64", - "New64a", - }, - "html": []string{ - "EscapeString", - "UnescapeString", - }, - "html/template": []string{ - "CSS", - "ErrAmbigContext", - "ErrBadHTML", - "ErrBranchEnd", - "ErrEndContext", - "ErrNoSuchTemplate", - "ErrOutputContext", - "ErrPartialCharset", - "ErrPartialEscape", - "ErrPredefinedEscaper", - "ErrRangeLoopReentry", - "ErrSlashAmbig", - "Error", - "ErrorCode", - "FuncMap", - "HTML", - "HTMLAttr", - "HTMLEscape", - "HTMLEscapeString", - "HTMLEscaper", - "IsTrue", - "JS", - "JSEscape", - "JSEscapeString", - "JSEscaper", - "JSStr", - "Must", - "New", - "OK", - "ParseFiles", - "ParseGlob", - "Srcset", - "Template", - "URL", - "URLQueryEscaper", - }, - "image": []string{ - "Alpha", - "Alpha16", - "Black", - "CMYK", - "Config", - "Decode", - "DecodeConfig", - "ErrFormat", - "Gray", - "Gray16", - "Image", - "NRGBA", - "NRGBA64", - "NYCbCrA", - "NewAlpha", - "NewAlpha16", - "NewCMYK", - "NewGray", - "NewGray16", - "NewNRGBA", - "NewNRGBA64", - "NewNYCbCrA", - "NewPaletted", - "NewRGBA", - "NewRGBA64", - "NewUniform", - "NewYCbCr", - "Opaque", - "Paletted", - "PalettedImage", - "Point", - "Pt", - "RGBA", - "RGBA64", - "Rect", - "Rectangle", - "RegisterFormat", - "Transparent", - "Uniform", - "White", - "YCbCr", - "YCbCrSubsampleRatio", - "YCbCrSubsampleRatio410", - "YCbCrSubsampleRatio411", - "YCbCrSubsampleRatio420", - "YCbCrSubsampleRatio422", - "YCbCrSubsampleRatio440", - "YCbCrSubsampleRatio444", - "ZP", - "ZR", - }, - "image/color": []string{ - "Alpha", - "Alpha16", - "Alpha16Model", - "AlphaModel", - "Black", - "CMYK", - "CMYKModel", - "CMYKToRGB", - "Color", - "Gray", - "Gray16", - "Gray16Model", - "GrayModel", - "Model", - "ModelFunc", - "NRGBA", - "NRGBA64", - "NRGBA64Model", - "NRGBAModel", - "NYCbCrA", - "NYCbCrAModel", - "Opaque", - "Palette", - "RGBA", - "RGBA64", - "RGBA64Model", - "RGBAModel", - "RGBToCMYK", - "RGBToYCbCr", - "Transparent", - "White", - "YCbCr", - "YCbCrModel", - "YCbCrToRGB", - }, - "image/color/palette": []string{ - "Plan9", - "WebSafe", - }, - "image/draw": []string{ - "Draw", - "DrawMask", - "Drawer", - "FloydSteinberg", - "Image", - "Op", - "Over", - "Quantizer", - "Src", - }, - "image/gif": []string{ - "Decode", - "DecodeAll", - "DecodeConfig", - "DisposalBackground", - "DisposalNone", - "DisposalPrevious", - "Encode", - "EncodeAll", - "GIF", - "Options", - }, - "image/jpeg": []string{ - "Decode", - "DecodeConfig", - "DefaultQuality", - "Encode", - "FormatError", - "Options", - "Reader", - "UnsupportedError", - }, - "image/png": []string{ - "BestCompression", - "BestSpeed", - "CompressionLevel", - "Decode", - "DecodeConfig", - "DefaultCompression", - "Encode", - "Encoder", - "EncoderBuffer", - "EncoderBufferPool", - "FormatError", - "NoCompression", - "UnsupportedError", - }, - "index/suffixarray": []string{ - "Index", - "New", - }, - "io": []string{ - "ByteReader", - "ByteScanner", - "ByteWriter", - "Closer", - "Copy", - "CopyBuffer", - "CopyN", - "EOF", - "ErrClosedPipe", - "ErrNoProgress", - "ErrShortBuffer", - "ErrShortWrite", - "ErrUnexpectedEOF", - "LimitReader", - "LimitedReader", - "MultiReader", - "MultiWriter", - "NewSectionReader", - "Pipe", - "PipeReader", - "PipeWriter", - "ReadAtLeast", - "ReadCloser", - "ReadFull", - "ReadSeeker", - "ReadWriteCloser", - "ReadWriteSeeker", - "ReadWriter", - "Reader", - "ReaderAt", - "ReaderFrom", - "RuneReader", - "RuneScanner", - "SectionReader", - "SeekCurrent", - "SeekEnd", - "SeekStart", - "Seeker", - "StringWriter", - "TeeReader", - "WriteCloser", - "WriteSeeker", - "WriteString", - "Writer", - "WriterAt", - "WriterTo", - }, - "io/ioutil": []string{ - "Discard", - "NopCloser", - "ReadAll", - "ReadDir", - "ReadFile", - "TempDir", - "TempFile", - "WriteFile", - }, - "log": []string{ - "Fatal", - "Fatalf", - "Fatalln", - "Flags", - "LUTC", - "Ldate", - "Llongfile", - "Lmicroseconds", - "Logger", - "Lshortfile", - "LstdFlags", - "Ltime", - "New", - "Output", - "Panic", - "Panicf", - "Panicln", - "Prefix", - "Print", - "Printf", - "Println", - "SetFlags", - "SetOutput", - "SetPrefix", - "Writer", - }, - "log/syslog": []string{ - "Dial", - "LOG_ALERT", - "LOG_AUTH", - "LOG_AUTHPRIV", - "LOG_CRIT", - "LOG_CRON", - "LOG_DAEMON", - "LOG_DEBUG", - "LOG_EMERG", - "LOG_ERR", - "LOG_FTP", - "LOG_INFO", - "LOG_KERN", - "LOG_LOCAL0", - "LOG_LOCAL1", - "LOG_LOCAL2", - "LOG_LOCAL3", - "LOG_LOCAL4", - "LOG_LOCAL5", - "LOG_LOCAL6", - "LOG_LOCAL7", - "LOG_LPR", - "LOG_MAIL", - "LOG_NEWS", - "LOG_NOTICE", - "LOG_SYSLOG", - "LOG_USER", - "LOG_UUCP", - "LOG_WARNING", - "New", - "NewLogger", - "Priority", - "Writer", - }, - "math": []string{ - "Abs", - "Acos", - "Acosh", - "Asin", - "Asinh", - "Atan", - "Atan2", - "Atanh", - "Cbrt", - "Ceil", - "Copysign", - "Cos", - "Cosh", - "Dim", - "E", - "Erf", - "Erfc", - "Erfcinv", - "Erfinv", - "Exp", - "Exp2", - "Expm1", - "Float32bits", - "Float32frombits", - "Float64bits", - "Float64frombits", - "Floor", - "Frexp", - "Gamma", - "Hypot", - "Ilogb", - "Inf", - "IsInf", - "IsNaN", - "J0", - "J1", - "Jn", - "Ldexp", - "Lgamma", - "Ln10", - "Ln2", - "Log", - "Log10", - "Log10E", - "Log1p", - "Log2", - "Log2E", - "Logb", - "Max", - "MaxFloat32", - "MaxFloat64", - "MaxInt16", - "MaxInt32", - "MaxInt64", - "MaxInt8", - "MaxUint16", - "MaxUint32", - "MaxUint64", - "MaxUint8", - "Min", - "MinInt16", - "MinInt32", - "MinInt64", - "MinInt8", - "Mod", - "Modf", - "NaN", - "Nextafter", - "Nextafter32", - "Phi", - "Pi", - "Pow", - "Pow10", - "Remainder", - "Round", - "RoundToEven", - "Signbit", - "Sin", - "Sincos", - "Sinh", - "SmallestNonzeroFloat32", - "SmallestNonzeroFloat64", - "Sqrt", - "Sqrt2", - "SqrtE", - "SqrtPhi", - "SqrtPi", - "Tan", - "Tanh", - "Trunc", - "Y0", - "Y1", - "Yn", - }, - "math/big": []string{ - "Above", - "Accuracy", - "AwayFromZero", - "Below", - "ErrNaN", - "Exact", - "Float", - "Int", - "Jacobi", - "MaxBase", - "MaxExp", - "MaxPrec", - "MinExp", - "NewFloat", - "NewInt", - "NewRat", - "ParseFloat", - "Rat", - "RoundingMode", - "ToNearestAway", - "ToNearestEven", - "ToNegativeInf", - "ToPositiveInf", - "ToZero", - "Word", - }, - "math/bits": []string{ - "Add", - "Add32", - "Add64", - "Div", - "Div32", - "Div64", - "LeadingZeros", - "LeadingZeros16", - "LeadingZeros32", - "LeadingZeros64", - "LeadingZeros8", - "Len", - "Len16", - "Len32", - "Len64", - "Len8", - "Mul", - "Mul32", - "Mul64", - "OnesCount", - "OnesCount16", - "OnesCount32", - "OnesCount64", - "OnesCount8", - "Reverse", - "Reverse16", - "Reverse32", - "Reverse64", - "Reverse8", - "ReverseBytes", - "ReverseBytes16", - "ReverseBytes32", - "ReverseBytes64", - "RotateLeft", - "RotateLeft16", - "RotateLeft32", - "RotateLeft64", - "RotateLeft8", - "Sub", - "Sub32", - "Sub64", - "TrailingZeros", - "TrailingZeros16", - "TrailingZeros32", - "TrailingZeros64", - "TrailingZeros8", - "UintSize", - }, - "math/cmplx": []string{ - "Abs", - "Acos", - "Acosh", - "Asin", - "Asinh", - "Atan", - "Atanh", - "Conj", - "Cos", - "Cosh", - "Cot", - "Exp", - "Inf", - "IsInf", - "IsNaN", - "Log", - "Log10", - "NaN", - "Phase", - "Polar", - "Pow", - "Rect", - "Sin", - "Sinh", - "Sqrt", - "Tan", - "Tanh", - }, - "math/rand": []string{ - "ExpFloat64", - "Float32", - "Float64", - "Int", - "Int31", - "Int31n", - "Int63", - "Int63n", - "Intn", - "New", - "NewSource", - "NewZipf", - "NormFloat64", - "Perm", - "Rand", - "Read", - "Seed", - "Shuffle", - "Source", - "Source64", - "Uint32", - "Uint64", - "Zipf", - }, - "mime": []string{ - "AddExtensionType", - "BEncoding", - "ErrInvalidMediaParameter", - "ExtensionsByType", - "FormatMediaType", - "ParseMediaType", - "QEncoding", - "TypeByExtension", - "WordDecoder", - "WordEncoder", - }, - "mime/multipart": []string{ - "ErrMessageTooLarge", - "File", - "FileHeader", - "Form", - "NewReader", - "NewWriter", - "Part", - "Reader", - "Writer", - }, - "mime/quotedprintable": []string{ - "NewReader", - "NewWriter", - "Reader", - "Writer", - }, - "net": []string{ - "Addr", - "AddrError", - "Buffers", - "CIDRMask", - "Conn", - "DNSConfigError", - "DNSError", - "DefaultResolver", - "Dial", - "DialIP", - "DialTCP", - "DialTimeout", - "DialUDP", - "DialUnix", - "Dialer", - "ErrWriteToConnected", - "Error", - "FileConn", - "FileListener", - "FilePacketConn", - "FlagBroadcast", - "FlagLoopback", - "FlagMulticast", - "FlagPointToPoint", - "FlagUp", - "Flags", - "HardwareAddr", - "IP", - "IPAddr", - "IPConn", - "IPMask", - "IPNet", - "IPv4", - "IPv4Mask", - "IPv4allrouter", - "IPv4allsys", - "IPv4bcast", - "IPv4len", - "IPv4zero", - "IPv6interfacelocalallnodes", - "IPv6len", - "IPv6linklocalallnodes", - "IPv6linklocalallrouters", - "IPv6loopback", - "IPv6unspecified", - "IPv6zero", - "Interface", - "InterfaceAddrs", - "InterfaceByIndex", - "InterfaceByName", - "Interfaces", - "InvalidAddrError", - "JoinHostPort", - "Listen", - "ListenConfig", - "ListenIP", - "ListenMulticastUDP", - "ListenPacket", - "ListenTCP", - "ListenUDP", - "ListenUnix", - "ListenUnixgram", - "Listener", - "LookupAddr", - "LookupCNAME", - "LookupHost", - "LookupIP", - "LookupMX", - "LookupNS", - "LookupPort", - "LookupSRV", - "LookupTXT", - "MX", - "NS", - "OpError", - "PacketConn", - "ParseCIDR", - "ParseError", - "ParseIP", - "ParseMAC", - "Pipe", - "ResolveIPAddr", - "ResolveTCPAddr", - "ResolveUDPAddr", - "ResolveUnixAddr", - "Resolver", - "SRV", - "SplitHostPort", - "TCPAddr", - "TCPConn", - "TCPListener", - "UDPAddr", - "UDPConn", - "UnixAddr", - "UnixConn", - "UnixListener", - "UnknownNetworkError", - }, - "net/http": []string{ - "CanonicalHeaderKey", - "Client", - "CloseNotifier", - "ConnState", - "Cookie", - "CookieJar", - "DefaultClient", - "DefaultMaxHeaderBytes", - "DefaultMaxIdleConnsPerHost", - "DefaultServeMux", - "DefaultTransport", - "DetectContentType", - "Dir", - "ErrAbortHandler", - "ErrBodyNotAllowed", - "ErrBodyReadAfterClose", - "ErrContentLength", - "ErrHandlerTimeout", - "ErrHeaderTooLong", - "ErrHijacked", - "ErrLineTooLong", - "ErrMissingBoundary", - "ErrMissingContentLength", - "ErrMissingFile", - "ErrNoCookie", - "ErrNoLocation", - "ErrNotMultipart", - "ErrNotSupported", - "ErrServerClosed", - "ErrShortBody", - "ErrSkipAltProtocol", - "ErrUnexpectedTrailer", - "ErrUseLastResponse", - "ErrWriteAfterFlush", - "Error", - "File", - "FileServer", - "FileSystem", - "Flusher", - "Get", - "Handle", - "HandleFunc", - "Handler", - "HandlerFunc", - "Head", - "Header", - "Hijacker", - "ListenAndServe", - "ListenAndServeTLS", - "LocalAddrContextKey", - "MaxBytesReader", - "MethodConnect", - "MethodDelete", - "MethodGet", - "MethodHead", - "MethodOptions", - "MethodPatch", - "MethodPost", - "MethodPut", - "MethodTrace", - "NewFileTransport", - "NewRequest", - "NewRequestWithContext", - "NewServeMux", - "NoBody", - "NotFound", - "NotFoundHandler", - "ParseHTTPVersion", - "ParseTime", - "Post", - "PostForm", - "ProtocolError", - "ProxyFromEnvironment", - "ProxyURL", - "PushOptions", - "Pusher", - "ReadRequest", - "ReadResponse", - "Redirect", - "RedirectHandler", - "Request", - "Response", - "ResponseWriter", - "RoundTripper", - "SameSite", - "SameSiteDefaultMode", - "SameSiteLaxMode", - "SameSiteNoneMode", - "SameSiteStrictMode", - "Serve", - "ServeContent", - "ServeFile", - "ServeMux", - "ServeTLS", - "Server", - "ServerContextKey", - "SetCookie", - "StateActive", - "StateClosed", - "StateHijacked", - "StateIdle", - "StateNew", - "StatusAccepted", - "StatusAlreadyReported", - "StatusBadGateway", - "StatusBadRequest", - "StatusConflict", - "StatusContinue", - "StatusCreated", - "StatusEarlyHints", - "StatusExpectationFailed", - "StatusFailedDependency", - "StatusForbidden", - "StatusFound", - "StatusGatewayTimeout", - "StatusGone", - "StatusHTTPVersionNotSupported", - "StatusIMUsed", - "StatusInsufficientStorage", - "StatusInternalServerError", - "StatusLengthRequired", - "StatusLocked", - "StatusLoopDetected", - "StatusMethodNotAllowed", - "StatusMisdirectedRequest", - "StatusMovedPermanently", - "StatusMultiStatus", - "StatusMultipleChoices", - "StatusNetworkAuthenticationRequired", - "StatusNoContent", - "StatusNonAuthoritativeInfo", - "StatusNotAcceptable", - "StatusNotExtended", - "StatusNotFound", - "StatusNotImplemented", - "StatusNotModified", - "StatusOK", - "StatusPartialContent", - "StatusPaymentRequired", - "StatusPermanentRedirect", - "StatusPreconditionFailed", - "StatusPreconditionRequired", - "StatusProcessing", - "StatusProxyAuthRequired", - "StatusRequestEntityTooLarge", - "StatusRequestHeaderFieldsTooLarge", - "StatusRequestTimeout", - "StatusRequestURITooLong", - "StatusRequestedRangeNotSatisfiable", - "StatusResetContent", - "StatusSeeOther", - "StatusServiceUnavailable", - "StatusSwitchingProtocols", - "StatusTeapot", - "StatusTemporaryRedirect", - "StatusText", - "StatusTooEarly", - "StatusTooManyRequests", - "StatusUnauthorized", - "StatusUnavailableForLegalReasons", - "StatusUnprocessableEntity", - "StatusUnsupportedMediaType", - "StatusUpgradeRequired", - "StatusUseProxy", - "StatusVariantAlsoNegotiates", - "StripPrefix", - "TimeFormat", - "TimeoutHandler", - "TrailerPrefix", - "Transport", - }, - "net/http/cgi": []string{ - "Handler", - "Request", - "RequestFromMap", - "Serve", - }, - "net/http/cookiejar": []string{ - "Jar", - "New", - "Options", - "PublicSuffixList", - }, - "net/http/fcgi": []string{ - "ErrConnClosed", - "ErrRequestAborted", - "ProcessEnv", - "Serve", - }, - "net/http/httptest": []string{ - "DefaultRemoteAddr", - "NewRecorder", - "NewRequest", - "NewServer", - "NewTLSServer", - "NewUnstartedServer", - "ResponseRecorder", - "Server", - }, - "net/http/httptrace": []string{ - "ClientTrace", - "ContextClientTrace", - "DNSDoneInfo", - "DNSStartInfo", - "GotConnInfo", - "WithClientTrace", - "WroteRequestInfo", - }, - "net/http/httputil": []string{ - "BufferPool", - "ClientConn", - "DumpRequest", - "DumpRequestOut", - "DumpResponse", - "ErrClosed", - "ErrLineTooLong", - "ErrPersistEOF", - "ErrPipeline", - "NewChunkedReader", - "NewChunkedWriter", - "NewClientConn", - "NewProxyClientConn", - "NewServerConn", - "NewSingleHostReverseProxy", - "ReverseProxy", - "ServerConn", - }, - "net/http/pprof": []string{ - "Cmdline", - "Handler", - "Index", - "Profile", - "Symbol", - "Trace", - }, - "net/mail": []string{ - "Address", - "AddressParser", - "ErrHeaderNotPresent", - "Header", - "Message", - "ParseAddress", - "ParseAddressList", - "ParseDate", - "ReadMessage", - }, - "net/rpc": []string{ - "Accept", - "Call", - "Client", - "ClientCodec", - "DefaultDebugPath", - "DefaultRPCPath", - "DefaultServer", - "Dial", - "DialHTTP", - "DialHTTPPath", - "ErrShutdown", - "HandleHTTP", - "NewClient", - "NewClientWithCodec", - "NewServer", - "Register", - "RegisterName", - "Request", - "Response", - "ServeCodec", - "ServeConn", - "ServeRequest", - "Server", - "ServerCodec", - "ServerError", - }, - "net/rpc/jsonrpc": []string{ - "Dial", - "NewClient", - "NewClientCodec", - "NewServerCodec", - "ServeConn", - }, - "net/smtp": []string{ - "Auth", - "CRAMMD5Auth", - "Client", - "Dial", - "NewClient", - "PlainAuth", - "SendMail", - "ServerInfo", - }, - "net/textproto": []string{ - "CanonicalMIMEHeaderKey", - "Conn", - "Dial", - "Error", - "MIMEHeader", - "NewConn", - "NewReader", - "NewWriter", - "Pipeline", - "ProtocolError", - "Reader", - "TrimBytes", - "TrimString", - "Writer", - }, - "net/url": []string{ - "Error", - "EscapeError", - "InvalidHostError", - "Parse", - "ParseQuery", - "ParseRequestURI", - "PathEscape", - "PathUnescape", - "QueryEscape", - "QueryUnescape", - "URL", - "User", - "UserPassword", - "Userinfo", - "Values", - }, - "os": []string{ - "Args", - "Chdir", - "Chmod", - "Chown", - "Chtimes", - "Clearenv", - "Create", - "DevNull", - "Environ", - "ErrClosed", - "ErrExist", - "ErrInvalid", - "ErrNoDeadline", - "ErrNotExist", - "ErrPermission", - "Executable", - "Exit", - "Expand", - "ExpandEnv", - "File", - "FileInfo", - "FileMode", - "FindProcess", - "Getegid", - "Getenv", - "Geteuid", - "Getgid", - "Getgroups", - "Getpagesize", - "Getpid", - "Getppid", - "Getuid", - "Getwd", - "Hostname", - "Interrupt", - "IsExist", - "IsNotExist", - "IsPathSeparator", - "IsPermission", - "IsTimeout", - "Kill", - "Lchown", - "Link", - "LinkError", - "LookupEnv", - "Lstat", - "Mkdir", - "MkdirAll", - "ModeAppend", - "ModeCharDevice", - "ModeDevice", - "ModeDir", - "ModeExclusive", - "ModeIrregular", - "ModeNamedPipe", - "ModePerm", - "ModeSetgid", - "ModeSetuid", - "ModeSocket", - "ModeSticky", - "ModeSymlink", - "ModeTemporary", - "ModeType", - "NewFile", - "NewSyscallError", - "O_APPEND", - "O_CREATE", - "O_EXCL", - "O_RDONLY", - "O_RDWR", - "O_SYNC", - "O_TRUNC", - "O_WRONLY", - "Open", - "OpenFile", - "PathError", - "PathListSeparator", - "PathSeparator", - "Pipe", - "ProcAttr", - "Process", - "ProcessState", - "Readlink", - "Remove", - "RemoveAll", - "Rename", - "SEEK_CUR", - "SEEK_END", - "SEEK_SET", - "SameFile", - "Setenv", - "Signal", - "StartProcess", - "Stat", - "Stderr", - "Stdin", - "Stdout", - "Symlink", - "SyscallError", - "TempDir", - "Truncate", - "Unsetenv", - "UserCacheDir", - "UserConfigDir", - "UserHomeDir", - }, - "os/exec": []string{ - "Cmd", - "Command", - "CommandContext", - "ErrNotFound", - "Error", - "ExitError", - "LookPath", - }, - "os/signal": []string{ - "Ignore", - "Ignored", - "Notify", - "Reset", - "Stop", - }, - "os/user": []string{ - "Current", - "Group", - "Lookup", - "LookupGroup", - "LookupGroupId", - "LookupId", - "UnknownGroupError", - "UnknownGroupIdError", - "UnknownUserError", - "UnknownUserIdError", - "User", - }, - "path": []string{ - "Base", - "Clean", - "Dir", - "ErrBadPattern", - "Ext", - "IsAbs", - "Join", - "Match", - "Split", - }, - "path/filepath": []string{ - "Abs", - "Base", - "Clean", - "Dir", - "ErrBadPattern", - "EvalSymlinks", - "Ext", - "FromSlash", - "Glob", - "HasPrefix", - "IsAbs", - "Join", - "ListSeparator", - "Match", - "Rel", - "Separator", - "SkipDir", - "Split", - "SplitList", - "ToSlash", - "VolumeName", - "Walk", - "WalkFunc", - }, - "plugin": []string{ - "Open", - "Plugin", - "Symbol", - }, - "reflect": []string{ - "Append", - "AppendSlice", - "Array", - "ArrayOf", - "Bool", - "BothDir", - "Chan", - "ChanDir", - "ChanOf", - "Complex128", - "Complex64", - "Copy", - "DeepEqual", - "Float32", - "Float64", - "Func", - "FuncOf", - "Indirect", - "Int", - "Int16", - "Int32", - "Int64", - "Int8", - "Interface", - "Invalid", - "Kind", - "MakeChan", - "MakeFunc", - "MakeMap", - "MakeMapWithSize", - "MakeSlice", - "Map", - "MapIter", - "MapOf", - "Method", - "New", - "NewAt", - "Ptr", - "PtrTo", - "RecvDir", - "Select", - "SelectCase", - "SelectDefault", - "SelectDir", - "SelectRecv", - "SelectSend", - "SendDir", - "Slice", - "SliceHeader", - "SliceOf", - "String", - "StringHeader", - "Struct", - "StructField", - "StructOf", - "StructTag", - "Swapper", - "Type", - "TypeOf", - "Uint", - "Uint16", - "Uint32", - "Uint64", - "Uint8", - "Uintptr", - "UnsafePointer", - "Value", - "ValueError", - "ValueOf", - "Zero", - }, - "regexp": []string{ - "Compile", - "CompilePOSIX", - "Match", - "MatchReader", - "MatchString", - "MustCompile", - "MustCompilePOSIX", - "QuoteMeta", - "Regexp", - }, - "regexp/syntax": []string{ - "ClassNL", - "Compile", - "DotNL", - "EmptyBeginLine", - "EmptyBeginText", - "EmptyEndLine", - "EmptyEndText", - "EmptyNoWordBoundary", - "EmptyOp", - "EmptyOpContext", - "EmptyWordBoundary", - "ErrInternalError", - "ErrInvalidCharClass", - "ErrInvalidCharRange", - "ErrInvalidEscape", - "ErrInvalidNamedCapture", - "ErrInvalidPerlOp", - "ErrInvalidRepeatOp", - "ErrInvalidRepeatSize", - "ErrInvalidUTF8", - "ErrMissingBracket", - "ErrMissingParen", - "ErrMissingRepeatArgument", - "ErrTrailingBackslash", - "ErrUnexpectedParen", - "Error", - "ErrorCode", - "Flags", - "FoldCase", - "Inst", - "InstAlt", - "InstAltMatch", - "InstCapture", - "InstEmptyWidth", - "InstFail", - "InstMatch", - "InstNop", - "InstOp", - "InstRune", - "InstRune1", - "InstRuneAny", - "InstRuneAnyNotNL", - "IsWordChar", - "Literal", - "MatchNL", - "NonGreedy", - "OneLine", - "Op", - "OpAlternate", - "OpAnyChar", - "OpAnyCharNotNL", - "OpBeginLine", - "OpBeginText", - "OpCapture", - "OpCharClass", - "OpConcat", - "OpEmptyMatch", - "OpEndLine", - "OpEndText", - "OpLiteral", - "OpNoMatch", - "OpNoWordBoundary", - "OpPlus", - "OpQuest", - "OpRepeat", - "OpStar", - "OpWordBoundary", - "POSIX", - "Parse", - "Perl", - "PerlX", - "Prog", - "Regexp", - "Simple", - "UnicodeGroups", - "WasDollar", - }, - "runtime": []string{ - "BlockProfile", - "BlockProfileRecord", - "Breakpoint", - "CPUProfile", - "Caller", - "Callers", - "CallersFrames", - "Compiler", - "Error", - "Frame", - "Frames", - "Func", - "FuncForPC", - "GC", - "GOARCH", - "GOMAXPROCS", - "GOOS", - "GOROOT", - "Goexit", - "GoroutineProfile", - "Gosched", - "KeepAlive", - "LockOSThread", - "MemProfile", - "MemProfileRate", - "MemProfileRecord", - "MemStats", - "MutexProfile", - "NumCPU", - "NumCgoCall", - "NumGoroutine", - "ReadMemStats", - "ReadTrace", - "SetBlockProfileRate", - "SetCPUProfileRate", - "SetCgoTraceback", - "SetFinalizer", - "SetMutexProfileFraction", - "Stack", - "StackRecord", - "StartTrace", - "StopTrace", - "ThreadCreateProfile", - "TypeAssertionError", - "UnlockOSThread", - "Version", - }, - "runtime/debug": []string{ - "BuildInfo", - "FreeOSMemory", - "GCStats", - "Module", - "PrintStack", - "ReadBuildInfo", - "ReadGCStats", - "SetGCPercent", - "SetMaxStack", - "SetMaxThreads", - "SetPanicOnFault", - "SetTraceback", - "Stack", - "WriteHeapDump", - }, - "runtime/pprof": []string{ - "Do", - "ForLabels", - "Label", - "LabelSet", - "Labels", - "Lookup", - "NewProfile", - "Profile", - "Profiles", - "SetGoroutineLabels", - "StartCPUProfile", - "StopCPUProfile", - "WithLabels", - "WriteHeapProfile", - }, - "runtime/trace": []string{ - "IsEnabled", - "Log", - "Logf", - "NewTask", - "Region", - "Start", - "StartRegion", - "Stop", - "Task", - "WithRegion", - }, - "sort": []string{ - "Float64Slice", - "Float64s", - "Float64sAreSorted", - "IntSlice", - "Interface", - "Ints", - "IntsAreSorted", - "IsSorted", - "Reverse", - "Search", - "SearchFloat64s", - "SearchInts", - "SearchStrings", - "Slice", - "SliceIsSorted", - "SliceStable", - "Sort", - "Stable", - "StringSlice", - "Strings", - "StringsAreSorted", - }, - "strconv": []string{ - "AppendBool", - "AppendFloat", - "AppendInt", - "AppendQuote", - "AppendQuoteRune", - "AppendQuoteRuneToASCII", - "AppendQuoteRuneToGraphic", - "AppendQuoteToASCII", - "AppendQuoteToGraphic", - "AppendUint", - "Atoi", - "CanBackquote", - "ErrRange", - "ErrSyntax", - "FormatBool", - "FormatFloat", - "FormatInt", - "FormatUint", - "IntSize", - "IsGraphic", - "IsPrint", - "Itoa", - "NumError", - "ParseBool", - "ParseFloat", - "ParseInt", - "ParseUint", - "Quote", - "QuoteRune", - "QuoteRuneToASCII", - "QuoteRuneToGraphic", - "QuoteToASCII", - "QuoteToGraphic", - "Unquote", - "UnquoteChar", - }, - "strings": []string{ - "Builder", - "Compare", - "Contains", - "ContainsAny", - "ContainsRune", - "Count", - "EqualFold", - "Fields", - "FieldsFunc", - "HasPrefix", - "HasSuffix", - "Index", - "IndexAny", - "IndexByte", - "IndexFunc", - "IndexRune", - "Join", - "LastIndex", - "LastIndexAny", - "LastIndexByte", - "LastIndexFunc", - "Map", - "NewReader", - "NewReplacer", - "Reader", - "Repeat", - "Replace", - "ReplaceAll", - "Replacer", - "Split", - "SplitAfter", - "SplitAfterN", - "SplitN", - "Title", - "ToLower", - "ToLowerSpecial", - "ToTitle", - "ToTitleSpecial", - "ToUpper", - "ToUpperSpecial", - "ToValidUTF8", - "Trim", - "TrimFunc", - "TrimLeft", - "TrimLeftFunc", - "TrimPrefix", - "TrimRight", - "TrimRightFunc", - "TrimSpace", - "TrimSuffix", - }, - "sync": []string{ - "Cond", - "Locker", - "Map", - "Mutex", - "NewCond", - "Once", - "Pool", - "RWMutex", - "WaitGroup", - }, - "sync/atomic": []string{ - "AddInt32", - "AddInt64", - "AddUint32", - "AddUint64", - "AddUintptr", - "CompareAndSwapInt32", - "CompareAndSwapInt64", - "CompareAndSwapPointer", - "CompareAndSwapUint32", - "CompareAndSwapUint64", - "CompareAndSwapUintptr", - "LoadInt32", - "LoadInt64", - "LoadPointer", - "LoadUint32", - "LoadUint64", - "LoadUintptr", - "StoreInt32", - "StoreInt64", - "StorePointer", - "StoreUint32", - "StoreUint64", - "StoreUintptr", - "SwapInt32", - "SwapInt64", - "SwapPointer", - "SwapUint32", - "SwapUint64", - "SwapUintptr", - "Value", - }, - "syscall": []string{ - "AF_ALG", - "AF_APPLETALK", - "AF_ARP", - "AF_ASH", - "AF_ATM", - "AF_ATMPVC", - "AF_ATMSVC", - "AF_AX25", - "AF_BLUETOOTH", - "AF_BRIDGE", - "AF_CAIF", - "AF_CAN", - "AF_CCITT", - "AF_CHAOS", - "AF_CNT", - "AF_COIP", - "AF_DATAKIT", - "AF_DECnet", - "AF_DLI", - "AF_E164", - "AF_ECMA", - "AF_ECONET", - "AF_ENCAP", - "AF_FILE", - "AF_HYLINK", - "AF_IEEE80211", - "AF_IEEE802154", - "AF_IMPLINK", - "AF_INET", - "AF_INET6", - "AF_INET6_SDP", - "AF_INET_SDP", - "AF_IPX", - "AF_IRDA", - "AF_ISDN", - "AF_ISO", - "AF_IUCV", - "AF_KEY", - "AF_LAT", - "AF_LINK", - "AF_LLC", - "AF_LOCAL", - "AF_MAX", - "AF_MPLS", - "AF_NATM", - "AF_NDRV", - "AF_NETBEUI", - "AF_NETBIOS", - "AF_NETGRAPH", - "AF_NETLINK", - "AF_NETROM", - "AF_NS", - "AF_OROUTE", - "AF_OSI", - "AF_PACKET", - "AF_PHONET", - "AF_PPP", - "AF_PPPOX", - "AF_PUP", - "AF_RDS", - "AF_RESERVED_36", - "AF_ROSE", - "AF_ROUTE", - "AF_RXRPC", - "AF_SCLUSTER", - "AF_SECURITY", - "AF_SIP", - "AF_SLOW", - "AF_SNA", - "AF_SYSTEM", - "AF_TIPC", - "AF_UNIX", - "AF_UNSPEC", - "AF_VENDOR00", - "AF_VENDOR01", - "AF_VENDOR02", - "AF_VENDOR03", - "AF_VENDOR04", - "AF_VENDOR05", - "AF_VENDOR06", - "AF_VENDOR07", - "AF_VENDOR08", - "AF_VENDOR09", - "AF_VENDOR10", - "AF_VENDOR11", - "AF_VENDOR12", - "AF_VENDOR13", - "AF_VENDOR14", - "AF_VENDOR15", - "AF_VENDOR16", - "AF_VENDOR17", - "AF_VENDOR18", - "AF_VENDOR19", - "AF_VENDOR20", - "AF_VENDOR21", - "AF_VENDOR22", - "AF_VENDOR23", - "AF_VENDOR24", - "AF_VENDOR25", - "AF_VENDOR26", - "AF_VENDOR27", - "AF_VENDOR28", - "AF_VENDOR29", - "AF_VENDOR30", - "AF_VENDOR31", - "AF_VENDOR32", - "AF_VENDOR33", - "AF_VENDOR34", - "AF_VENDOR35", - "AF_VENDOR36", - "AF_VENDOR37", - "AF_VENDOR38", - "AF_VENDOR39", - "AF_VENDOR40", - "AF_VENDOR41", - "AF_VENDOR42", - "AF_VENDOR43", - "AF_VENDOR44", - "AF_VENDOR45", - "AF_VENDOR46", - "AF_VENDOR47", - "AF_WANPIPE", - "AF_X25", - "AI_CANONNAME", - "AI_NUMERICHOST", - "AI_PASSIVE", - "APPLICATION_ERROR", - "ARPHRD_ADAPT", - "ARPHRD_APPLETLK", - "ARPHRD_ARCNET", - "ARPHRD_ASH", - "ARPHRD_ATM", - "ARPHRD_AX25", - "ARPHRD_BIF", - "ARPHRD_CHAOS", - "ARPHRD_CISCO", - "ARPHRD_CSLIP", - "ARPHRD_CSLIP6", - "ARPHRD_DDCMP", - "ARPHRD_DLCI", - "ARPHRD_ECONET", - "ARPHRD_EETHER", - "ARPHRD_ETHER", - "ARPHRD_EUI64", - "ARPHRD_FCAL", - "ARPHRD_FCFABRIC", - "ARPHRD_FCPL", - "ARPHRD_FCPP", - "ARPHRD_FDDI", - "ARPHRD_FRAD", - "ARPHRD_FRELAY", - "ARPHRD_HDLC", - "ARPHRD_HIPPI", - "ARPHRD_HWX25", - "ARPHRD_IEEE1394", - "ARPHRD_IEEE802", - "ARPHRD_IEEE80211", - "ARPHRD_IEEE80211_PRISM", - "ARPHRD_IEEE80211_RADIOTAP", - "ARPHRD_IEEE802154", - "ARPHRD_IEEE802154_PHY", - "ARPHRD_IEEE802_TR", - "ARPHRD_INFINIBAND", - "ARPHRD_IPDDP", - "ARPHRD_IPGRE", - "ARPHRD_IRDA", - "ARPHRD_LAPB", - "ARPHRD_LOCALTLK", - "ARPHRD_LOOPBACK", - "ARPHRD_METRICOM", - "ARPHRD_NETROM", - "ARPHRD_NONE", - "ARPHRD_PIMREG", - "ARPHRD_PPP", - "ARPHRD_PRONET", - "ARPHRD_RAWHDLC", - "ARPHRD_ROSE", - "ARPHRD_RSRVD", - "ARPHRD_SIT", - "ARPHRD_SKIP", - "ARPHRD_SLIP", - "ARPHRD_SLIP6", - "ARPHRD_STRIP", - "ARPHRD_TUNNEL", - "ARPHRD_TUNNEL6", - "ARPHRD_VOID", - "ARPHRD_X25", - "AUTHTYPE_CLIENT", - "AUTHTYPE_SERVER", - "Accept", - "Accept4", - "AcceptEx", - "Access", - "Acct", - "AddrinfoW", - "Adjtime", - "Adjtimex", - "AttachLsf", - "B0", - "B1000000", - "B110", - "B115200", - "B1152000", - "B1200", - "B134", - "B14400", - "B150", - "B1500000", - "B1800", - "B19200", - "B200", - "B2000000", - "B230400", - "B2400", - "B2500000", - "B28800", - "B300", - "B3000000", - "B3500000", - "B38400", - "B4000000", - "B460800", - "B4800", - "B50", - "B500000", - "B57600", - "B576000", - "B600", - "B7200", - "B75", - "B76800", - "B921600", - "B9600", - "BASE_PROTOCOL", - "BIOCFEEDBACK", - "BIOCFLUSH", - "BIOCGBLEN", - "BIOCGDIRECTION", - "BIOCGDIRFILT", - "BIOCGDLT", - "BIOCGDLTLIST", - "BIOCGETBUFMODE", - "BIOCGETIF", - "BIOCGETZMAX", - "BIOCGFEEDBACK", - "BIOCGFILDROP", - "BIOCGHDRCMPLT", - "BIOCGRSIG", - "BIOCGRTIMEOUT", - "BIOCGSEESENT", - "BIOCGSTATS", - "BIOCGSTATSOLD", - "BIOCGTSTAMP", - "BIOCIMMEDIATE", - "BIOCLOCK", - "BIOCPROMISC", - "BIOCROTZBUF", - "BIOCSBLEN", - "BIOCSDIRECTION", - "BIOCSDIRFILT", - "BIOCSDLT", - "BIOCSETBUFMODE", - "BIOCSETF", - "BIOCSETFNR", - "BIOCSETIF", - "BIOCSETWF", - "BIOCSETZBUF", - "BIOCSFEEDBACK", - "BIOCSFILDROP", - "BIOCSHDRCMPLT", - "BIOCSRSIG", - "BIOCSRTIMEOUT", - "BIOCSSEESENT", - "BIOCSTCPF", - "BIOCSTSTAMP", - "BIOCSUDPF", - "BIOCVERSION", - "BPF_A", - "BPF_ABS", - "BPF_ADD", - "BPF_ALIGNMENT", - "BPF_ALIGNMENT32", - "BPF_ALU", - "BPF_AND", - "BPF_B", - "BPF_BUFMODE_BUFFER", - "BPF_BUFMODE_ZBUF", - "BPF_DFLTBUFSIZE", - "BPF_DIRECTION_IN", - "BPF_DIRECTION_OUT", - "BPF_DIV", - "BPF_H", - "BPF_IMM", - "BPF_IND", - "BPF_JA", - "BPF_JEQ", - "BPF_JGE", - "BPF_JGT", - "BPF_JMP", - "BPF_JSET", - "BPF_K", - "BPF_LD", - "BPF_LDX", - "BPF_LEN", - "BPF_LSH", - "BPF_MAJOR_VERSION", - "BPF_MAXBUFSIZE", - "BPF_MAXINSNS", - "BPF_MEM", - "BPF_MEMWORDS", - "BPF_MINBUFSIZE", - "BPF_MINOR_VERSION", - "BPF_MISC", - "BPF_MSH", - "BPF_MUL", - "BPF_NEG", - "BPF_OR", - "BPF_RELEASE", - "BPF_RET", - "BPF_RSH", - "BPF_ST", - "BPF_STX", - "BPF_SUB", - "BPF_TAX", - "BPF_TXA", - "BPF_T_BINTIME", - "BPF_T_BINTIME_FAST", - "BPF_T_BINTIME_MONOTONIC", - "BPF_T_BINTIME_MONOTONIC_FAST", - "BPF_T_FAST", - "BPF_T_FLAG_MASK", - "BPF_T_FORMAT_MASK", - "BPF_T_MICROTIME", - "BPF_T_MICROTIME_FAST", - "BPF_T_MICROTIME_MONOTONIC", - "BPF_T_MICROTIME_MONOTONIC_FAST", - "BPF_T_MONOTONIC", - "BPF_T_MONOTONIC_FAST", - "BPF_T_NANOTIME", - "BPF_T_NANOTIME_FAST", - "BPF_T_NANOTIME_MONOTONIC", - "BPF_T_NANOTIME_MONOTONIC_FAST", - "BPF_T_NONE", - "BPF_T_NORMAL", - "BPF_W", - "BPF_X", - "BRKINT", - "Bind", - "BindToDevice", - "BpfBuflen", - "BpfDatalink", - "BpfHdr", - "BpfHeadercmpl", - "BpfInsn", - "BpfInterface", - "BpfJump", - "BpfProgram", - "BpfStat", - "BpfStats", - "BpfStmt", - "BpfTimeout", - "BpfTimeval", - "BpfVersion", - "BpfZbuf", - "BpfZbufHeader", - "ByHandleFileInformation", - "BytePtrFromString", - "ByteSliceFromString", - "CCR0_FLUSH", - "CERT_CHAIN_POLICY_AUTHENTICODE", - "CERT_CHAIN_POLICY_AUTHENTICODE_TS", - "CERT_CHAIN_POLICY_BASE", - "CERT_CHAIN_POLICY_BASIC_CONSTRAINTS", - "CERT_CHAIN_POLICY_EV", - "CERT_CHAIN_POLICY_MICROSOFT_ROOT", - "CERT_CHAIN_POLICY_NT_AUTH", - "CERT_CHAIN_POLICY_SSL", - "CERT_E_CN_NO_MATCH", - "CERT_E_EXPIRED", - "CERT_E_PURPOSE", - "CERT_E_ROLE", - "CERT_E_UNTRUSTEDROOT", - "CERT_STORE_ADD_ALWAYS", - "CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG", - "CERT_STORE_PROV_MEMORY", - "CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT", - "CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT", - "CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT", - "CERT_TRUST_HAS_NOT_SUPPORTED_CRITICAL_EXT", - "CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT", - "CERT_TRUST_INVALID_BASIC_CONSTRAINTS", - "CERT_TRUST_INVALID_EXTENSION", - "CERT_TRUST_INVALID_NAME_CONSTRAINTS", - "CERT_TRUST_INVALID_POLICY_CONSTRAINTS", - "CERT_TRUST_IS_CYCLIC", - "CERT_TRUST_IS_EXPLICIT_DISTRUST", - "CERT_TRUST_IS_NOT_SIGNATURE_VALID", - "CERT_TRUST_IS_NOT_TIME_VALID", - "CERT_TRUST_IS_NOT_VALID_FOR_USAGE", - "CERT_TRUST_IS_OFFLINE_REVOCATION", - "CERT_TRUST_IS_REVOKED", - "CERT_TRUST_IS_UNTRUSTED_ROOT", - "CERT_TRUST_NO_ERROR", - "CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY", - "CERT_TRUST_REVOCATION_STATUS_UNKNOWN", - "CFLUSH", - "CLOCAL", - "CLONE_CHILD_CLEARTID", - "CLONE_CHILD_SETTID", - "CLONE_CSIGNAL", - "CLONE_DETACHED", - "CLONE_FILES", - "CLONE_FS", - "CLONE_IO", - "CLONE_NEWIPC", - "CLONE_NEWNET", - "CLONE_NEWNS", - "CLONE_NEWPID", - "CLONE_NEWUSER", - "CLONE_NEWUTS", - "CLONE_PARENT", - "CLONE_PARENT_SETTID", - "CLONE_PID", - "CLONE_PTRACE", - "CLONE_SETTLS", - "CLONE_SIGHAND", - "CLONE_SYSVSEM", - "CLONE_THREAD", - "CLONE_UNTRACED", - "CLONE_VFORK", - "CLONE_VM", - "CPUID_CFLUSH", - "CREAD", - "CREATE_ALWAYS", - "CREATE_NEW", - "CREATE_NEW_PROCESS_GROUP", - "CREATE_UNICODE_ENVIRONMENT", - "CRYPT_DEFAULT_CONTAINER_OPTIONAL", - "CRYPT_DELETEKEYSET", - "CRYPT_MACHINE_KEYSET", - "CRYPT_NEWKEYSET", - "CRYPT_SILENT", - "CRYPT_VERIFYCONTEXT", - "CS5", - "CS6", - "CS7", - "CS8", - "CSIZE", - "CSTART", - "CSTATUS", - "CSTOP", - "CSTOPB", - "CSUSP", - "CTL_MAXNAME", - "CTL_NET", - "CTL_QUERY", - "CTRL_BREAK_EVENT", - "CTRL_C_EVENT", - "CancelIo", - "CancelIoEx", - "CertAddCertificateContextToStore", - "CertChainContext", - "CertChainElement", - "CertChainPara", - "CertChainPolicyPara", - "CertChainPolicyStatus", - "CertCloseStore", - "CertContext", - "CertCreateCertificateContext", - "CertEnhKeyUsage", - "CertEnumCertificatesInStore", - "CertFreeCertificateChain", - "CertFreeCertificateContext", - "CertGetCertificateChain", - "CertInfo", - "CertOpenStore", - "CertOpenSystemStore", - "CertRevocationCrlInfo", - "CertRevocationInfo", - "CertSimpleChain", - "CertTrustListInfo", - "CertTrustStatus", - "CertUsageMatch", - "CertVerifyCertificateChainPolicy", - "Chdir", - "CheckBpfVersion", - "Chflags", - "Chmod", - "Chown", - "Chroot", - "Clearenv", - "Close", - "CloseHandle", - "CloseOnExec", - "Closesocket", - "CmsgLen", - "CmsgSpace", - "Cmsghdr", - "CommandLineToArgv", - "ComputerName", - "Conn", - "Connect", - "ConnectEx", - "ConvertSidToStringSid", - "ConvertStringSidToSid", - "CopySid", - "Creat", - "CreateDirectory", - "CreateFile", - "CreateFileMapping", - "CreateHardLink", - "CreateIoCompletionPort", - "CreatePipe", - "CreateProcess", - "CreateProcessAsUser", - "CreateSymbolicLink", - "CreateToolhelp32Snapshot", - "Credential", - "CryptAcquireContext", - "CryptGenRandom", - "CryptReleaseContext", - "DIOCBSFLUSH", - "DIOCOSFPFLUSH", - "DLL", - "DLLError", - "DLT_A429", - "DLT_A653_ICM", - "DLT_AIRONET_HEADER", - "DLT_AOS", - "DLT_APPLE_IP_OVER_IEEE1394", - "DLT_ARCNET", - "DLT_ARCNET_LINUX", - "DLT_ATM_CLIP", - "DLT_ATM_RFC1483", - "DLT_AURORA", - "DLT_AX25", - "DLT_AX25_KISS", - "DLT_BACNET_MS_TP", - "DLT_BLUETOOTH_HCI_H4", - "DLT_BLUETOOTH_HCI_H4_WITH_PHDR", - "DLT_CAN20B", - "DLT_CAN_SOCKETCAN", - "DLT_CHAOS", - "DLT_CHDLC", - "DLT_CISCO_IOS", - "DLT_C_HDLC", - "DLT_C_HDLC_WITH_DIR", - "DLT_DBUS", - "DLT_DECT", - "DLT_DOCSIS", - "DLT_DVB_CI", - "DLT_ECONET", - "DLT_EN10MB", - "DLT_EN3MB", - "DLT_ENC", - "DLT_ERF", - "DLT_ERF_ETH", - "DLT_ERF_POS", - "DLT_FC_2", - "DLT_FC_2_WITH_FRAME_DELIMS", - "DLT_FDDI", - "DLT_FLEXRAY", - "DLT_FRELAY", - "DLT_FRELAY_WITH_DIR", - "DLT_GCOM_SERIAL", - "DLT_GCOM_T1E1", - "DLT_GPF_F", - "DLT_GPF_T", - "DLT_GPRS_LLC", - "DLT_GSMTAP_ABIS", - "DLT_GSMTAP_UM", - "DLT_HDLC", - "DLT_HHDLC", - "DLT_HIPPI", - "DLT_IBM_SN", - "DLT_IBM_SP", - "DLT_IEEE802", - "DLT_IEEE802_11", - "DLT_IEEE802_11_RADIO", - "DLT_IEEE802_11_RADIO_AVS", - "DLT_IEEE802_15_4", - "DLT_IEEE802_15_4_LINUX", - "DLT_IEEE802_15_4_NOFCS", - "DLT_IEEE802_15_4_NONASK_PHY", - "DLT_IEEE802_16_MAC_CPS", - "DLT_IEEE802_16_MAC_CPS_RADIO", - "DLT_IPFILTER", - "DLT_IPMB", - "DLT_IPMB_LINUX", - "DLT_IPNET", - "DLT_IPOIB", - "DLT_IPV4", - "DLT_IPV6", - "DLT_IP_OVER_FC", - "DLT_JUNIPER_ATM1", - "DLT_JUNIPER_ATM2", - "DLT_JUNIPER_ATM_CEMIC", - "DLT_JUNIPER_CHDLC", - "DLT_JUNIPER_ES", - "DLT_JUNIPER_ETHER", - "DLT_JUNIPER_FIBRECHANNEL", - "DLT_JUNIPER_FRELAY", - "DLT_JUNIPER_GGSN", - "DLT_JUNIPER_ISM", - "DLT_JUNIPER_MFR", - "DLT_JUNIPER_MLFR", - "DLT_JUNIPER_MLPPP", - "DLT_JUNIPER_MONITOR", - "DLT_JUNIPER_PIC_PEER", - "DLT_JUNIPER_PPP", - "DLT_JUNIPER_PPPOE", - "DLT_JUNIPER_PPPOE_ATM", - "DLT_JUNIPER_SERVICES", - "DLT_JUNIPER_SRX_E2E", - "DLT_JUNIPER_ST", - "DLT_JUNIPER_VP", - "DLT_JUNIPER_VS", - "DLT_LAPB_WITH_DIR", - "DLT_LAPD", - "DLT_LIN", - "DLT_LINUX_EVDEV", - "DLT_LINUX_IRDA", - "DLT_LINUX_LAPD", - "DLT_LINUX_PPP_WITHDIRECTION", - "DLT_LINUX_SLL", - "DLT_LOOP", - "DLT_LTALK", - "DLT_MATCHING_MAX", - "DLT_MATCHING_MIN", - "DLT_MFR", - "DLT_MOST", - "DLT_MPEG_2_TS", - "DLT_MPLS", - "DLT_MTP2", - "DLT_MTP2_WITH_PHDR", - "DLT_MTP3", - "DLT_MUX27010", - "DLT_NETANALYZER", - "DLT_NETANALYZER_TRANSPARENT", - "DLT_NFC_LLCP", - "DLT_NFLOG", - "DLT_NG40", - "DLT_NULL", - "DLT_PCI_EXP", - "DLT_PFLOG", - "DLT_PFSYNC", - "DLT_PPI", - "DLT_PPP", - "DLT_PPP_BSDOS", - "DLT_PPP_ETHER", - "DLT_PPP_PPPD", - "DLT_PPP_SERIAL", - "DLT_PPP_WITH_DIR", - "DLT_PPP_WITH_DIRECTION", - "DLT_PRISM_HEADER", - "DLT_PRONET", - "DLT_RAIF1", - "DLT_RAW", - "DLT_RAWAF_MASK", - "DLT_RIO", - "DLT_SCCP", - "DLT_SITA", - "DLT_SLIP", - "DLT_SLIP_BSDOS", - "DLT_STANAG_5066_D_PDU", - "DLT_SUNATM", - "DLT_SYMANTEC_FIREWALL", - "DLT_TZSP", - "DLT_USB", - "DLT_USB_LINUX", - "DLT_USB_LINUX_MMAPPED", - "DLT_USER0", - "DLT_USER1", - "DLT_USER10", - "DLT_USER11", - "DLT_USER12", - "DLT_USER13", - "DLT_USER14", - "DLT_USER15", - "DLT_USER2", - "DLT_USER3", - "DLT_USER4", - "DLT_USER5", - "DLT_USER6", - "DLT_USER7", - "DLT_USER8", - "DLT_USER9", - "DLT_WIHART", - "DLT_X2E_SERIAL", - "DLT_X2E_XORAYA", - "DNSMXData", - "DNSPTRData", - "DNSRecord", - "DNSSRVData", - "DNSTXTData", - "DNS_INFO_NO_RECORDS", - "DNS_TYPE_A", - "DNS_TYPE_A6", - "DNS_TYPE_AAAA", - "DNS_TYPE_ADDRS", - "DNS_TYPE_AFSDB", - "DNS_TYPE_ALL", - "DNS_TYPE_ANY", - "DNS_TYPE_ATMA", - "DNS_TYPE_AXFR", - "DNS_TYPE_CERT", - "DNS_TYPE_CNAME", - "DNS_TYPE_DHCID", - "DNS_TYPE_DNAME", - "DNS_TYPE_DNSKEY", - "DNS_TYPE_DS", - "DNS_TYPE_EID", - "DNS_TYPE_GID", - "DNS_TYPE_GPOS", - "DNS_TYPE_HINFO", - "DNS_TYPE_ISDN", - "DNS_TYPE_IXFR", - "DNS_TYPE_KEY", - "DNS_TYPE_KX", - "DNS_TYPE_LOC", - "DNS_TYPE_MAILA", - "DNS_TYPE_MAILB", - "DNS_TYPE_MB", - "DNS_TYPE_MD", - "DNS_TYPE_MF", - "DNS_TYPE_MG", - "DNS_TYPE_MINFO", - "DNS_TYPE_MR", - "DNS_TYPE_MX", - "DNS_TYPE_NAPTR", - "DNS_TYPE_NBSTAT", - "DNS_TYPE_NIMLOC", - "DNS_TYPE_NS", - "DNS_TYPE_NSAP", - "DNS_TYPE_NSAPPTR", - "DNS_TYPE_NSEC", - "DNS_TYPE_NULL", - "DNS_TYPE_NXT", - "DNS_TYPE_OPT", - "DNS_TYPE_PTR", - "DNS_TYPE_PX", - "DNS_TYPE_RP", - "DNS_TYPE_RRSIG", - "DNS_TYPE_RT", - "DNS_TYPE_SIG", - "DNS_TYPE_SINK", - "DNS_TYPE_SOA", - "DNS_TYPE_SRV", - "DNS_TYPE_TEXT", - "DNS_TYPE_TKEY", - "DNS_TYPE_TSIG", - "DNS_TYPE_UID", - "DNS_TYPE_UINFO", - "DNS_TYPE_UNSPEC", - "DNS_TYPE_WINS", - "DNS_TYPE_WINSR", - "DNS_TYPE_WKS", - "DNS_TYPE_X25", - "DT_BLK", - "DT_CHR", - "DT_DIR", - "DT_FIFO", - "DT_LNK", - "DT_REG", - "DT_SOCK", - "DT_UNKNOWN", - "DT_WHT", - "DUPLICATE_CLOSE_SOURCE", - "DUPLICATE_SAME_ACCESS", - "DeleteFile", - "DetachLsf", - "DeviceIoControl", - "Dirent", - "DnsNameCompare", - "DnsQuery", - "DnsRecordListFree", - "DnsSectionAdditional", - "DnsSectionAnswer", - "DnsSectionAuthority", - "DnsSectionQuestion", - "Dup", - "Dup2", - "Dup3", - "DuplicateHandle", - "E2BIG", - "EACCES", - "EADDRINUSE", - "EADDRNOTAVAIL", - "EADV", - "EAFNOSUPPORT", - "EAGAIN", - "EALREADY", - "EAUTH", - "EBADARCH", - "EBADE", - "EBADEXEC", - "EBADF", - "EBADFD", - "EBADMACHO", - "EBADMSG", - "EBADR", - "EBADRPC", - "EBADRQC", - "EBADSLT", - "EBFONT", - "EBUSY", - "ECANCELED", - "ECAPMODE", - "ECHILD", - "ECHO", - "ECHOCTL", - "ECHOE", - "ECHOK", - "ECHOKE", - "ECHONL", - "ECHOPRT", - "ECHRNG", - "ECOMM", - "ECONNABORTED", - "ECONNREFUSED", - "ECONNRESET", - "EDEADLK", - "EDEADLOCK", - "EDESTADDRREQ", - "EDEVERR", - "EDOM", - "EDOOFUS", - "EDOTDOT", - "EDQUOT", - "EEXIST", - "EFAULT", - "EFBIG", - "EFER_LMA", - "EFER_LME", - "EFER_NXE", - "EFER_SCE", - "EFTYPE", - "EHOSTDOWN", - "EHOSTUNREACH", - "EHWPOISON", - "EIDRM", - "EILSEQ", - "EINPROGRESS", - "EINTR", - "EINVAL", - "EIO", - "EIPSEC", - "EISCONN", - "EISDIR", - "EISNAM", - "EKEYEXPIRED", - "EKEYREJECTED", - "EKEYREVOKED", - "EL2HLT", - "EL2NSYNC", - "EL3HLT", - "EL3RST", - "ELAST", - "ELF_NGREG", - "ELF_PRARGSZ", - "ELIBACC", - "ELIBBAD", - "ELIBEXEC", - "ELIBMAX", - "ELIBSCN", - "ELNRNG", - "ELOOP", - "EMEDIUMTYPE", - "EMFILE", - "EMLINK", - "EMSGSIZE", - "EMT_TAGOVF", - "EMULTIHOP", - "EMUL_ENABLED", - "EMUL_LINUX", - "EMUL_LINUX32", - "EMUL_MAXID", - "EMUL_NATIVE", - "ENAMETOOLONG", - "ENAVAIL", - "ENDRUNDISC", - "ENEEDAUTH", - "ENETDOWN", - "ENETRESET", - "ENETUNREACH", - "ENFILE", - "ENOANO", - "ENOATTR", - "ENOBUFS", - "ENOCSI", - "ENODATA", - "ENODEV", - "ENOENT", - "ENOEXEC", - "ENOKEY", - "ENOLCK", - "ENOLINK", - "ENOMEDIUM", - "ENOMEM", - "ENOMSG", - "ENONET", - "ENOPKG", - "ENOPOLICY", - "ENOPROTOOPT", - "ENOSPC", - "ENOSR", - "ENOSTR", - "ENOSYS", - "ENOTBLK", - "ENOTCAPABLE", - "ENOTCONN", - "ENOTDIR", - "ENOTEMPTY", - "ENOTNAM", - "ENOTRECOVERABLE", - "ENOTSOCK", - "ENOTSUP", - "ENOTTY", - "ENOTUNIQ", - "ENXIO", - "EN_SW_CTL_INF", - "EN_SW_CTL_PREC", - "EN_SW_CTL_ROUND", - "EN_SW_DATACHAIN", - "EN_SW_DENORM", - "EN_SW_INVOP", - "EN_SW_OVERFLOW", - "EN_SW_PRECLOSS", - "EN_SW_UNDERFLOW", - "EN_SW_ZERODIV", - "EOPNOTSUPP", - "EOVERFLOW", - "EOWNERDEAD", - "EPERM", - "EPFNOSUPPORT", - "EPIPE", - "EPOLLERR", - "EPOLLET", - "EPOLLHUP", - "EPOLLIN", - "EPOLLMSG", - "EPOLLONESHOT", - "EPOLLOUT", - "EPOLLPRI", - "EPOLLRDBAND", - "EPOLLRDHUP", - "EPOLLRDNORM", - "EPOLLWRBAND", - "EPOLLWRNORM", - "EPOLL_CLOEXEC", - "EPOLL_CTL_ADD", - "EPOLL_CTL_DEL", - "EPOLL_CTL_MOD", - "EPOLL_NONBLOCK", - "EPROCLIM", - "EPROCUNAVAIL", - "EPROGMISMATCH", - "EPROGUNAVAIL", - "EPROTO", - "EPROTONOSUPPORT", - "EPROTOTYPE", - "EPWROFF", - "ERANGE", - "EREMCHG", - "EREMOTE", - "EREMOTEIO", - "ERESTART", - "ERFKILL", - "EROFS", - "ERPCMISMATCH", - "ERROR_ACCESS_DENIED", - "ERROR_ALREADY_EXISTS", - "ERROR_BROKEN_PIPE", - "ERROR_BUFFER_OVERFLOW", - "ERROR_DIR_NOT_EMPTY", - "ERROR_ENVVAR_NOT_FOUND", - "ERROR_FILE_EXISTS", - "ERROR_FILE_NOT_FOUND", - "ERROR_HANDLE_EOF", - "ERROR_INSUFFICIENT_BUFFER", - "ERROR_IO_PENDING", - "ERROR_MOD_NOT_FOUND", - "ERROR_MORE_DATA", - "ERROR_NETNAME_DELETED", - "ERROR_NOT_FOUND", - "ERROR_NO_MORE_FILES", - "ERROR_OPERATION_ABORTED", - "ERROR_PATH_NOT_FOUND", - "ERROR_PRIVILEGE_NOT_HELD", - "ERROR_PROC_NOT_FOUND", - "ESHLIBVERS", - "ESHUTDOWN", - "ESOCKTNOSUPPORT", - "ESPIPE", - "ESRCH", - "ESRMNT", - "ESTALE", - "ESTRPIPE", - "ETHERCAP_JUMBO_MTU", - "ETHERCAP_VLAN_HWTAGGING", - "ETHERCAP_VLAN_MTU", - "ETHERMIN", - "ETHERMTU", - "ETHERMTU_JUMBO", - "ETHERTYPE_8023", - "ETHERTYPE_AARP", - "ETHERTYPE_ACCTON", - "ETHERTYPE_AEONIC", - "ETHERTYPE_ALPHA", - "ETHERTYPE_AMBER", - "ETHERTYPE_AMOEBA", - "ETHERTYPE_AOE", - "ETHERTYPE_APOLLO", - "ETHERTYPE_APOLLODOMAIN", - "ETHERTYPE_APPLETALK", - "ETHERTYPE_APPLITEK", - "ETHERTYPE_ARGONAUT", - "ETHERTYPE_ARP", - "ETHERTYPE_AT", - "ETHERTYPE_ATALK", - "ETHERTYPE_ATOMIC", - "ETHERTYPE_ATT", - "ETHERTYPE_ATTSTANFORD", - "ETHERTYPE_AUTOPHON", - "ETHERTYPE_AXIS", - "ETHERTYPE_BCLOOP", - "ETHERTYPE_BOFL", - "ETHERTYPE_CABLETRON", - "ETHERTYPE_CHAOS", - "ETHERTYPE_COMDESIGN", - "ETHERTYPE_COMPUGRAPHIC", - "ETHERTYPE_COUNTERPOINT", - "ETHERTYPE_CRONUS", - "ETHERTYPE_CRONUSVLN", - "ETHERTYPE_DCA", - "ETHERTYPE_DDE", - "ETHERTYPE_DEBNI", - "ETHERTYPE_DECAM", - "ETHERTYPE_DECCUST", - "ETHERTYPE_DECDIAG", - "ETHERTYPE_DECDNS", - "ETHERTYPE_DECDTS", - "ETHERTYPE_DECEXPER", - "ETHERTYPE_DECLAST", - "ETHERTYPE_DECLTM", - "ETHERTYPE_DECMUMPS", - "ETHERTYPE_DECNETBIOS", - "ETHERTYPE_DELTACON", - "ETHERTYPE_DIDDLE", - "ETHERTYPE_DLOG1", - "ETHERTYPE_DLOG2", - "ETHERTYPE_DN", - "ETHERTYPE_DOGFIGHT", - "ETHERTYPE_DSMD", - "ETHERTYPE_ECMA", - "ETHERTYPE_ENCRYPT", - "ETHERTYPE_ES", - "ETHERTYPE_EXCELAN", - "ETHERTYPE_EXPERDATA", - "ETHERTYPE_FLIP", - "ETHERTYPE_FLOWCONTROL", - "ETHERTYPE_FRARP", - "ETHERTYPE_GENDYN", - "ETHERTYPE_HAYES", - "ETHERTYPE_HIPPI_FP", - "ETHERTYPE_HITACHI", - "ETHERTYPE_HP", - "ETHERTYPE_IEEEPUP", - "ETHERTYPE_IEEEPUPAT", - "ETHERTYPE_IMLBL", - "ETHERTYPE_IMLBLDIAG", - "ETHERTYPE_IP", - "ETHERTYPE_IPAS", - "ETHERTYPE_IPV6", - "ETHERTYPE_IPX", - "ETHERTYPE_IPXNEW", - "ETHERTYPE_KALPANA", - "ETHERTYPE_LANBRIDGE", - "ETHERTYPE_LANPROBE", - "ETHERTYPE_LAT", - "ETHERTYPE_LBACK", - "ETHERTYPE_LITTLE", - "ETHERTYPE_LLDP", - "ETHERTYPE_LOGICRAFT", - "ETHERTYPE_LOOPBACK", - "ETHERTYPE_MATRA", - "ETHERTYPE_MAX", - "ETHERTYPE_MERIT", - "ETHERTYPE_MICP", - "ETHERTYPE_MOPDL", - "ETHERTYPE_MOPRC", - "ETHERTYPE_MOTOROLA", - "ETHERTYPE_MPLS", - "ETHERTYPE_MPLS_MCAST", - "ETHERTYPE_MUMPS", - "ETHERTYPE_NBPCC", - "ETHERTYPE_NBPCLAIM", - "ETHERTYPE_NBPCLREQ", - "ETHERTYPE_NBPCLRSP", - "ETHERTYPE_NBPCREQ", - "ETHERTYPE_NBPCRSP", - "ETHERTYPE_NBPDG", - "ETHERTYPE_NBPDGB", - "ETHERTYPE_NBPDLTE", - "ETHERTYPE_NBPRAR", - "ETHERTYPE_NBPRAS", - "ETHERTYPE_NBPRST", - "ETHERTYPE_NBPSCD", - "ETHERTYPE_NBPVCD", - "ETHERTYPE_NBS", - "ETHERTYPE_NCD", - "ETHERTYPE_NESTAR", - "ETHERTYPE_NETBEUI", - "ETHERTYPE_NOVELL", - "ETHERTYPE_NS", - "ETHERTYPE_NSAT", - "ETHERTYPE_NSCOMPAT", - "ETHERTYPE_NTRAILER", - "ETHERTYPE_OS9", - "ETHERTYPE_OS9NET", - "ETHERTYPE_PACER", - "ETHERTYPE_PAE", - "ETHERTYPE_PCS", - "ETHERTYPE_PLANNING", - "ETHERTYPE_PPP", - "ETHERTYPE_PPPOE", - "ETHERTYPE_PPPOEDISC", - "ETHERTYPE_PRIMENTS", - "ETHERTYPE_PUP", - "ETHERTYPE_PUPAT", - "ETHERTYPE_QINQ", - "ETHERTYPE_RACAL", - "ETHERTYPE_RATIONAL", - "ETHERTYPE_RAWFR", - "ETHERTYPE_RCL", - "ETHERTYPE_RDP", - "ETHERTYPE_RETIX", - "ETHERTYPE_REVARP", - "ETHERTYPE_SCA", - "ETHERTYPE_SECTRA", - "ETHERTYPE_SECUREDATA", - "ETHERTYPE_SGITW", - "ETHERTYPE_SG_BOUNCE", - "ETHERTYPE_SG_DIAG", - "ETHERTYPE_SG_NETGAMES", - "ETHERTYPE_SG_RESV", - "ETHERTYPE_SIMNET", - "ETHERTYPE_SLOW", - "ETHERTYPE_SLOWPROTOCOLS", - "ETHERTYPE_SNA", - "ETHERTYPE_SNMP", - "ETHERTYPE_SONIX", - "ETHERTYPE_SPIDER", - "ETHERTYPE_SPRITE", - "ETHERTYPE_STP", - "ETHERTYPE_TALARIS", - "ETHERTYPE_TALARISMC", - "ETHERTYPE_TCPCOMP", - "ETHERTYPE_TCPSM", - "ETHERTYPE_TEC", - "ETHERTYPE_TIGAN", - "ETHERTYPE_TRAIL", - "ETHERTYPE_TRANSETHER", - "ETHERTYPE_TYMSHARE", - "ETHERTYPE_UBBST", - "ETHERTYPE_UBDEBUG", - "ETHERTYPE_UBDIAGLOOP", - "ETHERTYPE_UBDL", - "ETHERTYPE_UBNIU", - "ETHERTYPE_UBNMC", - "ETHERTYPE_VALID", - "ETHERTYPE_VARIAN", - "ETHERTYPE_VAXELN", - "ETHERTYPE_VEECO", - "ETHERTYPE_VEXP", - "ETHERTYPE_VGLAB", - "ETHERTYPE_VINES", - "ETHERTYPE_VINESECHO", - "ETHERTYPE_VINESLOOP", - "ETHERTYPE_VITAL", - "ETHERTYPE_VLAN", - "ETHERTYPE_VLTLMAN", - "ETHERTYPE_VPROD", - "ETHERTYPE_VURESERVED", - "ETHERTYPE_WATERLOO", - "ETHERTYPE_WELLFLEET", - "ETHERTYPE_X25", - "ETHERTYPE_X75", - "ETHERTYPE_XNSSM", - "ETHERTYPE_XTP", - "ETHER_ADDR_LEN", - "ETHER_ALIGN", - "ETHER_CRC_LEN", - "ETHER_CRC_POLY_BE", - "ETHER_CRC_POLY_LE", - "ETHER_HDR_LEN", - "ETHER_MAX_DIX_LEN", - "ETHER_MAX_LEN", - "ETHER_MAX_LEN_JUMBO", - "ETHER_MIN_LEN", - "ETHER_PPPOE_ENCAP_LEN", - "ETHER_TYPE_LEN", - "ETHER_VLAN_ENCAP_LEN", - "ETH_P_1588", - "ETH_P_8021Q", - "ETH_P_802_2", - "ETH_P_802_3", - "ETH_P_AARP", - "ETH_P_ALL", - "ETH_P_AOE", - "ETH_P_ARCNET", - "ETH_P_ARP", - "ETH_P_ATALK", - "ETH_P_ATMFATE", - "ETH_P_ATMMPOA", - "ETH_P_AX25", - "ETH_P_BPQ", - "ETH_P_CAIF", - "ETH_P_CAN", - "ETH_P_CONTROL", - "ETH_P_CUST", - "ETH_P_DDCMP", - "ETH_P_DEC", - "ETH_P_DIAG", - "ETH_P_DNA_DL", - "ETH_P_DNA_RC", - "ETH_P_DNA_RT", - "ETH_P_DSA", - "ETH_P_ECONET", - "ETH_P_EDSA", - "ETH_P_FCOE", - "ETH_P_FIP", - "ETH_P_HDLC", - "ETH_P_IEEE802154", - "ETH_P_IEEEPUP", - "ETH_P_IEEEPUPAT", - "ETH_P_IP", - "ETH_P_IPV6", - "ETH_P_IPX", - "ETH_P_IRDA", - "ETH_P_LAT", - "ETH_P_LINK_CTL", - "ETH_P_LOCALTALK", - "ETH_P_LOOP", - "ETH_P_MOBITEX", - "ETH_P_MPLS_MC", - "ETH_P_MPLS_UC", - "ETH_P_PAE", - "ETH_P_PAUSE", - "ETH_P_PHONET", - "ETH_P_PPPTALK", - "ETH_P_PPP_DISC", - "ETH_P_PPP_MP", - "ETH_P_PPP_SES", - "ETH_P_PUP", - "ETH_P_PUPAT", - "ETH_P_RARP", - "ETH_P_SCA", - "ETH_P_SLOW", - "ETH_P_SNAP", - "ETH_P_TEB", - "ETH_P_TIPC", - "ETH_P_TRAILER", - "ETH_P_TR_802_2", - "ETH_P_WAN_PPP", - "ETH_P_WCCP", - "ETH_P_X25", - "ETIME", - "ETIMEDOUT", - "ETOOMANYREFS", - "ETXTBSY", - "EUCLEAN", - "EUNATCH", - "EUSERS", - "EVFILT_AIO", - "EVFILT_FS", - "EVFILT_LIO", - "EVFILT_MACHPORT", - "EVFILT_PROC", - "EVFILT_READ", - "EVFILT_SIGNAL", - "EVFILT_SYSCOUNT", - "EVFILT_THREADMARKER", - "EVFILT_TIMER", - "EVFILT_USER", - "EVFILT_VM", - "EVFILT_VNODE", - "EVFILT_WRITE", - "EV_ADD", - "EV_CLEAR", - "EV_DELETE", - "EV_DISABLE", - "EV_DISPATCH", - "EV_DROP", - "EV_ENABLE", - "EV_EOF", - "EV_ERROR", - "EV_FLAG0", - "EV_FLAG1", - "EV_ONESHOT", - "EV_OOBAND", - "EV_POLL", - "EV_RECEIPT", - "EV_SYSFLAGS", - "EWINDOWS", - "EWOULDBLOCK", - "EXDEV", - "EXFULL", - "EXTA", - "EXTB", - "EXTPROC", - "Environ", - "EpollCreate", - "EpollCreate1", - "EpollCtl", - "EpollEvent", - "EpollWait", - "Errno", - "EscapeArg", - "Exchangedata", - "Exec", - "Exit", - "ExitProcess", - "FD_CLOEXEC", - "FD_SETSIZE", - "FILE_ACTION_ADDED", - "FILE_ACTION_MODIFIED", - "FILE_ACTION_REMOVED", - "FILE_ACTION_RENAMED_NEW_NAME", - "FILE_ACTION_RENAMED_OLD_NAME", - "FILE_APPEND_DATA", - "FILE_ATTRIBUTE_ARCHIVE", - "FILE_ATTRIBUTE_DIRECTORY", - "FILE_ATTRIBUTE_HIDDEN", - "FILE_ATTRIBUTE_NORMAL", - "FILE_ATTRIBUTE_READONLY", - "FILE_ATTRIBUTE_REPARSE_POINT", - "FILE_ATTRIBUTE_SYSTEM", - "FILE_BEGIN", - "FILE_CURRENT", - "FILE_END", - "FILE_FLAG_BACKUP_SEMANTICS", - "FILE_FLAG_OPEN_REPARSE_POINT", - "FILE_FLAG_OVERLAPPED", - "FILE_LIST_DIRECTORY", - "FILE_MAP_COPY", - "FILE_MAP_EXECUTE", - "FILE_MAP_READ", - "FILE_MAP_WRITE", - "FILE_NOTIFY_CHANGE_ATTRIBUTES", - "FILE_NOTIFY_CHANGE_CREATION", - "FILE_NOTIFY_CHANGE_DIR_NAME", - "FILE_NOTIFY_CHANGE_FILE_NAME", - "FILE_NOTIFY_CHANGE_LAST_ACCESS", - "FILE_NOTIFY_CHANGE_LAST_WRITE", - "FILE_NOTIFY_CHANGE_SIZE", - "FILE_SHARE_DELETE", - "FILE_SHARE_READ", - "FILE_SHARE_WRITE", - "FILE_SKIP_COMPLETION_PORT_ON_SUCCESS", - "FILE_SKIP_SET_EVENT_ON_HANDLE", - "FILE_TYPE_CHAR", - "FILE_TYPE_DISK", - "FILE_TYPE_PIPE", - "FILE_TYPE_REMOTE", - "FILE_TYPE_UNKNOWN", - "FILE_WRITE_ATTRIBUTES", - "FLUSHO", - "FORMAT_MESSAGE_ALLOCATE_BUFFER", - "FORMAT_MESSAGE_ARGUMENT_ARRAY", - "FORMAT_MESSAGE_FROM_HMODULE", - "FORMAT_MESSAGE_FROM_STRING", - "FORMAT_MESSAGE_FROM_SYSTEM", - "FORMAT_MESSAGE_IGNORE_INSERTS", - "FORMAT_MESSAGE_MAX_WIDTH_MASK", - "FSCTL_GET_REPARSE_POINT", - "F_ADDFILESIGS", - "F_ADDSIGS", - "F_ALLOCATEALL", - "F_ALLOCATECONTIG", - "F_CANCEL", - "F_CHKCLEAN", - "F_CLOSEM", - "F_DUP2FD", - "F_DUP2FD_CLOEXEC", - "F_DUPFD", - "F_DUPFD_CLOEXEC", - "F_EXLCK", - "F_FLUSH_DATA", - "F_FREEZE_FS", - "F_FSCTL", - "F_FSDIRMASK", - "F_FSIN", - "F_FSINOUT", - "F_FSOUT", - "F_FSPRIV", - "F_FSVOID", - "F_FULLFSYNC", - "F_GETFD", - "F_GETFL", - "F_GETLEASE", - "F_GETLK", - "F_GETLK64", - "F_GETLKPID", - "F_GETNOSIGPIPE", - "F_GETOWN", - "F_GETOWN_EX", - "F_GETPATH", - "F_GETPATH_MTMINFO", - "F_GETPIPE_SZ", - "F_GETPROTECTIONCLASS", - "F_GETSIG", - "F_GLOBAL_NOCACHE", - "F_LOCK", - "F_LOG2PHYS", - "F_LOG2PHYS_EXT", - "F_MARKDEPENDENCY", - "F_MAXFD", - "F_NOCACHE", - "F_NODIRECT", - "F_NOTIFY", - "F_OGETLK", - "F_OK", - "F_OSETLK", - "F_OSETLKW", - "F_PARAM_MASK", - "F_PARAM_MAX", - "F_PATHPKG_CHECK", - "F_PEOFPOSMODE", - "F_PREALLOCATE", - "F_RDADVISE", - "F_RDAHEAD", - "F_RDLCK", - "F_READAHEAD", - "F_READBOOTSTRAP", - "F_SETBACKINGSTORE", - "F_SETFD", - "F_SETFL", - "F_SETLEASE", - "F_SETLK", - "F_SETLK64", - "F_SETLKW", - "F_SETLKW64", - "F_SETLK_REMOTE", - "F_SETNOSIGPIPE", - "F_SETOWN", - "F_SETOWN_EX", - "F_SETPIPE_SZ", - "F_SETPROTECTIONCLASS", - "F_SETSIG", - "F_SETSIZE", - "F_SHLCK", - "F_TEST", - "F_THAW_FS", - "F_TLOCK", - "F_ULOCK", - "F_UNLCK", - "F_UNLCKSYS", - "F_VOLPOSMODE", - "F_WRITEBOOTSTRAP", - "F_WRLCK", - "Faccessat", - "Fallocate", - "Fbootstraptransfer_t", - "Fchdir", - "Fchflags", - "Fchmod", - "Fchmodat", - "Fchown", - "Fchownat", - "FcntlFlock", - "FdSet", - "Fdatasync", - "FileNotifyInformation", - "Filetime", - "FindClose", - "FindFirstFile", - "FindNextFile", - "Flock", - "Flock_t", - "FlushBpf", - "FlushFileBuffers", - "FlushViewOfFile", - "ForkExec", - "ForkLock", - "FormatMessage", - "Fpathconf", - "FreeAddrInfoW", - "FreeEnvironmentStrings", - "FreeLibrary", - "Fsid", - "Fstat", - "Fstatat", - "Fstatfs", - "Fstore_t", - "Fsync", - "Ftruncate", - "FullPath", - "Futimes", - "Futimesat", - "GENERIC_ALL", - "GENERIC_EXECUTE", - "GENERIC_READ", - "GENERIC_WRITE", - "GUID", - "GetAcceptExSockaddrs", - "GetAdaptersInfo", - "GetAddrInfoW", - "GetCommandLine", - "GetComputerName", - "GetConsoleMode", - "GetCurrentDirectory", - "GetCurrentProcess", - "GetEnvironmentStrings", - "GetEnvironmentVariable", - "GetExitCodeProcess", - "GetFileAttributes", - "GetFileAttributesEx", - "GetFileExInfoStandard", - "GetFileExMaxInfoLevel", - "GetFileInformationByHandle", - "GetFileType", - "GetFullPathName", - "GetHostByName", - "GetIfEntry", - "GetLastError", - "GetLengthSid", - "GetLongPathName", - "GetProcAddress", - "GetProcessTimes", - "GetProtoByName", - "GetQueuedCompletionStatus", - "GetServByName", - "GetShortPathName", - "GetStartupInfo", - "GetStdHandle", - "GetSystemTimeAsFileTime", - "GetTempPath", - "GetTimeZoneInformation", - "GetTokenInformation", - "GetUserNameEx", - "GetUserProfileDirectory", - "GetVersion", - "Getcwd", - "Getdents", - "Getdirentries", - "Getdtablesize", - "Getegid", - "Getenv", - "Geteuid", - "Getfsstat", - "Getgid", - "Getgroups", - "Getpagesize", - "Getpeername", - "Getpgid", - "Getpgrp", - "Getpid", - "Getppid", - "Getpriority", - "Getrlimit", - "Getrusage", - "Getsid", - "Getsockname", - "Getsockopt", - "GetsockoptByte", - "GetsockoptICMPv6Filter", - "GetsockoptIPMreq", - "GetsockoptIPMreqn", - "GetsockoptIPv6MTUInfo", - "GetsockoptIPv6Mreq", - "GetsockoptInet4Addr", - "GetsockoptInt", - "GetsockoptUcred", - "Gettid", - "Gettimeofday", - "Getuid", - "Getwd", - "Getxattr", - "HANDLE_FLAG_INHERIT", - "HKEY_CLASSES_ROOT", - "HKEY_CURRENT_CONFIG", - "HKEY_CURRENT_USER", - "HKEY_DYN_DATA", - "HKEY_LOCAL_MACHINE", - "HKEY_PERFORMANCE_DATA", - "HKEY_USERS", - "HUPCL", - "Handle", - "Hostent", - "ICANON", - "ICMP6_FILTER", - "ICMPV6_FILTER", - "ICMPv6Filter", - "ICRNL", - "IEXTEN", - "IFAN_ARRIVAL", - "IFAN_DEPARTURE", - "IFA_ADDRESS", - "IFA_ANYCAST", - "IFA_BROADCAST", - "IFA_CACHEINFO", - "IFA_F_DADFAILED", - "IFA_F_DEPRECATED", - "IFA_F_HOMEADDRESS", - "IFA_F_NODAD", - "IFA_F_OPTIMISTIC", - "IFA_F_PERMANENT", - "IFA_F_SECONDARY", - "IFA_F_TEMPORARY", - "IFA_F_TENTATIVE", - "IFA_LABEL", - "IFA_LOCAL", - "IFA_MAX", - "IFA_MULTICAST", - "IFA_ROUTE", - "IFA_UNSPEC", - "IFF_ALLMULTI", - "IFF_ALTPHYS", - "IFF_AUTOMEDIA", - "IFF_BROADCAST", - "IFF_CANTCHANGE", - "IFF_CANTCONFIG", - "IFF_DEBUG", - "IFF_DRV_OACTIVE", - "IFF_DRV_RUNNING", - "IFF_DYING", - "IFF_DYNAMIC", - "IFF_LINK0", - "IFF_LINK1", - "IFF_LINK2", - "IFF_LOOPBACK", - "IFF_MASTER", - "IFF_MONITOR", - "IFF_MULTICAST", - "IFF_NOARP", - "IFF_NOTRAILERS", - "IFF_NO_PI", - "IFF_OACTIVE", - "IFF_ONE_QUEUE", - "IFF_POINTOPOINT", - "IFF_POINTTOPOINT", - "IFF_PORTSEL", - "IFF_PPROMISC", - "IFF_PROMISC", - "IFF_RENAMING", - "IFF_RUNNING", - "IFF_SIMPLEX", - "IFF_SLAVE", - "IFF_SMART", - "IFF_STATICARP", - "IFF_TAP", - "IFF_TUN", - "IFF_TUN_EXCL", - "IFF_UP", - "IFF_VNET_HDR", - "IFLA_ADDRESS", - "IFLA_BROADCAST", - "IFLA_COST", - "IFLA_IFALIAS", - "IFLA_IFNAME", - "IFLA_LINK", - "IFLA_LINKINFO", - "IFLA_LINKMODE", - "IFLA_MAP", - "IFLA_MASTER", - "IFLA_MAX", - "IFLA_MTU", - "IFLA_NET_NS_PID", - "IFLA_OPERSTATE", - "IFLA_PRIORITY", - "IFLA_PROTINFO", - "IFLA_QDISC", - "IFLA_STATS", - "IFLA_TXQLEN", - "IFLA_UNSPEC", - "IFLA_WEIGHT", - "IFLA_WIRELESS", - "IFNAMSIZ", - "IFT_1822", - "IFT_A12MPPSWITCH", - "IFT_AAL2", - "IFT_AAL5", - "IFT_ADSL", - "IFT_AFLANE8023", - "IFT_AFLANE8025", - "IFT_ARAP", - "IFT_ARCNET", - "IFT_ARCNETPLUS", - "IFT_ASYNC", - "IFT_ATM", - "IFT_ATMDXI", - "IFT_ATMFUNI", - "IFT_ATMIMA", - "IFT_ATMLOGICAL", - "IFT_ATMRADIO", - "IFT_ATMSUBINTERFACE", - "IFT_ATMVCIENDPT", - "IFT_ATMVIRTUAL", - "IFT_BGPPOLICYACCOUNTING", - "IFT_BLUETOOTH", - "IFT_BRIDGE", - "IFT_BSC", - "IFT_CARP", - "IFT_CCTEMUL", - "IFT_CELLULAR", - "IFT_CEPT", - "IFT_CES", - "IFT_CHANNEL", - "IFT_CNR", - "IFT_COFFEE", - "IFT_COMPOSITELINK", - "IFT_DCN", - "IFT_DIGITALPOWERLINE", - "IFT_DIGITALWRAPPEROVERHEADCHANNEL", - "IFT_DLSW", - "IFT_DOCSCABLEDOWNSTREAM", - "IFT_DOCSCABLEMACLAYER", - "IFT_DOCSCABLEUPSTREAM", - "IFT_DOCSCABLEUPSTREAMCHANNEL", - "IFT_DS0", - "IFT_DS0BUNDLE", - "IFT_DS1FDL", - "IFT_DS3", - "IFT_DTM", - "IFT_DUMMY", - "IFT_DVBASILN", - "IFT_DVBASIOUT", - "IFT_DVBRCCDOWNSTREAM", - "IFT_DVBRCCMACLAYER", - "IFT_DVBRCCUPSTREAM", - "IFT_ECONET", - "IFT_ENC", - "IFT_EON", - "IFT_EPLRS", - "IFT_ESCON", - "IFT_ETHER", - "IFT_FAITH", - "IFT_FAST", - "IFT_FASTETHER", - "IFT_FASTETHERFX", - "IFT_FDDI", - "IFT_FIBRECHANNEL", - "IFT_FRAMERELAYINTERCONNECT", - "IFT_FRAMERELAYMPI", - "IFT_FRDLCIENDPT", - "IFT_FRELAY", - "IFT_FRELAYDCE", - "IFT_FRF16MFRBUNDLE", - "IFT_FRFORWARD", - "IFT_G703AT2MB", - "IFT_G703AT64K", - "IFT_GIF", - "IFT_GIGABITETHERNET", - "IFT_GR303IDT", - "IFT_GR303RDT", - "IFT_H323GATEKEEPER", - "IFT_H323PROXY", - "IFT_HDH1822", - "IFT_HDLC", - "IFT_HDSL2", - "IFT_HIPERLAN2", - "IFT_HIPPI", - "IFT_HIPPIINTERFACE", - "IFT_HOSTPAD", - "IFT_HSSI", - "IFT_HY", - "IFT_IBM370PARCHAN", - "IFT_IDSL", - "IFT_IEEE1394", - "IFT_IEEE80211", - "IFT_IEEE80212", - "IFT_IEEE8023ADLAG", - "IFT_IFGSN", - "IFT_IMT", - "IFT_INFINIBAND", - "IFT_INTERLEAVE", - "IFT_IP", - "IFT_IPFORWARD", - "IFT_IPOVERATM", - "IFT_IPOVERCDLC", - "IFT_IPOVERCLAW", - "IFT_IPSWITCH", - "IFT_IPXIP", - "IFT_ISDN", - "IFT_ISDNBASIC", - "IFT_ISDNPRIMARY", - "IFT_ISDNS", - "IFT_ISDNU", - "IFT_ISO88022LLC", - "IFT_ISO88023", - "IFT_ISO88024", - "IFT_ISO88025", - "IFT_ISO88025CRFPINT", - "IFT_ISO88025DTR", - "IFT_ISO88025FIBER", - "IFT_ISO88026", - "IFT_ISUP", - "IFT_L2VLAN", - "IFT_L3IPVLAN", - "IFT_L3IPXVLAN", - "IFT_LAPB", - "IFT_LAPD", - "IFT_LAPF", - "IFT_LINEGROUP", - "IFT_LOCALTALK", - "IFT_LOOP", - "IFT_MEDIAMAILOVERIP", - "IFT_MFSIGLINK", - "IFT_MIOX25", - "IFT_MODEM", - "IFT_MPC", - "IFT_MPLS", - "IFT_MPLSTUNNEL", - "IFT_MSDSL", - "IFT_MVL", - "IFT_MYRINET", - "IFT_NFAS", - "IFT_NSIP", - "IFT_OPTICALCHANNEL", - "IFT_OPTICALTRANSPORT", - "IFT_OTHER", - "IFT_P10", - "IFT_P80", - "IFT_PARA", - "IFT_PDP", - "IFT_PFLOG", - "IFT_PFLOW", - "IFT_PFSYNC", - "IFT_PLC", - "IFT_PON155", - "IFT_PON622", - "IFT_POS", - "IFT_PPP", - "IFT_PPPMULTILINKBUNDLE", - "IFT_PROPATM", - "IFT_PROPBWAP2MP", - "IFT_PROPCNLS", - "IFT_PROPDOCSWIRELESSDOWNSTREAM", - "IFT_PROPDOCSWIRELESSMACLAYER", - "IFT_PROPDOCSWIRELESSUPSTREAM", - "IFT_PROPMUX", - "IFT_PROPVIRTUAL", - "IFT_PROPWIRELESSP2P", - "IFT_PTPSERIAL", - "IFT_PVC", - "IFT_Q2931", - "IFT_QLLC", - "IFT_RADIOMAC", - "IFT_RADSL", - "IFT_REACHDSL", - "IFT_RFC1483", - "IFT_RS232", - "IFT_RSRB", - "IFT_SDLC", - "IFT_SDSL", - "IFT_SHDSL", - "IFT_SIP", - "IFT_SIPSIG", - "IFT_SIPTG", - "IFT_SLIP", - "IFT_SMDSDXI", - "IFT_SMDSICIP", - "IFT_SONET", - "IFT_SONETOVERHEADCHANNEL", - "IFT_SONETPATH", - "IFT_SONETVT", - "IFT_SRP", - "IFT_SS7SIGLINK", - "IFT_STACKTOSTACK", - "IFT_STARLAN", - "IFT_STF", - "IFT_T1", - "IFT_TDLC", - "IFT_TELINK", - "IFT_TERMPAD", - "IFT_TR008", - "IFT_TRANSPHDLC", - "IFT_TUNNEL", - "IFT_ULTRA", - "IFT_USB", - "IFT_V11", - "IFT_V35", - "IFT_V36", - "IFT_V37", - "IFT_VDSL", - "IFT_VIRTUALIPADDRESS", - "IFT_VIRTUALTG", - "IFT_VOICEDID", - "IFT_VOICEEM", - "IFT_VOICEEMFGD", - "IFT_VOICEENCAP", - "IFT_VOICEFGDEANA", - "IFT_VOICEFXO", - "IFT_VOICEFXS", - "IFT_VOICEOVERATM", - "IFT_VOICEOVERCABLE", - "IFT_VOICEOVERFRAMERELAY", - "IFT_VOICEOVERIP", - "IFT_X213", - "IFT_X25", - "IFT_X25DDN", - "IFT_X25HUNTGROUP", - "IFT_X25MLP", - "IFT_X25PLE", - "IFT_XETHER", - "IGNBRK", - "IGNCR", - "IGNORE", - "IGNPAR", - "IMAXBEL", - "INFINITE", - "INLCR", - "INPCK", - "INVALID_FILE_ATTRIBUTES", - "IN_ACCESS", - "IN_ALL_EVENTS", - "IN_ATTRIB", - "IN_CLASSA_HOST", - "IN_CLASSA_MAX", - "IN_CLASSA_NET", - "IN_CLASSA_NSHIFT", - "IN_CLASSB_HOST", - "IN_CLASSB_MAX", - "IN_CLASSB_NET", - "IN_CLASSB_NSHIFT", - "IN_CLASSC_HOST", - "IN_CLASSC_NET", - "IN_CLASSC_NSHIFT", - "IN_CLASSD_HOST", - "IN_CLASSD_NET", - "IN_CLASSD_NSHIFT", - "IN_CLOEXEC", - "IN_CLOSE", - "IN_CLOSE_NOWRITE", - "IN_CLOSE_WRITE", - "IN_CREATE", - "IN_DELETE", - "IN_DELETE_SELF", - "IN_DONT_FOLLOW", - "IN_EXCL_UNLINK", - "IN_IGNORED", - "IN_ISDIR", - "IN_LINKLOCALNETNUM", - "IN_LOOPBACKNET", - "IN_MASK_ADD", - "IN_MODIFY", - "IN_MOVE", - "IN_MOVED_FROM", - "IN_MOVED_TO", - "IN_MOVE_SELF", - "IN_NONBLOCK", - "IN_ONESHOT", - "IN_ONLYDIR", - "IN_OPEN", - "IN_Q_OVERFLOW", - "IN_RFC3021_HOST", - "IN_RFC3021_MASK", - "IN_RFC3021_NET", - "IN_RFC3021_NSHIFT", - "IN_UNMOUNT", - "IOC_IN", - "IOC_INOUT", - "IOC_OUT", - "IOC_VENDOR", - "IOC_WS2", - "IO_REPARSE_TAG_SYMLINK", - "IPMreq", - "IPMreqn", - "IPPROTO_3PC", - "IPPROTO_ADFS", - "IPPROTO_AH", - "IPPROTO_AHIP", - "IPPROTO_APES", - "IPPROTO_ARGUS", - "IPPROTO_AX25", - "IPPROTO_BHA", - "IPPROTO_BLT", - "IPPROTO_BRSATMON", - "IPPROTO_CARP", - "IPPROTO_CFTP", - "IPPROTO_CHAOS", - "IPPROTO_CMTP", - "IPPROTO_COMP", - "IPPROTO_CPHB", - "IPPROTO_CPNX", - "IPPROTO_DCCP", - "IPPROTO_DDP", - "IPPROTO_DGP", - "IPPROTO_DIVERT", - "IPPROTO_DIVERT_INIT", - "IPPROTO_DIVERT_RESP", - "IPPROTO_DONE", - "IPPROTO_DSTOPTS", - "IPPROTO_EGP", - "IPPROTO_EMCON", - "IPPROTO_ENCAP", - "IPPROTO_EON", - "IPPROTO_ESP", - "IPPROTO_ETHERIP", - "IPPROTO_FRAGMENT", - "IPPROTO_GGP", - "IPPROTO_GMTP", - "IPPROTO_GRE", - "IPPROTO_HELLO", - "IPPROTO_HMP", - "IPPROTO_HOPOPTS", - "IPPROTO_ICMP", - "IPPROTO_ICMPV6", - "IPPROTO_IDP", - "IPPROTO_IDPR", - "IPPROTO_IDRP", - "IPPROTO_IGMP", - "IPPROTO_IGP", - "IPPROTO_IGRP", - "IPPROTO_IL", - "IPPROTO_INLSP", - "IPPROTO_INP", - "IPPROTO_IP", - "IPPROTO_IPCOMP", - "IPPROTO_IPCV", - "IPPROTO_IPEIP", - "IPPROTO_IPIP", - "IPPROTO_IPPC", - "IPPROTO_IPV4", - "IPPROTO_IPV6", - "IPPROTO_IPV6_ICMP", - "IPPROTO_IRTP", - "IPPROTO_KRYPTOLAN", - "IPPROTO_LARP", - "IPPROTO_LEAF1", - "IPPROTO_LEAF2", - "IPPROTO_MAX", - "IPPROTO_MAXID", - "IPPROTO_MEAS", - "IPPROTO_MH", - "IPPROTO_MHRP", - "IPPROTO_MICP", - "IPPROTO_MOBILE", - "IPPROTO_MPLS", - "IPPROTO_MTP", - "IPPROTO_MUX", - "IPPROTO_ND", - "IPPROTO_NHRP", - "IPPROTO_NONE", - "IPPROTO_NSP", - "IPPROTO_NVPII", - "IPPROTO_OLD_DIVERT", - "IPPROTO_OSPFIGP", - "IPPROTO_PFSYNC", - "IPPROTO_PGM", - "IPPROTO_PIGP", - "IPPROTO_PIM", - "IPPROTO_PRM", - "IPPROTO_PUP", - "IPPROTO_PVP", - "IPPROTO_RAW", - "IPPROTO_RCCMON", - "IPPROTO_RDP", - "IPPROTO_ROUTING", - "IPPROTO_RSVP", - "IPPROTO_RVD", - "IPPROTO_SATEXPAK", - "IPPROTO_SATMON", - "IPPROTO_SCCSP", - "IPPROTO_SCTP", - "IPPROTO_SDRP", - "IPPROTO_SEND", - "IPPROTO_SEP", - "IPPROTO_SKIP", - "IPPROTO_SPACER", - "IPPROTO_SRPC", - "IPPROTO_ST", - "IPPROTO_SVMTP", - "IPPROTO_SWIPE", - "IPPROTO_TCF", - "IPPROTO_TCP", - "IPPROTO_TLSP", - "IPPROTO_TP", - "IPPROTO_TPXX", - "IPPROTO_TRUNK1", - "IPPROTO_TRUNK2", - "IPPROTO_TTP", - "IPPROTO_UDP", - "IPPROTO_UDPLITE", - "IPPROTO_VINES", - "IPPROTO_VISA", - "IPPROTO_VMTP", - "IPPROTO_VRRP", - "IPPROTO_WBEXPAK", - "IPPROTO_WBMON", - "IPPROTO_WSN", - "IPPROTO_XNET", - "IPPROTO_XTP", - "IPV6_2292DSTOPTS", - "IPV6_2292HOPLIMIT", - "IPV6_2292HOPOPTS", - "IPV6_2292NEXTHOP", - "IPV6_2292PKTINFO", - "IPV6_2292PKTOPTIONS", - "IPV6_2292RTHDR", - "IPV6_ADDRFORM", - "IPV6_ADD_MEMBERSHIP", - "IPV6_AUTHHDR", - "IPV6_AUTH_LEVEL", - "IPV6_AUTOFLOWLABEL", - "IPV6_BINDANY", - "IPV6_BINDV6ONLY", - "IPV6_BOUND_IF", - "IPV6_CHECKSUM", - "IPV6_DEFAULT_MULTICAST_HOPS", - "IPV6_DEFAULT_MULTICAST_LOOP", - "IPV6_DEFHLIM", - "IPV6_DONTFRAG", - "IPV6_DROP_MEMBERSHIP", - "IPV6_DSTOPTS", - "IPV6_ESP_NETWORK_LEVEL", - "IPV6_ESP_TRANS_LEVEL", - "IPV6_FAITH", - "IPV6_FLOWINFO_MASK", - "IPV6_FLOWLABEL_MASK", - "IPV6_FRAGTTL", - "IPV6_FW_ADD", - "IPV6_FW_DEL", - "IPV6_FW_FLUSH", - "IPV6_FW_GET", - "IPV6_FW_ZERO", - "IPV6_HLIMDEC", - "IPV6_HOPLIMIT", - "IPV6_HOPOPTS", - "IPV6_IPCOMP_LEVEL", - "IPV6_IPSEC_POLICY", - "IPV6_JOIN_ANYCAST", - "IPV6_JOIN_GROUP", - "IPV6_LEAVE_ANYCAST", - "IPV6_LEAVE_GROUP", - "IPV6_MAXHLIM", - "IPV6_MAXOPTHDR", - "IPV6_MAXPACKET", - "IPV6_MAX_GROUP_SRC_FILTER", - "IPV6_MAX_MEMBERSHIPS", - "IPV6_MAX_SOCK_SRC_FILTER", - "IPV6_MIN_MEMBERSHIPS", - "IPV6_MMTU", - "IPV6_MSFILTER", - "IPV6_MTU", - "IPV6_MTU_DISCOVER", - "IPV6_MULTICAST_HOPS", - "IPV6_MULTICAST_IF", - "IPV6_MULTICAST_LOOP", - "IPV6_NEXTHOP", - "IPV6_OPTIONS", - "IPV6_PATHMTU", - "IPV6_PIPEX", - "IPV6_PKTINFO", - "IPV6_PMTUDISC_DO", - "IPV6_PMTUDISC_DONT", - "IPV6_PMTUDISC_PROBE", - "IPV6_PMTUDISC_WANT", - "IPV6_PORTRANGE", - "IPV6_PORTRANGE_DEFAULT", - "IPV6_PORTRANGE_HIGH", - "IPV6_PORTRANGE_LOW", - "IPV6_PREFER_TEMPADDR", - "IPV6_RECVDSTOPTS", - "IPV6_RECVDSTPORT", - "IPV6_RECVERR", - "IPV6_RECVHOPLIMIT", - "IPV6_RECVHOPOPTS", - "IPV6_RECVPATHMTU", - "IPV6_RECVPKTINFO", - "IPV6_RECVRTHDR", - "IPV6_RECVTCLASS", - "IPV6_ROUTER_ALERT", - "IPV6_RTABLE", - "IPV6_RTHDR", - "IPV6_RTHDRDSTOPTS", - "IPV6_RTHDR_LOOSE", - "IPV6_RTHDR_STRICT", - "IPV6_RTHDR_TYPE_0", - "IPV6_RXDSTOPTS", - "IPV6_RXHOPOPTS", - "IPV6_SOCKOPT_RESERVED1", - "IPV6_TCLASS", - "IPV6_UNICAST_HOPS", - "IPV6_USE_MIN_MTU", - "IPV6_V6ONLY", - "IPV6_VERSION", - "IPV6_VERSION_MASK", - "IPV6_XFRM_POLICY", - "IP_ADD_MEMBERSHIP", - "IP_ADD_SOURCE_MEMBERSHIP", - "IP_AUTH_LEVEL", - "IP_BINDANY", - "IP_BLOCK_SOURCE", - "IP_BOUND_IF", - "IP_DEFAULT_MULTICAST_LOOP", - "IP_DEFAULT_MULTICAST_TTL", - "IP_DF", - "IP_DIVERTFL", - "IP_DONTFRAG", - "IP_DROP_MEMBERSHIP", - "IP_DROP_SOURCE_MEMBERSHIP", - "IP_DUMMYNET3", - "IP_DUMMYNET_CONFIGURE", - "IP_DUMMYNET_DEL", - "IP_DUMMYNET_FLUSH", - "IP_DUMMYNET_GET", - "IP_EF", - "IP_ERRORMTU", - "IP_ESP_NETWORK_LEVEL", - "IP_ESP_TRANS_LEVEL", - "IP_FAITH", - "IP_FREEBIND", - "IP_FW3", - "IP_FW_ADD", - "IP_FW_DEL", - "IP_FW_FLUSH", - "IP_FW_GET", - "IP_FW_NAT_CFG", - "IP_FW_NAT_DEL", - "IP_FW_NAT_GET_CONFIG", - "IP_FW_NAT_GET_LOG", - "IP_FW_RESETLOG", - "IP_FW_TABLE_ADD", - "IP_FW_TABLE_DEL", - "IP_FW_TABLE_FLUSH", - "IP_FW_TABLE_GETSIZE", - "IP_FW_TABLE_LIST", - "IP_FW_ZERO", - "IP_HDRINCL", - "IP_IPCOMP_LEVEL", - "IP_IPSECFLOWINFO", - "IP_IPSEC_LOCAL_AUTH", - "IP_IPSEC_LOCAL_CRED", - "IP_IPSEC_LOCAL_ID", - "IP_IPSEC_POLICY", - "IP_IPSEC_REMOTE_AUTH", - "IP_IPSEC_REMOTE_CRED", - "IP_IPSEC_REMOTE_ID", - "IP_MAXPACKET", - "IP_MAX_GROUP_SRC_FILTER", - "IP_MAX_MEMBERSHIPS", - "IP_MAX_SOCK_MUTE_FILTER", - "IP_MAX_SOCK_SRC_FILTER", - "IP_MAX_SOURCE_FILTER", - "IP_MF", - "IP_MINFRAGSIZE", - "IP_MINTTL", - "IP_MIN_MEMBERSHIPS", - "IP_MSFILTER", - "IP_MSS", - "IP_MTU", - "IP_MTU_DISCOVER", - "IP_MULTICAST_IF", - "IP_MULTICAST_IFINDEX", - "IP_MULTICAST_LOOP", - "IP_MULTICAST_TTL", - "IP_MULTICAST_VIF", - "IP_NAT__XXX", - "IP_OFFMASK", - "IP_OLD_FW_ADD", - "IP_OLD_FW_DEL", - "IP_OLD_FW_FLUSH", - "IP_OLD_FW_GET", - "IP_OLD_FW_RESETLOG", - "IP_OLD_FW_ZERO", - "IP_ONESBCAST", - "IP_OPTIONS", - "IP_ORIGDSTADDR", - "IP_PASSSEC", - "IP_PIPEX", - "IP_PKTINFO", - "IP_PKTOPTIONS", - "IP_PMTUDISC", - "IP_PMTUDISC_DO", - "IP_PMTUDISC_DONT", - "IP_PMTUDISC_PROBE", - "IP_PMTUDISC_WANT", - "IP_PORTRANGE", - "IP_PORTRANGE_DEFAULT", - "IP_PORTRANGE_HIGH", - "IP_PORTRANGE_LOW", - "IP_RECVDSTADDR", - "IP_RECVDSTPORT", - "IP_RECVERR", - "IP_RECVIF", - "IP_RECVOPTS", - "IP_RECVORIGDSTADDR", - "IP_RECVPKTINFO", - "IP_RECVRETOPTS", - "IP_RECVRTABLE", - "IP_RECVTOS", - "IP_RECVTTL", - "IP_RETOPTS", - "IP_RF", - "IP_ROUTER_ALERT", - "IP_RSVP_OFF", - "IP_RSVP_ON", - "IP_RSVP_VIF_OFF", - "IP_RSVP_VIF_ON", - "IP_RTABLE", - "IP_SENDSRCADDR", - "IP_STRIPHDR", - "IP_TOS", - "IP_TRAFFIC_MGT_BACKGROUND", - "IP_TRANSPARENT", - "IP_TTL", - "IP_UNBLOCK_SOURCE", - "IP_XFRM_POLICY", - "IPv6MTUInfo", - "IPv6Mreq", - "ISIG", - "ISTRIP", - "IUCLC", - "IUTF8", - "IXANY", - "IXOFF", - "IXON", - "IfAddrmsg", - "IfAnnounceMsghdr", - "IfData", - "IfInfomsg", - "IfMsghdr", - "IfaMsghdr", - "IfmaMsghdr", - "IfmaMsghdr2", - "ImplementsGetwd", - "Inet4Pktinfo", - "Inet6Pktinfo", - "InotifyAddWatch", - "InotifyEvent", - "InotifyInit", - "InotifyInit1", - "InotifyRmWatch", - "InterfaceAddrMessage", - "InterfaceAnnounceMessage", - "InterfaceInfo", - "InterfaceMessage", - "InterfaceMulticastAddrMessage", - "InvalidHandle", - "Ioperm", - "Iopl", - "Iovec", - "IpAdapterInfo", - "IpAddrString", - "IpAddressString", - "IpMaskString", - "Issetugid", - "KEY_ALL_ACCESS", - "KEY_CREATE_LINK", - "KEY_CREATE_SUB_KEY", - "KEY_ENUMERATE_SUB_KEYS", - "KEY_EXECUTE", - "KEY_NOTIFY", - "KEY_QUERY_VALUE", - "KEY_READ", - "KEY_SET_VALUE", - "KEY_WOW64_32KEY", - "KEY_WOW64_64KEY", - "KEY_WRITE", - "Kevent", - "Kevent_t", - "Kill", - "Klogctl", - "Kqueue", - "LANG_ENGLISH", - "LAYERED_PROTOCOL", - "LCNT_OVERLOAD_FLUSH", - "LINUX_REBOOT_CMD_CAD_OFF", - "LINUX_REBOOT_CMD_CAD_ON", - "LINUX_REBOOT_CMD_HALT", - "LINUX_REBOOT_CMD_KEXEC", - "LINUX_REBOOT_CMD_POWER_OFF", - "LINUX_REBOOT_CMD_RESTART", - "LINUX_REBOOT_CMD_RESTART2", - "LINUX_REBOOT_CMD_SW_SUSPEND", - "LINUX_REBOOT_MAGIC1", - "LINUX_REBOOT_MAGIC2", - "LOCK_EX", - "LOCK_NB", - "LOCK_SH", - "LOCK_UN", - "LazyDLL", - "LazyProc", - "Lchown", - "Linger", - "Link", - "Listen", - "Listxattr", - "LoadCancelIoEx", - "LoadConnectEx", - "LoadCreateSymbolicLink", - "LoadDLL", - "LoadGetAddrInfo", - "LoadLibrary", - "LoadSetFileCompletionNotificationModes", - "LocalFree", - "Log2phys_t", - "LookupAccountName", - "LookupAccountSid", - "LookupSID", - "LsfJump", - "LsfSocket", - "LsfStmt", - "Lstat", - "MADV_AUTOSYNC", - "MADV_CAN_REUSE", - "MADV_CORE", - "MADV_DOFORK", - "MADV_DONTFORK", - "MADV_DONTNEED", - "MADV_FREE", - "MADV_FREE_REUSABLE", - "MADV_FREE_REUSE", - "MADV_HUGEPAGE", - "MADV_HWPOISON", - "MADV_MERGEABLE", - "MADV_NOCORE", - "MADV_NOHUGEPAGE", - "MADV_NORMAL", - "MADV_NOSYNC", - "MADV_PROTECT", - "MADV_RANDOM", - "MADV_REMOVE", - "MADV_SEQUENTIAL", - "MADV_SPACEAVAIL", - "MADV_UNMERGEABLE", - "MADV_WILLNEED", - "MADV_ZERO_WIRED_PAGES", - "MAP_32BIT", - "MAP_ALIGNED_SUPER", - "MAP_ALIGNMENT_16MB", - "MAP_ALIGNMENT_1TB", - "MAP_ALIGNMENT_256TB", - "MAP_ALIGNMENT_4GB", - "MAP_ALIGNMENT_64KB", - "MAP_ALIGNMENT_64PB", - "MAP_ALIGNMENT_MASK", - "MAP_ALIGNMENT_SHIFT", - "MAP_ANON", - "MAP_ANONYMOUS", - "MAP_COPY", - "MAP_DENYWRITE", - "MAP_EXECUTABLE", - "MAP_FILE", - "MAP_FIXED", - "MAP_FLAGMASK", - "MAP_GROWSDOWN", - "MAP_HASSEMAPHORE", - "MAP_HUGETLB", - "MAP_INHERIT", - "MAP_INHERIT_COPY", - "MAP_INHERIT_DEFAULT", - "MAP_INHERIT_DONATE_COPY", - "MAP_INHERIT_NONE", - "MAP_INHERIT_SHARE", - "MAP_JIT", - "MAP_LOCKED", - "MAP_NOCACHE", - "MAP_NOCORE", - "MAP_NOEXTEND", - "MAP_NONBLOCK", - "MAP_NORESERVE", - "MAP_NOSYNC", - "MAP_POPULATE", - "MAP_PREFAULT_READ", - "MAP_PRIVATE", - "MAP_RENAME", - "MAP_RESERVED0080", - "MAP_RESERVED0100", - "MAP_SHARED", - "MAP_STACK", - "MAP_TRYFIXED", - "MAP_TYPE", - "MAP_WIRED", - "MAXIMUM_REPARSE_DATA_BUFFER_SIZE", - "MAXLEN_IFDESCR", - "MAXLEN_PHYSADDR", - "MAX_ADAPTER_ADDRESS_LENGTH", - "MAX_ADAPTER_DESCRIPTION_LENGTH", - "MAX_ADAPTER_NAME_LENGTH", - "MAX_COMPUTERNAME_LENGTH", - "MAX_INTERFACE_NAME_LEN", - "MAX_LONG_PATH", - "MAX_PATH", - "MAX_PROTOCOL_CHAIN", - "MCL_CURRENT", - "MCL_FUTURE", - "MNT_DETACH", - "MNT_EXPIRE", - "MNT_FORCE", - "MSG_BCAST", - "MSG_CMSG_CLOEXEC", - "MSG_COMPAT", - "MSG_CONFIRM", - "MSG_CONTROLMBUF", - "MSG_CTRUNC", - "MSG_DONTROUTE", - "MSG_DONTWAIT", - "MSG_EOF", - "MSG_EOR", - "MSG_ERRQUEUE", - "MSG_FASTOPEN", - "MSG_FIN", - "MSG_FLUSH", - "MSG_HAVEMORE", - "MSG_HOLD", - "MSG_IOVUSRSPACE", - "MSG_LENUSRSPACE", - "MSG_MCAST", - "MSG_MORE", - "MSG_NAMEMBUF", - "MSG_NBIO", - "MSG_NEEDSA", - "MSG_NOSIGNAL", - "MSG_NOTIFICATION", - "MSG_OOB", - "MSG_PEEK", - "MSG_PROXY", - "MSG_RCVMORE", - "MSG_RST", - "MSG_SEND", - "MSG_SYN", - "MSG_TRUNC", - "MSG_TRYHARD", - "MSG_USERFLAGS", - "MSG_WAITALL", - "MSG_WAITFORONE", - "MSG_WAITSTREAM", - "MS_ACTIVE", - "MS_ASYNC", - "MS_BIND", - "MS_DEACTIVATE", - "MS_DIRSYNC", - "MS_INVALIDATE", - "MS_I_VERSION", - "MS_KERNMOUNT", - "MS_KILLPAGES", - "MS_MANDLOCK", - "MS_MGC_MSK", - "MS_MGC_VAL", - "MS_MOVE", - "MS_NOATIME", - "MS_NODEV", - "MS_NODIRATIME", - "MS_NOEXEC", - "MS_NOSUID", - "MS_NOUSER", - "MS_POSIXACL", - "MS_PRIVATE", - "MS_RDONLY", - "MS_REC", - "MS_RELATIME", - "MS_REMOUNT", - "MS_RMT_MASK", - "MS_SHARED", - "MS_SILENT", - "MS_SLAVE", - "MS_STRICTATIME", - "MS_SYNC", - "MS_SYNCHRONOUS", - "MS_UNBINDABLE", - "Madvise", - "MapViewOfFile", - "MaxTokenInfoClass", - "Mclpool", - "MibIfRow", - "Mkdir", - "Mkdirat", - "Mkfifo", - "Mknod", - "Mknodat", - "Mlock", - "Mlockall", - "Mmap", - "Mount", - "MoveFile", - "Mprotect", - "Msghdr", - "Munlock", - "Munlockall", - "Munmap", - "MustLoadDLL", - "NAME_MAX", - "NETLINK_ADD_MEMBERSHIP", - "NETLINK_AUDIT", - "NETLINK_BROADCAST_ERROR", - "NETLINK_CONNECTOR", - "NETLINK_DNRTMSG", - "NETLINK_DROP_MEMBERSHIP", - "NETLINK_ECRYPTFS", - "NETLINK_FIB_LOOKUP", - "NETLINK_FIREWALL", - "NETLINK_GENERIC", - "NETLINK_INET_DIAG", - "NETLINK_IP6_FW", - "NETLINK_ISCSI", - "NETLINK_KOBJECT_UEVENT", - "NETLINK_NETFILTER", - "NETLINK_NFLOG", - "NETLINK_NO_ENOBUFS", - "NETLINK_PKTINFO", - "NETLINK_RDMA", - "NETLINK_ROUTE", - "NETLINK_SCSITRANSPORT", - "NETLINK_SELINUX", - "NETLINK_UNUSED", - "NETLINK_USERSOCK", - "NETLINK_XFRM", - "NET_RT_DUMP", - "NET_RT_DUMP2", - "NET_RT_FLAGS", - "NET_RT_IFLIST", - "NET_RT_IFLIST2", - "NET_RT_IFLISTL", - "NET_RT_IFMALIST", - "NET_RT_MAXID", - "NET_RT_OIFLIST", - "NET_RT_OOIFLIST", - "NET_RT_STAT", - "NET_RT_STATS", - "NET_RT_TABLE", - "NET_RT_TRASH", - "NLA_ALIGNTO", - "NLA_F_NESTED", - "NLA_F_NET_BYTEORDER", - "NLA_HDRLEN", - "NLMSG_ALIGNTO", - "NLMSG_DONE", - "NLMSG_ERROR", - "NLMSG_HDRLEN", - "NLMSG_MIN_TYPE", - "NLMSG_NOOP", - "NLMSG_OVERRUN", - "NLM_F_ACK", - "NLM_F_APPEND", - "NLM_F_ATOMIC", - "NLM_F_CREATE", - "NLM_F_DUMP", - "NLM_F_ECHO", - "NLM_F_EXCL", - "NLM_F_MATCH", - "NLM_F_MULTI", - "NLM_F_REPLACE", - "NLM_F_REQUEST", - "NLM_F_ROOT", - "NOFLSH", - "NOTE_ABSOLUTE", - "NOTE_ATTRIB", - "NOTE_CHILD", - "NOTE_DELETE", - "NOTE_EOF", - "NOTE_EXEC", - "NOTE_EXIT", - "NOTE_EXITSTATUS", - "NOTE_EXTEND", - "NOTE_FFAND", - "NOTE_FFCOPY", - "NOTE_FFCTRLMASK", - "NOTE_FFLAGSMASK", - "NOTE_FFNOP", - "NOTE_FFOR", - "NOTE_FORK", - "NOTE_LINK", - "NOTE_LOWAT", - "NOTE_NONE", - "NOTE_NSECONDS", - "NOTE_PCTRLMASK", - "NOTE_PDATAMASK", - "NOTE_REAP", - "NOTE_RENAME", - "NOTE_RESOURCEEND", - "NOTE_REVOKE", - "NOTE_SECONDS", - "NOTE_SIGNAL", - "NOTE_TRACK", - "NOTE_TRACKERR", - "NOTE_TRIGGER", - "NOTE_TRUNCATE", - "NOTE_USECONDS", - "NOTE_VM_ERROR", - "NOTE_VM_PRESSURE", - "NOTE_VM_PRESSURE_SUDDEN_TERMINATE", - "NOTE_VM_PRESSURE_TERMINATE", - "NOTE_WRITE", - "NameCanonical", - "NameCanonicalEx", - "NameDisplay", - "NameDnsDomain", - "NameFullyQualifiedDN", - "NameSamCompatible", - "NameServicePrincipal", - "NameUniqueId", - "NameUnknown", - "NameUserPrincipal", - "Nanosleep", - "NetApiBufferFree", - "NetGetJoinInformation", - "NetSetupDomainName", - "NetSetupUnjoined", - "NetSetupUnknownStatus", - "NetSetupWorkgroupName", - "NetUserGetInfo", - "NetlinkMessage", - "NetlinkRIB", - "NetlinkRouteAttr", - "NetlinkRouteRequest", - "NewCallback", - "NewCallbackCDecl", - "NewLazyDLL", - "NlAttr", - "NlMsgerr", - "NlMsghdr", - "NsecToFiletime", - "NsecToTimespec", - "NsecToTimeval", - "Ntohs", - "OCRNL", - "OFDEL", - "OFILL", - "OFIOGETBMAP", - "OID_PKIX_KP_SERVER_AUTH", - "OID_SERVER_GATED_CRYPTO", - "OID_SGC_NETSCAPE", - "OLCUC", - "ONLCR", - "ONLRET", - "ONOCR", - "ONOEOT", - "OPEN_ALWAYS", - "OPEN_EXISTING", - "OPOST", - "O_ACCMODE", - "O_ALERT", - "O_ALT_IO", - "O_APPEND", - "O_ASYNC", - "O_CLOEXEC", - "O_CREAT", - "O_DIRECT", - "O_DIRECTORY", - "O_DSYNC", - "O_EVTONLY", - "O_EXCL", - "O_EXEC", - "O_EXLOCK", - "O_FSYNC", - "O_LARGEFILE", - "O_NDELAY", - "O_NOATIME", - "O_NOCTTY", - "O_NOFOLLOW", - "O_NONBLOCK", - "O_NOSIGPIPE", - "O_POPUP", - "O_RDONLY", - "O_RDWR", - "O_RSYNC", - "O_SHLOCK", - "O_SYMLINK", - "O_SYNC", - "O_TRUNC", - "O_TTY_INIT", - "O_WRONLY", - "Open", - "OpenCurrentProcessToken", - "OpenProcess", - "OpenProcessToken", - "Openat", - "Overlapped", - "PACKET_ADD_MEMBERSHIP", - "PACKET_BROADCAST", - "PACKET_DROP_MEMBERSHIP", - "PACKET_FASTROUTE", - "PACKET_HOST", - "PACKET_LOOPBACK", - "PACKET_MR_ALLMULTI", - "PACKET_MR_MULTICAST", - "PACKET_MR_PROMISC", - "PACKET_MULTICAST", - "PACKET_OTHERHOST", - "PACKET_OUTGOING", - "PACKET_RECV_OUTPUT", - "PACKET_RX_RING", - "PACKET_STATISTICS", - "PAGE_EXECUTE_READ", - "PAGE_EXECUTE_READWRITE", - "PAGE_EXECUTE_WRITECOPY", - "PAGE_READONLY", - "PAGE_READWRITE", - "PAGE_WRITECOPY", - "PARENB", - "PARMRK", - "PARODD", - "PENDIN", - "PFL_HIDDEN", - "PFL_MATCHES_PROTOCOL_ZERO", - "PFL_MULTIPLE_PROTO_ENTRIES", - "PFL_NETWORKDIRECT_PROVIDER", - "PFL_RECOMMENDED_PROTO_ENTRY", - "PF_FLUSH", - "PKCS_7_ASN_ENCODING", - "PMC5_PIPELINE_FLUSH", - "PRIO_PGRP", - "PRIO_PROCESS", - "PRIO_USER", - "PRI_IOFLUSH", - "PROCESS_QUERY_INFORMATION", - "PROCESS_TERMINATE", - "PROT_EXEC", - "PROT_GROWSDOWN", - "PROT_GROWSUP", - "PROT_NONE", - "PROT_READ", - "PROT_WRITE", - "PROV_DH_SCHANNEL", - "PROV_DSS", - "PROV_DSS_DH", - "PROV_EC_ECDSA_FULL", - "PROV_EC_ECDSA_SIG", - "PROV_EC_ECNRA_FULL", - "PROV_EC_ECNRA_SIG", - "PROV_FORTEZZA", - "PROV_INTEL_SEC", - "PROV_MS_EXCHANGE", - "PROV_REPLACE_OWF", - "PROV_RNG", - "PROV_RSA_AES", - "PROV_RSA_FULL", - "PROV_RSA_SCHANNEL", - "PROV_RSA_SIG", - "PROV_SPYRUS_LYNKS", - "PROV_SSL", - "PR_CAPBSET_DROP", - "PR_CAPBSET_READ", - "PR_CLEAR_SECCOMP_FILTER", - "PR_ENDIAN_BIG", - "PR_ENDIAN_LITTLE", - "PR_ENDIAN_PPC_LITTLE", - "PR_FPEMU_NOPRINT", - "PR_FPEMU_SIGFPE", - "PR_FP_EXC_ASYNC", - "PR_FP_EXC_DISABLED", - "PR_FP_EXC_DIV", - "PR_FP_EXC_INV", - "PR_FP_EXC_NONRECOV", - "PR_FP_EXC_OVF", - "PR_FP_EXC_PRECISE", - "PR_FP_EXC_RES", - "PR_FP_EXC_SW_ENABLE", - "PR_FP_EXC_UND", - "PR_GET_DUMPABLE", - "PR_GET_ENDIAN", - "PR_GET_FPEMU", - "PR_GET_FPEXC", - "PR_GET_KEEPCAPS", - "PR_GET_NAME", - "PR_GET_PDEATHSIG", - "PR_GET_SECCOMP", - "PR_GET_SECCOMP_FILTER", - "PR_GET_SECUREBITS", - "PR_GET_TIMERSLACK", - "PR_GET_TIMING", - "PR_GET_TSC", - "PR_GET_UNALIGN", - "PR_MCE_KILL", - "PR_MCE_KILL_CLEAR", - "PR_MCE_KILL_DEFAULT", - "PR_MCE_KILL_EARLY", - "PR_MCE_KILL_GET", - "PR_MCE_KILL_LATE", - "PR_MCE_KILL_SET", - "PR_SECCOMP_FILTER_EVENT", - "PR_SECCOMP_FILTER_SYSCALL", - "PR_SET_DUMPABLE", - "PR_SET_ENDIAN", - "PR_SET_FPEMU", - "PR_SET_FPEXC", - "PR_SET_KEEPCAPS", - "PR_SET_NAME", - "PR_SET_PDEATHSIG", - "PR_SET_PTRACER", - "PR_SET_SECCOMP", - "PR_SET_SECCOMP_FILTER", - "PR_SET_SECUREBITS", - "PR_SET_TIMERSLACK", - "PR_SET_TIMING", - "PR_SET_TSC", - "PR_SET_UNALIGN", - "PR_TASK_PERF_EVENTS_DISABLE", - "PR_TASK_PERF_EVENTS_ENABLE", - "PR_TIMING_STATISTICAL", - "PR_TIMING_TIMESTAMP", - "PR_TSC_ENABLE", - "PR_TSC_SIGSEGV", - "PR_UNALIGN_NOPRINT", - "PR_UNALIGN_SIGBUS", - "PTRACE_ARCH_PRCTL", - "PTRACE_ATTACH", - "PTRACE_CONT", - "PTRACE_DETACH", - "PTRACE_EVENT_CLONE", - "PTRACE_EVENT_EXEC", - "PTRACE_EVENT_EXIT", - "PTRACE_EVENT_FORK", - "PTRACE_EVENT_VFORK", - "PTRACE_EVENT_VFORK_DONE", - "PTRACE_GETCRUNCHREGS", - "PTRACE_GETEVENTMSG", - "PTRACE_GETFPREGS", - "PTRACE_GETFPXREGS", - "PTRACE_GETHBPREGS", - "PTRACE_GETREGS", - "PTRACE_GETREGSET", - "PTRACE_GETSIGINFO", - "PTRACE_GETVFPREGS", - "PTRACE_GETWMMXREGS", - "PTRACE_GET_THREAD_AREA", - "PTRACE_KILL", - "PTRACE_OLDSETOPTIONS", - "PTRACE_O_MASK", - "PTRACE_O_TRACECLONE", - "PTRACE_O_TRACEEXEC", - "PTRACE_O_TRACEEXIT", - "PTRACE_O_TRACEFORK", - "PTRACE_O_TRACESYSGOOD", - "PTRACE_O_TRACEVFORK", - "PTRACE_O_TRACEVFORKDONE", - "PTRACE_PEEKDATA", - "PTRACE_PEEKTEXT", - "PTRACE_PEEKUSR", - "PTRACE_POKEDATA", - "PTRACE_POKETEXT", - "PTRACE_POKEUSR", - "PTRACE_SETCRUNCHREGS", - "PTRACE_SETFPREGS", - "PTRACE_SETFPXREGS", - "PTRACE_SETHBPREGS", - "PTRACE_SETOPTIONS", - "PTRACE_SETREGS", - "PTRACE_SETREGSET", - "PTRACE_SETSIGINFO", - "PTRACE_SETVFPREGS", - "PTRACE_SETWMMXREGS", - "PTRACE_SET_SYSCALL", - "PTRACE_SET_THREAD_AREA", - "PTRACE_SINGLEBLOCK", - "PTRACE_SINGLESTEP", - "PTRACE_SYSCALL", - "PTRACE_SYSEMU", - "PTRACE_SYSEMU_SINGLESTEP", - "PTRACE_TRACEME", - "PT_ATTACH", - "PT_ATTACHEXC", - "PT_CONTINUE", - "PT_DATA_ADDR", - "PT_DENY_ATTACH", - "PT_DETACH", - "PT_FIRSTMACH", - "PT_FORCEQUOTA", - "PT_KILL", - "PT_MASK", - "PT_READ_D", - "PT_READ_I", - "PT_READ_U", - "PT_SIGEXC", - "PT_STEP", - "PT_TEXT_ADDR", - "PT_TEXT_END_ADDR", - "PT_THUPDATE", - "PT_TRACE_ME", - "PT_WRITE_D", - "PT_WRITE_I", - "PT_WRITE_U", - "ParseDirent", - "ParseNetlinkMessage", - "ParseNetlinkRouteAttr", - "ParseRoutingMessage", - "ParseRoutingSockaddr", - "ParseSocketControlMessage", - "ParseUnixCredentials", - "ParseUnixRights", - "PathMax", - "Pathconf", - "Pause", - "Pipe", - "Pipe2", - "PivotRoot", - "Pointer", - "PostQueuedCompletionStatus", - "Pread", - "Proc", - "ProcAttr", - "Process32First", - "Process32Next", - "ProcessEntry32", - "ProcessInformation", - "Protoent", - "PtraceAttach", - "PtraceCont", - "PtraceDetach", - "PtraceGetEventMsg", - "PtraceGetRegs", - "PtracePeekData", - "PtracePeekText", - "PtracePokeData", - "PtracePokeText", - "PtraceRegs", - "PtraceSetOptions", - "PtraceSetRegs", - "PtraceSingleStep", - "PtraceSyscall", - "Pwrite", - "REG_BINARY", - "REG_DWORD", - "REG_DWORD_BIG_ENDIAN", - "REG_DWORD_LITTLE_ENDIAN", - "REG_EXPAND_SZ", - "REG_FULL_RESOURCE_DESCRIPTOR", - "REG_LINK", - "REG_MULTI_SZ", - "REG_NONE", - "REG_QWORD", - "REG_QWORD_LITTLE_ENDIAN", - "REG_RESOURCE_LIST", - "REG_RESOURCE_REQUIREMENTS_LIST", - "REG_SZ", - "RLIMIT_AS", - "RLIMIT_CORE", - "RLIMIT_CPU", - "RLIMIT_DATA", - "RLIMIT_FSIZE", - "RLIMIT_NOFILE", - "RLIMIT_STACK", - "RLIM_INFINITY", - "RTAX_ADVMSS", - "RTAX_AUTHOR", - "RTAX_BRD", - "RTAX_CWND", - "RTAX_DST", - "RTAX_FEATURES", - "RTAX_FEATURE_ALLFRAG", - "RTAX_FEATURE_ECN", - "RTAX_FEATURE_SACK", - "RTAX_FEATURE_TIMESTAMP", - "RTAX_GATEWAY", - "RTAX_GENMASK", - "RTAX_HOPLIMIT", - "RTAX_IFA", - "RTAX_IFP", - "RTAX_INITCWND", - "RTAX_INITRWND", - "RTAX_LABEL", - "RTAX_LOCK", - "RTAX_MAX", - "RTAX_MTU", - "RTAX_NETMASK", - "RTAX_REORDERING", - "RTAX_RTO_MIN", - "RTAX_RTT", - "RTAX_RTTVAR", - "RTAX_SRC", - "RTAX_SRCMASK", - "RTAX_SSTHRESH", - "RTAX_TAG", - "RTAX_UNSPEC", - "RTAX_WINDOW", - "RTA_ALIGNTO", - "RTA_AUTHOR", - "RTA_BRD", - "RTA_CACHEINFO", - "RTA_DST", - "RTA_FLOW", - "RTA_GATEWAY", - "RTA_GENMASK", - "RTA_IFA", - "RTA_IFP", - "RTA_IIF", - "RTA_LABEL", - "RTA_MAX", - "RTA_METRICS", - "RTA_MULTIPATH", - "RTA_NETMASK", - "RTA_OIF", - "RTA_PREFSRC", - "RTA_PRIORITY", - "RTA_SRC", - "RTA_SRCMASK", - "RTA_TABLE", - "RTA_TAG", - "RTA_UNSPEC", - "RTCF_DIRECTSRC", - "RTCF_DOREDIRECT", - "RTCF_LOG", - "RTCF_MASQ", - "RTCF_NAT", - "RTCF_VALVE", - "RTF_ADDRCLASSMASK", - "RTF_ADDRCONF", - "RTF_ALLONLINK", - "RTF_ANNOUNCE", - "RTF_BLACKHOLE", - "RTF_BROADCAST", - "RTF_CACHE", - "RTF_CLONED", - "RTF_CLONING", - "RTF_CONDEMNED", - "RTF_DEFAULT", - "RTF_DELCLONE", - "RTF_DONE", - "RTF_DYNAMIC", - "RTF_FLOW", - "RTF_FMASK", - "RTF_GATEWAY", - "RTF_GWFLAG_COMPAT", - "RTF_HOST", - "RTF_IFREF", - "RTF_IFSCOPE", - "RTF_INTERFACE", - "RTF_IRTT", - "RTF_LINKRT", - "RTF_LLDATA", - "RTF_LLINFO", - "RTF_LOCAL", - "RTF_MASK", - "RTF_MODIFIED", - "RTF_MPATH", - "RTF_MPLS", - "RTF_MSS", - "RTF_MTU", - "RTF_MULTICAST", - "RTF_NAT", - "RTF_NOFORWARD", - "RTF_NONEXTHOP", - "RTF_NOPMTUDISC", - "RTF_PERMANENT_ARP", - "RTF_PINNED", - "RTF_POLICY", - "RTF_PRCLONING", - "RTF_PROTO1", - "RTF_PROTO2", - "RTF_PROTO3", - "RTF_REINSTATE", - "RTF_REJECT", - "RTF_RNH_LOCKED", - "RTF_SOURCE", - "RTF_SRC", - "RTF_STATIC", - "RTF_STICKY", - "RTF_THROW", - "RTF_TUNNEL", - "RTF_UP", - "RTF_USETRAILERS", - "RTF_WASCLONED", - "RTF_WINDOW", - "RTF_XRESOLVE", - "RTM_ADD", - "RTM_BASE", - "RTM_CHANGE", - "RTM_CHGADDR", - "RTM_DELACTION", - "RTM_DELADDR", - "RTM_DELADDRLABEL", - "RTM_DELETE", - "RTM_DELLINK", - "RTM_DELMADDR", - "RTM_DELNEIGH", - "RTM_DELQDISC", - "RTM_DELROUTE", - "RTM_DELRULE", - "RTM_DELTCLASS", - "RTM_DELTFILTER", - "RTM_DESYNC", - "RTM_F_CLONED", - "RTM_F_EQUALIZE", - "RTM_F_NOTIFY", - "RTM_F_PREFIX", - "RTM_GET", - "RTM_GET2", - "RTM_GETACTION", - "RTM_GETADDR", - "RTM_GETADDRLABEL", - "RTM_GETANYCAST", - "RTM_GETDCB", - "RTM_GETLINK", - "RTM_GETMULTICAST", - "RTM_GETNEIGH", - "RTM_GETNEIGHTBL", - "RTM_GETQDISC", - "RTM_GETROUTE", - "RTM_GETRULE", - "RTM_GETTCLASS", - "RTM_GETTFILTER", - "RTM_IEEE80211", - "RTM_IFANNOUNCE", - "RTM_IFINFO", - "RTM_IFINFO2", - "RTM_LLINFO_UPD", - "RTM_LOCK", - "RTM_LOSING", - "RTM_MAX", - "RTM_MAXSIZE", - "RTM_MISS", - "RTM_NEWACTION", - "RTM_NEWADDR", - "RTM_NEWADDRLABEL", - "RTM_NEWLINK", - "RTM_NEWMADDR", - "RTM_NEWMADDR2", - "RTM_NEWNDUSEROPT", - "RTM_NEWNEIGH", - "RTM_NEWNEIGHTBL", - "RTM_NEWPREFIX", - "RTM_NEWQDISC", - "RTM_NEWROUTE", - "RTM_NEWRULE", - "RTM_NEWTCLASS", - "RTM_NEWTFILTER", - "RTM_NR_FAMILIES", - "RTM_NR_MSGTYPES", - "RTM_OIFINFO", - "RTM_OLDADD", - "RTM_OLDDEL", - "RTM_OOIFINFO", - "RTM_REDIRECT", - "RTM_RESOLVE", - "RTM_RTTUNIT", - "RTM_SETDCB", - "RTM_SETGATE", - "RTM_SETLINK", - "RTM_SETNEIGHTBL", - "RTM_VERSION", - "RTNH_ALIGNTO", - "RTNH_F_DEAD", - "RTNH_F_ONLINK", - "RTNH_F_PERVASIVE", - "RTNLGRP_IPV4_IFADDR", - "RTNLGRP_IPV4_MROUTE", - "RTNLGRP_IPV4_ROUTE", - "RTNLGRP_IPV4_RULE", - "RTNLGRP_IPV6_IFADDR", - "RTNLGRP_IPV6_IFINFO", - "RTNLGRP_IPV6_MROUTE", - "RTNLGRP_IPV6_PREFIX", - "RTNLGRP_IPV6_ROUTE", - "RTNLGRP_IPV6_RULE", - "RTNLGRP_LINK", - "RTNLGRP_ND_USEROPT", - "RTNLGRP_NEIGH", - "RTNLGRP_NONE", - "RTNLGRP_NOTIFY", - "RTNLGRP_TC", - "RTN_ANYCAST", - "RTN_BLACKHOLE", - "RTN_BROADCAST", - "RTN_LOCAL", - "RTN_MAX", - "RTN_MULTICAST", - "RTN_NAT", - "RTN_PROHIBIT", - "RTN_THROW", - "RTN_UNICAST", - "RTN_UNREACHABLE", - "RTN_UNSPEC", - "RTN_XRESOLVE", - "RTPROT_BIRD", - "RTPROT_BOOT", - "RTPROT_DHCP", - "RTPROT_DNROUTED", - "RTPROT_GATED", - "RTPROT_KERNEL", - "RTPROT_MRT", - "RTPROT_NTK", - "RTPROT_RA", - "RTPROT_REDIRECT", - "RTPROT_STATIC", - "RTPROT_UNSPEC", - "RTPROT_XORP", - "RTPROT_ZEBRA", - "RTV_EXPIRE", - "RTV_HOPCOUNT", - "RTV_MTU", - "RTV_RPIPE", - "RTV_RTT", - "RTV_RTTVAR", - "RTV_SPIPE", - "RTV_SSTHRESH", - "RTV_WEIGHT", - "RT_CACHING_CONTEXT", - "RT_CLASS_DEFAULT", - "RT_CLASS_LOCAL", - "RT_CLASS_MAIN", - "RT_CLASS_MAX", - "RT_CLASS_UNSPEC", - "RT_DEFAULT_FIB", - "RT_NORTREF", - "RT_SCOPE_HOST", - "RT_SCOPE_LINK", - "RT_SCOPE_NOWHERE", - "RT_SCOPE_SITE", - "RT_SCOPE_UNIVERSE", - "RT_TABLEID_MAX", - "RT_TABLE_COMPAT", - "RT_TABLE_DEFAULT", - "RT_TABLE_LOCAL", - "RT_TABLE_MAIN", - "RT_TABLE_MAX", - "RT_TABLE_UNSPEC", - "RUSAGE_CHILDREN", - "RUSAGE_SELF", - "RUSAGE_THREAD", - "Radvisory_t", - "RawConn", - "RawSockaddr", - "RawSockaddrAny", - "RawSockaddrDatalink", - "RawSockaddrInet4", - "RawSockaddrInet6", - "RawSockaddrLinklayer", - "RawSockaddrNetlink", - "RawSockaddrUnix", - "RawSyscall", - "RawSyscall6", - "Read", - "ReadConsole", - "ReadDirectoryChanges", - "ReadDirent", - "ReadFile", - "Readlink", - "Reboot", - "Recvfrom", - "Recvmsg", - "RegCloseKey", - "RegEnumKeyEx", - "RegOpenKeyEx", - "RegQueryInfoKey", - "RegQueryValueEx", - "RemoveDirectory", - "Removexattr", - "Rename", - "Renameat", - "Revoke", - "Rlimit", - "Rmdir", - "RouteMessage", - "RouteRIB", - "RoutingMessage", - "RtAttr", - "RtGenmsg", - "RtMetrics", - "RtMsg", - "RtMsghdr", - "RtNexthop", - "Rusage", - "SCM_BINTIME", - "SCM_CREDENTIALS", - "SCM_CREDS", - "SCM_RIGHTS", - "SCM_TIMESTAMP", - "SCM_TIMESTAMPING", - "SCM_TIMESTAMPNS", - "SCM_TIMESTAMP_MONOTONIC", - "SHUT_RD", - "SHUT_RDWR", - "SHUT_WR", - "SID", - "SIDAndAttributes", - "SIGABRT", - "SIGALRM", - "SIGBUS", - "SIGCHLD", - "SIGCLD", - "SIGCONT", - "SIGEMT", - "SIGFPE", - "SIGHUP", - "SIGILL", - "SIGINFO", - "SIGINT", - "SIGIO", - "SIGIOT", - "SIGKILL", - "SIGLIBRT", - "SIGLWP", - "SIGPIPE", - "SIGPOLL", - "SIGPROF", - "SIGPWR", - "SIGQUIT", - "SIGSEGV", - "SIGSTKFLT", - "SIGSTOP", - "SIGSYS", - "SIGTERM", - "SIGTHR", - "SIGTRAP", - "SIGTSTP", - "SIGTTIN", - "SIGTTOU", - "SIGUNUSED", - "SIGURG", - "SIGUSR1", - "SIGUSR2", - "SIGVTALRM", - "SIGWINCH", - "SIGXCPU", - "SIGXFSZ", - "SIOCADDDLCI", - "SIOCADDMULTI", - "SIOCADDRT", - "SIOCAIFADDR", - "SIOCAIFGROUP", - "SIOCALIFADDR", - "SIOCARPIPLL", - "SIOCATMARK", - "SIOCAUTOADDR", - "SIOCAUTONETMASK", - "SIOCBRDGADD", - "SIOCBRDGADDS", - "SIOCBRDGARL", - "SIOCBRDGDADDR", - "SIOCBRDGDEL", - "SIOCBRDGDELS", - "SIOCBRDGFLUSH", - "SIOCBRDGFRL", - "SIOCBRDGGCACHE", - "SIOCBRDGGFD", - "SIOCBRDGGHT", - "SIOCBRDGGIFFLGS", - "SIOCBRDGGMA", - "SIOCBRDGGPARAM", - "SIOCBRDGGPRI", - "SIOCBRDGGRL", - "SIOCBRDGGSIFS", - "SIOCBRDGGTO", - "SIOCBRDGIFS", - "SIOCBRDGRTS", - "SIOCBRDGSADDR", - "SIOCBRDGSCACHE", - "SIOCBRDGSFD", - "SIOCBRDGSHT", - "SIOCBRDGSIFCOST", - "SIOCBRDGSIFFLGS", - "SIOCBRDGSIFPRIO", - "SIOCBRDGSMA", - "SIOCBRDGSPRI", - "SIOCBRDGSPROTO", - "SIOCBRDGSTO", - "SIOCBRDGSTXHC", - "SIOCDARP", - "SIOCDELDLCI", - "SIOCDELMULTI", - "SIOCDELRT", - "SIOCDEVPRIVATE", - "SIOCDIFADDR", - "SIOCDIFGROUP", - "SIOCDIFPHYADDR", - "SIOCDLIFADDR", - "SIOCDRARP", - "SIOCGARP", - "SIOCGDRVSPEC", - "SIOCGETKALIVE", - "SIOCGETLABEL", - "SIOCGETPFLOW", - "SIOCGETPFSYNC", - "SIOCGETSGCNT", - "SIOCGETVIFCNT", - "SIOCGETVLAN", - "SIOCGHIWAT", - "SIOCGIFADDR", - "SIOCGIFADDRPREF", - "SIOCGIFALIAS", - "SIOCGIFALTMTU", - "SIOCGIFASYNCMAP", - "SIOCGIFBOND", - "SIOCGIFBR", - "SIOCGIFBRDADDR", - "SIOCGIFCAP", - "SIOCGIFCONF", - "SIOCGIFCOUNT", - "SIOCGIFDATA", - "SIOCGIFDESCR", - "SIOCGIFDEVMTU", - "SIOCGIFDLT", - "SIOCGIFDSTADDR", - "SIOCGIFENCAP", - "SIOCGIFFIB", - "SIOCGIFFLAGS", - "SIOCGIFGATTR", - "SIOCGIFGENERIC", - "SIOCGIFGMEMB", - "SIOCGIFGROUP", - "SIOCGIFHARDMTU", - "SIOCGIFHWADDR", - "SIOCGIFINDEX", - "SIOCGIFKPI", - "SIOCGIFMAC", - "SIOCGIFMAP", - "SIOCGIFMEDIA", - "SIOCGIFMEM", - "SIOCGIFMETRIC", - "SIOCGIFMTU", - "SIOCGIFNAME", - "SIOCGIFNETMASK", - "SIOCGIFPDSTADDR", - "SIOCGIFPFLAGS", - "SIOCGIFPHYS", - "SIOCGIFPRIORITY", - "SIOCGIFPSRCADDR", - "SIOCGIFRDOMAIN", - "SIOCGIFRTLABEL", - "SIOCGIFSLAVE", - "SIOCGIFSTATUS", - "SIOCGIFTIMESLOT", - "SIOCGIFTXQLEN", - "SIOCGIFVLAN", - "SIOCGIFWAKEFLAGS", - "SIOCGIFXFLAGS", - "SIOCGLIFADDR", - "SIOCGLIFPHYADDR", - "SIOCGLIFPHYRTABLE", - "SIOCGLIFPHYTTL", - "SIOCGLINKSTR", - "SIOCGLOWAT", - "SIOCGPGRP", - "SIOCGPRIVATE_0", - "SIOCGPRIVATE_1", - "SIOCGRARP", - "SIOCGSPPPPARAMS", - "SIOCGSTAMP", - "SIOCGSTAMPNS", - "SIOCGVH", - "SIOCGVNETID", - "SIOCIFCREATE", - "SIOCIFCREATE2", - "SIOCIFDESTROY", - "SIOCIFGCLONERS", - "SIOCINITIFADDR", - "SIOCPROTOPRIVATE", - "SIOCRSLVMULTI", - "SIOCRTMSG", - "SIOCSARP", - "SIOCSDRVSPEC", - "SIOCSETKALIVE", - "SIOCSETLABEL", - "SIOCSETPFLOW", - "SIOCSETPFSYNC", - "SIOCSETVLAN", - "SIOCSHIWAT", - "SIOCSIFADDR", - "SIOCSIFADDRPREF", - "SIOCSIFALTMTU", - "SIOCSIFASYNCMAP", - "SIOCSIFBOND", - "SIOCSIFBR", - "SIOCSIFBRDADDR", - "SIOCSIFCAP", - "SIOCSIFDESCR", - "SIOCSIFDSTADDR", - "SIOCSIFENCAP", - "SIOCSIFFIB", - "SIOCSIFFLAGS", - "SIOCSIFGATTR", - "SIOCSIFGENERIC", - "SIOCSIFHWADDR", - "SIOCSIFHWBROADCAST", - "SIOCSIFKPI", - "SIOCSIFLINK", - "SIOCSIFLLADDR", - "SIOCSIFMAC", - "SIOCSIFMAP", - "SIOCSIFMEDIA", - "SIOCSIFMEM", - "SIOCSIFMETRIC", - "SIOCSIFMTU", - "SIOCSIFNAME", - "SIOCSIFNETMASK", - "SIOCSIFPFLAGS", - "SIOCSIFPHYADDR", - "SIOCSIFPHYS", - "SIOCSIFPRIORITY", - "SIOCSIFRDOMAIN", - "SIOCSIFRTLABEL", - "SIOCSIFRVNET", - "SIOCSIFSLAVE", - "SIOCSIFTIMESLOT", - "SIOCSIFTXQLEN", - "SIOCSIFVLAN", - "SIOCSIFVNET", - "SIOCSIFXFLAGS", - "SIOCSLIFPHYADDR", - "SIOCSLIFPHYRTABLE", - "SIOCSLIFPHYTTL", - "SIOCSLINKSTR", - "SIOCSLOWAT", - "SIOCSPGRP", - "SIOCSRARP", - "SIOCSSPPPPARAMS", - "SIOCSVH", - "SIOCSVNETID", - "SIOCZIFDATA", - "SIO_GET_EXTENSION_FUNCTION_POINTER", - "SIO_GET_INTERFACE_LIST", - "SIO_KEEPALIVE_VALS", - "SIO_UDP_CONNRESET", - "SOCK_CLOEXEC", - "SOCK_DCCP", - "SOCK_DGRAM", - "SOCK_FLAGS_MASK", - "SOCK_MAXADDRLEN", - "SOCK_NONBLOCK", - "SOCK_NOSIGPIPE", - "SOCK_PACKET", - "SOCK_RAW", - "SOCK_RDM", - "SOCK_SEQPACKET", - "SOCK_STREAM", - "SOL_AAL", - "SOL_ATM", - "SOL_DECNET", - "SOL_ICMPV6", - "SOL_IP", - "SOL_IPV6", - "SOL_IRDA", - "SOL_PACKET", - "SOL_RAW", - "SOL_SOCKET", - "SOL_TCP", - "SOL_X25", - "SOMAXCONN", - "SO_ACCEPTCONN", - "SO_ACCEPTFILTER", - "SO_ATTACH_FILTER", - "SO_BINDANY", - "SO_BINDTODEVICE", - "SO_BINTIME", - "SO_BROADCAST", - "SO_BSDCOMPAT", - "SO_DEBUG", - "SO_DETACH_FILTER", - "SO_DOMAIN", - "SO_DONTROUTE", - "SO_DONTTRUNC", - "SO_ERROR", - "SO_KEEPALIVE", - "SO_LABEL", - "SO_LINGER", - "SO_LINGER_SEC", - "SO_LISTENINCQLEN", - "SO_LISTENQLEN", - "SO_LISTENQLIMIT", - "SO_MARK", - "SO_NETPROC", - "SO_NKE", - "SO_NOADDRERR", - "SO_NOHEADER", - "SO_NOSIGPIPE", - "SO_NOTIFYCONFLICT", - "SO_NO_CHECK", - "SO_NO_DDP", - "SO_NO_OFFLOAD", - "SO_NP_EXTENSIONS", - "SO_NREAD", - "SO_NWRITE", - "SO_OOBINLINE", - "SO_OVERFLOWED", - "SO_PASSCRED", - "SO_PASSSEC", - "SO_PEERCRED", - "SO_PEERLABEL", - "SO_PEERNAME", - "SO_PEERSEC", - "SO_PRIORITY", - "SO_PROTOCOL", - "SO_PROTOTYPE", - "SO_RANDOMPORT", - "SO_RCVBUF", - "SO_RCVBUFFORCE", - "SO_RCVLOWAT", - "SO_RCVTIMEO", - "SO_RESTRICTIONS", - "SO_RESTRICT_DENYIN", - "SO_RESTRICT_DENYOUT", - "SO_RESTRICT_DENYSET", - "SO_REUSEADDR", - "SO_REUSEPORT", - "SO_REUSESHAREUID", - "SO_RTABLE", - "SO_RXQ_OVFL", - "SO_SECURITY_AUTHENTICATION", - "SO_SECURITY_ENCRYPTION_NETWORK", - "SO_SECURITY_ENCRYPTION_TRANSPORT", - "SO_SETFIB", - "SO_SNDBUF", - "SO_SNDBUFFORCE", - "SO_SNDLOWAT", - "SO_SNDTIMEO", - "SO_SPLICE", - "SO_TIMESTAMP", - "SO_TIMESTAMPING", - "SO_TIMESTAMPNS", - "SO_TIMESTAMP_MONOTONIC", - "SO_TYPE", - "SO_UPCALLCLOSEWAIT", - "SO_UPDATE_ACCEPT_CONTEXT", - "SO_UPDATE_CONNECT_CONTEXT", - "SO_USELOOPBACK", - "SO_USER_COOKIE", - "SO_VENDOR", - "SO_WANTMORE", - "SO_WANTOOBFLAG", - "SSLExtraCertChainPolicyPara", - "STANDARD_RIGHTS_ALL", - "STANDARD_RIGHTS_EXECUTE", - "STANDARD_RIGHTS_READ", - "STANDARD_RIGHTS_REQUIRED", - "STANDARD_RIGHTS_WRITE", - "STARTF_USESHOWWINDOW", - "STARTF_USESTDHANDLES", - "STD_ERROR_HANDLE", - "STD_INPUT_HANDLE", - "STD_OUTPUT_HANDLE", - "SUBLANG_ENGLISH_US", - "SW_FORCEMINIMIZE", - "SW_HIDE", - "SW_MAXIMIZE", - "SW_MINIMIZE", - "SW_NORMAL", - "SW_RESTORE", - "SW_SHOW", - "SW_SHOWDEFAULT", - "SW_SHOWMAXIMIZED", - "SW_SHOWMINIMIZED", - "SW_SHOWMINNOACTIVE", - "SW_SHOWNA", - "SW_SHOWNOACTIVATE", - "SW_SHOWNORMAL", - "SYMBOLIC_LINK_FLAG_DIRECTORY", - "SYNCHRONIZE", - "SYSCTL_VERSION", - "SYSCTL_VERS_0", - "SYSCTL_VERS_1", - "SYSCTL_VERS_MASK", - "SYS_ABORT2", - "SYS_ACCEPT", - "SYS_ACCEPT4", - "SYS_ACCEPT_NOCANCEL", - "SYS_ACCESS", - "SYS_ACCESS_EXTENDED", - "SYS_ACCT", - "SYS_ADD_KEY", - "SYS_ADD_PROFIL", - "SYS_ADJFREQ", - "SYS_ADJTIME", - "SYS_ADJTIMEX", - "SYS_AFS_SYSCALL", - "SYS_AIO_CANCEL", - "SYS_AIO_ERROR", - "SYS_AIO_FSYNC", - "SYS_AIO_READ", - "SYS_AIO_RETURN", - "SYS_AIO_SUSPEND", - "SYS_AIO_SUSPEND_NOCANCEL", - "SYS_AIO_WRITE", - "SYS_ALARM", - "SYS_ARCH_PRCTL", - "SYS_ARM_FADVISE64_64", - "SYS_ARM_SYNC_FILE_RANGE", - "SYS_ATGETMSG", - "SYS_ATPGETREQ", - "SYS_ATPGETRSP", - "SYS_ATPSNDREQ", - "SYS_ATPSNDRSP", - "SYS_ATPUTMSG", - "SYS_ATSOCKET", - "SYS_AUDIT", - "SYS_AUDITCTL", - "SYS_AUDITON", - "SYS_AUDIT_SESSION_JOIN", - "SYS_AUDIT_SESSION_PORT", - "SYS_AUDIT_SESSION_SELF", - "SYS_BDFLUSH", - "SYS_BIND", - "SYS_BINDAT", - "SYS_BREAK", - "SYS_BRK", - "SYS_BSDTHREAD_CREATE", - "SYS_BSDTHREAD_REGISTER", - "SYS_BSDTHREAD_TERMINATE", - "SYS_CAPGET", - "SYS_CAPSET", - "SYS_CAP_ENTER", - "SYS_CAP_FCNTLS_GET", - "SYS_CAP_FCNTLS_LIMIT", - "SYS_CAP_GETMODE", - "SYS_CAP_GETRIGHTS", - "SYS_CAP_IOCTLS_GET", - "SYS_CAP_IOCTLS_LIMIT", - "SYS_CAP_NEW", - "SYS_CAP_RIGHTS_GET", - "SYS_CAP_RIGHTS_LIMIT", - "SYS_CHDIR", - "SYS_CHFLAGS", - "SYS_CHFLAGSAT", - "SYS_CHMOD", - "SYS_CHMOD_EXTENDED", - "SYS_CHOWN", - "SYS_CHOWN32", - "SYS_CHROOT", - "SYS_CHUD", - "SYS_CLOCK_ADJTIME", - "SYS_CLOCK_GETCPUCLOCKID2", - "SYS_CLOCK_GETRES", - "SYS_CLOCK_GETTIME", - "SYS_CLOCK_NANOSLEEP", - "SYS_CLOCK_SETTIME", - "SYS_CLONE", - "SYS_CLOSE", - "SYS_CLOSEFROM", - "SYS_CLOSE_NOCANCEL", - "SYS_CONNECT", - "SYS_CONNECTAT", - "SYS_CONNECT_NOCANCEL", - "SYS_COPYFILE", - "SYS_CPUSET", - "SYS_CPUSET_GETAFFINITY", - "SYS_CPUSET_GETID", - "SYS_CPUSET_SETAFFINITY", - "SYS_CPUSET_SETID", - "SYS_CREAT", - "SYS_CREATE_MODULE", - "SYS_CSOPS", - "SYS_DELETE", - "SYS_DELETE_MODULE", - "SYS_DUP", - "SYS_DUP2", - "SYS_DUP3", - "SYS_EACCESS", - "SYS_EPOLL_CREATE", - "SYS_EPOLL_CREATE1", - "SYS_EPOLL_CTL", - "SYS_EPOLL_CTL_OLD", - "SYS_EPOLL_PWAIT", - "SYS_EPOLL_WAIT", - "SYS_EPOLL_WAIT_OLD", - "SYS_EVENTFD", - "SYS_EVENTFD2", - "SYS_EXCHANGEDATA", - "SYS_EXECVE", - "SYS_EXIT", - "SYS_EXIT_GROUP", - "SYS_EXTATTRCTL", - "SYS_EXTATTR_DELETE_FD", - "SYS_EXTATTR_DELETE_FILE", - "SYS_EXTATTR_DELETE_LINK", - "SYS_EXTATTR_GET_FD", - "SYS_EXTATTR_GET_FILE", - "SYS_EXTATTR_GET_LINK", - "SYS_EXTATTR_LIST_FD", - "SYS_EXTATTR_LIST_FILE", - "SYS_EXTATTR_LIST_LINK", - "SYS_EXTATTR_SET_FD", - "SYS_EXTATTR_SET_FILE", - "SYS_EXTATTR_SET_LINK", - "SYS_FACCESSAT", - "SYS_FADVISE64", - "SYS_FADVISE64_64", - "SYS_FALLOCATE", - "SYS_FANOTIFY_INIT", - "SYS_FANOTIFY_MARK", - "SYS_FCHDIR", - "SYS_FCHFLAGS", - "SYS_FCHMOD", - "SYS_FCHMODAT", - "SYS_FCHMOD_EXTENDED", - "SYS_FCHOWN", - "SYS_FCHOWN32", - "SYS_FCHOWNAT", - "SYS_FCHROOT", - "SYS_FCNTL", - "SYS_FCNTL64", - "SYS_FCNTL_NOCANCEL", - "SYS_FDATASYNC", - "SYS_FEXECVE", - "SYS_FFCLOCK_GETCOUNTER", - "SYS_FFCLOCK_GETESTIMATE", - "SYS_FFCLOCK_SETESTIMATE", - "SYS_FFSCTL", - "SYS_FGETATTRLIST", - "SYS_FGETXATTR", - "SYS_FHOPEN", - "SYS_FHSTAT", - "SYS_FHSTATFS", - "SYS_FILEPORT_MAKEFD", - "SYS_FILEPORT_MAKEPORT", - "SYS_FKTRACE", - "SYS_FLISTXATTR", - "SYS_FLOCK", - "SYS_FORK", - "SYS_FPATHCONF", - "SYS_FREEBSD6_FTRUNCATE", - "SYS_FREEBSD6_LSEEK", - "SYS_FREEBSD6_MMAP", - "SYS_FREEBSD6_PREAD", - "SYS_FREEBSD6_PWRITE", - "SYS_FREEBSD6_TRUNCATE", - "SYS_FREMOVEXATTR", - "SYS_FSCTL", - "SYS_FSETATTRLIST", - "SYS_FSETXATTR", - "SYS_FSGETPATH", - "SYS_FSTAT", - "SYS_FSTAT64", - "SYS_FSTAT64_EXTENDED", - "SYS_FSTATAT", - "SYS_FSTATAT64", - "SYS_FSTATFS", - "SYS_FSTATFS64", - "SYS_FSTATV", - "SYS_FSTATVFS1", - "SYS_FSTAT_EXTENDED", - "SYS_FSYNC", - "SYS_FSYNC_NOCANCEL", - "SYS_FSYNC_RANGE", - "SYS_FTIME", - "SYS_FTRUNCATE", - "SYS_FTRUNCATE64", - "SYS_FUTEX", - "SYS_FUTIMENS", - "SYS_FUTIMES", - "SYS_FUTIMESAT", - "SYS_GETATTRLIST", - "SYS_GETAUDIT", - "SYS_GETAUDIT_ADDR", - "SYS_GETAUID", - "SYS_GETCONTEXT", - "SYS_GETCPU", - "SYS_GETCWD", - "SYS_GETDENTS", - "SYS_GETDENTS64", - "SYS_GETDIRENTRIES", - "SYS_GETDIRENTRIES64", - "SYS_GETDIRENTRIESATTR", - "SYS_GETDTABLECOUNT", - "SYS_GETDTABLESIZE", - "SYS_GETEGID", - "SYS_GETEGID32", - "SYS_GETEUID", - "SYS_GETEUID32", - "SYS_GETFH", - "SYS_GETFSSTAT", - "SYS_GETFSSTAT64", - "SYS_GETGID", - "SYS_GETGID32", - "SYS_GETGROUPS", - "SYS_GETGROUPS32", - "SYS_GETHOSTUUID", - "SYS_GETITIMER", - "SYS_GETLCID", - "SYS_GETLOGIN", - "SYS_GETLOGINCLASS", - "SYS_GETPEERNAME", - "SYS_GETPGID", - "SYS_GETPGRP", - "SYS_GETPID", - "SYS_GETPMSG", - "SYS_GETPPID", - "SYS_GETPRIORITY", - "SYS_GETRESGID", - "SYS_GETRESGID32", - "SYS_GETRESUID", - "SYS_GETRESUID32", - "SYS_GETRLIMIT", - "SYS_GETRTABLE", - "SYS_GETRUSAGE", - "SYS_GETSGROUPS", - "SYS_GETSID", - "SYS_GETSOCKNAME", - "SYS_GETSOCKOPT", - "SYS_GETTHRID", - "SYS_GETTID", - "SYS_GETTIMEOFDAY", - "SYS_GETUID", - "SYS_GETUID32", - "SYS_GETVFSSTAT", - "SYS_GETWGROUPS", - "SYS_GETXATTR", - "SYS_GET_KERNEL_SYMS", - "SYS_GET_MEMPOLICY", - "SYS_GET_ROBUST_LIST", - "SYS_GET_THREAD_AREA", - "SYS_GTTY", - "SYS_IDENTITYSVC", - "SYS_IDLE", - "SYS_INITGROUPS", - "SYS_INIT_MODULE", - "SYS_INOTIFY_ADD_WATCH", - "SYS_INOTIFY_INIT", - "SYS_INOTIFY_INIT1", - "SYS_INOTIFY_RM_WATCH", - "SYS_IOCTL", - "SYS_IOPERM", - "SYS_IOPL", - "SYS_IOPOLICYSYS", - "SYS_IOPRIO_GET", - "SYS_IOPRIO_SET", - "SYS_IO_CANCEL", - "SYS_IO_DESTROY", - "SYS_IO_GETEVENTS", - "SYS_IO_SETUP", - "SYS_IO_SUBMIT", - "SYS_IPC", - "SYS_ISSETUGID", - "SYS_JAIL", - "SYS_JAIL_ATTACH", - "SYS_JAIL_GET", - "SYS_JAIL_REMOVE", - "SYS_JAIL_SET", - "SYS_KDEBUG_TRACE", - "SYS_KENV", - "SYS_KEVENT", - "SYS_KEVENT64", - "SYS_KEXEC_LOAD", - "SYS_KEYCTL", - "SYS_KILL", - "SYS_KLDFIND", - "SYS_KLDFIRSTMOD", - "SYS_KLDLOAD", - "SYS_KLDNEXT", - "SYS_KLDSTAT", - "SYS_KLDSYM", - "SYS_KLDUNLOAD", - "SYS_KLDUNLOADF", - "SYS_KQUEUE", - "SYS_KQUEUE1", - "SYS_KTIMER_CREATE", - "SYS_KTIMER_DELETE", - "SYS_KTIMER_GETOVERRUN", - "SYS_KTIMER_GETTIME", - "SYS_KTIMER_SETTIME", - "SYS_KTRACE", - "SYS_LCHFLAGS", - "SYS_LCHMOD", - "SYS_LCHOWN", - "SYS_LCHOWN32", - "SYS_LGETFH", - "SYS_LGETXATTR", - "SYS_LINK", - "SYS_LINKAT", - "SYS_LIO_LISTIO", - "SYS_LISTEN", - "SYS_LISTXATTR", - "SYS_LLISTXATTR", - "SYS_LOCK", - "SYS_LOOKUP_DCOOKIE", - "SYS_LPATHCONF", - "SYS_LREMOVEXATTR", - "SYS_LSEEK", - "SYS_LSETXATTR", - "SYS_LSTAT", - "SYS_LSTAT64", - "SYS_LSTAT64_EXTENDED", - "SYS_LSTATV", - "SYS_LSTAT_EXTENDED", - "SYS_LUTIMES", - "SYS_MAC_SYSCALL", - "SYS_MADVISE", - "SYS_MADVISE1", - "SYS_MAXSYSCALL", - "SYS_MBIND", - "SYS_MIGRATE_PAGES", - "SYS_MINCORE", - "SYS_MINHERIT", - "SYS_MKCOMPLEX", - "SYS_MKDIR", - "SYS_MKDIRAT", - "SYS_MKDIR_EXTENDED", - "SYS_MKFIFO", - "SYS_MKFIFOAT", - "SYS_MKFIFO_EXTENDED", - "SYS_MKNOD", - "SYS_MKNODAT", - "SYS_MLOCK", - "SYS_MLOCKALL", - "SYS_MMAP", - "SYS_MMAP2", - "SYS_MODCTL", - "SYS_MODFIND", - "SYS_MODFNEXT", - "SYS_MODIFY_LDT", - "SYS_MODNEXT", - "SYS_MODSTAT", - "SYS_MODWATCH", - "SYS_MOUNT", - "SYS_MOVE_PAGES", - "SYS_MPROTECT", - "SYS_MPX", - "SYS_MQUERY", - "SYS_MQ_GETSETATTR", - "SYS_MQ_NOTIFY", - "SYS_MQ_OPEN", - "SYS_MQ_TIMEDRECEIVE", - "SYS_MQ_TIMEDSEND", - "SYS_MQ_UNLINK", - "SYS_MREMAP", - "SYS_MSGCTL", - "SYS_MSGGET", - "SYS_MSGRCV", - "SYS_MSGRCV_NOCANCEL", - "SYS_MSGSND", - "SYS_MSGSND_NOCANCEL", - "SYS_MSGSYS", - "SYS_MSYNC", - "SYS_MSYNC_NOCANCEL", - "SYS_MUNLOCK", - "SYS_MUNLOCKALL", - "SYS_MUNMAP", - "SYS_NAME_TO_HANDLE_AT", - "SYS_NANOSLEEP", - "SYS_NEWFSTATAT", - "SYS_NFSCLNT", - "SYS_NFSSERVCTL", - "SYS_NFSSVC", - "SYS_NFSTAT", - "SYS_NICE", - "SYS_NLSTAT", - "SYS_NMOUNT", - "SYS_NSTAT", - "SYS_NTP_ADJTIME", - "SYS_NTP_GETTIME", - "SYS_OABI_SYSCALL_BASE", - "SYS_OBREAK", - "SYS_OLDFSTAT", - "SYS_OLDLSTAT", - "SYS_OLDOLDUNAME", - "SYS_OLDSTAT", - "SYS_OLDUNAME", - "SYS_OPEN", - "SYS_OPENAT", - "SYS_OPENBSD_POLL", - "SYS_OPEN_BY_HANDLE_AT", - "SYS_OPEN_EXTENDED", - "SYS_OPEN_NOCANCEL", - "SYS_OVADVISE", - "SYS_PACCEPT", - "SYS_PATHCONF", - "SYS_PAUSE", - "SYS_PCICONFIG_IOBASE", - "SYS_PCICONFIG_READ", - "SYS_PCICONFIG_WRITE", - "SYS_PDFORK", - "SYS_PDGETPID", - "SYS_PDKILL", - "SYS_PERF_EVENT_OPEN", - "SYS_PERSONALITY", - "SYS_PID_HIBERNATE", - "SYS_PID_RESUME", - "SYS_PID_SHUTDOWN_SOCKETS", - "SYS_PID_SUSPEND", - "SYS_PIPE", - "SYS_PIPE2", - "SYS_PIVOT_ROOT", - "SYS_PMC_CONTROL", - "SYS_PMC_GET_INFO", - "SYS_POLL", - "SYS_POLLTS", - "SYS_POLL_NOCANCEL", - "SYS_POSIX_FADVISE", - "SYS_POSIX_FALLOCATE", - "SYS_POSIX_OPENPT", - "SYS_POSIX_SPAWN", - "SYS_PPOLL", - "SYS_PRCTL", - "SYS_PREAD", - "SYS_PREAD64", - "SYS_PREADV", - "SYS_PREAD_NOCANCEL", - "SYS_PRLIMIT64", - "SYS_PROCCTL", - "SYS_PROCESS_POLICY", - "SYS_PROCESS_VM_READV", - "SYS_PROCESS_VM_WRITEV", - "SYS_PROC_INFO", - "SYS_PROF", - "SYS_PROFIL", - "SYS_PSELECT", - "SYS_PSELECT6", - "SYS_PSET_ASSIGN", - "SYS_PSET_CREATE", - "SYS_PSET_DESTROY", - "SYS_PSYNCH_CVBROAD", - "SYS_PSYNCH_CVCLRPREPOST", - "SYS_PSYNCH_CVSIGNAL", - "SYS_PSYNCH_CVWAIT", - "SYS_PSYNCH_MUTEXDROP", - "SYS_PSYNCH_MUTEXWAIT", - "SYS_PSYNCH_RW_DOWNGRADE", - "SYS_PSYNCH_RW_LONGRDLOCK", - "SYS_PSYNCH_RW_RDLOCK", - "SYS_PSYNCH_RW_UNLOCK", - "SYS_PSYNCH_RW_UNLOCK2", - "SYS_PSYNCH_RW_UPGRADE", - "SYS_PSYNCH_RW_WRLOCK", - "SYS_PSYNCH_RW_YIELDWRLOCK", - "SYS_PTRACE", - "SYS_PUTPMSG", - "SYS_PWRITE", - "SYS_PWRITE64", - "SYS_PWRITEV", - "SYS_PWRITE_NOCANCEL", - "SYS_QUERY_MODULE", - "SYS_QUOTACTL", - "SYS_RASCTL", - "SYS_RCTL_ADD_RULE", - "SYS_RCTL_GET_LIMITS", - "SYS_RCTL_GET_RACCT", - "SYS_RCTL_GET_RULES", - "SYS_RCTL_REMOVE_RULE", - "SYS_READ", - "SYS_READAHEAD", - "SYS_READDIR", - "SYS_READLINK", - "SYS_READLINKAT", - "SYS_READV", - "SYS_READV_NOCANCEL", - "SYS_READ_NOCANCEL", - "SYS_REBOOT", - "SYS_RECV", - "SYS_RECVFROM", - "SYS_RECVFROM_NOCANCEL", - "SYS_RECVMMSG", - "SYS_RECVMSG", - "SYS_RECVMSG_NOCANCEL", - "SYS_REMAP_FILE_PAGES", - "SYS_REMOVEXATTR", - "SYS_RENAME", - "SYS_RENAMEAT", - "SYS_REQUEST_KEY", - "SYS_RESTART_SYSCALL", - "SYS_REVOKE", - "SYS_RFORK", - "SYS_RMDIR", - "SYS_RTPRIO", - "SYS_RTPRIO_THREAD", - "SYS_RT_SIGACTION", - "SYS_RT_SIGPENDING", - "SYS_RT_SIGPROCMASK", - "SYS_RT_SIGQUEUEINFO", - "SYS_RT_SIGRETURN", - "SYS_RT_SIGSUSPEND", - "SYS_RT_SIGTIMEDWAIT", - "SYS_RT_TGSIGQUEUEINFO", - "SYS_SBRK", - "SYS_SCHED_GETAFFINITY", - "SYS_SCHED_GETPARAM", - "SYS_SCHED_GETSCHEDULER", - "SYS_SCHED_GET_PRIORITY_MAX", - "SYS_SCHED_GET_PRIORITY_MIN", - "SYS_SCHED_RR_GET_INTERVAL", - "SYS_SCHED_SETAFFINITY", - "SYS_SCHED_SETPARAM", - "SYS_SCHED_SETSCHEDULER", - "SYS_SCHED_YIELD", - "SYS_SCTP_GENERIC_RECVMSG", - "SYS_SCTP_GENERIC_SENDMSG", - "SYS_SCTP_GENERIC_SENDMSG_IOV", - "SYS_SCTP_PEELOFF", - "SYS_SEARCHFS", - "SYS_SECURITY", - "SYS_SELECT", - "SYS_SELECT_NOCANCEL", - "SYS_SEMCONFIG", - "SYS_SEMCTL", - "SYS_SEMGET", - "SYS_SEMOP", - "SYS_SEMSYS", - "SYS_SEMTIMEDOP", - "SYS_SEM_CLOSE", - "SYS_SEM_DESTROY", - "SYS_SEM_GETVALUE", - "SYS_SEM_INIT", - "SYS_SEM_OPEN", - "SYS_SEM_POST", - "SYS_SEM_TRYWAIT", - "SYS_SEM_UNLINK", - "SYS_SEM_WAIT", - "SYS_SEM_WAIT_NOCANCEL", - "SYS_SEND", - "SYS_SENDFILE", - "SYS_SENDFILE64", - "SYS_SENDMMSG", - "SYS_SENDMSG", - "SYS_SENDMSG_NOCANCEL", - "SYS_SENDTO", - "SYS_SENDTO_NOCANCEL", - "SYS_SETATTRLIST", - "SYS_SETAUDIT", - "SYS_SETAUDIT_ADDR", - "SYS_SETAUID", - "SYS_SETCONTEXT", - "SYS_SETDOMAINNAME", - "SYS_SETEGID", - "SYS_SETEUID", - "SYS_SETFIB", - "SYS_SETFSGID", - "SYS_SETFSGID32", - "SYS_SETFSUID", - "SYS_SETFSUID32", - "SYS_SETGID", - "SYS_SETGID32", - "SYS_SETGROUPS", - "SYS_SETGROUPS32", - "SYS_SETHOSTNAME", - "SYS_SETITIMER", - "SYS_SETLCID", - "SYS_SETLOGIN", - "SYS_SETLOGINCLASS", - "SYS_SETNS", - "SYS_SETPGID", - "SYS_SETPRIORITY", - "SYS_SETPRIVEXEC", - "SYS_SETREGID", - "SYS_SETREGID32", - "SYS_SETRESGID", - "SYS_SETRESGID32", - "SYS_SETRESUID", - "SYS_SETRESUID32", - "SYS_SETREUID", - "SYS_SETREUID32", - "SYS_SETRLIMIT", - "SYS_SETRTABLE", - "SYS_SETSGROUPS", - "SYS_SETSID", - "SYS_SETSOCKOPT", - "SYS_SETTID", - "SYS_SETTID_WITH_PID", - "SYS_SETTIMEOFDAY", - "SYS_SETUID", - "SYS_SETUID32", - "SYS_SETWGROUPS", - "SYS_SETXATTR", - "SYS_SET_MEMPOLICY", - "SYS_SET_ROBUST_LIST", - "SYS_SET_THREAD_AREA", - "SYS_SET_TID_ADDRESS", - "SYS_SGETMASK", - "SYS_SHARED_REGION_CHECK_NP", - "SYS_SHARED_REGION_MAP_AND_SLIDE_NP", - "SYS_SHMAT", - "SYS_SHMCTL", - "SYS_SHMDT", - "SYS_SHMGET", - "SYS_SHMSYS", - "SYS_SHM_OPEN", - "SYS_SHM_UNLINK", - "SYS_SHUTDOWN", - "SYS_SIGACTION", - "SYS_SIGALTSTACK", - "SYS_SIGNAL", - "SYS_SIGNALFD", - "SYS_SIGNALFD4", - "SYS_SIGPENDING", - "SYS_SIGPROCMASK", - "SYS_SIGQUEUE", - "SYS_SIGQUEUEINFO", - "SYS_SIGRETURN", - "SYS_SIGSUSPEND", - "SYS_SIGSUSPEND_NOCANCEL", - "SYS_SIGTIMEDWAIT", - "SYS_SIGWAIT", - "SYS_SIGWAITINFO", - "SYS_SOCKET", - "SYS_SOCKETCALL", - "SYS_SOCKETPAIR", - "SYS_SPLICE", - "SYS_SSETMASK", - "SYS_SSTK", - "SYS_STACK_SNAPSHOT", - "SYS_STAT", - "SYS_STAT64", - "SYS_STAT64_EXTENDED", - "SYS_STATFS", - "SYS_STATFS64", - "SYS_STATV", - "SYS_STATVFS1", - "SYS_STAT_EXTENDED", - "SYS_STIME", - "SYS_STTY", - "SYS_SWAPCONTEXT", - "SYS_SWAPCTL", - "SYS_SWAPOFF", - "SYS_SWAPON", - "SYS_SYMLINK", - "SYS_SYMLINKAT", - "SYS_SYNC", - "SYS_SYNCFS", - "SYS_SYNC_FILE_RANGE", - "SYS_SYSARCH", - "SYS_SYSCALL", - "SYS_SYSCALL_BASE", - "SYS_SYSFS", - "SYS_SYSINFO", - "SYS_SYSLOG", - "SYS_TEE", - "SYS_TGKILL", - "SYS_THREAD_SELFID", - "SYS_THR_CREATE", - "SYS_THR_EXIT", - "SYS_THR_KILL", - "SYS_THR_KILL2", - "SYS_THR_NEW", - "SYS_THR_SELF", - "SYS_THR_SET_NAME", - "SYS_THR_SUSPEND", - "SYS_THR_WAKE", - "SYS_TIME", - "SYS_TIMERFD_CREATE", - "SYS_TIMERFD_GETTIME", - "SYS_TIMERFD_SETTIME", - "SYS_TIMER_CREATE", - "SYS_TIMER_DELETE", - "SYS_TIMER_GETOVERRUN", - "SYS_TIMER_GETTIME", - "SYS_TIMER_SETTIME", - "SYS_TIMES", - "SYS_TKILL", - "SYS_TRUNCATE", - "SYS_TRUNCATE64", - "SYS_TUXCALL", - "SYS_UGETRLIMIT", - "SYS_ULIMIT", - "SYS_UMASK", - "SYS_UMASK_EXTENDED", - "SYS_UMOUNT", - "SYS_UMOUNT2", - "SYS_UNAME", - "SYS_UNDELETE", - "SYS_UNLINK", - "SYS_UNLINKAT", - "SYS_UNMOUNT", - "SYS_UNSHARE", - "SYS_USELIB", - "SYS_USTAT", - "SYS_UTIME", - "SYS_UTIMENSAT", - "SYS_UTIMES", - "SYS_UTRACE", - "SYS_UUIDGEN", - "SYS_VADVISE", - "SYS_VFORK", - "SYS_VHANGUP", - "SYS_VM86", - "SYS_VM86OLD", - "SYS_VMSPLICE", - "SYS_VM_PRESSURE_MONITOR", - "SYS_VSERVER", - "SYS_WAIT4", - "SYS_WAIT4_NOCANCEL", - "SYS_WAIT6", - "SYS_WAITEVENT", - "SYS_WAITID", - "SYS_WAITID_NOCANCEL", - "SYS_WAITPID", - "SYS_WATCHEVENT", - "SYS_WORKQ_KERNRETURN", - "SYS_WORKQ_OPEN", - "SYS_WRITE", - "SYS_WRITEV", - "SYS_WRITEV_NOCANCEL", - "SYS_WRITE_NOCANCEL", - "SYS_YIELD", - "SYS__LLSEEK", - "SYS__LWP_CONTINUE", - "SYS__LWP_CREATE", - "SYS__LWP_CTL", - "SYS__LWP_DETACH", - "SYS__LWP_EXIT", - "SYS__LWP_GETNAME", - "SYS__LWP_GETPRIVATE", - "SYS__LWP_KILL", - "SYS__LWP_PARK", - "SYS__LWP_SELF", - "SYS__LWP_SETNAME", - "SYS__LWP_SETPRIVATE", - "SYS__LWP_SUSPEND", - "SYS__LWP_UNPARK", - "SYS__LWP_UNPARK_ALL", - "SYS__LWP_WAIT", - "SYS__LWP_WAKEUP", - "SYS__NEWSELECT", - "SYS__PSET_BIND", - "SYS__SCHED_GETAFFINITY", - "SYS__SCHED_GETPARAM", - "SYS__SCHED_SETAFFINITY", - "SYS__SCHED_SETPARAM", - "SYS__SYSCTL", - "SYS__UMTX_LOCK", - "SYS__UMTX_OP", - "SYS__UMTX_UNLOCK", - "SYS___ACL_ACLCHECK_FD", - "SYS___ACL_ACLCHECK_FILE", - "SYS___ACL_ACLCHECK_LINK", - "SYS___ACL_DELETE_FD", - "SYS___ACL_DELETE_FILE", - "SYS___ACL_DELETE_LINK", - "SYS___ACL_GET_FD", - "SYS___ACL_GET_FILE", - "SYS___ACL_GET_LINK", - "SYS___ACL_SET_FD", - "SYS___ACL_SET_FILE", - "SYS___ACL_SET_LINK", - "SYS___CLONE", - "SYS___DISABLE_THREADSIGNAL", - "SYS___GETCWD", - "SYS___GETLOGIN", - "SYS___GET_TCB", - "SYS___MAC_EXECVE", - "SYS___MAC_GETFSSTAT", - "SYS___MAC_GET_FD", - "SYS___MAC_GET_FILE", - "SYS___MAC_GET_LCID", - "SYS___MAC_GET_LCTX", - "SYS___MAC_GET_LINK", - "SYS___MAC_GET_MOUNT", - "SYS___MAC_GET_PID", - "SYS___MAC_GET_PROC", - "SYS___MAC_MOUNT", - "SYS___MAC_SET_FD", - "SYS___MAC_SET_FILE", - "SYS___MAC_SET_LCTX", - "SYS___MAC_SET_LINK", - "SYS___MAC_SET_PROC", - "SYS___MAC_SYSCALL", - "SYS___OLD_SEMWAIT_SIGNAL", - "SYS___OLD_SEMWAIT_SIGNAL_NOCANCEL", - "SYS___POSIX_CHOWN", - "SYS___POSIX_FCHOWN", - "SYS___POSIX_LCHOWN", - "SYS___POSIX_RENAME", - "SYS___PTHREAD_CANCELED", - "SYS___PTHREAD_CHDIR", - "SYS___PTHREAD_FCHDIR", - "SYS___PTHREAD_KILL", - "SYS___PTHREAD_MARKCANCEL", - "SYS___PTHREAD_SIGMASK", - "SYS___QUOTACTL", - "SYS___SEMCTL", - "SYS___SEMWAIT_SIGNAL", - "SYS___SEMWAIT_SIGNAL_NOCANCEL", - "SYS___SETLOGIN", - "SYS___SETUGID", - "SYS___SET_TCB", - "SYS___SIGACTION_SIGTRAMP", - "SYS___SIGTIMEDWAIT", - "SYS___SIGWAIT", - "SYS___SIGWAIT_NOCANCEL", - "SYS___SYSCTL", - "SYS___TFORK", - "SYS___THREXIT", - "SYS___THRSIGDIVERT", - "SYS___THRSLEEP", - "SYS___THRWAKEUP", - "S_ARCH1", - "S_ARCH2", - "S_BLKSIZE", - "S_IEXEC", - "S_IFBLK", - "S_IFCHR", - "S_IFDIR", - "S_IFIFO", - "S_IFLNK", - "S_IFMT", - "S_IFREG", - "S_IFSOCK", - "S_IFWHT", - "S_IREAD", - "S_IRGRP", - "S_IROTH", - "S_IRUSR", - "S_IRWXG", - "S_IRWXO", - "S_IRWXU", - "S_ISGID", - "S_ISTXT", - "S_ISUID", - "S_ISVTX", - "S_IWGRP", - "S_IWOTH", - "S_IWRITE", - "S_IWUSR", - "S_IXGRP", - "S_IXOTH", - "S_IXUSR", - "S_LOGIN_SET", - "SecurityAttributes", - "Seek", - "Select", - "Sendfile", - "Sendmsg", - "SendmsgN", - "Sendto", - "Servent", - "SetBpf", - "SetBpfBuflen", - "SetBpfDatalink", - "SetBpfHeadercmpl", - "SetBpfImmediate", - "SetBpfInterface", - "SetBpfPromisc", - "SetBpfTimeout", - "SetCurrentDirectory", - "SetEndOfFile", - "SetEnvironmentVariable", - "SetFileAttributes", - "SetFileCompletionNotificationModes", - "SetFilePointer", - "SetFileTime", - "SetHandleInformation", - "SetKevent", - "SetLsfPromisc", - "SetNonblock", - "Setdomainname", - "Setegid", - "Setenv", - "Seteuid", - "Setfsgid", - "Setfsuid", - "Setgid", - "Setgroups", - "Sethostname", - "Setlogin", - "Setpgid", - "Setpriority", - "Setprivexec", - "Setregid", - "Setresgid", - "Setresuid", - "Setreuid", - "Setrlimit", - "Setsid", - "Setsockopt", - "SetsockoptByte", - "SetsockoptICMPv6Filter", - "SetsockoptIPMreq", - "SetsockoptIPMreqn", - "SetsockoptIPv6Mreq", - "SetsockoptInet4Addr", - "SetsockoptInt", - "SetsockoptLinger", - "SetsockoptString", - "SetsockoptTimeval", - "Settimeofday", - "Setuid", - "Setxattr", - "Shutdown", - "SidTypeAlias", - "SidTypeComputer", - "SidTypeDeletedAccount", - "SidTypeDomain", - "SidTypeGroup", - "SidTypeInvalid", - "SidTypeLabel", - "SidTypeUnknown", - "SidTypeUser", - "SidTypeWellKnownGroup", - "Signal", - "SizeofBpfHdr", - "SizeofBpfInsn", - "SizeofBpfProgram", - "SizeofBpfStat", - "SizeofBpfVersion", - "SizeofBpfZbuf", - "SizeofBpfZbufHeader", - "SizeofCmsghdr", - "SizeofICMPv6Filter", - "SizeofIPMreq", - "SizeofIPMreqn", - "SizeofIPv6MTUInfo", - "SizeofIPv6Mreq", - "SizeofIfAddrmsg", - "SizeofIfAnnounceMsghdr", - "SizeofIfData", - "SizeofIfInfomsg", - "SizeofIfMsghdr", - "SizeofIfaMsghdr", - "SizeofIfmaMsghdr", - "SizeofIfmaMsghdr2", - "SizeofInet4Pktinfo", - "SizeofInet6Pktinfo", - "SizeofInotifyEvent", - "SizeofLinger", - "SizeofMsghdr", - "SizeofNlAttr", - "SizeofNlMsgerr", - "SizeofNlMsghdr", - "SizeofRtAttr", - "SizeofRtGenmsg", - "SizeofRtMetrics", - "SizeofRtMsg", - "SizeofRtMsghdr", - "SizeofRtNexthop", - "SizeofSockFilter", - "SizeofSockFprog", - "SizeofSockaddrAny", - "SizeofSockaddrDatalink", - "SizeofSockaddrInet4", - "SizeofSockaddrInet6", - "SizeofSockaddrLinklayer", - "SizeofSockaddrNetlink", - "SizeofSockaddrUnix", - "SizeofTCPInfo", - "SizeofUcred", - "SlicePtrFromStrings", - "SockFilter", - "SockFprog", - "Sockaddr", - "SockaddrDatalink", - "SockaddrGen", - "SockaddrInet4", - "SockaddrInet6", - "SockaddrLinklayer", - "SockaddrNetlink", - "SockaddrUnix", - "Socket", - "SocketControlMessage", - "SocketDisableIPv6", - "Socketpair", - "Splice", - "StartProcess", - "StartupInfo", - "Stat", - "Stat_t", - "Statfs", - "Statfs_t", - "Stderr", - "Stdin", - "Stdout", - "StringBytePtr", - "StringByteSlice", - "StringSlicePtr", - "StringToSid", - "StringToUTF16", - "StringToUTF16Ptr", - "Symlink", - "Sync", - "SyncFileRange", - "SysProcAttr", - "SysProcIDMap", - "Syscall", - "Syscall12", - "Syscall15", - "Syscall18", - "Syscall6", - "Syscall9", - "Sysctl", - "SysctlUint32", - "Sysctlnode", - "Sysinfo", - "Sysinfo_t", - "Systemtime", - "TCGETS", - "TCIFLUSH", - "TCIOFLUSH", - "TCOFLUSH", - "TCPInfo", - "TCPKeepalive", - "TCP_CA_NAME_MAX", - "TCP_CONGCTL", - "TCP_CONGESTION", - "TCP_CONNECTIONTIMEOUT", - "TCP_CORK", - "TCP_DEFER_ACCEPT", - "TCP_INFO", - "TCP_KEEPALIVE", - "TCP_KEEPCNT", - "TCP_KEEPIDLE", - "TCP_KEEPINIT", - "TCP_KEEPINTVL", - "TCP_LINGER2", - "TCP_MAXBURST", - "TCP_MAXHLEN", - "TCP_MAXOLEN", - "TCP_MAXSEG", - "TCP_MAXWIN", - "TCP_MAX_SACK", - "TCP_MAX_WINSHIFT", - "TCP_MD5SIG", - "TCP_MD5SIG_MAXKEYLEN", - "TCP_MINMSS", - "TCP_MINMSSOVERLOAD", - "TCP_MSS", - "TCP_NODELAY", - "TCP_NOOPT", - "TCP_NOPUSH", - "TCP_NSTATES", - "TCP_QUICKACK", - "TCP_RXT_CONNDROPTIME", - "TCP_RXT_FINDROP", - "TCP_SACK_ENABLE", - "TCP_SYNCNT", - "TCP_VENDOR", - "TCP_WINDOW_CLAMP", - "TCSAFLUSH", - "TCSETS", - "TF_DISCONNECT", - "TF_REUSE_SOCKET", - "TF_USE_DEFAULT_WORKER", - "TF_USE_KERNEL_APC", - "TF_USE_SYSTEM_THREAD", - "TF_WRITE_BEHIND", - "TH32CS_INHERIT", - "TH32CS_SNAPALL", - "TH32CS_SNAPHEAPLIST", - "TH32CS_SNAPMODULE", - "TH32CS_SNAPMODULE32", - "TH32CS_SNAPPROCESS", - "TH32CS_SNAPTHREAD", - "TIME_ZONE_ID_DAYLIGHT", - "TIME_ZONE_ID_STANDARD", - "TIME_ZONE_ID_UNKNOWN", - "TIOCCBRK", - "TIOCCDTR", - "TIOCCONS", - "TIOCDCDTIMESTAMP", - "TIOCDRAIN", - "TIOCDSIMICROCODE", - "TIOCEXCL", - "TIOCEXT", - "TIOCFLAG_CDTRCTS", - "TIOCFLAG_CLOCAL", - "TIOCFLAG_CRTSCTS", - "TIOCFLAG_MDMBUF", - "TIOCFLAG_PPS", - "TIOCFLAG_SOFTCAR", - "TIOCFLUSH", - "TIOCGDEV", - "TIOCGDRAINWAIT", - "TIOCGETA", - "TIOCGETD", - "TIOCGFLAGS", - "TIOCGICOUNT", - "TIOCGLCKTRMIOS", - "TIOCGLINED", - "TIOCGPGRP", - "TIOCGPTN", - "TIOCGQSIZE", - "TIOCGRANTPT", - "TIOCGRS485", - "TIOCGSERIAL", - "TIOCGSID", - "TIOCGSIZE", - "TIOCGSOFTCAR", - "TIOCGTSTAMP", - "TIOCGWINSZ", - "TIOCINQ", - "TIOCIXOFF", - "TIOCIXON", - "TIOCLINUX", - "TIOCMBIC", - "TIOCMBIS", - "TIOCMGDTRWAIT", - "TIOCMGET", - "TIOCMIWAIT", - "TIOCMODG", - "TIOCMODS", - "TIOCMSDTRWAIT", - "TIOCMSET", - "TIOCM_CAR", - "TIOCM_CD", - "TIOCM_CTS", - "TIOCM_DCD", - "TIOCM_DSR", - "TIOCM_DTR", - "TIOCM_LE", - "TIOCM_RI", - "TIOCM_RNG", - "TIOCM_RTS", - "TIOCM_SR", - "TIOCM_ST", - "TIOCNOTTY", - "TIOCNXCL", - "TIOCOUTQ", - "TIOCPKT", - "TIOCPKT_DATA", - "TIOCPKT_DOSTOP", - "TIOCPKT_FLUSHREAD", - "TIOCPKT_FLUSHWRITE", - "TIOCPKT_IOCTL", - "TIOCPKT_NOSTOP", - "TIOCPKT_START", - "TIOCPKT_STOP", - "TIOCPTMASTER", - "TIOCPTMGET", - "TIOCPTSNAME", - "TIOCPTYGNAME", - "TIOCPTYGRANT", - "TIOCPTYUNLK", - "TIOCRCVFRAME", - "TIOCREMOTE", - "TIOCSBRK", - "TIOCSCONS", - "TIOCSCTTY", - "TIOCSDRAINWAIT", - "TIOCSDTR", - "TIOCSERCONFIG", - "TIOCSERGETLSR", - "TIOCSERGETMULTI", - "TIOCSERGSTRUCT", - "TIOCSERGWILD", - "TIOCSERSETMULTI", - "TIOCSERSWILD", - "TIOCSER_TEMT", - "TIOCSETA", - "TIOCSETAF", - "TIOCSETAW", - "TIOCSETD", - "TIOCSFLAGS", - "TIOCSIG", - "TIOCSLCKTRMIOS", - "TIOCSLINED", - "TIOCSPGRP", - "TIOCSPTLCK", - "TIOCSQSIZE", - "TIOCSRS485", - "TIOCSSERIAL", - "TIOCSSIZE", - "TIOCSSOFTCAR", - "TIOCSTART", - "TIOCSTAT", - "TIOCSTI", - "TIOCSTOP", - "TIOCSTSTAMP", - "TIOCSWINSZ", - "TIOCTIMESTAMP", - "TIOCUCNTL", - "TIOCVHANGUP", - "TIOCXMTFRAME", - "TOKEN_ADJUST_DEFAULT", - "TOKEN_ADJUST_GROUPS", - "TOKEN_ADJUST_PRIVILEGES", - "TOKEN_ADJUST_SESSIONID", - "TOKEN_ALL_ACCESS", - "TOKEN_ASSIGN_PRIMARY", - "TOKEN_DUPLICATE", - "TOKEN_EXECUTE", - "TOKEN_IMPERSONATE", - "TOKEN_QUERY", - "TOKEN_QUERY_SOURCE", - "TOKEN_READ", - "TOKEN_WRITE", - "TOSTOP", - "TRUNCATE_EXISTING", - "TUNATTACHFILTER", - "TUNDETACHFILTER", - "TUNGETFEATURES", - "TUNGETIFF", - "TUNGETSNDBUF", - "TUNGETVNETHDRSZ", - "TUNSETDEBUG", - "TUNSETGROUP", - "TUNSETIFF", - "TUNSETLINK", - "TUNSETNOCSUM", - "TUNSETOFFLOAD", - "TUNSETOWNER", - "TUNSETPERSIST", - "TUNSETSNDBUF", - "TUNSETTXFILTER", - "TUNSETVNETHDRSZ", - "Tee", - "TerminateProcess", - "Termios", - "Tgkill", - "Time", - "Time_t", - "Times", - "Timespec", - "TimespecToNsec", - "Timeval", - "Timeval32", - "TimevalToNsec", - "Timex", - "Timezoneinformation", - "Tms", - "Token", - "TokenAccessInformation", - "TokenAuditPolicy", - "TokenDefaultDacl", - "TokenElevation", - "TokenElevationType", - "TokenGroups", - "TokenGroupsAndPrivileges", - "TokenHasRestrictions", - "TokenImpersonationLevel", - "TokenIntegrityLevel", - "TokenLinkedToken", - "TokenLogonSid", - "TokenMandatoryPolicy", - "TokenOrigin", - "TokenOwner", - "TokenPrimaryGroup", - "TokenPrivileges", - "TokenRestrictedSids", - "TokenSandBoxInert", - "TokenSessionId", - "TokenSessionReference", - "TokenSource", - "TokenStatistics", - "TokenType", - "TokenUIAccess", - "TokenUser", - "TokenVirtualizationAllowed", - "TokenVirtualizationEnabled", - "Tokenprimarygroup", - "Tokenuser", - "TranslateAccountName", - "TranslateName", - "TransmitFile", - "TransmitFileBuffers", - "Truncate", - "UNIX_PATH_MAX", - "USAGE_MATCH_TYPE_AND", - "USAGE_MATCH_TYPE_OR", - "UTF16FromString", - "UTF16PtrFromString", - "UTF16ToString", - "Ucred", - "Umask", - "Uname", - "Undelete", - "UnixCredentials", - "UnixRights", - "Unlink", - "Unlinkat", - "UnmapViewOfFile", - "Unmount", - "Unsetenv", - "Unshare", - "UserInfo10", - "Ustat", - "Ustat_t", - "Utimbuf", - "Utime", - "Utimes", - "UtimesNano", - "Utsname", - "VDISCARD", - "VDSUSP", - "VEOF", - "VEOL", - "VEOL2", - "VERASE", - "VERASE2", - "VINTR", - "VKILL", - "VLNEXT", - "VMIN", - "VQUIT", - "VREPRINT", - "VSTART", - "VSTATUS", - "VSTOP", - "VSUSP", - "VSWTC", - "VT0", - "VT1", - "VTDLY", - "VTIME", - "VWERASE", - "VirtualLock", - "VirtualUnlock", - "WAIT_ABANDONED", - "WAIT_FAILED", - "WAIT_OBJECT_0", - "WAIT_TIMEOUT", - "WALL", - "WALLSIG", - "WALTSIG", - "WCLONE", - "WCONTINUED", - "WCOREFLAG", - "WEXITED", - "WLINUXCLONE", - "WNOHANG", - "WNOTHREAD", - "WNOWAIT", - "WNOZOMBIE", - "WOPTSCHECKED", - "WORDSIZE", - "WSABuf", - "WSACleanup", - "WSADESCRIPTION_LEN", - "WSAData", - "WSAEACCES", - "WSAECONNABORTED", - "WSAECONNRESET", - "WSAEnumProtocols", - "WSAID_CONNECTEX", - "WSAIoctl", - "WSAPROTOCOL_LEN", - "WSAProtocolChain", - "WSAProtocolInfo", - "WSARecv", - "WSARecvFrom", - "WSASYS_STATUS_LEN", - "WSASend", - "WSASendTo", - "WSASendto", - "WSAStartup", - "WSTOPPED", - "WTRAPPED", - "WUNTRACED", - "Wait4", - "WaitForSingleObject", - "WaitStatus", - "Win32FileAttributeData", - "Win32finddata", - "Write", - "WriteConsole", - "WriteFile", - "X509_ASN_ENCODING", - "XCASE", - "XP1_CONNECTIONLESS", - "XP1_CONNECT_DATA", - "XP1_DISCONNECT_DATA", - "XP1_EXPEDITED_DATA", - "XP1_GRACEFUL_CLOSE", - "XP1_GUARANTEED_DELIVERY", - "XP1_GUARANTEED_ORDER", - "XP1_IFS_HANDLES", - "XP1_MESSAGE_ORIENTED", - "XP1_MULTIPOINT_CONTROL_PLANE", - "XP1_MULTIPOINT_DATA_PLANE", - "XP1_PARTIAL_MESSAGE", - "XP1_PSEUDO_STREAM", - "XP1_QOS_SUPPORTED", - "XP1_SAN_SUPPORT_SDP", - "XP1_SUPPORT_BROADCAST", - "XP1_SUPPORT_MULTIPOINT", - "XP1_UNI_RECV", - "XP1_UNI_SEND", - }, - "syscall/js": []string{ - "CopyBytesToGo", - "CopyBytesToJS", - "Error", - "Func", - "FuncOf", - "Global", - "Null", - "Type", - "TypeBoolean", - "TypeFunction", - "TypeNull", - "TypeNumber", - "TypeObject", - "TypeString", - "TypeSymbol", - "TypeUndefined", - "Undefined", - "Value", - "ValueError", - "ValueOf", - "Wrapper", - }, - "testing": []string{ - "AllocsPerRun", - "B", - "Benchmark", - "BenchmarkResult", - "Cover", - "CoverBlock", - "CoverMode", - "Coverage", - "Init", - "InternalBenchmark", - "InternalExample", - "InternalTest", - "M", - "Main", - "MainStart", - "PB", - "RegisterCover", - "RunBenchmarks", - "RunExamples", - "RunTests", - "Short", - "T", - "TB", - "Verbose", - }, - "testing/iotest": []string{ - "DataErrReader", - "ErrTimeout", - "HalfReader", - "NewReadLogger", - "NewWriteLogger", - "OneByteReader", - "TimeoutReader", - "TruncateWriter", - }, - "testing/quick": []string{ - "Check", - "CheckEqual", - "CheckEqualError", - "CheckError", - "Config", - "Generator", - "SetupError", - "Value", - }, - "text/scanner": []string{ - "Char", - "Comment", - "EOF", - "Float", - "GoTokens", - "GoWhitespace", - "Ident", - "Int", - "Position", - "RawString", - "ScanChars", - "ScanComments", - "ScanFloats", - "ScanIdents", - "ScanInts", - "ScanRawStrings", - "ScanStrings", - "Scanner", - "SkipComments", - "String", - "TokenString", - }, - "text/tabwriter": []string{ - "AlignRight", - "Debug", - "DiscardEmptyColumns", - "Escape", - "FilterHTML", - "NewWriter", - "StripEscape", - "TabIndent", - "Writer", - }, - "text/template": []string{ - "ExecError", - "FuncMap", - "HTMLEscape", - "HTMLEscapeString", - "HTMLEscaper", - "IsTrue", - "JSEscape", - "JSEscapeString", - "JSEscaper", - "Must", - "New", - "ParseFiles", - "ParseGlob", - "Template", - "URLQueryEscaper", - }, - "text/template/parse": []string{ - "ActionNode", - "BoolNode", - "BranchNode", - "ChainNode", - "CommandNode", - "DotNode", - "FieldNode", - "IdentifierNode", - "IfNode", - "IsEmptyTree", - "ListNode", - "New", - "NewIdentifier", - "NilNode", - "Node", - "NodeAction", - "NodeBool", - "NodeChain", - "NodeCommand", - "NodeDot", - "NodeField", - "NodeIdentifier", - "NodeIf", - "NodeList", - "NodeNil", - "NodeNumber", - "NodePipe", - "NodeRange", - "NodeString", - "NodeTemplate", - "NodeText", - "NodeType", - "NodeVariable", - "NodeWith", - "NumberNode", - "Parse", - "PipeNode", - "Pos", - "RangeNode", - "StringNode", - "TemplateNode", - "TextNode", - "Tree", - "VariableNode", - "WithNode", - }, - "time": []string{ - "ANSIC", - "After", - "AfterFunc", - "April", - "August", - "Date", - "December", - "Duration", - "February", - "FixedZone", - "Friday", - "Hour", - "January", - "July", - "June", - "Kitchen", - "LoadLocation", - "LoadLocationFromTZData", - "Local", - "Location", - "March", - "May", - "Microsecond", - "Millisecond", - "Minute", - "Monday", - "Month", - "Nanosecond", - "NewTicker", - "NewTimer", - "November", - "Now", - "October", - "Parse", - "ParseDuration", - "ParseError", - "ParseInLocation", - "RFC1123", - "RFC1123Z", - "RFC3339", - "RFC3339Nano", - "RFC822", - "RFC822Z", - "RFC850", - "RubyDate", - "Saturday", - "Second", - "September", - "Since", - "Sleep", - "Stamp", - "StampMicro", - "StampMilli", - "StampNano", - "Sunday", - "Thursday", - "Tick", - "Ticker", - "Time", - "Timer", - "Tuesday", - "UTC", - "Unix", - "UnixDate", - "Until", - "Wednesday", - "Weekday", - }, - "unicode": []string{ - "ASCII_Hex_Digit", - "Adlam", - "Ahom", - "Anatolian_Hieroglyphs", - "Arabic", - "Armenian", - "Avestan", - "AzeriCase", - "Balinese", - "Bamum", - "Bassa_Vah", - "Batak", - "Bengali", - "Bhaiksuki", - "Bidi_Control", - "Bopomofo", - "Brahmi", - "Braille", - "Buginese", - "Buhid", - "C", - "Canadian_Aboriginal", - "Carian", - "CaseRange", - "CaseRanges", - "Categories", - "Caucasian_Albanian", - "Cc", - "Cf", - "Chakma", - "Cham", - "Cherokee", - "Co", - "Common", - "Coptic", - "Cs", - "Cuneiform", - "Cypriot", - "Cyrillic", - "Dash", - "Deprecated", - "Deseret", - "Devanagari", - "Diacritic", - "Digit", - "Dogra", - "Duployan", - "Egyptian_Hieroglyphs", - "Elbasan", - "Ethiopic", - "Extender", - "FoldCategory", - "FoldScript", - "Georgian", - "Glagolitic", - "Gothic", - "Grantha", - "GraphicRanges", - "Greek", - "Gujarati", - "Gunjala_Gondi", - "Gurmukhi", - "Han", - "Hangul", - "Hanifi_Rohingya", - "Hanunoo", - "Hatran", - "Hebrew", - "Hex_Digit", - "Hiragana", - "Hyphen", - "IDS_Binary_Operator", - "IDS_Trinary_Operator", - "Ideographic", - "Imperial_Aramaic", - "In", - "Inherited", - "Inscriptional_Pahlavi", - "Inscriptional_Parthian", - "Is", - "IsControl", - "IsDigit", - "IsGraphic", - "IsLetter", - "IsLower", - "IsMark", - "IsNumber", - "IsOneOf", - "IsPrint", - "IsPunct", - "IsSpace", - "IsSymbol", - "IsTitle", - "IsUpper", - "Javanese", - "Join_Control", - "Kaithi", - "Kannada", - "Katakana", - "Kayah_Li", - "Kharoshthi", - "Khmer", - "Khojki", - "Khudawadi", - "L", - "Lao", - "Latin", - "Lepcha", - "Letter", - "Limbu", - "Linear_A", - "Linear_B", - "Lisu", - "Ll", - "Lm", - "Lo", - "Logical_Order_Exception", - "Lower", - "LowerCase", - "Lt", - "Lu", - "Lycian", - "Lydian", - "M", - "Mahajani", - "Makasar", - "Malayalam", - "Mandaic", - "Manichaean", - "Marchen", - "Mark", - "Masaram_Gondi", - "MaxASCII", - "MaxCase", - "MaxLatin1", - "MaxRune", - "Mc", - "Me", - "Medefaidrin", - "Meetei_Mayek", - "Mende_Kikakui", - "Meroitic_Cursive", - "Meroitic_Hieroglyphs", - "Miao", - "Mn", - "Modi", - "Mongolian", - "Mro", - "Multani", - "Myanmar", - "N", - "Nabataean", - "Nd", - "New_Tai_Lue", - "Newa", - "Nko", - "Nl", - "No", - "Noncharacter_Code_Point", - "Number", - "Nushu", - "Ogham", - "Ol_Chiki", - "Old_Hungarian", - "Old_Italic", - "Old_North_Arabian", - "Old_Permic", - "Old_Persian", - "Old_Sogdian", - "Old_South_Arabian", - "Old_Turkic", - "Oriya", - "Osage", - "Osmanya", - "Other", - "Other_Alphabetic", - "Other_Default_Ignorable_Code_Point", - "Other_Grapheme_Extend", - "Other_ID_Continue", - "Other_ID_Start", - "Other_Lowercase", - "Other_Math", - "Other_Uppercase", - "P", - "Pahawh_Hmong", - "Palmyrene", - "Pattern_Syntax", - "Pattern_White_Space", - "Pau_Cin_Hau", - "Pc", - "Pd", - "Pe", - "Pf", - "Phags_Pa", - "Phoenician", - "Pi", - "Po", - "Prepended_Concatenation_Mark", - "PrintRanges", - "Properties", - "Ps", - "Psalter_Pahlavi", - "Punct", - "Quotation_Mark", - "Radical", - "Range16", - "Range32", - "RangeTable", - "Regional_Indicator", - "Rejang", - "ReplacementChar", - "Runic", - "S", - "STerm", - "Samaritan", - "Saurashtra", - "Sc", - "Scripts", - "Sentence_Terminal", - "Sharada", - "Shavian", - "Siddham", - "SignWriting", - "SimpleFold", - "Sinhala", - "Sk", - "Sm", - "So", - "Soft_Dotted", - "Sogdian", - "Sora_Sompeng", - "Soyombo", - "Space", - "SpecialCase", - "Sundanese", - "Syloti_Nagri", - "Symbol", - "Syriac", - "Tagalog", - "Tagbanwa", - "Tai_Le", - "Tai_Tham", - "Tai_Viet", - "Takri", - "Tamil", - "Tangut", - "Telugu", - "Terminal_Punctuation", - "Thaana", - "Thai", - "Tibetan", - "Tifinagh", - "Tirhuta", - "Title", - "TitleCase", - "To", - "ToLower", - "ToTitle", - "ToUpper", - "TurkishCase", - "Ugaritic", - "Unified_Ideograph", - "Upper", - "UpperCase", - "UpperLower", - "Vai", - "Variation_Selector", - "Version", - "Warang_Citi", - "White_Space", - "Yi", - "Z", - "Zanabazar_Square", - "Zl", - "Zp", - "Zs", - }, - "unicode/utf16": []string{ - "Decode", - "DecodeRune", - "Encode", - "EncodeRune", - "IsSurrogate", - }, - "unicode/utf8": []string{ - "DecodeLastRune", - "DecodeLastRuneInString", - "DecodeRune", - "DecodeRuneInString", - "EncodeRune", - "FullRune", - "FullRuneInString", - "MaxRune", - "RuneCount", - "RuneCountInString", - "RuneError", - "RuneLen", - "RuneSelf", - "RuneStart", - "UTFMax", - "Valid", - "ValidRune", - "ValidString", - }, - "unsafe": []string{ - "Alignof", - "ArbitraryType", - "Offsetof", - "Pointer", - "Sizeof", - }, -} diff --git a/vendor/golang.org/x/xerrors/LICENSE b/vendor/golang.org/x/xerrors/LICENSE deleted file mode 100644 index e4a47e1..0000000 --- a/vendor/golang.org/x/xerrors/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2019 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/xerrors/PATENTS b/vendor/golang.org/x/xerrors/PATENTS deleted file mode 100644 index 7330990..0000000 --- a/vendor/golang.org/x/xerrors/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Go project. - -Google hereby grants to You a perpetual, worldwide, non-exclusive, -no-charge, royalty-free, irrevocable (except as stated in this section) -patent license to make, have made, use, offer to sell, sell, import, -transfer and otherwise run, modify and propagate the contents of this -implementation of Go, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of Go. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of Go or any code incorporated within this -implementation of Go constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of Go -shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/xerrors/README b/vendor/golang.org/x/xerrors/README deleted file mode 100644 index aac7867..0000000 --- a/vendor/golang.org/x/xerrors/README +++ /dev/null @@ -1,2 +0,0 @@ -This repository holds the transition packages for the new Go 1.13 error values. -See golang.org/design/29934-error-values. diff --git a/vendor/golang.org/x/xerrors/adaptor.go b/vendor/golang.org/x/xerrors/adaptor.go deleted file mode 100644 index 4317f24..0000000 --- a/vendor/golang.org/x/xerrors/adaptor.go +++ /dev/null @@ -1,193 +0,0 @@ -// 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 xerrors - -import ( - "bytes" - "fmt" - "io" - "reflect" - "strconv" -) - -// FormatError calls the FormatError method of f with an errors.Printer -// configured according to s and verb, and writes the result to s. -func FormatError(f Formatter, s fmt.State, verb rune) { - // Assuming this function is only called from the Format method, and given - // that FormatError takes precedence over Format, it cannot be called from - // any package that supports errors.Formatter. It is therefore safe to - // disregard that State may be a specific printer implementation and use one - // of our choice instead. - - // limitations: does not support printing error as Go struct. - - var ( - sep = " " // separator before next error - p = &state{State: s} - direct = true - ) - - var err error = f - - switch verb { - // Note that this switch must match the preference order - // for ordinary string printing (%#v before %+v, and so on). - - case 'v': - if s.Flag('#') { - if stringer, ok := err.(fmt.GoStringer); ok { - io.WriteString(&p.buf, stringer.GoString()) - goto exit - } - // proceed as if it were %v - } else if s.Flag('+') { - p.printDetail = true - sep = "\n - " - } - case 's': - case 'q', 'x', 'X': - // Use an intermediate buffer in the rare cases that precision, - // truncation, or one of the alternative verbs (q, x, and X) are - // specified. - direct = false - - default: - p.buf.WriteString("%!") - p.buf.WriteRune(verb) - p.buf.WriteByte('(') - switch { - case err != nil: - p.buf.WriteString(reflect.TypeOf(f).String()) - default: - p.buf.WriteString("") - } - p.buf.WriteByte(')') - io.Copy(s, &p.buf) - return - } - -loop: - for { - switch v := err.(type) { - case Formatter: - err = v.FormatError((*printer)(p)) - case fmt.Formatter: - v.Format(p, 'v') - break loop - default: - io.WriteString(&p.buf, v.Error()) - break loop - } - if err == nil { - break - } - if p.needColon || !p.printDetail { - p.buf.WriteByte(':') - p.needColon = false - } - p.buf.WriteString(sep) - p.inDetail = false - p.needNewline = false - } - -exit: - width, okW := s.Width() - prec, okP := s.Precision() - - if !direct || (okW && width > 0) || okP { - // Construct format string from State s. - format := []byte{'%'} - if s.Flag('-') { - format = append(format, '-') - } - if s.Flag('+') { - format = append(format, '+') - } - if s.Flag(' ') { - format = append(format, ' ') - } - if okW { - format = strconv.AppendInt(format, int64(width), 10) - } - if okP { - format = append(format, '.') - format = strconv.AppendInt(format, int64(prec), 10) - } - format = append(format, string(verb)...) - fmt.Fprintf(s, string(format), p.buf.String()) - } else { - io.Copy(s, &p.buf) - } -} - -var detailSep = []byte("\n ") - -// state tracks error printing state. It implements fmt.State. -type state struct { - fmt.State - buf bytes.Buffer - - printDetail bool - inDetail bool - needColon bool - needNewline bool -} - -func (s *state) Write(b []byte) (n int, err error) { - if s.printDetail { - if len(b) == 0 { - return 0, nil - } - if s.inDetail && s.needColon { - s.needNewline = true - if b[0] == '\n' { - b = b[1:] - } - } - k := 0 - for i, c := range b { - if s.needNewline { - if s.inDetail && s.needColon { - s.buf.WriteByte(':') - s.needColon = false - } - s.buf.Write(detailSep) - s.needNewline = false - } - if c == '\n' { - s.buf.Write(b[k:i]) - k = i + 1 - s.needNewline = true - } - } - s.buf.Write(b[k:]) - if !s.inDetail { - s.needColon = true - } - } else if !s.inDetail { - s.buf.Write(b) - } - return len(b), nil -} - -// printer wraps a state to implement an xerrors.Printer. -type printer state - -func (s *printer) Print(args ...interface{}) { - if !s.inDetail || s.printDetail { - fmt.Fprint((*state)(s), args...) - } -} - -func (s *printer) Printf(format string, args ...interface{}) { - if !s.inDetail || s.printDetail { - fmt.Fprintf((*state)(s), format, args...) - } -} - -func (s *printer) Detail() bool { - s.inDetail = true - return s.printDetail -} diff --git a/vendor/golang.org/x/xerrors/codereview.cfg b/vendor/golang.org/x/xerrors/codereview.cfg deleted file mode 100644 index 3f8b14b..0000000 --- a/vendor/golang.org/x/xerrors/codereview.cfg +++ /dev/null @@ -1 +0,0 @@ -issuerepo: golang/go diff --git a/vendor/golang.org/x/xerrors/doc.go b/vendor/golang.org/x/xerrors/doc.go deleted file mode 100644 index eef99d9..0000000 --- a/vendor/golang.org/x/xerrors/doc.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package xerrors implements functions to manipulate errors. -// -// This package is based on the Go 2 proposal for error values: -// https://golang.org/design/29934-error-values -// -// These functions were incorporated into the standard library's errors package -// in Go 1.13: -// - Is -// - As -// - Unwrap -// -// Also, Errorf's %w verb was incorporated into fmt.Errorf. -// -// Use this package to get equivalent behavior in all supported Go versions. -// -// No other features of this package were included in Go 1.13, and at present -// there are no plans to include any of them. -package xerrors // import "golang.org/x/xerrors" diff --git a/vendor/golang.org/x/xerrors/errors.go b/vendor/golang.org/x/xerrors/errors.go deleted file mode 100644 index e88d377..0000000 --- a/vendor/golang.org/x/xerrors/errors.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xerrors - -import "fmt" - -// errorString is a trivial implementation of error. -type errorString struct { - s string - frame Frame -} - -// New returns an error that formats as the given text. -// -// The returned error contains a Frame set to the caller's location and -// implements Formatter to show this information when printed with details. -func New(text string) error { - return &errorString{text, Caller(1)} -} - -func (e *errorString) Error() string { - return e.s -} - -func (e *errorString) Format(s fmt.State, v rune) { FormatError(e, s, v) } - -func (e *errorString) FormatError(p Printer) (next error) { - p.Print(e.s) - e.frame.Format(p) - return nil -} diff --git a/vendor/golang.org/x/xerrors/fmt.go b/vendor/golang.org/x/xerrors/fmt.go deleted file mode 100644 index 829862d..0000000 --- a/vendor/golang.org/x/xerrors/fmt.go +++ /dev/null @@ -1,187 +0,0 @@ -// 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 xerrors - -import ( - "fmt" - "strings" - "unicode" - "unicode/utf8" - - "golang.org/x/xerrors/internal" -) - -const percentBangString = "%!" - -// Errorf formats according to a format specifier and returns the string as a -// value that satisfies error. -// -// The returned error includes the file and line number of the caller when -// formatted with additional detail enabled. If the last argument is an error -// the returned error's Format method will return it if the format string ends -// with ": %s", ": %v", or ": %w". If the last argument is an error and the -// format string ends with ": %w", the returned error implements an Unwrap -// method returning it. -// -// If the format specifier includes a %w verb with an error operand in a -// position other than at the end, the returned error will still implement an -// Unwrap method returning the operand, but the error's Format method will not -// return the wrapped error. -// -// It is invalid to include more than one %w verb or to supply it with an -// operand that does not implement the error interface. The %w verb is otherwise -// a synonym for %v. -func Errorf(format string, a ...interface{}) error { - format = formatPlusW(format) - // Support a ": %[wsv]" suffix, which works well with xerrors.Formatter. - wrap := strings.HasSuffix(format, ": %w") - idx, format2, ok := parsePercentW(format) - percentWElsewhere := !wrap && idx >= 0 - if !percentWElsewhere && (wrap || strings.HasSuffix(format, ": %s") || strings.HasSuffix(format, ": %v")) { - err := errorAt(a, len(a)-1) - if err == nil { - return &noWrapError{fmt.Sprintf(format, a...), nil, Caller(1)} - } - // TODO: this is not entirely correct. The error value could be - // printed elsewhere in format if it mixes numbered with unnumbered - // substitutions. With relatively small changes to doPrintf we can - // have it optionally ignore extra arguments and pass the argument - // list in its entirety. - msg := fmt.Sprintf(format[:len(format)-len(": %s")], a[:len(a)-1]...) - frame := Frame{} - if internal.EnableTrace { - frame = Caller(1) - } - if wrap { - return &wrapError{msg, err, frame} - } - return &noWrapError{msg, err, frame} - } - // Support %w anywhere. - // TODO: don't repeat the wrapped error's message when %w occurs in the middle. - msg := fmt.Sprintf(format2, a...) - if idx < 0 { - return &noWrapError{msg, nil, Caller(1)} - } - err := errorAt(a, idx) - if !ok || err == nil { - // Too many %ws or argument of %w is not an error. Approximate the Go - // 1.13 fmt.Errorf message. - return &noWrapError{fmt.Sprintf("%sw(%s)", percentBangString, msg), nil, Caller(1)} - } - frame := Frame{} - if internal.EnableTrace { - frame = Caller(1) - } - return &wrapError{msg, err, frame} -} - -func errorAt(args []interface{}, i int) error { - if i < 0 || i >= len(args) { - return nil - } - err, ok := args[i].(error) - if !ok { - return nil - } - return err -} - -// formatPlusW is used to avoid the vet check that will barf at %w. -func formatPlusW(s string) string { - return s -} - -// Return the index of the only %w in format, or -1 if none. -// Also return a rewritten format string with %w replaced by %v, and -// false if there is more than one %w. -// TODO: handle "%[N]w". -func parsePercentW(format string) (idx int, newFormat string, ok bool) { - // Loosely copied from golang.org/x/tools/go/analysis/passes/printf/printf.go. - idx = -1 - ok = true - n := 0 - sz := 0 - var isW bool - for i := 0; i < len(format); i += sz { - if format[i] != '%' { - sz = 1 - continue - } - // "%%" is not a format directive. - if i+1 < len(format) && format[i+1] == '%' { - sz = 2 - continue - } - sz, isW = parsePrintfVerb(format[i:]) - if isW { - if idx >= 0 { - ok = false - } else { - idx = n - } - // "Replace" the last character, the 'w', with a 'v'. - p := i + sz - 1 - format = format[:p] + "v" + format[p+1:] - } - n++ - } - return idx, format, ok -} - -// Parse the printf verb starting with a % at s[0]. -// Return how many bytes it occupies and whether the verb is 'w'. -func parsePrintfVerb(s string) (int, bool) { - // Assume only that the directive is a sequence of non-letters followed by a single letter. - sz := 0 - var r rune - for i := 1; i < len(s); i += sz { - r, sz = utf8.DecodeRuneInString(s[i:]) - if unicode.IsLetter(r) { - return i + sz, r == 'w' - } - } - return len(s), false -} - -type noWrapError struct { - msg string - err error - frame Frame -} - -func (e *noWrapError) Error() string { - return fmt.Sprint(e) -} - -func (e *noWrapError) Format(s fmt.State, v rune) { FormatError(e, s, v) } - -func (e *noWrapError) FormatError(p Printer) (next error) { - p.Print(e.msg) - e.frame.Format(p) - return e.err -} - -type wrapError struct { - msg string - err error - frame Frame -} - -func (e *wrapError) Error() string { - return fmt.Sprint(e) -} - -func (e *wrapError) Format(s fmt.State, v rune) { FormatError(e, s, v) } - -func (e *wrapError) FormatError(p Printer) (next error) { - p.Print(e.msg) - e.frame.Format(p) - return e.err -} - -func (e *wrapError) Unwrap() error { - return e.err -} diff --git a/vendor/golang.org/x/xerrors/format.go b/vendor/golang.org/x/xerrors/format.go deleted file mode 100644 index 1bc9c26..0000000 --- a/vendor/golang.org/x/xerrors/format.go +++ /dev/null @@ -1,34 +0,0 @@ -// 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 xerrors - -// A Formatter formats error messages. -type Formatter interface { - error - - // FormatError prints the receiver's first error and returns the next error in - // the error chain, if any. - FormatError(p Printer) (next error) -} - -// A Printer formats error messages. -// -// The most common implementation of Printer is the one provided by package fmt -// during Printf (as of Go 1.13). Localization packages such as golang.org/x/text/message -// typically provide their own implementations. -type Printer interface { - // Print appends args to the message output. - Print(args ...interface{}) - - // Printf writes a formatted string. - Printf(format string, args ...interface{}) - - // Detail reports whether error detail is requested. - // After the first call to Detail, all text written to the Printer - // is formatted as additional detail, or ignored when - // detail has not been requested. - // If Detail returns false, the caller can avoid printing the detail at all. - Detail() bool -} diff --git a/vendor/golang.org/x/xerrors/frame.go b/vendor/golang.org/x/xerrors/frame.go deleted file mode 100644 index 0de628e..0000000 --- a/vendor/golang.org/x/xerrors/frame.go +++ /dev/null @@ -1,56 +0,0 @@ -// 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 xerrors - -import ( - "runtime" -) - -// A Frame contains part of a call stack. -type Frame struct { - // Make room for three PCs: the one we were asked for, what it called, - // and possibly a PC for skipPleaseUseCallersFrames. See: - // https://go.googlesource.com/go/+/032678e0fb/src/runtime/extern.go#169 - frames [3]uintptr -} - -// Caller returns a Frame that describes a frame on the caller's stack. -// The argument skip is the number of frames to skip over. -// Caller(0) returns the frame for the caller of Caller. -func Caller(skip int) Frame { - var s Frame - runtime.Callers(skip+1, s.frames[:]) - return s -} - -// location reports the file, line, and function of a frame. -// -// The returned function may be "" even if file and line are not. -func (f Frame) location() (function, file string, line int) { - frames := runtime.CallersFrames(f.frames[:]) - if _, ok := frames.Next(); !ok { - return "", "", 0 - } - fr, ok := frames.Next() - if !ok { - return "", "", 0 - } - return fr.Function, fr.File, fr.Line -} - -// Format prints the stack as error detail. -// It should be called from an error's Format implementation -// after printing any other error detail. -func (f Frame) Format(p Printer) { - if p.Detail() { - function, file, line := f.location() - if function != "" { - p.Printf("%s\n ", function) - } - if file != "" { - p.Printf("%s:%d\n", file, line) - } - } -} diff --git a/vendor/golang.org/x/xerrors/go.mod b/vendor/golang.org/x/xerrors/go.mod deleted file mode 100644 index 870d4f6..0000000 --- a/vendor/golang.org/x/xerrors/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module golang.org/x/xerrors - -go 1.11 diff --git a/vendor/golang.org/x/xerrors/internal/internal.go b/vendor/golang.org/x/xerrors/internal/internal.go deleted file mode 100644 index 89f4eca..0000000 --- a/vendor/golang.org/x/xerrors/internal/internal.go +++ /dev/null @@ -1,8 +0,0 @@ -// 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 internal - -// EnableTrace indicates whether stack information should be recorded in errors. -var EnableTrace = true diff --git a/vendor/golang.org/x/xerrors/wrap.go b/vendor/golang.org/x/xerrors/wrap.go deleted file mode 100644 index 9a3b510..0000000 --- a/vendor/golang.org/x/xerrors/wrap.go +++ /dev/null @@ -1,106 +0,0 @@ -// 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 xerrors - -import ( - "reflect" -) - -// A Wrapper provides context around another error. -type Wrapper interface { - // Unwrap returns the next error in the error chain. - // If there is no next error, Unwrap returns nil. - Unwrap() error -} - -// Opaque returns an error with the same error formatting as err -// but that does not match err and cannot be unwrapped. -func Opaque(err error) error { - return noWrapper{err} -} - -type noWrapper struct { - error -} - -func (e noWrapper) FormatError(p Printer) (next error) { - if f, ok := e.error.(Formatter); ok { - return f.FormatError(p) - } - p.Print(e.error) - return nil -} - -// Unwrap returns the result of calling the Unwrap method on err, if err implements -// Unwrap. Otherwise, Unwrap returns nil. -func Unwrap(err error) error { - u, ok := err.(Wrapper) - if !ok { - return nil - } - return u.Unwrap() -} - -// Is reports whether any error in err's chain matches target. -// -// An error is considered to match a target if it is equal to that target or if -// it implements a method Is(error) bool such that Is(target) returns true. -func Is(err, target error) bool { - if target == nil { - return err == target - } - - isComparable := reflect.TypeOf(target).Comparable() - for { - if isComparable && err == target { - return true - } - if x, ok := err.(interface{ Is(error) bool }); ok && x.Is(target) { - return true - } - // TODO: consider supporing target.Is(err). This would allow - // user-definable predicates, but also may allow for coping with sloppy - // APIs, thereby making it easier to get away with them. - if err = Unwrap(err); err == nil { - return false - } - } -} - -// As finds the first error in err's chain that matches the type to which target -// points, and if so, sets the target to its value and returns true. An error -// matches a type if it is assignable to the target type, or if it has a method -// As(interface{}) bool such that As(target) returns true. As will panic if target -// is not a non-nil pointer to a type which implements error or is of interface type. -// -// The As method should set the target to its value and return true if err -// matches the type to which target points. -func As(err error, target interface{}) bool { - if target == nil { - panic("errors: target cannot be nil") - } - val := reflect.ValueOf(target) - typ := val.Type() - if typ.Kind() != reflect.Ptr || val.IsNil() { - panic("errors: target must be a non-nil pointer") - } - if e := typ.Elem(); e.Kind() != reflect.Interface && !e.Implements(errorType) { - panic("errors: *target must be interface or implement error") - } - targetType := typ.Elem() - for err != nil { - if reflect.TypeOf(err).AssignableTo(targetType) { - val.Elem().Set(reflect.ValueOf(err)) - return true - } - if x, ok := err.(interface{ As(interface{}) bool }); ok && x.As(target) { - return true - } - err = Unwrap(err) - } - return false -} - -var errorType = reflect.TypeOf((*error)(nil)).Elem() diff --git a/vendor/gonum.org/v1/gonum/.travis/deps.d/linux/01-deps.sh b/vendor/gonum.org/v1/gonum/.travis/deps.d/linux/01-deps.sh deleted file mode 120000 index 920836a..0000000 --- a/vendor/gonum.org/v1/gonum/.travis/deps.d/linux/01-deps.sh +++ /dev/null @@ -1 +0,0 @@ -../../script.d/deps.sh \ No newline at end of file diff --git a/vendor/gonum.org/v1/gonum/.travis/deps.d/osx/nothing.sh b/vendor/gonum.org/v1/gonum/.travis/deps.d/osx/nothing.sh deleted file mode 120000 index 18b1728..0000000 --- a/vendor/gonum.org/v1/gonum/.travis/deps.d/osx/nothing.sh +++ /dev/null @@ -1 +0,0 @@ -../../script.d/nothing.sh \ No newline at end of file diff --git a/vendor/gonum.org/v1/gonum/.travis/deps.d/windows/nothing.sh b/vendor/gonum.org/v1/gonum/.travis/deps.d/windows/nothing.sh deleted file mode 120000 index 18b1728..0000000 --- a/vendor/gonum.org/v1/gonum/.travis/deps.d/windows/nothing.sh +++ /dev/null @@ -1 +0,0 @@ -../../script.d/nothing.sh \ No newline at end of file diff --git a/vendor/gonum.org/v1/gonum/.travis/run.d/linux/01-check-copyright.sh b/vendor/gonum.org/v1/gonum/.travis/run.d/linux/01-check-copyright.sh deleted file mode 120000 index 31835de..0000000 --- a/vendor/gonum.org/v1/gonum/.travis/run.d/linux/01-check-copyright.sh +++ /dev/null @@ -1 +0,0 @@ -../../script.d/check-copyright.sh \ No newline at end of file diff --git a/vendor/gonum.org/v1/gonum/.travis/run.d/linux/02-check-imports.sh b/vendor/gonum.org/v1/gonum/.travis/run.d/linux/02-check-imports.sh deleted file mode 120000 index 2eb0ad5..0000000 --- a/vendor/gonum.org/v1/gonum/.travis/run.d/linux/02-check-imports.sh +++ /dev/null @@ -1 +0,0 @@ -../../script.d/check-imports.sh \ No newline at end of file diff --git a/vendor/gonum.org/v1/gonum/.travis/run.d/linux/03-check-formatting.sh b/vendor/gonum.org/v1/gonum/.travis/run.d/linux/03-check-formatting.sh deleted file mode 120000 index e82d24d..0000000 --- a/vendor/gonum.org/v1/gonum/.travis/run.d/linux/03-check-formatting.sh +++ /dev/null @@ -1 +0,0 @@ -../../script.d/check-formatting.sh \ No newline at end of file diff --git a/vendor/gonum.org/v1/gonum/.travis/run.d/linux/04-test.sh b/vendor/gonum.org/v1/gonum/.travis/run.d/linux/04-test.sh deleted file mode 120000 index b86e940..0000000 --- a/vendor/gonum.org/v1/gonum/.travis/run.d/linux/04-test.sh +++ /dev/null @@ -1 +0,0 @@ -../../script.d/test.sh \ No newline at end of file diff --git a/vendor/gonum.org/v1/gonum/.travis/run.d/linux/05-test-coverage.sh b/vendor/gonum.org/v1/gonum/.travis/run.d/linux/05-test-coverage.sh deleted file mode 120000 index 3557f72..0000000 --- a/vendor/gonum.org/v1/gonum/.travis/run.d/linux/05-test-coverage.sh +++ /dev/null @@ -1 +0,0 @@ -../../script.d/test-coverage.sh \ No newline at end of file diff --git a/vendor/gonum.org/v1/gonum/.travis/run.d/linux/06-check-generate.sh b/vendor/gonum.org/v1/gonum/.travis/run.d/linux/06-check-generate.sh deleted file mode 120000 index 3131460..0000000 --- a/vendor/gonum.org/v1/gonum/.travis/run.d/linux/06-check-generate.sh +++ /dev/null @@ -1 +0,0 @@ -../../script.d/check-generate.sh \ No newline at end of file diff --git a/vendor/gonum.org/v1/gonum/.travis/run.d/osx/01-test.sh b/vendor/gonum.org/v1/gonum/.travis/run.d/osx/01-test.sh deleted file mode 120000 index b86e940..0000000 --- a/vendor/gonum.org/v1/gonum/.travis/run.d/osx/01-test.sh +++ /dev/null @@ -1 +0,0 @@ -../../script.d/test.sh \ No newline at end of file diff --git a/vendor/gonum.org/v1/gonum/AUTHORS b/vendor/gonum.org/v1/gonum/AUTHORS deleted file mode 100644 index 08848ec..0000000 --- a/vendor/gonum.org/v1/gonum/AUTHORS +++ /dev/null @@ -1,98 +0,0 @@ -# This is the official list of Gonum authors for copyright purposes. -# This file is distinct from the CONTRIBUTORS files. -# See the latter for an explanation. - -# Names should be added to this file as -# Name or Organization -# The email address is not required for organizations. - -# Please keep the list sorted. - -Alexander Egurnov -Andrei Blinnikov -Bill Gray -Bill Noon -Brendan Tracey -Brent Pedersen -Chad Kunde -Chih-Wei Chang -Chris Tessum -Christophe Meessen -Clayton Northey -Dan Kortschak -Daniel Fireman -Dario Heinisch -David Kleiven -David Samborski -Davor Kapsa -DeepMind Technologies -Delaney Gillilan -Dezmond Goff -Dong-hee Na -Egon Elbre -Ekaterina Efimova -Ethan Burns -Evert Lammerts -Facundo Gaich -Fazlul Shahriar -Francesc Campoy -Google Inc -Gustaf Johansson -Iakov Davydov -Igor Mikushkin -Iskander Sharipov -Jalem Raj Rohit -James Bell -James Bowman -James Holmes <32bitkid@gmail.com> -Janne Snabb -Jeremy Atkinson -Jonas Kahler -Jonas Schulze -Jonathan J Lawlor -Jonathan Reiter -Jonathan Schroeder -Joseph Watson -Josh Wilson -Julien Roland -Kai Trukenmüller -Kent English -Kevin C. Zimmerman -Kirill Motkov -Konstantin Shaposhnikov -Leonid Kneller -Lyron Winderbaum -Martin Diz -Matthieu Di Mercurio -Max Halford -MinJae Kwon -Nathan Edwards -Nick Potts -Nils Wogatzky -Olivier Wulveryck -Or Rikon -Pontus Melke -Renée French -Rishi Desai -Robin Eklind -Sam Zaydel -Samuel Kelemen -Saran Ahluwalia -Scott Holden -Sebastien Binet -Shawn Smith -source{d} -Spencer Lyon -Steve McCoy -Taesu Pyo -Takeshi Yoneda -The University of Adelaide -The University of Minnesota -The University of Washington -Thomas Berg -Tobin Harding -Vincent Thiery -Vladimír Chalupecký -Yevgeniy Vahlis -Yucheng Zhu -Zoe Juozapaitis diff --git a/vendor/gonum.org/v1/gonum/CONTRIBUTORS b/vendor/gonum.org/v1/gonum/CONTRIBUTORS deleted file mode 100644 index 3726244..0000000 --- a/vendor/gonum.org/v1/gonum/CONTRIBUTORS +++ /dev/null @@ -1,100 +0,0 @@ -# This is the official list of people who can contribute -# (and typically have contributed) code to the Gonum -# project. -# -# The AUTHORS file lists the copyright holders; this file -# lists people. For example, Google employees would be listed here -# but not in AUTHORS, because Google would hold the copyright. -# -# When adding J Random Contributor's name to this file, -# either J's name or J's organization's name should be -# added to the AUTHORS file. -# -# Names should be added to this file like so: -# Name -# -# Please keep the list sorted. - -Alexander Egurnov -Andrei Blinnikov -Andrew Brampton -Bill Gray -Bill Noon -Brendan Tracey -Brent Pedersen -Chad Kunde -Chih-Wei Chang -Chris Tessum -Christophe Meessen -Clayton Northey -Dan Kortschak -Daniel Fireman -Dario Heinisch -David Kleiven -David Samborski -Davor Kapsa -Delaney Gillilan -Dezmond Goff -Dong-hee Na -Egon Elbre -Ekaterina Efimova -Ethan Burns -Evert Lammerts -Facundo Gaich -Fazlul Shahriar -Francesc Campoy -Gustaf Johansson -Iakov Davydov -Igor Mikushkin -Iskander Sharipov -Jalem Raj Rohit -James Bell -James Bowman -James Holmes <32bitkid@gmail.com> -Janne Snabb -Jeremy Atkinson -Jonas Kahler -Jonas Schulze -Jonathan J Lawlor -Jonathan Reiter -Jonathan Schroeder -Joseph Watson -Josh Wilson -Julien Roland -Kai Trukenmüller -Kent English -Kevin C. Zimmerman -Kirill Motkov -Konstantin Shaposhnikov -Leonid Kneller -Lyron Winderbaum -Martin Diz -Matthieu Di Mercurio -Max Halford -MinJae Kwon -Nathan Edwards -Nick Potts -Nils Wogatzky -Olivier Wulveryck -Or Rikon -Pontus Melke -Renée French -Rishi Desai -Robin Eklind -Sam Zaydel -Samuel Kelemen -Saran Ahluwalia -Scott Holden -Sebastien Binet -Shawn Smith -Spencer Lyon -Steve McCoy -Taesu Pyo -Takeshi Yoneda -Thomas Berg -Tobin Harding -Vincent Thiery -Vladimír Chalupecký -Yevgeniy Vahlis -Yucheng Zhu -Zoe Juozapaitis diff --git a/vendor/gonum.org/v1/gonum/LICENSE b/vendor/gonum.org/v1/gonum/LICENSE deleted file mode 100644 index ed477e5..0000000 --- a/vendor/gonum.org/v1/gonum/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright ©2013 The Gonum Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Gonum project nor the names of its authors and - 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. \ No newline at end of file diff --git a/vendor/gonum.org/v1/gonum/blas/README.md b/vendor/gonum.org/v1/gonum/blas/README.md deleted file mode 100644 index e9d33ee..0000000 --- a/vendor/gonum.org/v1/gonum/blas/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# Gonum BLAS [![GoDoc](https://godoc.org/gonum.org/v1/gonum/blas?status.svg)](https://godoc.org/gonum.org/v1/gonum/blas) - -A collection of packages to provide BLAS functionality for the [Go programming -language](http://golang.org) - -## Installation -```sh - go get gonum.org/v1/gonum/blas/... -``` - -## Packages - -### blas - -Defines [BLAS API](http://www.netlib.org/blas/blast-forum/cinterface.pdf) split in several -interfaces. - -### blas/gonum - -Go implementation of the BLAS API (incomplete, implements the `float32` and `float64` API). - -### blas/blas64 and blas/blas32 - -Wrappers for an implementation of the double (i.e., `float64`) and single (`float32`) -precision real parts of the BLAS API. - -```Go -package main - -import ( - "fmt" - - "gonum.org/v1/gonum/blas/blas64" -) - -func main() { - v := blas64.Vector{Inc: 1, Data: []float64{1, 1, 1}} - fmt.Println("v has length:", blas64.Nrm2(len(v.Data), v)) -} -``` - -### blas/cblas128 and blas/cblas64 - -Wrappers for an implementation of the double (i.e., `complex128`) and single (`complex64`) -precision complex parts of the blas API. - -Currently blas/cblas64 and blas/cblas128 require gonum.org/v1/netlib/blas. diff --git a/vendor/gonum.org/v1/gonum/blas/blas.go b/vendor/gonum.org/v1/gonum/blas/blas.go deleted file mode 100644 index 9b933e3..0000000 --- a/vendor/gonum.org/v1/gonum/blas/blas.go +++ /dev/null @@ -1,283 +0,0 @@ -// Copyright ©2013 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:generate ./conversions.bash - -package blas - -// Flag constants indicate Givens transformation H matrix state. -type Flag int - -const ( - Identity Flag = -2 // H is the identity matrix; no rotation is needed. - Rescaling Flag = -1 // H specifies rescaling. - OffDiagonal Flag = 0 // Off-diagonal elements of H are non-unit. - Diagonal Flag = 1 // Diagonal elements of H are non-unit. -) - -// SrotmParams contains Givens transformation parameters returned -// by the Float32 Srotm method. -type SrotmParams struct { - Flag - H [4]float32 // Column-major 2 by 2 matrix. -} - -// DrotmParams contains Givens transformation parameters returned -// by the Float64 Drotm method. -type DrotmParams struct { - Flag - H [4]float64 // Column-major 2 by 2 matrix. -} - -// Transpose specifies the transposition operation of a matrix. -type Transpose byte - -const ( - NoTrans Transpose = 'N' - Trans Transpose = 'T' - ConjTrans Transpose = 'C' -) - -// Uplo specifies whether a matrix is upper or lower triangular. -type Uplo byte - -const ( - Upper Uplo = 'U' - Lower Uplo = 'L' - All Uplo = 'A' -) - -// Diag specifies whether a matrix is unit triangular. -type Diag byte - -const ( - NonUnit Diag = 'N' - Unit Diag = 'U' -) - -// Side specifies from which side a multiplication operation is performed. -type Side byte - -const ( - Left Side = 'L' - Right Side = 'R' -) - -// Float32 implements the single precision real BLAS routines. -type Float32 interface { - Float32Level1 - Float32Level2 - Float32Level3 -} - -// Float32Level1 implements the single precision real BLAS Level 1 routines. -type Float32Level1 interface { - Sdsdot(n int, alpha float32, x []float32, incX int, y []float32, incY int) float32 - Dsdot(n int, x []float32, incX int, y []float32, incY int) float64 - Sdot(n int, x []float32, incX int, y []float32, incY int) float32 - Snrm2(n int, x []float32, incX int) float32 - Sasum(n int, x []float32, incX int) float32 - Isamax(n int, x []float32, incX int) int - Sswap(n int, x []float32, incX int, y []float32, incY int) - Scopy(n int, x []float32, incX int, y []float32, incY int) - Saxpy(n int, alpha float32, x []float32, incX int, y []float32, incY int) - Srotg(a, b float32) (c, s, r, z float32) - Srotmg(d1, d2, b1, b2 float32) (p SrotmParams, rd1, rd2, rb1 float32) - Srot(n int, x []float32, incX int, y []float32, incY int, c, s float32) - Srotm(n int, x []float32, incX int, y []float32, incY int, p SrotmParams) - Sscal(n int, alpha float32, x []float32, incX int) -} - -// Float32Level2 implements the single precision real BLAS Level 2 routines. -type Float32Level2 interface { - Sgemv(tA Transpose, m, n int, alpha float32, a []float32, lda int, x []float32, incX int, beta float32, y []float32, incY int) - Sgbmv(tA Transpose, m, n, kL, kU int, alpha float32, a []float32, lda int, x []float32, incX int, beta float32, y []float32, incY int) - Strmv(ul Uplo, tA Transpose, d Diag, n int, a []float32, lda int, x []float32, incX int) - Stbmv(ul Uplo, tA Transpose, d Diag, n, k int, a []float32, lda int, x []float32, incX int) - Stpmv(ul Uplo, tA Transpose, d Diag, n int, ap []float32, x []float32, incX int) - Strsv(ul Uplo, tA Transpose, d Diag, n int, a []float32, lda int, x []float32, incX int) - Stbsv(ul Uplo, tA Transpose, d Diag, n, k int, a []float32, lda int, x []float32, incX int) - Stpsv(ul Uplo, tA Transpose, d Diag, n int, ap []float32, x []float32, incX int) - Ssymv(ul Uplo, n int, alpha float32, a []float32, lda int, x []float32, incX int, beta float32, y []float32, incY int) - Ssbmv(ul Uplo, n, k int, alpha float32, a []float32, lda int, x []float32, incX int, beta float32, y []float32, incY int) - Sspmv(ul Uplo, n int, alpha float32, ap []float32, x []float32, incX int, beta float32, y []float32, incY int) - Sger(m, n int, alpha float32, x []float32, incX int, y []float32, incY int, a []float32, lda int) - Ssyr(ul Uplo, n int, alpha float32, x []float32, incX int, a []float32, lda int) - Sspr(ul Uplo, n int, alpha float32, x []float32, incX int, ap []float32) - Ssyr2(ul Uplo, n int, alpha float32, x []float32, incX int, y []float32, incY int, a []float32, lda int) - Sspr2(ul Uplo, n int, alpha float32, x []float32, incX int, y []float32, incY int, a []float32) -} - -// Float32Level3 implements the single precision real BLAS Level 3 routines. -type Float32Level3 interface { - Sgemm(tA, tB Transpose, m, n, k int, alpha float32, a []float32, lda int, b []float32, ldb int, beta float32, c []float32, ldc int) - Ssymm(s Side, ul Uplo, m, n int, alpha float32, a []float32, lda int, b []float32, ldb int, beta float32, c []float32, ldc int) - Ssyrk(ul Uplo, t Transpose, n, k int, alpha float32, a []float32, lda int, beta float32, c []float32, ldc int) - Ssyr2k(ul Uplo, t Transpose, n, k int, alpha float32, a []float32, lda int, b []float32, ldb int, beta float32, c []float32, ldc int) - Strmm(s Side, ul Uplo, tA Transpose, d Diag, m, n int, alpha float32, a []float32, lda int, b []float32, ldb int) - Strsm(s Side, ul Uplo, tA Transpose, d Diag, m, n int, alpha float32, a []float32, lda int, b []float32, ldb int) -} - -// Float64 implements the single precision real BLAS routines. -type Float64 interface { - Float64Level1 - Float64Level2 - Float64Level3 -} - -// Float64Level1 implements the double precision real BLAS Level 1 routines. -type Float64Level1 interface { - Ddot(n int, x []float64, incX int, y []float64, incY int) float64 - Dnrm2(n int, x []float64, incX int) float64 - Dasum(n int, x []float64, incX int) float64 - Idamax(n int, x []float64, incX int) int - Dswap(n int, x []float64, incX int, y []float64, incY int) - Dcopy(n int, x []float64, incX int, y []float64, incY int) - Daxpy(n int, alpha float64, x []float64, incX int, y []float64, incY int) - Drotg(a, b float64) (c, s, r, z float64) - Drotmg(d1, d2, b1, b2 float64) (p DrotmParams, rd1, rd2, rb1 float64) - Drot(n int, x []float64, incX int, y []float64, incY int, c float64, s float64) - Drotm(n int, x []float64, incX int, y []float64, incY int, p DrotmParams) - Dscal(n int, alpha float64, x []float64, incX int) -} - -// Float64Level2 implements the double precision real BLAS Level 2 routines. -type Float64Level2 interface { - Dgemv(tA Transpose, m, n int, alpha float64, a []float64, lda int, x []float64, incX int, beta float64, y []float64, incY int) - Dgbmv(tA Transpose, m, n, kL, kU int, alpha float64, a []float64, lda int, x []float64, incX int, beta float64, y []float64, incY int) - Dtrmv(ul Uplo, tA Transpose, d Diag, n int, a []float64, lda int, x []float64, incX int) - Dtbmv(ul Uplo, tA Transpose, d Diag, n, k int, a []float64, lda int, x []float64, incX int) - Dtpmv(ul Uplo, tA Transpose, d Diag, n int, ap []float64, x []float64, incX int) - Dtrsv(ul Uplo, tA Transpose, d Diag, n int, a []float64, lda int, x []float64, incX int) - Dtbsv(ul Uplo, tA Transpose, d Diag, n, k int, a []float64, lda int, x []float64, incX int) - Dtpsv(ul Uplo, tA Transpose, d Diag, n int, ap []float64, x []float64, incX int) - Dsymv(ul Uplo, n int, alpha float64, a []float64, lda int, x []float64, incX int, beta float64, y []float64, incY int) - Dsbmv(ul Uplo, n, k int, alpha float64, a []float64, lda int, x []float64, incX int, beta float64, y []float64, incY int) - Dspmv(ul Uplo, n int, alpha float64, ap []float64, x []float64, incX int, beta float64, y []float64, incY int) - Dger(m, n int, alpha float64, x []float64, incX int, y []float64, incY int, a []float64, lda int) - Dsyr(ul Uplo, n int, alpha float64, x []float64, incX int, a []float64, lda int) - Dspr(ul Uplo, n int, alpha float64, x []float64, incX int, ap []float64) - Dsyr2(ul Uplo, n int, alpha float64, x []float64, incX int, y []float64, incY int, a []float64, lda int) - Dspr2(ul Uplo, n int, alpha float64, x []float64, incX int, y []float64, incY int, a []float64) -} - -// Float64Level3 implements the double precision real BLAS Level 3 routines. -type Float64Level3 interface { - Dgemm(tA, tB Transpose, m, n, k int, alpha float64, a []float64, lda int, b []float64, ldb int, beta float64, c []float64, ldc int) - Dsymm(s Side, ul Uplo, m, n int, alpha float64, a []float64, lda int, b []float64, ldb int, beta float64, c []float64, ldc int) - Dsyrk(ul Uplo, t Transpose, n, k int, alpha float64, a []float64, lda int, beta float64, c []float64, ldc int) - Dsyr2k(ul Uplo, t Transpose, n, k int, alpha float64, a []float64, lda int, b []float64, ldb int, beta float64, c []float64, ldc int) - Dtrmm(s Side, ul Uplo, tA Transpose, d Diag, m, n int, alpha float64, a []float64, lda int, b []float64, ldb int) - Dtrsm(s Side, ul Uplo, tA Transpose, d Diag, m, n int, alpha float64, a []float64, lda int, b []float64, ldb int) -} - -// Complex64 implements the single precision complex BLAS routines. -type Complex64 interface { - Complex64Level1 - Complex64Level2 - Complex64Level3 -} - -// Complex64Level1 implements the single precision complex BLAS Level 1 routines. -type Complex64Level1 interface { - Cdotu(n int, x []complex64, incX int, y []complex64, incY int) (dotu complex64) - Cdotc(n int, x []complex64, incX int, y []complex64, incY int) (dotc complex64) - Scnrm2(n int, x []complex64, incX int) float32 - Scasum(n int, x []complex64, incX int) float32 - Icamax(n int, x []complex64, incX int) int - Cswap(n int, x []complex64, incX int, y []complex64, incY int) - Ccopy(n int, x []complex64, incX int, y []complex64, incY int) - Caxpy(n int, alpha complex64, x []complex64, incX int, y []complex64, incY int) - Cscal(n int, alpha complex64, x []complex64, incX int) - Csscal(n int, alpha float32, x []complex64, incX int) -} - -// Complex64Level2 implements the single precision complex BLAS routines Level 2 routines. -type Complex64Level2 interface { - Cgemv(tA Transpose, m, n int, alpha complex64, a []complex64, lda int, x []complex64, incX int, beta complex64, y []complex64, incY int) - Cgbmv(tA Transpose, m, n, kL, kU int, alpha complex64, a []complex64, lda int, x []complex64, incX int, beta complex64, y []complex64, incY int) - Ctrmv(ul Uplo, tA Transpose, d Diag, n int, a []complex64, lda int, x []complex64, incX int) - Ctbmv(ul Uplo, tA Transpose, d Diag, n, k int, a []complex64, lda int, x []complex64, incX int) - Ctpmv(ul Uplo, tA Transpose, d Diag, n int, ap []complex64, x []complex64, incX int) - Ctrsv(ul Uplo, tA Transpose, d Diag, n int, a []complex64, lda int, x []complex64, incX int) - Ctbsv(ul Uplo, tA Transpose, d Diag, n, k int, a []complex64, lda int, x []complex64, incX int) - Ctpsv(ul Uplo, tA Transpose, d Diag, n int, ap []complex64, x []complex64, incX int) - Chemv(ul Uplo, n int, alpha complex64, a []complex64, lda int, x []complex64, incX int, beta complex64, y []complex64, incY int) - Chbmv(ul Uplo, n, k int, alpha complex64, a []complex64, lda int, x []complex64, incX int, beta complex64, y []complex64, incY int) - Chpmv(ul Uplo, n int, alpha complex64, ap []complex64, x []complex64, incX int, beta complex64, y []complex64, incY int) - Cgeru(m, n int, alpha complex64, x []complex64, incX int, y []complex64, incY int, a []complex64, lda int) - Cgerc(m, n int, alpha complex64, x []complex64, incX int, y []complex64, incY int, a []complex64, lda int) - Cher(ul Uplo, n int, alpha float32, x []complex64, incX int, a []complex64, lda int) - Chpr(ul Uplo, n int, alpha float32, x []complex64, incX int, a []complex64) - Cher2(ul Uplo, n int, alpha complex64, x []complex64, incX int, y []complex64, incY int, a []complex64, lda int) - Chpr2(ul Uplo, n int, alpha complex64, x []complex64, incX int, y []complex64, incY int, ap []complex64) -} - -// Complex64Level3 implements the single precision complex BLAS Level 3 routines. -type Complex64Level3 interface { - Cgemm(tA, tB Transpose, m, n, k int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta complex64, c []complex64, ldc int) - Csymm(s Side, ul Uplo, m, n int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta complex64, c []complex64, ldc int) - Csyrk(ul Uplo, t Transpose, n, k int, alpha complex64, a []complex64, lda int, beta complex64, c []complex64, ldc int) - Csyr2k(ul Uplo, t Transpose, n, k int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta complex64, c []complex64, ldc int) - Ctrmm(s Side, ul Uplo, tA Transpose, d Diag, m, n int, alpha complex64, a []complex64, lda int, b []complex64, ldb int) - Ctrsm(s Side, ul Uplo, tA Transpose, d Diag, m, n int, alpha complex64, a []complex64, lda int, b []complex64, ldb int) - Chemm(s Side, ul Uplo, m, n int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta complex64, c []complex64, ldc int) - Cherk(ul Uplo, t Transpose, n, k int, alpha float32, a []complex64, lda int, beta float32, c []complex64, ldc int) - Cher2k(ul Uplo, t Transpose, n, k int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta float32, c []complex64, ldc int) -} - -// Complex128 implements the double precision complex BLAS routines. -type Complex128 interface { - Complex128Level1 - Complex128Level2 - Complex128Level3 -} - -// Complex128Level1 implements the double precision complex BLAS Level 1 routines. -type Complex128Level1 interface { - Zdotu(n int, x []complex128, incX int, y []complex128, incY int) (dotu complex128) - Zdotc(n int, x []complex128, incX int, y []complex128, incY int) (dotc complex128) - Dznrm2(n int, x []complex128, incX int) float64 - Dzasum(n int, x []complex128, incX int) float64 - Izamax(n int, x []complex128, incX int) int - Zswap(n int, x []complex128, incX int, y []complex128, incY int) - Zcopy(n int, x []complex128, incX int, y []complex128, incY int) - Zaxpy(n int, alpha complex128, x []complex128, incX int, y []complex128, incY int) - Zscal(n int, alpha complex128, x []complex128, incX int) - Zdscal(n int, alpha float64, x []complex128, incX int) -} - -// Complex128Level2 implements the double precision complex BLAS Level 2 routines. -type Complex128Level2 interface { - Zgemv(tA Transpose, m, n int, alpha complex128, a []complex128, lda int, x []complex128, incX int, beta complex128, y []complex128, incY int) - Zgbmv(tA Transpose, m, n int, kL int, kU int, alpha complex128, a []complex128, lda int, x []complex128, incX int, beta complex128, y []complex128, incY int) - Ztrmv(ul Uplo, tA Transpose, d Diag, n int, a []complex128, lda int, x []complex128, incX int) - Ztbmv(ul Uplo, tA Transpose, d Diag, n, k int, a []complex128, lda int, x []complex128, incX int) - Ztpmv(ul Uplo, tA Transpose, d Diag, n int, ap []complex128, x []complex128, incX int) - Ztrsv(ul Uplo, tA Transpose, d Diag, n int, a []complex128, lda int, x []complex128, incX int) - Ztbsv(ul Uplo, tA Transpose, d Diag, n, k int, a []complex128, lda int, x []complex128, incX int) - Ztpsv(ul Uplo, tA Transpose, d Diag, n int, ap []complex128, x []complex128, incX int) - Zhemv(ul Uplo, n int, alpha complex128, a []complex128, lda int, x []complex128, incX int, beta complex128, y []complex128, incY int) - Zhbmv(ul Uplo, n, k int, alpha complex128, a []complex128, lda int, x []complex128, incX int, beta complex128, y []complex128, incY int) - Zhpmv(ul Uplo, n int, alpha complex128, ap []complex128, x []complex128, incX int, beta complex128, y []complex128, incY int) - Zgeru(m, n int, alpha complex128, x []complex128, incX int, y []complex128, incY int, a []complex128, lda int) - Zgerc(m, n int, alpha complex128, x []complex128, incX int, y []complex128, incY int, a []complex128, lda int) - Zher(ul Uplo, n int, alpha float64, x []complex128, incX int, a []complex128, lda int) - Zhpr(ul Uplo, n int, alpha float64, x []complex128, incX int, a []complex128) - Zher2(ul Uplo, n int, alpha complex128, x []complex128, incX int, y []complex128, incY int, a []complex128, lda int) - Zhpr2(ul Uplo, n int, alpha complex128, x []complex128, incX int, y []complex128, incY int, ap []complex128) -} - -// Complex128Level3 implements the double precision complex BLAS Level 3 routines. -type Complex128Level3 interface { - Zgemm(tA, tB Transpose, m, n, k int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) - Zsymm(s Side, ul Uplo, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) - Zsyrk(ul Uplo, t Transpose, n, k int, alpha complex128, a []complex128, lda int, beta complex128, c []complex128, ldc int) - Zsyr2k(ul Uplo, t Transpose, n, k int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) - Ztrmm(s Side, ul Uplo, tA Transpose, d Diag, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int) - Ztrsm(s Side, ul Uplo, tA Transpose, d Diag, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int) - Zhemm(s Side, ul Uplo, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) - Zherk(ul Uplo, t Transpose, n, k int, alpha float64, a []complex128, lda int, beta float64, c []complex128, ldc int) - Zher2k(ul Uplo, t Transpose, n, k int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta float64, c []complex128, ldc int) -} diff --git a/vendor/gonum.org/v1/gonum/blas/blas64/blas64.go b/vendor/gonum.org/v1/gonum/blas/blas64/blas64.go deleted file mode 100644 index 5871321..0000000 --- a/vendor/gonum.org/v1/gonum/blas/blas64/blas64.go +++ /dev/null @@ -1,472 +0,0 @@ -// Copyright ©2015 The Gonum 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 blas64 - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/gonum" -) - -var blas64 blas.Float64 = gonum.Implementation{} - -// Use sets the BLAS float64 implementation to be used by subsequent BLAS calls. -// The default implementation is -// gonum.org/v1/gonum/blas/gonum.Implementation. -func Use(b blas.Float64) { - blas64 = b -} - -// Implementation returns the current BLAS float64 implementation. -// -// Implementation allows direct calls to the current the BLAS float64 implementation -// giving finer control of parameters. -func Implementation() blas.Float64 { - return blas64 -} - -// Vector represents a vector with an associated element increment. -type Vector struct { - N int - Data []float64 - Inc int -} - -// General represents a matrix using the conventional storage scheme. -type General struct { - Rows, Cols int - Data []float64 - Stride int -} - -// Band represents a band matrix using the band storage scheme. -type Band struct { - Rows, Cols int - KL, KU int - Data []float64 - Stride int -} - -// Triangular represents a triangular matrix using the conventional storage scheme. -type Triangular struct { - Uplo blas.Uplo - Diag blas.Diag - N int - Data []float64 - Stride int -} - -// TriangularBand represents a triangular matrix using the band storage scheme. -type TriangularBand struct { - Uplo blas.Uplo - Diag blas.Diag - N, K int - Data []float64 - Stride int -} - -// TriangularPacked represents a triangular matrix using the packed storage scheme. -type TriangularPacked struct { - Uplo blas.Uplo - Diag blas.Diag - N int - Data []float64 -} - -// Symmetric represents a symmetric matrix using the conventional storage scheme. -type Symmetric struct { - Uplo blas.Uplo - N int - Data []float64 - Stride int -} - -// SymmetricBand represents a symmetric matrix using the band storage scheme. -type SymmetricBand struct { - Uplo blas.Uplo - N, K int - Data []float64 - Stride int -} - -// SymmetricPacked represents a symmetric matrix using the packed storage scheme. -type SymmetricPacked struct { - Uplo blas.Uplo - N int - Data []float64 -} - -// Level 1 - -const ( - negInc = "blas64: negative vector increment" - badLength = "blas64: vector length mismatch" -) - -// Dot computes the dot product of the two vectors: -// \sum_i x[i]*y[i]. -// Dot will panic if the lengths of x and y do not match. -func Dot(x, y Vector) float64 { - if x.N != y.N { - panic(badLength) - } - return blas64.Ddot(x.N, x.Data, x.Inc, y.Data, y.Inc) -} - -// Nrm2 computes the Euclidean norm of the vector x: -// sqrt(\sum_i x[i]*x[i]). -// -// Nrm2 will panic if the vector increment is negative. -func Nrm2(x Vector) float64 { - if x.Inc < 0 { - panic(negInc) - } - return blas64.Dnrm2(x.N, x.Data, x.Inc) -} - -// Asum computes the sum of the absolute values of the elements of x: -// \sum_i |x[i]|. -// -// Asum will panic if the vector increment is negative. -func Asum(x Vector) float64 { - if x.Inc < 0 { - panic(negInc) - } - return blas64.Dasum(x.N, x.Data, x.Inc) -} - -// Iamax returns the index of an element of x with the largest absolute value. -// If there are multiple such indices the earliest is returned. -// Iamax returns -1 if n == 0. -// -// Iamax will panic if the vector increment is negative. -func Iamax(x Vector) int { - if x.Inc < 0 { - panic(negInc) - } - return blas64.Idamax(x.N, x.Data, x.Inc) -} - -// Swap exchanges the elements of the two vectors: -// x[i], y[i] = y[i], x[i] for all i. -// Swap will panic if the lengths of x and y do not match. -func Swap(x, y Vector) { - if x.N != y.N { - panic(badLength) - } - blas64.Dswap(x.N, x.Data, x.Inc, y.Data, y.Inc) -} - -// Copy copies the elements of x into the elements of y: -// y[i] = x[i] for all i. -// Copy will panic if the lengths of x and y do not match. -func Copy(x, y Vector) { - if x.N != y.N { - panic(badLength) - } - blas64.Dcopy(x.N, x.Data, x.Inc, y.Data, y.Inc) -} - -// Axpy adds x scaled by alpha to y: -// y[i] += alpha*x[i] for all i. -// Axpy will panic if the lengths of x and y do not match. -func Axpy(alpha float64, x, y Vector) { - if x.N != y.N { - panic(badLength) - } - blas64.Daxpy(x.N, alpha, x.Data, x.Inc, y.Data, y.Inc) -} - -// Rotg computes the parameters of a Givens plane rotation so that -// ⎡ c s⎤ ⎡a⎤ ⎡r⎤ -// ⎣-s c⎦ * ⎣b⎦ = ⎣0⎦ -// where a and b are the Cartesian coordinates of a given point. -// c, s, and r are defined as -// r = ±Sqrt(a^2 + b^2), -// c = a/r, the cosine of the rotation angle, -// s = a/r, the sine of the rotation angle, -// and z is defined such that -// if |a| > |b|, z = s, -// otherwise if c != 0, z = 1/c, -// otherwise z = 1. -func Rotg(a, b float64) (c, s, r, z float64) { - return blas64.Drotg(a, b) -} - -// Rotmg computes the modified Givens rotation. See -// http://www.netlib.org/lapack/explore-html/df/deb/drotmg_8f.html -// for more details. -func Rotmg(d1, d2, b1, b2 float64) (p blas.DrotmParams, rd1, rd2, rb1 float64) { - return blas64.Drotmg(d1, d2, b1, b2) -} - -// Rot applies a plane transformation to n points represented by the vectors x -// and y: -// x[i] = c*x[i] + s*y[i], -// y[i] = -s*x[i] + c*y[i], for all i. -func Rot(x, y Vector, c, s float64) { - if x.N != y.N { - panic(badLength) - } - blas64.Drot(x.N, x.Data, x.Inc, y.Data, y.Inc, c, s) -} - -// Rotm applies the modified Givens rotation to n points represented by the -// vectors x and y. -func Rotm(x, y Vector, p blas.DrotmParams) { - if x.N != y.N { - panic(badLength) - } - blas64.Drotm(x.N, x.Data, x.Inc, y.Data, y.Inc, p) -} - -// Scal scales the vector x by alpha: -// x[i] *= alpha for all i. -// -// Scal will panic if the vector increment is negative. -func Scal(alpha float64, x Vector) { - if x.Inc < 0 { - panic(negInc) - } - blas64.Dscal(x.N, alpha, x.Data, x.Inc) -} - -// Level 2 - -// Gemv computes -// y = alpha * A * x + beta * y if t == blas.NoTrans, -// y = alpha * Aᵀ * x + beta * y if t == blas.Trans or blas.ConjTrans, -// where A is an m×n dense matrix, x and y are vectors, and alpha and beta are scalars. -func Gemv(t blas.Transpose, alpha float64, a General, x Vector, beta float64, y Vector) { - blas64.Dgemv(t, a.Rows, a.Cols, alpha, a.Data, a.Stride, x.Data, x.Inc, beta, y.Data, y.Inc) -} - -// Gbmv computes -// y = alpha * A * x + beta * y if t == blas.NoTrans, -// y = alpha * Aᵀ * x + beta * y if t == blas.Trans or blas.ConjTrans, -// where A is an m×n band matrix, x and y are vectors, and alpha and beta are scalars. -func Gbmv(t blas.Transpose, alpha float64, a Band, x Vector, beta float64, y Vector) { - blas64.Dgbmv(t, a.Rows, a.Cols, a.KL, a.KU, alpha, a.Data, a.Stride, x.Data, x.Inc, beta, y.Data, y.Inc) -} - -// Trmv computes -// x = A * x if t == blas.NoTrans, -// x = Aᵀ * x if t == blas.Trans or blas.ConjTrans, -// where A is an n×n triangular matrix, and x is a vector. -func Trmv(t blas.Transpose, a Triangular, x Vector) { - blas64.Dtrmv(a.Uplo, t, a.Diag, a.N, a.Data, a.Stride, x.Data, x.Inc) -} - -// Tbmv computes -// x = A * x if t == blas.NoTrans, -// x = Aᵀ * x if t == blas.Trans or blas.ConjTrans, -// where A is an n×n triangular band matrix, and x is a vector. -func Tbmv(t blas.Transpose, a TriangularBand, x Vector) { - blas64.Dtbmv(a.Uplo, t, a.Diag, a.N, a.K, a.Data, a.Stride, x.Data, x.Inc) -} - -// Tpmv computes -// x = A * x if t == blas.NoTrans, -// x = Aᵀ * x if t == blas.Trans or blas.ConjTrans, -// where A is an n×n triangular matrix in packed format, and x is a vector. -func Tpmv(t blas.Transpose, a TriangularPacked, x Vector) { - blas64.Dtpmv(a.Uplo, t, a.Diag, a.N, a.Data, x.Data, x.Inc) -} - -// Trsv solves -// A * x = b if t == blas.NoTrans, -// Aᵀ * x = b if t == blas.Trans or blas.ConjTrans, -// where A is an n×n triangular matrix, and x and b are vectors. -// -// At entry to the function, x contains the values of b, and the result is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -func Trsv(t blas.Transpose, a Triangular, x Vector) { - blas64.Dtrsv(a.Uplo, t, a.Diag, a.N, a.Data, a.Stride, x.Data, x.Inc) -} - -// Tbsv solves -// A * x = b if t == blas.NoTrans, -// Aᵀ * x = b if t == blas.Trans or blas.ConjTrans, -// where A is an n×n triangular band matrix, and x and b are vectors. -// -// At entry to the function, x contains the values of b, and the result is -// stored in place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -func Tbsv(t blas.Transpose, a TriangularBand, x Vector) { - blas64.Dtbsv(a.Uplo, t, a.Diag, a.N, a.K, a.Data, a.Stride, x.Data, x.Inc) -} - -// Tpsv solves -// A * x = b if t == blas.NoTrans, -// Aᵀ * x = b if t == blas.Trans or blas.ConjTrans, -// where A is an n×n triangular matrix in packed format, and x and b are -// vectors. -// -// At entry to the function, x contains the values of b, and the result is -// stored in place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -func Tpsv(t blas.Transpose, a TriangularPacked, x Vector) { - blas64.Dtpsv(a.Uplo, t, a.Diag, a.N, a.Data, x.Data, x.Inc) -} - -// Symv computes -// y = alpha * A * x + beta * y, -// where A is an n×n symmetric matrix, x and y are vectors, and alpha and -// beta are scalars. -func Symv(alpha float64, a Symmetric, x Vector, beta float64, y Vector) { - blas64.Dsymv(a.Uplo, a.N, alpha, a.Data, a.Stride, x.Data, x.Inc, beta, y.Data, y.Inc) -} - -// Sbmv performs -// y = alpha * A * x + beta * y, -// where A is an n×n symmetric band matrix, x and y are vectors, and alpha -// and beta are scalars. -func Sbmv(alpha float64, a SymmetricBand, x Vector, beta float64, y Vector) { - blas64.Dsbmv(a.Uplo, a.N, a.K, alpha, a.Data, a.Stride, x.Data, x.Inc, beta, y.Data, y.Inc) -} - -// Spmv performs -// y = alpha * A * x + beta * y, -// where A is an n×n symmetric matrix in packed format, x and y are vectors, -// and alpha and beta are scalars. -func Spmv(alpha float64, a SymmetricPacked, x Vector, beta float64, y Vector) { - blas64.Dspmv(a.Uplo, a.N, alpha, a.Data, x.Data, x.Inc, beta, y.Data, y.Inc) -} - -// Ger performs a rank-1 update -// A += alpha * x * yᵀ, -// where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. -func Ger(alpha float64, x, y Vector, a General) { - blas64.Dger(a.Rows, a.Cols, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data, a.Stride) -} - -// Syr performs a rank-1 update -// A += alpha * x * xᵀ, -// where A is an n×n symmetric matrix, x is a vector, and alpha is a scalar. -func Syr(alpha float64, x Vector, a Symmetric) { - blas64.Dsyr(a.Uplo, a.N, alpha, x.Data, x.Inc, a.Data, a.Stride) -} - -// Spr performs the rank-1 update -// A += alpha * x * xᵀ, -// where A is an n×n symmetric matrix in packed format, x is a vector, and -// alpha is a scalar. -func Spr(alpha float64, x Vector, a SymmetricPacked) { - blas64.Dspr(a.Uplo, a.N, alpha, x.Data, x.Inc, a.Data) -} - -// Syr2 performs a rank-2 update -// A += alpha * x * yᵀ + alpha * y * xᵀ, -// where A is a symmetric n×n matrix, x and y are vectors, and alpha is a scalar. -func Syr2(alpha float64, x, y Vector, a Symmetric) { - blas64.Dsyr2(a.Uplo, a.N, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data, a.Stride) -} - -// Spr2 performs a rank-2 update -// A += alpha * x * yᵀ + alpha * y * xᵀ, -// where A is an n×n symmetric matrix in packed format, x and y are vectors, -// and alpha is a scalar. -func Spr2(alpha float64, x, y Vector, a SymmetricPacked) { - blas64.Dspr2(a.Uplo, a.N, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data) -} - -// Level 3 - -// Gemm computes -// C = alpha * A * B + beta * C, -// where A, B, and C are dense matrices, and alpha and beta are scalars. -// tA and tB specify whether A or B are transposed. -func Gemm(tA, tB blas.Transpose, alpha float64, a, b General, beta float64, c General) { - var m, n, k int - if tA == blas.NoTrans { - m, k = a.Rows, a.Cols - } else { - m, k = a.Cols, a.Rows - } - if tB == blas.NoTrans { - n = b.Cols - } else { - n = b.Rows - } - blas64.Dgemm(tA, tB, m, n, k, alpha, a.Data, a.Stride, b.Data, b.Stride, beta, c.Data, c.Stride) -} - -// Symm performs -// C = alpha * A * B + beta * C if s == blas.Left, -// C = alpha * B * A + beta * C if s == blas.Right, -// where A is an n×n or m×m symmetric matrix, B and C are m×n matrices, and -// alpha is a scalar. -func Symm(s blas.Side, alpha float64, a Symmetric, b General, beta float64, c General) { - var m, n int - if s == blas.Left { - m, n = a.N, b.Cols - } else { - m, n = b.Rows, a.N - } - blas64.Dsymm(s, a.Uplo, m, n, alpha, a.Data, a.Stride, b.Data, b.Stride, beta, c.Data, c.Stride) -} - -// Syrk performs a symmetric rank-k update -// C = alpha * A * Aᵀ + beta * C if t == blas.NoTrans, -// C = alpha * Aᵀ * A + beta * C if t == blas.Trans or blas.ConjTrans, -// where C is an n×n symmetric matrix, A is an n×k matrix if t == blas.NoTrans and -// a k×n matrix otherwise, and alpha and beta are scalars. -func Syrk(t blas.Transpose, alpha float64, a General, beta float64, c Symmetric) { - var n, k int - if t == blas.NoTrans { - n, k = a.Rows, a.Cols - } else { - n, k = a.Cols, a.Rows - } - blas64.Dsyrk(c.Uplo, t, n, k, alpha, a.Data, a.Stride, beta, c.Data, c.Stride) -} - -// Syr2k performs a symmetric rank-2k update -// C = alpha * A * Bᵀ + alpha * B * Aᵀ + beta * C if t == blas.NoTrans, -// C = alpha * Aᵀ * B + alpha * Bᵀ * A + beta * C if t == blas.Trans or blas.ConjTrans, -// where C is an n×n symmetric matrix, A and B are n×k matrices if t == NoTrans -// and k×n matrices otherwise, and alpha and beta are scalars. -func Syr2k(t blas.Transpose, alpha float64, a, b General, beta float64, c Symmetric) { - var n, k int - if t == blas.NoTrans { - n, k = a.Rows, a.Cols - } else { - n, k = a.Cols, a.Rows - } - blas64.Dsyr2k(c.Uplo, t, n, k, alpha, a.Data, a.Stride, b.Data, b.Stride, beta, c.Data, c.Stride) -} - -// Trmm performs -// B = alpha * A * B if tA == blas.NoTrans and s == blas.Left, -// B = alpha * Aᵀ * B if tA == blas.Trans or blas.ConjTrans, and s == blas.Left, -// B = alpha * B * A if tA == blas.NoTrans and s == blas.Right, -// B = alpha * B * Aᵀ if tA == blas.Trans or blas.ConjTrans, and s == blas.Right, -// where A is an n×n or m×m triangular matrix, B is an m×n matrix, and alpha is -// a scalar. -func Trmm(s blas.Side, tA blas.Transpose, alpha float64, a Triangular, b General) { - blas64.Dtrmm(s, a.Uplo, tA, a.Diag, b.Rows, b.Cols, alpha, a.Data, a.Stride, b.Data, b.Stride) -} - -// Trsm solves -// A * X = alpha * B if tA == blas.NoTrans and s == blas.Left, -// Aᵀ * X = alpha * B if tA == blas.Trans or blas.ConjTrans, and s == blas.Left, -// X * A = alpha * B if tA == blas.NoTrans and s == blas.Right, -// X * Aᵀ = alpha * B if tA == blas.Trans or blas.ConjTrans, and s == blas.Right, -// where A is an n×n or m×m triangular matrix, X and B are m×n matrices, and -// alpha is a scalar. -// -// At entry to the function, X contains the values of B, and the result is -// stored in-place into X. -// -// No check is made that A is invertible. -func Trsm(s blas.Side, tA blas.Transpose, alpha float64, a Triangular, b General) { - blas64.Dtrsm(s, a.Uplo, tA, a.Diag, b.Rows, b.Cols, alpha, a.Data, a.Stride, b.Data, b.Stride) -} diff --git a/vendor/gonum.org/v1/gonum/blas/blas64/conv.go b/vendor/gonum.org/v1/gonum/blas/blas64/conv.go deleted file mode 100644 index 6cc6517..0000000 --- a/vendor/gonum.org/v1/gonum/blas/blas64/conv.go +++ /dev/null @@ -1,277 +0,0 @@ -// Copyright ©2015 The Gonum 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 blas64 - -import "gonum.org/v1/gonum/blas" - -// GeneralCols represents a matrix using the conventional column-major storage scheme. -type GeneralCols General - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions as a and have adequate backing -// data storage. -func (t GeneralCols) From(a General) { - if t.Rows != a.Rows || t.Cols != a.Cols { - panic("blas64: mismatched dimension") - } - if len(t.Data) < (t.Cols-1)*t.Stride+t.Rows { - panic("blas64: short data slice") - } - for i := 0; i < a.Rows; i++ { - for j, v := range a.Data[i*a.Stride : i*a.Stride+a.Cols] { - t.Data[i+j*t.Stride] = v - } - } -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions as a and have adequate backing -// data storage. -func (t General) From(a GeneralCols) { - if t.Rows != a.Rows || t.Cols != a.Cols { - panic("blas64: mismatched dimension") - } - if len(t.Data) < (t.Rows-1)*t.Stride+t.Cols { - panic("blas64: short data slice") - } - for j := 0; j < a.Cols; j++ { - for i, v := range a.Data[j*a.Stride : j*a.Stride+a.Rows] { - t.Data[i*t.Stride+j] = v - } - } -} - -// TriangularCols represents a matrix using the conventional column-major storage scheme. -type TriangularCols Triangular - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, uplo and diag as a and have -// adequate backing data storage. -func (t TriangularCols) From(a Triangular) { - if t.N != a.N { - panic("blas64: mismatched dimension") - } - if t.Uplo != a.Uplo { - panic("blas64: mismatched BLAS uplo") - } - if t.Diag != a.Diag { - panic("blas64: mismatched BLAS diag") - } - switch a.Uplo { - default: - panic("blas64: bad BLAS uplo") - case blas.Upper: - for i := 0; i < a.N; i++ { - for j := i; j < a.N; j++ { - t.Data[i+j*t.Stride] = a.Data[i*a.Stride+j] - } - } - case blas.Lower: - for i := 0; i < a.N; i++ { - for j := 0; j <= i; j++ { - t.Data[i+j*t.Stride] = a.Data[i*a.Stride+j] - } - } - case blas.All: - for i := 0; i < a.N; i++ { - for j := 0; j < a.N; j++ { - t.Data[i+j*t.Stride] = a.Data[i*a.Stride+j] - } - } - } -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, uplo and diag as a and have -// adequate backing data storage. -func (t Triangular) From(a TriangularCols) { - if t.N != a.N { - panic("blas64: mismatched dimension") - } - if t.Uplo != a.Uplo { - panic("blas64: mismatched BLAS uplo") - } - if t.Diag != a.Diag { - panic("blas64: mismatched BLAS diag") - } - switch a.Uplo { - default: - panic("blas64: bad BLAS uplo") - case blas.Upper: - for i := 0; i < a.N; i++ { - for j := i; j < a.N; j++ { - t.Data[i*t.Stride+j] = a.Data[i+j*a.Stride] - } - } - case blas.Lower: - for i := 0; i < a.N; i++ { - for j := 0; j <= i; j++ { - t.Data[i*t.Stride+j] = a.Data[i+j*a.Stride] - } - } - case blas.All: - for i := 0; i < a.N; i++ { - for j := 0; j < a.N; j++ { - t.Data[i*t.Stride+j] = a.Data[i+j*a.Stride] - } - } - } -} - -// BandCols represents a matrix using the band column-major storage scheme. -type BandCols Band - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions and bandwidth as a and have -// adequate backing data storage. -func (t BandCols) From(a Band) { - if t.Rows != a.Rows || t.Cols != a.Cols { - panic("blas64: mismatched dimension") - } - if t.KL != a.KL || t.KU != a.KU { - panic("blas64: mismatched bandwidth") - } - if a.Stride < a.KL+a.KU+1 { - panic("blas64: short stride for source") - } - if t.Stride < t.KL+t.KU+1 { - panic("blas64: short stride for destination") - } - for i := 0; i < a.Rows; i++ { - for j := max(0, i-a.KL); j < min(i+a.KU+1, a.Cols); j++ { - t.Data[i+t.KU-j+j*t.Stride] = a.Data[j+a.KL-i+i*a.Stride] - } - } -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions and bandwidth as a and have -// adequate backing data storage. -func (t Band) From(a BandCols) { - if t.Rows != a.Rows || t.Cols != a.Cols { - panic("blas64: mismatched dimension") - } - if t.KL != a.KL || t.KU != a.KU { - panic("blas64: mismatched bandwidth") - } - if a.Stride < a.KL+a.KU+1 { - panic("blas64: short stride for source") - } - if t.Stride < t.KL+t.KU+1 { - panic("blas64: short stride for destination") - } - for j := 0; j < a.Cols; j++ { - for i := max(0, j-a.KU); i < min(j+a.KL+1, a.Rows); i++ { - t.Data[j+a.KL-i+i*a.Stride] = a.Data[i+t.KU-j+j*t.Stride] - } - } -} - -// TriangularBandCols represents a triangular matrix using the band column-major storage scheme. -type TriangularBandCols TriangularBand - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, bandwidth and uplo as a and -// have adequate backing data storage. -func (t TriangularBandCols) From(a TriangularBand) { - if t.N != a.N { - panic("blas64: mismatched dimension") - } - if t.K != a.K { - panic("blas64: mismatched bandwidth") - } - if a.Stride < a.K+1 { - panic("blas64: short stride for source") - } - if t.Stride < t.K+1 { - panic("blas64: short stride for destination") - } - if t.Uplo != a.Uplo { - panic("blas64: mismatched BLAS uplo") - } - if t.Diag != a.Diag { - panic("blas64: mismatched BLAS diag") - } - dst := BandCols{ - Rows: t.N, Cols: t.N, - Stride: t.Stride, - Data: t.Data, - } - src := Band{ - Rows: a.N, Cols: a.N, - Stride: a.Stride, - Data: a.Data, - } - switch a.Uplo { - default: - panic("blas64: bad BLAS uplo") - case blas.Upper: - dst.KU = t.K - src.KU = a.K - case blas.Lower: - dst.KL = t.K - src.KL = a.K - } - dst.From(src) -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, bandwidth and uplo as a and -// have adequate backing data storage. -func (t TriangularBand) From(a TriangularBandCols) { - if t.N != a.N { - panic("blas64: mismatched dimension") - } - if t.K != a.K { - panic("blas64: mismatched bandwidth") - } - if a.Stride < a.K+1 { - panic("blas64: short stride for source") - } - if t.Stride < t.K+1 { - panic("blas64: short stride for destination") - } - if t.Uplo != a.Uplo { - panic("blas64: mismatched BLAS uplo") - } - if t.Diag != a.Diag { - panic("blas64: mismatched BLAS diag") - } - dst := Band{ - Rows: t.N, Cols: t.N, - Stride: t.Stride, - Data: t.Data, - } - src := BandCols{ - Rows: a.N, Cols: a.N, - Stride: a.Stride, - Data: a.Data, - } - switch a.Uplo { - default: - panic("blas64: bad BLAS uplo") - case blas.Upper: - dst.KU = t.K - src.KU = a.K - case blas.Lower: - dst.KL = t.K - src.KL = a.K - } - dst.From(src) -} - -func min(a, b int) int { - if a < b { - return a - } - return b -} - -func max(a, b int) int { - if a > b { - return a - } - return b -} diff --git a/vendor/gonum.org/v1/gonum/blas/blas64/conv_symmetric.go b/vendor/gonum.org/v1/gonum/blas/blas64/conv_symmetric.go deleted file mode 100644 index 5146f1a..0000000 --- a/vendor/gonum.org/v1/gonum/blas/blas64/conv_symmetric.go +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright ©2015 The Gonum 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 blas64 - -import "gonum.org/v1/gonum/blas" - -// SymmetricCols represents a matrix using the conventional column-major storage scheme. -type SymmetricCols Symmetric - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions and uplo as a and have adequate -// backing data storage. -func (t SymmetricCols) From(a Symmetric) { - if t.N != a.N { - panic("blas64: mismatched dimension") - } - if t.Uplo != a.Uplo { - panic("blas64: mismatched BLAS uplo") - } - switch a.Uplo { - default: - panic("blas64: bad BLAS uplo") - case blas.Upper: - for i := 0; i < a.N; i++ { - for j := i; j < a.N; j++ { - t.Data[i+j*t.Stride] = a.Data[i*a.Stride+j] - } - } - case blas.Lower: - for i := 0; i < a.N; i++ { - for j := 0; j <= i; j++ { - t.Data[i+j*t.Stride] = a.Data[i*a.Stride+j] - } - } - } -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions and uplo as a and have adequate -// backing data storage. -func (t Symmetric) From(a SymmetricCols) { - if t.N != a.N { - panic("blas64: mismatched dimension") - } - if t.Uplo != a.Uplo { - panic("blas64: mismatched BLAS uplo") - } - switch a.Uplo { - default: - panic("blas64: bad BLAS uplo") - case blas.Upper: - for i := 0; i < a.N; i++ { - for j := i; j < a.N; j++ { - t.Data[i*t.Stride+j] = a.Data[i+j*a.Stride] - } - } - case blas.Lower: - for i := 0; i < a.N; i++ { - for j := 0; j <= i; j++ { - t.Data[i*t.Stride+j] = a.Data[i+j*a.Stride] - } - } - } -} - -// SymmetricBandCols represents a symmetric matrix using the band column-major storage scheme. -type SymmetricBandCols SymmetricBand - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, bandwidth and uplo as a and -// have adequate backing data storage. -func (t SymmetricBandCols) From(a SymmetricBand) { - if t.N != a.N { - panic("blas64: mismatched dimension") - } - if t.K != a.K { - panic("blas64: mismatched bandwidth") - } - if a.Stride < a.K+1 { - panic("blas64: short stride for source") - } - if t.Stride < t.K+1 { - panic("blas64: short stride for destination") - } - if t.Uplo != a.Uplo { - panic("blas64: mismatched BLAS uplo") - } - dst := BandCols{ - Rows: t.N, Cols: t.N, - Stride: t.Stride, - Data: t.Data, - } - src := Band{ - Rows: a.N, Cols: a.N, - Stride: a.Stride, - Data: a.Data, - } - switch a.Uplo { - default: - panic("blas64: bad BLAS uplo") - case blas.Upper: - dst.KU = t.K - src.KU = a.K - case blas.Lower: - dst.KL = t.K - src.KL = a.K - } - dst.From(src) -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, bandwidth and uplo as a and -// have adequate backing data storage. -func (t SymmetricBand) From(a SymmetricBandCols) { - if t.N != a.N { - panic("blas64: mismatched dimension") - } - if t.K != a.K { - panic("blas64: mismatched bandwidth") - } - if a.Stride < a.K+1 { - panic("blas64: short stride for source") - } - if t.Stride < t.K+1 { - panic("blas64: short stride for destination") - } - if t.Uplo != a.Uplo { - panic("blas64: mismatched BLAS uplo") - } - dst := Band{ - Rows: t.N, Cols: t.N, - Stride: t.Stride, - Data: t.Data, - } - src := BandCols{ - Rows: a.N, Cols: a.N, - Stride: a.Stride, - Data: a.Data, - } - switch a.Uplo { - default: - panic("blas64: bad BLAS uplo") - case blas.Upper: - dst.KU = t.K - src.KU = a.K - case blas.Lower: - dst.KL = t.K - src.KL = a.K - } - dst.From(src) -} diff --git a/vendor/gonum.org/v1/gonum/blas/blas64/doc.go b/vendor/gonum.org/v1/gonum/blas/blas64/doc.go deleted file mode 100644 index 7410cee..0000000 --- a/vendor/gonum.org/v1/gonum/blas/blas64/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright ©2017 The Gonum 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 blas64 provides a simple interface to the float64 BLAS API. -package blas64 // import "gonum.org/v1/gonum/blas/blas64" diff --git a/vendor/gonum.org/v1/gonum/blas/cblas128/cblas128.go b/vendor/gonum.org/v1/gonum/blas/cblas128/cblas128.go deleted file mode 100644 index 4b74584..0000000 --- a/vendor/gonum.org/v1/gonum/blas/cblas128/cblas128.go +++ /dev/null @@ -1,532 +0,0 @@ -// Copyright ©2015 The Gonum 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 cblas128 - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/gonum" -) - -var cblas128 blas.Complex128 = gonum.Implementation{} - -// Use sets the BLAS complex128 implementation to be used by subsequent BLAS calls. -// The default implementation is -// gonum.org/v1/gonum/blas/gonum.Implementation. -func Use(b blas.Complex128) { - cblas128 = b -} - -// Implementation returns the current BLAS complex128 implementation. -// -// Implementation allows direct calls to the current the BLAS complex128 implementation -// giving finer control of parameters. -func Implementation() blas.Complex128 { - return cblas128 -} - -// Vector represents a vector with an associated element increment. -type Vector struct { - N int - Inc int - Data []complex128 -} - -// General represents a matrix using the conventional storage scheme. -type General struct { - Rows, Cols int - Stride int - Data []complex128 -} - -// Band represents a band matrix using the band storage scheme. -type Band struct { - Rows, Cols int - KL, KU int - Stride int - Data []complex128 -} - -// Triangular represents a triangular matrix using the conventional storage scheme. -type Triangular struct { - N int - Stride int - Data []complex128 - Uplo blas.Uplo - Diag blas.Diag -} - -// TriangularBand represents a triangular matrix using the band storage scheme. -type TriangularBand struct { - N, K int - Stride int - Data []complex128 - Uplo blas.Uplo - Diag blas.Diag -} - -// TriangularPacked represents a triangular matrix using the packed storage scheme. -type TriangularPacked struct { - N int - Data []complex128 - Uplo blas.Uplo - Diag blas.Diag -} - -// Symmetric represents a symmetric matrix using the conventional storage scheme. -type Symmetric struct { - N int - Stride int - Data []complex128 - Uplo blas.Uplo -} - -// SymmetricBand represents a symmetric matrix using the band storage scheme. -type SymmetricBand struct { - N, K int - Stride int - Data []complex128 - Uplo blas.Uplo -} - -// SymmetricPacked represents a symmetric matrix using the packed storage scheme. -type SymmetricPacked struct { - N int - Data []complex128 - Uplo blas.Uplo -} - -// Hermitian represents an Hermitian matrix using the conventional storage scheme. -type Hermitian Symmetric - -// HermitianBand represents an Hermitian matrix using the band storage scheme. -type HermitianBand SymmetricBand - -// HermitianPacked represents an Hermitian matrix using the packed storage scheme. -type HermitianPacked SymmetricPacked - -// Level 1 - -const ( - negInc = "cblas128: negative vector increment" - badLength = "cblas128: vector length mismatch" -) - -// Dotu computes the dot product of the two vectors without -// complex conjugation: -// xᵀ * y. -// Dotu will panic if the lengths of x and y do not match. -func Dotu(x, y Vector) complex128 { - if x.N != y.N { - panic(badLength) - } - return cblas128.Zdotu(x.N, x.Data, x.Inc, y.Data, y.Inc) -} - -// Dotc computes the dot product of the two vectors with -// complex conjugation: -// xᴴ * y. -// Dotc will panic if the lengths of x and y do not match. -func Dotc(x, y Vector) complex128 { - if x.N != y.N { - panic(badLength) - } - return cblas128.Zdotc(x.N, x.Data, x.Inc, y.Data, y.Inc) -} - -// Nrm2 computes the Euclidean norm of the vector x: -// sqrt(\sum_i x[i] * x[i]). -// -// Nrm2 will panic if the vector increment is negative. -func Nrm2(x Vector) float64 { - if x.Inc < 0 { - panic(negInc) - } - return cblas128.Dznrm2(x.N, x.Data, x.Inc) -} - -// Asum computes the sum of magnitudes of the real and imaginary parts of -// elements of the vector x: -// \sum_i (|Re x[i]| + |Im x[i]|). -// -// Asum will panic if the vector increment is negative. -func Asum(x Vector) float64 { - if x.Inc < 0 { - panic(negInc) - } - return cblas128.Dzasum(x.N, x.Data, x.Inc) -} - -// Iamax returns the index of an element of x with the largest sum of -// magnitudes of the real and imaginary parts (|Re x[i]|+|Im x[i]|). -// If there are multiple such indices, the earliest is returned. -// -// Iamax returns -1 if n == 0. -// -// Iamax will panic if the vector increment is negative. -func Iamax(x Vector) int { - if x.Inc < 0 { - panic(negInc) - } - return cblas128.Izamax(x.N, x.Data, x.Inc) -} - -// Swap exchanges the elements of two vectors: -// x[i], y[i] = y[i], x[i] for all i. -// Swap will panic if the lengths of x and y do not match. -func Swap(x, y Vector) { - if x.N != y.N { - panic(badLength) - } - cblas128.Zswap(x.N, x.Data, x.Inc, y.Data, y.Inc) -} - -// Copy copies the elements of x into the elements of y: -// y[i] = x[i] for all i. -// Copy will panic if the lengths of x and y do not match. -func Copy(x, y Vector) { - if x.N != y.N { - panic(badLength) - } - cblas128.Zcopy(x.N, x.Data, x.Inc, y.Data, y.Inc) -} - -// Axpy computes -// y = alpha * x + y, -// where x and y are vectors, and alpha is a scalar. -// Axpy will panic if the lengths of x and y do not match. -func Axpy(alpha complex128, x, y Vector) { - if x.N != y.N { - panic(badLength) - } - cblas128.Zaxpy(x.N, alpha, x.Data, x.Inc, y.Data, y.Inc) -} - -// Scal computes -// x = alpha * x, -// where x is a vector, and alpha is a scalar. -// -// Scal will panic if the vector increment is negative. -func Scal(alpha complex128, x Vector) { - if x.Inc < 0 { - panic(negInc) - } - cblas128.Zscal(x.N, alpha, x.Data, x.Inc) -} - -// Dscal computes -// x = alpha * x, -// where x is a vector, and alpha is a real scalar. -// -// Dscal will panic if the vector increment is negative. -func Dscal(alpha float64, x Vector) { - if x.Inc < 0 { - panic(negInc) - } - cblas128.Zdscal(x.N, alpha, x.Data, x.Inc) -} - -// Level 2 - -// Gemv computes -// y = alpha * A * x + beta * y if t == blas.NoTrans, -// y = alpha * Aᵀ * x + beta * y if t == blas.Trans, -// y = alpha * Aᴴ * x + beta * y if t == blas.ConjTrans, -// where A is an m×n dense matrix, x and y are vectors, and alpha and beta are -// scalars. -func Gemv(t blas.Transpose, alpha complex128, a General, x Vector, beta complex128, y Vector) { - cblas128.Zgemv(t, a.Rows, a.Cols, alpha, a.Data, a.Stride, x.Data, x.Inc, beta, y.Data, y.Inc) -} - -// Gbmv computes -// y = alpha * A * x + beta * y if t == blas.NoTrans, -// y = alpha * Aᵀ * x + beta * y if t == blas.Trans, -// y = alpha * Aᴴ * x + beta * y if t == blas.ConjTrans, -// where A is an m×n band matrix, x and y are vectors, and alpha and beta are -// scalars. -func Gbmv(t blas.Transpose, alpha complex128, a Band, x Vector, beta complex128, y Vector) { - cblas128.Zgbmv(t, a.Rows, a.Cols, a.KL, a.KU, alpha, a.Data, a.Stride, x.Data, x.Inc, beta, y.Data, y.Inc) -} - -// Trmv computes -// x = A * x if t == blas.NoTrans, -// x = Aᵀ * x if t == blas.Trans, -// x = Aᴴ * x if t == blas.ConjTrans, -// where A is an n×n triangular matrix, and x is a vector. -func Trmv(t blas.Transpose, a Triangular, x Vector) { - cblas128.Ztrmv(a.Uplo, t, a.Diag, a.N, a.Data, a.Stride, x.Data, x.Inc) -} - -// Tbmv computes -// x = A * x if t == blas.NoTrans, -// x = Aᵀ * x if t == blas.Trans, -// x = Aᴴ * x if t == blas.ConjTrans, -// where A is an n×n triangular band matrix, and x is a vector. -func Tbmv(t blas.Transpose, a TriangularBand, x Vector) { - cblas128.Ztbmv(a.Uplo, t, a.Diag, a.N, a.K, a.Data, a.Stride, x.Data, x.Inc) -} - -// Tpmv computes -// x = A * x if t == blas.NoTrans, -// x = Aᵀ * x if t == blas.Trans, -// x = Aᴴ * x if t == blas.ConjTrans, -// where A is an n×n triangular matrix in packed format, and x is a vector. -func Tpmv(t blas.Transpose, a TriangularPacked, x Vector) { - cblas128.Ztpmv(a.Uplo, t, a.Diag, a.N, a.Data, x.Data, x.Inc) -} - -// Trsv solves -// A * x = b if t == blas.NoTrans, -// Aᵀ * x = b if t == blas.Trans, -// Aᴴ * x = b if t == blas.ConjTrans, -// where A is an n×n triangular matrix and x is a vector. -// -// At entry to the function, x contains the values of b, and the result is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -func Trsv(t blas.Transpose, a Triangular, x Vector) { - cblas128.Ztrsv(a.Uplo, t, a.Diag, a.N, a.Data, a.Stride, x.Data, x.Inc) -} - -// Tbsv solves -// A * x = b if t == blas.NoTrans, -// Aᵀ * x = b if t == blas.Trans, -// Aᴴ * x = b if t == blas.ConjTrans, -// where A is an n×n triangular band matrix, and x is a vector. -// -// At entry to the function, x contains the values of b, and the result is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -func Tbsv(t blas.Transpose, a TriangularBand, x Vector) { - cblas128.Ztbsv(a.Uplo, t, a.Diag, a.N, a.K, a.Data, a.Stride, x.Data, x.Inc) -} - -// Tpsv solves -// A * x = b if t == blas.NoTrans, -// Aᵀ * x = b if t == blas.Trans, -// Aᴴ * x = b if t == blas.ConjTrans, -// where A is an n×n triangular matrix in packed format and x is a vector. -// -// At entry to the function, x contains the values of b, and the result is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -func Tpsv(t blas.Transpose, a TriangularPacked, x Vector) { - cblas128.Ztpsv(a.Uplo, t, a.Diag, a.N, a.Data, x.Data, x.Inc) -} - -// Hemv computes -// y = alpha * A * x + beta * y, -// where A is an n×n Hermitian matrix, x and y are vectors, and alpha and -// beta are scalars. -func Hemv(alpha complex128, a Hermitian, x Vector, beta complex128, y Vector) { - cblas128.Zhemv(a.Uplo, a.N, alpha, a.Data, a.Stride, x.Data, x.Inc, beta, y.Data, y.Inc) -} - -// Hbmv performs -// y = alpha * A * x + beta * y, -// where A is an n×n Hermitian band matrix, x and y are vectors, and alpha -// and beta are scalars. -func Hbmv(alpha complex128, a HermitianBand, x Vector, beta complex128, y Vector) { - cblas128.Zhbmv(a.Uplo, a.N, a.K, alpha, a.Data, a.Stride, x.Data, x.Inc, beta, y.Data, y.Inc) -} - -// Hpmv performs -// y = alpha * A * x + beta * y, -// where A is an n×n Hermitian matrix in packed format, x and y are vectors, -// and alpha and beta are scalars. -func Hpmv(alpha complex128, a HermitianPacked, x Vector, beta complex128, y Vector) { - cblas128.Zhpmv(a.Uplo, a.N, alpha, a.Data, x.Data, x.Inc, beta, y.Data, y.Inc) -} - -// Geru performs a rank-1 update -// A += alpha * x * yᵀ, -// where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. -func Geru(alpha complex128, x, y Vector, a General) { - cblas128.Zgeru(a.Rows, a.Cols, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data, a.Stride) -} - -// Gerc performs a rank-1 update -// A += alpha * x * yᴴ, -// where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. -func Gerc(alpha complex128, x, y Vector, a General) { - cblas128.Zgerc(a.Rows, a.Cols, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data, a.Stride) -} - -// Her performs a rank-1 update -// A += alpha * x * yᵀ, -// where A is an m×n Hermitian matrix, x and y are vectors, and alpha is a scalar. -func Her(alpha float64, x Vector, a Hermitian) { - cblas128.Zher(a.Uplo, a.N, alpha, x.Data, x.Inc, a.Data, a.Stride) -} - -// Hpr performs a rank-1 update -// A += alpha * x * xᴴ, -// where A is an n×n Hermitian matrix in packed format, x is a vector, and -// alpha is a scalar. -func Hpr(alpha float64, x Vector, a HermitianPacked) { - cblas128.Zhpr(a.Uplo, a.N, alpha, x.Data, x.Inc, a.Data) -} - -// Her2 performs a rank-2 update -// A += alpha * x * yᴴ + conj(alpha) * y * xᴴ, -// where A is an n×n Hermitian matrix, x and y are vectors, and alpha is a scalar. -func Her2(alpha complex128, x, y Vector, a Hermitian) { - cblas128.Zher2(a.Uplo, a.N, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data, a.Stride) -} - -// Hpr2 performs a rank-2 update -// A += alpha * x * yᴴ + conj(alpha) * y * xᴴ, -// where A is an n×n Hermitian matrix in packed format, x and y are vectors, -// and alpha is a scalar. -func Hpr2(alpha complex128, x, y Vector, a HermitianPacked) { - cblas128.Zhpr2(a.Uplo, a.N, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data) -} - -// Level 3 - -// Gemm computes -// C = alpha * A * B + beta * C, -// where A, B, and C are dense matrices, and alpha and beta are scalars. -// tA and tB specify whether A or B are transposed or conjugated. -func Gemm(tA, tB blas.Transpose, alpha complex128, a, b General, beta complex128, c General) { - var m, n, k int - if tA == blas.NoTrans { - m, k = a.Rows, a.Cols - } else { - m, k = a.Cols, a.Rows - } - if tB == blas.NoTrans { - n = b.Cols - } else { - n = b.Rows - } - cblas128.Zgemm(tA, tB, m, n, k, alpha, a.Data, a.Stride, b.Data, b.Stride, beta, c.Data, c.Stride) -} - -// Symm performs -// C = alpha * A * B + beta * C if s == blas.Left, -// C = alpha * B * A + beta * C if s == blas.Right, -// where A is an n×n or m×m symmetric matrix, B and C are m×n matrices, and -// alpha and beta are scalars. -func Symm(s blas.Side, alpha complex128, a Symmetric, b General, beta complex128, c General) { - var m, n int - if s == blas.Left { - m, n = a.N, b.Cols - } else { - m, n = b.Rows, a.N - } - cblas128.Zsymm(s, a.Uplo, m, n, alpha, a.Data, a.Stride, b.Data, b.Stride, beta, c.Data, c.Stride) -} - -// Syrk performs a symmetric rank-k update -// C = alpha * A * Aᵀ + beta * C if t == blas.NoTrans, -// C = alpha * Aᵀ * A + beta * C if t == blas.Trans, -// where C is an n×n symmetric matrix, A is an n×k matrix if t == blas.NoTrans -// and a k×n matrix otherwise, and alpha and beta are scalars. -func Syrk(t blas.Transpose, alpha complex128, a General, beta complex128, c Symmetric) { - var n, k int - if t == blas.NoTrans { - n, k = a.Rows, a.Cols - } else { - n, k = a.Cols, a.Rows - } - cblas128.Zsyrk(c.Uplo, t, n, k, alpha, a.Data, a.Stride, beta, c.Data, c.Stride) -} - -// Syr2k performs a symmetric rank-2k update -// C = alpha * A * Bᵀ + alpha * B * Aᵀ + beta * C if t == blas.NoTrans, -// C = alpha * Aᵀ * B + alpha * Bᵀ * A + beta * C if t == blas.Trans, -// where C is an n×n symmetric matrix, A and B are n×k matrices if -// t == blas.NoTrans and k×n otherwise, and alpha and beta are scalars. -func Syr2k(t blas.Transpose, alpha complex128, a, b General, beta complex128, c Symmetric) { - var n, k int - if t == blas.NoTrans { - n, k = a.Rows, a.Cols - } else { - n, k = a.Cols, a.Rows - } - cblas128.Zsyr2k(c.Uplo, t, n, k, alpha, a.Data, a.Stride, b.Data, b.Stride, beta, c.Data, c.Stride) -} - -// Trmm performs -// B = alpha * A * B if tA == blas.NoTrans and s == blas.Left, -// B = alpha * Aᵀ * B if tA == blas.Trans and s == blas.Left, -// B = alpha * Aᴴ * B if tA == blas.ConjTrans and s == blas.Left, -// B = alpha * B * A if tA == blas.NoTrans and s == blas.Right, -// B = alpha * B * Aᵀ if tA == blas.Trans and s == blas.Right, -// B = alpha * B * Aᴴ if tA == blas.ConjTrans and s == blas.Right, -// where A is an n×n or m×m triangular matrix, B is an m×n matrix, and alpha is -// a scalar. -func Trmm(s blas.Side, tA blas.Transpose, alpha complex128, a Triangular, b General) { - cblas128.Ztrmm(s, a.Uplo, tA, a.Diag, b.Rows, b.Cols, alpha, a.Data, a.Stride, b.Data, b.Stride) -} - -// Trsm solves -// A * X = alpha * B if tA == blas.NoTrans and s == blas.Left, -// Aᵀ * X = alpha * B if tA == blas.Trans and s == blas.Left, -// Aᴴ * X = alpha * B if tA == blas.ConjTrans and s == blas.Left, -// X * A = alpha * B if tA == blas.NoTrans and s == blas.Right, -// X * Aᵀ = alpha * B if tA == blas.Trans and s == blas.Right, -// X * Aᴴ = alpha * B if tA == blas.ConjTrans and s == blas.Right, -// where A is an n×n or m×m triangular matrix, X and B are m×n matrices, and -// alpha is a scalar. -// -// At entry to the function, b contains the values of B, and the result is -// stored in-place into b. -// -// No check is made that A is invertible. -func Trsm(s blas.Side, tA blas.Transpose, alpha complex128, a Triangular, b General) { - cblas128.Ztrsm(s, a.Uplo, tA, a.Diag, b.Rows, b.Cols, alpha, a.Data, a.Stride, b.Data, b.Stride) -} - -// Hemm performs -// C = alpha * A * B + beta * C if s == blas.Left, -// C = alpha * B * A + beta * C if s == blas.Right, -// where A is an n×n or m×m Hermitian matrix, B and C are m×n matrices, and -// alpha and beta are scalars. -func Hemm(s blas.Side, alpha complex128, a Hermitian, b General, beta complex128, c General) { - var m, n int - if s == blas.Left { - m, n = a.N, b.Cols - } else { - m, n = b.Rows, a.N - } - cblas128.Zhemm(s, a.Uplo, m, n, alpha, a.Data, a.Stride, b.Data, b.Stride, beta, c.Data, c.Stride) -} - -// Herk performs the Hermitian rank-k update -// C = alpha * A * Aᴴ + beta*C if t == blas.NoTrans, -// C = alpha * Aᴴ * A + beta*C if t == blas.ConjTrans, -// where C is an n×n Hermitian matrix, A is an n×k matrix if t == blas.NoTrans -// and a k×n matrix otherwise, and alpha and beta are scalars. -func Herk(t blas.Transpose, alpha float64, a General, beta float64, c Hermitian) { - var n, k int - if t == blas.NoTrans { - n, k = a.Rows, a.Cols - } else { - n, k = a.Cols, a.Rows - } - cblas128.Zherk(c.Uplo, t, n, k, alpha, a.Data, a.Stride, beta, c.Data, c.Stride) -} - -// Her2k performs the Hermitian rank-2k update -// C = alpha * A * Bᴴ + conj(alpha) * B * Aᴴ + beta * C if t == blas.NoTrans, -// C = alpha * Aᴴ * B + conj(alpha) * Bᴴ * A + beta * C if t == blas.ConjTrans, -// where C is an n×n Hermitian matrix, A and B are n×k matrices if t == NoTrans -// and k×n matrices otherwise, and alpha and beta are scalars. -func Her2k(t blas.Transpose, alpha complex128, a, b General, beta float64, c Hermitian) { - var n, k int - if t == blas.NoTrans { - n, k = a.Rows, a.Cols - } else { - n, k = a.Cols, a.Rows - } - cblas128.Zher2k(c.Uplo, t, n, k, alpha, a.Data, a.Stride, b.Data, b.Stride, beta, c.Data, c.Stride) -} diff --git a/vendor/gonum.org/v1/gonum/blas/cblas128/conv.go b/vendor/gonum.org/v1/gonum/blas/cblas128/conv.go deleted file mode 100644 index c459e1d..0000000 --- a/vendor/gonum.org/v1/gonum/blas/cblas128/conv.go +++ /dev/null @@ -1,279 +0,0 @@ -// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT. - -// Copyright ©2015 The Gonum 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 cblas128 - -import "gonum.org/v1/gonum/blas" - -// GeneralCols represents a matrix using the conventional column-major storage scheme. -type GeneralCols General - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions as a and have adequate backing -// data storage. -func (t GeneralCols) From(a General) { - if t.Rows != a.Rows || t.Cols != a.Cols { - panic("cblas128: mismatched dimension") - } - if len(t.Data) < (t.Cols-1)*t.Stride+t.Rows { - panic("cblas128: short data slice") - } - for i := 0; i < a.Rows; i++ { - for j, v := range a.Data[i*a.Stride : i*a.Stride+a.Cols] { - t.Data[i+j*t.Stride] = v - } - } -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions as a and have adequate backing -// data storage. -func (t General) From(a GeneralCols) { - if t.Rows != a.Rows || t.Cols != a.Cols { - panic("cblas128: mismatched dimension") - } - if len(t.Data) < (t.Rows-1)*t.Stride+t.Cols { - panic("cblas128: short data slice") - } - for j := 0; j < a.Cols; j++ { - for i, v := range a.Data[j*a.Stride : j*a.Stride+a.Rows] { - t.Data[i*t.Stride+j] = v - } - } -} - -// TriangularCols represents a matrix using the conventional column-major storage scheme. -type TriangularCols Triangular - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, uplo and diag as a and have -// adequate backing data storage. -func (t TriangularCols) From(a Triangular) { - if t.N != a.N { - panic("cblas128: mismatched dimension") - } - if t.Uplo != a.Uplo { - panic("cblas128: mismatched BLAS uplo") - } - if t.Diag != a.Diag { - panic("cblas128: mismatched BLAS diag") - } - switch a.Uplo { - default: - panic("cblas128: bad BLAS uplo") - case blas.Upper: - for i := 0; i < a.N; i++ { - for j := i; j < a.N; j++ { - t.Data[i+j*t.Stride] = a.Data[i*a.Stride+j] - } - } - case blas.Lower: - for i := 0; i < a.N; i++ { - for j := 0; j <= i; j++ { - t.Data[i+j*t.Stride] = a.Data[i*a.Stride+j] - } - } - case blas.All: - for i := 0; i < a.N; i++ { - for j := 0; j < a.N; j++ { - t.Data[i+j*t.Stride] = a.Data[i*a.Stride+j] - } - } - } -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, uplo and diag as a and have -// adequate backing data storage. -func (t Triangular) From(a TriangularCols) { - if t.N != a.N { - panic("cblas128: mismatched dimension") - } - if t.Uplo != a.Uplo { - panic("cblas128: mismatched BLAS uplo") - } - if t.Diag != a.Diag { - panic("cblas128: mismatched BLAS diag") - } - switch a.Uplo { - default: - panic("cblas128: bad BLAS uplo") - case blas.Upper: - for i := 0; i < a.N; i++ { - for j := i; j < a.N; j++ { - t.Data[i*t.Stride+j] = a.Data[i+j*a.Stride] - } - } - case blas.Lower: - for i := 0; i < a.N; i++ { - for j := 0; j <= i; j++ { - t.Data[i*t.Stride+j] = a.Data[i+j*a.Stride] - } - } - case blas.All: - for i := 0; i < a.N; i++ { - for j := 0; j < a.N; j++ { - t.Data[i*t.Stride+j] = a.Data[i+j*a.Stride] - } - } - } -} - -// BandCols represents a matrix using the band column-major storage scheme. -type BandCols Band - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions and bandwidth as a and have -// adequate backing data storage. -func (t BandCols) From(a Band) { - if t.Rows != a.Rows || t.Cols != a.Cols { - panic("cblas128: mismatched dimension") - } - if t.KL != a.KL || t.KU != a.KU { - panic("cblas128: mismatched bandwidth") - } - if a.Stride < a.KL+a.KU+1 { - panic("cblas128: short stride for source") - } - if t.Stride < t.KL+t.KU+1 { - panic("cblas128: short stride for destination") - } - for i := 0; i < a.Rows; i++ { - for j := max(0, i-a.KL); j < min(i+a.KU+1, a.Cols); j++ { - t.Data[i+t.KU-j+j*t.Stride] = a.Data[j+a.KL-i+i*a.Stride] - } - } -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions and bandwidth as a and have -// adequate backing data storage. -func (t Band) From(a BandCols) { - if t.Rows != a.Rows || t.Cols != a.Cols { - panic("cblas128: mismatched dimension") - } - if t.KL != a.KL || t.KU != a.KU { - panic("cblas128: mismatched bandwidth") - } - if a.Stride < a.KL+a.KU+1 { - panic("cblas128: short stride for source") - } - if t.Stride < t.KL+t.KU+1 { - panic("cblas128: short stride for destination") - } - for j := 0; j < a.Cols; j++ { - for i := max(0, j-a.KU); i < min(j+a.KL+1, a.Rows); i++ { - t.Data[j+a.KL-i+i*a.Stride] = a.Data[i+t.KU-j+j*t.Stride] - } - } -} - -// TriangularBandCols represents a triangular matrix using the band column-major storage scheme. -type TriangularBandCols TriangularBand - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, bandwidth and uplo as a and -// have adequate backing data storage. -func (t TriangularBandCols) From(a TriangularBand) { - if t.N != a.N { - panic("cblas128: mismatched dimension") - } - if t.K != a.K { - panic("cblas128: mismatched bandwidth") - } - if a.Stride < a.K+1 { - panic("cblas128: short stride for source") - } - if t.Stride < t.K+1 { - panic("cblas128: short stride for destination") - } - if t.Uplo != a.Uplo { - panic("cblas128: mismatched BLAS uplo") - } - if t.Diag != a.Diag { - panic("cblas128: mismatched BLAS diag") - } - dst := BandCols{ - Rows: t.N, Cols: t.N, - Stride: t.Stride, - Data: t.Data, - } - src := Band{ - Rows: a.N, Cols: a.N, - Stride: a.Stride, - Data: a.Data, - } - switch a.Uplo { - default: - panic("cblas128: bad BLAS uplo") - case blas.Upper: - dst.KU = t.K - src.KU = a.K - case blas.Lower: - dst.KL = t.K - src.KL = a.K - } - dst.From(src) -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, bandwidth and uplo as a and -// have adequate backing data storage. -func (t TriangularBand) From(a TriangularBandCols) { - if t.N != a.N { - panic("cblas128: mismatched dimension") - } - if t.K != a.K { - panic("cblas128: mismatched bandwidth") - } - if a.Stride < a.K+1 { - panic("cblas128: short stride for source") - } - if t.Stride < t.K+1 { - panic("cblas128: short stride for destination") - } - if t.Uplo != a.Uplo { - panic("cblas128: mismatched BLAS uplo") - } - if t.Diag != a.Diag { - panic("cblas128: mismatched BLAS diag") - } - dst := Band{ - Rows: t.N, Cols: t.N, - Stride: t.Stride, - Data: t.Data, - } - src := BandCols{ - Rows: a.N, Cols: a.N, - Stride: a.Stride, - Data: a.Data, - } - switch a.Uplo { - default: - panic("cblas128: bad BLAS uplo") - case blas.Upper: - dst.KU = t.K - src.KU = a.K - case blas.Lower: - dst.KL = t.K - src.KL = a.K - } - dst.From(src) -} - -func min(a, b int) int { - if a < b { - return a - } - return b -} - -func max(a, b int) int { - if a > b { - return a - } - return b -} diff --git a/vendor/gonum.org/v1/gonum/blas/cblas128/conv_hermitian.go b/vendor/gonum.org/v1/gonum/blas/cblas128/conv_hermitian.go deleted file mode 100644 index 51c3a57..0000000 --- a/vendor/gonum.org/v1/gonum/blas/cblas128/conv_hermitian.go +++ /dev/null @@ -1,155 +0,0 @@ -// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT. - -// Copyright ©2015 The Gonum 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 cblas128 - -import "gonum.org/v1/gonum/blas" - -// HermitianCols represents a matrix using the conventional column-major storage scheme. -type HermitianCols Hermitian - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions and uplo as a and have adequate -// backing data storage. -func (t HermitianCols) From(a Hermitian) { - if t.N != a.N { - panic("cblas128: mismatched dimension") - } - if t.Uplo != a.Uplo { - panic("cblas128: mismatched BLAS uplo") - } - switch a.Uplo { - default: - panic("cblas128: bad BLAS uplo") - case blas.Upper: - for i := 0; i < a.N; i++ { - for j := i; j < a.N; j++ { - t.Data[i+j*t.Stride] = a.Data[i*a.Stride+j] - } - } - case blas.Lower: - for i := 0; i < a.N; i++ { - for j := 0; j <= i; j++ { - t.Data[i+j*t.Stride] = a.Data[i*a.Stride+j] - } - } - } -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions and uplo as a and have adequate -// backing data storage. -func (t Hermitian) From(a HermitianCols) { - if t.N != a.N { - panic("cblas128: mismatched dimension") - } - if t.Uplo != a.Uplo { - panic("cblas128: mismatched BLAS uplo") - } - switch a.Uplo { - default: - panic("cblas128: bad BLAS uplo") - case blas.Upper: - for i := 0; i < a.N; i++ { - for j := i; j < a.N; j++ { - t.Data[i*t.Stride+j] = a.Data[i+j*a.Stride] - } - } - case blas.Lower: - for i := 0; i < a.N; i++ { - for j := 0; j <= i; j++ { - t.Data[i*t.Stride+j] = a.Data[i+j*a.Stride] - } - } - } -} - -// HermitianBandCols represents an Hermitian matrix using the band column-major storage scheme. -type HermitianBandCols HermitianBand - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, bandwidth and uplo as a and -// have adequate backing data storage. -func (t HermitianBandCols) From(a HermitianBand) { - if t.N != a.N { - panic("cblas128: mismatched dimension") - } - if t.K != a.K { - panic("cblas128: mismatched bandwidth") - } - if a.Stride < a.K+1 { - panic("cblas128: short stride for source") - } - if t.Stride < t.K+1 { - panic("cblas128: short stride for destination") - } - if t.Uplo != a.Uplo { - panic("cblas128: mismatched BLAS uplo") - } - dst := BandCols{ - Rows: t.N, Cols: t.N, - Stride: t.Stride, - Data: t.Data, - } - src := Band{ - Rows: a.N, Cols: a.N, - Stride: a.Stride, - Data: a.Data, - } - switch a.Uplo { - default: - panic("cblas128: bad BLAS uplo") - case blas.Upper: - dst.KU = t.K - src.KU = a.K - case blas.Lower: - dst.KL = t.K - src.KL = a.K - } - dst.From(src) -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, bandwidth and uplo as a and -// have adequate backing data storage. -func (t HermitianBand) From(a HermitianBandCols) { - if t.N != a.N { - panic("cblas128: mismatched dimension") - } - if t.K != a.K { - panic("cblas128: mismatched bandwidth") - } - if a.Stride < a.K+1 { - panic("cblas128: short stride for source") - } - if t.Stride < t.K+1 { - panic("cblas128: short stride for destination") - } - if t.Uplo != a.Uplo { - panic("cblas128: mismatched BLAS uplo") - } - dst := Band{ - Rows: t.N, Cols: t.N, - Stride: t.Stride, - Data: t.Data, - } - src := BandCols{ - Rows: a.N, Cols: a.N, - Stride: a.Stride, - Data: a.Data, - } - switch a.Uplo { - default: - panic("cblas128: bad BLAS uplo") - case blas.Upper: - dst.KU = t.K - src.KU = a.K - case blas.Lower: - dst.KL = t.K - src.KL = a.K - } - dst.From(src) -} diff --git a/vendor/gonum.org/v1/gonum/blas/cblas128/conv_symmetric.go b/vendor/gonum.org/v1/gonum/blas/cblas128/conv_symmetric.go deleted file mode 100644 index f1bf40c..0000000 --- a/vendor/gonum.org/v1/gonum/blas/cblas128/conv_symmetric.go +++ /dev/null @@ -1,155 +0,0 @@ -// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT. - -// Copyright ©2015 The Gonum 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 cblas128 - -import "gonum.org/v1/gonum/blas" - -// SymmetricCols represents a matrix using the conventional column-major storage scheme. -type SymmetricCols Symmetric - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions and uplo as a and have adequate -// backing data storage. -func (t SymmetricCols) From(a Symmetric) { - if t.N != a.N { - panic("cblas128: mismatched dimension") - } - if t.Uplo != a.Uplo { - panic("cblas128: mismatched BLAS uplo") - } - switch a.Uplo { - default: - panic("cblas128: bad BLAS uplo") - case blas.Upper: - for i := 0; i < a.N; i++ { - for j := i; j < a.N; j++ { - t.Data[i+j*t.Stride] = a.Data[i*a.Stride+j] - } - } - case blas.Lower: - for i := 0; i < a.N; i++ { - for j := 0; j <= i; j++ { - t.Data[i+j*t.Stride] = a.Data[i*a.Stride+j] - } - } - } -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions and uplo as a and have adequate -// backing data storage. -func (t Symmetric) From(a SymmetricCols) { - if t.N != a.N { - panic("cblas128: mismatched dimension") - } - if t.Uplo != a.Uplo { - panic("cblas128: mismatched BLAS uplo") - } - switch a.Uplo { - default: - panic("cblas128: bad BLAS uplo") - case blas.Upper: - for i := 0; i < a.N; i++ { - for j := i; j < a.N; j++ { - t.Data[i*t.Stride+j] = a.Data[i+j*a.Stride] - } - } - case blas.Lower: - for i := 0; i < a.N; i++ { - for j := 0; j <= i; j++ { - t.Data[i*t.Stride+j] = a.Data[i+j*a.Stride] - } - } - } -} - -// SymmetricBandCols represents a symmetric matrix using the band column-major storage scheme. -type SymmetricBandCols SymmetricBand - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, bandwidth and uplo as a and -// have adequate backing data storage. -func (t SymmetricBandCols) From(a SymmetricBand) { - if t.N != a.N { - panic("cblas128: mismatched dimension") - } - if t.K != a.K { - panic("cblas128: mismatched bandwidth") - } - if a.Stride < a.K+1 { - panic("cblas128: short stride for source") - } - if t.Stride < t.K+1 { - panic("cblas128: short stride for destination") - } - if t.Uplo != a.Uplo { - panic("cblas128: mismatched BLAS uplo") - } - dst := BandCols{ - Rows: t.N, Cols: t.N, - Stride: t.Stride, - Data: t.Data, - } - src := Band{ - Rows: a.N, Cols: a.N, - Stride: a.Stride, - Data: a.Data, - } - switch a.Uplo { - default: - panic("cblas128: bad BLAS uplo") - case blas.Upper: - dst.KU = t.K - src.KU = a.K - case blas.Lower: - dst.KL = t.K - src.KL = a.K - } - dst.From(src) -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, bandwidth and uplo as a and -// have adequate backing data storage. -func (t SymmetricBand) From(a SymmetricBandCols) { - if t.N != a.N { - panic("cblas128: mismatched dimension") - } - if t.K != a.K { - panic("cblas128: mismatched bandwidth") - } - if a.Stride < a.K+1 { - panic("cblas128: short stride for source") - } - if t.Stride < t.K+1 { - panic("cblas128: short stride for destination") - } - if t.Uplo != a.Uplo { - panic("cblas128: mismatched BLAS uplo") - } - dst := Band{ - Rows: t.N, Cols: t.N, - Stride: t.Stride, - Data: t.Data, - } - src := BandCols{ - Rows: a.N, Cols: a.N, - Stride: a.Stride, - Data: a.Data, - } - switch a.Uplo { - default: - panic("cblas128: bad BLAS uplo") - case blas.Upper: - dst.KU = t.K - src.KU = a.K - case blas.Lower: - dst.KL = t.K - src.KL = a.K - } - dst.From(src) -} diff --git a/vendor/gonum.org/v1/gonum/blas/cblas128/doc.go b/vendor/gonum.org/v1/gonum/blas/cblas128/doc.go deleted file mode 100644 index 09719b1..0000000 --- a/vendor/gonum.org/v1/gonum/blas/cblas128/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright ©2017 The Gonum 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 cblas128 provides a simple interface to the complex128 BLAS API. -package cblas128 // import "gonum.org/v1/gonum/blas/cblas128" diff --git a/vendor/gonum.org/v1/gonum/blas/conversions.bash b/vendor/gonum.org/v1/gonum/blas/conversions.bash deleted file mode 100755 index d1c0ef0..0000000 --- a/vendor/gonum.org/v1/gonum/blas/conversions.bash +++ /dev/null @@ -1,159 +0,0 @@ -#!/usr/bin/env bash - -# Copyright ©2017 The Gonum Authors. All rights reserved. -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file. - -# Generate code for blas32. -echo Generating blas32/conv.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > blas32/conv.go -cat blas64/conv.go \ -| gofmt -r 'float64 -> float32' \ -\ -| sed -e 's/blas64/blas32/' \ -\ ->> blas32/conv.go - -echo Generating blas32/conv_test.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > blas32/conv_test.go -cat blas64/conv_test.go \ -| gofmt -r 'float64 -> float32' \ -\ -| sed -e 's/blas64/blas32/' \ - -e 's_"math"_math "gonum.org/v1/gonum/internal/math32"_' \ -\ ->> blas32/conv_test.go - -echo Generating blas32/conv_symmetric.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > blas32/conv_symmetric.go -cat blas64/conv_symmetric.go \ -| gofmt -r 'float64 -> float32' \ -\ -| sed -e 's/blas64/blas32/' \ -\ ->> blas32/conv_symmetric.go - -echo Generating blas32/conv_symmetric_test.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > blas32/conv_symmetric_test.go -cat blas64/conv_symmetric_test.go \ -| gofmt -r 'float64 -> float32' \ -\ -| sed -e 's/blas64/blas32/' \ - -e 's_"math"_math "gonum.org/v1/gonum/internal/math32"_' \ -\ ->> blas32/conv_symmetric_test.go - - -# Generate code for cblas128. -echo Generating cblas128/conv.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > cblas128/conv.go -cat blas64/conv.go \ -| gofmt -r 'float64 -> complex128' \ -\ -| sed -e 's/blas64/cblas128/' \ -\ ->> cblas128/conv.go - -echo Generating cblas128/conv_test.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > cblas128/conv_test.go -cat blas64/conv_test.go \ -| gofmt -r 'float64 -> complex128' \ -\ -| sed -e 's/blas64/cblas128/' \ - -e 's_"math"_math "math/cmplx"_' \ -\ ->> cblas128/conv_test.go - -echo Generating cblas128/conv_symmetric.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > cblas128/conv_symmetric.go -cat blas64/conv_symmetric.go \ -| gofmt -r 'float64 -> complex128' \ -\ -| sed -e 's/blas64/cblas128/' \ -\ ->> cblas128/conv_symmetric.go - -echo Generating cblas128/conv_symmetric_test.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > cblas128/conv_symmetric_test.go -cat blas64/conv_symmetric_test.go \ -| gofmt -r 'float64 -> complex128' \ -\ -| sed -e 's/blas64/cblas128/' \ - -e 's_"math"_math "math/cmplx"_' \ -\ ->> cblas128/conv_symmetric_test.go - -echo Generating cblas128/conv_hermitian.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > cblas128/conv_hermitian.go -cat blas64/conv_symmetric.go \ -| gofmt -r 'float64 -> complex128' \ -\ -| sed -e 's/blas64/cblas128/' \ - -e 's/Symmetric/Hermitian/g' \ - -e 's/a symmetric/an Hermitian/g' \ - -e 's/symmetric/hermitian/g' \ - -e 's/Sym/Herm/g' \ -\ ->> cblas128/conv_hermitian.go - -echo Generating cblas128/conv_hermitian_test.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > cblas128/conv_hermitian_test.go -cat blas64/conv_symmetric_test.go \ -| gofmt -r 'float64 -> complex128' \ -\ -| sed -e 's/blas64/cblas128/' \ - -e 's/Symmetric/Hermitian/g' \ - -e 's/a symmetric/an Hermitian/g' \ - -e 's/symmetric/hermitian/g' \ - -e 's/Sym/Herm/g' \ - -e 's_"math"_math "math/cmplx"_' \ -\ ->> cblas128/conv_hermitian_test.go - - -# Generate code for cblas64. -echo Generating cblas64/conv.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > cblas64/conv.go -cat blas64/conv.go \ -| gofmt -r 'float64 -> complex64' \ -\ -| sed -e 's/blas64/cblas64/' \ -\ ->> cblas64/conv.go - -echo Generating cblas64/conv_test.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > cblas64/conv_test.go -cat blas64/conv_test.go \ -| gofmt -r 'float64 -> complex64' \ -\ -| sed -e 's/blas64/cblas64/' \ - -e 's_"math"_math "gonum.org/v1/gonum/internal/cmplx64"_' \ -\ ->> cblas64/conv_test.go - -echo Generating cblas64/conv_hermitian.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > cblas64/conv_hermitian.go -cat blas64/conv_symmetric.go \ -| gofmt -r 'float64 -> complex64' \ -\ -| sed -e 's/blas64/cblas64/' \ - -e 's/Symmetric/Hermitian/g' \ - -e 's/a symmetric/an Hermitian/g' \ - -e 's/symmetric/hermitian/g' \ - -e 's/Sym/Herm/g' \ -\ ->> cblas64/conv_hermitian.go - -echo Generating cblas64/conv_hermitian_test.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > cblas64/conv_hermitian_test.go -cat blas64/conv_symmetric_test.go \ -| gofmt -r 'float64 -> complex64' \ -\ -| sed -e 's/blas64/cblas64/' \ - -e 's/Symmetric/Hermitian/g' \ - -e 's/a symmetric/an Hermitian/g' \ - -e 's/symmetric/hermitian/g' \ - -e 's/Sym/Herm/g' \ - -e 's_"math"_math "gonum.org/v1/gonum/internal/cmplx64"_' \ -\ ->> cblas64/conv_hermitian_test.go diff --git a/vendor/gonum.org/v1/gonum/blas/doc.go b/vendor/gonum.org/v1/gonum/blas/doc.go deleted file mode 100644 index ea4b16c..0000000 --- a/vendor/gonum.org/v1/gonum/blas/doc.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright ©2017 The Gonum 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 blas provides interfaces for the BLAS linear algebra standard. - -All methods must perform appropriate parameter checking and panic if -provided parameters that do not conform to the requirements specified -by the BLAS standard. - -Quick Reference Guide to the BLAS from http://www.netlib.org/lapack/lug/node145.html - -This version is modified to remove the "order" option. All matrix operations are -on row-order matrices. - -Level 1 BLAS - - dim scalar vector vector scalars 5-element prefixes - struct - - _rotg ( a, b ) S, D - _rotmg( d1, d2, a, b ) S, D - _rot ( n, x, incX, y, incY, c, s ) S, D - _rotm ( n, x, incX, y, incY, param ) S, D - _swap ( n, x, incX, y, incY ) S, D, C, Z - _scal ( n, alpha, x, incX ) S, D, C, Z, Cs, Zd - _copy ( n, x, incX, y, incY ) S, D, C, Z - _axpy ( n, alpha, x, incX, y, incY ) S, D, C, Z - _dot ( n, x, incX, y, incY ) S, D, Ds - _dotu ( n, x, incX, y, incY ) C, Z - _dotc ( n, x, incX, y, incY ) C, Z - __dot ( n, alpha, x, incX, y, incY ) Sds - _nrm2 ( n, x, incX ) S, D, Sc, Dz - _asum ( n, x, incX ) S, D, Sc, Dz - I_amax( n, x, incX ) s, d, c, z - -Level 2 BLAS - - options dim b-width scalar matrix vector scalar vector prefixes - - _gemv ( trans, m, n, alpha, a, lda, x, incX, beta, y, incY ) S, D, C, Z - _gbmv ( trans, m, n, kL, kU, alpha, a, lda, x, incX, beta, y, incY ) S, D, C, Z - _hemv ( uplo, n, alpha, a, lda, x, incX, beta, y, incY ) C, Z - _hbmv ( uplo, n, k, alpha, a, lda, x, incX, beta, y, incY ) C, Z - _hpmv ( uplo, n, alpha, ap, x, incX, beta, y, incY ) C, Z - _symv ( uplo, n, alpha, a, lda, x, incX, beta, y, incY ) S, D - _sbmv ( uplo, n, k, alpha, a, lda, x, incX, beta, y, incY ) S, D - _spmv ( uplo, n, alpha, ap, x, incX, beta, y, incY ) S, D - _trmv ( uplo, trans, diag, n, a, lda, x, incX ) S, D, C, Z - _tbmv ( uplo, trans, diag, n, k, a, lda, x, incX ) S, D, C, Z - _tpmv ( uplo, trans, diag, n, ap, x, incX ) S, D, C, Z - _trsv ( uplo, trans, diag, n, a, lda, x, incX ) S, D, C, Z - _tbsv ( uplo, trans, diag, n, k, a, lda, x, incX ) S, D, C, Z - _tpsv ( uplo, trans, diag, n, ap, x, incX ) S, D, C, Z - - options dim scalar vector vector matrix prefixes - - _ger ( m, n, alpha, x, incX, y, incY, a, lda ) S, D - _geru ( m, n, alpha, x, incX, y, incY, a, lda ) C, Z - _gerc ( m, n, alpha, x, incX, y, incY, a, lda ) C, Z - _her ( uplo, n, alpha, x, incX, a, lda ) C, Z - _hpr ( uplo, n, alpha, x, incX, ap ) C, Z - _her2 ( uplo, n, alpha, x, incX, y, incY, a, lda ) C, Z - _hpr2 ( uplo, n, alpha, x, incX, y, incY, ap ) C, Z - _syr ( uplo, n, alpha, x, incX, a, lda ) S, D - _spr ( uplo, n, alpha, x, incX, ap ) S, D - _syr2 ( uplo, n, alpha, x, incX, y, incY, a, lda ) S, D - _spr2 ( uplo, n, alpha, x, incX, y, incY, ap ) S, D - -Level 3 BLAS - - options dim scalar matrix matrix scalar matrix prefixes - - _gemm ( transA, transB, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc ) S, D, C, Z - _symm ( side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc ) S, D, C, Z - _hemm ( side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc ) C, Z - _syrk ( uplo, trans, n, k, alpha, a, lda, beta, c, ldc ) S, D, C, Z - _herk ( uplo, trans, n, k, alpha, a, lda, beta, c, ldc ) C, Z - _syr2k( uplo, trans, n, k, alpha, a, lda, b, ldb, beta, c, ldc ) S, D, C, Z - _her2k( uplo, trans, n, k, alpha, a, lda, b, ldb, beta, c, ldc ) C, Z - _trmm ( side, uplo, transA, diag, m, n, alpha, a, lda, b, ldb ) S, D, C, Z - _trsm ( side, uplo, transA, diag, m, n, alpha, a, lda, b, ldb ) S, D, C, Z - -Meaning of prefixes - - S - float32 C - complex64 - D - float64 Z - complex128 - -Matrix types - - GE - GEneral GB - General Band - SY - SYmmetric SB - Symmetric Band SP - Symmetric Packed - HE - HErmitian HB - Hermitian Band HP - Hermitian Packed - TR - TRiangular TB - Triangular Band TP - Triangular Packed - -Options - - trans = NoTrans, Trans, ConjTrans - uplo = Upper, Lower - diag = Nonunit, Unit - side = Left, Right (A or op(A) on the left, or A or op(A) on the right) - -For real matrices, Trans and ConjTrans have the same meaning. -For Hermitian matrices, trans = Trans is not allowed. -For complex symmetric matrices, trans = ConjTrans is not allowed. -*/ -package blas // import "gonum.org/v1/gonum/blas" diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/dgemm.go b/vendor/gonum.org/v1/gonum/blas/gonum/dgemm.go deleted file mode 100644 index 167dd27..0000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/dgemm.go +++ /dev/null @@ -1,314 +0,0 @@ -// Copyright ©2014 The Gonum 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 gonum - -import ( - "runtime" - "sync" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/f64" -) - -// Dgemm performs one of the matrix-matrix operations -// C = alpha * A * B + beta * C -// C = alpha * Aᵀ * B + beta * C -// C = alpha * A * Bᵀ + beta * C -// C = alpha * Aᵀ * Bᵀ + beta * C -// where A is an m×k or k×m dense matrix, B is an n×k or k×n dense matrix, C is -// an m×n matrix, and alpha and beta are scalars. tA and tB specify whether A or -// B are transposed. -func (Implementation) Dgemm(tA, tB blas.Transpose, m, n, k int, alpha float64, a []float64, lda int, b []float64, ldb int, beta float64, c []float64, ldc int) { - switch tA { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch tB { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - aTrans := tA == blas.Trans || tA == blas.ConjTrans - if aTrans { - if lda < max(1, m) { - panic(badLdA) - } - } else { - if lda < max(1, k) { - panic(badLdA) - } - } - bTrans := tB == blas.Trans || tB == blas.ConjTrans - if bTrans { - if ldb < max(1, k) { - panic(badLdB) - } - } else { - if ldb < max(1, n) { - panic(badLdB) - } - } - if ldc < max(1, n) { - panic(badLdC) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if aTrans { - if len(a) < (k-1)*lda+m { - panic(shortA) - } - } else { - if len(a) < (m-1)*lda+k { - panic(shortA) - } - } - if bTrans { - if len(b) < (n-1)*ldb+k { - panic(shortB) - } - } else { - if len(b) < (k-1)*ldb+n { - panic(shortB) - } - } - if len(c) < (m-1)*ldc+n { - panic(shortC) - } - - // Quick return if possible. - if (alpha == 0 || k == 0) && beta == 1 { - return - } - - // scale c - if beta != 1 { - if beta == 0 { - for i := 0; i < m; i++ { - ctmp := c[i*ldc : i*ldc+n] - for j := range ctmp { - ctmp[j] = 0 - } - } - } else { - for i := 0; i < m; i++ { - ctmp := c[i*ldc : i*ldc+n] - for j := range ctmp { - ctmp[j] *= beta - } - } - } - } - - dgemmParallel(aTrans, bTrans, m, n, k, a, lda, b, ldb, c, ldc, alpha) -} - -func dgemmParallel(aTrans, bTrans bool, m, n, k int, a []float64, lda int, b []float64, ldb int, c []float64, ldc int, alpha float64) { - // dgemmParallel computes a parallel matrix multiplication by partitioning - // a and b into sub-blocks, and updating c with the multiplication of the sub-block - // In all cases, - // A = [ A_11 A_12 ... A_1j - // A_21 A_22 ... A_2j - // ... - // A_i1 A_i2 ... A_ij] - // - // and same for B. All of the submatrix sizes are blockSize×blockSize except - // at the edges. - // - // In all cases, there is one dimension for each matrix along which - // C must be updated sequentially. - // Cij = \sum_k Aik Bki, (A * B) - // Cij = \sum_k Aki Bkj, (Aᵀ * B) - // Cij = \sum_k Aik Bjk, (A * Bᵀ) - // Cij = \sum_k Aki Bjk, (Aᵀ * Bᵀ) - // - // This code computes one {i, j} block sequentially along the k dimension, - // and computes all of the {i, j} blocks concurrently. This - // partitioning allows Cij to be updated in-place without race-conditions. - // Instead of launching a goroutine for each possible concurrent computation, - // a number of worker goroutines are created and channels are used to pass - // available and completed cases. - // - // http://alexkr.com/docs/matrixmult.pdf is a good reference on matrix-matrix - // multiplies, though this code does not copy matrices to attempt to eliminate - // cache misses. - - maxKLen := k - parBlocks := blocks(m, blockSize) * blocks(n, blockSize) - if parBlocks < minParBlock { - // The matrix multiplication is small in the dimensions where it can be - // computed concurrently. Just do it in serial. - dgemmSerial(aTrans, bTrans, m, n, k, a, lda, b, ldb, c, ldc, alpha) - return - } - - nWorkers := runtime.GOMAXPROCS(0) - if parBlocks < nWorkers { - nWorkers = parBlocks - } - // There is a tradeoff between the workers having to wait for work - // and a large buffer making operations slow. - buf := buffMul * nWorkers - if buf > parBlocks { - buf = parBlocks - } - - sendChan := make(chan subMul, buf) - - // Launch workers. A worker receives an {i, j} submatrix of c, and computes - // A_ik B_ki (or the transposed version) storing the result in c_ij. When the - // channel is finally closed, it signals to the waitgroup that it has finished - // computing. - var wg sync.WaitGroup - for i := 0; i < nWorkers; i++ { - wg.Add(1) - go func() { - defer wg.Done() - for sub := range sendChan { - i := sub.i - j := sub.j - leni := blockSize - if i+leni > m { - leni = m - i - } - lenj := blockSize - if j+lenj > n { - lenj = n - j - } - - cSub := sliceView64(c, ldc, i, j, leni, lenj) - - // Compute A_ik B_kj for all k - for k := 0; k < maxKLen; k += blockSize { - lenk := blockSize - if k+lenk > maxKLen { - lenk = maxKLen - k - } - var aSub, bSub []float64 - if aTrans { - aSub = sliceView64(a, lda, k, i, lenk, leni) - } else { - aSub = sliceView64(a, lda, i, k, leni, lenk) - } - if bTrans { - bSub = sliceView64(b, ldb, j, k, lenj, lenk) - } else { - bSub = sliceView64(b, ldb, k, j, lenk, lenj) - } - dgemmSerial(aTrans, bTrans, leni, lenj, lenk, aSub, lda, bSub, ldb, cSub, ldc, alpha) - } - } - }() - } - - // Send out all of the {i, j} subblocks for computation. - for i := 0; i < m; i += blockSize { - for j := 0; j < n; j += blockSize { - sendChan <- subMul{ - i: i, - j: j, - } - } - } - close(sendChan) - wg.Wait() -} - -// dgemmSerial is serial matrix multiply -func dgemmSerial(aTrans, bTrans bool, m, n, k int, a []float64, lda int, b []float64, ldb int, c []float64, ldc int, alpha float64) { - switch { - case !aTrans && !bTrans: - dgemmSerialNotNot(m, n, k, a, lda, b, ldb, c, ldc, alpha) - return - case aTrans && !bTrans: - dgemmSerialTransNot(m, n, k, a, lda, b, ldb, c, ldc, alpha) - return - case !aTrans && bTrans: - dgemmSerialNotTrans(m, n, k, a, lda, b, ldb, c, ldc, alpha) - return - case aTrans && bTrans: - dgemmSerialTransTrans(m, n, k, a, lda, b, ldb, c, ldc, alpha) - return - default: - panic("unreachable") - } -} - -// dgemmSerial where neither a nor b are transposed -func dgemmSerialNotNot(m, n, k int, a []float64, lda int, b []float64, ldb int, c []float64, ldc int, alpha float64) { - // This style is used instead of the literal [i*stride +j]) is used because - // approximately 5 times faster as of go 1.3. - for i := 0; i < m; i++ { - ctmp := c[i*ldc : i*ldc+n] - for l, v := range a[i*lda : i*lda+k] { - tmp := alpha * v - if tmp != 0 { - f64.AxpyUnitary(tmp, b[l*ldb:l*ldb+n], ctmp) - } - } - } -} - -// dgemmSerial where neither a is transposed and b is not -func dgemmSerialTransNot(m, n, k int, a []float64, lda int, b []float64, ldb int, c []float64, ldc int, alpha float64) { - // This style is used instead of the literal [i*stride +j]) is used because - // approximately 5 times faster as of go 1.3. - for l := 0; l < k; l++ { - btmp := b[l*ldb : l*ldb+n] - for i, v := range a[l*lda : l*lda+m] { - tmp := alpha * v - if tmp != 0 { - ctmp := c[i*ldc : i*ldc+n] - f64.AxpyUnitary(tmp, btmp, ctmp) - } - } - } -} - -// dgemmSerial where neither a is not transposed and b is -func dgemmSerialNotTrans(m, n, k int, a []float64, lda int, b []float64, ldb int, c []float64, ldc int, alpha float64) { - // This style is used instead of the literal [i*stride +j]) is used because - // approximately 5 times faster as of go 1.3. - for i := 0; i < m; i++ { - atmp := a[i*lda : i*lda+k] - ctmp := c[i*ldc : i*ldc+n] - for j := 0; j < n; j++ { - ctmp[j] += alpha * f64.DotUnitary(atmp, b[j*ldb:j*ldb+k]) - } - } -} - -// dgemmSerial where both are transposed -func dgemmSerialTransTrans(m, n, k int, a []float64, lda int, b []float64, ldb int, c []float64, ldc int, alpha float64) { - // This style is used instead of the literal [i*stride +j]) is used because - // approximately 5 times faster as of go 1.3. - for l := 0; l < k; l++ { - for i, v := range a[l*lda : l*lda+m] { - tmp := alpha * v - if tmp != 0 { - ctmp := c[i*ldc : i*ldc+n] - f64.AxpyInc(tmp, b[l:], ctmp, uintptr(n), uintptr(ldb), 1, 0, 0) - } - } - } -} - -func sliceView64(a []float64, lda, i, j, r, c int) []float64 { - return a[i*lda+j : (i+r-1)*lda+j+c] -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/doc.go b/vendor/gonum.org/v1/gonum/blas/gonum/doc.go deleted file mode 100644 index 3f4b6c1..0000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/doc.go +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Ensure changes made to blas/native are reflected in blas/cgo where relevant. - -/* -Package gonum is a Go implementation of the BLAS API. This implementation -panics when the input arguments are invalid as per the standard, for example -if a vector increment is zero. Note that the treatment of NaN values -is not specified, and differs among the BLAS implementations. -gonum.org/v1/gonum/blas/blas64 provides helpful wrapper functions to the BLAS -interface. The rest of this text describes the layout of the data for the input types. - -Note that in the function documentation, x[i] refers to the i^th element -of the vector, which will be different from the i^th element of the slice if -incX != 1. - -See http://www.netlib.org/lapack/explore-html/d4/de1/_l_i_c_e_n_s_e_source.html -for more license information. - -Vector arguments are effectively strided slices. They have two input arguments, -a number of elements, n, and an increment, incX. The increment specifies the -distance between elements of the vector. The actual Go slice may be longer -than necessary. -The increment may be positive or negative, except in functions with only -a single vector argument where the increment may only be positive. If the increment -is negative, s[0] is the last element in the slice. Note that this is not the same -as counting backward from the end of the slice, as len(s) may be longer than -necessary. So, for example, if n = 5 and incX = 3, the elements of s are - [0 * * 1 * * 2 * * 3 * * 4 * * * ...] -where ∗ elements are never accessed. If incX = -3, the same elements are -accessed, just in reverse order (4, 3, 2, 1, 0). - -Dense matrices are specified by a number of rows, a number of columns, and a stride. -The stride specifies the number of entries in the slice between the first element -of successive rows. The stride must be at least as large as the number of columns -but may be longer. - [a00 ... a0n a0* ... a1stride-1 a21 ... amn am* ... amstride-1] -Thus, dense[i*ld + j] refers to the {i, j}th element of the matrix. - -Symmetric and triangular matrices (non-packed) are stored identically to Dense, -except that only elements in one triangle of the matrix are accessed. - -Packed symmetric and packed triangular matrices are laid out with the entries -condensed such that all of the unreferenced elements are removed. So, the upper triangular -matrix - [ - 1 2 3 - 0 4 5 - 0 0 6 - ] -and the lower-triangular matrix - [ - 1 0 0 - 2 3 0 - 4 5 6 - ] -will both be compacted as [1 2 3 4 5 6]. The (i, j) element of the original -dense matrix can be found at element i*n - (i-1)*i/2 + j for upper triangular, -and at element i * (i+1) /2 + j for lower triangular. - -Banded matrices are laid out in a compact format, constructed by removing the -zeros in the rows and aligning the diagonals. For example, the matrix - [ - 1 2 3 0 0 0 - 4 5 6 7 0 0 - 0 8 9 10 11 0 - 0 0 12 13 14 15 - 0 0 0 16 17 18 - 0 0 0 0 19 20 - ] - -implicitly becomes (∗ entries are never accessed) - [ - * 1 2 3 - 4 5 6 7 - 8 9 10 11 - 12 13 14 15 - 16 17 18 * - 19 20 * * - ] -which is given to the BLAS routine as [∗ 1 2 3 4 ...]. - -See http://www.crest.iu.edu/research/mtl/reference/html/banded.html -for more information -*/ -package gonum // import "gonum.org/v1/gonum/blas/gonum" diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/errors.go b/vendor/gonum.org/v1/gonum/blas/gonum/errors.go deleted file mode 100644 index e98575d..0000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/errors.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -// Panic strings used during parameter checks. -// This list is duplicated in netlib/blas/netlib. Keep in sync. -const ( - zeroIncX = "blas: zero x index increment" - zeroIncY = "blas: zero y index increment" - - mLT0 = "blas: m < 0" - nLT0 = "blas: n < 0" - kLT0 = "blas: k < 0" - kLLT0 = "blas: kL < 0" - kULT0 = "blas: kU < 0" - - badUplo = "blas: illegal triangle" - badTranspose = "blas: illegal transpose" - badDiag = "blas: illegal diagonal" - badSide = "blas: illegal side" - badFlag = "blas: illegal rotm flag" - - badLdA = "blas: bad leading dimension of A" - badLdB = "blas: bad leading dimension of B" - badLdC = "blas: bad leading dimension of C" - - shortX = "blas: insufficient length of x" - shortY = "blas: insufficient length of y" - shortAP = "blas: insufficient length of ap" - shortA = "blas: insufficient length of a" - shortB = "blas: insufficient length of b" - shortC = "blas: insufficient length of c" -) diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/gemv.go b/vendor/gonum.org/v1/gonum/blas/gonum/gemv.go deleted file mode 100644 index 8bc3bf6..0000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/gemv.go +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright ©2018 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/f32" - "gonum.org/v1/gonum/internal/asm/f64" -) - -// TODO(Kunde21): Merge these methods back into level2double/level2single when Sgemv assembly kernels are merged into f32. - -// Dgemv computes -// y = alpha * A * x + beta * y if tA = blas.NoTrans -// y = alpha * Aᵀ * x + beta * y if tA = blas.Trans or blas.ConjTrans -// where A is an m×n dense matrix, x and y are vectors, and alpha and beta are scalars. -func (Implementation) Dgemv(tA blas.Transpose, m, n int, alpha float64, a []float64, lda int, x []float64, incX int, beta float64, y []float64, incY int) { - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - // Set up indexes - lenX := m - lenY := n - if tA == blas.NoTrans { - lenX = n - lenY = m - } - - // Quick return if possible - if m == 0 || n == 0 { - return - } - - if (incX > 0 && (lenX-1)*incX >= len(x)) || (incX < 0 && (1-lenX)*incX >= len(x)) { - panic(shortX) - } - if (incY > 0 && (lenY-1)*incY >= len(y)) || (incY < 0 && (1-lenY)*incY >= len(y)) { - panic(shortY) - } - if len(a) < lda*(m-1)+n { - panic(shortA) - } - - // Quick return if possible - if alpha == 0 && beta == 1 { - return - } - - if alpha == 0 { - // First form y = beta * y - if incY > 0 { - Implementation{}.Dscal(lenY, beta, y, incY) - } else { - Implementation{}.Dscal(lenY, beta, y, -incY) - } - return - } - - // Form y = alpha * A * x + y - if tA == blas.NoTrans { - f64.GemvN(uintptr(m), uintptr(n), alpha, a, uintptr(lda), x, uintptr(incX), beta, y, uintptr(incY)) - return - } - // Cases where a is transposed. - f64.GemvT(uintptr(m), uintptr(n), alpha, a, uintptr(lda), x, uintptr(incX), beta, y, uintptr(incY)) -} - -// Sgemv computes -// y = alpha * A * x + beta * y if tA = blas.NoTrans -// y = alpha * Aᵀ * x + beta * y if tA = blas.Trans or blas.ConjTrans -// where A is an m×n dense matrix, x and y are vectors, and alpha and beta are scalars. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Sgemv(tA blas.Transpose, m, n int, alpha float32, a []float32, lda int, x []float32, incX int, beta float32, y []float32, incY int) { - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // Set up indexes - lenX := m - lenY := n - if tA == blas.NoTrans { - lenX = n - lenY = m - } - if (incX > 0 && (lenX-1)*incX >= len(x)) || (incX < 0 && (1-lenX)*incX >= len(x)) { - panic(shortX) - } - if (incY > 0 && (lenY-1)*incY >= len(y)) || (incY < 0 && (1-lenY)*incY >= len(y)) { - panic(shortY) - } - if len(a) < lda*(m-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - // First form y = beta * y - if incY > 0 { - Implementation{}.Sscal(lenY, beta, y, incY) - } else { - Implementation{}.Sscal(lenY, beta, y, -incY) - } - - if alpha == 0 { - return - } - - var kx, ky int - if incX < 0 { - kx = -(lenX - 1) * incX - } - if incY < 0 { - ky = -(lenY - 1) * incY - } - - // Form y = alpha * A * x + y - if tA == blas.NoTrans { - if incX == 1 && incY == 1 { - for i := 0; i < m; i++ { - y[i] += alpha * f32.DotUnitary(a[lda*i:lda*i+n], x[:n]) - } - return - } - iy := ky - for i := 0; i < m; i++ { - y[iy] += alpha * f32.DotInc(x, a[lda*i:lda*i+n], uintptr(n), uintptr(incX), 1, uintptr(kx), 0) - iy += incY - } - return - } - // Cases where a is transposed. - if incX == 1 && incY == 1 { - for i := 0; i < m; i++ { - tmp := alpha * x[i] - if tmp != 0 { - f32.AxpyUnitaryTo(y, tmp, a[lda*i:lda*i+n], y[:n]) - } - } - return - } - ix := kx - for i := 0; i < m; i++ { - tmp := alpha * x[ix] - if tmp != 0 { - f32.AxpyInc(tmp, a[lda*i:lda*i+n], y, uintptr(n), 1, uintptr(incY), 0, uintptr(ky)) - } - ix += incX - } -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/gonum.go b/vendor/gonum.org/v1/gonum/blas/gonum/gonum.go deleted file mode 100644 index 8ab8d43..0000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/gonum.go +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:generate ./single_precision.bash - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/internal/math32" -) - -type Implementation struct{} - -// [SD]gemm behavior constants. These are kept here to keep them out of the -// way during single precision code genration. -const ( - blockSize = 64 // b x b matrix - minParBlock = 4 // minimum number of blocks needed to go parallel - buffMul = 4 // how big is the buffer relative to the number of workers -) - -// subMul is a common type shared by [SD]gemm. -type subMul struct { - i, j int // index of block -} - -func max(a, b int) int { - if a > b { - return a - } - return b -} - -func min(a, b int) int { - if a > b { - return b - } - return a -} - -// blocks returns the number of divisions of the dimension length with the given -// block size. -func blocks(dim, bsize int) int { - return (dim + bsize - 1) / bsize -} - -// dcabs1 returns |real(z)|+|imag(z)|. -func dcabs1(z complex128) float64 { - return math.Abs(real(z)) + math.Abs(imag(z)) -} - -// scabs1 returns |real(z)|+|imag(z)|. -func scabs1(z complex64) float32 { - return math32.Abs(real(z)) + math32.Abs(imag(z)) -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level1cmplx128.go b/vendor/gonum.org/v1/gonum/blas/gonum/level1cmplx128.go deleted file mode 100644 index a207db4..0000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level1cmplx128.go +++ /dev/null @@ -1,445 +0,0 @@ -// Copyright ©2017 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/c128" -) - -var _ blas.Complex128Level1 = Implementation{} - -// Dzasum returns the sum of the absolute values of the elements of x -// \sum_i |Re(x[i])| + |Im(x[i])| -// Dzasum returns 0 if incX is negative. -func (Implementation) Dzasum(n int, x []complex128, incX int) float64 { - if n < 0 { - panic(nLT0) - } - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return 0 - } - var sum float64 - if incX == 1 { - if len(x) < n { - panic(shortX) - } - for _, v := range x[:n] { - sum += dcabs1(v) - } - return sum - } - if (n-1)*incX >= len(x) { - panic(shortX) - } - for i := 0; i < n; i++ { - v := x[i*incX] - sum += dcabs1(v) - } - return sum -} - -// Dznrm2 computes the Euclidean norm of the complex vector x, -// ‖x‖_2 = sqrt(\sum_i x[i] * conj(x[i])). -// This function returns 0 if incX is negative. -func (Implementation) Dznrm2(n int, x []complex128, incX int) float64 { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return 0 - } - if n < 1 { - if n == 0 { - return 0 - } - panic(nLT0) - } - if (n-1)*incX >= len(x) { - panic(shortX) - } - var ( - scale float64 - ssq float64 = 1 - ) - if incX == 1 { - for _, v := range x[:n] { - re, im := math.Abs(real(v)), math.Abs(imag(v)) - if re != 0 { - if re > scale { - ssq = 1 + ssq*(scale/re)*(scale/re) - scale = re - } else { - ssq += (re / scale) * (re / scale) - } - } - if im != 0 { - if im > scale { - ssq = 1 + ssq*(scale/im)*(scale/im) - scale = im - } else { - ssq += (im / scale) * (im / scale) - } - } - } - if math.IsInf(scale, 1) { - return math.Inf(1) - } - return scale * math.Sqrt(ssq) - } - for ix := 0; ix < n*incX; ix += incX { - re, im := math.Abs(real(x[ix])), math.Abs(imag(x[ix])) - if re != 0 { - if re > scale { - ssq = 1 + ssq*(scale/re)*(scale/re) - scale = re - } else { - ssq += (re / scale) * (re / scale) - } - } - if im != 0 { - if im > scale { - ssq = 1 + ssq*(scale/im)*(scale/im) - scale = im - } else { - ssq += (im / scale) * (im / scale) - } - } - } - if math.IsInf(scale, 1) { - return math.Inf(1) - } - return scale * math.Sqrt(ssq) -} - -// Izamax returns the index of the first element of x having largest |Re(·)|+|Im(·)|. -// Izamax returns -1 if n is 0 or incX is negative. -func (Implementation) Izamax(n int, x []complex128, incX int) int { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - // Return invalid index. - return -1 - } - if n < 1 { - if n == 0 { - // Return invalid index. - return -1 - } - panic(nLT0) - } - if len(x) <= (n-1)*incX { - panic(shortX) - } - idx := 0 - max := dcabs1(x[0]) - if incX == 1 { - for i, v := range x[1:n] { - absV := dcabs1(v) - if absV > max { - max = absV - idx = i + 1 - } - } - return idx - } - ix := incX - for i := 1; i < n; i++ { - absV := dcabs1(x[ix]) - if absV > max { - max = absV - idx = i - } - ix += incX - } - return idx -} - -// Zaxpy adds alpha times x to y: -// y[i] += alpha * x[i] for all i -func (Implementation) Zaxpy(n int, alpha complex128, x []complex128, incX int, y []complex128, incY int) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic(shortX) - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic(shortY) - } - if alpha == 0 { - return - } - if incX == 1 && incY == 1 { - c128.AxpyUnitary(alpha, x[:n], y[:n]) - return - } - var ix, iy int - if incX < 0 { - ix = (1 - n) * incX - } - if incY < 0 { - iy = (1 - n) * incY - } - c128.AxpyInc(alpha, x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy)) -} - -// Zcopy copies the vector x to vector y. -func (Implementation) Zcopy(n int, x []complex128, incX int, y []complex128, incY int) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic(shortX) - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic(shortY) - } - if incX == 1 && incY == 1 { - copy(y[:n], x[:n]) - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - y[iy] = x[ix] - ix += incX - iy += incY - } -} - -// Zdotc computes the dot product -// xᴴ · y -// of two complex vectors x and y. -func (Implementation) Zdotc(n int, x []complex128, incX int, y []complex128, incY int) complex128 { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n <= 0 { - if n == 0 { - return 0 - } - panic(nLT0) - } - if incX == 1 && incY == 1 { - if len(x) < n { - panic(shortX) - } - if len(y) < n { - panic(shortY) - } - return c128.DotcUnitary(x[:n], y[:n]) - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - if ix >= len(x) || (n-1)*incX >= len(x) { - panic(shortX) - } - if iy >= len(y) || (n-1)*incY >= len(y) { - panic(shortY) - } - return c128.DotcInc(x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy)) -} - -// Zdotu computes the dot product -// xᵀ · y -// of two complex vectors x and y. -func (Implementation) Zdotu(n int, x []complex128, incX int, y []complex128, incY int) complex128 { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n <= 0 { - if n == 0 { - return 0 - } - panic(nLT0) - } - if incX == 1 && incY == 1 { - if len(x) < n { - panic(shortX) - } - if len(y) < n { - panic(shortY) - } - return c128.DotuUnitary(x[:n], y[:n]) - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - if ix >= len(x) || (n-1)*incX >= len(x) { - panic(shortX) - } - if iy >= len(y) || (n-1)*incY >= len(y) { - panic(shortY) - } - return c128.DotuInc(x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy)) -} - -// Zdscal scales the vector x by a real scalar alpha. -// Zdscal has no effect if incX < 0. -func (Implementation) Zdscal(n int, alpha float64, x []complex128, incX int) { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return - } - if (n-1)*incX >= len(x) { - panic(shortX) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if alpha == 0 { - if incX == 1 { - x = x[:n] - for i := range x { - x[i] = 0 - } - return - } - for ix := 0; ix < n*incX; ix += incX { - x[ix] = 0 - } - return - } - if incX == 1 { - x = x[:n] - for i, v := range x { - x[i] = complex(alpha*real(v), alpha*imag(v)) - } - return - } - for ix := 0; ix < n*incX; ix += incX { - v := x[ix] - x[ix] = complex(alpha*real(v), alpha*imag(v)) - } -} - -// Zscal scales the vector x by a complex scalar alpha. -// Zscal has no effect if incX < 0. -func (Implementation) Zscal(n int, alpha complex128, x []complex128, incX int) { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return - } - if (n-1)*incX >= len(x) { - panic(shortX) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if alpha == 0 { - if incX == 1 { - x = x[:n] - for i := range x { - x[i] = 0 - } - return - } - for ix := 0; ix < n*incX; ix += incX { - x[ix] = 0 - } - return - } - if incX == 1 { - c128.ScalUnitary(alpha, x[:n]) - return - } - c128.ScalInc(alpha, x, uintptr(n), uintptr(incX)) -} - -// Zswap exchanges the elements of two complex vectors x and y. -func (Implementation) Zswap(n int, x []complex128, incX int, y []complex128, incY int) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic(shortX) - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic(shortY) - } - if incX == 1 && incY == 1 { - x = x[:n] - for i, v := range x { - x[i], y[i] = y[i], v - } - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - x[ix], y[iy] = y[iy], x[ix] - ix += incX - iy += incY - } -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level1cmplx64.go b/vendor/gonum.org/v1/gonum/blas/gonum/level1cmplx64.go deleted file mode 100644 index 018bae2..0000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level1cmplx64.go +++ /dev/null @@ -1,467 +0,0 @@ -// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT. - -// Copyright ©2017 The Gonum 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 gonum - -import ( - math "gonum.org/v1/gonum/internal/math32" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/c64" -) - -var _ blas.Complex64Level1 = Implementation{} - -// Scasum returns the sum of the absolute values of the elements of x -// \sum_i |Re(x[i])| + |Im(x[i])| -// Scasum returns 0 if incX is negative. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Scasum(n int, x []complex64, incX int) float32 { - if n < 0 { - panic(nLT0) - } - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return 0 - } - var sum float32 - if incX == 1 { - if len(x) < n { - panic(shortX) - } - for _, v := range x[:n] { - sum += scabs1(v) - } - return sum - } - if (n-1)*incX >= len(x) { - panic(shortX) - } - for i := 0; i < n; i++ { - v := x[i*incX] - sum += scabs1(v) - } - return sum -} - -// Scnrm2 computes the Euclidean norm of the complex vector x, -// ‖x‖_2 = sqrt(\sum_i x[i] * conj(x[i])). -// This function returns 0 if incX is negative. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Scnrm2(n int, x []complex64, incX int) float32 { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return 0 - } - if n < 1 { - if n == 0 { - return 0 - } - panic(nLT0) - } - if (n-1)*incX >= len(x) { - panic(shortX) - } - var ( - scale float32 - ssq float32 = 1 - ) - if incX == 1 { - for _, v := range x[:n] { - re, im := math.Abs(real(v)), math.Abs(imag(v)) - if re != 0 { - if re > scale { - ssq = 1 + ssq*(scale/re)*(scale/re) - scale = re - } else { - ssq += (re / scale) * (re / scale) - } - } - if im != 0 { - if im > scale { - ssq = 1 + ssq*(scale/im)*(scale/im) - scale = im - } else { - ssq += (im / scale) * (im / scale) - } - } - } - if math.IsInf(scale, 1) { - return math.Inf(1) - } - return scale * math.Sqrt(ssq) - } - for ix := 0; ix < n*incX; ix += incX { - re, im := math.Abs(real(x[ix])), math.Abs(imag(x[ix])) - if re != 0 { - if re > scale { - ssq = 1 + ssq*(scale/re)*(scale/re) - scale = re - } else { - ssq += (re / scale) * (re / scale) - } - } - if im != 0 { - if im > scale { - ssq = 1 + ssq*(scale/im)*(scale/im) - scale = im - } else { - ssq += (im / scale) * (im / scale) - } - } - } - if math.IsInf(scale, 1) { - return math.Inf(1) - } - return scale * math.Sqrt(ssq) -} - -// Icamax returns the index of the first element of x having largest |Re(·)|+|Im(·)|. -// Icamax returns -1 if n is 0 or incX is negative. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Icamax(n int, x []complex64, incX int) int { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - // Return invalid index. - return -1 - } - if n < 1 { - if n == 0 { - // Return invalid index. - return -1 - } - panic(nLT0) - } - if len(x) <= (n-1)*incX { - panic(shortX) - } - idx := 0 - max := scabs1(x[0]) - if incX == 1 { - for i, v := range x[1:n] { - absV := scabs1(v) - if absV > max { - max = absV - idx = i + 1 - } - } - return idx - } - ix := incX - for i := 1; i < n; i++ { - absV := scabs1(x[ix]) - if absV > max { - max = absV - idx = i - } - ix += incX - } - return idx -} - -// Caxpy adds alpha times x to y: -// y[i] += alpha * x[i] for all i -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Caxpy(n int, alpha complex64, x []complex64, incX int, y []complex64, incY int) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic(shortX) - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic(shortY) - } - if alpha == 0 { - return - } - if incX == 1 && incY == 1 { - c64.AxpyUnitary(alpha, x[:n], y[:n]) - return - } - var ix, iy int - if incX < 0 { - ix = (1 - n) * incX - } - if incY < 0 { - iy = (1 - n) * incY - } - c64.AxpyInc(alpha, x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy)) -} - -// Ccopy copies the vector x to vector y. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Ccopy(n int, x []complex64, incX int, y []complex64, incY int) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic(shortX) - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic(shortY) - } - if incX == 1 && incY == 1 { - copy(y[:n], x[:n]) - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - y[iy] = x[ix] - ix += incX - iy += incY - } -} - -// Cdotc computes the dot product -// xᴴ · y -// of two complex vectors x and y. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Cdotc(n int, x []complex64, incX int, y []complex64, incY int) complex64 { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n <= 0 { - if n == 0 { - return 0 - } - panic(nLT0) - } - if incX == 1 && incY == 1 { - if len(x) < n { - panic(shortX) - } - if len(y) < n { - panic(shortY) - } - return c64.DotcUnitary(x[:n], y[:n]) - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - if ix >= len(x) || (n-1)*incX >= len(x) { - panic(shortX) - } - if iy >= len(y) || (n-1)*incY >= len(y) { - panic(shortY) - } - return c64.DotcInc(x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy)) -} - -// Cdotu computes the dot product -// xᵀ · y -// of two complex vectors x and y. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Cdotu(n int, x []complex64, incX int, y []complex64, incY int) complex64 { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n <= 0 { - if n == 0 { - return 0 - } - panic(nLT0) - } - if incX == 1 && incY == 1 { - if len(x) < n { - panic(shortX) - } - if len(y) < n { - panic(shortY) - } - return c64.DotuUnitary(x[:n], y[:n]) - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - if ix >= len(x) || (n-1)*incX >= len(x) { - panic(shortX) - } - if iy >= len(y) || (n-1)*incY >= len(y) { - panic(shortY) - } - return c64.DotuInc(x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy)) -} - -// Csscal scales the vector x by a real scalar alpha. -// Csscal has no effect if incX < 0. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Csscal(n int, alpha float32, x []complex64, incX int) { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return - } - if (n-1)*incX >= len(x) { - panic(shortX) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if alpha == 0 { - if incX == 1 { - x = x[:n] - for i := range x { - x[i] = 0 - } - return - } - for ix := 0; ix < n*incX; ix += incX { - x[ix] = 0 - } - return - } - if incX == 1 { - x = x[:n] - for i, v := range x { - x[i] = complex(alpha*real(v), alpha*imag(v)) - } - return - } - for ix := 0; ix < n*incX; ix += incX { - v := x[ix] - x[ix] = complex(alpha*real(v), alpha*imag(v)) - } -} - -// Cscal scales the vector x by a complex scalar alpha. -// Cscal has no effect if incX < 0. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Cscal(n int, alpha complex64, x []complex64, incX int) { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return - } - if (n-1)*incX >= len(x) { - panic(shortX) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if alpha == 0 { - if incX == 1 { - x = x[:n] - for i := range x { - x[i] = 0 - } - return - } - for ix := 0; ix < n*incX; ix += incX { - x[ix] = 0 - } - return - } - if incX == 1 { - c64.ScalUnitary(alpha, x[:n]) - return - } - c64.ScalInc(alpha, x, uintptr(n), uintptr(incX)) -} - -// Cswap exchanges the elements of two complex vectors x and y. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Cswap(n int, x []complex64, incX int, y []complex64, incY int) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic(shortX) - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic(shortY) - } - if incX == 1 && incY == 1 { - x = x[:n] - for i, v := range x { - x[i], y[i] = y[i], v - } - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - x[ix], y[iy] = y[iy], x[ix] - ix += incX - iy += incY - } -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level1float32.go b/vendor/gonum.org/v1/gonum/blas/gonum/level1float32.go deleted file mode 100644 index c1648fb..0000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level1float32.go +++ /dev/null @@ -1,602 +0,0 @@ -// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT. - -// Copyright ©2015 The Gonum 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 gonum - -import ( - math "gonum.org/v1/gonum/internal/math32" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/f32" -) - -var _ blas.Float32Level1 = Implementation{} - -// Snrm2 computes the Euclidean norm of a vector, -// sqrt(\sum_i x[i] * x[i]). -// This function returns 0 if incX is negative. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Snrm2(n int, x []float32, incX int) float32 { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return 0 - } - if len(x) <= (n-1)*incX { - panic(shortX) - } - if n < 2 { - if n == 1 { - return math.Abs(x[0]) - } - if n == 0 { - return 0 - } - panic(nLT0) - } - if incX == 1 { - return f32.L2NormUnitary(x[:n]) - } - return f32.L2NormInc(x, uintptr(n), uintptr(incX)) -} - -// Sasum computes the sum of the absolute values of the elements of x. -// \sum_i |x[i]| -// Sasum returns 0 if incX is negative. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Sasum(n int, x []float32, incX int) float32 { - var sum float32 - if n < 0 { - panic(nLT0) - } - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return 0 - } - if len(x) <= (n-1)*incX { - panic(shortX) - } - if incX == 1 { - x = x[:n] - for _, v := range x { - sum += math.Abs(v) - } - return sum - } - for i := 0; i < n; i++ { - sum += math.Abs(x[i*incX]) - } - return sum -} - -// Isamax returns the index of an element of x with the largest absolute value. -// If there are multiple such indices the earliest is returned. -// Isamax returns -1 if n == 0. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Isamax(n int, x []float32, incX int) int { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return -1 - } - if len(x) <= (n-1)*incX { - panic(shortX) - } - if n < 2 { - if n == 1 { - return 0 - } - if n == 0 { - return -1 // Netlib returns invalid index when n == 0. - } - panic(nLT0) - } - idx := 0 - max := math.Abs(x[0]) - if incX == 1 { - for i, v := range x[:n] { - absV := math.Abs(v) - if absV > max { - max = absV - idx = i - } - } - return idx - } - ix := incX - for i := 1; i < n; i++ { - v := x[ix] - absV := math.Abs(v) - if absV > max { - max = absV - idx = i - } - ix += incX - } - return idx -} - -// Sswap exchanges the elements of two vectors. -// x[i], y[i] = y[i], x[i] for all i -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Sswap(n int, x []float32, incX int, y []float32, incY int) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if incX == 1 && incY == 1 { - x = x[:n] - for i, v := range x { - x[i], y[i] = y[i], v - } - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - x[ix], y[iy] = y[iy], x[ix] - ix += incX - iy += incY - } -} - -// Scopy copies the elements of x into the elements of y. -// y[i] = x[i] for all i -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Scopy(n int, x []float32, incX int, y []float32, incY int) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if incX == 1 && incY == 1 { - copy(y[:n], x[:n]) - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - y[iy] = x[ix] - ix += incX - iy += incY - } -} - -// Saxpy adds alpha times x to y -// y[i] += alpha * x[i] for all i -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Saxpy(n int, alpha float32, x []float32, incX int, y []float32, incY int) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if alpha == 0 { - return - } - if incX == 1 && incY == 1 { - f32.AxpyUnitary(alpha, x[:n], y[:n]) - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - f32.AxpyInc(alpha, x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy)) -} - -// Srotg computes the plane rotation -// _ _ _ _ _ _ -// | c s | | a | | r | -// | -s c | * | b | = | 0 | -// ‾ ‾ ‾ ‾ ‾ ‾ -// where -// r = ±√(a^2 + b^2) -// c = a/r, the cosine of the plane rotation -// s = b/r, the sine of the plane rotation -// -// NOTE: There is a discrepancy between the reference implementation and the BLAS -// technical manual regarding the sign for r when a or b are zero. -// Srotg agrees with the definition in the manual and other -// common BLAS implementations. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Srotg(a, b float32) (c, s, r, z float32) { - if b == 0 && a == 0 { - return 1, 0, a, 0 - } - absA := math.Abs(a) - absB := math.Abs(b) - aGTb := absA > absB - r = math.Hypot(a, b) - if aGTb { - r = math.Copysign(r, a) - } else { - r = math.Copysign(r, b) - } - c = a / r - s = b / r - if aGTb { - z = s - } else if c != 0 { // r == 0 case handled above - z = 1 / c - } else { - z = 1 - } - return -} - -// Srotmg computes the modified Givens rotation. See -// http://www.netlib.org/lapack/explore-html/df/deb/drotmg_8f.html -// for more details. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Srotmg(d1, d2, x1, y1 float32) (p blas.SrotmParams, rd1, rd2, rx1 float32) { - // The implementation of Drotmg used here is taken from Hopkins 1997 - // Appendix A: https://doi.org/10.1145/289251.289253 - // with the exception of the gam constants below. - - const ( - gam = 4096.0 - gamsq = gam * gam - rgamsq = 1.0 / gamsq - ) - - if d1 < 0 { - p.Flag = blas.Rescaling // Error state. - return p, 0, 0, 0 - } - - if d2 == 0 || y1 == 0 { - p.Flag = blas.Identity - return p, d1, d2, x1 - } - - var h11, h12, h21, h22 float32 - if (d1 == 0 || x1 == 0) && d2 > 0 { - p.Flag = blas.Diagonal - h12 = 1 - h21 = -1 - x1 = y1 - d1, d2 = d2, d1 - } else { - p2 := d2 * y1 - p1 := d1 * x1 - q2 := p2 * y1 - q1 := p1 * x1 - if math.Abs(q1) > math.Abs(q2) { - p.Flag = blas.OffDiagonal - h11 = 1 - h22 = 1 - h21 = -y1 / x1 - h12 = p2 / p1 - u := 1 - float32(h12*h21) - if u <= 0 { - p.Flag = blas.Rescaling // Error state. - return p, 0, 0, 0 - } - - d1 /= u - d2 /= u - x1 *= u - } else { - if q2 < 0 { - p.Flag = blas.Rescaling // Error state. - return p, 0, 0, 0 - } - - p.Flag = blas.Diagonal - h21 = -1 - h12 = 1 - h11 = p1 / p2 - h22 = x1 / y1 - u := 1 + float32(h11*h22) - d1, d2 = d2/u, d1/u - x1 = y1 * u - } - } - - for d1 <= rgamsq && d1 != 0 { - p.Flag = blas.Rescaling - d1 = (d1 * gam) * gam - x1 /= gam - h11 /= gam - h12 /= gam - } - for d1 > gamsq { - p.Flag = blas.Rescaling - d1 = (d1 / gam) / gam - x1 *= gam - h11 *= gam - h12 *= gam - } - - for math.Abs(d2) <= rgamsq && d2 != 0 { - p.Flag = blas.Rescaling - d2 = (d2 * gam) * gam - h21 /= gam - h22 /= gam - } - for math.Abs(d2) > gamsq { - p.Flag = blas.Rescaling - d2 = (d2 / gam) / gam - h21 *= gam - h22 *= gam - } - - switch p.Flag { - case blas.Diagonal: - p.H = [4]float32{0: h11, 3: h22} - case blas.OffDiagonal: - p.H = [4]float32{1: h21, 2: h12} - case blas.Rescaling: - p.H = [4]float32{h11, h21, h12, h22} - default: - panic(badFlag) - } - - return p, d1, d2, x1 -} - -// Srot applies a plane transformation. -// x[i] = c * x[i] + s * y[i] -// y[i] = c * y[i] - s * x[i] -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Srot(n int, x []float32, incX int, y []float32, incY int, c float32, s float32) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if incX == 1 && incY == 1 { - x = x[:n] - for i, vx := range x { - vy := y[i] - x[i], y[i] = c*vx+s*vy, c*vy-s*vx - } - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - vx := x[ix] - vy := y[iy] - x[ix], y[iy] = c*vx+s*vy, c*vy-s*vx - ix += incX - iy += incY - } -} - -// Srotm applies the modified Givens rotation to the 2×n matrix. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Srotm(n int, x []float32, incX int, y []float32, incY int, p blas.SrotmParams) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n <= 0 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - if p.Flag == blas.Identity { - return - } - - switch p.Flag { - case blas.Rescaling: - h11 := p.H[0] - h12 := p.H[2] - h21 := p.H[1] - h22 := p.H[3] - if incX == 1 && incY == 1 { - x = x[:n] - for i, vx := range x { - vy := y[i] - x[i], y[i] = float32(vx*h11)+float32(vy*h12), float32(vx*h21)+float32(vy*h22) - } - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - vx := x[ix] - vy := y[iy] - x[ix], y[iy] = float32(vx*h11)+float32(vy*h12), float32(vx*h21)+float32(vy*h22) - ix += incX - iy += incY - } - case blas.OffDiagonal: - h12 := p.H[2] - h21 := p.H[1] - if incX == 1 && incY == 1 { - x = x[:n] - for i, vx := range x { - vy := y[i] - x[i], y[i] = vx+float32(vy*h12), float32(vx*h21)+vy - } - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - vx := x[ix] - vy := y[iy] - x[ix], y[iy] = vx+float32(vy*h12), float32(vx*h21)+vy - ix += incX - iy += incY - } - case blas.Diagonal: - h11 := p.H[0] - h22 := p.H[3] - if incX == 1 && incY == 1 { - x = x[:n] - for i, vx := range x { - vy := y[i] - x[i], y[i] = float32(vx*h11)+vy, -vx+float32(vy*h22) - } - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - vx := x[ix] - vy := y[iy] - x[ix], y[iy] = float32(vx*h11)+vy, -vx+float32(vy*h22) - ix += incX - iy += incY - } - } -} - -// Sscal scales x by alpha. -// x[i] *= alpha -// Sscal has no effect if incX < 0. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Sscal(n int, alpha float32, x []float32, incX int) { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (n-1)*incX >= len(x) { - panic(shortX) - } - if alpha == 0 { - if incX == 1 { - x = x[:n] - for i := range x { - x[i] = 0 - } - return - } - for ix := 0; ix < n*incX; ix += incX { - x[ix] = 0 - } - return - } - if incX == 1 { - f32.ScalUnitary(alpha, x[:n]) - return - } - f32.ScalInc(alpha, x, uintptr(n), uintptr(incX)) -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level1float32_dsdot.go b/vendor/gonum.org/v1/gonum/blas/gonum/level1float32_dsdot.go deleted file mode 100644 index 089e0d8..0000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level1float32_dsdot.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT. - -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/internal/asm/f32" -) - -// Dsdot computes the dot product of the two vectors -// \sum_i x[i]*y[i] -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Dsdot(n int, x []float32, incX int, y []float32, incY int) float64 { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n <= 0 { - if n == 0 { - return 0 - } - panic(nLT0) - } - if incX == 1 && incY == 1 { - if len(x) < n { - panic(shortX) - } - if len(y) < n { - panic(shortY) - } - return f32.DdotUnitary(x[:n], y[:n]) - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - if ix >= len(x) || ix+(n-1)*incX >= len(x) { - panic(shortX) - } - if iy >= len(y) || iy+(n-1)*incY >= len(y) { - panic(shortY) - } - return f32.DdotInc(x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy)) -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level1float32_sdot.go b/vendor/gonum.org/v1/gonum/blas/gonum/level1float32_sdot.go deleted file mode 100644 index 41c3e79..0000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level1float32_sdot.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT. - -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/internal/asm/f32" -) - -// Sdot computes the dot product of the two vectors -// \sum_i x[i]*y[i] -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Sdot(n int, x []float32, incX int, y []float32, incY int) float32 { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n <= 0 { - if n == 0 { - return 0 - } - panic(nLT0) - } - if incX == 1 && incY == 1 { - if len(x) < n { - panic(shortX) - } - if len(y) < n { - panic(shortY) - } - return f32.DotUnitary(x[:n], y[:n]) - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - if ix >= len(x) || ix+(n-1)*incX >= len(x) { - panic(shortX) - } - if iy >= len(y) || iy+(n-1)*incY >= len(y) { - panic(shortY) - } - return f32.DotInc(x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy)) -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level1float32_sdsdot.go b/vendor/gonum.org/v1/gonum/blas/gonum/level1float32_sdsdot.go deleted file mode 100644 index 69dd8aa..0000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level1float32_sdsdot.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT. - -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/internal/asm/f32" -) - -// Sdsdot computes the dot product of the two vectors plus a constant -// alpha + \sum_i x[i]*y[i] -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Sdsdot(n int, alpha float32, x []float32, incX int, y []float32, incY int) float32 { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n <= 0 { - if n == 0 { - return 0 - } - panic(nLT0) - } - if incX == 1 && incY == 1 { - if len(x) < n { - panic(shortX) - } - if len(y) < n { - panic(shortY) - } - return alpha + float32(f32.DdotUnitary(x[:n], y[:n])) - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - if ix >= len(x) || ix+(n-1)*incX >= len(x) { - panic(shortX) - } - if iy >= len(y) || iy+(n-1)*incY >= len(y) { - panic(shortY) - } - return alpha + float32(f32.DdotInc(x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy))) -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level1float64.go b/vendor/gonum.org/v1/gonum/blas/gonum/level1float64.go deleted file mode 100644 index af0afdc..0000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level1float64.go +++ /dev/null @@ -1,578 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/f64" -) - -var _ blas.Float64Level1 = Implementation{} - -// Dnrm2 computes the Euclidean norm of a vector, -// sqrt(\sum_i x[i] * x[i]). -// This function returns 0 if incX is negative. -func (Implementation) Dnrm2(n int, x []float64, incX int) float64 { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return 0 - } - if len(x) <= (n-1)*incX { - panic(shortX) - } - if n < 2 { - if n == 1 { - return math.Abs(x[0]) - } - if n == 0 { - return 0 - } - panic(nLT0) - } - if incX == 1 { - return f64.L2NormUnitary(x[:n]) - } - return f64.L2NormInc(x, uintptr(n), uintptr(incX)) -} - -// Dasum computes the sum of the absolute values of the elements of x. -// \sum_i |x[i]| -// Dasum returns 0 if incX is negative. -func (Implementation) Dasum(n int, x []float64, incX int) float64 { - var sum float64 - if n < 0 { - panic(nLT0) - } - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return 0 - } - if len(x) <= (n-1)*incX { - panic(shortX) - } - if incX == 1 { - x = x[:n] - for _, v := range x { - sum += math.Abs(v) - } - return sum - } - for i := 0; i < n; i++ { - sum += math.Abs(x[i*incX]) - } - return sum -} - -// Idamax returns the index of an element of x with the largest absolute value. -// If there are multiple such indices the earliest is returned. -// Idamax returns -1 if n == 0. -func (Implementation) Idamax(n int, x []float64, incX int) int { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return -1 - } - if len(x) <= (n-1)*incX { - panic(shortX) - } - if n < 2 { - if n == 1 { - return 0 - } - if n == 0 { - return -1 // Netlib returns invalid index when n == 0. - } - panic(nLT0) - } - idx := 0 - max := math.Abs(x[0]) - if incX == 1 { - for i, v := range x[:n] { - absV := math.Abs(v) - if absV > max { - max = absV - idx = i - } - } - return idx - } - ix := incX - for i := 1; i < n; i++ { - v := x[ix] - absV := math.Abs(v) - if absV > max { - max = absV - idx = i - } - ix += incX - } - return idx -} - -// Dswap exchanges the elements of two vectors. -// x[i], y[i] = y[i], x[i] for all i -func (Implementation) Dswap(n int, x []float64, incX int, y []float64, incY int) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if incX == 1 && incY == 1 { - x = x[:n] - for i, v := range x { - x[i], y[i] = y[i], v - } - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - x[ix], y[iy] = y[iy], x[ix] - ix += incX - iy += incY - } -} - -// Dcopy copies the elements of x into the elements of y. -// y[i] = x[i] for all i -func (Implementation) Dcopy(n int, x []float64, incX int, y []float64, incY int) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if incX == 1 && incY == 1 { - copy(y[:n], x[:n]) - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - y[iy] = x[ix] - ix += incX - iy += incY - } -} - -// Daxpy adds alpha times x to y -// y[i] += alpha * x[i] for all i -func (Implementation) Daxpy(n int, alpha float64, x []float64, incX int, y []float64, incY int) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if alpha == 0 { - return - } - if incX == 1 && incY == 1 { - f64.AxpyUnitary(alpha, x[:n], y[:n]) - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - f64.AxpyInc(alpha, x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy)) -} - -// Drotg computes the plane rotation -// _ _ _ _ _ _ -// | c s | | a | | r | -// | -s c | * | b | = | 0 | -// ‾ ‾ ‾ ‾ ‾ ‾ -// where -// r = ±√(a^2 + b^2) -// c = a/r, the cosine of the plane rotation -// s = b/r, the sine of the plane rotation -// -// NOTE: There is a discrepancy between the reference implementation and the BLAS -// technical manual regarding the sign for r when a or b are zero. -// Drotg agrees with the definition in the manual and other -// common BLAS implementations. -func (Implementation) Drotg(a, b float64) (c, s, r, z float64) { - if b == 0 && a == 0 { - return 1, 0, a, 0 - } - absA := math.Abs(a) - absB := math.Abs(b) - aGTb := absA > absB - r = math.Hypot(a, b) - if aGTb { - r = math.Copysign(r, a) - } else { - r = math.Copysign(r, b) - } - c = a / r - s = b / r - if aGTb { - z = s - } else if c != 0 { // r == 0 case handled above - z = 1 / c - } else { - z = 1 - } - return -} - -// Drotmg computes the modified Givens rotation. See -// http://www.netlib.org/lapack/explore-html/df/deb/drotmg_8f.html -// for more details. -func (Implementation) Drotmg(d1, d2, x1, y1 float64) (p blas.DrotmParams, rd1, rd2, rx1 float64) { - // The implementation of Drotmg used here is taken from Hopkins 1997 - // Appendix A: https://doi.org/10.1145/289251.289253 - // with the exception of the gam constants below. - - const ( - gam = 4096.0 - gamsq = gam * gam - rgamsq = 1.0 / gamsq - ) - - if d1 < 0 { - p.Flag = blas.Rescaling // Error state. - return p, 0, 0, 0 - } - - if d2 == 0 || y1 == 0 { - p.Flag = blas.Identity - return p, d1, d2, x1 - } - - var h11, h12, h21, h22 float64 - if (d1 == 0 || x1 == 0) && d2 > 0 { - p.Flag = blas.Diagonal - h12 = 1 - h21 = -1 - x1 = y1 - d1, d2 = d2, d1 - } else { - p2 := d2 * y1 - p1 := d1 * x1 - q2 := p2 * y1 - q1 := p1 * x1 - if math.Abs(q1) > math.Abs(q2) { - p.Flag = blas.OffDiagonal - h11 = 1 - h22 = 1 - h21 = -y1 / x1 - h12 = p2 / p1 - u := 1 - float64(h12*h21) - if u <= 0 { - p.Flag = blas.Rescaling // Error state. - return p, 0, 0, 0 - } - - d1 /= u - d2 /= u - x1 *= u - } else { - if q2 < 0 { - p.Flag = blas.Rescaling // Error state. - return p, 0, 0, 0 - } - - p.Flag = blas.Diagonal - h21 = -1 - h12 = 1 - h11 = p1 / p2 - h22 = x1 / y1 - u := 1 + float64(h11*h22) - d1, d2 = d2/u, d1/u - x1 = y1 * u - } - } - - for d1 <= rgamsq && d1 != 0 { - p.Flag = blas.Rescaling - d1 = (d1 * gam) * gam - x1 /= gam - h11 /= gam - h12 /= gam - } - for d1 > gamsq { - p.Flag = blas.Rescaling - d1 = (d1 / gam) / gam - x1 *= gam - h11 *= gam - h12 *= gam - } - - for math.Abs(d2) <= rgamsq && d2 != 0 { - p.Flag = blas.Rescaling - d2 = (d2 * gam) * gam - h21 /= gam - h22 /= gam - } - for math.Abs(d2) > gamsq { - p.Flag = blas.Rescaling - d2 = (d2 / gam) / gam - h21 *= gam - h22 *= gam - } - - switch p.Flag { - case blas.Diagonal: - p.H = [4]float64{0: h11, 3: h22} - case blas.OffDiagonal: - p.H = [4]float64{1: h21, 2: h12} - case blas.Rescaling: - p.H = [4]float64{h11, h21, h12, h22} - default: - panic(badFlag) - } - - return p, d1, d2, x1 -} - -// Drot applies a plane transformation. -// x[i] = c * x[i] + s * y[i] -// y[i] = c * y[i] - s * x[i] -func (Implementation) Drot(n int, x []float64, incX int, y []float64, incY int, c float64, s float64) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if incX == 1 && incY == 1 { - x = x[:n] - for i, vx := range x { - vy := y[i] - x[i], y[i] = c*vx+s*vy, c*vy-s*vx - } - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - vx := x[ix] - vy := y[iy] - x[ix], y[iy] = c*vx+s*vy, c*vy-s*vx - ix += incX - iy += incY - } -} - -// Drotm applies the modified Givens rotation to the 2×n matrix. -func (Implementation) Drotm(n int, x []float64, incX int, y []float64, incY int, p blas.DrotmParams) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n <= 0 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - if p.Flag == blas.Identity { - return - } - - switch p.Flag { - case blas.Rescaling: - h11 := p.H[0] - h12 := p.H[2] - h21 := p.H[1] - h22 := p.H[3] - if incX == 1 && incY == 1 { - x = x[:n] - for i, vx := range x { - vy := y[i] - x[i], y[i] = float64(vx*h11)+float64(vy*h12), float64(vx*h21)+float64(vy*h22) - } - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - vx := x[ix] - vy := y[iy] - x[ix], y[iy] = float64(vx*h11)+float64(vy*h12), float64(vx*h21)+float64(vy*h22) - ix += incX - iy += incY - } - case blas.OffDiagonal: - h12 := p.H[2] - h21 := p.H[1] - if incX == 1 && incY == 1 { - x = x[:n] - for i, vx := range x { - vy := y[i] - x[i], y[i] = vx+float64(vy*h12), float64(vx*h21)+vy - } - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - vx := x[ix] - vy := y[iy] - x[ix], y[iy] = vx+float64(vy*h12), float64(vx*h21)+vy - ix += incX - iy += incY - } - case blas.Diagonal: - h11 := p.H[0] - h22 := p.H[3] - if incX == 1 && incY == 1 { - x = x[:n] - for i, vx := range x { - vy := y[i] - x[i], y[i] = float64(vx*h11)+vy, -vx+float64(vy*h22) - } - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - vx := x[ix] - vy := y[iy] - x[ix], y[iy] = float64(vx*h11)+vy, -vx+float64(vy*h22) - ix += incX - iy += incY - } - } -} - -// Dscal scales x by alpha. -// x[i] *= alpha -// Dscal has no effect if incX < 0. -func (Implementation) Dscal(n int, alpha float64, x []float64, incX int) { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (n-1)*incX >= len(x) { - panic(shortX) - } - if alpha == 0 { - if incX == 1 { - x = x[:n] - for i := range x { - x[i] = 0 - } - return - } - for ix := 0; ix < n*incX; ix += incX { - x[ix] = 0 - } - return - } - if incX == 1 { - f64.ScalUnitary(alpha, x[:n]) - return - } - f64.ScalInc(alpha, x, uintptr(n), uintptr(incX)) -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level1float64_ddot.go b/vendor/gonum.org/v1/gonum/blas/gonum/level1float64_ddot.go deleted file mode 100644 index be87ba1..0000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level1float64_ddot.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/internal/asm/f64" -) - -// Ddot computes the dot product of the two vectors -// \sum_i x[i]*y[i] -func (Implementation) Ddot(n int, x []float64, incX int, y []float64, incY int) float64 { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n <= 0 { - if n == 0 { - return 0 - } - panic(nLT0) - } - if incX == 1 && incY == 1 { - if len(x) < n { - panic(shortX) - } - if len(y) < n { - panic(shortY) - } - return f64.DotUnitary(x[:n], y[:n]) - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - if ix >= len(x) || ix+(n-1)*incX >= len(x) { - panic(shortX) - } - if iy >= len(y) || iy+(n-1)*incY >= len(y) { - panic(shortY) - } - return f64.DotInc(x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy)) -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level2cmplx128.go b/vendor/gonum.org/v1/gonum/blas/gonum/level2cmplx128.go deleted file mode 100644 index d0ca4eb..0000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level2cmplx128.go +++ /dev/null @@ -1,2906 +0,0 @@ -// Copyright ©2017 The Gonum 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 gonum - -import ( - "math/cmplx" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/c128" -) - -var _ blas.Complex128Level2 = Implementation{} - -// Zgbmv performs one of the matrix-vector operations -// y = alpha * A * x + beta * y if trans = blas.NoTrans -// y = alpha * Aᵀ * x + beta * y if trans = blas.Trans -// y = alpha * Aᴴ * x + beta * y if trans = blas.ConjTrans -// where alpha and beta are scalars, x and y are vectors, and A is an m×n band matrix -// with kL sub-diagonals and kU super-diagonals. -func (Implementation) Zgbmv(trans blas.Transpose, m, n, kL, kU int, alpha complex128, a []complex128, lda int, x []complex128, incX int, beta complex128, y []complex128, incY int) { - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if kL < 0 { - panic(kLLT0) - } - if kU < 0 { - panic(kULT0) - } - if lda < kL+kU+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(min(m, n+kL)-1)+kL+kU+1 { - panic(shortA) - } - var lenX, lenY int - if trans == blas.NoTrans { - lenX, lenY = n, m - } else { - lenX, lenY = m, n - } - if (incX > 0 && len(x) <= (lenX-1)*incX) || (incX < 0 && len(x) <= (1-lenX)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (lenY-1)*incY) || (incY < 0 && len(y) <= (1-lenY)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - var kx int - if incX < 0 { - kx = (1 - lenX) * incX - } - var ky int - if incY < 0 { - ky = (1 - lenY) * incY - } - - // Form y = beta*y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:lenY] { - y[i] = 0 - } - } else { - c128.ScalUnitary(beta, y[:lenY]) - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < lenY; i++ { - y[iy] = 0 - iy += incY - } - } else { - if incY > 0 { - c128.ScalInc(beta, y, uintptr(lenY), uintptr(incY)) - } else { - c128.ScalInc(beta, y, uintptr(lenY), uintptr(-incY)) - } - } - } - } - - nRow := min(m, n+kL) - nCol := kL + 1 + kU - switch trans { - case blas.NoTrans: - iy := ky - if incX == 1 { - for i := 0; i < nRow; i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - aRow := a[i*lda+l : i*lda+u] - off := max(0, i-kL) - xtmp := x[off : off+u-l] - var sum complex128 - for j, v := range aRow { - sum += xtmp[j] * v - } - y[iy] += alpha * sum - iy += incY - } - } else { - for i := 0; i < nRow; i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - aRow := a[i*lda+l : i*lda+u] - off := max(0, i-kL) * incX - jx := kx - var sum complex128 - for _, v := range aRow { - sum += x[off+jx] * v - jx += incX - } - y[iy] += alpha * sum - iy += incY - } - } - case blas.Trans: - if incX == 1 { - for i := 0; i < nRow; i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - aRow := a[i*lda+l : i*lda+u] - off := max(0, i-kL) * incY - alphaxi := alpha * x[i] - jy := ky - for _, v := range aRow { - y[off+jy] += alphaxi * v - jy += incY - } - } - } else { - ix := kx - for i := 0; i < nRow; i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - aRow := a[i*lda+l : i*lda+u] - off := max(0, i-kL) * incY - alphaxi := alpha * x[ix] - jy := ky - for _, v := range aRow { - y[off+jy] += alphaxi * v - jy += incY - } - ix += incX - } - } - case blas.ConjTrans: - if incX == 1 { - for i := 0; i < nRow; i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - aRow := a[i*lda+l : i*lda+u] - off := max(0, i-kL) * incY - alphaxi := alpha * x[i] - jy := ky - for _, v := range aRow { - y[off+jy] += alphaxi * cmplx.Conj(v) - jy += incY - } - } - } else { - ix := kx - for i := 0; i < nRow; i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - aRow := a[i*lda+l : i*lda+u] - off := max(0, i-kL) * incY - alphaxi := alpha * x[ix] - jy := ky - for _, v := range aRow { - y[off+jy] += alphaxi * cmplx.Conj(v) - jy += incY - } - ix += incX - } - } - } -} - -// Zgemv performs one of the matrix-vector operations -// y = alpha * A * x + beta * y if trans = blas.NoTrans -// y = alpha * Aᵀ * x + beta * y if trans = blas.Trans -// y = alpha * Aᴴ * x + beta * y if trans = blas.ConjTrans -// where alpha and beta are scalars, x and y are vectors, and A is an m×n dense matrix. -func (Implementation) Zgemv(trans blas.Transpose, m, n int, alpha complex128, a []complex128, lda int, x []complex128, incX int, beta complex128, y []complex128, incY int) { - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - var lenX, lenY int - if trans == blas.NoTrans { - lenX = n - lenY = m - } else { - lenX = m - lenY = n - } - if len(a) < lda*(m-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (lenX-1)*incX) || (incX < 0 && len(x) <= (1-lenX)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (lenY-1)*incY) || (incY < 0 && len(y) <= (1-lenY)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - var kx int - if incX < 0 { - kx = (1 - lenX) * incX - } - var ky int - if incY < 0 { - ky = (1 - lenY) * incY - } - - // Form y = beta*y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:lenY] { - y[i] = 0 - } - } else { - c128.ScalUnitary(beta, y[:lenY]) - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < lenY; i++ { - y[iy] = 0 - iy += incY - } - } else { - if incY > 0 { - c128.ScalInc(beta, y, uintptr(lenY), uintptr(incY)) - } else { - c128.ScalInc(beta, y, uintptr(lenY), uintptr(-incY)) - } - } - } - } - - if alpha == 0 { - return - } - - switch trans { - default: - // Form y = alpha*A*x + y. - iy := ky - if incX == 1 { - for i := 0; i < m; i++ { - y[iy] += alpha * c128.DotuUnitary(a[i*lda:i*lda+n], x[:n]) - iy += incY - } - return - } - for i := 0; i < m; i++ { - y[iy] += alpha * c128.DotuInc(a[i*lda:i*lda+n], x, uintptr(n), 1, uintptr(incX), 0, uintptr(kx)) - iy += incY - } - return - - case blas.Trans: - // Form y = alpha*Aᵀ*x + y. - ix := kx - if incY == 1 { - for i := 0; i < m; i++ { - c128.AxpyUnitary(alpha*x[ix], a[i*lda:i*lda+n], y[:n]) - ix += incX - } - return - } - for i := 0; i < m; i++ { - c128.AxpyInc(alpha*x[ix], a[i*lda:i*lda+n], y, uintptr(n), 1, uintptr(incY), 0, uintptr(ky)) - ix += incX - } - return - - case blas.ConjTrans: - // Form y = alpha*Aᴴ*x + y. - ix := kx - if incY == 1 { - for i := 0; i < m; i++ { - tmp := alpha * x[ix] - for j := 0; j < n; j++ { - y[j] += tmp * cmplx.Conj(a[i*lda+j]) - } - ix += incX - } - return - } - for i := 0; i < m; i++ { - tmp := alpha * x[ix] - jy := ky - for j := 0; j < n; j++ { - y[jy] += tmp * cmplx.Conj(a[i*lda+j]) - jy += incY - } - ix += incX - } - return - } -} - -// Zgerc performs the rank-one operation -// A += alpha * x * yᴴ -// where A is an m×n dense matrix, alpha is a scalar, x is an m element vector, -// and y is an n element vector. -func (Implementation) Zgerc(m, n int, alpha complex128, x []complex128, incX int, y []complex128, incY int, a []complex128, lda int) { - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (m-1)*incX) || (incX < 0 && len(x) <= (1-m)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(a) < lda*(m-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - var kx, jy int - if incX < 0 { - kx = (1 - m) * incX - } - if incY < 0 { - jy = (1 - n) * incY - } - for j := 0; j < n; j++ { - if y[jy] != 0 { - tmp := alpha * cmplx.Conj(y[jy]) - c128.AxpyInc(tmp, x, a[j:], uintptr(m), uintptr(incX), uintptr(lda), uintptr(kx), 0) - } - jy += incY - } -} - -// Zgeru performs the rank-one operation -// A += alpha * x * yᵀ -// where A is an m×n dense matrix, alpha is a scalar, x is an m element vector, -// and y is an n element vector. -func (Implementation) Zgeru(m, n int, alpha complex128, x []complex128, incX int, y []complex128, incY int, a []complex128, lda int) { - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (m-1)*incX) || (incX < 0 && len(x) <= (1-m)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(a) < lda*(m-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - var kx int - if incX < 0 { - kx = (1 - m) * incX - } - if incY == 1 { - for i := 0; i < m; i++ { - if x[kx] != 0 { - tmp := alpha * x[kx] - c128.AxpyUnitary(tmp, y[:n], a[i*lda:i*lda+n]) - } - kx += incX - } - return - } - var jy int - if incY < 0 { - jy = (1 - n) * incY - } - for i := 0; i < m; i++ { - if x[kx] != 0 { - tmp := alpha * x[kx] - c128.AxpyInc(tmp, y, a[i*lda:i*lda+n], uintptr(n), uintptr(incY), 1, uintptr(jy), 0) - } - kx += incX - } -} - -// Zhbmv performs the matrix-vector operation -// y = alpha * A * x + beta * y -// where alpha and beta are scalars, x and y are vectors, and A is an n×n -// Hermitian band matrix with k super-diagonals. The imaginary parts of -// the diagonal elements of A are ignored and assumed to be zero. -func (Implementation) Zhbmv(uplo blas.Uplo, n, k int, alpha complex128, a []complex128, lda int, x []complex128, incX int, beta complex128, y []complex128, incY int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - if lda < k+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+k+1 { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - // Set up the start indices in X and Y. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - var ky int - if incY < 0 { - ky = (1 - n) * incY - } - - // Form y = beta*y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:n] { - y[i] = 0 - } - } else { - for i, v := range y[:n] { - y[i] = beta * v - } - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < n; i++ { - y[iy] = 0 - iy += incY - } - } else { - for i := 0; i < n; i++ { - y[iy] = beta * y[iy] - iy += incY - } - } - } - } - - if alpha == 0 { - return - } - - // The elements of A are accessed sequentially with one pass through a. - switch uplo { - case blas.Upper: - iy := ky - if incX == 1 { - for i := 0; i < n; i++ { - aRow := a[i*lda:] - alphaxi := alpha * x[i] - sum := alphaxi * complex(real(aRow[0]), 0) - u := min(k+1, n-i) - jy := incY - for j := 1; j < u; j++ { - v := aRow[j] - sum += alpha * x[i+j] * v - y[iy+jy] += alphaxi * cmplx.Conj(v) - jy += incY - } - y[iy] += sum - iy += incY - } - } else { - ix := kx - for i := 0; i < n; i++ { - aRow := a[i*lda:] - alphaxi := alpha * x[ix] - sum := alphaxi * complex(real(aRow[0]), 0) - u := min(k+1, n-i) - jx := incX - jy := incY - for j := 1; j < u; j++ { - v := aRow[j] - sum += alpha * x[ix+jx] * v - y[iy+jy] += alphaxi * cmplx.Conj(v) - jx += incX - jy += incY - } - y[iy] += sum - ix += incX - iy += incY - } - } - case blas.Lower: - iy := ky - if incX == 1 { - for i := 0; i < n; i++ { - l := max(0, k-i) - alphaxi := alpha * x[i] - jy := l * incY - aRow := a[i*lda:] - for j := l; j < k; j++ { - v := aRow[j] - y[iy] += alpha * v * x[i-k+j] - y[iy-k*incY+jy] += alphaxi * cmplx.Conj(v) - jy += incY - } - y[iy] += alphaxi * complex(real(aRow[k]), 0) - iy += incY - } - } else { - ix := kx - for i := 0; i < n; i++ { - l := max(0, k-i) - alphaxi := alpha * x[ix] - jx := l * incX - jy := l * incY - aRow := a[i*lda:] - for j := l; j < k; j++ { - v := aRow[j] - y[iy] += alpha * v * x[ix-k*incX+jx] - y[iy-k*incY+jy] += alphaxi * cmplx.Conj(v) - jx += incX - jy += incY - } - y[iy] += alphaxi * complex(real(aRow[k]), 0) - ix += incX - iy += incY - } - } - } -} - -// Zhemv performs the matrix-vector operation -// y = alpha * A * x + beta * y -// where alpha and beta are scalars, x and y are vectors, and A is an n×n -// Hermitian matrix. The imaginary parts of the diagonal elements of A are -// ignored and assumed to be zero. -func (Implementation) Zhemv(uplo blas.Uplo, n int, alpha complex128, a []complex128, lda int, x []complex128, incX int, beta complex128, y []complex128, incY int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - // Set up the start indices in X and Y. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - var ky int - if incY < 0 { - ky = (1 - n) * incY - } - - // Form y = beta*y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:n] { - y[i] = 0 - } - } else { - for i, v := range y[:n] { - y[i] = beta * v - } - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < n; i++ { - y[iy] = 0 - iy += incY - } - } else { - for i := 0; i < n; i++ { - y[iy] = beta * y[iy] - iy += incY - } - } - } - } - - if alpha == 0 { - return - } - - // The elements of A are accessed sequentially with one pass through - // the triangular part of A. - - if uplo == blas.Upper { - // Form y when A is stored in upper triangle. - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - tmp1 := alpha * x[i] - var tmp2 complex128 - for j := i + 1; j < n; j++ { - y[j] += tmp1 * cmplx.Conj(a[i*lda+j]) - tmp2 += a[i*lda+j] * x[j] - } - aii := complex(real(a[i*lda+i]), 0) - y[i] += tmp1*aii + alpha*tmp2 - } - } else { - ix := kx - iy := ky - for i := 0; i < n; i++ { - tmp1 := alpha * x[ix] - var tmp2 complex128 - jx := ix - jy := iy - for j := i + 1; j < n; j++ { - jx += incX - jy += incY - y[jy] += tmp1 * cmplx.Conj(a[i*lda+j]) - tmp2 += a[i*lda+j] * x[jx] - } - aii := complex(real(a[i*lda+i]), 0) - y[iy] += tmp1*aii + alpha*tmp2 - ix += incX - iy += incY - } - } - return - } - - // Form y when A is stored in lower triangle. - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - tmp1 := alpha * x[i] - var tmp2 complex128 - for j := 0; j < i; j++ { - y[j] += tmp1 * cmplx.Conj(a[i*lda+j]) - tmp2 += a[i*lda+j] * x[j] - } - aii := complex(real(a[i*lda+i]), 0) - y[i] += tmp1*aii + alpha*tmp2 - } - } else { - ix := kx - iy := ky - for i := 0; i < n; i++ { - tmp1 := alpha * x[ix] - var tmp2 complex128 - jx := kx - jy := ky - for j := 0; j < i; j++ { - y[jy] += tmp1 * cmplx.Conj(a[i*lda+j]) - tmp2 += a[i*lda+j] * x[jx] - jx += incX - jy += incY - } - aii := complex(real(a[i*lda+i]), 0) - y[iy] += tmp1*aii + alpha*tmp2 - ix += incX - iy += incY - } - } -} - -// Zher performs the Hermitian rank-one operation -// A += alpha * x * xᴴ -// where A is an n×n Hermitian matrix, alpha is a real scalar, and x is an n -// element vector. On entry, the imaginary parts of the diagonal elements of A -// are ignored and assumed to be zero, on return they will be set to zero. -func (Implementation) Zher(uplo blas.Uplo, n int, alpha float64, x []complex128, incX int, a []complex128, lda int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if len(a) < lda*(n-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - if uplo == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - if x[i] != 0 { - tmp := complex(alpha*real(x[i]), alpha*imag(x[i])) - aii := real(a[i*lda+i]) - xtmp := real(tmp * cmplx.Conj(x[i])) - a[i*lda+i] = complex(aii+xtmp, 0) - for j := i + 1; j < n; j++ { - a[i*lda+j] += tmp * cmplx.Conj(x[j]) - } - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - } - return - } - - ix := kx - for i := 0; i < n; i++ { - if x[ix] != 0 { - tmp := complex(alpha*real(x[ix]), alpha*imag(x[ix])) - aii := real(a[i*lda+i]) - xtmp := real(tmp * cmplx.Conj(x[ix])) - a[i*lda+i] = complex(aii+xtmp, 0) - jx := ix + incX - for j := i + 1; j < n; j++ { - a[i*lda+j] += tmp * cmplx.Conj(x[jx]) - jx += incX - } - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - ix += incX - } - return - } - - if incX == 1 { - for i := 0; i < n; i++ { - if x[i] != 0 { - tmp := complex(alpha*real(x[i]), alpha*imag(x[i])) - for j := 0; j < i; j++ { - a[i*lda+j] += tmp * cmplx.Conj(x[j]) - } - aii := real(a[i*lda+i]) - xtmp := real(tmp * cmplx.Conj(x[i])) - a[i*lda+i] = complex(aii+xtmp, 0) - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - } - return - } - - ix := kx - for i := 0; i < n; i++ { - if x[ix] != 0 { - tmp := complex(alpha*real(x[ix]), alpha*imag(x[ix])) - jx := kx - for j := 0; j < i; j++ { - a[i*lda+j] += tmp * cmplx.Conj(x[jx]) - jx += incX - } - aii := real(a[i*lda+i]) - xtmp := real(tmp * cmplx.Conj(x[ix])) - a[i*lda+i] = complex(aii+xtmp, 0) - - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - ix += incX - } -} - -// Zher2 performs the Hermitian rank-two operation -// A += alpha * x * yᴴ + conj(alpha) * y * xᴴ -// where alpha is a scalar, x and y are n element vectors and A is an n×n -// Hermitian matrix. On entry, the imaginary parts of the diagonal elements are -// ignored and assumed to be zero. On return they will be set to zero. -func (Implementation) Zher2(uplo blas.Uplo, n int, alpha complex128, x []complex128, incX int, y []complex128, incY int, a []complex128, lda int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(a) < lda*(n-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - var kx, ky int - var ix, iy int - if incX != 1 || incY != 1 { - if incX < 0 { - kx = (1 - n) * incX - } - if incY < 0 { - ky = (1 - n) * incY - } - ix = kx - iy = ky - } - if uplo == blas.Upper { - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - if x[i] != 0 || y[i] != 0 { - tmp1 := alpha * x[i] - tmp2 := cmplx.Conj(alpha) * y[i] - aii := real(a[i*lda+i]) + real(tmp1*cmplx.Conj(y[i])) + real(tmp2*cmplx.Conj(x[i])) - a[i*lda+i] = complex(aii, 0) - for j := i + 1; j < n; j++ { - a[i*lda+j] += tmp1*cmplx.Conj(y[j]) + tmp2*cmplx.Conj(x[j]) - } - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - } - return - } - for i := 0; i < n; i++ { - if x[ix] != 0 || y[iy] != 0 { - tmp1 := alpha * x[ix] - tmp2 := cmplx.Conj(alpha) * y[iy] - aii := real(a[i*lda+i]) + real(tmp1*cmplx.Conj(y[iy])) + real(tmp2*cmplx.Conj(x[ix])) - a[i*lda+i] = complex(aii, 0) - jx := ix + incX - jy := iy + incY - for j := i + 1; j < n; j++ { - a[i*lda+j] += tmp1*cmplx.Conj(y[jy]) + tmp2*cmplx.Conj(x[jx]) - jx += incX - jy += incY - } - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - ix += incX - iy += incY - } - return - } - - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - if x[i] != 0 || y[i] != 0 { - tmp1 := alpha * x[i] - tmp2 := cmplx.Conj(alpha) * y[i] - for j := 0; j < i; j++ { - a[i*lda+j] += tmp1*cmplx.Conj(y[j]) + tmp2*cmplx.Conj(x[j]) - } - aii := real(a[i*lda+i]) + real(tmp1*cmplx.Conj(y[i])) + real(tmp2*cmplx.Conj(x[i])) - a[i*lda+i] = complex(aii, 0) - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - } - return - } - for i := 0; i < n; i++ { - if x[ix] != 0 || y[iy] != 0 { - tmp1 := alpha * x[ix] - tmp2 := cmplx.Conj(alpha) * y[iy] - jx := kx - jy := ky - for j := 0; j < i; j++ { - a[i*lda+j] += tmp1*cmplx.Conj(y[jy]) + tmp2*cmplx.Conj(x[jx]) - jx += incX - jy += incY - } - aii := real(a[i*lda+i]) + real(tmp1*cmplx.Conj(y[iy])) + real(tmp2*cmplx.Conj(x[ix])) - a[i*lda+i] = complex(aii, 0) - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - ix += incX - iy += incY - } -} - -// Zhpmv performs the matrix-vector operation -// y = alpha * A * x + beta * y -// where alpha and beta are scalars, x and y are vectors, and A is an n×n -// Hermitian matrix in packed form. The imaginary parts of the diagonal -// elements of A are ignored and assumed to be zero. -func (Implementation) Zhpmv(uplo blas.Uplo, n int, alpha complex128, ap []complex128, x []complex128, incX int, beta complex128, y []complex128, incY int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - // Set up the start indices in X and Y. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - var ky int - if incY < 0 { - ky = (1 - n) * incY - } - - // Form y = beta*y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:n] { - y[i] = 0 - } - } else { - for i, v := range y[:n] { - y[i] = beta * v - } - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < n; i++ { - y[iy] = 0 - iy += incY - } - } else { - for i := 0; i < n; i++ { - y[iy] *= beta - iy += incY - } - } - } - } - - if alpha == 0 { - return - } - - // The elements of A are accessed sequentially with one pass through ap. - - var kk int - if uplo == blas.Upper { - // Form y when ap contains the upper triangle. - // Here, kk points to the current diagonal element in ap. - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - tmp1 := alpha * x[i] - y[i] += tmp1 * complex(real(ap[kk]), 0) - var tmp2 complex128 - k := kk + 1 - for j := i + 1; j < n; j++ { - y[j] += tmp1 * cmplx.Conj(ap[k]) - tmp2 += ap[k] * x[j] - k++ - } - y[i] += alpha * tmp2 - kk += n - i - } - } else { - ix := kx - iy := ky - for i := 0; i < n; i++ { - tmp1 := alpha * x[ix] - y[iy] += tmp1 * complex(real(ap[kk]), 0) - var tmp2 complex128 - jx := ix - jy := iy - for k := kk + 1; k < kk+n-i; k++ { - jx += incX - jy += incY - y[jy] += tmp1 * cmplx.Conj(ap[k]) - tmp2 += ap[k] * x[jx] - } - y[iy] += alpha * tmp2 - ix += incX - iy += incY - kk += n - i - } - } - return - } - - // Form y when ap contains the lower triangle. - // Here, kk points to the beginning of current row in ap. - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - tmp1 := alpha * x[i] - var tmp2 complex128 - k := kk - for j := 0; j < i; j++ { - y[j] += tmp1 * cmplx.Conj(ap[k]) - tmp2 += ap[k] * x[j] - k++ - } - aii := complex(real(ap[kk+i]), 0) - y[i] += tmp1*aii + alpha*tmp2 - kk += i + 1 - } - } else { - ix := kx - iy := ky - for i := 0; i < n; i++ { - tmp1 := alpha * x[ix] - var tmp2 complex128 - jx := kx - jy := ky - for k := kk; k < kk+i; k++ { - y[jy] += tmp1 * cmplx.Conj(ap[k]) - tmp2 += ap[k] * x[jx] - jx += incX - jy += incY - } - aii := complex(real(ap[kk+i]), 0) - y[iy] += tmp1*aii + alpha*tmp2 - ix += incX - iy += incY - kk += i + 1 - } - } -} - -// Zhpr performs the Hermitian rank-1 operation -// A += alpha * x * xᴴ -// where alpha is a real scalar, x is a vector, and A is an n×n hermitian matrix -// in packed form. On entry, the imaginary parts of the diagonal elements are -// assumed to be zero, and on return they are set to zero. -func (Implementation) Zhpr(uplo blas.Uplo, n int, alpha float64, x []complex128, incX int, ap []complex128) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - // The elements of A are accessed sequentially with one pass through ap. - - var kk int - if uplo == blas.Upper { - // Form A when upper triangle is stored in AP. - // Here, kk points to the current diagonal element in ap. - if incX == 1 { - for i := 0; i < n; i++ { - xi := x[i] - if xi != 0 { - aii := real(ap[kk]) + alpha*real(cmplx.Conj(xi)*xi) - ap[kk] = complex(aii, 0) - - tmp := complex(alpha, 0) * xi - a := ap[kk+1 : kk+n-i] - x := x[i+1 : n] - for j, v := range x { - a[j] += tmp * cmplx.Conj(v) - } - } else { - ap[kk] = complex(real(ap[kk]), 0) - } - kk += n - i - } - } else { - ix := kx - for i := 0; i < n; i++ { - xi := x[ix] - if xi != 0 { - aii := real(ap[kk]) + alpha*real(cmplx.Conj(xi)*xi) - ap[kk] = complex(aii, 0) - - tmp := complex(alpha, 0) * xi - jx := ix + incX - a := ap[kk+1 : kk+n-i] - for k := range a { - a[k] += tmp * cmplx.Conj(x[jx]) - jx += incX - } - } else { - ap[kk] = complex(real(ap[kk]), 0) - } - ix += incX - kk += n - i - } - } - return - } - - // Form A when lower triangle is stored in AP. - // Here, kk points to the beginning of current row in ap. - if incX == 1 { - for i := 0; i < n; i++ { - xi := x[i] - if xi != 0 { - tmp := complex(alpha, 0) * xi - a := ap[kk : kk+i] - for j, v := range x[:i] { - a[j] += tmp * cmplx.Conj(v) - } - - aii := real(ap[kk+i]) + alpha*real(cmplx.Conj(xi)*xi) - ap[kk+i] = complex(aii, 0) - } else { - ap[kk+i] = complex(real(ap[kk+i]), 0) - } - kk += i + 1 - } - } else { - ix := kx - for i := 0; i < n; i++ { - xi := x[ix] - if xi != 0 { - tmp := complex(alpha, 0) * xi - a := ap[kk : kk+i] - jx := kx - for k := range a { - a[k] += tmp * cmplx.Conj(x[jx]) - jx += incX - } - - aii := real(ap[kk+i]) + alpha*real(cmplx.Conj(xi)*xi) - ap[kk+i] = complex(aii, 0) - } else { - ap[kk+i] = complex(real(ap[kk+i]), 0) - } - ix += incX - kk += i + 1 - } - } -} - -// Zhpr2 performs the Hermitian rank-2 operation -// A += alpha * x * yᴴ + conj(alpha) * y * xᴴ -// where alpha is a complex scalar, x and y are n element vectors, and A is an -// n×n Hermitian matrix, supplied in packed form. On entry, the imaginary parts -// of the diagonal elements are assumed to be zero, and on return they are set to zero. -func (Implementation) Zhpr2(uplo blas.Uplo, n int, alpha complex128, x []complex128, incX int, y []complex128, incY int, ap []complex128) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - // Set up start indices in X and Y. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - var ky int - if incY < 0 { - ky = (1 - n) * incY - } - - // The elements of A are accessed sequentially with one pass through ap. - - var kk int - if uplo == blas.Upper { - // Form A when upper triangle is stored in AP. - // Here, kk points to the current diagonal element in ap. - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - if x[i] != 0 || y[i] != 0 { - tmp1 := alpha * x[i] - tmp2 := cmplx.Conj(alpha) * y[i] - aii := real(ap[kk]) + real(tmp1*cmplx.Conj(y[i])) + real(tmp2*cmplx.Conj(x[i])) - ap[kk] = complex(aii, 0) - k := kk + 1 - for j := i + 1; j < n; j++ { - ap[k] += tmp1*cmplx.Conj(y[j]) + tmp2*cmplx.Conj(x[j]) - k++ - } - } else { - ap[kk] = complex(real(ap[kk]), 0) - } - kk += n - i - } - } else { - ix := kx - iy := ky - for i := 0; i < n; i++ { - if x[ix] != 0 || y[iy] != 0 { - tmp1 := alpha * x[ix] - tmp2 := cmplx.Conj(alpha) * y[iy] - aii := real(ap[kk]) + real(tmp1*cmplx.Conj(y[iy])) + real(tmp2*cmplx.Conj(x[ix])) - ap[kk] = complex(aii, 0) - jx := ix + incX - jy := iy + incY - for k := kk + 1; k < kk+n-i; k++ { - ap[k] += tmp1*cmplx.Conj(y[jy]) + tmp2*cmplx.Conj(x[jx]) - jx += incX - jy += incY - } - } else { - ap[kk] = complex(real(ap[kk]), 0) - } - ix += incX - iy += incY - kk += n - i - } - } - return - } - - // Form A when lower triangle is stored in AP. - // Here, kk points to the beginning of current row in ap. - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - if x[i] != 0 || y[i] != 0 { - tmp1 := alpha * x[i] - tmp2 := cmplx.Conj(alpha) * y[i] - k := kk - for j := 0; j < i; j++ { - ap[k] += tmp1*cmplx.Conj(y[j]) + tmp2*cmplx.Conj(x[j]) - k++ - } - aii := real(ap[kk+i]) + real(tmp1*cmplx.Conj(y[i])) + real(tmp2*cmplx.Conj(x[i])) - ap[kk+i] = complex(aii, 0) - } else { - ap[kk+i] = complex(real(ap[kk+i]), 0) - } - kk += i + 1 - } - } else { - ix := kx - iy := ky - for i := 0; i < n; i++ { - if x[ix] != 0 || y[iy] != 0 { - tmp1 := alpha * x[ix] - tmp2 := cmplx.Conj(alpha) * y[iy] - jx := kx - jy := ky - for k := kk; k < kk+i; k++ { - ap[k] += tmp1*cmplx.Conj(y[jy]) + tmp2*cmplx.Conj(x[jx]) - jx += incX - jy += incY - } - aii := real(ap[kk+i]) + real(tmp1*cmplx.Conj(y[iy])) + real(tmp2*cmplx.Conj(x[ix])) - ap[kk+i] = complex(aii, 0) - } else { - ap[kk+i] = complex(real(ap[kk+i]), 0) - } - ix += incX - iy += incY - kk += i + 1 - } - } -} - -// Ztbmv performs one of the matrix-vector operations -// x = A * x if trans = blas.NoTrans -// x = Aᵀ * x if trans = blas.Trans -// x = Aᴴ * x if trans = blas.ConjTrans -// where x is an n element vector and A is an n×n triangular band matrix, with -// (k+1) diagonals. -func (Implementation) Ztbmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n, k int, a []complex128, lda int, x []complex128, incX int) { - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - switch diag { - default: - panic(badDiag) - case blas.NonUnit, blas.Unit: - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - if lda < k+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+k+1 { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - switch trans { - case blas.NoTrans: - if uplo == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - xi := x[i] - if diag == blas.NonUnit { - xi *= a[i*lda] - } - kk := min(k, n-i-1) - for j, aij := range a[i*lda+1 : i*lda+kk+1] { - xi += x[i+j+1] * aij - } - x[i] = xi - } - } else { - ix := kx - for i := 0; i < n; i++ { - xi := x[ix] - if diag == blas.NonUnit { - xi *= a[i*lda] - } - kk := min(k, n-i-1) - jx := ix + incX - for _, aij := range a[i*lda+1 : i*lda+kk+1] { - xi += x[jx] * aij - jx += incX - } - x[ix] = xi - ix += incX - } - } - } else { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - xi := x[i] - if diag == blas.NonUnit { - xi *= a[i*lda+k] - } - kk := min(k, i) - for j, aij := range a[i*lda+k-kk : i*lda+k] { - xi += x[i-kk+j] * aij - } - x[i] = xi - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - xi := x[ix] - if diag == blas.NonUnit { - xi *= a[i*lda+k] - } - kk := min(k, i) - jx := ix - kk*incX - for _, aij := range a[i*lda+k-kk : i*lda+k] { - xi += x[jx] * aij - jx += incX - } - x[ix] = xi - ix -= incX - } - } - } - case blas.Trans: - if uplo == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - kk := min(k, n-i-1) - xi := x[i] - for j, aij := range a[i*lda+1 : i*lda+kk+1] { - x[i+j+1] += xi * aij - } - if diag == blas.NonUnit { - x[i] *= a[i*lda] - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - kk := min(k, n-i-1) - jx := ix + incX - xi := x[ix] - for _, aij := range a[i*lda+1 : i*lda+kk+1] { - x[jx] += xi * aij - jx += incX - } - if diag == blas.NonUnit { - x[ix] *= a[i*lda] - } - ix -= incX - } - } - } else { - if incX == 1 { - for i := 0; i < n; i++ { - kk := min(k, i) - xi := x[i] - for j, aij := range a[i*lda+k-kk : i*lda+k] { - x[i-kk+j] += xi * aij - } - if diag == blas.NonUnit { - x[i] *= a[i*lda+k] - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - kk := min(k, i) - jx := ix - kk*incX - xi := x[ix] - for _, aij := range a[i*lda+k-kk : i*lda+k] { - x[jx] += xi * aij - jx += incX - } - if diag == blas.NonUnit { - x[ix] *= a[i*lda+k] - } - ix += incX - } - } - } - case blas.ConjTrans: - if uplo == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - kk := min(k, n-i-1) - xi := x[i] - for j, aij := range a[i*lda+1 : i*lda+kk+1] { - x[i+j+1] += xi * cmplx.Conj(aij) - } - if diag == blas.NonUnit { - x[i] *= cmplx.Conj(a[i*lda]) - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - kk := min(k, n-i-1) - jx := ix + incX - xi := x[ix] - for _, aij := range a[i*lda+1 : i*lda+kk+1] { - x[jx] += xi * cmplx.Conj(aij) - jx += incX - } - if diag == blas.NonUnit { - x[ix] *= cmplx.Conj(a[i*lda]) - } - ix -= incX - } - } - } else { - if incX == 1 { - for i := 0; i < n; i++ { - kk := min(k, i) - xi := x[i] - for j, aij := range a[i*lda+k-kk : i*lda+k] { - x[i-kk+j] += xi * cmplx.Conj(aij) - } - if diag == blas.NonUnit { - x[i] *= cmplx.Conj(a[i*lda+k]) - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - kk := min(k, i) - jx := ix - kk*incX - xi := x[ix] - for _, aij := range a[i*lda+k-kk : i*lda+k] { - x[jx] += xi * cmplx.Conj(aij) - jx += incX - } - if diag == blas.NonUnit { - x[ix] *= cmplx.Conj(a[i*lda+k]) - } - ix += incX - } - } - } - } -} - -// Ztbsv solves one of the systems of equations -// A * x = b if trans == blas.NoTrans -// Aᵀ * x = b if trans == blas.Trans -// Aᴴ * x = b if trans == blas.ConjTrans -// where b and x are n element vectors and A is an n×n triangular band matrix -// with (k+1) diagonals. -// -// On entry, x contains the values of b, and the solution is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -func (Implementation) Ztbsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n, k int, a []complex128, lda int, x []complex128, incX int) { - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - switch diag { - default: - panic(badDiag) - case blas.NonUnit, blas.Unit: - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - if lda < k+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+k+1 { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - switch trans { - case blas.NoTrans: - if uplo == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - kk := min(k, n-i-1) - var sum complex128 - for j, aij := range a[i*lda+1 : i*lda+kk+1] { - sum += x[i+1+j] * aij - } - x[i] -= sum - if diag == blas.NonUnit { - x[i] /= a[i*lda] - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - kk := min(k, n-i-1) - var sum complex128 - jx := ix + incX - for _, aij := range a[i*lda+1 : i*lda+kk+1] { - sum += x[jx] * aij - jx += incX - } - x[ix] -= sum - if diag == blas.NonUnit { - x[ix] /= a[i*lda] - } - ix -= incX - } - } - } else { - if incX == 1 { - for i := 0; i < n; i++ { - kk := min(k, i) - var sum complex128 - for j, aij := range a[i*lda+k-kk : i*lda+k] { - sum += x[i-kk+j] * aij - } - x[i] -= sum - if diag == blas.NonUnit { - x[i] /= a[i*lda+k] - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - kk := min(k, i) - var sum complex128 - jx := ix - kk*incX - for _, aij := range a[i*lda+k-kk : i*lda+k] { - sum += x[jx] * aij - jx += incX - } - x[ix] -= sum - if diag == blas.NonUnit { - x[ix] /= a[i*lda+k] - } - ix += incX - } - } - } - case blas.Trans: - if uplo == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[i] /= a[i*lda] - } - kk := min(k, n-i-1) - xi := x[i] - for j, aij := range a[i*lda+1 : i*lda+kk+1] { - x[i+1+j] -= xi * aij - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[ix] /= a[i*lda] - } - kk := min(k, n-i-1) - xi := x[ix] - jx := ix + incX - for _, aij := range a[i*lda+1 : i*lda+kk+1] { - x[jx] -= xi * aij - jx += incX - } - ix += incX - } - } - } else { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[i] /= a[i*lda+k] - } - kk := min(k, i) - xi := x[i] - for j, aij := range a[i*lda+k-kk : i*lda+k] { - x[i-kk+j] -= xi * aij - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[ix] /= a[i*lda+k] - } - kk := min(k, i) - xi := x[ix] - jx := ix - kk*incX - for _, aij := range a[i*lda+k-kk : i*lda+k] { - x[jx] -= xi * aij - jx += incX - } - ix -= incX - } - } - } - case blas.ConjTrans: - if uplo == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[i] /= cmplx.Conj(a[i*lda]) - } - kk := min(k, n-i-1) - xi := x[i] - for j, aij := range a[i*lda+1 : i*lda+kk+1] { - x[i+1+j] -= xi * cmplx.Conj(aij) - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[ix] /= cmplx.Conj(a[i*lda]) - } - kk := min(k, n-i-1) - xi := x[ix] - jx := ix + incX - for _, aij := range a[i*lda+1 : i*lda+kk+1] { - x[jx] -= xi * cmplx.Conj(aij) - jx += incX - } - ix += incX - } - } - } else { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[i] /= cmplx.Conj(a[i*lda+k]) - } - kk := min(k, i) - xi := x[i] - for j, aij := range a[i*lda+k-kk : i*lda+k] { - x[i-kk+j] -= xi * cmplx.Conj(aij) - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[ix] /= cmplx.Conj(a[i*lda+k]) - } - kk := min(k, i) - xi := x[ix] - jx := ix - kk*incX - for _, aij := range a[i*lda+k-kk : i*lda+k] { - x[jx] -= xi * cmplx.Conj(aij) - jx += incX - } - ix -= incX - } - } - } - } -} - -// Ztpmv performs one of the matrix-vector operations -// x = A * x if trans = blas.NoTrans -// x = Aᵀ * x if trans = blas.Trans -// x = Aᴴ * x if trans = blas.ConjTrans -// where x is an n element vector and A is an n×n triangular matrix, supplied in -// packed form. -func (Implementation) Ztpmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n int, ap []complex128, x []complex128, incX int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch diag { - default: - panic(badDiag) - case blas.NonUnit, blas.Unit: - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - // The elements of A are accessed sequentially with one pass through A. - - if trans == blas.NoTrans { - // Form x = A*x. - if uplo == blas.Upper { - // kk points to the current diagonal element in ap. - kk := 0 - if incX == 1 { - x = x[:n] - for i := range x { - if diag == blas.NonUnit { - x[i] *= ap[kk] - } - if n-i-1 > 0 { - x[i] += c128.DotuUnitary(ap[kk+1:kk+n-i], x[i+1:]) - } - kk += n - i - } - } else { - ix := kx - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[ix] *= ap[kk] - } - if n-i-1 > 0 { - x[ix] += c128.DotuInc(ap[kk+1:kk+n-i], x, uintptr(n-i-1), 1, uintptr(incX), 0, uintptr(ix+incX)) - } - ix += incX - kk += n - i - } - } - } else { - // kk points to the beginning of current row in ap. - kk := n*(n+1)/2 - n - if incX == 1 { - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[i] *= ap[kk+i] - } - if i > 0 { - x[i] += c128.DotuUnitary(ap[kk:kk+i], x[:i]) - } - kk -= i - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[ix] *= ap[kk+i] - } - if i > 0 { - x[ix] += c128.DotuInc(ap[kk:kk+i], x, uintptr(i), 1, uintptr(incX), 0, uintptr(kx)) - } - ix -= incX - kk -= i - } - } - } - return - } - - if trans == blas.Trans { - // Form x = Aᵀ*x. - if uplo == blas.Upper { - // kk points to the current diagonal element in ap. - kk := n*(n+1)/2 - 1 - if incX == 1 { - for i := n - 1; i >= 0; i-- { - xi := x[i] - if diag == blas.NonUnit { - x[i] *= ap[kk] - } - if n-i-1 > 0 { - c128.AxpyUnitary(xi, ap[kk+1:kk+n-i], x[i+1:n]) - } - kk -= n - i + 1 - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - xi := x[ix] - if diag == blas.NonUnit { - x[ix] *= ap[kk] - } - if n-i-1 > 0 { - c128.AxpyInc(xi, ap[kk+1:kk+n-i], x, uintptr(n-i-1), 1, uintptr(incX), 0, uintptr(ix+incX)) - } - ix -= incX - kk -= n - i + 1 - } - } - } else { - // kk points to the beginning of current row in ap. - kk := 0 - if incX == 1 { - x = x[:n] - for i := range x { - if i > 0 { - c128.AxpyUnitary(x[i], ap[kk:kk+i], x[:i]) - } - if diag == blas.NonUnit { - x[i] *= ap[kk+i] - } - kk += i + 1 - } - } else { - ix := kx - for i := 0; i < n; i++ { - if i > 0 { - c128.AxpyInc(x[ix], ap[kk:kk+i], x, uintptr(i), 1, uintptr(incX), 0, uintptr(kx)) - } - if diag == blas.NonUnit { - x[ix] *= ap[kk+i] - } - ix += incX - kk += i + 1 - } - } - } - return - } - - // Form x = Aᴴ*x. - if uplo == blas.Upper { - // kk points to the current diagonal element in ap. - kk := n*(n+1)/2 - 1 - if incX == 1 { - for i := n - 1; i >= 0; i-- { - xi := x[i] - if diag == blas.NonUnit { - x[i] *= cmplx.Conj(ap[kk]) - } - k := kk + 1 - for j := i + 1; j < n; j++ { - x[j] += xi * cmplx.Conj(ap[k]) - k++ - } - kk -= n - i + 1 - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - xi := x[ix] - if diag == blas.NonUnit { - x[ix] *= cmplx.Conj(ap[kk]) - } - jx := ix + incX - k := kk + 1 - for j := i + 1; j < n; j++ { - x[jx] += xi * cmplx.Conj(ap[k]) - jx += incX - k++ - } - ix -= incX - kk -= n - i + 1 - } - } - } else { - // kk points to the beginning of current row in ap. - kk := 0 - if incX == 1 { - x = x[:n] - for i, xi := range x { - for j := 0; j < i; j++ { - x[j] += xi * cmplx.Conj(ap[kk+j]) - } - if diag == blas.NonUnit { - x[i] *= cmplx.Conj(ap[kk+i]) - } - kk += i + 1 - } - } else { - ix := kx - for i := 0; i < n; i++ { - xi := x[ix] - jx := kx - for j := 0; j < i; j++ { - x[jx] += xi * cmplx.Conj(ap[kk+j]) - jx += incX - } - if diag == blas.NonUnit { - x[ix] *= cmplx.Conj(ap[kk+i]) - } - ix += incX - kk += i + 1 - } - } - } -} - -// Ztpsv solves one of the systems of equations -// A * x = b if trans == blas.NoTrans -// Aᵀ * x = b if trans == blas.Trans -// Aᴴ * x = b if trans == blas.ConjTrans -// where b and x are n element vectors and A is an n×n triangular matrix in -// packed form. -// -// On entry, x contains the values of b, and the solution is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -func (Implementation) Ztpsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n int, ap []complex128, x []complex128, incX int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch diag { - default: - panic(badDiag) - case blas.NonUnit, blas.Unit: - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - // The elements of A are accessed sequentially with one pass through ap. - - if trans == blas.NoTrans { - // Form x = inv(A)*x. - if uplo == blas.Upper { - kk := n*(n+1)/2 - 1 - if incX == 1 { - for i := n - 1; i >= 0; i-- { - aii := ap[kk] - if n-i-1 > 0 { - x[i] -= c128.DotuUnitary(x[i+1:n], ap[kk+1:kk+n-i]) - } - if diag == blas.NonUnit { - x[i] /= aii - } - kk -= n - i + 1 - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - aii := ap[kk] - if n-i-1 > 0 { - x[ix] -= c128.DotuInc(x, ap[kk+1:kk+n-i], uintptr(n-i-1), uintptr(incX), 1, uintptr(ix+incX), 0) - } - if diag == blas.NonUnit { - x[ix] /= aii - } - ix -= incX - kk -= n - i + 1 - } - } - } else { - kk := 0 - if incX == 1 { - for i := 0; i < n; i++ { - if i > 0 { - x[i] -= c128.DotuUnitary(x[:i], ap[kk:kk+i]) - } - if diag == blas.NonUnit { - x[i] /= ap[kk+i] - } - kk += i + 1 - } - } else { - ix := kx - for i := 0; i < n; i++ { - if i > 0 { - x[ix] -= c128.DotuInc(x, ap[kk:kk+i], uintptr(i), uintptr(incX), 1, uintptr(kx), 0) - } - if diag == blas.NonUnit { - x[ix] /= ap[kk+i] - } - ix += incX - kk += i + 1 - } - } - } - return - } - - if trans == blas.Trans { - // Form x = inv(Aᵀ)*x. - if uplo == blas.Upper { - kk := 0 - if incX == 1 { - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[j] /= ap[kk] - } - if n-j-1 > 0 { - c128.AxpyUnitary(-x[j], ap[kk+1:kk+n-j], x[j+1:n]) - } - kk += n - j - } - } else { - jx := kx - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[jx] /= ap[kk] - } - if n-j-1 > 0 { - c128.AxpyInc(-x[jx], ap[kk+1:kk+n-j], x, uintptr(n-j-1), 1, uintptr(incX), 0, uintptr(jx+incX)) - } - jx += incX - kk += n - j - } - } - } else { - kk := n*(n+1)/2 - n - if incX == 1 { - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[j] /= ap[kk+j] - } - if j > 0 { - c128.AxpyUnitary(-x[j], ap[kk:kk+j], x[:j]) - } - kk -= j - } - } else { - jx := kx + (n-1)*incX - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[jx] /= ap[kk+j] - } - if j > 0 { - c128.AxpyInc(-x[jx], ap[kk:kk+j], x, uintptr(j), 1, uintptr(incX), 0, uintptr(kx)) - } - jx -= incX - kk -= j - } - } - } - return - } - - // Form x = inv(Aᴴ)*x. - if uplo == blas.Upper { - kk := 0 - if incX == 1 { - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[j] /= cmplx.Conj(ap[kk]) - } - xj := x[j] - k := kk + 1 - for i := j + 1; i < n; i++ { - x[i] -= xj * cmplx.Conj(ap[k]) - k++ - } - kk += n - j - } - } else { - jx := kx - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[jx] /= cmplx.Conj(ap[kk]) - } - xj := x[jx] - ix := jx + incX - k := kk + 1 - for i := j + 1; i < n; i++ { - x[ix] -= xj * cmplx.Conj(ap[k]) - ix += incX - k++ - } - jx += incX - kk += n - j - } - } - } else { - kk := n*(n+1)/2 - n - if incX == 1 { - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[j] /= cmplx.Conj(ap[kk+j]) - } - xj := x[j] - for i := 0; i < j; i++ { - x[i] -= xj * cmplx.Conj(ap[kk+i]) - } - kk -= j - } - } else { - jx := kx + (n-1)*incX - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[jx] /= cmplx.Conj(ap[kk+j]) - } - xj := x[jx] - ix := kx - for i := 0; i < j; i++ { - x[ix] -= xj * cmplx.Conj(ap[kk+i]) - ix += incX - } - jx -= incX - kk -= j - } - } - } -} - -// Ztrmv performs one of the matrix-vector operations -// x = A * x if trans = blas.NoTrans -// x = Aᵀ * x if trans = blas.Trans -// x = Aᴴ * x if trans = blas.ConjTrans -// where x is a vector, and A is an n×n triangular matrix. -func (Implementation) Ztrmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n int, a []complex128, lda int, x []complex128, incX int) { - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - switch diag { - default: - panic(badDiag) - case blas.NonUnit, blas.Unit: - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - // The elements of A are accessed sequentially with one pass through A. - - if trans == blas.NoTrans { - // Form x = A*x. - if uplo == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[i] *= a[i*lda+i] - } - if n-i-1 > 0 { - x[i] += c128.DotuUnitary(a[i*lda+i+1:i*lda+n], x[i+1:n]) - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[ix] *= a[i*lda+i] - } - if n-i-1 > 0 { - x[ix] += c128.DotuInc(a[i*lda+i+1:i*lda+n], x, uintptr(n-i-1), 1, uintptr(incX), 0, uintptr(ix+incX)) - } - ix += incX - } - } - } else { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[i] *= a[i*lda+i] - } - if i > 0 { - x[i] += c128.DotuUnitary(a[i*lda:i*lda+i], x[:i]) - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[ix] *= a[i*lda+i] - } - if i > 0 { - x[ix] += c128.DotuInc(a[i*lda:i*lda+i], x, uintptr(i), 1, uintptr(incX), 0, uintptr(kx)) - } - ix -= incX - } - } - } - return - } - - if trans == blas.Trans { - // Form x = Aᵀ*x. - if uplo == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - xi := x[i] - if diag == blas.NonUnit { - x[i] *= a[i*lda+i] - } - if n-i-1 > 0 { - c128.AxpyUnitary(xi, a[i*lda+i+1:i*lda+n], x[i+1:n]) - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - xi := x[ix] - if diag == blas.NonUnit { - x[ix] *= a[i*lda+i] - } - if n-i-1 > 0 { - c128.AxpyInc(xi, a[i*lda+i+1:i*lda+n], x, uintptr(n-i-1), 1, uintptr(incX), 0, uintptr(ix+incX)) - } - ix -= incX - } - } - } else { - if incX == 1 { - for i := 0; i < n; i++ { - if i > 0 { - c128.AxpyUnitary(x[i], a[i*lda:i*lda+i], x[:i]) - } - if diag == blas.NonUnit { - x[i] *= a[i*lda+i] - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - if i > 0 { - c128.AxpyInc(x[ix], a[i*lda:i*lda+i], x, uintptr(i), 1, uintptr(incX), 0, uintptr(kx)) - } - if diag == blas.NonUnit { - x[ix] *= a[i*lda+i] - } - ix += incX - } - } - } - return - } - - // Form x = Aᴴ*x. - if uplo == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - xi := x[i] - if diag == blas.NonUnit { - x[i] *= cmplx.Conj(a[i*lda+i]) - } - for j := i + 1; j < n; j++ { - x[j] += xi * cmplx.Conj(a[i*lda+j]) - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - xi := x[ix] - if diag == blas.NonUnit { - x[ix] *= cmplx.Conj(a[i*lda+i]) - } - jx := ix + incX - for j := i + 1; j < n; j++ { - x[jx] += xi * cmplx.Conj(a[i*lda+j]) - jx += incX - } - ix -= incX - } - } - } else { - if incX == 1 { - for i := 0; i < n; i++ { - for j := 0; j < i; j++ { - x[j] += x[i] * cmplx.Conj(a[i*lda+j]) - } - if diag == blas.NonUnit { - x[i] *= cmplx.Conj(a[i*lda+i]) - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - jx := kx - for j := 0; j < i; j++ { - x[jx] += x[ix] * cmplx.Conj(a[i*lda+j]) - jx += incX - } - if diag == blas.NonUnit { - x[ix] *= cmplx.Conj(a[i*lda+i]) - } - ix += incX - } - } - } -} - -// Ztrsv solves one of the systems of equations -// A * x = b if trans == blas.NoTrans -// Aᵀ * x = b if trans == blas.Trans -// Aᴴ * x = b if trans == blas.ConjTrans -// where b and x are n element vectors and A is an n×n triangular matrix. -// -// On entry, x contains the values of b, and the solution is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -func (Implementation) Ztrsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n int, a []complex128, lda int, x []complex128, incX int) { - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - switch diag { - default: - panic(badDiag) - case blas.NonUnit, blas.Unit: - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - // The elements of A are accessed sequentially with one pass through A. - - if trans == blas.NoTrans { - // Form x = inv(A)*x. - if uplo == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - aii := a[i*lda+i] - if n-i-1 > 0 { - x[i] -= c128.DotuUnitary(x[i+1:n], a[i*lda+i+1:i*lda+n]) - } - if diag == blas.NonUnit { - x[i] /= aii - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - aii := a[i*lda+i] - if n-i-1 > 0 { - x[ix] -= c128.DotuInc(x, a[i*lda+i+1:i*lda+n], uintptr(n-i-1), uintptr(incX), 1, uintptr(ix+incX), 0) - } - if diag == blas.NonUnit { - x[ix] /= aii - } - ix -= incX - } - } - } else { - if incX == 1 { - for i := 0; i < n; i++ { - if i > 0 { - x[i] -= c128.DotuUnitary(x[:i], a[i*lda:i*lda+i]) - } - if diag == blas.NonUnit { - x[i] /= a[i*lda+i] - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - if i > 0 { - x[ix] -= c128.DotuInc(x, a[i*lda:i*lda+i], uintptr(i), uintptr(incX), 1, uintptr(kx), 0) - } - if diag == blas.NonUnit { - x[ix] /= a[i*lda+i] - } - ix += incX - } - } - } - return - } - - if trans == blas.Trans { - // Form x = inv(Aᵀ)*x. - if uplo == blas.Upper { - if incX == 1 { - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[j] /= a[j*lda+j] - } - if n-j-1 > 0 { - c128.AxpyUnitary(-x[j], a[j*lda+j+1:j*lda+n], x[j+1:n]) - } - } - } else { - jx := kx - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[jx] /= a[j*lda+j] - } - if n-j-1 > 0 { - c128.AxpyInc(-x[jx], a[j*lda+j+1:j*lda+n], x, uintptr(n-j-1), 1, uintptr(incX), 0, uintptr(jx+incX)) - } - jx += incX - } - } - } else { - if incX == 1 { - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[j] /= a[j*lda+j] - } - xj := x[j] - if j > 0 { - c128.AxpyUnitary(-xj, a[j*lda:j*lda+j], x[:j]) - } - } - } else { - jx := kx + (n-1)*incX - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[jx] /= a[j*lda+j] - } - if j > 0 { - c128.AxpyInc(-x[jx], a[j*lda:j*lda+j], x, uintptr(j), 1, uintptr(incX), 0, uintptr(kx)) - } - jx -= incX - } - } - } - return - } - - // Form x = inv(Aᴴ)*x. - if uplo == blas.Upper { - if incX == 1 { - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[j] /= cmplx.Conj(a[j*lda+j]) - } - xj := x[j] - for i := j + 1; i < n; i++ { - x[i] -= xj * cmplx.Conj(a[j*lda+i]) - } - } - } else { - jx := kx - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[jx] /= cmplx.Conj(a[j*lda+j]) - } - xj := x[jx] - ix := jx + incX - for i := j + 1; i < n; i++ { - x[ix] -= xj * cmplx.Conj(a[j*lda+i]) - ix += incX - } - jx += incX - } - } - } else { - if incX == 1 { - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[j] /= cmplx.Conj(a[j*lda+j]) - } - xj := x[j] - for i := 0; i < j; i++ { - x[i] -= xj * cmplx.Conj(a[j*lda+i]) - } - } - } else { - jx := kx + (n-1)*incX - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[jx] /= cmplx.Conj(a[j*lda+j]) - } - xj := x[jx] - ix := kx - for i := 0; i < j; i++ { - x[ix] -= xj * cmplx.Conj(a[j*lda+i]) - ix += incX - } - jx -= incX - } - } - } -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level2cmplx64.go b/vendor/gonum.org/v1/gonum/blas/gonum/level2cmplx64.go deleted file mode 100644 index 3aa4c21..0000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level2cmplx64.go +++ /dev/null @@ -1,2942 +0,0 @@ -// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT. - -// Copyright ©2017 The Gonum 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 gonum - -import ( - cmplx "gonum.org/v1/gonum/internal/cmplx64" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/c64" -) - -var _ blas.Complex64Level2 = Implementation{} - -// Cgbmv performs one of the matrix-vector operations -// y = alpha * A * x + beta * y if trans = blas.NoTrans -// y = alpha * Aᵀ * x + beta * y if trans = blas.Trans -// y = alpha * Aᴴ * x + beta * y if trans = blas.ConjTrans -// where alpha and beta are scalars, x and y are vectors, and A is an m×n band matrix -// with kL sub-diagonals and kU super-diagonals. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Cgbmv(trans blas.Transpose, m, n, kL, kU int, alpha complex64, a []complex64, lda int, x []complex64, incX int, beta complex64, y []complex64, incY int) { - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if kL < 0 { - panic(kLLT0) - } - if kU < 0 { - panic(kULT0) - } - if lda < kL+kU+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(min(m, n+kL)-1)+kL+kU+1 { - panic(shortA) - } - var lenX, lenY int - if trans == blas.NoTrans { - lenX, lenY = n, m - } else { - lenX, lenY = m, n - } - if (incX > 0 && len(x) <= (lenX-1)*incX) || (incX < 0 && len(x) <= (1-lenX)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (lenY-1)*incY) || (incY < 0 && len(y) <= (1-lenY)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - var kx int - if incX < 0 { - kx = (1 - lenX) * incX - } - var ky int - if incY < 0 { - ky = (1 - lenY) * incY - } - - // Form y = beta*y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:lenY] { - y[i] = 0 - } - } else { - c64.ScalUnitary(beta, y[:lenY]) - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < lenY; i++ { - y[iy] = 0 - iy += incY - } - } else { - if incY > 0 { - c64.ScalInc(beta, y, uintptr(lenY), uintptr(incY)) - } else { - c64.ScalInc(beta, y, uintptr(lenY), uintptr(-incY)) - } - } - } - } - - nRow := min(m, n+kL) - nCol := kL + 1 + kU - switch trans { - case blas.NoTrans: - iy := ky - if incX == 1 { - for i := 0; i < nRow; i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - aRow := a[i*lda+l : i*lda+u] - off := max(0, i-kL) - xtmp := x[off : off+u-l] - var sum complex64 - for j, v := range aRow { - sum += xtmp[j] * v - } - y[iy] += alpha * sum - iy += incY - } - } else { - for i := 0; i < nRow; i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - aRow := a[i*lda+l : i*lda+u] - off := max(0, i-kL) * incX - jx := kx - var sum complex64 - for _, v := range aRow { - sum += x[off+jx] * v - jx += incX - } - y[iy] += alpha * sum - iy += incY - } - } - case blas.Trans: - if incX == 1 { - for i := 0; i < nRow; i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - aRow := a[i*lda+l : i*lda+u] - off := max(0, i-kL) * incY - alphaxi := alpha * x[i] - jy := ky - for _, v := range aRow { - y[off+jy] += alphaxi * v - jy += incY - } - } - } else { - ix := kx - for i := 0; i < nRow; i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - aRow := a[i*lda+l : i*lda+u] - off := max(0, i-kL) * incY - alphaxi := alpha * x[ix] - jy := ky - for _, v := range aRow { - y[off+jy] += alphaxi * v - jy += incY - } - ix += incX - } - } - case blas.ConjTrans: - if incX == 1 { - for i := 0; i < nRow; i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - aRow := a[i*lda+l : i*lda+u] - off := max(0, i-kL) * incY - alphaxi := alpha * x[i] - jy := ky - for _, v := range aRow { - y[off+jy] += alphaxi * cmplx.Conj(v) - jy += incY - } - } - } else { - ix := kx - for i := 0; i < nRow; i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - aRow := a[i*lda+l : i*lda+u] - off := max(0, i-kL) * incY - alphaxi := alpha * x[ix] - jy := ky - for _, v := range aRow { - y[off+jy] += alphaxi * cmplx.Conj(v) - jy += incY - } - ix += incX - } - } - } -} - -// Cgemv performs one of the matrix-vector operations -// y = alpha * A * x + beta * y if trans = blas.NoTrans -// y = alpha * Aᵀ * x + beta * y if trans = blas.Trans -// y = alpha * Aᴴ * x + beta * y if trans = blas.ConjTrans -// where alpha and beta are scalars, x and y are vectors, and A is an m×n dense matrix. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Cgemv(trans blas.Transpose, m, n int, alpha complex64, a []complex64, lda int, x []complex64, incX int, beta complex64, y []complex64, incY int) { - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - var lenX, lenY int - if trans == blas.NoTrans { - lenX = n - lenY = m - } else { - lenX = m - lenY = n - } - if len(a) < lda*(m-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (lenX-1)*incX) || (incX < 0 && len(x) <= (1-lenX)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (lenY-1)*incY) || (incY < 0 && len(y) <= (1-lenY)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - var kx int - if incX < 0 { - kx = (1 - lenX) * incX - } - var ky int - if incY < 0 { - ky = (1 - lenY) * incY - } - - // Form y = beta*y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:lenY] { - y[i] = 0 - } - } else { - c64.ScalUnitary(beta, y[:lenY]) - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < lenY; i++ { - y[iy] = 0 - iy += incY - } - } else { - if incY > 0 { - c64.ScalInc(beta, y, uintptr(lenY), uintptr(incY)) - } else { - c64.ScalInc(beta, y, uintptr(lenY), uintptr(-incY)) - } - } - } - } - - if alpha == 0 { - return - } - - switch trans { - default: - // Form y = alpha*A*x + y. - iy := ky - if incX == 1 { - for i := 0; i < m; i++ { - y[iy] += alpha * c64.DotuUnitary(a[i*lda:i*lda+n], x[:n]) - iy += incY - } - return - } - for i := 0; i < m; i++ { - y[iy] += alpha * c64.DotuInc(a[i*lda:i*lda+n], x, uintptr(n), 1, uintptr(incX), 0, uintptr(kx)) - iy += incY - } - return - - case blas.Trans: - // Form y = alpha*Aᵀ*x + y. - ix := kx - if incY == 1 { - for i := 0; i < m; i++ { - c64.AxpyUnitary(alpha*x[ix], a[i*lda:i*lda+n], y[:n]) - ix += incX - } - return - } - for i := 0; i < m; i++ { - c64.AxpyInc(alpha*x[ix], a[i*lda:i*lda+n], y, uintptr(n), 1, uintptr(incY), 0, uintptr(ky)) - ix += incX - } - return - - case blas.ConjTrans: - // Form y = alpha*Aᴴ*x + y. - ix := kx - if incY == 1 { - for i := 0; i < m; i++ { - tmp := alpha * x[ix] - for j := 0; j < n; j++ { - y[j] += tmp * cmplx.Conj(a[i*lda+j]) - } - ix += incX - } - return - } - for i := 0; i < m; i++ { - tmp := alpha * x[ix] - jy := ky - for j := 0; j < n; j++ { - y[jy] += tmp * cmplx.Conj(a[i*lda+j]) - jy += incY - } - ix += incX - } - return - } -} - -// Cgerc performs the rank-one operation -// A += alpha * x * yᴴ -// where A is an m×n dense matrix, alpha is a scalar, x is an m element vector, -// and y is an n element vector. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Cgerc(m, n int, alpha complex64, x []complex64, incX int, y []complex64, incY int, a []complex64, lda int) { - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (m-1)*incX) || (incX < 0 && len(x) <= (1-m)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(a) < lda*(m-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - var kx, jy int - if incX < 0 { - kx = (1 - m) * incX - } - if incY < 0 { - jy = (1 - n) * incY - } - for j := 0; j < n; j++ { - if y[jy] != 0 { - tmp := alpha * cmplx.Conj(y[jy]) - c64.AxpyInc(tmp, x, a[j:], uintptr(m), uintptr(incX), uintptr(lda), uintptr(kx), 0) - } - jy += incY - } -} - -// Cgeru performs the rank-one operation -// A += alpha * x * yᵀ -// where A is an m×n dense matrix, alpha is a scalar, x is an m element vector, -// and y is an n element vector. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Cgeru(m, n int, alpha complex64, x []complex64, incX int, y []complex64, incY int, a []complex64, lda int) { - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (m-1)*incX) || (incX < 0 && len(x) <= (1-m)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(a) < lda*(m-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - var kx int - if incX < 0 { - kx = (1 - m) * incX - } - if incY == 1 { - for i := 0; i < m; i++ { - if x[kx] != 0 { - tmp := alpha * x[kx] - c64.AxpyUnitary(tmp, y[:n], a[i*lda:i*lda+n]) - } - kx += incX - } - return - } - var jy int - if incY < 0 { - jy = (1 - n) * incY - } - for i := 0; i < m; i++ { - if x[kx] != 0 { - tmp := alpha * x[kx] - c64.AxpyInc(tmp, y, a[i*lda:i*lda+n], uintptr(n), uintptr(incY), 1, uintptr(jy), 0) - } - kx += incX - } -} - -// Chbmv performs the matrix-vector operation -// y = alpha * A * x + beta * y -// where alpha and beta are scalars, x and y are vectors, and A is an n×n -// Hermitian band matrix with k super-diagonals. The imaginary parts of -// the diagonal elements of A are ignored and assumed to be zero. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Chbmv(uplo blas.Uplo, n, k int, alpha complex64, a []complex64, lda int, x []complex64, incX int, beta complex64, y []complex64, incY int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - if lda < k+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+k+1 { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - // Set up the start indices in X and Y. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - var ky int - if incY < 0 { - ky = (1 - n) * incY - } - - // Form y = beta*y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:n] { - y[i] = 0 - } - } else { - for i, v := range y[:n] { - y[i] = beta * v - } - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < n; i++ { - y[iy] = 0 - iy += incY - } - } else { - for i := 0; i < n; i++ { - y[iy] = beta * y[iy] - iy += incY - } - } - } - } - - if alpha == 0 { - return - } - - // The elements of A are accessed sequentially with one pass through a. - switch uplo { - case blas.Upper: - iy := ky - if incX == 1 { - for i := 0; i < n; i++ { - aRow := a[i*lda:] - alphaxi := alpha * x[i] - sum := alphaxi * complex(real(aRow[0]), 0) - u := min(k+1, n-i) - jy := incY - for j := 1; j < u; j++ { - v := aRow[j] - sum += alpha * x[i+j] * v - y[iy+jy] += alphaxi * cmplx.Conj(v) - jy += incY - } - y[iy] += sum - iy += incY - } - } else { - ix := kx - for i := 0; i < n; i++ { - aRow := a[i*lda:] - alphaxi := alpha * x[ix] - sum := alphaxi * complex(real(aRow[0]), 0) - u := min(k+1, n-i) - jx := incX - jy := incY - for j := 1; j < u; j++ { - v := aRow[j] - sum += alpha * x[ix+jx] * v - y[iy+jy] += alphaxi * cmplx.Conj(v) - jx += incX - jy += incY - } - y[iy] += sum - ix += incX - iy += incY - } - } - case blas.Lower: - iy := ky - if incX == 1 { - for i := 0; i < n; i++ { - l := max(0, k-i) - alphaxi := alpha * x[i] - jy := l * incY - aRow := a[i*lda:] - for j := l; j < k; j++ { - v := aRow[j] - y[iy] += alpha * v * x[i-k+j] - y[iy-k*incY+jy] += alphaxi * cmplx.Conj(v) - jy += incY - } - y[iy] += alphaxi * complex(real(aRow[k]), 0) - iy += incY - } - } else { - ix := kx - for i := 0; i < n; i++ { - l := max(0, k-i) - alphaxi := alpha * x[ix] - jx := l * incX - jy := l * incY - aRow := a[i*lda:] - for j := l; j < k; j++ { - v := aRow[j] - y[iy] += alpha * v * x[ix-k*incX+jx] - y[iy-k*incY+jy] += alphaxi * cmplx.Conj(v) - jx += incX - jy += incY - } - y[iy] += alphaxi * complex(real(aRow[k]), 0) - ix += incX - iy += incY - } - } - } -} - -// Chemv performs the matrix-vector operation -// y = alpha * A * x + beta * y -// where alpha and beta are scalars, x and y are vectors, and A is an n×n -// Hermitian matrix. The imaginary parts of the diagonal elements of A are -// ignored and assumed to be zero. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Chemv(uplo blas.Uplo, n int, alpha complex64, a []complex64, lda int, x []complex64, incX int, beta complex64, y []complex64, incY int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - // Set up the start indices in X and Y. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - var ky int - if incY < 0 { - ky = (1 - n) * incY - } - - // Form y = beta*y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:n] { - y[i] = 0 - } - } else { - for i, v := range y[:n] { - y[i] = beta * v - } - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < n; i++ { - y[iy] = 0 - iy += incY - } - } else { - for i := 0; i < n; i++ { - y[iy] = beta * y[iy] - iy += incY - } - } - } - } - - if alpha == 0 { - return - } - - // The elements of A are accessed sequentially with one pass through - // the triangular part of A. - - if uplo == blas.Upper { - // Form y when A is stored in upper triangle. - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - tmp1 := alpha * x[i] - var tmp2 complex64 - for j := i + 1; j < n; j++ { - y[j] += tmp1 * cmplx.Conj(a[i*lda+j]) - tmp2 += a[i*lda+j] * x[j] - } - aii := complex(real(a[i*lda+i]), 0) - y[i] += tmp1*aii + alpha*tmp2 - } - } else { - ix := kx - iy := ky - for i := 0; i < n; i++ { - tmp1 := alpha * x[ix] - var tmp2 complex64 - jx := ix - jy := iy - for j := i + 1; j < n; j++ { - jx += incX - jy += incY - y[jy] += tmp1 * cmplx.Conj(a[i*lda+j]) - tmp2 += a[i*lda+j] * x[jx] - } - aii := complex(real(a[i*lda+i]), 0) - y[iy] += tmp1*aii + alpha*tmp2 - ix += incX - iy += incY - } - } - return - } - - // Form y when A is stored in lower triangle. - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - tmp1 := alpha * x[i] - var tmp2 complex64 - for j := 0; j < i; j++ { - y[j] += tmp1 * cmplx.Conj(a[i*lda+j]) - tmp2 += a[i*lda+j] * x[j] - } - aii := complex(real(a[i*lda+i]), 0) - y[i] += tmp1*aii + alpha*tmp2 - } - } else { - ix := kx - iy := ky - for i := 0; i < n; i++ { - tmp1 := alpha * x[ix] - var tmp2 complex64 - jx := kx - jy := ky - for j := 0; j < i; j++ { - y[jy] += tmp1 * cmplx.Conj(a[i*lda+j]) - tmp2 += a[i*lda+j] * x[jx] - jx += incX - jy += incY - } - aii := complex(real(a[i*lda+i]), 0) - y[iy] += tmp1*aii + alpha*tmp2 - ix += incX - iy += incY - } - } -} - -// Cher performs the Hermitian rank-one operation -// A += alpha * x * xᴴ -// where A is an n×n Hermitian matrix, alpha is a real scalar, and x is an n -// element vector. On entry, the imaginary parts of the diagonal elements of A -// are ignored and assumed to be zero, on return they will be set to zero. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Cher(uplo blas.Uplo, n int, alpha float32, x []complex64, incX int, a []complex64, lda int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if len(a) < lda*(n-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - if uplo == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - if x[i] != 0 { - tmp := complex(alpha*real(x[i]), alpha*imag(x[i])) - aii := real(a[i*lda+i]) - xtmp := real(tmp * cmplx.Conj(x[i])) - a[i*lda+i] = complex(aii+xtmp, 0) - for j := i + 1; j < n; j++ { - a[i*lda+j] += tmp * cmplx.Conj(x[j]) - } - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - } - return - } - - ix := kx - for i := 0; i < n; i++ { - if x[ix] != 0 { - tmp := complex(alpha*real(x[ix]), alpha*imag(x[ix])) - aii := real(a[i*lda+i]) - xtmp := real(tmp * cmplx.Conj(x[ix])) - a[i*lda+i] = complex(aii+xtmp, 0) - jx := ix + incX - for j := i + 1; j < n; j++ { - a[i*lda+j] += tmp * cmplx.Conj(x[jx]) - jx += incX - } - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - ix += incX - } - return - } - - if incX == 1 { - for i := 0; i < n; i++ { - if x[i] != 0 { - tmp := complex(alpha*real(x[i]), alpha*imag(x[i])) - for j := 0; j < i; j++ { - a[i*lda+j] += tmp * cmplx.Conj(x[j]) - } - aii := real(a[i*lda+i]) - xtmp := real(tmp * cmplx.Conj(x[i])) - a[i*lda+i] = complex(aii+xtmp, 0) - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - } - return - } - - ix := kx - for i := 0; i < n; i++ { - if x[ix] != 0 { - tmp := complex(alpha*real(x[ix]), alpha*imag(x[ix])) - jx := kx - for j := 0; j < i; j++ { - a[i*lda+j] += tmp * cmplx.Conj(x[jx]) - jx += incX - } - aii := real(a[i*lda+i]) - xtmp := real(tmp * cmplx.Conj(x[ix])) - a[i*lda+i] = complex(aii+xtmp, 0) - - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - ix += incX - } -} - -// Cher2 performs the Hermitian rank-two operation -// A += alpha * x * yᴴ + conj(alpha) * y * xᴴ -// where alpha is a scalar, x and y are n element vectors and A is an n×n -// Hermitian matrix. On entry, the imaginary parts of the diagonal elements are -// ignored and assumed to be zero. On return they will be set to zero. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Cher2(uplo blas.Uplo, n int, alpha complex64, x []complex64, incX int, y []complex64, incY int, a []complex64, lda int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(a) < lda*(n-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - var kx, ky int - var ix, iy int - if incX != 1 || incY != 1 { - if incX < 0 { - kx = (1 - n) * incX - } - if incY < 0 { - ky = (1 - n) * incY - } - ix = kx - iy = ky - } - if uplo == blas.Upper { - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - if x[i] != 0 || y[i] != 0 { - tmp1 := alpha * x[i] - tmp2 := cmplx.Conj(alpha) * y[i] - aii := real(a[i*lda+i]) + real(tmp1*cmplx.Conj(y[i])) + real(tmp2*cmplx.Conj(x[i])) - a[i*lda+i] = complex(aii, 0) - for j := i + 1; j < n; j++ { - a[i*lda+j] += tmp1*cmplx.Conj(y[j]) + tmp2*cmplx.Conj(x[j]) - } - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - } - return - } - for i := 0; i < n; i++ { - if x[ix] != 0 || y[iy] != 0 { - tmp1 := alpha * x[ix] - tmp2 := cmplx.Conj(alpha) * y[iy] - aii := real(a[i*lda+i]) + real(tmp1*cmplx.Conj(y[iy])) + real(tmp2*cmplx.Conj(x[ix])) - a[i*lda+i] = complex(aii, 0) - jx := ix + incX - jy := iy + incY - for j := i + 1; j < n; j++ { - a[i*lda+j] += tmp1*cmplx.Conj(y[jy]) + tmp2*cmplx.Conj(x[jx]) - jx += incX - jy += incY - } - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - ix += incX - iy += incY - } - return - } - - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - if x[i] != 0 || y[i] != 0 { - tmp1 := alpha * x[i] - tmp2 := cmplx.Conj(alpha) * y[i] - for j := 0; j < i; j++ { - a[i*lda+j] += tmp1*cmplx.Conj(y[j]) + tmp2*cmplx.Conj(x[j]) - } - aii := real(a[i*lda+i]) + real(tmp1*cmplx.Conj(y[i])) + real(tmp2*cmplx.Conj(x[i])) - a[i*lda+i] = complex(aii, 0) - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - } - return - } - for i := 0; i < n; i++ { - if x[ix] != 0 || y[iy] != 0 { - tmp1 := alpha * x[ix] - tmp2 := cmplx.Conj(alpha) * y[iy] - jx := kx - jy := ky - for j := 0; j < i; j++ { - a[i*lda+j] += tmp1*cmplx.Conj(y[jy]) + tmp2*cmplx.Conj(x[jx]) - jx += incX - jy += incY - } - aii := real(a[i*lda+i]) + real(tmp1*cmplx.Conj(y[iy])) + real(tmp2*cmplx.Conj(x[ix])) - a[i*lda+i] = complex(aii, 0) - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - ix += incX - iy += incY - } -} - -// Chpmv performs the matrix-vector operation -// y = alpha * A * x + beta * y -// where alpha and beta are scalars, x and y are vectors, and A is an n×n -// Hermitian matrix in packed form. The imaginary parts of the diagonal -// elements of A are ignored and assumed to be zero. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Chpmv(uplo blas.Uplo, n int, alpha complex64, ap []complex64, x []complex64, incX int, beta complex64, y []complex64, incY int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - // Set up the start indices in X and Y. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - var ky int - if incY < 0 { - ky = (1 - n) * incY - } - - // Form y = beta*y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:n] { - y[i] = 0 - } - } else { - for i, v := range y[:n] { - y[i] = beta * v - } - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < n; i++ { - y[iy] = 0 - iy += incY - } - } else { - for i := 0; i < n; i++ { - y[iy] *= beta - iy += incY - } - } - } - } - - if alpha == 0 { - return - } - - // The elements of A are accessed sequentially with one pass through ap. - - var kk int - if uplo == blas.Upper { - // Form y when ap contains the upper triangle. - // Here, kk points to the current diagonal element in ap. - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - tmp1 := alpha * x[i] - y[i] += tmp1 * complex(real(ap[kk]), 0) - var tmp2 complex64 - k := kk + 1 - for j := i + 1; j < n; j++ { - y[j] += tmp1 * cmplx.Conj(ap[k]) - tmp2 += ap[k] * x[j] - k++ - } - y[i] += alpha * tmp2 - kk += n - i - } - } else { - ix := kx - iy := ky - for i := 0; i < n; i++ { - tmp1 := alpha * x[ix] - y[iy] += tmp1 * complex(real(ap[kk]), 0) - var tmp2 complex64 - jx := ix - jy := iy - for k := kk + 1; k < kk+n-i; k++ { - jx += incX - jy += incY - y[jy] += tmp1 * cmplx.Conj(ap[k]) - tmp2 += ap[k] * x[jx] - } - y[iy] += alpha * tmp2 - ix += incX - iy += incY - kk += n - i - } - } - return - } - - // Form y when ap contains the lower triangle. - // Here, kk points to the beginning of current row in ap. - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - tmp1 := alpha * x[i] - var tmp2 complex64 - k := kk - for j := 0; j < i; j++ { - y[j] += tmp1 * cmplx.Conj(ap[k]) - tmp2 += ap[k] * x[j] - k++ - } - aii := complex(real(ap[kk+i]), 0) - y[i] += tmp1*aii + alpha*tmp2 - kk += i + 1 - } - } else { - ix := kx - iy := ky - for i := 0; i < n; i++ { - tmp1 := alpha * x[ix] - var tmp2 complex64 - jx := kx - jy := ky - for k := kk; k < kk+i; k++ { - y[jy] += tmp1 * cmplx.Conj(ap[k]) - tmp2 += ap[k] * x[jx] - jx += incX - jy += incY - } - aii := complex(real(ap[kk+i]), 0) - y[iy] += tmp1*aii + alpha*tmp2 - ix += incX - iy += incY - kk += i + 1 - } - } -} - -// Chpr performs the Hermitian rank-1 operation -// A += alpha * x * xᴴ -// where alpha is a real scalar, x is a vector, and A is an n×n hermitian matrix -// in packed form. On entry, the imaginary parts of the diagonal elements are -// assumed to be zero, and on return they are set to zero. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Chpr(uplo blas.Uplo, n int, alpha float32, x []complex64, incX int, ap []complex64) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - // The elements of A are accessed sequentially with one pass through ap. - - var kk int - if uplo == blas.Upper { - // Form A when upper triangle is stored in AP. - // Here, kk points to the current diagonal element in ap. - if incX == 1 { - for i := 0; i < n; i++ { - xi := x[i] - if xi != 0 { - aii := real(ap[kk]) + alpha*real(cmplx.Conj(xi)*xi) - ap[kk] = complex(aii, 0) - - tmp := complex(alpha, 0) * xi - a := ap[kk+1 : kk+n-i] - x := x[i+1 : n] - for j, v := range x { - a[j] += tmp * cmplx.Conj(v) - } - } else { - ap[kk] = complex(real(ap[kk]), 0) - } - kk += n - i - } - } else { - ix := kx - for i := 0; i < n; i++ { - xi := x[ix] - if xi != 0 { - aii := real(ap[kk]) + alpha*real(cmplx.Conj(xi)*xi) - ap[kk] = complex(aii, 0) - - tmp := complex(alpha, 0) * xi - jx := ix + incX - a := ap[kk+1 : kk+n-i] - for k := range a { - a[k] += tmp * cmplx.Conj(x[jx]) - jx += incX - } - } else { - ap[kk] = complex(real(ap[kk]), 0) - } - ix += incX - kk += n - i - } - } - return - } - - // Form A when lower triangle is stored in AP. - // Here, kk points to the beginning of current row in ap. - if incX == 1 { - for i := 0; i < n; i++ { - xi := x[i] - if xi != 0 { - tmp := complex(alpha, 0) * xi - a := ap[kk : kk+i] - for j, v := range x[:i] { - a[j] += tmp * cmplx.Conj(v) - } - - aii := real(ap[kk+i]) + alpha*real(cmplx.Conj(xi)*xi) - ap[kk+i] = complex(aii, 0) - } else { - ap[kk+i] = complex(real(ap[kk+i]), 0) - } - kk += i + 1 - } - } else { - ix := kx - for i := 0; i < n; i++ { - xi := x[ix] - if xi != 0 { - tmp := complex(alpha, 0) * xi - a := ap[kk : kk+i] - jx := kx - for k := range a { - a[k] += tmp * cmplx.Conj(x[jx]) - jx += incX - } - - aii := real(ap[kk+i]) + alpha*real(cmplx.Conj(xi)*xi) - ap[kk+i] = complex(aii, 0) - } else { - ap[kk+i] = complex(real(ap[kk+i]), 0) - } - ix += incX - kk += i + 1 - } - } -} - -// Chpr2 performs the Hermitian rank-2 operation -// A += alpha * x * yᴴ + conj(alpha) * y * xᴴ -// where alpha is a complex scalar, x and y are n element vectors, and A is an -// n×n Hermitian matrix, supplied in packed form. On entry, the imaginary parts -// of the diagonal elements are assumed to be zero, and on return they are set to zero. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Chpr2(uplo blas.Uplo, n int, alpha complex64, x []complex64, incX int, y []complex64, incY int, ap []complex64) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - // Set up start indices in X and Y. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - var ky int - if incY < 0 { - ky = (1 - n) * incY - } - - // The elements of A are accessed sequentially with one pass through ap. - - var kk int - if uplo == blas.Upper { - // Form A when upper triangle is stored in AP. - // Here, kk points to the current diagonal element in ap. - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - if x[i] != 0 || y[i] != 0 { - tmp1 := alpha * x[i] - tmp2 := cmplx.Conj(alpha) * y[i] - aii := real(ap[kk]) + real(tmp1*cmplx.Conj(y[i])) + real(tmp2*cmplx.Conj(x[i])) - ap[kk] = complex(aii, 0) - k := kk + 1 - for j := i + 1; j < n; j++ { - ap[k] += tmp1*cmplx.Conj(y[j]) + tmp2*cmplx.Conj(x[j]) - k++ - } - } else { - ap[kk] = complex(real(ap[kk]), 0) - } - kk += n - i - } - } else { - ix := kx - iy := ky - for i := 0; i < n; i++ { - if x[ix] != 0 || y[iy] != 0 { - tmp1 := alpha * x[ix] - tmp2 := cmplx.Conj(alpha) * y[iy] - aii := real(ap[kk]) + real(tmp1*cmplx.Conj(y[iy])) + real(tmp2*cmplx.Conj(x[ix])) - ap[kk] = complex(aii, 0) - jx := ix + incX - jy := iy + incY - for k := kk + 1; k < kk+n-i; k++ { - ap[k] += tmp1*cmplx.Conj(y[jy]) + tmp2*cmplx.Conj(x[jx]) - jx += incX - jy += incY - } - } else { - ap[kk] = complex(real(ap[kk]), 0) - } - ix += incX - iy += incY - kk += n - i - } - } - return - } - - // Form A when lower triangle is stored in AP. - // Here, kk points to the beginning of current row in ap. - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - if x[i] != 0 || y[i] != 0 { - tmp1 := alpha * x[i] - tmp2 := cmplx.Conj(alpha) * y[i] - k := kk - for j := 0; j < i; j++ { - ap[k] += tmp1*cmplx.Conj(y[j]) + tmp2*cmplx.Conj(x[j]) - k++ - } - aii := real(ap[kk+i]) + real(tmp1*cmplx.Conj(y[i])) + real(tmp2*cmplx.Conj(x[i])) - ap[kk+i] = complex(aii, 0) - } else { - ap[kk+i] = complex(real(ap[kk+i]), 0) - } - kk += i + 1 - } - } else { - ix := kx - iy := ky - for i := 0; i < n; i++ { - if x[ix] != 0 || y[iy] != 0 { - tmp1 := alpha * x[ix] - tmp2 := cmplx.Conj(alpha) * y[iy] - jx := kx - jy := ky - for k := kk; k < kk+i; k++ { - ap[k] += tmp1*cmplx.Conj(y[jy]) + tmp2*cmplx.Conj(x[jx]) - jx += incX - jy += incY - } - aii := real(ap[kk+i]) + real(tmp1*cmplx.Conj(y[iy])) + real(tmp2*cmplx.Conj(x[ix])) - ap[kk+i] = complex(aii, 0) - } else { - ap[kk+i] = complex(real(ap[kk+i]), 0) - } - ix += incX - iy += incY - kk += i + 1 - } - } -} - -// Ctbmv performs one of the matrix-vector operations -// x = A * x if trans = blas.NoTrans -// x = Aᵀ * x if trans = blas.Trans -// x = Aᴴ * x if trans = blas.ConjTrans -// where x is an n element vector and A is an n×n triangular band matrix, with -// (k+1) diagonals. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Ctbmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n, k int, a []complex64, lda int, x []complex64, incX int) { - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - switch diag { - default: - panic(badDiag) - case blas.NonUnit, blas.Unit: - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - if lda < k+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+k+1 { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - switch trans { - case blas.NoTrans: - if uplo == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - xi := x[i] - if diag == blas.NonUnit { - xi *= a[i*lda] - } - kk := min(k, n-i-1) - for j, aij := range a[i*lda+1 : i*lda+kk+1] { - xi += x[i+j+1] * aij - } - x[i] = xi - } - } else { - ix := kx - for i := 0; i < n; i++ { - xi := x[ix] - if diag == blas.NonUnit { - xi *= a[i*lda] - } - kk := min(k, n-i-1) - jx := ix + incX - for _, aij := range a[i*lda+1 : i*lda+kk+1] { - xi += x[jx] * aij - jx += incX - } - x[ix] = xi - ix += incX - } - } - } else { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - xi := x[i] - if diag == blas.NonUnit { - xi *= a[i*lda+k] - } - kk := min(k, i) - for j, aij := range a[i*lda+k-kk : i*lda+k] { - xi += x[i-kk+j] * aij - } - x[i] = xi - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - xi := x[ix] - if diag == blas.NonUnit { - xi *= a[i*lda+k] - } - kk := min(k, i) - jx := ix - kk*incX - for _, aij := range a[i*lda+k-kk : i*lda+k] { - xi += x[jx] * aij - jx += incX - } - x[ix] = xi - ix -= incX - } - } - } - case blas.Trans: - if uplo == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - kk := min(k, n-i-1) - xi := x[i] - for j, aij := range a[i*lda+1 : i*lda+kk+1] { - x[i+j+1] += xi * aij - } - if diag == blas.NonUnit { - x[i] *= a[i*lda] - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - kk := min(k, n-i-1) - jx := ix + incX - xi := x[ix] - for _, aij := range a[i*lda+1 : i*lda+kk+1] { - x[jx] += xi * aij - jx += incX - } - if diag == blas.NonUnit { - x[ix] *= a[i*lda] - } - ix -= incX - } - } - } else { - if incX == 1 { - for i := 0; i < n; i++ { - kk := min(k, i) - xi := x[i] - for j, aij := range a[i*lda+k-kk : i*lda+k] { - x[i-kk+j] += xi * aij - } - if diag == blas.NonUnit { - x[i] *= a[i*lda+k] - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - kk := min(k, i) - jx := ix - kk*incX - xi := x[ix] - for _, aij := range a[i*lda+k-kk : i*lda+k] { - x[jx] += xi * aij - jx += incX - } - if diag == blas.NonUnit { - x[ix] *= a[i*lda+k] - } - ix += incX - } - } - } - case blas.ConjTrans: - if uplo == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - kk := min(k, n-i-1) - xi := x[i] - for j, aij := range a[i*lda+1 : i*lda+kk+1] { - x[i+j+1] += xi * cmplx.Conj(aij) - } - if diag == blas.NonUnit { - x[i] *= cmplx.Conj(a[i*lda]) - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - kk := min(k, n-i-1) - jx := ix + incX - xi := x[ix] - for _, aij := range a[i*lda+1 : i*lda+kk+1] { - x[jx] += xi * cmplx.Conj(aij) - jx += incX - } - if diag == blas.NonUnit { - x[ix] *= cmplx.Conj(a[i*lda]) - } - ix -= incX - } - } - } else { - if incX == 1 { - for i := 0; i < n; i++ { - kk := min(k, i) - xi := x[i] - for j, aij := range a[i*lda+k-kk : i*lda+k] { - x[i-kk+j] += xi * cmplx.Conj(aij) - } - if diag == blas.NonUnit { - x[i] *= cmplx.Conj(a[i*lda+k]) - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - kk := min(k, i) - jx := ix - kk*incX - xi := x[ix] - for _, aij := range a[i*lda+k-kk : i*lda+k] { - x[jx] += xi * cmplx.Conj(aij) - jx += incX - } - if diag == blas.NonUnit { - x[ix] *= cmplx.Conj(a[i*lda+k]) - } - ix += incX - } - } - } - } -} - -// Ctbsv solves one of the systems of equations -// A * x = b if trans == blas.NoTrans -// Aᵀ * x = b if trans == blas.Trans -// Aᴴ * x = b if trans == blas.ConjTrans -// where b and x are n element vectors and A is an n×n triangular band matrix -// with (k+1) diagonals. -// -// On entry, x contains the values of b, and the solution is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Ctbsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n, k int, a []complex64, lda int, x []complex64, incX int) { - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - switch diag { - default: - panic(badDiag) - case blas.NonUnit, blas.Unit: - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - if lda < k+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+k+1 { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - switch trans { - case blas.NoTrans: - if uplo == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - kk := min(k, n-i-1) - var sum complex64 - for j, aij := range a[i*lda+1 : i*lda+kk+1] { - sum += x[i+1+j] * aij - } - x[i] -= sum - if diag == blas.NonUnit { - x[i] /= a[i*lda] - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - kk := min(k, n-i-1) - var sum complex64 - jx := ix + incX - for _, aij := range a[i*lda+1 : i*lda+kk+1] { - sum += x[jx] * aij - jx += incX - } - x[ix] -= sum - if diag == blas.NonUnit { - x[ix] /= a[i*lda] - } - ix -= incX - } - } - } else { - if incX == 1 { - for i := 0; i < n; i++ { - kk := min(k, i) - var sum complex64 - for j, aij := range a[i*lda+k-kk : i*lda+k] { - sum += x[i-kk+j] * aij - } - x[i] -= sum - if diag == blas.NonUnit { - x[i] /= a[i*lda+k] - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - kk := min(k, i) - var sum complex64 - jx := ix - kk*incX - for _, aij := range a[i*lda+k-kk : i*lda+k] { - sum += x[jx] * aij - jx += incX - } - x[ix] -= sum - if diag == blas.NonUnit { - x[ix] /= a[i*lda+k] - } - ix += incX - } - } - } - case blas.Trans: - if uplo == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[i] /= a[i*lda] - } - kk := min(k, n-i-1) - xi := x[i] - for j, aij := range a[i*lda+1 : i*lda+kk+1] { - x[i+1+j] -= xi * aij - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[ix] /= a[i*lda] - } - kk := min(k, n-i-1) - xi := x[ix] - jx := ix + incX - for _, aij := range a[i*lda+1 : i*lda+kk+1] { - x[jx] -= xi * aij - jx += incX - } - ix += incX - } - } - } else { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[i] /= a[i*lda+k] - } - kk := min(k, i) - xi := x[i] - for j, aij := range a[i*lda+k-kk : i*lda+k] { - x[i-kk+j] -= xi * aij - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[ix] /= a[i*lda+k] - } - kk := min(k, i) - xi := x[ix] - jx := ix - kk*incX - for _, aij := range a[i*lda+k-kk : i*lda+k] { - x[jx] -= xi * aij - jx += incX - } - ix -= incX - } - } - } - case blas.ConjTrans: - if uplo == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[i] /= cmplx.Conj(a[i*lda]) - } - kk := min(k, n-i-1) - xi := x[i] - for j, aij := range a[i*lda+1 : i*lda+kk+1] { - x[i+1+j] -= xi * cmplx.Conj(aij) - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[ix] /= cmplx.Conj(a[i*lda]) - } - kk := min(k, n-i-1) - xi := x[ix] - jx := ix + incX - for _, aij := range a[i*lda+1 : i*lda+kk+1] { - x[jx] -= xi * cmplx.Conj(aij) - jx += incX - } - ix += incX - } - } - } else { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[i] /= cmplx.Conj(a[i*lda+k]) - } - kk := min(k, i) - xi := x[i] - for j, aij := range a[i*lda+k-kk : i*lda+k] { - x[i-kk+j] -= xi * cmplx.Conj(aij) - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[ix] /= cmplx.Conj(a[i*lda+k]) - } - kk := min(k, i) - xi := x[ix] - jx := ix - kk*incX - for _, aij := range a[i*lda+k-kk : i*lda+k] { - x[jx] -= xi * cmplx.Conj(aij) - jx += incX - } - ix -= incX - } - } - } - } -} - -// Ctpmv performs one of the matrix-vector operations -// x = A * x if trans = blas.NoTrans -// x = Aᵀ * x if trans = blas.Trans -// x = Aᴴ * x if trans = blas.ConjTrans -// where x is an n element vector and A is an n×n triangular matrix, supplied in -// packed form. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Ctpmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n int, ap []complex64, x []complex64, incX int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch diag { - default: - panic(badDiag) - case blas.NonUnit, blas.Unit: - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - // The elements of A are accessed sequentially with one pass through A. - - if trans == blas.NoTrans { - // Form x = A*x. - if uplo == blas.Upper { - // kk points to the current diagonal element in ap. - kk := 0 - if incX == 1 { - x = x[:n] - for i := range x { - if diag == blas.NonUnit { - x[i] *= ap[kk] - } - if n-i-1 > 0 { - x[i] += c64.DotuUnitary(ap[kk+1:kk+n-i], x[i+1:]) - } - kk += n - i - } - } else { - ix := kx - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[ix] *= ap[kk] - } - if n-i-1 > 0 { - x[ix] += c64.DotuInc(ap[kk+1:kk+n-i], x, uintptr(n-i-1), 1, uintptr(incX), 0, uintptr(ix+incX)) - } - ix += incX - kk += n - i - } - } - } else { - // kk points to the beginning of current row in ap. - kk := n*(n+1)/2 - n - if incX == 1 { - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[i] *= ap[kk+i] - } - if i > 0 { - x[i] += c64.DotuUnitary(ap[kk:kk+i], x[:i]) - } - kk -= i - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[ix] *= ap[kk+i] - } - if i > 0 { - x[ix] += c64.DotuInc(ap[kk:kk+i], x, uintptr(i), 1, uintptr(incX), 0, uintptr(kx)) - } - ix -= incX - kk -= i - } - } - } - return - } - - if trans == blas.Trans { - // Form x = Aᵀ*x. - if uplo == blas.Upper { - // kk points to the current diagonal element in ap. - kk := n*(n+1)/2 - 1 - if incX == 1 { - for i := n - 1; i >= 0; i-- { - xi := x[i] - if diag == blas.NonUnit { - x[i] *= ap[kk] - } - if n-i-1 > 0 { - c64.AxpyUnitary(xi, ap[kk+1:kk+n-i], x[i+1:n]) - } - kk -= n - i + 1 - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - xi := x[ix] - if diag == blas.NonUnit { - x[ix] *= ap[kk] - } - if n-i-1 > 0 { - c64.AxpyInc(xi, ap[kk+1:kk+n-i], x, uintptr(n-i-1), 1, uintptr(incX), 0, uintptr(ix+incX)) - } - ix -= incX - kk -= n - i + 1 - } - } - } else { - // kk points to the beginning of current row in ap. - kk := 0 - if incX == 1 { - x = x[:n] - for i := range x { - if i > 0 { - c64.AxpyUnitary(x[i], ap[kk:kk+i], x[:i]) - } - if diag == blas.NonUnit { - x[i] *= ap[kk+i] - } - kk += i + 1 - } - } else { - ix := kx - for i := 0; i < n; i++ { - if i > 0 { - c64.AxpyInc(x[ix], ap[kk:kk+i], x, uintptr(i), 1, uintptr(incX), 0, uintptr(kx)) - } - if diag == blas.NonUnit { - x[ix] *= ap[kk+i] - } - ix += incX - kk += i + 1 - } - } - } - return - } - - // Form x = Aᴴ*x. - if uplo == blas.Upper { - // kk points to the current diagonal element in ap. - kk := n*(n+1)/2 - 1 - if incX == 1 { - for i := n - 1; i >= 0; i-- { - xi := x[i] - if diag == blas.NonUnit { - x[i] *= cmplx.Conj(ap[kk]) - } - k := kk + 1 - for j := i + 1; j < n; j++ { - x[j] += xi * cmplx.Conj(ap[k]) - k++ - } - kk -= n - i + 1 - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - xi := x[ix] - if diag == blas.NonUnit { - x[ix] *= cmplx.Conj(ap[kk]) - } - jx := ix + incX - k := kk + 1 - for j := i + 1; j < n; j++ { - x[jx] += xi * cmplx.Conj(ap[k]) - jx += incX - k++ - } - ix -= incX - kk -= n - i + 1 - } - } - } else { - // kk points to the beginning of current row in ap. - kk := 0 - if incX == 1 { - x = x[:n] - for i, xi := range x { - for j := 0; j < i; j++ { - x[j] += xi * cmplx.Conj(ap[kk+j]) - } - if diag == blas.NonUnit { - x[i] *= cmplx.Conj(ap[kk+i]) - } - kk += i + 1 - } - } else { - ix := kx - for i := 0; i < n; i++ { - xi := x[ix] - jx := kx - for j := 0; j < i; j++ { - x[jx] += xi * cmplx.Conj(ap[kk+j]) - jx += incX - } - if diag == blas.NonUnit { - x[ix] *= cmplx.Conj(ap[kk+i]) - } - ix += incX - kk += i + 1 - } - } - } -} - -// Ctpsv solves one of the systems of equations -// A * x = b if trans == blas.NoTrans -// Aᵀ * x = b if trans == blas.Trans -// Aᴴ * x = b if trans == blas.ConjTrans -// where b and x are n element vectors and A is an n×n triangular matrix in -// packed form. -// -// On entry, x contains the values of b, and the solution is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Ctpsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n int, ap []complex64, x []complex64, incX int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch diag { - default: - panic(badDiag) - case blas.NonUnit, blas.Unit: - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - // The elements of A are accessed sequentially with one pass through ap. - - if trans == blas.NoTrans { - // Form x = inv(A)*x. - if uplo == blas.Upper { - kk := n*(n+1)/2 - 1 - if incX == 1 { - for i := n - 1; i >= 0; i-- { - aii := ap[kk] - if n-i-1 > 0 { - x[i] -= c64.DotuUnitary(x[i+1:n], ap[kk+1:kk+n-i]) - } - if diag == blas.NonUnit { - x[i] /= aii - } - kk -= n - i + 1 - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - aii := ap[kk] - if n-i-1 > 0 { - x[ix] -= c64.DotuInc(x, ap[kk+1:kk+n-i], uintptr(n-i-1), uintptr(incX), 1, uintptr(ix+incX), 0) - } - if diag == blas.NonUnit { - x[ix] /= aii - } - ix -= incX - kk -= n - i + 1 - } - } - } else { - kk := 0 - if incX == 1 { - for i := 0; i < n; i++ { - if i > 0 { - x[i] -= c64.DotuUnitary(x[:i], ap[kk:kk+i]) - } - if diag == blas.NonUnit { - x[i] /= ap[kk+i] - } - kk += i + 1 - } - } else { - ix := kx - for i := 0; i < n; i++ { - if i > 0 { - x[ix] -= c64.DotuInc(x, ap[kk:kk+i], uintptr(i), uintptr(incX), 1, uintptr(kx), 0) - } - if diag == blas.NonUnit { - x[ix] /= ap[kk+i] - } - ix += incX - kk += i + 1 - } - } - } - return - } - - if trans == blas.Trans { - // Form x = inv(Aᵀ)*x. - if uplo == blas.Upper { - kk := 0 - if incX == 1 { - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[j] /= ap[kk] - } - if n-j-1 > 0 { - c64.AxpyUnitary(-x[j], ap[kk+1:kk+n-j], x[j+1:n]) - } - kk += n - j - } - } else { - jx := kx - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[jx] /= ap[kk] - } - if n-j-1 > 0 { - c64.AxpyInc(-x[jx], ap[kk+1:kk+n-j], x, uintptr(n-j-1), 1, uintptr(incX), 0, uintptr(jx+incX)) - } - jx += incX - kk += n - j - } - } - } else { - kk := n*(n+1)/2 - n - if incX == 1 { - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[j] /= ap[kk+j] - } - if j > 0 { - c64.AxpyUnitary(-x[j], ap[kk:kk+j], x[:j]) - } - kk -= j - } - } else { - jx := kx + (n-1)*incX - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[jx] /= ap[kk+j] - } - if j > 0 { - c64.AxpyInc(-x[jx], ap[kk:kk+j], x, uintptr(j), 1, uintptr(incX), 0, uintptr(kx)) - } - jx -= incX - kk -= j - } - } - } - return - } - - // Form x = inv(Aᴴ)*x. - if uplo == blas.Upper { - kk := 0 - if incX == 1 { - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[j] /= cmplx.Conj(ap[kk]) - } - xj := x[j] - k := kk + 1 - for i := j + 1; i < n; i++ { - x[i] -= xj * cmplx.Conj(ap[k]) - k++ - } - kk += n - j - } - } else { - jx := kx - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[jx] /= cmplx.Conj(ap[kk]) - } - xj := x[jx] - ix := jx + incX - k := kk + 1 - for i := j + 1; i < n; i++ { - x[ix] -= xj * cmplx.Conj(ap[k]) - ix += incX - k++ - } - jx += incX - kk += n - j - } - } - } else { - kk := n*(n+1)/2 - n - if incX == 1 { - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[j] /= cmplx.Conj(ap[kk+j]) - } - xj := x[j] - for i := 0; i < j; i++ { - x[i] -= xj * cmplx.Conj(ap[kk+i]) - } - kk -= j - } - } else { - jx := kx + (n-1)*incX - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[jx] /= cmplx.Conj(ap[kk+j]) - } - xj := x[jx] - ix := kx - for i := 0; i < j; i++ { - x[ix] -= xj * cmplx.Conj(ap[kk+i]) - ix += incX - } - jx -= incX - kk -= j - } - } - } -} - -// Ctrmv performs one of the matrix-vector operations -// x = A * x if trans = blas.NoTrans -// x = Aᵀ * x if trans = blas.Trans -// x = Aᴴ * x if trans = blas.ConjTrans -// where x is a vector, and A is an n×n triangular matrix. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Ctrmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n int, a []complex64, lda int, x []complex64, incX int) { - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - switch diag { - default: - panic(badDiag) - case blas.NonUnit, blas.Unit: - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - // The elements of A are accessed sequentially with one pass through A. - - if trans == blas.NoTrans { - // Form x = A*x. - if uplo == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[i] *= a[i*lda+i] - } - if n-i-1 > 0 { - x[i] += c64.DotuUnitary(a[i*lda+i+1:i*lda+n], x[i+1:n]) - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[ix] *= a[i*lda+i] - } - if n-i-1 > 0 { - x[ix] += c64.DotuInc(a[i*lda+i+1:i*lda+n], x, uintptr(n-i-1), 1, uintptr(incX), 0, uintptr(ix+incX)) - } - ix += incX - } - } - } else { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[i] *= a[i*lda+i] - } - if i > 0 { - x[i] += c64.DotuUnitary(a[i*lda:i*lda+i], x[:i]) - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[ix] *= a[i*lda+i] - } - if i > 0 { - x[ix] += c64.DotuInc(a[i*lda:i*lda+i], x, uintptr(i), 1, uintptr(incX), 0, uintptr(kx)) - } - ix -= incX - } - } - } - return - } - - if trans == blas.Trans { - // Form x = Aᵀ*x. - if uplo == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - xi := x[i] - if diag == blas.NonUnit { - x[i] *= a[i*lda+i] - } - if n-i-1 > 0 { - c64.AxpyUnitary(xi, a[i*lda+i+1:i*lda+n], x[i+1:n]) - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - xi := x[ix] - if diag == blas.NonUnit { - x[ix] *= a[i*lda+i] - } - if n-i-1 > 0 { - c64.AxpyInc(xi, a[i*lda+i+1:i*lda+n], x, uintptr(n-i-1), 1, uintptr(incX), 0, uintptr(ix+incX)) - } - ix -= incX - } - } - } else { - if incX == 1 { - for i := 0; i < n; i++ { - if i > 0 { - c64.AxpyUnitary(x[i], a[i*lda:i*lda+i], x[:i]) - } - if diag == blas.NonUnit { - x[i] *= a[i*lda+i] - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - if i > 0 { - c64.AxpyInc(x[ix], a[i*lda:i*lda+i], x, uintptr(i), 1, uintptr(incX), 0, uintptr(kx)) - } - if diag == blas.NonUnit { - x[ix] *= a[i*lda+i] - } - ix += incX - } - } - } - return - } - - // Form x = Aᴴ*x. - if uplo == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - xi := x[i] - if diag == blas.NonUnit { - x[i] *= cmplx.Conj(a[i*lda+i]) - } - for j := i + 1; j < n; j++ { - x[j] += xi * cmplx.Conj(a[i*lda+j]) - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - xi := x[ix] - if diag == blas.NonUnit { - x[ix] *= cmplx.Conj(a[i*lda+i]) - } - jx := ix + incX - for j := i + 1; j < n; j++ { - x[jx] += xi * cmplx.Conj(a[i*lda+j]) - jx += incX - } - ix -= incX - } - } - } else { - if incX == 1 { - for i := 0; i < n; i++ { - for j := 0; j < i; j++ { - x[j] += x[i] * cmplx.Conj(a[i*lda+j]) - } - if diag == blas.NonUnit { - x[i] *= cmplx.Conj(a[i*lda+i]) - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - jx := kx - for j := 0; j < i; j++ { - x[jx] += x[ix] * cmplx.Conj(a[i*lda+j]) - jx += incX - } - if diag == blas.NonUnit { - x[ix] *= cmplx.Conj(a[i*lda+i]) - } - ix += incX - } - } - } -} - -// Ctrsv solves one of the systems of equations -// A * x = b if trans == blas.NoTrans -// Aᵀ * x = b if trans == blas.Trans -// Aᴴ * x = b if trans == blas.ConjTrans -// where b and x are n element vectors and A is an n×n triangular matrix. -// -// On entry, x contains the values of b, and the solution is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Ctrsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n int, a []complex64, lda int, x []complex64, incX int) { - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - switch diag { - default: - panic(badDiag) - case blas.NonUnit, blas.Unit: - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - // The elements of A are accessed sequentially with one pass through A. - - if trans == blas.NoTrans { - // Form x = inv(A)*x. - if uplo == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - aii := a[i*lda+i] - if n-i-1 > 0 { - x[i] -= c64.DotuUnitary(x[i+1:n], a[i*lda+i+1:i*lda+n]) - } - if diag == blas.NonUnit { - x[i] /= aii - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - aii := a[i*lda+i] - if n-i-1 > 0 { - x[ix] -= c64.DotuInc(x, a[i*lda+i+1:i*lda+n], uintptr(n-i-1), uintptr(incX), 1, uintptr(ix+incX), 0) - } - if diag == blas.NonUnit { - x[ix] /= aii - } - ix -= incX - } - } - } else { - if incX == 1 { - for i := 0; i < n; i++ { - if i > 0 { - x[i] -= c64.DotuUnitary(x[:i], a[i*lda:i*lda+i]) - } - if diag == blas.NonUnit { - x[i] /= a[i*lda+i] - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - if i > 0 { - x[ix] -= c64.DotuInc(x, a[i*lda:i*lda+i], uintptr(i), uintptr(incX), 1, uintptr(kx), 0) - } - if diag == blas.NonUnit { - x[ix] /= a[i*lda+i] - } - ix += incX - } - } - } - return - } - - if trans == blas.Trans { - // Form x = inv(Aᵀ)*x. - if uplo == blas.Upper { - if incX == 1 { - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[j] /= a[j*lda+j] - } - if n-j-1 > 0 { - c64.AxpyUnitary(-x[j], a[j*lda+j+1:j*lda+n], x[j+1:n]) - } - } - } else { - jx := kx - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[jx] /= a[j*lda+j] - } - if n-j-1 > 0 { - c64.AxpyInc(-x[jx], a[j*lda+j+1:j*lda+n], x, uintptr(n-j-1), 1, uintptr(incX), 0, uintptr(jx+incX)) - } - jx += incX - } - } - } else { - if incX == 1 { - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[j] /= a[j*lda+j] - } - xj := x[j] - if j > 0 { - c64.AxpyUnitary(-xj, a[j*lda:j*lda+j], x[:j]) - } - } - } else { - jx := kx + (n-1)*incX - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[jx] /= a[j*lda+j] - } - if j > 0 { - c64.AxpyInc(-x[jx], a[j*lda:j*lda+j], x, uintptr(j), 1, uintptr(incX), 0, uintptr(kx)) - } - jx -= incX - } - } - } - return - } - - // Form x = inv(Aᴴ)*x. - if uplo == blas.Upper { - if incX == 1 { - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[j] /= cmplx.Conj(a[j*lda+j]) - } - xj := x[j] - for i := j + 1; i < n; i++ { - x[i] -= xj * cmplx.Conj(a[j*lda+i]) - } - } - } else { - jx := kx - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[jx] /= cmplx.Conj(a[j*lda+j]) - } - xj := x[jx] - ix := jx + incX - for i := j + 1; i < n; i++ { - x[ix] -= xj * cmplx.Conj(a[j*lda+i]) - ix += incX - } - jx += incX - } - } - } else { - if incX == 1 { - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[j] /= cmplx.Conj(a[j*lda+j]) - } - xj := x[j] - for i := 0; i < j; i++ { - x[i] -= xj * cmplx.Conj(a[j*lda+i]) - } - } - } else { - jx := kx + (n-1)*incX - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[jx] /= cmplx.Conj(a[j*lda+j]) - } - xj := x[jx] - ix := kx - for i := 0; i < j; i++ { - x[ix] -= xj * cmplx.Conj(a[j*lda+i]) - ix += incX - } - jx -= incX - } - } - } -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level2float32.go b/vendor/gonum.org/v1/gonum/blas/gonum/level2float32.go deleted file mode 100644 index d37a0b1..0000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level2float32.go +++ /dev/null @@ -1,2296 +0,0 @@ -// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT. - -// Copyright ©2014 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/f32" -) - -var _ blas.Float32Level2 = Implementation{} - -// Sger performs the rank-one operation -// A += alpha * x * yᵀ -// where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Sger(m, n int, alpha float32, x []float32, incX int, y []float32, incY int, a []float32, lda int) { - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (m-1)*incX) || (incX < 0 && len(x) <= (1-m)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(a) < lda*(m-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - f32.Ger(uintptr(m), uintptr(n), - alpha, - x, uintptr(incX), - y, uintptr(incY), - a, uintptr(lda)) -} - -// Sgbmv performs one of the matrix-vector operations -// y = alpha * A * x + beta * y if tA == blas.NoTrans -// y = alpha * Aᵀ * x + beta * y if tA == blas.Trans or blas.ConjTrans -// where A is an m×n band matrix with kL sub-diagonals and kU super-diagonals, -// x and y are vectors, and alpha and beta are scalars. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Sgbmv(tA blas.Transpose, m, n, kL, kU int, alpha float32, a []float32, lda int, x []float32, incX int, beta float32, y []float32, incY int) { - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if kL < 0 { - panic(kLLT0) - } - if kU < 0 { - panic(kULT0) - } - if lda < kL+kU+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(min(m, n+kL)-1)+kL+kU+1 { - panic(shortA) - } - lenX := m - lenY := n - if tA == blas.NoTrans { - lenX = n - lenY = m - } - if (incX > 0 && len(x) <= (lenX-1)*incX) || (incX < 0 && len(x) <= (1-lenX)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (lenY-1)*incY) || (incY < 0 && len(y) <= (1-lenY)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - var kx, ky int - if incX < 0 { - kx = -(lenX - 1) * incX - } - if incY < 0 { - ky = -(lenY - 1) * incY - } - - // Form y = beta * y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:lenY] { - y[i] = 0 - } - } else { - f32.ScalUnitary(beta, y[:lenY]) - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < lenY; i++ { - y[iy] = 0 - iy += incY - } - } else { - if incY > 0 { - f32.ScalInc(beta, y, uintptr(lenY), uintptr(incY)) - } else { - f32.ScalInc(beta, y, uintptr(lenY), uintptr(-incY)) - } - } - } - } - - if alpha == 0 { - return - } - - // i and j are indices of the compacted banded matrix. - // off is the offset into the dense matrix (off + j = densej) - nCol := kU + 1 + kL - if tA == blas.NoTrans { - iy := ky - if incX == 1 { - for i := 0; i < min(m, n+kL); i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - off := max(0, i-kL) - atmp := a[i*lda+l : i*lda+u] - xtmp := x[off : off+u-l] - var sum float32 - for j, v := range atmp { - sum += xtmp[j] * v - } - y[iy] += sum * alpha - iy += incY - } - return - } - for i := 0; i < min(m, n+kL); i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - off := max(0, i-kL) - atmp := a[i*lda+l : i*lda+u] - jx := kx - var sum float32 - for _, v := range atmp { - sum += x[off*incX+jx] * v - jx += incX - } - y[iy] += sum * alpha - iy += incY - } - return - } - if incX == 1 { - for i := 0; i < min(m, n+kL); i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - off := max(0, i-kL) - atmp := a[i*lda+l : i*lda+u] - tmp := alpha * x[i] - jy := ky - for _, v := range atmp { - y[jy+off*incY] += tmp * v - jy += incY - } - } - return - } - ix := kx - for i := 0; i < min(m, n+kL); i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - off := max(0, i-kL) - atmp := a[i*lda+l : i*lda+u] - tmp := alpha * x[ix] - jy := ky - for _, v := range atmp { - y[jy+off*incY] += tmp * v - jy += incY - } - ix += incX - } -} - -// Strmv performs one of the matrix-vector operations -// x = A * x if tA == blas.NoTrans -// x = Aᵀ * x if tA == blas.Trans or blas.ConjTrans -// where A is an n×n triangular matrix, and x is a vector. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Strmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, a []float32, lda int, x []float32, incX int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - nonUnit := d != blas.Unit - if n == 1 { - if nonUnit { - x[0] *= a[0] - } - return - } - var kx int - if incX <= 0 { - kx = -(n - 1) * incX - } - if tA == blas.NoTrans { - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - ilda := i * lda - var tmp float32 - if nonUnit { - tmp = a[ilda+i] * x[i] - } else { - tmp = x[i] - } - x[i] = tmp + f32.DotUnitary(a[ilda+i+1:ilda+n], x[i+1:n]) - } - return - } - ix := kx - for i := 0; i < n; i++ { - ilda := i * lda - var tmp float32 - if nonUnit { - tmp = a[ilda+i] * x[ix] - } else { - tmp = x[ix] - } - x[ix] = tmp + f32.DotInc(x, a[ilda+i+1:ilda+n], uintptr(n-i-1), uintptr(incX), 1, uintptr(ix+incX), 0) - ix += incX - } - return - } - if incX == 1 { - for i := n - 1; i >= 0; i-- { - ilda := i * lda - var tmp float32 - if nonUnit { - tmp += a[ilda+i] * x[i] - } else { - tmp = x[i] - } - x[i] = tmp + f32.DotUnitary(a[ilda:ilda+i], x[:i]) - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - ilda := i * lda - var tmp float32 - if nonUnit { - tmp = a[ilda+i] * x[ix] - } else { - tmp = x[ix] - } - x[ix] = tmp + f32.DotInc(x, a[ilda:ilda+i], uintptr(i), uintptr(incX), 1, uintptr(kx), 0) - ix -= incX - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - ilda := i * lda - xi := x[i] - f32.AxpyUnitary(xi, a[ilda+i+1:ilda+n], x[i+1:n]) - if nonUnit { - x[i] *= a[ilda+i] - } - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - ilda := i * lda - xi := x[ix] - f32.AxpyInc(xi, a[ilda+i+1:ilda+n], x, uintptr(n-i-1), 1, uintptr(incX), 0, uintptr(kx+(i+1)*incX)) - if nonUnit { - x[ix] *= a[ilda+i] - } - ix -= incX - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - ilda := i * lda - xi := x[i] - f32.AxpyUnitary(xi, a[ilda:ilda+i], x[:i]) - if nonUnit { - x[i] *= a[i*lda+i] - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - ilda := i * lda - xi := x[ix] - f32.AxpyInc(xi, a[ilda:ilda+i], x, uintptr(i), 1, uintptr(incX), 0, uintptr(kx)) - if nonUnit { - x[ix] *= a[ilda+i] - } - ix += incX - } -} - -// Strsv solves one of the systems of equations -// A * x = b if tA == blas.NoTrans -// Aᵀ * x = b if tA == blas.Trans or blas.ConjTrans -// where A is an n×n triangular matrix, and x and b are vectors. -// -// At entry to the function, x contains the values of b, and the result is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Strsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, a []float32, lda int, x []float32, incX int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - if n == 1 { - if d == blas.NonUnit { - x[0] /= a[0] - } - return - } - - var kx int - if incX < 0 { - kx = -(n - 1) * incX - } - nonUnit := d == blas.NonUnit - if tA == blas.NoTrans { - if ul == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - var sum float32 - atmp := a[i*lda+i+1 : i*lda+n] - for j, v := range atmp { - jv := i + j + 1 - sum += x[jv] * v - } - x[i] -= sum - if nonUnit { - x[i] /= a[i*lda+i] - } - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - var sum float32 - jx := ix + incX - atmp := a[i*lda+i+1 : i*lda+n] - for _, v := range atmp { - sum += x[jx] * v - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= a[i*lda+i] - } - ix -= incX - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - var sum float32 - atmp := a[i*lda : i*lda+i] - for j, v := range atmp { - sum += x[j] * v - } - x[i] -= sum - if nonUnit { - x[i] /= a[i*lda+i] - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - jx := kx - var sum float32 - atmp := a[i*lda : i*lda+i] - for _, v := range atmp { - sum += x[jx] * v - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= a[i*lda+i] - } - ix += incX - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - if nonUnit { - x[i] /= a[i*lda+i] - } - xi := x[i] - atmp := a[i*lda+i+1 : i*lda+n] - for j, v := range atmp { - jv := j + i + 1 - x[jv] -= v * xi - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - if nonUnit { - x[ix] /= a[i*lda+i] - } - xi := x[ix] - jx := kx + (i+1)*incX - atmp := a[i*lda+i+1 : i*lda+n] - for _, v := range atmp { - x[jx] -= v * xi - jx += incX - } - ix += incX - } - return - } - if incX == 1 { - for i := n - 1; i >= 0; i-- { - if nonUnit { - x[i] /= a[i*lda+i] - } - xi := x[i] - atmp := a[i*lda : i*lda+i] - for j, v := range atmp { - x[j] -= v * xi - } - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - if nonUnit { - x[ix] /= a[i*lda+i] - } - xi := x[ix] - jx := kx - atmp := a[i*lda : i*lda+i] - for _, v := range atmp { - x[jx] -= v * xi - jx += incX - } - ix -= incX - } -} - -// Ssymv performs the matrix-vector operation -// y = alpha * A * x + beta * y -// where A is an n×n symmetric matrix, x and y are vectors, and alpha and -// beta are scalars. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Ssymv(ul blas.Uplo, n int, alpha float32, a []float32, lda int, x []float32, incX int, beta float32, y []float32, incY int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - // Set up start points - var kx, ky int - if incX < 0 { - kx = -(n - 1) * incX - } - if incY < 0 { - ky = -(n - 1) * incY - } - - // Form y = beta * y - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:n] { - y[i] = 0 - } - } else { - f32.ScalUnitary(beta, y[:n]) - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < n; i++ { - y[iy] = 0 - iy += incY - } - } else { - if incY > 0 { - f32.ScalInc(beta, y, uintptr(n), uintptr(incY)) - } else { - f32.ScalInc(beta, y, uintptr(n), uintptr(-incY)) - } - } - } - } - - if alpha == 0 { - return - } - - if n == 1 { - y[0] += alpha * a[0] * x[0] - return - } - - if ul == blas.Upper { - if incX == 1 { - iy := ky - for i := 0; i < n; i++ { - xv := x[i] * alpha - sum := x[i] * a[i*lda+i] - jy := ky + (i+1)*incY - atmp := a[i*lda+i+1 : i*lda+n] - for j, v := range atmp { - jp := j + i + 1 - sum += x[jp] * v - y[jy] += xv * v - jy += incY - } - y[iy] += alpha * sum - iy += incY - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - xv := x[ix] * alpha - sum := x[ix] * a[i*lda+i] - jx := kx + (i+1)*incX - jy := ky + (i+1)*incY - atmp := a[i*lda+i+1 : i*lda+n] - for _, v := range atmp { - sum += x[jx] * v - y[jy] += xv * v - jx += incX - jy += incY - } - y[iy] += alpha * sum - ix += incX - iy += incY - } - return - } - // Cases where a is lower triangular. - if incX == 1 { - iy := ky - for i := 0; i < n; i++ { - jy := ky - xv := alpha * x[i] - atmp := a[i*lda : i*lda+i] - var sum float32 - for j, v := range atmp { - sum += x[j] * v - y[jy] += xv * v - jy += incY - } - sum += x[i] * a[i*lda+i] - sum *= alpha - y[iy] += sum - iy += incY - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - jx := kx - jy := ky - xv := alpha * x[ix] - atmp := a[i*lda : i*lda+i] - var sum float32 - for _, v := range atmp { - sum += x[jx] * v - y[jy] += xv * v - jx += incX - jy += incY - } - sum += x[ix] * a[i*lda+i] - sum *= alpha - y[iy] += sum - ix += incX - iy += incY - } -} - -// Stbmv performs one of the matrix-vector operations -// x = A * x if tA == blas.NoTrans -// x = Aᵀ * x if tA == blas.Trans or blas.ConjTrans -// where A is an n×n triangular band matrix with k+1 diagonals, and x is a vector. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Stbmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k int, a []float32, lda int, x []float32, incX int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - if lda < k+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+k+1 { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - var kx int - if incX < 0 { - kx = -(n - 1) * incX - } - - nonunit := d != blas.Unit - - if tA == blas.NoTrans { - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - u := min(1+k, n-i) - var sum float32 - atmp := a[i*lda:] - xtmp := x[i:] - for j := 1; j < u; j++ { - sum += xtmp[j] * atmp[j] - } - if nonunit { - sum += xtmp[0] * atmp[0] - } else { - sum += xtmp[0] - } - x[i] = sum - } - return - } - ix := kx - for i := 0; i < n; i++ { - u := min(1+k, n-i) - var sum float32 - atmp := a[i*lda:] - jx := incX - for j := 1; j < u; j++ { - sum += x[ix+jx] * atmp[j] - jx += incX - } - if nonunit { - sum += x[ix] * atmp[0] - } else { - sum += x[ix] - } - x[ix] = sum - ix += incX - } - return - } - if incX == 1 { - for i := n - 1; i >= 0; i-- { - l := max(0, k-i) - atmp := a[i*lda:] - var sum float32 - for j := l; j < k; j++ { - sum += x[i-k+j] * atmp[j] - } - if nonunit { - sum += x[i] * atmp[k] - } else { - sum += x[i] - } - x[i] = sum - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - l := max(0, k-i) - atmp := a[i*lda:] - var sum float32 - jx := l * incX - for j := l; j < k; j++ { - sum += x[ix-k*incX+jx] * atmp[j] - jx += incX - } - if nonunit { - sum += x[ix] * atmp[k] - } else { - sum += x[ix] - } - x[ix] = sum - ix -= incX - } - return - } - if ul == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - u := k + 1 - if i < u { - u = i + 1 - } - var sum float32 - for j := 1; j < u; j++ { - sum += x[i-j] * a[(i-j)*lda+j] - } - if nonunit { - sum += x[i] * a[i*lda] - } else { - sum += x[i] - } - x[i] = sum - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - u := k + 1 - if i < u { - u = i + 1 - } - var sum float32 - jx := incX - for j := 1; j < u; j++ { - sum += x[ix-jx] * a[(i-j)*lda+j] - jx += incX - } - if nonunit { - sum += x[ix] * a[i*lda] - } else { - sum += x[ix] - } - x[ix] = sum - ix -= incX - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - u := k - if i+k >= n { - u = n - i - 1 - } - var sum float32 - for j := 0; j < u; j++ { - sum += x[i+j+1] * a[(i+j+1)*lda+k-j-1] - } - if nonunit { - sum += x[i] * a[i*lda+k] - } else { - sum += x[i] - } - x[i] = sum - } - return - } - ix := kx - for i := 0; i < n; i++ { - u := k - if i+k >= n { - u = n - i - 1 - } - var ( - sum float32 - jx int - ) - for j := 0; j < u; j++ { - sum += x[ix+jx+incX] * a[(i+j+1)*lda+k-j-1] - jx += incX - } - if nonunit { - sum += x[ix] * a[i*lda+k] - } else { - sum += x[ix] - } - x[ix] = sum - ix += incX - } -} - -// Stpmv performs one of the matrix-vector operations -// x = A * x if tA == blas.NoTrans -// x = Aᵀ * x if tA == blas.Trans or blas.ConjTrans -// where A is an n×n triangular matrix in packed format, and x is a vector. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Stpmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, ap []float32, x []float32, incX int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - var kx int - if incX < 0 { - kx = -(n - 1) * incX - } - - nonUnit := d == blas.NonUnit - var offset int // Offset is the index of (i,i) - if tA == blas.NoTrans { - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - xi := x[i] - if nonUnit { - xi *= ap[offset] - } - atmp := ap[offset+1 : offset+n-i] - xtmp := x[i+1:] - for j, v := range atmp { - xi += v * xtmp[j] - } - x[i] = xi - offset += n - i - } - return - } - ix := kx - for i := 0; i < n; i++ { - xix := x[ix] - if nonUnit { - xix *= ap[offset] - } - atmp := ap[offset+1 : offset+n-i] - jx := kx + (i+1)*incX - for _, v := range atmp { - xix += v * x[jx] - jx += incX - } - x[ix] = xix - offset += n - i - ix += incX - } - return - } - if incX == 1 { - offset = n*(n+1)/2 - 1 - for i := n - 1; i >= 0; i-- { - xi := x[i] - if nonUnit { - xi *= ap[offset] - } - atmp := ap[offset-i : offset] - for j, v := range atmp { - xi += v * x[j] - } - x[i] = xi - offset -= i + 1 - } - return - } - ix := kx + (n-1)*incX - offset = n*(n+1)/2 - 1 - for i := n - 1; i >= 0; i-- { - xix := x[ix] - if nonUnit { - xix *= ap[offset] - } - atmp := ap[offset-i : offset] - jx := kx - for _, v := range atmp { - xix += v * x[jx] - jx += incX - } - x[ix] = xix - offset -= i + 1 - ix -= incX - } - return - } - // Cases where ap is transposed. - if ul == blas.Upper { - if incX == 1 { - offset = n*(n+1)/2 - 1 - for i := n - 1; i >= 0; i-- { - xi := x[i] - atmp := ap[offset+1 : offset+n-i] - xtmp := x[i+1:] - for j, v := range atmp { - xtmp[j] += v * xi - } - if nonUnit { - x[i] *= ap[offset] - } - offset -= n - i + 1 - } - return - } - ix := kx + (n-1)*incX - offset = n*(n+1)/2 - 1 - for i := n - 1; i >= 0; i-- { - xix := x[ix] - jx := kx + (i+1)*incX - atmp := ap[offset+1 : offset+n-i] - for _, v := range atmp { - x[jx] += v * xix - jx += incX - } - if nonUnit { - x[ix] *= ap[offset] - } - offset -= n - i + 1 - ix -= incX - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - xi := x[i] - atmp := ap[offset-i : offset] - for j, v := range atmp { - x[j] += v * xi - } - if nonUnit { - x[i] *= ap[offset] - } - offset += i + 2 - } - return - } - ix := kx - for i := 0; i < n; i++ { - xix := x[ix] - jx := kx - atmp := ap[offset-i : offset] - for _, v := range atmp { - x[jx] += v * xix - jx += incX - } - if nonUnit { - x[ix] *= ap[offset] - } - ix += incX - offset += i + 2 - } -} - -// Stbsv solves one of the systems of equations -// A * x = b if tA == blas.NoTrans -// Aᵀ * x = b if tA == blas.Trans or tA == blas.ConjTrans -// where A is an n×n triangular band matrix with k+1 diagonals, -// and x and b are vectors. -// -// At entry to the function, x contains the values of b, and the result is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Stbsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k int, a []float32, lda int, x []float32, incX int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - if lda < k+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+k+1 { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - var kx int - if incX < 0 { - kx = -(n - 1) * incX - } - nonUnit := d == blas.NonUnit - // Form x = A^-1 x. - // Several cases below use subslices for speed improvement. - // The incX != 1 cases usually do not because incX may be negative. - if tA == blas.NoTrans { - if ul == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - bands := k - if i+bands >= n { - bands = n - i - 1 - } - atmp := a[i*lda+1:] - xtmp := x[i+1 : i+bands+1] - var sum float32 - for j, v := range xtmp { - sum += v * atmp[j] - } - x[i] -= sum - if nonUnit { - x[i] /= a[i*lda] - } - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - max := k + 1 - if i+max > n { - max = n - i - } - atmp := a[i*lda:] - var ( - jx int - sum float32 - ) - for j := 1; j < max; j++ { - jx += incX - sum += x[ix+jx] * atmp[j] - } - x[ix] -= sum - if nonUnit { - x[ix] /= atmp[0] - } - ix -= incX - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - bands := k - if i-k < 0 { - bands = i - } - atmp := a[i*lda+k-bands:] - xtmp := x[i-bands : i] - var sum float32 - for j, v := range xtmp { - sum += v * atmp[j] - } - x[i] -= sum - if nonUnit { - x[i] /= atmp[bands] - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - bands := k - if i-k < 0 { - bands = i - } - atmp := a[i*lda+k-bands:] - var ( - sum float32 - jx int - ) - for j := 0; j < bands; j++ { - sum += x[ix-bands*incX+jx] * atmp[j] - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= atmp[bands] - } - ix += incX - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - bands := k - if i-k < 0 { - bands = i - } - var sum float32 - for j := 0; j < bands; j++ { - sum += x[i-bands+j] * a[(i-bands+j)*lda+bands-j] - } - x[i] -= sum - if nonUnit { - x[i] /= a[i*lda] - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - bands := k - if i-k < 0 { - bands = i - } - var ( - sum float32 - jx int - ) - for j := 0; j < bands; j++ { - sum += x[ix-bands*incX+jx] * a[(i-bands+j)*lda+bands-j] - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= a[i*lda] - } - ix += incX - } - return - } - if incX == 1 { - for i := n - 1; i >= 0; i-- { - bands := k - if i+bands >= n { - bands = n - i - 1 - } - var sum float32 - xtmp := x[i+1 : i+1+bands] - for j, v := range xtmp { - sum += v * a[(i+j+1)*lda+k-j-1] - } - x[i] -= sum - if nonUnit { - x[i] /= a[i*lda+k] - } - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - bands := k - if i+bands >= n { - bands = n - i - 1 - } - var ( - sum float32 - jx int - ) - for j := 0; j < bands; j++ { - sum += x[ix+jx+incX] * a[(i+j+1)*lda+k-j-1] - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= a[i*lda+k] - } - ix -= incX - } -} - -// Ssbmv performs the matrix-vector operation -// y = alpha * A * x + beta * y -// where A is an n×n symmetric band matrix with k super-diagonals, x and y are -// vectors, and alpha and beta are scalars. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Ssbmv(ul blas.Uplo, n, k int, alpha float32, a []float32, lda int, x []float32, incX int, beta float32, y []float32, incY int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - if lda < k+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+k+1 { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - // Set up indexes - lenX := n - lenY := n - var kx, ky int - if incX < 0 { - kx = -(lenX - 1) * incX - } - if incY < 0 { - ky = -(lenY - 1) * incY - } - - // Form y = beta * y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:n] { - y[i] = 0 - } - } else { - f32.ScalUnitary(beta, y[:n]) - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < n; i++ { - y[iy] = 0 - iy += incY - } - } else { - if incY > 0 { - f32.ScalInc(beta, y, uintptr(n), uintptr(incY)) - } else { - f32.ScalInc(beta, y, uintptr(n), uintptr(-incY)) - } - } - } - } - - if alpha == 0 { - return - } - - if ul == blas.Upper { - if incX == 1 { - iy := ky - for i := 0; i < n; i++ { - atmp := a[i*lda:] - tmp := alpha * x[i] - sum := tmp * atmp[0] - u := min(k, n-i-1) - jy := incY - for j := 1; j <= u; j++ { - v := atmp[j] - sum += alpha * x[i+j] * v - y[iy+jy] += tmp * v - jy += incY - } - y[iy] += sum - iy += incY - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - atmp := a[i*lda:] - tmp := alpha * x[ix] - sum := tmp * atmp[0] - u := min(k, n-i-1) - jx := incX - jy := incY - for j := 1; j <= u; j++ { - v := atmp[j] - sum += alpha * x[ix+jx] * v - y[iy+jy] += tmp * v - jx += incX - jy += incY - } - y[iy] += sum - ix += incX - iy += incY - } - return - } - - // Casses where a has bands below the diagonal. - if incX == 1 { - iy := ky - for i := 0; i < n; i++ { - l := max(0, k-i) - tmp := alpha * x[i] - jy := l * incY - atmp := a[i*lda:] - for j := l; j < k; j++ { - v := atmp[j] - y[iy] += alpha * v * x[i-k+j] - y[iy-k*incY+jy] += tmp * v - jy += incY - } - y[iy] += tmp * atmp[k] - iy += incY - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - l := max(0, k-i) - tmp := alpha * x[ix] - jx := l * incX - jy := l * incY - atmp := a[i*lda:] - for j := l; j < k; j++ { - v := atmp[j] - y[iy] += alpha * v * x[ix-k*incX+jx] - y[iy-k*incY+jy] += tmp * v - jx += incX - jy += incY - } - y[iy] += tmp * atmp[k] - ix += incX - iy += incY - } -} - -// Ssyr performs the symmetric rank-one update -// A += alpha * x * xᵀ -// where A is an n×n symmetric matrix, and x is a vector. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Ssyr(ul blas.Uplo, n int, alpha float32, x []float32, incX int, a []float32, lda int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if len(a) < lda*(n-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - lenX := n - var kx int - if incX < 0 { - kx = -(lenX - 1) * incX - } - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - tmp := x[i] * alpha - if tmp != 0 { - atmp := a[i*lda+i : i*lda+n] - xtmp := x[i:n] - for j, v := range xtmp { - atmp[j] += v * tmp - } - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - tmp := x[ix] * alpha - if tmp != 0 { - jx := ix - atmp := a[i*lda:] - for j := i; j < n; j++ { - atmp[j] += x[jx] * tmp - jx += incX - } - } - ix += incX - } - return - } - // Cases where a is lower triangular. - if incX == 1 { - for i := 0; i < n; i++ { - tmp := x[i] * alpha - if tmp != 0 { - atmp := a[i*lda:] - xtmp := x[:i+1] - for j, v := range xtmp { - atmp[j] += tmp * v - } - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - tmp := x[ix] * alpha - if tmp != 0 { - atmp := a[i*lda:] - jx := kx - for j := 0; j < i+1; j++ { - atmp[j] += tmp * x[jx] - jx += incX - } - } - ix += incX - } -} - -// Ssyr2 performs the symmetric rank-two update -// A += alpha * x * yᵀ + alpha * y * xᵀ -// where A is an n×n symmetric matrix, x and y are vectors, and alpha is a scalar. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Ssyr2(ul blas.Uplo, n int, alpha float32, x []float32, incX int, y []float32, incY int, a []float32, lda int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(a) < lda*(n-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - var ky, kx int - if incY < 0 { - ky = -(n - 1) * incY - } - if incX < 0 { - kx = -(n - 1) * incX - } - if ul == blas.Upper { - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - xi := x[i] - yi := y[i] - atmp := a[i*lda:] - for j := i; j < n; j++ { - atmp[j] += alpha * (xi*y[j] + x[j]*yi) - } - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - jx := kx + i*incX - jy := ky + i*incY - xi := x[ix] - yi := y[iy] - atmp := a[i*lda:] - for j := i; j < n; j++ { - atmp[j] += alpha * (xi*y[jy] + x[jx]*yi) - jx += incX - jy += incY - } - ix += incX - iy += incY - } - return - } - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - xi := x[i] - yi := y[i] - atmp := a[i*lda:] - for j := 0; j <= i; j++ { - atmp[j] += alpha * (xi*y[j] + x[j]*yi) - } - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - jx := kx - jy := ky - xi := x[ix] - yi := y[iy] - atmp := a[i*lda:] - for j := 0; j <= i; j++ { - atmp[j] += alpha * (xi*y[jy] + x[jx]*yi) - jx += incX - jy += incY - } - ix += incX - iy += incY - } -} - -// Stpsv solves one of the systems of equations -// A * x = b if tA == blas.NoTrans -// Aᵀ * x = b if tA == blas.Trans or blas.ConjTrans -// where A is an n×n triangular matrix in packed format, and x and b are vectors. -// -// At entry to the function, x contains the values of b, and the result is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Stpsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, ap []float32, x []float32, incX int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - var kx int - if incX < 0 { - kx = -(n - 1) * incX - } - - nonUnit := d == blas.NonUnit - var offset int // Offset is the index of (i,i) - if tA == blas.NoTrans { - if ul == blas.Upper { - offset = n*(n+1)/2 - 1 - if incX == 1 { - for i := n - 1; i >= 0; i-- { - atmp := ap[offset+1 : offset+n-i] - xtmp := x[i+1:] - var sum float32 - for j, v := range atmp { - sum += v * xtmp[j] - } - x[i] -= sum - if nonUnit { - x[i] /= ap[offset] - } - offset -= n - i + 1 - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - atmp := ap[offset+1 : offset+n-i] - jx := kx + (i+1)*incX - var sum float32 - for _, v := range atmp { - sum += v * x[jx] - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= ap[offset] - } - ix -= incX - offset -= n - i + 1 - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - atmp := ap[offset-i : offset] - var sum float32 - for j, v := range atmp { - sum += v * x[j] - } - x[i] -= sum - if nonUnit { - x[i] /= ap[offset] - } - offset += i + 2 - } - return - } - ix := kx - for i := 0; i < n; i++ { - jx := kx - atmp := ap[offset-i : offset] - var sum float32 - for _, v := range atmp { - sum += v * x[jx] - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= ap[offset] - } - ix += incX - offset += i + 2 - } - return - } - // Cases where ap is transposed. - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - if nonUnit { - x[i] /= ap[offset] - } - xi := x[i] - atmp := ap[offset+1 : offset+n-i] - xtmp := x[i+1:] - for j, v := range atmp { - xtmp[j] -= v * xi - } - offset += n - i - } - return - } - ix := kx - for i := 0; i < n; i++ { - if nonUnit { - x[ix] /= ap[offset] - } - xix := x[ix] - atmp := ap[offset+1 : offset+n-i] - jx := kx + (i+1)*incX - for _, v := range atmp { - x[jx] -= v * xix - jx += incX - } - ix += incX - offset += n - i - } - return - } - if incX == 1 { - offset = n*(n+1)/2 - 1 - for i := n - 1; i >= 0; i-- { - if nonUnit { - x[i] /= ap[offset] - } - xi := x[i] - atmp := ap[offset-i : offset] - for j, v := range atmp { - x[j] -= v * xi - } - offset -= i + 1 - } - return - } - ix := kx + (n-1)*incX - offset = n*(n+1)/2 - 1 - for i := n - 1; i >= 0; i-- { - if nonUnit { - x[ix] /= ap[offset] - } - xix := x[ix] - atmp := ap[offset-i : offset] - jx := kx - for _, v := range atmp { - x[jx] -= v * xix - jx += incX - } - ix -= incX - offset -= i + 1 - } -} - -// Sspmv performs the matrix-vector operation -// y = alpha * A * x + beta * y -// where A is an n×n symmetric matrix in packed format, x and y are vectors, -// and alpha and beta are scalars. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Sspmv(ul blas.Uplo, n int, alpha float32, ap []float32, x []float32, incX int, beta float32, y []float32, incY int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - // Set up start points - var kx, ky int - if incX < 0 { - kx = -(n - 1) * incX - } - if incY < 0 { - ky = -(n - 1) * incY - } - - // Form y = beta * y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:n] { - y[i] = 0 - } - } else { - f32.ScalUnitary(beta, y[:n]) - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < n; i++ { - y[iy] = 0 - iy += incY - } - } else { - if incY > 0 { - f32.ScalInc(beta, y, uintptr(n), uintptr(incY)) - } else { - f32.ScalInc(beta, y, uintptr(n), uintptr(-incY)) - } - } - } - } - - if alpha == 0 { - return - } - - if n == 1 { - y[0] += alpha * ap[0] * x[0] - return - } - var offset int // Offset is the index of (i,i). - if ul == blas.Upper { - if incX == 1 { - iy := ky - for i := 0; i < n; i++ { - xv := x[i] * alpha - sum := ap[offset] * x[i] - atmp := ap[offset+1 : offset+n-i] - xtmp := x[i+1:] - jy := ky + (i+1)*incY - for j, v := range atmp { - sum += v * xtmp[j] - y[jy] += v * xv - jy += incY - } - y[iy] += alpha * sum - iy += incY - offset += n - i - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - xv := x[ix] * alpha - sum := ap[offset] * x[ix] - atmp := ap[offset+1 : offset+n-i] - jx := kx + (i+1)*incX - jy := ky + (i+1)*incY - for _, v := range atmp { - sum += v * x[jx] - y[jy] += v * xv - jx += incX - jy += incY - } - y[iy] += alpha * sum - ix += incX - iy += incY - offset += n - i - } - return - } - if incX == 1 { - iy := ky - for i := 0; i < n; i++ { - xv := x[i] * alpha - atmp := ap[offset-i : offset] - jy := ky - var sum float32 - for j, v := range atmp { - sum += v * x[j] - y[jy] += v * xv - jy += incY - } - sum += ap[offset] * x[i] - y[iy] += alpha * sum - iy += incY - offset += i + 2 - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - xv := x[ix] * alpha - atmp := ap[offset-i : offset] - jx := kx - jy := ky - var sum float32 - for _, v := range atmp { - sum += v * x[jx] - y[jy] += v * xv - jx += incX - jy += incY - } - - sum += ap[offset] * x[ix] - y[iy] += alpha * sum - ix += incX - iy += incY - offset += i + 2 - } -} - -// Sspr performs the symmetric rank-one operation -// A += alpha * x * xᵀ -// where A is an n×n symmetric matrix in packed format, x is a vector, and -// alpha is a scalar. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Sspr(ul blas.Uplo, n int, alpha float32, x []float32, incX int, ap []float32) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - lenX := n - var kx int - if incX < 0 { - kx = -(lenX - 1) * incX - } - var offset int // Offset is the index of (i,i). - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - atmp := ap[offset:] - xv := alpha * x[i] - xtmp := x[i:n] - for j, v := range xtmp { - atmp[j] += xv * v - } - offset += n - i - } - return - } - ix := kx - for i := 0; i < n; i++ { - jx := kx + i*incX - atmp := ap[offset:] - xv := alpha * x[ix] - for j := 0; j < n-i; j++ { - atmp[j] += xv * x[jx] - jx += incX - } - ix += incX - offset += n - i - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - atmp := ap[offset-i:] - xv := alpha * x[i] - xtmp := x[:i+1] - for j, v := range xtmp { - atmp[j] += xv * v - } - offset += i + 2 - } - return - } - ix := kx - for i := 0; i < n; i++ { - jx := kx - atmp := ap[offset-i:] - xv := alpha * x[ix] - for j := 0; j <= i; j++ { - atmp[j] += xv * x[jx] - jx += incX - } - ix += incX - offset += i + 2 - } -} - -// Sspr2 performs the symmetric rank-2 update -// A += alpha * x * yᵀ + alpha * y * xᵀ -// where A is an n×n symmetric matrix in packed format, x and y are vectors, -// and alpha is a scalar. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Sspr2(ul blas.Uplo, n int, alpha float32, x []float32, incX int, y []float32, incY int, ap []float32) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - var ky, kx int - if incY < 0 { - ky = -(n - 1) * incY - } - if incX < 0 { - kx = -(n - 1) * incX - } - var offset int // Offset is the index of (i,i). - if ul == blas.Upper { - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - atmp := ap[offset:] - xi := x[i] - yi := y[i] - xtmp := x[i:n] - ytmp := y[i:n] - for j, v := range xtmp { - atmp[j] += alpha * (xi*ytmp[j] + v*yi) - } - offset += n - i - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - jx := kx + i*incX - jy := ky + i*incY - atmp := ap[offset:] - xi := x[ix] - yi := y[iy] - for j := 0; j < n-i; j++ { - atmp[j] += alpha * (xi*y[jy] + x[jx]*yi) - jx += incX - jy += incY - } - ix += incX - iy += incY - offset += n - i - } - return - } - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - atmp := ap[offset-i:] - xi := x[i] - yi := y[i] - xtmp := x[:i+1] - for j, v := range xtmp { - atmp[j] += alpha * (xi*y[j] + v*yi) - } - offset += i + 2 - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - jx := kx - jy := ky - atmp := ap[offset-i:] - for j := 0; j <= i; j++ { - atmp[j] += alpha * (x[ix]*y[jy] + x[jx]*y[iy]) - jx += incX - jy += incY - } - ix += incX - iy += incY - offset += i + 2 - } -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level2float64.go b/vendor/gonum.org/v1/gonum/blas/gonum/level2float64.go deleted file mode 100644 index 725efca..0000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level2float64.go +++ /dev/null @@ -1,2264 +0,0 @@ -// Copyright ©2014 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/f64" -) - -var _ blas.Float64Level2 = Implementation{} - -// Dger performs the rank-one operation -// A += alpha * x * yᵀ -// where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. -func (Implementation) Dger(m, n int, alpha float64, x []float64, incX int, y []float64, incY int, a []float64, lda int) { - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (m-1)*incX) || (incX < 0 && len(x) <= (1-m)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(a) < lda*(m-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - f64.Ger(uintptr(m), uintptr(n), - alpha, - x, uintptr(incX), - y, uintptr(incY), - a, uintptr(lda)) -} - -// Dgbmv performs one of the matrix-vector operations -// y = alpha * A * x + beta * y if tA == blas.NoTrans -// y = alpha * Aᵀ * x + beta * y if tA == blas.Trans or blas.ConjTrans -// where A is an m×n band matrix with kL sub-diagonals and kU super-diagonals, -// x and y are vectors, and alpha and beta are scalars. -func (Implementation) Dgbmv(tA blas.Transpose, m, n, kL, kU int, alpha float64, a []float64, lda int, x []float64, incX int, beta float64, y []float64, incY int) { - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if kL < 0 { - panic(kLLT0) - } - if kU < 0 { - panic(kULT0) - } - if lda < kL+kU+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(min(m, n+kL)-1)+kL+kU+1 { - panic(shortA) - } - lenX := m - lenY := n - if tA == blas.NoTrans { - lenX = n - lenY = m - } - if (incX > 0 && len(x) <= (lenX-1)*incX) || (incX < 0 && len(x) <= (1-lenX)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (lenY-1)*incY) || (incY < 0 && len(y) <= (1-lenY)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - var kx, ky int - if incX < 0 { - kx = -(lenX - 1) * incX - } - if incY < 0 { - ky = -(lenY - 1) * incY - } - - // Form y = beta * y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:lenY] { - y[i] = 0 - } - } else { - f64.ScalUnitary(beta, y[:lenY]) - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < lenY; i++ { - y[iy] = 0 - iy += incY - } - } else { - if incY > 0 { - f64.ScalInc(beta, y, uintptr(lenY), uintptr(incY)) - } else { - f64.ScalInc(beta, y, uintptr(lenY), uintptr(-incY)) - } - } - } - } - - if alpha == 0 { - return - } - - // i and j are indices of the compacted banded matrix. - // off is the offset into the dense matrix (off + j = densej) - nCol := kU + 1 + kL - if tA == blas.NoTrans { - iy := ky - if incX == 1 { - for i := 0; i < min(m, n+kL); i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - off := max(0, i-kL) - atmp := a[i*lda+l : i*lda+u] - xtmp := x[off : off+u-l] - var sum float64 - for j, v := range atmp { - sum += xtmp[j] * v - } - y[iy] += sum * alpha - iy += incY - } - return - } - for i := 0; i < min(m, n+kL); i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - off := max(0, i-kL) - atmp := a[i*lda+l : i*lda+u] - jx := kx - var sum float64 - for _, v := range atmp { - sum += x[off*incX+jx] * v - jx += incX - } - y[iy] += sum * alpha - iy += incY - } - return - } - if incX == 1 { - for i := 0; i < min(m, n+kL); i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - off := max(0, i-kL) - atmp := a[i*lda+l : i*lda+u] - tmp := alpha * x[i] - jy := ky - for _, v := range atmp { - y[jy+off*incY] += tmp * v - jy += incY - } - } - return - } - ix := kx - for i := 0; i < min(m, n+kL); i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - off := max(0, i-kL) - atmp := a[i*lda+l : i*lda+u] - tmp := alpha * x[ix] - jy := ky - for _, v := range atmp { - y[jy+off*incY] += tmp * v - jy += incY - } - ix += incX - } -} - -// Dtrmv performs one of the matrix-vector operations -// x = A * x if tA == blas.NoTrans -// x = Aᵀ * x if tA == blas.Trans or blas.ConjTrans -// where A is an n×n triangular matrix, and x is a vector. -func (Implementation) Dtrmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, a []float64, lda int, x []float64, incX int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - nonUnit := d != blas.Unit - if n == 1 { - if nonUnit { - x[0] *= a[0] - } - return - } - var kx int - if incX <= 0 { - kx = -(n - 1) * incX - } - if tA == blas.NoTrans { - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - ilda := i * lda - var tmp float64 - if nonUnit { - tmp = a[ilda+i] * x[i] - } else { - tmp = x[i] - } - x[i] = tmp + f64.DotUnitary(a[ilda+i+1:ilda+n], x[i+1:n]) - } - return - } - ix := kx - for i := 0; i < n; i++ { - ilda := i * lda - var tmp float64 - if nonUnit { - tmp = a[ilda+i] * x[ix] - } else { - tmp = x[ix] - } - x[ix] = tmp + f64.DotInc(x, a[ilda+i+1:ilda+n], uintptr(n-i-1), uintptr(incX), 1, uintptr(ix+incX), 0) - ix += incX - } - return - } - if incX == 1 { - for i := n - 1; i >= 0; i-- { - ilda := i * lda - var tmp float64 - if nonUnit { - tmp += a[ilda+i] * x[i] - } else { - tmp = x[i] - } - x[i] = tmp + f64.DotUnitary(a[ilda:ilda+i], x[:i]) - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - ilda := i * lda - var tmp float64 - if nonUnit { - tmp = a[ilda+i] * x[ix] - } else { - tmp = x[ix] - } - x[ix] = tmp + f64.DotInc(x, a[ilda:ilda+i], uintptr(i), uintptr(incX), 1, uintptr(kx), 0) - ix -= incX - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - ilda := i * lda - xi := x[i] - f64.AxpyUnitary(xi, a[ilda+i+1:ilda+n], x[i+1:n]) - if nonUnit { - x[i] *= a[ilda+i] - } - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - ilda := i * lda - xi := x[ix] - f64.AxpyInc(xi, a[ilda+i+1:ilda+n], x, uintptr(n-i-1), 1, uintptr(incX), 0, uintptr(kx+(i+1)*incX)) - if nonUnit { - x[ix] *= a[ilda+i] - } - ix -= incX - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - ilda := i * lda - xi := x[i] - f64.AxpyUnitary(xi, a[ilda:ilda+i], x[:i]) - if nonUnit { - x[i] *= a[i*lda+i] - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - ilda := i * lda - xi := x[ix] - f64.AxpyInc(xi, a[ilda:ilda+i], x, uintptr(i), 1, uintptr(incX), 0, uintptr(kx)) - if nonUnit { - x[ix] *= a[ilda+i] - } - ix += incX - } -} - -// Dtrsv solves one of the systems of equations -// A * x = b if tA == blas.NoTrans -// Aᵀ * x = b if tA == blas.Trans or blas.ConjTrans -// where A is an n×n triangular matrix, and x and b are vectors. -// -// At entry to the function, x contains the values of b, and the result is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -func (Implementation) Dtrsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, a []float64, lda int, x []float64, incX int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - if n == 1 { - if d == blas.NonUnit { - x[0] /= a[0] - } - return - } - - var kx int - if incX < 0 { - kx = -(n - 1) * incX - } - nonUnit := d == blas.NonUnit - if tA == blas.NoTrans { - if ul == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - var sum float64 - atmp := a[i*lda+i+1 : i*lda+n] - for j, v := range atmp { - jv := i + j + 1 - sum += x[jv] * v - } - x[i] -= sum - if nonUnit { - x[i] /= a[i*lda+i] - } - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - var sum float64 - jx := ix + incX - atmp := a[i*lda+i+1 : i*lda+n] - for _, v := range atmp { - sum += x[jx] * v - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= a[i*lda+i] - } - ix -= incX - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - var sum float64 - atmp := a[i*lda : i*lda+i] - for j, v := range atmp { - sum += x[j] * v - } - x[i] -= sum - if nonUnit { - x[i] /= a[i*lda+i] - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - jx := kx - var sum float64 - atmp := a[i*lda : i*lda+i] - for _, v := range atmp { - sum += x[jx] * v - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= a[i*lda+i] - } - ix += incX - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - if nonUnit { - x[i] /= a[i*lda+i] - } - xi := x[i] - atmp := a[i*lda+i+1 : i*lda+n] - for j, v := range atmp { - jv := j + i + 1 - x[jv] -= v * xi - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - if nonUnit { - x[ix] /= a[i*lda+i] - } - xi := x[ix] - jx := kx + (i+1)*incX - atmp := a[i*lda+i+1 : i*lda+n] - for _, v := range atmp { - x[jx] -= v * xi - jx += incX - } - ix += incX - } - return - } - if incX == 1 { - for i := n - 1; i >= 0; i-- { - if nonUnit { - x[i] /= a[i*lda+i] - } - xi := x[i] - atmp := a[i*lda : i*lda+i] - for j, v := range atmp { - x[j] -= v * xi - } - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - if nonUnit { - x[ix] /= a[i*lda+i] - } - xi := x[ix] - jx := kx - atmp := a[i*lda : i*lda+i] - for _, v := range atmp { - x[jx] -= v * xi - jx += incX - } - ix -= incX - } -} - -// Dsymv performs the matrix-vector operation -// y = alpha * A * x + beta * y -// where A is an n×n symmetric matrix, x and y are vectors, and alpha and -// beta are scalars. -func (Implementation) Dsymv(ul blas.Uplo, n int, alpha float64, a []float64, lda int, x []float64, incX int, beta float64, y []float64, incY int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - // Set up start points - var kx, ky int - if incX < 0 { - kx = -(n - 1) * incX - } - if incY < 0 { - ky = -(n - 1) * incY - } - - // Form y = beta * y - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:n] { - y[i] = 0 - } - } else { - f64.ScalUnitary(beta, y[:n]) - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < n; i++ { - y[iy] = 0 - iy += incY - } - } else { - if incY > 0 { - f64.ScalInc(beta, y, uintptr(n), uintptr(incY)) - } else { - f64.ScalInc(beta, y, uintptr(n), uintptr(-incY)) - } - } - } - } - - if alpha == 0 { - return - } - - if n == 1 { - y[0] += alpha * a[0] * x[0] - return - } - - if ul == blas.Upper { - if incX == 1 { - iy := ky - for i := 0; i < n; i++ { - xv := x[i] * alpha - sum := x[i] * a[i*lda+i] - jy := ky + (i+1)*incY - atmp := a[i*lda+i+1 : i*lda+n] - for j, v := range atmp { - jp := j + i + 1 - sum += x[jp] * v - y[jy] += xv * v - jy += incY - } - y[iy] += alpha * sum - iy += incY - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - xv := x[ix] * alpha - sum := x[ix] * a[i*lda+i] - jx := kx + (i+1)*incX - jy := ky + (i+1)*incY - atmp := a[i*lda+i+1 : i*lda+n] - for _, v := range atmp { - sum += x[jx] * v - y[jy] += xv * v - jx += incX - jy += incY - } - y[iy] += alpha * sum - ix += incX - iy += incY - } - return - } - // Cases where a is lower triangular. - if incX == 1 { - iy := ky - for i := 0; i < n; i++ { - jy := ky - xv := alpha * x[i] - atmp := a[i*lda : i*lda+i] - var sum float64 - for j, v := range atmp { - sum += x[j] * v - y[jy] += xv * v - jy += incY - } - sum += x[i] * a[i*lda+i] - sum *= alpha - y[iy] += sum - iy += incY - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - jx := kx - jy := ky - xv := alpha * x[ix] - atmp := a[i*lda : i*lda+i] - var sum float64 - for _, v := range atmp { - sum += x[jx] * v - y[jy] += xv * v - jx += incX - jy += incY - } - sum += x[ix] * a[i*lda+i] - sum *= alpha - y[iy] += sum - ix += incX - iy += incY - } -} - -// Dtbmv performs one of the matrix-vector operations -// x = A * x if tA == blas.NoTrans -// x = Aᵀ * x if tA == blas.Trans or blas.ConjTrans -// where A is an n×n triangular band matrix with k+1 diagonals, and x is a vector. -func (Implementation) Dtbmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k int, a []float64, lda int, x []float64, incX int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - if lda < k+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+k+1 { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - var kx int - if incX < 0 { - kx = -(n - 1) * incX - } - - nonunit := d != blas.Unit - - if tA == blas.NoTrans { - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - u := min(1+k, n-i) - var sum float64 - atmp := a[i*lda:] - xtmp := x[i:] - for j := 1; j < u; j++ { - sum += xtmp[j] * atmp[j] - } - if nonunit { - sum += xtmp[0] * atmp[0] - } else { - sum += xtmp[0] - } - x[i] = sum - } - return - } - ix := kx - for i := 0; i < n; i++ { - u := min(1+k, n-i) - var sum float64 - atmp := a[i*lda:] - jx := incX - for j := 1; j < u; j++ { - sum += x[ix+jx] * atmp[j] - jx += incX - } - if nonunit { - sum += x[ix] * atmp[0] - } else { - sum += x[ix] - } - x[ix] = sum - ix += incX - } - return - } - if incX == 1 { - for i := n - 1; i >= 0; i-- { - l := max(0, k-i) - atmp := a[i*lda:] - var sum float64 - for j := l; j < k; j++ { - sum += x[i-k+j] * atmp[j] - } - if nonunit { - sum += x[i] * atmp[k] - } else { - sum += x[i] - } - x[i] = sum - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - l := max(0, k-i) - atmp := a[i*lda:] - var sum float64 - jx := l * incX - for j := l; j < k; j++ { - sum += x[ix-k*incX+jx] * atmp[j] - jx += incX - } - if nonunit { - sum += x[ix] * atmp[k] - } else { - sum += x[ix] - } - x[ix] = sum - ix -= incX - } - return - } - if ul == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - u := k + 1 - if i < u { - u = i + 1 - } - var sum float64 - for j := 1; j < u; j++ { - sum += x[i-j] * a[(i-j)*lda+j] - } - if nonunit { - sum += x[i] * a[i*lda] - } else { - sum += x[i] - } - x[i] = sum - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - u := k + 1 - if i < u { - u = i + 1 - } - var sum float64 - jx := incX - for j := 1; j < u; j++ { - sum += x[ix-jx] * a[(i-j)*lda+j] - jx += incX - } - if nonunit { - sum += x[ix] * a[i*lda] - } else { - sum += x[ix] - } - x[ix] = sum - ix -= incX - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - u := k - if i+k >= n { - u = n - i - 1 - } - var sum float64 - for j := 0; j < u; j++ { - sum += x[i+j+1] * a[(i+j+1)*lda+k-j-1] - } - if nonunit { - sum += x[i] * a[i*lda+k] - } else { - sum += x[i] - } - x[i] = sum - } - return - } - ix := kx - for i := 0; i < n; i++ { - u := k - if i+k >= n { - u = n - i - 1 - } - var ( - sum float64 - jx int - ) - for j := 0; j < u; j++ { - sum += x[ix+jx+incX] * a[(i+j+1)*lda+k-j-1] - jx += incX - } - if nonunit { - sum += x[ix] * a[i*lda+k] - } else { - sum += x[ix] - } - x[ix] = sum - ix += incX - } -} - -// Dtpmv performs one of the matrix-vector operations -// x = A * x if tA == blas.NoTrans -// x = Aᵀ * x if tA == blas.Trans or blas.ConjTrans -// where A is an n×n triangular matrix in packed format, and x is a vector. -func (Implementation) Dtpmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, ap []float64, x []float64, incX int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - var kx int - if incX < 0 { - kx = -(n - 1) * incX - } - - nonUnit := d == blas.NonUnit - var offset int // Offset is the index of (i,i) - if tA == blas.NoTrans { - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - xi := x[i] - if nonUnit { - xi *= ap[offset] - } - atmp := ap[offset+1 : offset+n-i] - xtmp := x[i+1:] - for j, v := range atmp { - xi += v * xtmp[j] - } - x[i] = xi - offset += n - i - } - return - } - ix := kx - for i := 0; i < n; i++ { - xix := x[ix] - if nonUnit { - xix *= ap[offset] - } - atmp := ap[offset+1 : offset+n-i] - jx := kx + (i+1)*incX - for _, v := range atmp { - xix += v * x[jx] - jx += incX - } - x[ix] = xix - offset += n - i - ix += incX - } - return - } - if incX == 1 { - offset = n*(n+1)/2 - 1 - for i := n - 1; i >= 0; i-- { - xi := x[i] - if nonUnit { - xi *= ap[offset] - } - atmp := ap[offset-i : offset] - for j, v := range atmp { - xi += v * x[j] - } - x[i] = xi - offset -= i + 1 - } - return - } - ix := kx + (n-1)*incX - offset = n*(n+1)/2 - 1 - for i := n - 1; i >= 0; i-- { - xix := x[ix] - if nonUnit { - xix *= ap[offset] - } - atmp := ap[offset-i : offset] - jx := kx - for _, v := range atmp { - xix += v * x[jx] - jx += incX - } - x[ix] = xix - offset -= i + 1 - ix -= incX - } - return - } - // Cases where ap is transposed. - if ul == blas.Upper { - if incX == 1 { - offset = n*(n+1)/2 - 1 - for i := n - 1; i >= 0; i-- { - xi := x[i] - atmp := ap[offset+1 : offset+n-i] - xtmp := x[i+1:] - for j, v := range atmp { - xtmp[j] += v * xi - } - if nonUnit { - x[i] *= ap[offset] - } - offset -= n - i + 1 - } - return - } - ix := kx + (n-1)*incX - offset = n*(n+1)/2 - 1 - for i := n - 1; i >= 0; i-- { - xix := x[ix] - jx := kx + (i+1)*incX - atmp := ap[offset+1 : offset+n-i] - for _, v := range atmp { - x[jx] += v * xix - jx += incX - } - if nonUnit { - x[ix] *= ap[offset] - } - offset -= n - i + 1 - ix -= incX - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - xi := x[i] - atmp := ap[offset-i : offset] - for j, v := range atmp { - x[j] += v * xi - } - if nonUnit { - x[i] *= ap[offset] - } - offset += i + 2 - } - return - } - ix := kx - for i := 0; i < n; i++ { - xix := x[ix] - jx := kx - atmp := ap[offset-i : offset] - for _, v := range atmp { - x[jx] += v * xix - jx += incX - } - if nonUnit { - x[ix] *= ap[offset] - } - ix += incX - offset += i + 2 - } -} - -// Dtbsv solves one of the systems of equations -// A * x = b if tA == blas.NoTrans -// Aᵀ * x = b if tA == blas.Trans or tA == blas.ConjTrans -// where A is an n×n triangular band matrix with k+1 diagonals, -// and x and b are vectors. -// -// At entry to the function, x contains the values of b, and the result is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -func (Implementation) Dtbsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k int, a []float64, lda int, x []float64, incX int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - if lda < k+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+k+1 { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - var kx int - if incX < 0 { - kx = -(n - 1) * incX - } - nonUnit := d == blas.NonUnit - // Form x = A^-1 x. - // Several cases below use subslices for speed improvement. - // The incX != 1 cases usually do not because incX may be negative. - if tA == blas.NoTrans { - if ul == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - bands := k - if i+bands >= n { - bands = n - i - 1 - } - atmp := a[i*lda+1:] - xtmp := x[i+1 : i+bands+1] - var sum float64 - for j, v := range xtmp { - sum += v * atmp[j] - } - x[i] -= sum - if nonUnit { - x[i] /= a[i*lda] - } - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - max := k + 1 - if i+max > n { - max = n - i - } - atmp := a[i*lda:] - var ( - jx int - sum float64 - ) - for j := 1; j < max; j++ { - jx += incX - sum += x[ix+jx] * atmp[j] - } - x[ix] -= sum - if nonUnit { - x[ix] /= atmp[0] - } - ix -= incX - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - bands := k - if i-k < 0 { - bands = i - } - atmp := a[i*lda+k-bands:] - xtmp := x[i-bands : i] - var sum float64 - for j, v := range xtmp { - sum += v * atmp[j] - } - x[i] -= sum - if nonUnit { - x[i] /= atmp[bands] - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - bands := k - if i-k < 0 { - bands = i - } - atmp := a[i*lda+k-bands:] - var ( - sum float64 - jx int - ) - for j := 0; j < bands; j++ { - sum += x[ix-bands*incX+jx] * atmp[j] - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= atmp[bands] - } - ix += incX - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - bands := k - if i-k < 0 { - bands = i - } - var sum float64 - for j := 0; j < bands; j++ { - sum += x[i-bands+j] * a[(i-bands+j)*lda+bands-j] - } - x[i] -= sum - if nonUnit { - x[i] /= a[i*lda] - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - bands := k - if i-k < 0 { - bands = i - } - var ( - sum float64 - jx int - ) - for j := 0; j < bands; j++ { - sum += x[ix-bands*incX+jx] * a[(i-bands+j)*lda+bands-j] - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= a[i*lda] - } - ix += incX - } - return - } - if incX == 1 { - for i := n - 1; i >= 0; i-- { - bands := k - if i+bands >= n { - bands = n - i - 1 - } - var sum float64 - xtmp := x[i+1 : i+1+bands] - for j, v := range xtmp { - sum += v * a[(i+j+1)*lda+k-j-1] - } - x[i] -= sum - if nonUnit { - x[i] /= a[i*lda+k] - } - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - bands := k - if i+bands >= n { - bands = n - i - 1 - } - var ( - sum float64 - jx int - ) - for j := 0; j < bands; j++ { - sum += x[ix+jx+incX] * a[(i+j+1)*lda+k-j-1] - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= a[i*lda+k] - } - ix -= incX - } -} - -// Dsbmv performs the matrix-vector operation -// y = alpha * A * x + beta * y -// where A is an n×n symmetric band matrix with k super-diagonals, x and y are -// vectors, and alpha and beta are scalars. -func (Implementation) Dsbmv(ul blas.Uplo, n, k int, alpha float64, a []float64, lda int, x []float64, incX int, beta float64, y []float64, incY int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - if lda < k+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+k+1 { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - // Set up indexes - lenX := n - lenY := n - var kx, ky int - if incX < 0 { - kx = -(lenX - 1) * incX - } - if incY < 0 { - ky = -(lenY - 1) * incY - } - - // Form y = beta * y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:n] { - y[i] = 0 - } - } else { - f64.ScalUnitary(beta, y[:n]) - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < n; i++ { - y[iy] = 0 - iy += incY - } - } else { - if incY > 0 { - f64.ScalInc(beta, y, uintptr(n), uintptr(incY)) - } else { - f64.ScalInc(beta, y, uintptr(n), uintptr(-incY)) - } - } - } - } - - if alpha == 0 { - return - } - - if ul == blas.Upper { - if incX == 1 { - iy := ky - for i := 0; i < n; i++ { - atmp := a[i*lda:] - tmp := alpha * x[i] - sum := tmp * atmp[0] - u := min(k, n-i-1) - jy := incY - for j := 1; j <= u; j++ { - v := atmp[j] - sum += alpha * x[i+j] * v - y[iy+jy] += tmp * v - jy += incY - } - y[iy] += sum - iy += incY - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - atmp := a[i*lda:] - tmp := alpha * x[ix] - sum := tmp * atmp[0] - u := min(k, n-i-1) - jx := incX - jy := incY - for j := 1; j <= u; j++ { - v := atmp[j] - sum += alpha * x[ix+jx] * v - y[iy+jy] += tmp * v - jx += incX - jy += incY - } - y[iy] += sum - ix += incX - iy += incY - } - return - } - - // Casses where a has bands below the diagonal. - if incX == 1 { - iy := ky - for i := 0; i < n; i++ { - l := max(0, k-i) - tmp := alpha * x[i] - jy := l * incY - atmp := a[i*lda:] - for j := l; j < k; j++ { - v := atmp[j] - y[iy] += alpha * v * x[i-k+j] - y[iy-k*incY+jy] += tmp * v - jy += incY - } - y[iy] += tmp * atmp[k] - iy += incY - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - l := max(0, k-i) - tmp := alpha * x[ix] - jx := l * incX - jy := l * incY - atmp := a[i*lda:] - for j := l; j < k; j++ { - v := atmp[j] - y[iy] += alpha * v * x[ix-k*incX+jx] - y[iy-k*incY+jy] += tmp * v - jx += incX - jy += incY - } - y[iy] += tmp * atmp[k] - ix += incX - iy += incY - } -} - -// Dsyr performs the symmetric rank-one update -// A += alpha * x * xᵀ -// where A is an n×n symmetric matrix, and x is a vector. -func (Implementation) Dsyr(ul blas.Uplo, n int, alpha float64, x []float64, incX int, a []float64, lda int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if len(a) < lda*(n-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - lenX := n - var kx int - if incX < 0 { - kx = -(lenX - 1) * incX - } - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - tmp := x[i] * alpha - if tmp != 0 { - atmp := a[i*lda+i : i*lda+n] - xtmp := x[i:n] - for j, v := range xtmp { - atmp[j] += v * tmp - } - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - tmp := x[ix] * alpha - if tmp != 0 { - jx := ix - atmp := a[i*lda:] - for j := i; j < n; j++ { - atmp[j] += x[jx] * tmp - jx += incX - } - } - ix += incX - } - return - } - // Cases where a is lower triangular. - if incX == 1 { - for i := 0; i < n; i++ { - tmp := x[i] * alpha - if tmp != 0 { - atmp := a[i*lda:] - xtmp := x[:i+1] - for j, v := range xtmp { - atmp[j] += tmp * v - } - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - tmp := x[ix] * alpha - if tmp != 0 { - atmp := a[i*lda:] - jx := kx - for j := 0; j < i+1; j++ { - atmp[j] += tmp * x[jx] - jx += incX - } - } - ix += incX - } -} - -// Dsyr2 performs the symmetric rank-two update -// A += alpha * x * yᵀ + alpha * y * xᵀ -// where A is an n×n symmetric matrix, x and y are vectors, and alpha is a scalar. -func (Implementation) Dsyr2(ul blas.Uplo, n int, alpha float64, x []float64, incX int, y []float64, incY int, a []float64, lda int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(a) < lda*(n-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - var ky, kx int - if incY < 0 { - ky = -(n - 1) * incY - } - if incX < 0 { - kx = -(n - 1) * incX - } - if ul == blas.Upper { - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - xi := x[i] - yi := y[i] - atmp := a[i*lda:] - for j := i; j < n; j++ { - atmp[j] += alpha * (xi*y[j] + x[j]*yi) - } - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - jx := kx + i*incX - jy := ky + i*incY - xi := x[ix] - yi := y[iy] - atmp := a[i*lda:] - for j := i; j < n; j++ { - atmp[j] += alpha * (xi*y[jy] + x[jx]*yi) - jx += incX - jy += incY - } - ix += incX - iy += incY - } - return - } - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - xi := x[i] - yi := y[i] - atmp := a[i*lda:] - for j := 0; j <= i; j++ { - atmp[j] += alpha * (xi*y[j] + x[j]*yi) - } - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - jx := kx - jy := ky - xi := x[ix] - yi := y[iy] - atmp := a[i*lda:] - for j := 0; j <= i; j++ { - atmp[j] += alpha * (xi*y[jy] + x[jx]*yi) - jx += incX - jy += incY - } - ix += incX - iy += incY - } -} - -// Dtpsv solves one of the systems of equations -// A * x = b if tA == blas.NoTrans -// Aᵀ * x = b if tA == blas.Trans or blas.ConjTrans -// where A is an n×n triangular matrix in packed format, and x and b are vectors. -// -// At entry to the function, x contains the values of b, and the result is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -func (Implementation) Dtpsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, ap []float64, x []float64, incX int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - var kx int - if incX < 0 { - kx = -(n - 1) * incX - } - - nonUnit := d == blas.NonUnit - var offset int // Offset is the index of (i,i) - if tA == blas.NoTrans { - if ul == blas.Upper { - offset = n*(n+1)/2 - 1 - if incX == 1 { - for i := n - 1; i >= 0; i-- { - atmp := ap[offset+1 : offset+n-i] - xtmp := x[i+1:] - var sum float64 - for j, v := range atmp { - sum += v * xtmp[j] - } - x[i] -= sum - if nonUnit { - x[i] /= ap[offset] - } - offset -= n - i + 1 - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - atmp := ap[offset+1 : offset+n-i] - jx := kx + (i+1)*incX - var sum float64 - for _, v := range atmp { - sum += v * x[jx] - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= ap[offset] - } - ix -= incX - offset -= n - i + 1 - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - atmp := ap[offset-i : offset] - var sum float64 - for j, v := range atmp { - sum += v * x[j] - } - x[i] -= sum - if nonUnit { - x[i] /= ap[offset] - } - offset += i + 2 - } - return - } - ix := kx - for i := 0; i < n; i++ { - jx := kx - atmp := ap[offset-i : offset] - var sum float64 - for _, v := range atmp { - sum += v * x[jx] - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= ap[offset] - } - ix += incX - offset += i + 2 - } - return - } - // Cases where ap is transposed. - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - if nonUnit { - x[i] /= ap[offset] - } - xi := x[i] - atmp := ap[offset+1 : offset+n-i] - xtmp := x[i+1:] - for j, v := range atmp { - xtmp[j] -= v * xi - } - offset += n - i - } - return - } - ix := kx - for i := 0; i < n; i++ { - if nonUnit { - x[ix] /= ap[offset] - } - xix := x[ix] - atmp := ap[offset+1 : offset+n-i] - jx := kx + (i+1)*incX - for _, v := range atmp { - x[jx] -= v * xix - jx += incX - } - ix += incX - offset += n - i - } - return - } - if incX == 1 { - offset = n*(n+1)/2 - 1 - for i := n - 1; i >= 0; i-- { - if nonUnit { - x[i] /= ap[offset] - } - xi := x[i] - atmp := ap[offset-i : offset] - for j, v := range atmp { - x[j] -= v * xi - } - offset -= i + 1 - } - return - } - ix := kx + (n-1)*incX - offset = n*(n+1)/2 - 1 - for i := n - 1; i >= 0; i-- { - if nonUnit { - x[ix] /= ap[offset] - } - xix := x[ix] - atmp := ap[offset-i : offset] - jx := kx - for _, v := range atmp { - x[jx] -= v * xix - jx += incX - } - ix -= incX - offset -= i + 1 - } -} - -// Dspmv performs the matrix-vector operation -// y = alpha * A * x + beta * y -// where A is an n×n symmetric matrix in packed format, x and y are vectors, -// and alpha and beta are scalars. -func (Implementation) Dspmv(ul blas.Uplo, n int, alpha float64, ap []float64, x []float64, incX int, beta float64, y []float64, incY int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - // Set up start points - var kx, ky int - if incX < 0 { - kx = -(n - 1) * incX - } - if incY < 0 { - ky = -(n - 1) * incY - } - - // Form y = beta * y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:n] { - y[i] = 0 - } - } else { - f64.ScalUnitary(beta, y[:n]) - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < n; i++ { - y[iy] = 0 - iy += incY - } - } else { - if incY > 0 { - f64.ScalInc(beta, y, uintptr(n), uintptr(incY)) - } else { - f64.ScalInc(beta, y, uintptr(n), uintptr(-incY)) - } - } - } - } - - if alpha == 0 { - return - } - - if n == 1 { - y[0] += alpha * ap[0] * x[0] - return - } - var offset int // Offset is the index of (i,i). - if ul == blas.Upper { - if incX == 1 { - iy := ky - for i := 0; i < n; i++ { - xv := x[i] * alpha - sum := ap[offset] * x[i] - atmp := ap[offset+1 : offset+n-i] - xtmp := x[i+1:] - jy := ky + (i+1)*incY - for j, v := range atmp { - sum += v * xtmp[j] - y[jy] += v * xv - jy += incY - } - y[iy] += alpha * sum - iy += incY - offset += n - i - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - xv := x[ix] * alpha - sum := ap[offset] * x[ix] - atmp := ap[offset+1 : offset+n-i] - jx := kx + (i+1)*incX - jy := ky + (i+1)*incY - for _, v := range atmp { - sum += v * x[jx] - y[jy] += v * xv - jx += incX - jy += incY - } - y[iy] += alpha * sum - ix += incX - iy += incY - offset += n - i - } - return - } - if incX == 1 { - iy := ky - for i := 0; i < n; i++ { - xv := x[i] * alpha - atmp := ap[offset-i : offset] - jy := ky - var sum float64 - for j, v := range atmp { - sum += v * x[j] - y[jy] += v * xv - jy += incY - } - sum += ap[offset] * x[i] - y[iy] += alpha * sum - iy += incY - offset += i + 2 - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - xv := x[ix] * alpha - atmp := ap[offset-i : offset] - jx := kx - jy := ky - var sum float64 - for _, v := range atmp { - sum += v * x[jx] - y[jy] += v * xv - jx += incX - jy += incY - } - - sum += ap[offset] * x[ix] - y[iy] += alpha * sum - ix += incX - iy += incY - offset += i + 2 - } -} - -// Dspr performs the symmetric rank-one operation -// A += alpha * x * xᵀ -// where A is an n×n symmetric matrix in packed format, x is a vector, and -// alpha is a scalar. -func (Implementation) Dspr(ul blas.Uplo, n int, alpha float64, x []float64, incX int, ap []float64) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - lenX := n - var kx int - if incX < 0 { - kx = -(lenX - 1) * incX - } - var offset int // Offset is the index of (i,i). - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - atmp := ap[offset:] - xv := alpha * x[i] - xtmp := x[i:n] - for j, v := range xtmp { - atmp[j] += xv * v - } - offset += n - i - } - return - } - ix := kx - for i := 0; i < n; i++ { - jx := kx + i*incX - atmp := ap[offset:] - xv := alpha * x[ix] - for j := 0; j < n-i; j++ { - atmp[j] += xv * x[jx] - jx += incX - } - ix += incX - offset += n - i - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - atmp := ap[offset-i:] - xv := alpha * x[i] - xtmp := x[:i+1] - for j, v := range xtmp { - atmp[j] += xv * v - } - offset += i + 2 - } - return - } - ix := kx - for i := 0; i < n; i++ { - jx := kx - atmp := ap[offset-i:] - xv := alpha * x[ix] - for j := 0; j <= i; j++ { - atmp[j] += xv * x[jx] - jx += incX - } - ix += incX - offset += i + 2 - } -} - -// Dspr2 performs the symmetric rank-2 update -// A += alpha * x * yᵀ + alpha * y * xᵀ -// where A is an n×n symmetric matrix in packed format, x and y are vectors, -// and alpha is a scalar. -func (Implementation) Dspr2(ul blas.Uplo, n int, alpha float64, x []float64, incX int, y []float64, incY int, ap []float64) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - var ky, kx int - if incY < 0 { - ky = -(n - 1) * incY - } - if incX < 0 { - kx = -(n - 1) * incX - } - var offset int // Offset is the index of (i,i). - if ul == blas.Upper { - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - atmp := ap[offset:] - xi := x[i] - yi := y[i] - xtmp := x[i:n] - ytmp := y[i:n] - for j, v := range xtmp { - atmp[j] += alpha * (xi*ytmp[j] + v*yi) - } - offset += n - i - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - jx := kx + i*incX - jy := ky + i*incY - atmp := ap[offset:] - xi := x[ix] - yi := y[iy] - for j := 0; j < n-i; j++ { - atmp[j] += alpha * (xi*y[jy] + x[jx]*yi) - jx += incX - jy += incY - } - ix += incX - iy += incY - offset += n - i - } - return - } - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - atmp := ap[offset-i:] - xi := x[i] - yi := y[i] - xtmp := x[:i+1] - for j, v := range xtmp { - atmp[j] += alpha * (xi*y[j] + v*yi) - } - offset += i + 2 - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - jx := kx - jy := ky - atmp := ap[offset-i:] - for j := 0; j <= i; j++ { - atmp[j] += alpha * (x[ix]*y[jy] + x[jx]*y[iy]) - jx += incX - jy += incY - } - ix += incX - iy += incY - offset += i + 2 - } -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level3cmplx128.go b/vendor/gonum.org/v1/gonum/blas/gonum/level3cmplx128.go deleted file mode 100644 index f2a2b2f..0000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level3cmplx128.go +++ /dev/null @@ -1,1715 +0,0 @@ -// Copyright ©2019 The Gonum 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 gonum - -import ( - "math/cmplx" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/c128" -) - -var _ blas.Complex128Level3 = Implementation{} - -// Zgemm performs one of the matrix-matrix operations -// C = alpha * op(A) * op(B) + beta * C -// where op(X) is one of -// op(X) = X or op(X) = Xᵀ or op(X) = Xᴴ, -// alpha and beta are scalars, and A, B and C are matrices, with op(A) an m×k matrix, -// op(B) a k×n matrix and C an m×n matrix. -func (Implementation) Zgemm(tA, tB blas.Transpose, m, n, k int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) { - switch tA { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch tB { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - } - rowA, colA := m, k - if tA != blas.NoTrans { - rowA, colA = k, m - } - if lda < max(1, colA) { - panic(badLdA) - } - rowB, colB := k, n - if tB != blas.NoTrans { - rowB, colB = n, k - } - if ldb < max(1, colB) { - panic(badLdB) - } - if ldc < max(1, n) { - panic(badLdC) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (rowA-1)*lda+colA { - panic(shortA) - } - if len(b) < (rowB-1)*ldb+colB { - panic(shortB) - } - if len(c) < (m-1)*ldc+n { - panic(shortC) - } - - // Quick return if possible. - if (alpha == 0 || k == 0) && beta == 1 { - return - } - - if alpha == 0 { - if beta == 0 { - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - c[i*ldc+j] = 0 - } - } - } else { - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - c[i*ldc+j] *= beta - } - } - } - return - } - - switch tA { - case blas.NoTrans: - switch tB { - case blas.NoTrans: - // Form C = alpha * A * B + beta * C. - for i := 0; i < m; i++ { - switch { - case beta == 0: - for j := 0; j < n; j++ { - c[i*ldc+j] = 0 - } - case beta != 1: - for j := 0; j < n; j++ { - c[i*ldc+j] *= beta - } - } - for l := 0; l < k; l++ { - tmp := alpha * a[i*lda+l] - for j := 0; j < n; j++ { - c[i*ldc+j] += tmp * b[l*ldb+j] - } - } - } - case blas.Trans: - // Form C = alpha * A * Bᵀ + beta * C. - for i := 0; i < m; i++ { - switch { - case beta == 0: - for j := 0; j < n; j++ { - c[i*ldc+j] = 0 - } - case beta != 1: - for j := 0; j < n; j++ { - c[i*ldc+j] *= beta - } - } - for l := 0; l < k; l++ { - tmp := alpha * a[i*lda+l] - for j := 0; j < n; j++ { - c[i*ldc+j] += tmp * b[j*ldb+l] - } - } - } - case blas.ConjTrans: - // Form C = alpha * A * Bᴴ + beta * C. - for i := 0; i < m; i++ { - switch { - case beta == 0: - for j := 0; j < n; j++ { - c[i*ldc+j] = 0 - } - case beta != 1: - for j := 0; j < n; j++ { - c[i*ldc+j] *= beta - } - } - for l := 0; l < k; l++ { - tmp := alpha * a[i*lda+l] - for j := 0; j < n; j++ { - c[i*ldc+j] += tmp * cmplx.Conj(b[j*ldb+l]) - } - } - } - } - case blas.Trans: - switch tB { - case blas.NoTrans: - // Form C = alpha * Aᵀ * B + beta * C. - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - var tmp complex128 - for l := 0; l < k; l++ { - tmp += a[l*lda+i] * b[l*ldb+j] - } - if beta == 0 { - c[i*ldc+j] = alpha * tmp - } else { - c[i*ldc+j] = alpha*tmp + beta*c[i*ldc+j] - } - } - } - case blas.Trans: - // Form C = alpha * Aᵀ * Bᵀ + beta * C. - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - var tmp complex128 - for l := 0; l < k; l++ { - tmp += a[l*lda+i] * b[j*ldb+l] - } - if beta == 0 { - c[i*ldc+j] = alpha * tmp - } else { - c[i*ldc+j] = alpha*tmp + beta*c[i*ldc+j] - } - } - } - case blas.ConjTrans: - // Form C = alpha * Aᵀ * Bᴴ + beta * C. - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - var tmp complex128 - for l := 0; l < k; l++ { - tmp += a[l*lda+i] * cmplx.Conj(b[j*ldb+l]) - } - if beta == 0 { - c[i*ldc+j] = alpha * tmp - } else { - c[i*ldc+j] = alpha*tmp + beta*c[i*ldc+j] - } - } - } - } - case blas.ConjTrans: - switch tB { - case blas.NoTrans: - // Form C = alpha * Aᴴ * B + beta * C. - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - var tmp complex128 - for l := 0; l < k; l++ { - tmp += cmplx.Conj(a[l*lda+i]) * b[l*ldb+j] - } - if beta == 0 { - c[i*ldc+j] = alpha * tmp - } else { - c[i*ldc+j] = alpha*tmp + beta*c[i*ldc+j] - } - } - } - case blas.Trans: - // Form C = alpha * Aᴴ * Bᵀ + beta * C. - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - var tmp complex128 - for l := 0; l < k; l++ { - tmp += cmplx.Conj(a[l*lda+i]) * b[j*ldb+l] - } - if beta == 0 { - c[i*ldc+j] = alpha * tmp - } else { - c[i*ldc+j] = alpha*tmp + beta*c[i*ldc+j] - } - } - } - case blas.ConjTrans: - // Form C = alpha * Aᴴ * Bᴴ + beta * C. - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - var tmp complex128 - for l := 0; l < k; l++ { - tmp += cmplx.Conj(a[l*lda+i]) * cmplx.Conj(b[j*ldb+l]) - } - if beta == 0 { - c[i*ldc+j] = alpha * tmp - } else { - c[i*ldc+j] = alpha*tmp + beta*c[i*ldc+j] - } - } - } - } - } -} - -// Zhemm performs one of the matrix-matrix operations -// C = alpha*A*B + beta*C if side == blas.Left -// C = alpha*B*A + beta*C if side == blas.Right -// where alpha and beta are scalars, A is an m×m or n×n hermitian matrix and B -// and C are m×n matrices. The imaginary parts of the diagonal elements of A are -// assumed to be zero. -func (Implementation) Zhemm(side blas.Side, uplo blas.Uplo, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) { - na := m - if side == blas.Right { - na = n - } - switch { - case side != blas.Left && side != blas.Right: - panic(badSide) - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, na): - panic(badLdA) - case ldb < max(1, n): - panic(badLdB) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(na-1)+na { - panic(shortA) - } - if len(b) < ldb*(m-1)+n { - panic(shortB) - } - if len(c) < ldc*(m-1)+n { - panic(shortC) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - if alpha == 0 { - if beta == 0 { - for i := 0; i < m; i++ { - ci := c[i*ldc : i*ldc+n] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < m; i++ { - ci := c[i*ldc : i*ldc+n] - c128.ScalUnitary(beta, ci) - } - } - return - } - - if side == blas.Left { - // Form C = alpha*A*B + beta*C. - for i := 0; i < m; i++ { - atmp := alpha * complex(real(a[i*lda+i]), 0) - bi := b[i*ldb : i*ldb+n] - ci := c[i*ldc : i*ldc+n] - if beta == 0 { - for j, bij := range bi { - ci[j] = atmp * bij - } - } else { - for j, bij := range bi { - ci[j] = atmp*bij + beta*ci[j] - } - } - if uplo == blas.Upper { - for k := 0; k < i; k++ { - atmp = alpha * cmplx.Conj(a[k*lda+i]) - c128.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - for k := i + 1; k < m; k++ { - atmp = alpha * a[i*lda+k] - c128.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - } else { - for k := 0; k < i; k++ { - atmp = alpha * a[i*lda+k] - c128.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - for k := i + 1; k < m; k++ { - atmp = alpha * cmplx.Conj(a[k*lda+i]) - c128.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - } - } - } else { - // Form C = alpha*B*A + beta*C. - if uplo == blas.Upper { - for i := 0; i < m; i++ { - for j := n - 1; j >= 0; j-- { - abij := alpha * b[i*ldb+j] - aj := a[j*lda+j+1 : j*lda+n] - bi := b[i*ldb+j+1 : i*ldb+n] - ci := c[i*ldc+j+1 : i*ldc+n] - var tmp complex128 - for k, ajk := range aj { - ci[k] += abij * ajk - tmp += bi[k] * cmplx.Conj(ajk) - } - ajj := complex(real(a[j*lda+j]), 0) - if beta == 0 { - c[i*ldc+j] = abij*ajj + alpha*tmp - } else { - c[i*ldc+j] = abij*ajj + alpha*tmp + beta*c[i*ldc+j] - } - } - } - } else { - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - abij := alpha * b[i*ldb+j] - aj := a[j*lda : j*lda+j] - bi := b[i*ldb : i*ldb+j] - ci := c[i*ldc : i*ldc+j] - var tmp complex128 - for k, ajk := range aj { - ci[k] += abij * ajk - tmp += bi[k] * cmplx.Conj(ajk) - } - ajj := complex(real(a[j*lda+j]), 0) - if beta == 0 { - c[i*ldc+j] = abij*ajj + alpha*tmp - } else { - c[i*ldc+j] = abij*ajj + alpha*tmp + beta*c[i*ldc+j] - } - } - } - } - } -} - -// Zherk performs one of the hermitian rank-k operations -// C = alpha*A*Aᴴ + beta*C if trans == blas.NoTrans -// C = alpha*Aᴴ*A + beta*C if trans == blas.ConjTrans -// where alpha and beta are real scalars, C is an n×n hermitian matrix and A is -// an n×k matrix in the first case and a k×n matrix in the second case. -// -// The imaginary parts of the diagonal elements of C are assumed to be zero, and -// on return they will be set to zero. -func (Implementation) Zherk(uplo blas.Uplo, trans blas.Transpose, n, k int, alpha float64, a []complex128, lda int, beta float64, c []complex128, ldc int) { - var rowA, colA int - switch trans { - default: - panic(badTranspose) - case blas.NoTrans: - rowA, colA = n, k - case blas.ConjTrans: - rowA, colA = k, n - } - switch { - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case lda < max(1, colA): - panic(badLdA) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (rowA-1)*lda+colA { - panic(shortA) - } - if len(c) < (n-1)*ldc+n { - panic(shortC) - } - - // Quick return if possible. - if (alpha == 0 || k == 0) && beta == 1 { - return - } - - if alpha == 0 { - if uplo == blas.Upper { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - ci[0] = complex(beta*real(ci[0]), 0) - if i != n-1 { - c128.DscalUnitary(beta, ci[1:]) - } - } - } - } else { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - if i != 0 { - c128.DscalUnitary(beta, ci[:i]) - } - ci[i] = complex(beta*real(ci[i]), 0) - } - } - } - return - } - - calpha := complex(alpha, 0) - if trans == blas.NoTrans { - // Form C = alpha*A*Aᴴ + beta*C. - cbeta := complex(beta, 0) - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - ai := a[i*lda : i*lda+k] - switch { - case beta == 0: - // Handle the i-th diagonal element of C. - ci[0] = complex(alpha*real(c128.DotcUnitary(ai, ai)), 0) - // Handle the remaining elements on the i-th row of C. - for jc := range ci[1:] { - j := i + 1 + jc - ci[jc+1] = calpha * c128.DotcUnitary(a[j*lda:j*lda+k], ai) - } - case beta != 1: - cii := calpha*c128.DotcUnitary(ai, ai) + cbeta*ci[0] - ci[0] = complex(real(cii), 0) - for jc, cij := range ci[1:] { - j := i + 1 + jc - ci[jc+1] = calpha*c128.DotcUnitary(a[j*lda:j*lda+k], ai) + cbeta*cij - } - default: - cii := calpha*c128.DotcUnitary(ai, ai) + ci[0] - ci[0] = complex(real(cii), 0) - for jc, cij := range ci[1:] { - j := i + 1 + jc - ci[jc+1] = calpha*c128.DotcUnitary(a[j*lda:j*lda+k], ai) + cij - } - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - ai := a[i*lda : i*lda+k] - switch { - case beta == 0: - // Handle the first i-1 elements on the i-th row of C. - for j := range ci[:i] { - ci[j] = calpha * c128.DotcUnitary(a[j*lda:j*lda+k], ai) - } - // Handle the i-th diagonal element of C. - ci[i] = complex(alpha*real(c128.DotcUnitary(ai, ai)), 0) - case beta != 1: - for j, cij := range ci[:i] { - ci[j] = calpha*c128.DotcUnitary(a[j*lda:j*lda+k], ai) + cbeta*cij - } - cii := calpha*c128.DotcUnitary(ai, ai) + cbeta*ci[i] - ci[i] = complex(real(cii), 0) - default: - for j, cij := range ci[:i] { - ci[j] = calpha*c128.DotcUnitary(a[j*lda:j*lda+k], ai) + cij - } - cii := calpha*c128.DotcUnitary(ai, ai) + ci[i] - ci[i] = complex(real(cii), 0) - } - } - } - } else { - // Form C = alpha*Aᴴ*A + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - switch { - case beta == 0: - for jc := range ci { - ci[jc] = 0 - } - case beta != 1: - c128.DscalUnitary(beta, ci) - ci[0] = complex(real(ci[0]), 0) - default: - ci[0] = complex(real(ci[0]), 0) - } - for j := 0; j < k; j++ { - aji := cmplx.Conj(a[j*lda+i]) - if aji != 0 { - c128.AxpyUnitary(calpha*aji, a[j*lda+i:j*lda+n], ci) - } - } - c[i*ldc+i] = complex(real(c[i*ldc+i]), 0) - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - switch { - case beta == 0: - for j := range ci { - ci[j] = 0 - } - case beta != 1: - c128.DscalUnitary(beta, ci) - ci[i] = complex(real(ci[i]), 0) - default: - ci[i] = complex(real(ci[i]), 0) - } - for j := 0; j < k; j++ { - aji := cmplx.Conj(a[j*lda+i]) - if aji != 0 { - c128.AxpyUnitary(calpha*aji, a[j*lda:j*lda+i+1], ci) - } - } - c[i*ldc+i] = complex(real(c[i*ldc+i]), 0) - } - } - } -} - -// Zher2k performs one of the hermitian rank-2k operations -// C = alpha*A*Bᴴ + conj(alpha)*B*Aᴴ + beta*C if trans == blas.NoTrans -// C = alpha*Aᴴ*B + conj(alpha)*Bᴴ*A + beta*C if trans == blas.ConjTrans -// where alpha and beta are scalars with beta real, C is an n×n hermitian matrix -// and A and B are n×k matrices in the first case and k×n matrices in the second case. -// -// The imaginary parts of the diagonal elements of C are assumed to be zero, and -// on return they will be set to zero. -func (Implementation) Zher2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta float64, c []complex128, ldc int) { - var row, col int - switch trans { - default: - panic(badTranspose) - case blas.NoTrans: - row, col = n, k - case blas.ConjTrans: - row, col = k, n - } - switch { - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case lda < max(1, col): - panic(badLdA) - case ldb < max(1, col): - panic(badLdB) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (row-1)*lda+col { - panic(shortA) - } - if len(b) < (row-1)*ldb+col { - panic(shortB) - } - if len(c) < (n-1)*ldc+n { - panic(shortC) - } - - // Quick return if possible. - if (alpha == 0 || k == 0) && beta == 1 { - return - } - - if alpha == 0 { - if uplo == blas.Upper { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - ci[0] = complex(beta*real(ci[0]), 0) - if i != n-1 { - c128.DscalUnitary(beta, ci[1:]) - } - } - } - } else { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - if i != 0 { - c128.DscalUnitary(beta, ci[:i]) - } - ci[i] = complex(beta*real(ci[i]), 0) - } - } - } - return - } - - conjalpha := cmplx.Conj(alpha) - cbeta := complex(beta, 0) - if trans == blas.NoTrans { - // Form C = alpha*A*Bᴴ + conj(alpha)*B*Aᴴ + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i+1 : i*ldc+n] - ai := a[i*lda : i*lda+k] - bi := b[i*ldb : i*ldb+k] - if beta == 0 { - cii := alpha*c128.DotcUnitary(bi, ai) + conjalpha*c128.DotcUnitary(ai, bi) - c[i*ldc+i] = complex(real(cii), 0) - for jc := range ci { - j := i + 1 + jc - ci[jc] = alpha*c128.DotcUnitary(b[j*ldb:j*ldb+k], ai) + conjalpha*c128.DotcUnitary(a[j*lda:j*lda+k], bi) - } - } else { - cii := alpha*c128.DotcUnitary(bi, ai) + conjalpha*c128.DotcUnitary(ai, bi) + cbeta*c[i*ldc+i] - c[i*ldc+i] = complex(real(cii), 0) - for jc, cij := range ci { - j := i + 1 + jc - ci[jc] = alpha*c128.DotcUnitary(b[j*ldb:j*ldb+k], ai) + conjalpha*c128.DotcUnitary(a[j*lda:j*lda+k], bi) + cbeta*cij - } - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i] - ai := a[i*lda : i*lda+k] - bi := b[i*ldb : i*ldb+k] - if beta == 0 { - for j := range ci { - ci[j] = alpha*c128.DotcUnitary(b[j*ldb:j*ldb+k], ai) + conjalpha*c128.DotcUnitary(a[j*lda:j*lda+k], bi) - } - cii := alpha*c128.DotcUnitary(bi, ai) + conjalpha*c128.DotcUnitary(ai, bi) - c[i*ldc+i] = complex(real(cii), 0) - } else { - for j, cij := range ci { - ci[j] = alpha*c128.DotcUnitary(b[j*ldb:j*ldb+k], ai) + conjalpha*c128.DotcUnitary(a[j*lda:j*lda+k], bi) + cbeta*cij - } - cii := alpha*c128.DotcUnitary(bi, ai) + conjalpha*c128.DotcUnitary(ai, bi) + cbeta*c[i*ldc+i] - c[i*ldc+i] = complex(real(cii), 0) - } - } - } - } else { - // Form C = alpha*Aᴴ*B + conj(alpha)*Bᴴ*A + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - switch { - case beta == 0: - for jc := range ci { - ci[jc] = 0 - } - case beta != 1: - c128.DscalUnitary(beta, ci) - ci[0] = complex(real(ci[0]), 0) - default: - ci[0] = complex(real(ci[0]), 0) - } - for j := 0; j < k; j++ { - aji := a[j*lda+i] - bji := b[j*ldb+i] - if aji != 0 { - c128.AxpyUnitary(alpha*cmplx.Conj(aji), b[j*ldb+i:j*ldb+n], ci) - } - if bji != 0 { - c128.AxpyUnitary(conjalpha*cmplx.Conj(bji), a[j*lda+i:j*lda+n], ci) - } - } - ci[0] = complex(real(ci[0]), 0) - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - switch { - case beta == 0: - for j := range ci { - ci[j] = 0 - } - case beta != 1: - c128.DscalUnitary(beta, ci) - ci[i] = complex(real(ci[i]), 0) - default: - ci[i] = complex(real(ci[i]), 0) - } - for j := 0; j < k; j++ { - aji := a[j*lda+i] - bji := b[j*ldb+i] - if aji != 0 { - c128.AxpyUnitary(alpha*cmplx.Conj(aji), b[j*ldb:j*ldb+i+1], ci) - } - if bji != 0 { - c128.AxpyUnitary(conjalpha*cmplx.Conj(bji), a[j*lda:j*lda+i+1], ci) - } - } - ci[i] = complex(real(ci[i]), 0) - } - } - } -} - -// Zsymm performs one of the matrix-matrix operations -// C = alpha*A*B + beta*C if side == blas.Left -// C = alpha*B*A + beta*C if side == blas.Right -// where alpha and beta are scalars, A is an m×m or n×n symmetric matrix and B -// and C are m×n matrices. -func (Implementation) Zsymm(side blas.Side, uplo blas.Uplo, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) { - na := m - if side == blas.Right { - na = n - } - switch { - case side != blas.Left && side != blas.Right: - panic(badSide) - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, na): - panic(badLdA) - case ldb < max(1, n): - panic(badLdB) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(na-1)+na { - panic(shortA) - } - if len(b) < ldb*(m-1)+n { - panic(shortB) - } - if len(c) < ldc*(m-1)+n { - panic(shortC) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - if alpha == 0 { - if beta == 0 { - for i := 0; i < m; i++ { - ci := c[i*ldc : i*ldc+n] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < m; i++ { - ci := c[i*ldc : i*ldc+n] - c128.ScalUnitary(beta, ci) - } - } - return - } - - if side == blas.Left { - // Form C = alpha*A*B + beta*C. - for i := 0; i < m; i++ { - atmp := alpha * a[i*lda+i] - bi := b[i*ldb : i*ldb+n] - ci := c[i*ldc : i*ldc+n] - if beta == 0 { - for j, bij := range bi { - ci[j] = atmp * bij - } - } else { - for j, bij := range bi { - ci[j] = atmp*bij + beta*ci[j] - } - } - if uplo == blas.Upper { - for k := 0; k < i; k++ { - atmp = alpha * a[k*lda+i] - c128.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - for k := i + 1; k < m; k++ { - atmp = alpha * a[i*lda+k] - c128.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - } else { - for k := 0; k < i; k++ { - atmp = alpha * a[i*lda+k] - c128.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - for k := i + 1; k < m; k++ { - atmp = alpha * a[k*lda+i] - c128.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - } - } - } else { - // Form C = alpha*B*A + beta*C. - if uplo == blas.Upper { - for i := 0; i < m; i++ { - for j := n - 1; j >= 0; j-- { - abij := alpha * b[i*ldb+j] - aj := a[j*lda+j+1 : j*lda+n] - bi := b[i*ldb+j+1 : i*ldb+n] - ci := c[i*ldc+j+1 : i*ldc+n] - var tmp complex128 - for k, ajk := range aj { - ci[k] += abij * ajk - tmp += bi[k] * ajk - } - if beta == 0 { - c[i*ldc+j] = abij*a[j*lda+j] + alpha*tmp - } else { - c[i*ldc+j] = abij*a[j*lda+j] + alpha*tmp + beta*c[i*ldc+j] - } - } - } - } else { - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - abij := alpha * b[i*ldb+j] - aj := a[j*lda : j*lda+j] - bi := b[i*ldb : i*ldb+j] - ci := c[i*ldc : i*ldc+j] - var tmp complex128 - for k, ajk := range aj { - ci[k] += abij * ajk - tmp += bi[k] * ajk - } - if beta == 0 { - c[i*ldc+j] = abij*a[j*lda+j] + alpha*tmp - } else { - c[i*ldc+j] = abij*a[j*lda+j] + alpha*tmp + beta*c[i*ldc+j] - } - } - } - } - } -} - -// Zsyrk performs one of the symmetric rank-k operations -// C = alpha*A*Aᵀ + beta*C if trans == blas.NoTrans -// C = alpha*Aᵀ*A + beta*C if trans == blas.Trans -// where alpha and beta are scalars, C is an n×n symmetric matrix and A is -// an n×k matrix in the first case and a k×n matrix in the second case. -func (Implementation) Zsyrk(uplo blas.Uplo, trans blas.Transpose, n, k int, alpha complex128, a []complex128, lda int, beta complex128, c []complex128, ldc int) { - var rowA, colA int - switch trans { - default: - panic(badTranspose) - case blas.NoTrans: - rowA, colA = n, k - case blas.Trans: - rowA, colA = k, n - } - switch { - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case lda < max(1, colA): - panic(badLdA) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (rowA-1)*lda+colA { - panic(shortA) - } - if len(c) < (n-1)*ldc+n { - panic(shortC) - } - - // Quick return if possible. - if (alpha == 0 || k == 0) && beta == 1 { - return - } - - if alpha == 0 { - if uplo == blas.Upper { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - c128.ScalUnitary(beta, ci) - } - } - } else { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - c128.ScalUnitary(beta, ci) - } - } - } - return - } - - if trans == blas.NoTrans { - // Form C = alpha*A*Aᵀ + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - ai := a[i*lda : i*lda+k] - for jc, cij := range ci { - j := i + jc - ci[jc] = beta*cij + alpha*c128.DotuUnitary(ai, a[j*lda:j*lda+k]) - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - ai := a[i*lda : i*lda+k] - for j, cij := range ci { - ci[j] = beta*cij + alpha*c128.DotuUnitary(ai, a[j*lda:j*lda+k]) - } - } - } - } else { - // Form C = alpha*Aᵀ*A + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - switch { - case beta == 0: - for jc := range ci { - ci[jc] = 0 - } - case beta != 1: - for jc := range ci { - ci[jc] *= beta - } - } - for j := 0; j < k; j++ { - aji := a[j*lda+i] - if aji != 0 { - c128.AxpyUnitary(alpha*aji, a[j*lda+i:j*lda+n], ci) - } - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - switch { - case beta == 0: - for j := range ci { - ci[j] = 0 - } - case beta != 1: - for j := range ci { - ci[j] *= beta - } - } - for j := 0; j < k; j++ { - aji := a[j*lda+i] - if aji != 0 { - c128.AxpyUnitary(alpha*aji, a[j*lda:j*lda+i+1], ci) - } - } - } - } - } -} - -// Zsyr2k performs one of the symmetric rank-2k operations -// C = alpha*A*Bᵀ + alpha*B*Aᵀ + beta*C if trans == blas.NoTrans -// C = alpha*Aᵀ*B + alpha*Bᵀ*A + beta*C if trans == blas.Trans -// where alpha and beta are scalars, C is an n×n symmetric matrix and A and B -// are n×k matrices in the first case and k×n matrices in the second case. -func (Implementation) Zsyr2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) { - var row, col int - switch trans { - default: - panic(badTranspose) - case blas.NoTrans: - row, col = n, k - case blas.Trans: - row, col = k, n - } - switch { - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case lda < max(1, col): - panic(badLdA) - case ldb < max(1, col): - panic(badLdB) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (row-1)*lda+col { - panic(shortA) - } - if len(b) < (row-1)*ldb+col { - panic(shortB) - } - if len(c) < (n-1)*ldc+n { - panic(shortC) - } - - // Quick return if possible. - if (alpha == 0 || k == 0) && beta == 1 { - return - } - - if alpha == 0 { - if uplo == blas.Upper { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - c128.ScalUnitary(beta, ci) - } - } - } else { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - c128.ScalUnitary(beta, ci) - } - } - } - return - } - - if trans == blas.NoTrans { - // Form C = alpha*A*Bᵀ + alpha*B*Aᵀ + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - ai := a[i*lda : i*lda+k] - bi := b[i*ldb : i*ldb+k] - if beta == 0 { - for jc := range ci { - j := i + jc - ci[jc] = alpha*c128.DotuUnitary(ai, b[j*ldb:j*ldb+k]) + alpha*c128.DotuUnitary(bi, a[j*lda:j*lda+k]) - } - } else { - for jc, cij := range ci { - j := i + jc - ci[jc] = alpha*c128.DotuUnitary(ai, b[j*ldb:j*ldb+k]) + alpha*c128.DotuUnitary(bi, a[j*lda:j*lda+k]) + beta*cij - } - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - ai := a[i*lda : i*lda+k] - bi := b[i*ldb : i*ldb+k] - if beta == 0 { - for j := range ci { - ci[j] = alpha*c128.DotuUnitary(ai, b[j*ldb:j*ldb+k]) + alpha*c128.DotuUnitary(bi, a[j*lda:j*lda+k]) - } - } else { - for j, cij := range ci { - ci[j] = alpha*c128.DotuUnitary(ai, b[j*ldb:j*ldb+k]) + alpha*c128.DotuUnitary(bi, a[j*lda:j*lda+k]) + beta*cij - } - } - } - } - } else { - // Form C = alpha*Aᵀ*B + alpha*Bᵀ*A + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - switch { - case beta == 0: - for jc := range ci { - ci[jc] = 0 - } - case beta != 1: - for jc := range ci { - ci[jc] *= beta - } - } - for j := 0; j < k; j++ { - aji := a[j*lda+i] - bji := b[j*ldb+i] - if aji != 0 { - c128.AxpyUnitary(alpha*aji, b[j*ldb+i:j*ldb+n], ci) - } - if bji != 0 { - c128.AxpyUnitary(alpha*bji, a[j*lda+i:j*lda+n], ci) - } - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - switch { - case beta == 0: - for j := range ci { - ci[j] = 0 - } - case beta != 1: - for j := range ci { - ci[j] *= beta - } - } - for j := 0; j < k; j++ { - aji := a[j*lda+i] - bji := b[j*ldb+i] - if aji != 0 { - c128.AxpyUnitary(alpha*aji, b[j*ldb:j*ldb+i+1], ci) - } - if bji != 0 { - c128.AxpyUnitary(alpha*bji, a[j*lda:j*lda+i+1], ci) - } - } - } - } - } -} - -// Ztrmm performs one of the matrix-matrix operations -// B = alpha * op(A) * B if side == blas.Left, -// B = alpha * B * op(A) if side == blas.Right, -// where alpha is a scalar, B is an m×n matrix, A is a unit, or non-unit, -// upper or lower triangular matrix and op(A) is one of -// op(A) = A if trans == blas.NoTrans, -// op(A) = Aᵀ if trans == blas.Trans, -// op(A) = Aᴴ if trans == blas.ConjTrans. -func (Implementation) Ztrmm(side blas.Side, uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int) { - na := m - if side == blas.Right { - na = n - } - switch { - case side != blas.Left && side != blas.Right: - panic(badSide) - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case trans != blas.NoTrans && trans != blas.Trans && trans != blas.ConjTrans: - panic(badTranspose) - case diag != blas.Unit && diag != blas.NonUnit: - panic(badDiag) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, na): - panic(badLdA) - case ldb < max(1, n): - panic(badLdB) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (na-1)*lda+na { - panic(shortA) - } - if len(b) < (m-1)*ldb+n { - panic(shortB) - } - - // Quick return if possible. - if alpha == 0 { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for j := range bi { - bi[j] = 0 - } - } - return - } - - noConj := trans != blas.ConjTrans - noUnit := diag == blas.NonUnit - if side == blas.Left { - if trans == blas.NoTrans { - // Form B = alpha*A*B. - if uplo == blas.Upper { - for i := 0; i < m; i++ { - aii := alpha - if noUnit { - aii *= a[i*lda+i] - } - bi := b[i*ldb : i*ldb+n] - for j := range bi { - bi[j] *= aii - } - for ja, aij := range a[i*lda+i+1 : i*lda+m] { - j := ja + i + 1 - if aij != 0 { - c128.AxpyUnitary(alpha*aij, b[j*ldb:j*ldb+n], bi) - } - } - } - } else { - for i := m - 1; i >= 0; i-- { - aii := alpha - if noUnit { - aii *= a[i*lda+i] - } - bi := b[i*ldb : i*ldb+n] - for j := range bi { - bi[j] *= aii - } - for j, aij := range a[i*lda : i*lda+i] { - if aij != 0 { - c128.AxpyUnitary(alpha*aij, b[j*ldb:j*ldb+n], bi) - } - } - } - } - } else { - // Form B = alpha*Aᵀ*B or B = alpha*Aᴴ*B. - if uplo == blas.Upper { - for k := m - 1; k >= 0; k-- { - bk := b[k*ldb : k*ldb+n] - for ja, ajk := range a[k*lda+k+1 : k*lda+m] { - if ajk == 0 { - continue - } - j := k + 1 + ja - if noConj { - c128.AxpyUnitary(alpha*ajk, bk, b[j*ldb:j*ldb+n]) - } else { - c128.AxpyUnitary(alpha*cmplx.Conj(ajk), bk, b[j*ldb:j*ldb+n]) - } - } - akk := alpha - if noUnit { - if noConj { - akk *= a[k*lda+k] - } else { - akk *= cmplx.Conj(a[k*lda+k]) - } - } - if akk != 1 { - c128.ScalUnitary(akk, bk) - } - } - } else { - for k := 0; k < m; k++ { - bk := b[k*ldb : k*ldb+n] - for j, ajk := range a[k*lda : k*lda+k] { - if ajk == 0 { - continue - } - if noConj { - c128.AxpyUnitary(alpha*ajk, bk, b[j*ldb:j*ldb+n]) - } else { - c128.AxpyUnitary(alpha*cmplx.Conj(ajk), bk, b[j*ldb:j*ldb+n]) - } - } - akk := alpha - if noUnit { - if noConj { - akk *= a[k*lda+k] - } else { - akk *= cmplx.Conj(a[k*lda+k]) - } - } - if akk != 1 { - c128.ScalUnitary(akk, bk) - } - } - } - } - } else { - if trans == blas.NoTrans { - // Form B = alpha*B*A. - if uplo == blas.Upper { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for k := n - 1; k >= 0; k-- { - abik := alpha * bi[k] - if abik == 0 { - continue - } - bi[k] = abik - if noUnit { - bi[k] *= a[k*lda+k] - } - c128.AxpyUnitary(abik, a[k*lda+k+1:k*lda+n], bi[k+1:]) - } - } - } else { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for k := 0; k < n; k++ { - abik := alpha * bi[k] - if abik == 0 { - continue - } - bi[k] = abik - if noUnit { - bi[k] *= a[k*lda+k] - } - c128.AxpyUnitary(abik, a[k*lda:k*lda+k], bi[:k]) - } - } - } - } else { - // Form B = alpha*B*Aᵀ or B = alpha*B*Aᴴ. - if uplo == blas.Upper { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for j, bij := range bi { - if noConj { - if noUnit { - bij *= a[j*lda+j] - } - bij += c128.DotuUnitary(a[j*lda+j+1:j*lda+n], bi[j+1:n]) - } else { - if noUnit { - bij *= cmplx.Conj(a[j*lda+j]) - } - bij += c128.DotcUnitary(a[j*lda+j+1:j*lda+n], bi[j+1:n]) - } - bi[j] = alpha * bij - } - } - } else { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for j := n - 1; j >= 0; j-- { - bij := bi[j] - if noConj { - if noUnit { - bij *= a[j*lda+j] - } - bij += c128.DotuUnitary(a[j*lda:j*lda+j], bi[:j]) - } else { - if noUnit { - bij *= cmplx.Conj(a[j*lda+j]) - } - bij += c128.DotcUnitary(a[j*lda:j*lda+j], bi[:j]) - } - bi[j] = alpha * bij - } - } - } - } - } -} - -// Ztrsm solves one of the matrix equations -// op(A) * X = alpha * B if side == blas.Left, -// X * op(A) = alpha * B if side == blas.Right, -// where alpha is a scalar, X and B are m×n matrices, A is a unit or -// non-unit, upper or lower triangular matrix and op(A) is one of -// op(A) = A if transA == blas.NoTrans, -// op(A) = Aᵀ if transA == blas.Trans, -// op(A) = Aᴴ if transA == blas.ConjTrans. -// On return the matrix X is overwritten on B. -func (Implementation) Ztrsm(side blas.Side, uplo blas.Uplo, transA blas.Transpose, diag blas.Diag, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int) { - na := m - if side == blas.Right { - na = n - } - switch { - case side != blas.Left && side != blas.Right: - panic(badSide) - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case transA != blas.NoTrans && transA != blas.Trans && transA != blas.ConjTrans: - panic(badTranspose) - case diag != blas.Unit && diag != blas.NonUnit: - panic(badDiag) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, na): - panic(badLdA) - case ldb < max(1, n): - panic(badLdB) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (na-1)*lda+na { - panic(shortA) - } - if len(b) < (m-1)*ldb+n { - panic(shortB) - } - - if alpha == 0 { - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - b[i*ldb+j] = 0 - } - } - return - } - - noConj := transA != blas.ConjTrans - noUnit := diag == blas.NonUnit - if side == blas.Left { - if transA == blas.NoTrans { - // Form B = alpha*inv(A)*B. - if uplo == blas.Upper { - for i := m - 1; i >= 0; i-- { - bi := b[i*ldb : i*ldb+n] - if alpha != 1 { - c128.ScalUnitary(alpha, bi) - } - for ka, aik := range a[i*lda+i+1 : i*lda+m] { - k := i + 1 + ka - if aik != 0 { - c128.AxpyUnitary(-aik, b[k*ldb:k*ldb+n], bi) - } - } - if noUnit { - c128.ScalUnitary(1/a[i*lda+i], bi) - } - } - } else { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - if alpha != 1 { - c128.ScalUnitary(alpha, bi) - } - for j, aij := range a[i*lda : i*lda+i] { - if aij != 0 { - c128.AxpyUnitary(-aij, b[j*ldb:j*ldb+n], bi) - } - } - if noUnit { - c128.ScalUnitary(1/a[i*lda+i], bi) - } - } - } - } else { - // Form B = alpha*inv(Aᵀ)*B or B = alpha*inv(Aᴴ)*B. - if uplo == blas.Upper { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - if noUnit { - if noConj { - c128.ScalUnitary(1/a[i*lda+i], bi) - } else { - c128.ScalUnitary(1/cmplx.Conj(a[i*lda+i]), bi) - } - } - for ja, aij := range a[i*lda+i+1 : i*lda+m] { - if aij == 0 { - continue - } - j := i + 1 + ja - if noConj { - c128.AxpyUnitary(-aij, bi, b[j*ldb:j*ldb+n]) - } else { - c128.AxpyUnitary(-cmplx.Conj(aij), bi, b[j*ldb:j*ldb+n]) - } - } - if alpha != 1 { - c128.ScalUnitary(alpha, bi) - } - } - } else { - for i := m - 1; i >= 0; i-- { - bi := b[i*ldb : i*ldb+n] - if noUnit { - if noConj { - c128.ScalUnitary(1/a[i*lda+i], bi) - } else { - c128.ScalUnitary(1/cmplx.Conj(a[i*lda+i]), bi) - } - } - for j, aij := range a[i*lda : i*lda+i] { - if aij == 0 { - continue - } - if noConj { - c128.AxpyUnitary(-aij, bi, b[j*ldb:j*ldb+n]) - } else { - c128.AxpyUnitary(-cmplx.Conj(aij), bi, b[j*ldb:j*ldb+n]) - } - } - if alpha != 1 { - c128.ScalUnitary(alpha, bi) - } - } - } - } - } else { - if transA == blas.NoTrans { - // Form B = alpha*B*inv(A). - if uplo == blas.Upper { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - if alpha != 1 { - c128.ScalUnitary(alpha, bi) - } - for j, bij := range bi { - if bij == 0 { - continue - } - if noUnit { - bi[j] /= a[j*lda+j] - } - c128.AxpyUnitary(-bi[j], a[j*lda+j+1:j*lda+n], bi[j+1:n]) - } - } - } else { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - if alpha != 1 { - c128.ScalUnitary(alpha, bi) - } - for j := n - 1; j >= 0; j-- { - if bi[j] == 0 { - continue - } - if noUnit { - bi[j] /= a[j*lda+j] - } - c128.AxpyUnitary(-bi[j], a[j*lda:j*lda+j], bi[:j]) - } - } - } - } else { - // Form B = alpha*B*inv(Aᵀ) or B = alpha*B*inv(Aᴴ). - if uplo == blas.Upper { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for j := n - 1; j >= 0; j-- { - bij := alpha * bi[j] - if noConj { - bij -= c128.DotuUnitary(a[j*lda+j+1:j*lda+n], bi[j+1:n]) - if noUnit { - bij /= a[j*lda+j] - } - } else { - bij -= c128.DotcUnitary(a[j*lda+j+1:j*lda+n], bi[j+1:n]) - if noUnit { - bij /= cmplx.Conj(a[j*lda+j]) - } - } - bi[j] = bij - } - } - } else { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for j, bij := range bi { - bij *= alpha - if noConj { - bij -= c128.DotuUnitary(a[j*lda:j*lda+j], bi[:j]) - if noUnit { - bij /= a[j*lda+j] - } - } else { - bij -= c128.DotcUnitary(a[j*lda:j*lda+j], bi[:j]) - if noUnit { - bij /= cmplx.Conj(a[j*lda+j]) - } - } - bi[j] = bij - } - } - } - } - } -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level3cmplx64.go b/vendor/gonum.org/v1/gonum/blas/gonum/level3cmplx64.go deleted file mode 100644 index 570b2af..0000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level3cmplx64.go +++ /dev/null @@ -1,1735 +0,0 @@ -// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT. - -// Copyright ©2019 The Gonum 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 gonum - -import ( - cmplx "gonum.org/v1/gonum/internal/cmplx64" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/c64" -) - -var _ blas.Complex64Level3 = Implementation{} - -// Cgemm performs one of the matrix-matrix operations -// C = alpha * op(A) * op(B) + beta * C -// where op(X) is one of -// op(X) = X or op(X) = Xᵀ or op(X) = Xᴴ, -// alpha and beta are scalars, and A, B and C are matrices, with op(A) an m×k matrix, -// op(B) a k×n matrix and C an m×n matrix. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Cgemm(tA, tB blas.Transpose, m, n, k int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta complex64, c []complex64, ldc int) { - switch tA { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch tB { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - } - rowA, colA := m, k - if tA != blas.NoTrans { - rowA, colA = k, m - } - if lda < max(1, colA) { - panic(badLdA) - } - rowB, colB := k, n - if tB != blas.NoTrans { - rowB, colB = n, k - } - if ldb < max(1, colB) { - panic(badLdB) - } - if ldc < max(1, n) { - panic(badLdC) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (rowA-1)*lda+colA { - panic(shortA) - } - if len(b) < (rowB-1)*ldb+colB { - panic(shortB) - } - if len(c) < (m-1)*ldc+n { - panic(shortC) - } - - // Quick return if possible. - if (alpha == 0 || k == 0) && beta == 1 { - return - } - - if alpha == 0 { - if beta == 0 { - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - c[i*ldc+j] = 0 - } - } - } else { - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - c[i*ldc+j] *= beta - } - } - } - return - } - - switch tA { - case blas.NoTrans: - switch tB { - case blas.NoTrans: - // Form C = alpha * A * B + beta * C. - for i := 0; i < m; i++ { - switch { - case beta == 0: - for j := 0; j < n; j++ { - c[i*ldc+j] = 0 - } - case beta != 1: - for j := 0; j < n; j++ { - c[i*ldc+j] *= beta - } - } - for l := 0; l < k; l++ { - tmp := alpha * a[i*lda+l] - for j := 0; j < n; j++ { - c[i*ldc+j] += tmp * b[l*ldb+j] - } - } - } - case blas.Trans: - // Form C = alpha * A * Bᵀ + beta * C. - for i := 0; i < m; i++ { - switch { - case beta == 0: - for j := 0; j < n; j++ { - c[i*ldc+j] = 0 - } - case beta != 1: - for j := 0; j < n; j++ { - c[i*ldc+j] *= beta - } - } - for l := 0; l < k; l++ { - tmp := alpha * a[i*lda+l] - for j := 0; j < n; j++ { - c[i*ldc+j] += tmp * b[j*ldb+l] - } - } - } - case blas.ConjTrans: - // Form C = alpha * A * Bᴴ + beta * C. - for i := 0; i < m; i++ { - switch { - case beta == 0: - for j := 0; j < n; j++ { - c[i*ldc+j] = 0 - } - case beta != 1: - for j := 0; j < n; j++ { - c[i*ldc+j] *= beta - } - } - for l := 0; l < k; l++ { - tmp := alpha * a[i*lda+l] - for j := 0; j < n; j++ { - c[i*ldc+j] += tmp * cmplx.Conj(b[j*ldb+l]) - } - } - } - } - case blas.Trans: - switch tB { - case blas.NoTrans: - // Form C = alpha * Aᵀ * B + beta * C. - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - var tmp complex64 - for l := 0; l < k; l++ { - tmp += a[l*lda+i] * b[l*ldb+j] - } - if beta == 0 { - c[i*ldc+j] = alpha * tmp - } else { - c[i*ldc+j] = alpha*tmp + beta*c[i*ldc+j] - } - } - } - case blas.Trans: - // Form C = alpha * Aᵀ * Bᵀ + beta * C. - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - var tmp complex64 - for l := 0; l < k; l++ { - tmp += a[l*lda+i] * b[j*ldb+l] - } - if beta == 0 { - c[i*ldc+j] = alpha * tmp - } else { - c[i*ldc+j] = alpha*tmp + beta*c[i*ldc+j] - } - } - } - case blas.ConjTrans: - // Form C = alpha * Aᵀ * Bᴴ + beta * C. - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - var tmp complex64 - for l := 0; l < k; l++ { - tmp += a[l*lda+i] * cmplx.Conj(b[j*ldb+l]) - } - if beta == 0 { - c[i*ldc+j] = alpha * tmp - } else { - c[i*ldc+j] = alpha*tmp + beta*c[i*ldc+j] - } - } - } - } - case blas.ConjTrans: - switch tB { - case blas.NoTrans: - // Form C = alpha * Aᴴ * B + beta * C. - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - var tmp complex64 - for l := 0; l < k; l++ { - tmp += cmplx.Conj(a[l*lda+i]) * b[l*ldb+j] - } - if beta == 0 { - c[i*ldc+j] = alpha * tmp - } else { - c[i*ldc+j] = alpha*tmp + beta*c[i*ldc+j] - } - } - } - case blas.Trans: - // Form C = alpha * Aᴴ * Bᵀ + beta * C. - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - var tmp complex64 - for l := 0; l < k; l++ { - tmp += cmplx.Conj(a[l*lda+i]) * b[j*ldb+l] - } - if beta == 0 { - c[i*ldc+j] = alpha * tmp - } else { - c[i*ldc+j] = alpha*tmp + beta*c[i*ldc+j] - } - } - } - case blas.ConjTrans: - // Form C = alpha * Aᴴ * Bᴴ + beta * C. - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - var tmp complex64 - for l := 0; l < k; l++ { - tmp += cmplx.Conj(a[l*lda+i]) * cmplx.Conj(b[j*ldb+l]) - } - if beta == 0 { - c[i*ldc+j] = alpha * tmp - } else { - c[i*ldc+j] = alpha*tmp + beta*c[i*ldc+j] - } - } - } - } - } -} - -// Chemm performs one of the matrix-matrix operations -// C = alpha*A*B + beta*C if side == blas.Left -// C = alpha*B*A + beta*C if side == blas.Right -// where alpha and beta are scalars, A is an m×m or n×n hermitian matrix and B -// and C are m×n matrices. The imaginary parts of the diagonal elements of A are -// assumed to be zero. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Chemm(side blas.Side, uplo blas.Uplo, m, n int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta complex64, c []complex64, ldc int) { - na := m - if side == blas.Right { - na = n - } - switch { - case side != blas.Left && side != blas.Right: - panic(badSide) - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, na): - panic(badLdA) - case ldb < max(1, n): - panic(badLdB) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(na-1)+na { - panic(shortA) - } - if len(b) < ldb*(m-1)+n { - panic(shortB) - } - if len(c) < ldc*(m-1)+n { - panic(shortC) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - if alpha == 0 { - if beta == 0 { - for i := 0; i < m; i++ { - ci := c[i*ldc : i*ldc+n] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < m; i++ { - ci := c[i*ldc : i*ldc+n] - c64.ScalUnitary(beta, ci) - } - } - return - } - - if side == blas.Left { - // Form C = alpha*A*B + beta*C. - for i := 0; i < m; i++ { - atmp := alpha * complex(real(a[i*lda+i]), 0) - bi := b[i*ldb : i*ldb+n] - ci := c[i*ldc : i*ldc+n] - if beta == 0 { - for j, bij := range bi { - ci[j] = atmp * bij - } - } else { - for j, bij := range bi { - ci[j] = atmp*bij + beta*ci[j] - } - } - if uplo == blas.Upper { - for k := 0; k < i; k++ { - atmp = alpha * cmplx.Conj(a[k*lda+i]) - c64.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - for k := i + 1; k < m; k++ { - atmp = alpha * a[i*lda+k] - c64.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - } else { - for k := 0; k < i; k++ { - atmp = alpha * a[i*lda+k] - c64.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - for k := i + 1; k < m; k++ { - atmp = alpha * cmplx.Conj(a[k*lda+i]) - c64.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - } - } - } else { - // Form C = alpha*B*A + beta*C. - if uplo == blas.Upper { - for i := 0; i < m; i++ { - for j := n - 1; j >= 0; j-- { - abij := alpha * b[i*ldb+j] - aj := a[j*lda+j+1 : j*lda+n] - bi := b[i*ldb+j+1 : i*ldb+n] - ci := c[i*ldc+j+1 : i*ldc+n] - var tmp complex64 - for k, ajk := range aj { - ci[k] += abij * ajk - tmp += bi[k] * cmplx.Conj(ajk) - } - ajj := complex(real(a[j*lda+j]), 0) - if beta == 0 { - c[i*ldc+j] = abij*ajj + alpha*tmp - } else { - c[i*ldc+j] = abij*ajj + alpha*tmp + beta*c[i*ldc+j] - } - } - } - } else { - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - abij := alpha * b[i*ldb+j] - aj := a[j*lda : j*lda+j] - bi := b[i*ldb : i*ldb+j] - ci := c[i*ldc : i*ldc+j] - var tmp complex64 - for k, ajk := range aj { - ci[k] += abij * ajk - tmp += bi[k] * cmplx.Conj(ajk) - } - ajj := complex(real(a[j*lda+j]), 0) - if beta == 0 { - c[i*ldc+j] = abij*ajj + alpha*tmp - } else { - c[i*ldc+j] = abij*ajj + alpha*tmp + beta*c[i*ldc+j] - } - } - } - } - } -} - -// Cherk performs one of the hermitian rank-k operations -// C = alpha*A*Aᴴ + beta*C if trans == blas.NoTrans -// C = alpha*Aᴴ*A + beta*C if trans == blas.ConjTrans -// where alpha and beta are real scalars, C is an n×n hermitian matrix and A is -// an n×k matrix in the first case and a k×n matrix in the second case. -// -// The imaginary parts of the diagonal elements of C are assumed to be zero, and -// on return they will be set to zero. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Cherk(uplo blas.Uplo, trans blas.Transpose, n, k int, alpha float32, a []complex64, lda int, beta float32, c []complex64, ldc int) { - var rowA, colA int - switch trans { - default: - panic(badTranspose) - case blas.NoTrans: - rowA, colA = n, k - case blas.ConjTrans: - rowA, colA = k, n - } - switch { - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case lda < max(1, colA): - panic(badLdA) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (rowA-1)*lda+colA { - panic(shortA) - } - if len(c) < (n-1)*ldc+n { - panic(shortC) - } - - // Quick return if possible. - if (alpha == 0 || k == 0) && beta == 1 { - return - } - - if alpha == 0 { - if uplo == blas.Upper { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - ci[0] = complex(beta*real(ci[0]), 0) - if i != n-1 { - c64.SscalUnitary(beta, ci[1:]) - } - } - } - } else { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - if i != 0 { - c64.SscalUnitary(beta, ci[:i]) - } - ci[i] = complex(beta*real(ci[i]), 0) - } - } - } - return - } - - calpha := complex(alpha, 0) - if trans == blas.NoTrans { - // Form C = alpha*A*Aᴴ + beta*C. - cbeta := complex(beta, 0) - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - ai := a[i*lda : i*lda+k] - switch { - case beta == 0: - // Handle the i-th diagonal element of C. - ci[0] = complex(alpha*real(c64.DotcUnitary(ai, ai)), 0) - // Handle the remaining elements on the i-th row of C. - for jc := range ci[1:] { - j := i + 1 + jc - ci[jc+1] = calpha * c64.DotcUnitary(a[j*lda:j*lda+k], ai) - } - case beta != 1: - cii := calpha*c64.DotcUnitary(ai, ai) + cbeta*ci[0] - ci[0] = complex(real(cii), 0) - for jc, cij := range ci[1:] { - j := i + 1 + jc - ci[jc+1] = calpha*c64.DotcUnitary(a[j*lda:j*lda+k], ai) + cbeta*cij - } - default: - cii := calpha*c64.DotcUnitary(ai, ai) + ci[0] - ci[0] = complex(real(cii), 0) - for jc, cij := range ci[1:] { - j := i + 1 + jc - ci[jc+1] = calpha*c64.DotcUnitary(a[j*lda:j*lda+k], ai) + cij - } - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - ai := a[i*lda : i*lda+k] - switch { - case beta == 0: - // Handle the first i-1 elements on the i-th row of C. - for j := range ci[:i] { - ci[j] = calpha * c64.DotcUnitary(a[j*lda:j*lda+k], ai) - } - // Handle the i-th diagonal element of C. - ci[i] = complex(alpha*real(c64.DotcUnitary(ai, ai)), 0) - case beta != 1: - for j, cij := range ci[:i] { - ci[j] = calpha*c64.DotcUnitary(a[j*lda:j*lda+k], ai) + cbeta*cij - } - cii := calpha*c64.DotcUnitary(ai, ai) + cbeta*ci[i] - ci[i] = complex(real(cii), 0) - default: - for j, cij := range ci[:i] { - ci[j] = calpha*c64.DotcUnitary(a[j*lda:j*lda+k], ai) + cij - } - cii := calpha*c64.DotcUnitary(ai, ai) + ci[i] - ci[i] = complex(real(cii), 0) - } - } - } - } else { - // Form C = alpha*Aᴴ*A + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - switch { - case beta == 0: - for jc := range ci { - ci[jc] = 0 - } - case beta != 1: - c64.SscalUnitary(beta, ci) - ci[0] = complex(real(ci[0]), 0) - default: - ci[0] = complex(real(ci[0]), 0) - } - for j := 0; j < k; j++ { - aji := cmplx.Conj(a[j*lda+i]) - if aji != 0 { - c64.AxpyUnitary(calpha*aji, a[j*lda+i:j*lda+n], ci) - } - } - c[i*ldc+i] = complex(real(c[i*ldc+i]), 0) - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - switch { - case beta == 0: - for j := range ci { - ci[j] = 0 - } - case beta != 1: - c64.SscalUnitary(beta, ci) - ci[i] = complex(real(ci[i]), 0) - default: - ci[i] = complex(real(ci[i]), 0) - } - for j := 0; j < k; j++ { - aji := cmplx.Conj(a[j*lda+i]) - if aji != 0 { - c64.AxpyUnitary(calpha*aji, a[j*lda:j*lda+i+1], ci) - } - } - c[i*ldc+i] = complex(real(c[i*ldc+i]), 0) - } - } - } -} - -// Cher2k performs one of the hermitian rank-2k operations -// C = alpha*A*Bᴴ + conj(alpha)*B*Aᴴ + beta*C if trans == blas.NoTrans -// C = alpha*Aᴴ*B + conj(alpha)*Bᴴ*A + beta*C if trans == blas.ConjTrans -// where alpha and beta are scalars with beta real, C is an n×n hermitian matrix -// and A and B are n×k matrices in the first case and k×n matrices in the second case. -// -// The imaginary parts of the diagonal elements of C are assumed to be zero, and -// on return they will be set to zero. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Cher2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta float32, c []complex64, ldc int) { - var row, col int - switch trans { - default: - panic(badTranspose) - case blas.NoTrans: - row, col = n, k - case blas.ConjTrans: - row, col = k, n - } - switch { - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case lda < max(1, col): - panic(badLdA) - case ldb < max(1, col): - panic(badLdB) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (row-1)*lda+col { - panic(shortA) - } - if len(b) < (row-1)*ldb+col { - panic(shortB) - } - if len(c) < (n-1)*ldc+n { - panic(shortC) - } - - // Quick return if possible. - if (alpha == 0 || k == 0) && beta == 1 { - return - } - - if alpha == 0 { - if uplo == blas.Upper { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - ci[0] = complex(beta*real(ci[0]), 0) - if i != n-1 { - c64.SscalUnitary(beta, ci[1:]) - } - } - } - } else { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - if i != 0 { - c64.SscalUnitary(beta, ci[:i]) - } - ci[i] = complex(beta*real(ci[i]), 0) - } - } - } - return - } - - conjalpha := cmplx.Conj(alpha) - cbeta := complex(beta, 0) - if trans == blas.NoTrans { - // Form C = alpha*A*Bᴴ + conj(alpha)*B*Aᴴ + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i+1 : i*ldc+n] - ai := a[i*lda : i*lda+k] - bi := b[i*ldb : i*ldb+k] - if beta == 0 { - cii := alpha*c64.DotcUnitary(bi, ai) + conjalpha*c64.DotcUnitary(ai, bi) - c[i*ldc+i] = complex(real(cii), 0) - for jc := range ci { - j := i + 1 + jc - ci[jc] = alpha*c64.DotcUnitary(b[j*ldb:j*ldb+k], ai) + conjalpha*c64.DotcUnitary(a[j*lda:j*lda+k], bi) - } - } else { - cii := alpha*c64.DotcUnitary(bi, ai) + conjalpha*c64.DotcUnitary(ai, bi) + cbeta*c[i*ldc+i] - c[i*ldc+i] = complex(real(cii), 0) - for jc, cij := range ci { - j := i + 1 + jc - ci[jc] = alpha*c64.DotcUnitary(b[j*ldb:j*ldb+k], ai) + conjalpha*c64.DotcUnitary(a[j*lda:j*lda+k], bi) + cbeta*cij - } - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i] - ai := a[i*lda : i*lda+k] - bi := b[i*ldb : i*ldb+k] - if beta == 0 { - for j := range ci { - ci[j] = alpha*c64.DotcUnitary(b[j*ldb:j*ldb+k], ai) + conjalpha*c64.DotcUnitary(a[j*lda:j*lda+k], bi) - } - cii := alpha*c64.DotcUnitary(bi, ai) + conjalpha*c64.DotcUnitary(ai, bi) - c[i*ldc+i] = complex(real(cii), 0) - } else { - for j, cij := range ci { - ci[j] = alpha*c64.DotcUnitary(b[j*ldb:j*ldb+k], ai) + conjalpha*c64.DotcUnitary(a[j*lda:j*lda+k], bi) + cbeta*cij - } - cii := alpha*c64.DotcUnitary(bi, ai) + conjalpha*c64.DotcUnitary(ai, bi) + cbeta*c[i*ldc+i] - c[i*ldc+i] = complex(real(cii), 0) - } - } - } - } else { - // Form C = alpha*Aᴴ*B + conj(alpha)*Bᴴ*A + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - switch { - case beta == 0: - for jc := range ci { - ci[jc] = 0 - } - case beta != 1: - c64.SscalUnitary(beta, ci) - ci[0] = complex(real(ci[0]), 0) - default: - ci[0] = complex(real(ci[0]), 0) - } - for j := 0; j < k; j++ { - aji := a[j*lda+i] - bji := b[j*ldb+i] - if aji != 0 { - c64.AxpyUnitary(alpha*cmplx.Conj(aji), b[j*ldb+i:j*ldb+n], ci) - } - if bji != 0 { - c64.AxpyUnitary(conjalpha*cmplx.Conj(bji), a[j*lda+i:j*lda+n], ci) - } - } - ci[0] = complex(real(ci[0]), 0) - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - switch { - case beta == 0: - for j := range ci { - ci[j] = 0 - } - case beta != 1: - c64.SscalUnitary(beta, ci) - ci[i] = complex(real(ci[i]), 0) - default: - ci[i] = complex(real(ci[i]), 0) - } - for j := 0; j < k; j++ { - aji := a[j*lda+i] - bji := b[j*ldb+i] - if aji != 0 { - c64.AxpyUnitary(alpha*cmplx.Conj(aji), b[j*ldb:j*ldb+i+1], ci) - } - if bji != 0 { - c64.AxpyUnitary(conjalpha*cmplx.Conj(bji), a[j*lda:j*lda+i+1], ci) - } - } - ci[i] = complex(real(ci[i]), 0) - } - } - } -} - -// Csymm performs one of the matrix-matrix operations -// C = alpha*A*B + beta*C if side == blas.Left -// C = alpha*B*A + beta*C if side == blas.Right -// where alpha and beta are scalars, A is an m×m or n×n symmetric matrix and B -// and C are m×n matrices. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Csymm(side blas.Side, uplo blas.Uplo, m, n int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta complex64, c []complex64, ldc int) { - na := m - if side == blas.Right { - na = n - } - switch { - case side != blas.Left && side != blas.Right: - panic(badSide) - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, na): - panic(badLdA) - case ldb < max(1, n): - panic(badLdB) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(na-1)+na { - panic(shortA) - } - if len(b) < ldb*(m-1)+n { - panic(shortB) - } - if len(c) < ldc*(m-1)+n { - panic(shortC) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - if alpha == 0 { - if beta == 0 { - for i := 0; i < m; i++ { - ci := c[i*ldc : i*ldc+n] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < m; i++ { - ci := c[i*ldc : i*ldc+n] - c64.ScalUnitary(beta, ci) - } - } - return - } - - if side == blas.Left { - // Form C = alpha*A*B + beta*C. - for i := 0; i < m; i++ { - atmp := alpha * a[i*lda+i] - bi := b[i*ldb : i*ldb+n] - ci := c[i*ldc : i*ldc+n] - if beta == 0 { - for j, bij := range bi { - ci[j] = atmp * bij - } - } else { - for j, bij := range bi { - ci[j] = atmp*bij + beta*ci[j] - } - } - if uplo == blas.Upper { - for k := 0; k < i; k++ { - atmp = alpha * a[k*lda+i] - c64.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - for k := i + 1; k < m; k++ { - atmp = alpha * a[i*lda+k] - c64.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - } else { - for k := 0; k < i; k++ { - atmp = alpha * a[i*lda+k] - c64.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - for k := i + 1; k < m; k++ { - atmp = alpha * a[k*lda+i] - c64.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - } - } - } else { - // Form C = alpha*B*A + beta*C. - if uplo == blas.Upper { - for i := 0; i < m; i++ { - for j := n - 1; j >= 0; j-- { - abij := alpha * b[i*ldb+j] - aj := a[j*lda+j+1 : j*lda+n] - bi := b[i*ldb+j+1 : i*ldb+n] - ci := c[i*ldc+j+1 : i*ldc+n] - var tmp complex64 - for k, ajk := range aj { - ci[k] += abij * ajk - tmp += bi[k] * ajk - } - if beta == 0 { - c[i*ldc+j] = abij*a[j*lda+j] + alpha*tmp - } else { - c[i*ldc+j] = abij*a[j*lda+j] + alpha*tmp + beta*c[i*ldc+j] - } - } - } - } else { - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - abij := alpha * b[i*ldb+j] - aj := a[j*lda : j*lda+j] - bi := b[i*ldb : i*ldb+j] - ci := c[i*ldc : i*ldc+j] - var tmp complex64 - for k, ajk := range aj { - ci[k] += abij * ajk - tmp += bi[k] * ajk - } - if beta == 0 { - c[i*ldc+j] = abij*a[j*lda+j] + alpha*tmp - } else { - c[i*ldc+j] = abij*a[j*lda+j] + alpha*tmp + beta*c[i*ldc+j] - } - } - } - } - } -} - -// Csyrk performs one of the symmetric rank-k operations -// C = alpha*A*Aᵀ + beta*C if trans == blas.NoTrans -// C = alpha*Aᵀ*A + beta*C if trans == blas.Trans -// where alpha and beta are scalars, C is an n×n symmetric matrix and A is -// an n×k matrix in the first case and a k×n matrix in the second case. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Csyrk(uplo blas.Uplo, trans blas.Transpose, n, k int, alpha complex64, a []complex64, lda int, beta complex64, c []complex64, ldc int) { - var rowA, colA int - switch trans { - default: - panic(badTranspose) - case blas.NoTrans: - rowA, colA = n, k - case blas.Trans: - rowA, colA = k, n - } - switch { - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case lda < max(1, colA): - panic(badLdA) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (rowA-1)*lda+colA { - panic(shortA) - } - if len(c) < (n-1)*ldc+n { - panic(shortC) - } - - // Quick return if possible. - if (alpha == 0 || k == 0) && beta == 1 { - return - } - - if alpha == 0 { - if uplo == blas.Upper { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - c64.ScalUnitary(beta, ci) - } - } - } else { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - c64.ScalUnitary(beta, ci) - } - } - } - return - } - - if trans == blas.NoTrans { - // Form C = alpha*A*Aᵀ + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - ai := a[i*lda : i*lda+k] - for jc, cij := range ci { - j := i + jc - ci[jc] = beta*cij + alpha*c64.DotuUnitary(ai, a[j*lda:j*lda+k]) - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - ai := a[i*lda : i*lda+k] - for j, cij := range ci { - ci[j] = beta*cij + alpha*c64.DotuUnitary(ai, a[j*lda:j*lda+k]) - } - } - } - } else { - // Form C = alpha*Aᵀ*A + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - switch { - case beta == 0: - for jc := range ci { - ci[jc] = 0 - } - case beta != 1: - for jc := range ci { - ci[jc] *= beta - } - } - for j := 0; j < k; j++ { - aji := a[j*lda+i] - if aji != 0 { - c64.AxpyUnitary(alpha*aji, a[j*lda+i:j*lda+n], ci) - } - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - switch { - case beta == 0: - for j := range ci { - ci[j] = 0 - } - case beta != 1: - for j := range ci { - ci[j] *= beta - } - } - for j := 0; j < k; j++ { - aji := a[j*lda+i] - if aji != 0 { - c64.AxpyUnitary(alpha*aji, a[j*lda:j*lda+i+1], ci) - } - } - } - } - } -} - -// Csyr2k performs one of the symmetric rank-2k operations -// C = alpha*A*Bᵀ + alpha*B*Aᵀ + beta*C if trans == blas.NoTrans -// C = alpha*Aᵀ*B + alpha*Bᵀ*A + beta*C if trans == blas.Trans -// where alpha and beta are scalars, C is an n×n symmetric matrix and A and B -// are n×k matrices in the first case and k×n matrices in the second case. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Csyr2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta complex64, c []complex64, ldc int) { - var row, col int - switch trans { - default: - panic(badTranspose) - case blas.NoTrans: - row, col = n, k - case blas.Trans: - row, col = k, n - } - switch { - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case lda < max(1, col): - panic(badLdA) - case ldb < max(1, col): - panic(badLdB) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (row-1)*lda+col { - panic(shortA) - } - if len(b) < (row-1)*ldb+col { - panic(shortB) - } - if len(c) < (n-1)*ldc+n { - panic(shortC) - } - - // Quick return if possible. - if (alpha == 0 || k == 0) && beta == 1 { - return - } - - if alpha == 0 { - if uplo == blas.Upper { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - c64.ScalUnitary(beta, ci) - } - } - } else { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - c64.ScalUnitary(beta, ci) - } - } - } - return - } - - if trans == blas.NoTrans { - // Form C = alpha*A*Bᵀ + alpha*B*Aᵀ + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - ai := a[i*lda : i*lda+k] - bi := b[i*ldb : i*ldb+k] - if beta == 0 { - for jc := range ci { - j := i + jc - ci[jc] = alpha*c64.DotuUnitary(ai, b[j*ldb:j*ldb+k]) + alpha*c64.DotuUnitary(bi, a[j*lda:j*lda+k]) - } - } else { - for jc, cij := range ci { - j := i + jc - ci[jc] = alpha*c64.DotuUnitary(ai, b[j*ldb:j*ldb+k]) + alpha*c64.DotuUnitary(bi, a[j*lda:j*lda+k]) + beta*cij - } - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - ai := a[i*lda : i*lda+k] - bi := b[i*ldb : i*ldb+k] - if beta == 0 { - for j := range ci { - ci[j] = alpha*c64.DotuUnitary(ai, b[j*ldb:j*ldb+k]) + alpha*c64.DotuUnitary(bi, a[j*lda:j*lda+k]) - } - } else { - for j, cij := range ci { - ci[j] = alpha*c64.DotuUnitary(ai, b[j*ldb:j*ldb+k]) + alpha*c64.DotuUnitary(bi, a[j*lda:j*lda+k]) + beta*cij - } - } - } - } - } else { - // Form C = alpha*Aᵀ*B + alpha*Bᵀ*A + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - switch { - case beta == 0: - for jc := range ci { - ci[jc] = 0 - } - case beta != 1: - for jc := range ci { - ci[jc] *= beta - } - } - for j := 0; j < k; j++ { - aji := a[j*lda+i] - bji := b[j*ldb+i] - if aji != 0 { - c64.AxpyUnitary(alpha*aji, b[j*ldb+i:j*ldb+n], ci) - } - if bji != 0 { - c64.AxpyUnitary(alpha*bji, a[j*lda+i:j*lda+n], ci) - } - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - switch { - case beta == 0: - for j := range ci { - ci[j] = 0 - } - case beta != 1: - for j := range ci { - ci[j] *= beta - } - } - for j := 0; j < k; j++ { - aji := a[j*lda+i] - bji := b[j*ldb+i] - if aji != 0 { - c64.AxpyUnitary(alpha*aji, b[j*ldb:j*ldb+i+1], ci) - } - if bji != 0 { - c64.AxpyUnitary(alpha*bji, a[j*lda:j*lda+i+1], ci) - } - } - } - } - } -} - -// Ctrmm performs one of the matrix-matrix operations -// B = alpha * op(A) * B if side == blas.Left, -// B = alpha * B * op(A) if side == blas.Right, -// where alpha is a scalar, B is an m×n matrix, A is a unit, or non-unit, -// upper or lower triangular matrix and op(A) is one of -// op(A) = A if trans == blas.NoTrans, -// op(A) = Aᵀ if trans == blas.Trans, -// op(A) = Aᴴ if trans == blas.ConjTrans. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Ctrmm(side blas.Side, uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, m, n int, alpha complex64, a []complex64, lda int, b []complex64, ldb int) { - na := m - if side == blas.Right { - na = n - } - switch { - case side != blas.Left && side != blas.Right: - panic(badSide) - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case trans != blas.NoTrans && trans != blas.Trans && trans != blas.ConjTrans: - panic(badTranspose) - case diag != blas.Unit && diag != blas.NonUnit: - panic(badDiag) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, na): - panic(badLdA) - case ldb < max(1, n): - panic(badLdB) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (na-1)*lda+na { - panic(shortA) - } - if len(b) < (m-1)*ldb+n { - panic(shortB) - } - - // Quick return if possible. - if alpha == 0 { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for j := range bi { - bi[j] = 0 - } - } - return - } - - noConj := trans != blas.ConjTrans - noUnit := diag == blas.NonUnit - if side == blas.Left { - if trans == blas.NoTrans { - // Form B = alpha*A*B. - if uplo == blas.Upper { - for i := 0; i < m; i++ { - aii := alpha - if noUnit { - aii *= a[i*lda+i] - } - bi := b[i*ldb : i*ldb+n] - for j := range bi { - bi[j] *= aii - } - for ja, aij := range a[i*lda+i+1 : i*lda+m] { - j := ja + i + 1 - if aij != 0 { - c64.AxpyUnitary(alpha*aij, b[j*ldb:j*ldb+n], bi) - } - } - } - } else { - for i := m - 1; i >= 0; i-- { - aii := alpha - if noUnit { - aii *= a[i*lda+i] - } - bi := b[i*ldb : i*ldb+n] - for j := range bi { - bi[j] *= aii - } - for j, aij := range a[i*lda : i*lda+i] { - if aij != 0 { - c64.AxpyUnitary(alpha*aij, b[j*ldb:j*ldb+n], bi) - } - } - } - } - } else { - // Form B = alpha*Aᵀ*B or B = alpha*Aᴴ*B. - if uplo == blas.Upper { - for k := m - 1; k >= 0; k-- { - bk := b[k*ldb : k*ldb+n] - for ja, ajk := range a[k*lda+k+1 : k*lda+m] { - if ajk == 0 { - continue - } - j := k + 1 + ja - if noConj { - c64.AxpyUnitary(alpha*ajk, bk, b[j*ldb:j*ldb+n]) - } else { - c64.AxpyUnitary(alpha*cmplx.Conj(ajk), bk, b[j*ldb:j*ldb+n]) - } - } - akk := alpha - if noUnit { - if noConj { - akk *= a[k*lda+k] - } else { - akk *= cmplx.Conj(a[k*lda+k]) - } - } - if akk != 1 { - c64.ScalUnitary(akk, bk) - } - } - } else { - for k := 0; k < m; k++ { - bk := b[k*ldb : k*ldb+n] - for j, ajk := range a[k*lda : k*lda+k] { - if ajk == 0 { - continue - } - if noConj { - c64.AxpyUnitary(alpha*ajk, bk, b[j*ldb:j*ldb+n]) - } else { - c64.AxpyUnitary(alpha*cmplx.Conj(ajk), bk, b[j*ldb:j*ldb+n]) - } - } - akk := alpha - if noUnit { - if noConj { - akk *= a[k*lda+k] - } else { - akk *= cmplx.Conj(a[k*lda+k]) - } - } - if akk != 1 { - c64.ScalUnitary(akk, bk) - } - } - } - } - } else { - if trans == blas.NoTrans { - // Form B = alpha*B*A. - if uplo == blas.Upper { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for k := n - 1; k >= 0; k-- { - abik := alpha * bi[k] - if abik == 0 { - continue - } - bi[k] = abik - if noUnit { - bi[k] *= a[k*lda+k] - } - c64.AxpyUnitary(abik, a[k*lda+k+1:k*lda+n], bi[k+1:]) - } - } - } else { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for k := 0; k < n; k++ { - abik := alpha * bi[k] - if abik == 0 { - continue - } - bi[k] = abik - if noUnit { - bi[k] *= a[k*lda+k] - } - c64.AxpyUnitary(abik, a[k*lda:k*lda+k], bi[:k]) - } - } - } - } else { - // Form B = alpha*B*Aᵀ or B = alpha*B*Aᴴ. - if uplo == blas.Upper { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for j, bij := range bi { - if noConj { - if noUnit { - bij *= a[j*lda+j] - } - bij += c64.DotuUnitary(a[j*lda+j+1:j*lda+n], bi[j+1:n]) - } else { - if noUnit { - bij *= cmplx.Conj(a[j*lda+j]) - } - bij += c64.DotcUnitary(a[j*lda+j+1:j*lda+n], bi[j+1:n]) - } - bi[j] = alpha * bij - } - } - } else { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for j := n - 1; j >= 0; j-- { - bij := bi[j] - if noConj { - if noUnit { - bij *= a[j*lda+j] - } - bij += c64.DotuUnitary(a[j*lda:j*lda+j], bi[:j]) - } else { - if noUnit { - bij *= cmplx.Conj(a[j*lda+j]) - } - bij += c64.DotcUnitary(a[j*lda:j*lda+j], bi[:j]) - } - bi[j] = alpha * bij - } - } - } - } - } -} - -// Ctrsm solves one of the matrix equations -// op(A) * X = alpha * B if side == blas.Left, -// X * op(A) = alpha * B if side == blas.Right, -// where alpha is a scalar, X and B are m×n matrices, A is a unit or -// non-unit, upper or lower triangular matrix and op(A) is one of -// op(A) = A if transA == blas.NoTrans, -// op(A) = Aᵀ if transA == blas.Trans, -// op(A) = Aᴴ if transA == blas.ConjTrans. -// On return the matrix X is overwritten on B. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Ctrsm(side blas.Side, uplo blas.Uplo, transA blas.Transpose, diag blas.Diag, m, n int, alpha complex64, a []complex64, lda int, b []complex64, ldb int) { - na := m - if side == blas.Right { - na = n - } - switch { - case side != blas.Left && side != blas.Right: - panic(badSide) - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case transA != blas.NoTrans && transA != blas.Trans && transA != blas.ConjTrans: - panic(badTranspose) - case diag != blas.Unit && diag != blas.NonUnit: - panic(badDiag) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, na): - panic(badLdA) - case ldb < max(1, n): - panic(badLdB) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (na-1)*lda+na { - panic(shortA) - } - if len(b) < (m-1)*ldb+n { - panic(shortB) - } - - if alpha == 0 { - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - b[i*ldb+j] = 0 - } - } - return - } - - noConj := transA != blas.ConjTrans - noUnit := diag == blas.NonUnit - if side == blas.Left { - if transA == blas.NoTrans { - // Form B = alpha*inv(A)*B. - if uplo == blas.Upper { - for i := m - 1; i >= 0; i-- { - bi := b[i*ldb : i*ldb+n] - if alpha != 1 { - c64.ScalUnitary(alpha, bi) - } - for ka, aik := range a[i*lda+i+1 : i*lda+m] { - k := i + 1 + ka - if aik != 0 { - c64.AxpyUnitary(-aik, b[k*ldb:k*ldb+n], bi) - } - } - if noUnit { - c64.ScalUnitary(1/a[i*lda+i], bi) - } - } - } else { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - if alpha != 1 { - c64.ScalUnitary(alpha, bi) - } - for j, aij := range a[i*lda : i*lda+i] { - if aij != 0 { - c64.AxpyUnitary(-aij, b[j*ldb:j*ldb+n], bi) - } - } - if noUnit { - c64.ScalUnitary(1/a[i*lda+i], bi) - } - } - } - } else { - // Form B = alpha*inv(Aᵀ)*B or B = alpha*inv(Aᴴ)*B. - if uplo == blas.Upper { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - if noUnit { - if noConj { - c64.ScalUnitary(1/a[i*lda+i], bi) - } else { - c64.ScalUnitary(1/cmplx.Conj(a[i*lda+i]), bi) - } - } - for ja, aij := range a[i*lda+i+1 : i*lda+m] { - if aij == 0 { - continue - } - j := i + 1 + ja - if noConj { - c64.AxpyUnitary(-aij, bi, b[j*ldb:j*ldb+n]) - } else { - c64.AxpyUnitary(-cmplx.Conj(aij), bi, b[j*ldb:j*ldb+n]) - } - } - if alpha != 1 { - c64.ScalUnitary(alpha, bi) - } - } - } else { - for i := m - 1; i >= 0; i-- { - bi := b[i*ldb : i*ldb+n] - if noUnit { - if noConj { - c64.ScalUnitary(1/a[i*lda+i], bi) - } else { - c64.ScalUnitary(1/cmplx.Conj(a[i*lda+i]), bi) - } - } - for j, aij := range a[i*lda : i*lda+i] { - if aij == 0 { - continue - } - if noConj { - c64.AxpyUnitary(-aij, bi, b[j*ldb:j*ldb+n]) - } else { - c64.AxpyUnitary(-cmplx.Conj(aij), bi, b[j*ldb:j*ldb+n]) - } - } - if alpha != 1 { - c64.ScalUnitary(alpha, bi) - } - } - } - } - } else { - if transA == blas.NoTrans { - // Form B = alpha*B*inv(A). - if uplo == blas.Upper { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - if alpha != 1 { - c64.ScalUnitary(alpha, bi) - } - for j, bij := range bi { - if bij == 0 { - continue - } - if noUnit { - bi[j] /= a[j*lda+j] - } - c64.AxpyUnitary(-bi[j], a[j*lda+j+1:j*lda+n], bi[j+1:n]) - } - } - } else { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - if alpha != 1 { - c64.ScalUnitary(alpha, bi) - } - for j := n - 1; j >= 0; j-- { - if bi[j] == 0 { - continue - } - if noUnit { - bi[j] /= a[j*lda+j] - } - c64.AxpyUnitary(-bi[j], a[j*lda:j*lda+j], bi[:j]) - } - } - } - } else { - // Form B = alpha*B*inv(Aᵀ) or B = alpha*B*inv(Aᴴ). - if uplo == blas.Upper { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for j := n - 1; j >= 0; j-- { - bij := alpha * bi[j] - if noConj { - bij -= c64.DotuUnitary(a[j*lda+j+1:j*lda+n], bi[j+1:n]) - if noUnit { - bij /= a[j*lda+j] - } - } else { - bij -= c64.DotcUnitary(a[j*lda+j+1:j*lda+n], bi[j+1:n]) - if noUnit { - bij /= cmplx.Conj(a[j*lda+j]) - } - } - bi[j] = bij - } - } - } else { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for j, bij := range bi { - bij *= alpha - if noConj { - bij -= c64.DotuUnitary(a[j*lda:j*lda+j], bi[:j]) - if noUnit { - bij /= a[j*lda+j] - } - } else { - bij -= c64.DotcUnitary(a[j*lda:j*lda+j], bi[:j]) - if noUnit { - bij /= cmplx.Conj(a[j*lda+j]) - } - } - bi[j] = bij - } - } - } - } - } -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level3float32.go b/vendor/gonum.org/v1/gonum/blas/gonum/level3float32.go deleted file mode 100644 index a565b9e..0000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level3float32.go +++ /dev/null @@ -1,876 +0,0 @@ -// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT. - -// Copyright ©2014 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/f32" -) - -var _ blas.Float32Level3 = Implementation{} - -// Strsm solves one of the matrix equations -// A * X = alpha * B if tA == blas.NoTrans and side == blas.Left -// Aᵀ * X = alpha * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Left -// X * A = alpha * B if tA == blas.NoTrans and side == blas.Right -// X * Aᵀ = alpha * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Right -// where A is an n×n or m×m triangular matrix, X and B are m×n matrices, and alpha is a -// scalar. -// -// At entry to the function, X contains the values of B, and the result is -// stored in-place into X. -// -// No check is made that A is invertible. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Strsm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas.Diag, m, n int, alpha float32, a []float32, lda int, b []float32, ldb int) { - if s != blas.Left && s != blas.Right { - panic(badSide) - } - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - k := n - if s == blas.Left { - k = m - } - if lda < max(1, k) { - panic(badLdA) - } - if ldb < max(1, n) { - panic(badLdB) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(k-1)+k { - panic(shortA) - } - if len(b) < ldb*(m-1)+n { - panic(shortB) - } - - if alpha == 0 { - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for j := range btmp { - btmp[j] = 0 - } - } - return - } - nonUnit := d == blas.NonUnit - if s == blas.Left { - if tA == blas.NoTrans { - if ul == blas.Upper { - for i := m - 1; i >= 0; i-- { - btmp := b[i*ldb : i*ldb+n] - if alpha != 1 { - f32.ScalUnitary(alpha, btmp) - } - for ka, va := range a[i*lda+i+1 : i*lda+m] { - if va != 0 { - k := ka + i + 1 - f32.AxpyUnitary(-va, b[k*ldb:k*ldb+n], btmp) - } - } - if nonUnit { - tmp := 1 / a[i*lda+i] - f32.ScalUnitary(tmp, btmp) - } - } - return - } - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - if alpha != 1 { - f32.ScalUnitary(alpha, btmp) - } - for k, va := range a[i*lda : i*lda+i] { - if va != 0 { - f32.AxpyUnitary(-va, b[k*ldb:k*ldb+n], btmp) - } - } - if nonUnit { - tmp := 1 / a[i*lda+i] - f32.ScalUnitary(tmp, btmp) - } - } - return - } - // Cases where a is transposed - if ul == blas.Upper { - for k := 0; k < m; k++ { - btmpk := b[k*ldb : k*ldb+n] - if nonUnit { - tmp := 1 / a[k*lda+k] - f32.ScalUnitary(tmp, btmpk) - } - for ia, va := range a[k*lda+k+1 : k*lda+m] { - if va != 0 { - i := ia + k + 1 - f32.AxpyUnitary(-va, btmpk, b[i*ldb:i*ldb+n]) - } - } - if alpha != 1 { - f32.ScalUnitary(alpha, btmpk) - } - } - return - } - for k := m - 1; k >= 0; k-- { - btmpk := b[k*ldb : k*ldb+n] - if nonUnit { - tmp := 1 / a[k*lda+k] - f32.ScalUnitary(tmp, btmpk) - } - for i, va := range a[k*lda : k*lda+k] { - if va != 0 { - f32.AxpyUnitary(-va, btmpk, b[i*ldb:i*ldb+n]) - } - } - if alpha != 1 { - f32.ScalUnitary(alpha, btmpk) - } - } - return - } - // Cases where a is to the right of X. - if tA == blas.NoTrans { - if ul == blas.Upper { - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - if alpha != 1 { - f32.ScalUnitary(alpha, btmp) - } - for k, vb := range btmp { - if vb == 0 { - continue - } - if nonUnit { - btmp[k] /= a[k*lda+k] - } - f32.AxpyUnitary(-btmp[k], a[k*lda+k+1:k*lda+n], btmp[k+1:n]) - } - } - return - } - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - if alpha != 1 { - f32.ScalUnitary(alpha, btmp) - } - for k := n - 1; k >= 0; k-- { - if btmp[k] == 0 { - continue - } - if nonUnit { - btmp[k] /= a[k*lda+k] - } - f32.AxpyUnitary(-btmp[k], a[k*lda:k*lda+k], btmp[:k]) - } - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for j := n - 1; j >= 0; j-- { - tmp := alpha*btmp[j] - f32.DotUnitary(a[j*lda+j+1:j*lda+n], btmp[j+1:]) - if nonUnit { - tmp /= a[j*lda+j] - } - btmp[j] = tmp - } - } - return - } - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for j := 0; j < n; j++ { - tmp := alpha*btmp[j] - f32.DotUnitary(a[j*lda:j*lda+j], btmp[:j]) - if nonUnit { - tmp /= a[j*lda+j] - } - btmp[j] = tmp - } - } -} - -// Ssymm performs one of the matrix-matrix operations -// C = alpha * A * B + beta * C if side == blas.Left -// C = alpha * B * A + beta * C if side == blas.Right -// where A is an n×n or m×m symmetric matrix, B and C are m×n matrices, and alpha -// is a scalar. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Ssymm(s blas.Side, ul blas.Uplo, m, n int, alpha float32, a []float32, lda int, b []float32, ldb int, beta float32, c []float32, ldc int) { - if s != blas.Right && s != blas.Left { - panic(badSide) - } - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - k := n - if s == blas.Left { - k = m - } - if lda < max(1, k) { - panic(badLdA) - } - if ldb < max(1, n) { - panic(badLdB) - } - if ldc < max(1, n) { - panic(badLdC) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(k-1)+k { - panic(shortA) - } - if len(b) < ldb*(m-1)+n { - panic(shortB) - } - if len(c) < ldc*(m-1)+n { - panic(shortC) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - if alpha == 0 { - if beta == 0 { - for i := 0; i < m; i++ { - ctmp := c[i*ldc : i*ldc+n] - for j := range ctmp { - ctmp[j] = 0 - } - } - return - } - for i := 0; i < m; i++ { - ctmp := c[i*ldc : i*ldc+n] - for j := 0; j < n; j++ { - ctmp[j] *= beta - } - } - return - } - - isUpper := ul == blas.Upper - if s == blas.Left { - for i := 0; i < m; i++ { - atmp := alpha * a[i*lda+i] - btmp := b[i*ldb : i*ldb+n] - ctmp := c[i*ldc : i*ldc+n] - for j, v := range btmp { - ctmp[j] *= beta - ctmp[j] += atmp * v - } - - for k := 0; k < i; k++ { - var atmp float32 - if isUpper { - atmp = a[k*lda+i] - } else { - atmp = a[i*lda+k] - } - atmp *= alpha - f32.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ctmp) - } - for k := i + 1; k < m; k++ { - var atmp float32 - if isUpper { - atmp = a[i*lda+k] - } else { - atmp = a[k*lda+i] - } - atmp *= alpha - f32.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ctmp) - } - } - return - } - if isUpper { - for i := 0; i < m; i++ { - for j := n - 1; j >= 0; j-- { - tmp := alpha * b[i*ldb+j] - var tmp2 float32 - atmp := a[j*lda+j+1 : j*lda+n] - btmp := b[i*ldb+j+1 : i*ldb+n] - ctmp := c[i*ldc+j+1 : i*ldc+n] - for k, v := range atmp { - ctmp[k] += tmp * v - tmp2 += btmp[k] * v - } - c[i*ldc+j] *= beta - c[i*ldc+j] += tmp*a[j*lda+j] + alpha*tmp2 - } - } - return - } - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - tmp := alpha * b[i*ldb+j] - var tmp2 float32 - atmp := a[j*lda : j*lda+j] - btmp := b[i*ldb : i*ldb+j] - ctmp := c[i*ldc : i*ldc+j] - for k, v := range atmp { - ctmp[k] += tmp * v - tmp2 += btmp[k] * v - } - c[i*ldc+j] *= beta - c[i*ldc+j] += tmp*a[j*lda+j] + alpha*tmp2 - } - } -} - -// Ssyrk performs one of the symmetric rank-k operations -// C = alpha * A * Aᵀ + beta * C if tA == blas.NoTrans -// C = alpha * Aᵀ * A + beta * C if tA == blas.Trans or tA == blas.ConjTrans -// where A is an n×k or k×n matrix, C is an n×n symmetric matrix, and alpha and -// beta are scalars. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Ssyrk(ul blas.Uplo, tA blas.Transpose, n, k int, alpha float32, a []float32, lda int, beta float32, c []float32, ldc int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.Trans && tA != blas.NoTrans && tA != blas.ConjTrans { - panic(badTranspose) - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - row, col := k, n - if tA == blas.NoTrans { - row, col = n, k - } - if lda < max(1, col) { - panic(badLdA) - } - if ldc < max(1, n) { - panic(badLdC) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(row-1)+col { - panic(shortA) - } - if len(c) < ldc*(n-1)+n { - panic(shortC) - } - - if alpha == 0 { - if beta == 0 { - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - for j := range ctmp { - ctmp[j] = 0 - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - for j := range ctmp { - ctmp[j] = 0 - } - } - return - } - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - for j := range ctmp { - ctmp[j] *= beta - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - for j := range ctmp { - ctmp[j] *= beta - } - } - return - } - if tA == blas.NoTrans { - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - atmp := a[i*lda : i*lda+k] - if beta == 0 { - for jc := range ctmp { - j := jc + i - ctmp[jc] = alpha * f32.DotUnitary(atmp, a[j*lda:j*lda+k]) - } - } else { - for jc, vc := range ctmp { - j := jc + i - ctmp[jc] = vc*beta + alpha*f32.DotUnitary(atmp, a[j*lda:j*lda+k]) - } - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - atmp := a[i*lda : i*lda+k] - if beta == 0 { - for j := range ctmp { - ctmp[j] = alpha * f32.DotUnitary(a[j*lda:j*lda+k], atmp) - } - } else { - for j, vc := range ctmp { - ctmp[j] = vc*beta + alpha*f32.DotUnitary(a[j*lda:j*lda+k], atmp) - } - } - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - if beta == 0 { - for j := range ctmp { - ctmp[j] = 0 - } - } else if beta != 1 { - for j := range ctmp { - ctmp[j] *= beta - } - } - for l := 0; l < k; l++ { - tmp := alpha * a[l*lda+i] - if tmp != 0 { - f32.AxpyUnitary(tmp, a[l*lda+i:l*lda+n], ctmp) - } - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - if beta != 1 { - for j := range ctmp { - ctmp[j] *= beta - } - } - for l := 0; l < k; l++ { - tmp := alpha * a[l*lda+i] - if tmp != 0 { - f32.AxpyUnitary(tmp, a[l*lda:l*lda+i+1], ctmp) - } - } - } -} - -// Ssyr2k performs one of the symmetric rank 2k operations -// C = alpha * A * Bᵀ + alpha * B * Aᵀ + beta * C if tA == blas.NoTrans -// C = alpha * Aᵀ * B + alpha * Bᵀ * A + beta * C if tA == blas.Trans or tA == blas.ConjTrans -// where A and B are n×k or k×n matrices, C is an n×n symmetric matrix, and -// alpha and beta are scalars. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Ssyr2k(ul blas.Uplo, tA blas.Transpose, n, k int, alpha float32, a []float32, lda int, b []float32, ldb int, beta float32, c []float32, ldc int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.Trans && tA != blas.NoTrans && tA != blas.ConjTrans { - panic(badTranspose) - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - row, col := k, n - if tA == blas.NoTrans { - row, col = n, k - } - if lda < max(1, col) { - panic(badLdA) - } - if ldb < max(1, col) { - panic(badLdB) - } - if ldc < max(1, n) { - panic(badLdC) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(row-1)+col { - panic(shortA) - } - if len(b) < ldb*(row-1)+col { - panic(shortB) - } - if len(c) < ldc*(n-1)+n { - panic(shortC) - } - - if alpha == 0 { - if beta == 0 { - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - for j := range ctmp { - ctmp[j] = 0 - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - for j := range ctmp { - ctmp[j] = 0 - } - } - return - } - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - for j := range ctmp { - ctmp[j] *= beta - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - for j := range ctmp { - ctmp[j] *= beta - } - } - return - } - if tA == blas.NoTrans { - if ul == blas.Upper { - for i := 0; i < n; i++ { - atmp := a[i*lda : i*lda+k] - btmp := b[i*ldb : i*ldb+k] - ctmp := c[i*ldc+i : i*ldc+n] - for jc := range ctmp { - j := i + jc - var tmp1, tmp2 float32 - binner := b[j*ldb : j*ldb+k] - for l, v := range a[j*lda : j*lda+k] { - tmp1 += v * btmp[l] - tmp2 += atmp[l] * binner[l] - } - ctmp[jc] *= beta - ctmp[jc] += alpha * (tmp1 + tmp2) - } - } - return - } - for i := 0; i < n; i++ { - atmp := a[i*lda : i*lda+k] - btmp := b[i*ldb : i*ldb+k] - ctmp := c[i*ldc : i*ldc+i+1] - for j := 0; j <= i; j++ { - var tmp1, tmp2 float32 - binner := b[j*ldb : j*ldb+k] - for l, v := range a[j*lda : j*lda+k] { - tmp1 += v * btmp[l] - tmp2 += atmp[l] * binner[l] - } - ctmp[j] *= beta - ctmp[j] += alpha * (tmp1 + tmp2) - } - } - return - } - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - if beta != 1 { - for j := range ctmp { - ctmp[j] *= beta - } - } - for l := 0; l < k; l++ { - tmp1 := alpha * b[l*ldb+i] - tmp2 := alpha * a[l*lda+i] - btmp := b[l*ldb+i : l*ldb+n] - if tmp1 != 0 || tmp2 != 0 { - for j, v := range a[l*lda+i : l*lda+n] { - ctmp[j] += v*tmp1 + btmp[j]*tmp2 - } - } - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - if beta != 1 { - for j := range ctmp { - ctmp[j] *= beta - } - } - for l := 0; l < k; l++ { - tmp1 := alpha * b[l*ldb+i] - tmp2 := alpha * a[l*lda+i] - btmp := b[l*ldb : l*ldb+i+1] - if tmp1 != 0 || tmp2 != 0 { - for j, v := range a[l*lda : l*lda+i+1] { - ctmp[j] += v*tmp1 + btmp[j]*tmp2 - } - } - } - } -} - -// Strmm performs one of the matrix-matrix operations -// B = alpha * A * B if tA == blas.NoTrans and side == blas.Left -// B = alpha * Aᵀ * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Left -// B = alpha * B * A if tA == blas.NoTrans and side == blas.Right -// B = alpha * B * Aᵀ if tA == blas.Trans or blas.ConjTrans, and side == blas.Right -// where A is an n×n or m×m triangular matrix, B is an m×n matrix, and alpha is a scalar. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Strmm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas.Diag, m, n int, alpha float32, a []float32, lda int, b []float32, ldb int) { - if s != blas.Left && s != blas.Right { - panic(badSide) - } - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - k := n - if s == blas.Left { - k = m - } - if lda < max(1, k) { - panic(badLdA) - } - if ldb < max(1, n) { - panic(badLdB) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(k-1)+k { - panic(shortA) - } - if len(b) < ldb*(m-1)+n { - panic(shortB) - } - - if alpha == 0 { - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for j := range btmp { - btmp[j] = 0 - } - } - return - } - - nonUnit := d == blas.NonUnit - if s == blas.Left { - if tA == blas.NoTrans { - if ul == blas.Upper { - for i := 0; i < m; i++ { - tmp := alpha - if nonUnit { - tmp *= a[i*lda+i] - } - btmp := b[i*ldb : i*ldb+n] - f32.ScalUnitary(tmp, btmp) - for ka, va := range a[i*lda+i+1 : i*lda+m] { - k := ka + i + 1 - if va != 0 { - f32.AxpyUnitary(alpha*va, b[k*ldb:k*ldb+n], btmp) - } - } - } - return - } - for i := m - 1; i >= 0; i-- { - tmp := alpha - if nonUnit { - tmp *= a[i*lda+i] - } - btmp := b[i*ldb : i*ldb+n] - f32.ScalUnitary(tmp, btmp) - for k, va := range a[i*lda : i*lda+i] { - if va != 0 { - f32.AxpyUnitary(alpha*va, b[k*ldb:k*ldb+n], btmp) - } - } - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - for k := m - 1; k >= 0; k-- { - btmpk := b[k*ldb : k*ldb+n] - for ia, va := range a[k*lda+k+1 : k*lda+m] { - i := ia + k + 1 - btmp := b[i*ldb : i*ldb+n] - if va != 0 { - f32.AxpyUnitary(alpha*va, btmpk, btmp) - } - } - tmp := alpha - if nonUnit { - tmp *= a[k*lda+k] - } - if tmp != 1 { - f32.ScalUnitary(tmp, btmpk) - } - } - return - } - for k := 0; k < m; k++ { - btmpk := b[k*ldb : k*ldb+n] - for i, va := range a[k*lda : k*lda+k] { - btmp := b[i*ldb : i*ldb+n] - if va != 0 { - f32.AxpyUnitary(alpha*va, btmpk, btmp) - } - } - tmp := alpha - if nonUnit { - tmp *= a[k*lda+k] - } - if tmp != 1 { - f32.ScalUnitary(tmp, btmpk) - } - } - return - } - // Cases where a is on the right - if tA == blas.NoTrans { - if ul == blas.Upper { - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for k := n - 1; k >= 0; k-- { - tmp := alpha * btmp[k] - if tmp == 0 { - continue - } - btmp[k] = tmp - if nonUnit { - btmp[k] *= a[k*lda+k] - } - f32.AxpyUnitary(tmp, a[k*lda+k+1:k*lda+n], btmp[k+1:n]) - } - } - return - } - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for k := 0; k < n; k++ { - tmp := alpha * btmp[k] - if tmp == 0 { - continue - } - btmp[k] = tmp - if nonUnit { - btmp[k] *= a[k*lda+k] - } - f32.AxpyUnitary(tmp, a[k*lda:k*lda+k], btmp[:k]) - } - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for j, vb := range btmp { - tmp := vb - if nonUnit { - tmp *= a[j*lda+j] - } - tmp += f32.DotUnitary(a[j*lda+j+1:j*lda+n], btmp[j+1:n]) - btmp[j] = alpha * tmp - } - } - return - } - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for j := n - 1; j >= 0; j-- { - tmp := btmp[j] - if nonUnit { - tmp *= a[j*lda+j] - } - tmp += f32.DotUnitary(a[j*lda:j*lda+j], btmp[:j]) - btmp[j] = alpha * tmp - } - } -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level3float64.go b/vendor/gonum.org/v1/gonum/blas/gonum/level3float64.go deleted file mode 100644 index bf91d14..0000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level3float64.go +++ /dev/null @@ -1,864 +0,0 @@ -// Copyright ©2014 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/f64" -) - -var _ blas.Float64Level3 = Implementation{} - -// Dtrsm solves one of the matrix equations -// A * X = alpha * B if tA == blas.NoTrans and side == blas.Left -// Aᵀ * X = alpha * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Left -// X * A = alpha * B if tA == blas.NoTrans and side == blas.Right -// X * Aᵀ = alpha * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Right -// where A is an n×n or m×m triangular matrix, X and B are m×n matrices, and alpha is a -// scalar. -// -// At entry to the function, X contains the values of B, and the result is -// stored in-place into X. -// -// No check is made that A is invertible. -func (Implementation) Dtrsm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas.Diag, m, n int, alpha float64, a []float64, lda int, b []float64, ldb int) { - if s != blas.Left && s != blas.Right { - panic(badSide) - } - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - k := n - if s == blas.Left { - k = m - } - if lda < max(1, k) { - panic(badLdA) - } - if ldb < max(1, n) { - panic(badLdB) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(k-1)+k { - panic(shortA) - } - if len(b) < ldb*(m-1)+n { - panic(shortB) - } - - if alpha == 0 { - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for j := range btmp { - btmp[j] = 0 - } - } - return - } - nonUnit := d == blas.NonUnit - if s == blas.Left { - if tA == blas.NoTrans { - if ul == blas.Upper { - for i := m - 1; i >= 0; i-- { - btmp := b[i*ldb : i*ldb+n] - if alpha != 1 { - f64.ScalUnitary(alpha, btmp) - } - for ka, va := range a[i*lda+i+1 : i*lda+m] { - if va != 0 { - k := ka + i + 1 - f64.AxpyUnitary(-va, b[k*ldb:k*ldb+n], btmp) - } - } - if nonUnit { - tmp := 1 / a[i*lda+i] - f64.ScalUnitary(tmp, btmp) - } - } - return - } - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - if alpha != 1 { - f64.ScalUnitary(alpha, btmp) - } - for k, va := range a[i*lda : i*lda+i] { - if va != 0 { - f64.AxpyUnitary(-va, b[k*ldb:k*ldb+n], btmp) - } - } - if nonUnit { - tmp := 1 / a[i*lda+i] - f64.ScalUnitary(tmp, btmp) - } - } - return - } - // Cases where a is transposed - if ul == blas.Upper { - for k := 0; k < m; k++ { - btmpk := b[k*ldb : k*ldb+n] - if nonUnit { - tmp := 1 / a[k*lda+k] - f64.ScalUnitary(tmp, btmpk) - } - for ia, va := range a[k*lda+k+1 : k*lda+m] { - if va != 0 { - i := ia + k + 1 - f64.AxpyUnitary(-va, btmpk, b[i*ldb:i*ldb+n]) - } - } - if alpha != 1 { - f64.ScalUnitary(alpha, btmpk) - } - } - return - } - for k := m - 1; k >= 0; k-- { - btmpk := b[k*ldb : k*ldb+n] - if nonUnit { - tmp := 1 / a[k*lda+k] - f64.ScalUnitary(tmp, btmpk) - } - for i, va := range a[k*lda : k*lda+k] { - if va != 0 { - f64.AxpyUnitary(-va, btmpk, b[i*ldb:i*ldb+n]) - } - } - if alpha != 1 { - f64.ScalUnitary(alpha, btmpk) - } - } - return - } - // Cases where a is to the right of X. - if tA == blas.NoTrans { - if ul == blas.Upper { - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - if alpha != 1 { - f64.ScalUnitary(alpha, btmp) - } - for k, vb := range btmp { - if vb == 0 { - continue - } - if nonUnit { - btmp[k] /= a[k*lda+k] - } - f64.AxpyUnitary(-btmp[k], a[k*lda+k+1:k*lda+n], btmp[k+1:n]) - } - } - return - } - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - if alpha != 1 { - f64.ScalUnitary(alpha, btmp) - } - for k := n - 1; k >= 0; k-- { - if btmp[k] == 0 { - continue - } - if nonUnit { - btmp[k] /= a[k*lda+k] - } - f64.AxpyUnitary(-btmp[k], a[k*lda:k*lda+k], btmp[:k]) - } - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for j := n - 1; j >= 0; j-- { - tmp := alpha*btmp[j] - f64.DotUnitary(a[j*lda+j+1:j*lda+n], btmp[j+1:]) - if nonUnit { - tmp /= a[j*lda+j] - } - btmp[j] = tmp - } - } - return - } - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for j := 0; j < n; j++ { - tmp := alpha*btmp[j] - f64.DotUnitary(a[j*lda:j*lda+j], btmp[:j]) - if nonUnit { - tmp /= a[j*lda+j] - } - btmp[j] = tmp - } - } -} - -// Dsymm performs one of the matrix-matrix operations -// C = alpha * A * B + beta * C if side == blas.Left -// C = alpha * B * A + beta * C if side == blas.Right -// where A is an n×n or m×m symmetric matrix, B and C are m×n matrices, and alpha -// is a scalar. -func (Implementation) Dsymm(s blas.Side, ul blas.Uplo, m, n int, alpha float64, a []float64, lda int, b []float64, ldb int, beta float64, c []float64, ldc int) { - if s != blas.Right && s != blas.Left { - panic(badSide) - } - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - k := n - if s == blas.Left { - k = m - } - if lda < max(1, k) { - panic(badLdA) - } - if ldb < max(1, n) { - panic(badLdB) - } - if ldc < max(1, n) { - panic(badLdC) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(k-1)+k { - panic(shortA) - } - if len(b) < ldb*(m-1)+n { - panic(shortB) - } - if len(c) < ldc*(m-1)+n { - panic(shortC) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - if alpha == 0 { - if beta == 0 { - for i := 0; i < m; i++ { - ctmp := c[i*ldc : i*ldc+n] - for j := range ctmp { - ctmp[j] = 0 - } - } - return - } - for i := 0; i < m; i++ { - ctmp := c[i*ldc : i*ldc+n] - for j := 0; j < n; j++ { - ctmp[j] *= beta - } - } - return - } - - isUpper := ul == blas.Upper - if s == blas.Left { - for i := 0; i < m; i++ { - atmp := alpha * a[i*lda+i] - btmp := b[i*ldb : i*ldb+n] - ctmp := c[i*ldc : i*ldc+n] - for j, v := range btmp { - ctmp[j] *= beta - ctmp[j] += atmp * v - } - - for k := 0; k < i; k++ { - var atmp float64 - if isUpper { - atmp = a[k*lda+i] - } else { - atmp = a[i*lda+k] - } - atmp *= alpha - f64.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ctmp) - } - for k := i + 1; k < m; k++ { - var atmp float64 - if isUpper { - atmp = a[i*lda+k] - } else { - atmp = a[k*lda+i] - } - atmp *= alpha - f64.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ctmp) - } - } - return - } - if isUpper { - for i := 0; i < m; i++ { - for j := n - 1; j >= 0; j-- { - tmp := alpha * b[i*ldb+j] - var tmp2 float64 - atmp := a[j*lda+j+1 : j*lda+n] - btmp := b[i*ldb+j+1 : i*ldb+n] - ctmp := c[i*ldc+j+1 : i*ldc+n] - for k, v := range atmp { - ctmp[k] += tmp * v - tmp2 += btmp[k] * v - } - c[i*ldc+j] *= beta - c[i*ldc+j] += tmp*a[j*lda+j] + alpha*tmp2 - } - } - return - } - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - tmp := alpha * b[i*ldb+j] - var tmp2 float64 - atmp := a[j*lda : j*lda+j] - btmp := b[i*ldb : i*ldb+j] - ctmp := c[i*ldc : i*ldc+j] - for k, v := range atmp { - ctmp[k] += tmp * v - tmp2 += btmp[k] * v - } - c[i*ldc+j] *= beta - c[i*ldc+j] += tmp*a[j*lda+j] + alpha*tmp2 - } - } -} - -// Dsyrk performs one of the symmetric rank-k operations -// C = alpha * A * Aᵀ + beta * C if tA == blas.NoTrans -// C = alpha * Aᵀ * A + beta * C if tA == blas.Trans or tA == blas.ConjTrans -// where A is an n×k or k×n matrix, C is an n×n symmetric matrix, and alpha and -// beta are scalars. -func (Implementation) Dsyrk(ul blas.Uplo, tA blas.Transpose, n, k int, alpha float64, a []float64, lda int, beta float64, c []float64, ldc int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.Trans && tA != blas.NoTrans && tA != blas.ConjTrans { - panic(badTranspose) - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - row, col := k, n - if tA == blas.NoTrans { - row, col = n, k - } - if lda < max(1, col) { - panic(badLdA) - } - if ldc < max(1, n) { - panic(badLdC) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(row-1)+col { - panic(shortA) - } - if len(c) < ldc*(n-1)+n { - panic(shortC) - } - - if alpha == 0 { - if beta == 0 { - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - for j := range ctmp { - ctmp[j] = 0 - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - for j := range ctmp { - ctmp[j] = 0 - } - } - return - } - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - for j := range ctmp { - ctmp[j] *= beta - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - for j := range ctmp { - ctmp[j] *= beta - } - } - return - } - if tA == blas.NoTrans { - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - atmp := a[i*lda : i*lda+k] - if beta == 0 { - for jc := range ctmp { - j := jc + i - ctmp[jc] = alpha * f64.DotUnitary(atmp, a[j*lda:j*lda+k]) - } - } else { - for jc, vc := range ctmp { - j := jc + i - ctmp[jc] = vc*beta + alpha*f64.DotUnitary(atmp, a[j*lda:j*lda+k]) - } - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - atmp := a[i*lda : i*lda+k] - if beta == 0 { - for j := range ctmp { - ctmp[j] = alpha * f64.DotUnitary(a[j*lda:j*lda+k], atmp) - } - } else { - for j, vc := range ctmp { - ctmp[j] = vc*beta + alpha*f64.DotUnitary(a[j*lda:j*lda+k], atmp) - } - } - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - if beta == 0 { - for j := range ctmp { - ctmp[j] = 0 - } - } else if beta != 1 { - for j := range ctmp { - ctmp[j] *= beta - } - } - for l := 0; l < k; l++ { - tmp := alpha * a[l*lda+i] - if tmp != 0 { - f64.AxpyUnitary(tmp, a[l*lda+i:l*lda+n], ctmp) - } - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - if beta != 1 { - for j := range ctmp { - ctmp[j] *= beta - } - } - for l := 0; l < k; l++ { - tmp := alpha * a[l*lda+i] - if tmp != 0 { - f64.AxpyUnitary(tmp, a[l*lda:l*lda+i+1], ctmp) - } - } - } -} - -// Dsyr2k performs one of the symmetric rank 2k operations -// C = alpha * A * Bᵀ + alpha * B * Aᵀ + beta * C if tA == blas.NoTrans -// C = alpha * Aᵀ * B + alpha * Bᵀ * A + beta * C if tA == blas.Trans or tA == blas.ConjTrans -// where A and B are n×k or k×n matrices, C is an n×n symmetric matrix, and -// alpha and beta are scalars. -func (Implementation) Dsyr2k(ul blas.Uplo, tA blas.Transpose, n, k int, alpha float64, a []float64, lda int, b []float64, ldb int, beta float64, c []float64, ldc int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.Trans && tA != blas.NoTrans && tA != blas.ConjTrans { - panic(badTranspose) - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - row, col := k, n - if tA == blas.NoTrans { - row, col = n, k - } - if lda < max(1, col) { - panic(badLdA) - } - if ldb < max(1, col) { - panic(badLdB) - } - if ldc < max(1, n) { - panic(badLdC) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(row-1)+col { - panic(shortA) - } - if len(b) < ldb*(row-1)+col { - panic(shortB) - } - if len(c) < ldc*(n-1)+n { - panic(shortC) - } - - if alpha == 0 { - if beta == 0 { - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - for j := range ctmp { - ctmp[j] = 0 - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - for j := range ctmp { - ctmp[j] = 0 - } - } - return - } - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - for j := range ctmp { - ctmp[j] *= beta - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - for j := range ctmp { - ctmp[j] *= beta - } - } - return - } - if tA == blas.NoTrans { - if ul == blas.Upper { - for i := 0; i < n; i++ { - atmp := a[i*lda : i*lda+k] - btmp := b[i*ldb : i*ldb+k] - ctmp := c[i*ldc+i : i*ldc+n] - for jc := range ctmp { - j := i + jc - var tmp1, tmp2 float64 - binner := b[j*ldb : j*ldb+k] - for l, v := range a[j*lda : j*lda+k] { - tmp1 += v * btmp[l] - tmp2 += atmp[l] * binner[l] - } - ctmp[jc] *= beta - ctmp[jc] += alpha * (tmp1 + tmp2) - } - } - return - } - for i := 0; i < n; i++ { - atmp := a[i*lda : i*lda+k] - btmp := b[i*ldb : i*ldb+k] - ctmp := c[i*ldc : i*ldc+i+1] - for j := 0; j <= i; j++ { - var tmp1, tmp2 float64 - binner := b[j*ldb : j*ldb+k] - for l, v := range a[j*lda : j*lda+k] { - tmp1 += v * btmp[l] - tmp2 += atmp[l] * binner[l] - } - ctmp[j] *= beta - ctmp[j] += alpha * (tmp1 + tmp2) - } - } - return - } - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - if beta != 1 { - for j := range ctmp { - ctmp[j] *= beta - } - } - for l := 0; l < k; l++ { - tmp1 := alpha * b[l*ldb+i] - tmp2 := alpha * a[l*lda+i] - btmp := b[l*ldb+i : l*ldb+n] - if tmp1 != 0 || tmp2 != 0 { - for j, v := range a[l*lda+i : l*lda+n] { - ctmp[j] += v*tmp1 + btmp[j]*tmp2 - } - } - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - if beta != 1 { - for j := range ctmp { - ctmp[j] *= beta - } - } - for l := 0; l < k; l++ { - tmp1 := alpha * b[l*ldb+i] - tmp2 := alpha * a[l*lda+i] - btmp := b[l*ldb : l*ldb+i+1] - if tmp1 != 0 || tmp2 != 0 { - for j, v := range a[l*lda : l*lda+i+1] { - ctmp[j] += v*tmp1 + btmp[j]*tmp2 - } - } - } - } -} - -// Dtrmm performs one of the matrix-matrix operations -// B = alpha * A * B if tA == blas.NoTrans and side == blas.Left -// B = alpha * Aᵀ * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Left -// B = alpha * B * A if tA == blas.NoTrans and side == blas.Right -// B = alpha * B * Aᵀ if tA == blas.Trans or blas.ConjTrans, and side == blas.Right -// where A is an n×n or m×m triangular matrix, B is an m×n matrix, and alpha is a scalar. -func (Implementation) Dtrmm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas.Diag, m, n int, alpha float64, a []float64, lda int, b []float64, ldb int) { - if s != blas.Left && s != blas.Right { - panic(badSide) - } - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - k := n - if s == blas.Left { - k = m - } - if lda < max(1, k) { - panic(badLdA) - } - if ldb < max(1, n) { - panic(badLdB) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(k-1)+k { - panic(shortA) - } - if len(b) < ldb*(m-1)+n { - panic(shortB) - } - - if alpha == 0 { - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for j := range btmp { - btmp[j] = 0 - } - } - return - } - - nonUnit := d == blas.NonUnit - if s == blas.Left { - if tA == blas.NoTrans { - if ul == blas.Upper { - for i := 0; i < m; i++ { - tmp := alpha - if nonUnit { - tmp *= a[i*lda+i] - } - btmp := b[i*ldb : i*ldb+n] - f64.ScalUnitary(tmp, btmp) - for ka, va := range a[i*lda+i+1 : i*lda+m] { - k := ka + i + 1 - if va != 0 { - f64.AxpyUnitary(alpha*va, b[k*ldb:k*ldb+n], btmp) - } - } - } - return - } - for i := m - 1; i >= 0; i-- { - tmp := alpha - if nonUnit { - tmp *= a[i*lda+i] - } - btmp := b[i*ldb : i*ldb+n] - f64.ScalUnitary(tmp, btmp) - for k, va := range a[i*lda : i*lda+i] { - if va != 0 { - f64.AxpyUnitary(alpha*va, b[k*ldb:k*ldb+n], btmp) - } - } - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - for k := m - 1; k >= 0; k-- { - btmpk := b[k*ldb : k*ldb+n] - for ia, va := range a[k*lda+k+1 : k*lda+m] { - i := ia + k + 1 - btmp := b[i*ldb : i*ldb+n] - if va != 0 { - f64.AxpyUnitary(alpha*va, btmpk, btmp) - } - } - tmp := alpha - if nonUnit { - tmp *= a[k*lda+k] - } - if tmp != 1 { - f64.ScalUnitary(tmp, btmpk) - } - } - return - } - for k := 0; k < m; k++ { - btmpk := b[k*ldb : k*ldb+n] - for i, va := range a[k*lda : k*lda+k] { - btmp := b[i*ldb : i*ldb+n] - if va != 0 { - f64.AxpyUnitary(alpha*va, btmpk, btmp) - } - } - tmp := alpha - if nonUnit { - tmp *= a[k*lda+k] - } - if tmp != 1 { - f64.ScalUnitary(tmp, btmpk) - } - } - return - } - // Cases where a is on the right - if tA == blas.NoTrans { - if ul == blas.Upper { - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for k := n - 1; k >= 0; k-- { - tmp := alpha * btmp[k] - if tmp == 0 { - continue - } - btmp[k] = tmp - if nonUnit { - btmp[k] *= a[k*lda+k] - } - f64.AxpyUnitary(tmp, a[k*lda+k+1:k*lda+n], btmp[k+1:n]) - } - } - return - } - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for k := 0; k < n; k++ { - tmp := alpha * btmp[k] - if tmp == 0 { - continue - } - btmp[k] = tmp - if nonUnit { - btmp[k] *= a[k*lda+k] - } - f64.AxpyUnitary(tmp, a[k*lda:k*lda+k], btmp[:k]) - } - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for j, vb := range btmp { - tmp := vb - if nonUnit { - tmp *= a[j*lda+j] - } - tmp += f64.DotUnitary(a[j*lda+j+1:j*lda+n], btmp[j+1:n]) - btmp[j] = alpha * tmp - } - } - return - } - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for j := n - 1; j >= 0; j-- { - tmp := btmp[j] - if nonUnit { - tmp *= a[j*lda+j] - } - tmp += f64.DotUnitary(a[j*lda:j*lda+j], btmp[:j]) - btmp[j] = alpha * tmp - } - } -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/sgemm.go b/vendor/gonum.org/v1/gonum/blas/gonum/sgemm.go deleted file mode 100644 index 079b94c..0000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/sgemm.go +++ /dev/null @@ -1,318 +0,0 @@ -// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT. - -// Copyright ©2014 The Gonum 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 gonum - -import ( - "runtime" - "sync" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/f32" -) - -// Sgemm performs one of the matrix-matrix operations -// C = alpha * A * B + beta * C -// C = alpha * Aᵀ * B + beta * C -// C = alpha * A * Bᵀ + beta * C -// C = alpha * Aᵀ * Bᵀ + beta * C -// where A is an m×k or k×m dense matrix, B is an n×k or k×n dense matrix, C is -// an m×n matrix, and alpha and beta are scalars. tA and tB specify whether A or -// B are transposed. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Sgemm(tA, tB blas.Transpose, m, n, k int, alpha float32, a []float32, lda int, b []float32, ldb int, beta float32, c []float32, ldc int) { - switch tA { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch tB { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - aTrans := tA == blas.Trans || tA == blas.ConjTrans - if aTrans { - if lda < max(1, m) { - panic(badLdA) - } - } else { - if lda < max(1, k) { - panic(badLdA) - } - } - bTrans := tB == blas.Trans || tB == blas.ConjTrans - if bTrans { - if ldb < max(1, k) { - panic(badLdB) - } - } else { - if ldb < max(1, n) { - panic(badLdB) - } - } - if ldc < max(1, n) { - panic(badLdC) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if aTrans { - if len(a) < (k-1)*lda+m { - panic(shortA) - } - } else { - if len(a) < (m-1)*lda+k { - panic(shortA) - } - } - if bTrans { - if len(b) < (n-1)*ldb+k { - panic(shortB) - } - } else { - if len(b) < (k-1)*ldb+n { - panic(shortB) - } - } - if len(c) < (m-1)*ldc+n { - panic(shortC) - } - - // Quick return if possible. - if (alpha == 0 || k == 0) && beta == 1 { - return - } - - // scale c - if beta != 1 { - if beta == 0 { - for i := 0; i < m; i++ { - ctmp := c[i*ldc : i*ldc+n] - for j := range ctmp { - ctmp[j] = 0 - } - } - } else { - for i := 0; i < m; i++ { - ctmp := c[i*ldc : i*ldc+n] - for j := range ctmp { - ctmp[j] *= beta - } - } - } - } - - sgemmParallel(aTrans, bTrans, m, n, k, a, lda, b, ldb, c, ldc, alpha) -} - -func sgemmParallel(aTrans, bTrans bool, m, n, k int, a []float32, lda int, b []float32, ldb int, c []float32, ldc int, alpha float32) { - // dgemmParallel computes a parallel matrix multiplication by partitioning - // a and b into sub-blocks, and updating c with the multiplication of the sub-block - // In all cases, - // A = [ A_11 A_12 ... A_1j - // A_21 A_22 ... A_2j - // ... - // A_i1 A_i2 ... A_ij] - // - // and same for B. All of the submatrix sizes are blockSize×blockSize except - // at the edges. - // - // In all cases, there is one dimension for each matrix along which - // C must be updated sequentially. - // Cij = \sum_k Aik Bki, (A * B) - // Cij = \sum_k Aki Bkj, (Aᵀ * B) - // Cij = \sum_k Aik Bjk, (A * Bᵀ) - // Cij = \sum_k Aki Bjk, (Aᵀ * Bᵀ) - // - // This code computes one {i, j} block sequentially along the k dimension, - // and computes all of the {i, j} blocks concurrently. This - // partitioning allows Cij to be updated in-place without race-conditions. - // Instead of launching a goroutine for each possible concurrent computation, - // a number of worker goroutines are created and channels are used to pass - // available and completed cases. - // - // http://alexkr.com/docs/matrixmult.pdf is a good reference on matrix-matrix - // multiplies, though this code does not copy matrices to attempt to eliminate - // cache misses. - - maxKLen := k - parBlocks := blocks(m, blockSize) * blocks(n, blockSize) - if parBlocks < minParBlock { - // The matrix multiplication is small in the dimensions where it can be - // computed concurrently. Just do it in serial. - sgemmSerial(aTrans, bTrans, m, n, k, a, lda, b, ldb, c, ldc, alpha) - return - } - - nWorkers := runtime.GOMAXPROCS(0) - if parBlocks < nWorkers { - nWorkers = parBlocks - } - // There is a tradeoff between the workers having to wait for work - // and a large buffer making operations slow. - buf := buffMul * nWorkers - if buf > parBlocks { - buf = parBlocks - } - - sendChan := make(chan subMul, buf) - - // Launch workers. A worker receives an {i, j} submatrix of c, and computes - // A_ik B_ki (or the transposed version) storing the result in c_ij. When the - // channel is finally closed, it signals to the waitgroup that it has finished - // computing. - var wg sync.WaitGroup - for i := 0; i < nWorkers; i++ { - wg.Add(1) - go func() { - defer wg.Done() - for sub := range sendChan { - i := sub.i - j := sub.j - leni := blockSize - if i+leni > m { - leni = m - i - } - lenj := blockSize - if j+lenj > n { - lenj = n - j - } - - cSub := sliceView32(c, ldc, i, j, leni, lenj) - - // Compute A_ik B_kj for all k - for k := 0; k < maxKLen; k += blockSize { - lenk := blockSize - if k+lenk > maxKLen { - lenk = maxKLen - k - } - var aSub, bSub []float32 - if aTrans { - aSub = sliceView32(a, lda, k, i, lenk, leni) - } else { - aSub = sliceView32(a, lda, i, k, leni, lenk) - } - if bTrans { - bSub = sliceView32(b, ldb, j, k, lenj, lenk) - } else { - bSub = sliceView32(b, ldb, k, j, lenk, lenj) - } - sgemmSerial(aTrans, bTrans, leni, lenj, lenk, aSub, lda, bSub, ldb, cSub, ldc, alpha) - } - } - }() - } - - // Send out all of the {i, j} subblocks for computation. - for i := 0; i < m; i += blockSize { - for j := 0; j < n; j += blockSize { - sendChan <- subMul{ - i: i, - j: j, - } - } - } - close(sendChan) - wg.Wait() -} - -// sgemmSerial is serial matrix multiply -func sgemmSerial(aTrans, bTrans bool, m, n, k int, a []float32, lda int, b []float32, ldb int, c []float32, ldc int, alpha float32) { - switch { - case !aTrans && !bTrans: - sgemmSerialNotNot(m, n, k, a, lda, b, ldb, c, ldc, alpha) - return - case aTrans && !bTrans: - sgemmSerialTransNot(m, n, k, a, lda, b, ldb, c, ldc, alpha) - return - case !aTrans && bTrans: - sgemmSerialNotTrans(m, n, k, a, lda, b, ldb, c, ldc, alpha) - return - case aTrans && bTrans: - sgemmSerialTransTrans(m, n, k, a, lda, b, ldb, c, ldc, alpha) - return - default: - panic("unreachable") - } -} - -// sgemmSerial where neither a nor b are transposed -func sgemmSerialNotNot(m, n, k int, a []float32, lda int, b []float32, ldb int, c []float32, ldc int, alpha float32) { - // This style is used instead of the literal [i*stride +j]) is used because - // approximately 5 times faster as of go 1.3. - for i := 0; i < m; i++ { - ctmp := c[i*ldc : i*ldc+n] - for l, v := range a[i*lda : i*lda+k] { - tmp := alpha * v - if tmp != 0 { - f32.AxpyUnitary(tmp, b[l*ldb:l*ldb+n], ctmp) - } - } - } -} - -// sgemmSerial where neither a is transposed and b is not -func sgemmSerialTransNot(m, n, k int, a []float32, lda int, b []float32, ldb int, c []float32, ldc int, alpha float32) { - // This style is used instead of the literal [i*stride +j]) is used because - // approximately 5 times faster as of go 1.3. - for l := 0; l < k; l++ { - btmp := b[l*ldb : l*ldb+n] - for i, v := range a[l*lda : l*lda+m] { - tmp := alpha * v - if tmp != 0 { - ctmp := c[i*ldc : i*ldc+n] - f32.AxpyUnitary(tmp, btmp, ctmp) - } - } - } -} - -// sgemmSerial where neither a is not transposed and b is -func sgemmSerialNotTrans(m, n, k int, a []float32, lda int, b []float32, ldb int, c []float32, ldc int, alpha float32) { - // This style is used instead of the literal [i*stride +j]) is used because - // approximately 5 times faster as of go 1.3. - for i := 0; i < m; i++ { - atmp := a[i*lda : i*lda+k] - ctmp := c[i*ldc : i*ldc+n] - for j := 0; j < n; j++ { - ctmp[j] += alpha * f32.DotUnitary(atmp, b[j*ldb:j*ldb+k]) - } - } -} - -// sgemmSerial where both are transposed -func sgemmSerialTransTrans(m, n, k int, a []float32, lda int, b []float32, ldb int, c []float32, ldc int, alpha float32) { - // This style is used instead of the literal [i*stride +j]) is used because - // approximately 5 times faster as of go 1.3. - for l := 0; l < k; l++ { - for i, v := range a[l*lda : l*lda+m] { - tmp := alpha * v - if tmp != 0 { - ctmp := c[i*ldc : i*ldc+n] - f32.AxpyInc(tmp, b[l:], ctmp, uintptr(n), uintptr(ldb), 1, 0, 0) - } - } - } -} - -func sliceView32(a []float32, lda, i, j, r, c int) []float32 { - return a[i*lda+j : (i+r-1)*lda+j+c] -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/single_precision.bash b/vendor/gonum.org/v1/gonum/blas/gonum/single_precision.bash deleted file mode 100755 index 2341007..0000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/single_precision.bash +++ /dev/null @@ -1,220 +0,0 @@ -#!/usr/bin/env bash - -# Copyright ©2015 The Gonum Authors. All rights reserved. -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file. - -WARNINGF32='//\ -// Float32 implementations are autogenerated and not directly tested.\ -' -WARNINGC64='//\ -// Complex64 implementations are autogenerated and not directly tested.\ -' - -# Level1 routines. - -echo Generating level1float32.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT.\n' > level1float32.go -cat level1float64.go \ -| gofmt -r 'blas.Float64Level1 -> blas.Float32Level1' \ -\ -| gofmt -r 'float64 -> float32' \ -| gofmt -r 'blas.DrotmParams -> blas.SrotmParams' \ -\ -| gofmt -r 'f64.AxpyInc -> f32.AxpyInc' \ -| gofmt -r 'f64.AxpyUnitary -> f32.AxpyUnitary' \ -| gofmt -r 'f64.DotUnitary -> f32.DotUnitary' \ -| gofmt -r 'f64.L2NormInc -> f32.L2NormInc' \ -| gofmt -r 'f64.L2NormUnitary -> f32.L2NormUnitary' \ -| gofmt -r 'f64.ScalInc -> f32.ScalInc' \ -| gofmt -r 'f64.ScalUnitary -> f32.ScalUnitary' \ -\ -| sed -e "s_^\(func (Implementation) \)D\(.*\)\$_$WARNINGF32\1S\2_" \ - -e 's_^// D_// S_' \ - -e "s_^\(func (Implementation) \)Id\(.*\)\$_$WARNINGF32\1Is\2_" \ - -e 's_^// Id_// Is_' \ - -e 's_"gonum.org/v1/gonum/internal/asm/f64"_"gonum.org/v1/gonum/internal/asm/f32"_' \ - -e 's_"math"_math "gonum.org/v1/gonum/internal/math32"_' \ ->> level1float32.go - -echo Generating level1cmplx64.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT.\n' > level1cmplx64.go -cat level1cmplx128.go \ -| gofmt -r 'blas.Complex128Level1 -> blas.Complex64Level1' \ -\ -| gofmt -r 'float64 -> float32' \ -| gofmt -r 'complex128 -> complex64' \ -\ -| gofmt -r 'c128.AxpyInc -> c64.AxpyInc' \ -| gofmt -r 'c128.AxpyUnitary -> c64.AxpyUnitary' \ -| gofmt -r 'c128.DotcInc -> c64.DotcInc' \ -| gofmt -r 'c128.DotcUnitary -> c64.DotcUnitary' \ -| gofmt -r 'c128.DotuInc -> c64.DotuInc' \ -| gofmt -r 'c128.DotuUnitary -> c64.DotuUnitary' \ -| gofmt -r 'c128.ScalInc -> c64.ScalInc' \ -| gofmt -r 'c128.ScalUnitary -> c64.ScalUnitary' \ -| gofmt -r 'dcabs1 -> scabs1' \ -\ -| sed -e "s_^\(func (Implementation) \)Zdot\(.*\)\$_$WARNINGC64\1Cdot\2_" \ - -e 's_^// Zdot_// Cdot_' \ - -e "s_^\(func (Implementation) \)Zdscal\(.*\)\$_$WARNINGC64\1Csscal\2_" \ - -e 's_^// Zdscal_// Csscal_' \ - -e "s_^\(func (Implementation) \)Z\(.*\)\$_$WARNINGC64\1C\2_" \ - -e 's_^// Z_// C_' \ - -e "s_^\(func (Implementation) \)Iz\(.*\)\$_$WARNINGC64\1Ic\2_" \ - -e 's_^// Iz_// Ic_' \ - -e "s_^\(func (Implementation) \)Dz\(.*\)\$_$WARNINGC64\1Sc\2_" \ - -e 's_^// Dz_// Sc_' \ - -e 's_"gonum.org/v1/gonum/internal/asm/c128"_"gonum.org/v1/gonum/internal/asm/c64"_' \ - -e 's_"math"_math "gonum.org/v1/gonum/internal/math32"_' \ ->> level1cmplx64.go - -echo Generating level1float32_sdot.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT.\n' > level1float32_sdot.go -cat level1float64_ddot.go \ -| gofmt -r 'float64 -> float32' \ -\ -| gofmt -r 'f64.DotInc -> f32.DotInc' \ -| gofmt -r 'f64.DotUnitary -> f32.DotUnitary' \ -\ -| sed -e "s_^\(func (Implementation) \)D\(.*\)\$_$WARNINGF32\1S\2_" \ - -e 's_^// D_// S_' \ - -e 's_"gonum.org/v1/gonum/internal/asm/f64"_"gonum.org/v1/gonum/internal/asm/f32"_' \ ->> level1float32_sdot.go - -echo Generating level1float32_dsdot.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT.\n' > level1float32_dsdot.go -cat level1float64_ddot.go \ -| gofmt -r '[]float64 -> []float32' \ -\ -| gofmt -r 'f64.DotInc -> f32.DdotInc' \ -| gofmt -r 'f64.DotUnitary -> f32.DdotUnitary' \ -\ -| sed -e "s_^\(func (Implementation) \)D\(.*\)\$_$WARNINGF32\1Ds\2_" \ - -e 's_^// D_// Ds_' \ - -e 's_"gonum.org/v1/gonum/internal/asm/f64"_"gonum.org/v1/gonum/internal/asm/f32"_' \ ->> level1float32_dsdot.go - -echo Generating level1float32_sdsdot.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT.\n' > level1float32_sdsdot.go -cat level1float64_ddot.go \ -| gofmt -r 'float64 -> float32' \ -\ -| gofmt -r 'f64.DotInc(x, y, f(n), f(incX), f(incY), f(ix), f(iy)) -> alpha + float32(f32.DdotInc(x, y, f(n), f(incX), f(incY), f(ix), f(iy)))' \ -| gofmt -r 'f64.DotUnitary(a, b) -> alpha + float32(f32.DdotUnitary(a, b))' \ -\ -| sed -e "s_^\(func (Implementation) \)D\(.*\)\$_$WARNINGF32\1Sds\2_" \ - -e 's_^// D\(.*\)$_// Sds\1 plus a constant_' \ - -e 's_\\sum_alpha + \\sum_' \ - -e 's/n int/n int, alpha float32/' \ - -e 's_"gonum.org/v1/gonum/internal/asm/f64"_"gonum.org/v1/gonum/internal/asm/f32"_' \ ->> level1float32_sdsdot.go - - -# Level2 routines. - -echo Generating level2float32.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT.\n' > level2float32.go -cat level2float64.go \ -| gofmt -r 'blas.Float64Level2 -> blas.Float32Level2' \ -\ -| gofmt -r 'float64 -> float32' \ -\ -| gofmt -r 'f64.AxpyInc -> f32.AxpyInc' \ -| gofmt -r 'f64.AxpyIncTo -> f32.AxpyIncTo' \ -| gofmt -r 'f64.AxpyUnitary -> f32.AxpyUnitary' \ -| gofmt -r 'f64.AxpyUnitaryTo -> f32.AxpyUnitaryTo' \ -| gofmt -r 'f64.DotInc -> f32.DotInc' \ -| gofmt -r 'f64.DotUnitary -> f32.DotUnitary' \ -| gofmt -r 'f64.ScalInc -> f32.ScalInc' \ -| gofmt -r 'f64.ScalUnitary -> f32.ScalUnitary' \ -| gofmt -r 'f64.Ger -> f32.Ger' \ -\ -| sed -e "s_^\(func (Implementation) \)D\(.*\)\$_$WARNINGF32\1S\2_" \ - -e 's_^// D_// S_' \ - -e 's_"gonum.org/v1/gonum/internal/asm/f64"_"gonum.org/v1/gonum/internal/asm/f32"_' \ ->> level2float32.go - -echo Generating level2cmplx64.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT.\n' > level2cmplx64.go -cat level2cmplx128.go \ -| gofmt -r 'blas.Complex128Level2 -> blas.Complex64Level2' \ -\ -| gofmt -r 'complex128 -> complex64' \ -| gofmt -r 'float64 -> float32' \ -\ -| gofmt -r 'c128.AxpyInc -> c64.AxpyInc' \ -| gofmt -r 'c128.AxpyUnitary -> c64.AxpyUnitary' \ -| gofmt -r 'c128.DotuInc -> c64.DotuInc' \ -| gofmt -r 'c128.DotuUnitary -> c64.DotuUnitary' \ -| gofmt -r 'c128.ScalInc -> c64.ScalInc' \ -| gofmt -r 'c128.ScalUnitary -> c64.ScalUnitary' \ -\ -| sed -e "s_^\(func (Implementation) \)Z\(.*\)\$_$WARNINGC64\1C\2_" \ - -e 's_^// Z_// C_' \ - -e 's_"gonum.org/v1/gonum/internal/asm/c128"_"gonum.org/v1/gonum/internal/asm/c64"_' \ - -e 's_"math/cmplx"_cmplx "gonum.org/v1/gonum/internal/cmplx64"_' \ ->> level2cmplx64.go - -# Level3 routines. - -echo Generating level3float32.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT.\n' > level3float32.go -cat level3float64.go \ -| gofmt -r 'blas.Float64Level3 -> blas.Float32Level3' \ -\ -| gofmt -r 'float64 -> float32' \ -\ -| gofmt -r 'f64.AxpyUnitaryTo -> f32.AxpyUnitaryTo' \ -| gofmt -r 'f64.AxpyUnitary -> f32.AxpyUnitary' \ -| gofmt -r 'f64.DotUnitary -> f32.DotUnitary' \ -| gofmt -r 'f64.ScalUnitary -> f32.ScalUnitary' \ -\ -| sed -e "s_^\(func (Implementation) \)D\(.*\)\$_$WARNINGF32\1S\2_" \ - -e 's_^// D_// S_' \ - -e 's_"gonum.org/v1/gonum/internal/asm/f64"_"gonum.org/v1/gonum/internal/asm/f32"_' \ ->> level3float32.go - -echo Generating sgemm.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT.\n' > sgemm.go -cat dgemm.go \ -| gofmt -r 'float64 -> float32' \ -| gofmt -r 'sliceView64 -> sliceView32' \ -\ -| gofmt -r 'dgemmParallel -> sgemmParallel' \ -| gofmt -r 'computeNumBlocks64 -> computeNumBlocks32' \ -| gofmt -r 'dgemmSerial -> sgemmSerial' \ -| gofmt -r 'dgemmSerialNotNot -> sgemmSerialNotNot' \ -| gofmt -r 'dgemmSerialTransNot -> sgemmSerialTransNot' \ -| gofmt -r 'dgemmSerialNotTrans -> sgemmSerialNotTrans' \ -| gofmt -r 'dgemmSerialTransTrans -> sgemmSerialTransTrans' \ -\ -| gofmt -r 'f64.AxpyInc -> f32.AxpyInc' \ -| gofmt -r 'f64.AxpyUnitary -> f32.AxpyUnitary' \ -| gofmt -r 'f64.DotUnitary -> f32.DotUnitary' \ -\ -| sed -e "s_^\(func (Implementation) \)D\(.*\)\$_$WARNINGF32\1S\2_" \ - -e 's_^// D_// S_' \ - -e 's_^// d_// s_' \ - -e 's_"gonum.org/v1/gonum/internal/asm/f64"_"gonum.org/v1/gonum/internal/asm/f32"_' \ ->> sgemm.go - -echo Generating level3cmplx64.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT.\n' > level3cmplx64.go -cat level3cmplx128.go \ -| gofmt -r 'blas.Complex128Level3 -> blas.Complex64Level3' \ -\ -| gofmt -r 'float64 -> float32' \ -| gofmt -r 'complex128 -> complex64' \ -\ -| gofmt -r 'c128.ScalUnitary -> c64.ScalUnitary' \ -| gofmt -r 'c128.DscalUnitary -> c64.SscalUnitary' \ -| gofmt -r 'c128.DotcUnitary -> c64.DotcUnitary' \ -| gofmt -r 'c128.AxpyUnitary -> c64.AxpyUnitary' \ -| gofmt -r 'c128.DotuUnitary -> c64.DotuUnitary' \ -\ -| sed -e "s_^\(func (Implementation) \)Z\(.*\)\$_$WARNINGC64\1C\2_" \ - -e 's_^// Z_// C_' \ - -e 's_"gonum.org/v1/gonum/internal/asm/c128"_"gonum.org/v1/gonum/internal/asm/c64"_' \ - -e 's_"math/cmplx"_cmplx "gonum.org/v1/gonum/internal/cmplx64"_' \ ->> level3cmplx64.go diff --git a/vendor/gonum.org/v1/gonum/floats/README.md b/vendor/gonum.org/v1/gonum/floats/README.md deleted file mode 100644 index ee867bb..0000000 --- a/vendor/gonum.org/v1/gonum/floats/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Gonum floats [![GoDoc](https://godoc.org/gonum.org/v1/gonum/floats?status.svg)](https://godoc.org/gonum.org/v1/gonum/floats) - -Package floats provides a set of helper routines for dealing with slices of float64. -The functions avoid allocations to allow for use within tight loops without garbage collection overhead. diff --git a/vendor/gonum.org/v1/gonum/floats/doc.go b/vendor/gonum.org/v1/gonum/floats/doc.go deleted file mode 100644 index bfe05c1..0000000 --- a/vendor/gonum.org/v1/gonum/floats/doc.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright ©2017 The Gonum 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 floats provides a set of helper routines for dealing with slices -// of float64. The functions avoid allocations to allow for use within tight -// loops without garbage collection overhead. -// -// The convention used is that when a slice is being modified in place, it has -// the name dst. -package floats // import "gonum.org/v1/gonum/floats" diff --git a/vendor/gonum.org/v1/gonum/floats/floats.go b/vendor/gonum.org/v1/gonum/floats/floats.go deleted file mode 100644 index 6a0efae..0000000 --- a/vendor/gonum.org/v1/gonum/floats/floats.go +++ /dev/null @@ -1,925 +0,0 @@ -// Copyright ©2013 The Gonum Authors. All rights reserved. -// Use of this code is governed by a BSD-style -// license that can be found in the LICENSE file - -package floats - -import ( - "errors" - "math" - "sort" - "strconv" - - "gonum.org/v1/gonum/internal/asm/f64" -) - -// Add adds, element-wise, the elements of s and dst, and stores in dst. -// Panics if the lengths of dst and s do not match. -func Add(dst, s []float64) { - if len(dst) != len(s) { - panic("floats: length of the slices do not match") - } - f64.AxpyUnitaryTo(dst, 1, s, dst) -} - -// AddTo adds, element-wise, the elements of s and t and -// stores the result in dst. Panics if the lengths of s, t and dst do not match. -func AddTo(dst, s, t []float64) []float64 { - if len(s) != len(t) { - panic("floats: length of adders do not match") - } - if len(dst) != len(s) { - panic("floats: length of destination does not match length of adder") - } - f64.AxpyUnitaryTo(dst, 1, s, t) - return dst -} - -// AddConst adds the scalar c to all of the values in dst. -func AddConst(c float64, dst []float64) { - f64.AddConst(c, dst) -} - -// AddScaled performs dst = dst + alpha * s. -// It panics if the lengths of dst and s are not equal. -func AddScaled(dst []float64, alpha float64, s []float64) { - if len(dst) != len(s) { - panic("floats: length of destination and source to not match") - } - f64.AxpyUnitaryTo(dst, alpha, s, dst) -} - -// AddScaledTo performs dst = y + alpha * s, where alpha is a scalar, -// and dst, y and s are all slices. -// It panics if the lengths of dst, y, and s are not equal. -// -// At the return of the function, dst[i] = y[i] + alpha * s[i] -func AddScaledTo(dst, y []float64, alpha float64, s []float64) []float64 { - if len(dst) != len(s) || len(dst) != len(y) { - panic("floats: lengths of slices do not match") - } - f64.AxpyUnitaryTo(dst, alpha, s, y) - return dst -} - -// argsort is a helper that implements sort.Interface, as used by -// Argsort. -type argsort struct { - s []float64 - inds []int -} - -func (a argsort) Len() int { - return len(a.s) -} - -func (a argsort) Less(i, j int) bool { - return a.s[i] < a.s[j] -} - -func (a argsort) Swap(i, j int) { - a.s[i], a.s[j] = a.s[j], a.s[i] - a.inds[i], a.inds[j] = a.inds[j], a.inds[i] -} - -// Argsort sorts the elements of dst while tracking their original order. -// At the conclusion of Argsort, dst will contain the original elements of dst -// but sorted in increasing order, and inds will contain the original position -// of the elements in the slice such that dst[i] = origDst[inds[i]]. -// It panics if the lengths of dst and inds do not match. -func Argsort(dst []float64, inds []int) { - if len(dst) != len(inds) { - panic("floats: length of inds does not match length of slice") - } - for i := range dst { - inds[i] = i - } - - a := argsort{s: dst, inds: inds} - sort.Sort(a) -} - -// Count applies the function f to every element of s and returns the number -// of times the function returned true. -func Count(f func(float64) bool, s []float64) int { - var n int - for _, val := range s { - if f(val) { - n++ - } - } - return n -} - -// CumProd finds the cumulative product of the first i elements in -// s and puts them in place into the ith element of the -// destination dst. A panic will occur if the lengths of arguments -// do not match. -// -// At the return of the function, dst[i] = s[i] * s[i-1] * s[i-2] * ... -func CumProd(dst, s []float64) []float64 { - if len(dst) != len(s) { - panic("floats: length of destination does not match length of the source") - } - if len(dst) == 0 { - return dst - } - return f64.CumProd(dst, s) -} - -// CumSum finds the cumulative sum of the first i elements in -// s and puts them in place into the ith element of the -// destination dst. A panic will occur if the lengths of arguments -// do not match. -// -// At the return of the function, dst[i] = s[i] + s[i-1] + s[i-2] + ... -func CumSum(dst, s []float64) []float64 { - if len(dst) != len(s) { - panic("floats: length of destination does not match length of the source") - } - if len(dst) == 0 { - return dst - } - return f64.CumSum(dst, s) -} - -// Distance computes the L-norm of s - t. See Norm for special cases. -// A panic will occur if the lengths of s and t do not match. -func Distance(s, t []float64, L float64) float64 { - if len(s) != len(t) { - panic("floats: slice lengths do not match") - } - if len(s) == 0 { - return 0 - } - if L == 2 { - return f64.L2DistanceUnitary(s, t) - } - var norm float64 - if L == 1 { - for i, v := range s { - norm += math.Abs(t[i] - v) - } - return norm - } - if math.IsInf(L, 1) { - for i, v := range s { - absDiff := math.Abs(t[i] - v) - if absDiff > norm { - norm = absDiff - } - } - return norm - } - for i, v := range s { - norm += math.Pow(math.Abs(t[i]-v), L) - } - return math.Pow(norm, 1/L) -} - -// Div performs element-wise division dst / s -// and stores the value in dst. It panics if the -// lengths of s and t are not equal. -func Div(dst, s []float64) { - if len(dst) != len(s) { - panic("floats: slice lengths do not match") - } - f64.Div(dst, s) -} - -// DivTo performs element-wise division s / t -// and stores the value in dst. It panics if the -// lengths of s, t, and dst are not equal. -func DivTo(dst, s, t []float64) []float64 { - if len(s) != len(t) || len(dst) != len(t) { - panic("floats: slice lengths do not match") - } - return f64.DivTo(dst, s, t) -} - -// Dot computes the dot product of s1 and s2, i.e. -// sum_{i = 1}^N s1[i]*s2[i]. -// A panic will occur if lengths of arguments do not match. -func Dot(s1, s2 []float64) float64 { - if len(s1) != len(s2) { - panic("floats: lengths of the slices do not match") - } - return f64.DotUnitary(s1, s2) -} - -// Equal returns true if the slices have equal lengths and -// all elements are numerically identical. -func Equal(s1, s2 []float64) bool { - if len(s1) != len(s2) { - return false - } - for i, val := range s1 { - if s2[i] != val { - return false - } - } - return true -} - -// EqualApprox returns true if the slices have equal lengths and -// all element pairs have an absolute tolerance less than tol or a -// relative tolerance less than tol. -func EqualApprox(s1, s2 []float64, tol float64) bool { - if len(s1) != len(s2) { - return false - } - for i, a := range s1 { - if !EqualWithinAbsOrRel(a, s2[i], tol, tol) { - return false - } - } - return true -} - -// EqualFunc returns true if the slices have the same lengths -// and the function returns true for all element pairs. -func EqualFunc(s1, s2 []float64, f func(float64, float64) bool) bool { - if len(s1) != len(s2) { - return false - } - for i, val := range s1 { - if !f(val, s2[i]) { - return false - } - } - return true -} - -// EqualWithinAbs returns true if a and b have an absolute -// difference of less than tol. -func EqualWithinAbs(a, b, tol float64) bool { - return a == b || math.Abs(a-b) <= tol -} - -const minNormalFloat64 = 2.2250738585072014e-308 - -// EqualWithinRel returns true if the difference between a and b -// is not greater than tol times the greater value. -func EqualWithinRel(a, b, tol float64) bool { - if a == b { - return true - } - delta := math.Abs(a - b) - if delta <= minNormalFloat64 { - return delta <= tol*minNormalFloat64 - } - // We depend on the division in this relationship to identify - // infinities (we rely on the NaN to fail the test) otherwise - // we compare Infs of the same sign and evaluate Infs as equal - // independent of sign. - return delta/math.Max(math.Abs(a), math.Abs(b)) <= tol -} - -// EqualWithinAbsOrRel returns true if a and b are equal to within -// the absolute tolerance. -func EqualWithinAbsOrRel(a, b, absTol, relTol float64) bool { - if EqualWithinAbs(a, b, absTol) { - return true - } - return EqualWithinRel(a, b, relTol) -} - -// EqualWithinULP returns true if a and b are equal to within -// the specified number of floating point units in the last place. -func EqualWithinULP(a, b float64, ulp uint) bool { - if a == b { - return true - } - if math.IsNaN(a) || math.IsNaN(b) { - return false - } - if math.Signbit(a) != math.Signbit(b) { - return math.Float64bits(math.Abs(a))+math.Float64bits(math.Abs(b)) <= uint64(ulp) - } - return ulpDiff(math.Float64bits(a), math.Float64bits(b)) <= uint64(ulp) -} - -func ulpDiff(a, b uint64) uint64 { - if a > b { - return a - b - } - return b - a -} - -// EqualLengths returns true if all of the slices have equal length, -// and false otherwise. Returns true if there are no input slices. -func EqualLengths(slices ...[]float64) bool { - // This length check is needed: http://play.golang.org/p/sdty6YiLhM - if len(slices) == 0 { - return true - } - l := len(slices[0]) - for i := 1; i < len(slices); i++ { - if len(slices[i]) != l { - return false - } - } - return true -} - -// Find applies f to every element of s and returns the indices of the first -// k elements for which the f returns true, or all such elements -// if k < 0. -// Find will reslice inds to have 0 length, and will append -// found indices to inds. -// If k > 0 and there are fewer than k elements in s satisfying f, -// all of the found elements will be returned along with an error. -// At the return of the function, the input inds will be in an undetermined state. -func Find(inds []int, f func(float64) bool, s []float64, k int) ([]int, error) { - // inds is also returned to allow for calling with nil - - // Reslice inds to have zero length - inds = inds[:0] - - // If zero elements requested, can just return - if k == 0 { - return inds, nil - } - - // If k < 0, return all of the found indices - if k < 0 { - for i, val := range s { - if f(val) { - inds = append(inds, i) - } - } - return inds, nil - } - - // Otherwise, find the first k elements - nFound := 0 - for i, val := range s { - if f(val) { - inds = append(inds, i) - nFound++ - if nFound == k { - return inds, nil - } - } - } - // Finished iterating over the loop, which means k elements were not found - return inds, errors.New("floats: insufficient elements found") -} - -// HasNaN returns true if the slice s has any values that are NaN and false -// otherwise. -func HasNaN(s []float64) bool { - for _, v := range s { - if math.IsNaN(v) { - return true - } - } - return false -} - -// LogSpan returns a set of n equally spaced points in log space between, -// l and u where N is equal to len(dst). The first element of the -// resulting dst will be l and the final element of dst will be u. -// Panics if len(dst) < 2 -// Note that this call will return NaNs if either l or u are negative, and -// will return all zeros if l or u is zero. -// Also returns the mutated slice dst, so that it can be used in range, like: -// -// for i, x := range LogSpan(dst, l, u) { ... } -func LogSpan(dst []float64, l, u float64) []float64 { - Span(dst, math.Log(l), math.Log(u)) - for i := range dst { - dst[i] = math.Exp(dst[i]) - } - return dst -} - -// LogSumExp returns the log of the sum of the exponentials of the values in s. -// Panics if s is an empty slice. -func LogSumExp(s []float64) float64 { - // Want to do this in a numerically stable way which avoids - // overflow and underflow - // First, find the maximum value in the slice. - maxval := Max(s) - if math.IsInf(maxval, 0) { - // If it's infinity either way, the logsumexp will be infinity as well - // returning now avoids NaNs - return maxval - } - var lse float64 - // Compute the sumexp part - for _, val := range s { - lse += math.Exp(val - maxval) - } - // Take the log and add back on the constant taken out - return math.Log(lse) + maxval -} - -// Max returns the maximum value in the input slice. If the slice is empty, Max will panic. -func Max(s []float64) float64 { - return s[MaxIdx(s)] -} - -// MaxIdx returns the index of the maximum value in the input slice. If several -// entries have the maximum value, the first such index is returned. If the slice -// is empty, MaxIdx will panic. -func MaxIdx(s []float64) int { - if len(s) == 0 { - panic("floats: zero slice length") - } - max := math.NaN() - var ind int - for i, v := range s { - if math.IsNaN(v) { - continue - } - if v > max || math.IsNaN(max) { - max = v - ind = i - } - } - return ind -} - -// Min returns the maximum value in the input slice. If the slice is empty, Min will panic. -func Min(s []float64) float64 { - return s[MinIdx(s)] -} - -// MinIdx returns the index of the minimum value in the input slice. If several -// entries have the maximum value, the first such index is returned. If the slice -// is empty, MinIdx will panic. -func MinIdx(s []float64) int { - if len(s) == 0 { - panic("floats: zero slice length") - } - min := math.NaN() - var ind int - for i, v := range s { - if math.IsNaN(v) { - continue - } - if v < min || math.IsNaN(min) { - min = v - ind = i - } - } - return ind -} - -// Mul performs element-wise multiplication between dst -// and s and stores the value in dst. Panics if the -// lengths of s and t are not equal. -func Mul(dst, s []float64) { - if len(dst) != len(s) { - panic("floats: slice lengths do not match") - } - for i, val := range s { - dst[i] *= val - } -} - -// MulTo performs element-wise multiplication between s -// and t and stores the value in dst. Panics if the -// lengths of s, t, and dst are not equal. -func MulTo(dst, s, t []float64) []float64 { - if len(s) != len(t) || len(dst) != len(t) { - panic("floats: slice lengths do not match") - } - for i, val := range t { - dst[i] = val * s[i] - } - return dst -} - -const ( - nanBits = 0x7ff8000000000000 - nanMask = 0xfff8000000000000 -) - -// NaNWith returns an IEEE 754 "quiet not-a-number" value with the -// payload specified in the low 51 bits of payload. -// The NaN returned by math.NaN has a bit pattern equal to NaNWith(1). -func NaNWith(payload uint64) float64 { - return math.Float64frombits(nanBits | (payload &^ nanMask)) -} - -// NaNPayload returns the lowest 51 bits payload of an IEEE 754 "quiet -// not-a-number". For values of f other than quiet-NaN, NaNPayload -// returns zero and false. -func NaNPayload(f float64) (payload uint64, ok bool) { - b := math.Float64bits(f) - if b&nanBits != nanBits { - return 0, false - } - return b &^ nanMask, true -} - -// NearestIdx returns the index of the element in s -// whose value is nearest to v. If several such -// elements exist, the lowest index is returned. -// NearestIdx panics if len(s) == 0. -func NearestIdx(s []float64, v float64) int { - if len(s) == 0 { - panic("floats: zero length slice") - } - switch { - case math.IsNaN(v): - return 0 - case math.IsInf(v, 1): - return MaxIdx(s) - case math.IsInf(v, -1): - return MinIdx(s) - } - var ind int - dist := math.NaN() - for i, val := range s { - newDist := math.Abs(v - val) - // A NaN distance will not be closer. - if math.IsNaN(newDist) { - continue - } - if newDist < dist || math.IsNaN(dist) { - dist = newDist - ind = i - } - } - return ind -} - -// NearestIdxForSpan return the index of a hypothetical vector created -// by Span with length n and bounds l and u whose value is closest -// to v. That is, NearestIdxForSpan(n, l, u, v) is equivalent to -// Nearest(Span(make([]float64, n),l,u),v) without an allocation. -// NearestIdxForSpan panics if n is less than two. -func NearestIdxForSpan(n int, l, u float64, v float64) int { - if n <= 1 { - panic("floats: span must have length >1") - } - if math.IsNaN(v) { - return 0 - } - - // Special cases for Inf and NaN. - switch { - case math.IsNaN(l) && !math.IsNaN(u): - return n - 1 - case math.IsNaN(u): - return 0 - case math.IsInf(l, 0) && math.IsInf(u, 0): - if l == u { - return 0 - } - if n%2 == 1 { - if !math.IsInf(v, 0) { - return n / 2 - } - if math.Copysign(1, v) == math.Copysign(1, l) { - return 0 - } - return n/2 + 1 - } - if math.Copysign(1, v) == math.Copysign(1, l) { - return 0 - } - return n / 2 - case math.IsInf(l, 0): - if v == l { - return 0 - } - return n - 1 - case math.IsInf(u, 0): - if v == u { - return n - 1 - } - return 0 - case math.IsInf(v, -1): - if l <= u { - return 0 - } - return n - 1 - case math.IsInf(v, 1): - if u <= l { - return 0 - } - return n - 1 - } - - // Special cases for v outside (l, u) and (u, l). - switch { - case l < u: - if v <= l { - return 0 - } - if v >= u { - return n - 1 - } - case l > u: - if v >= l { - return 0 - } - if v <= u { - return n - 1 - } - default: - return 0 - } - - // Can't guarantee anything about exactly halfway between - // because of floating point weirdness. - return int((float64(n)-1)/(u-l)*(v-l) + 0.5) -} - -// Norm returns the L norm of the slice S, defined as -// (sum_{i=1}^N s[i]^L)^{1/L} -// Special cases: -// L = math.Inf(1) gives the maximum absolute value. -// Does not correctly compute the zero norm (use Count). -func Norm(s []float64, L float64) float64 { - // Should this complain if L is not positive? - // Should this be done in log space for better numerical stability? - // would be more cost - // maybe only if L is high? - if len(s) == 0 { - return 0 - } - if L == 2 { - return f64.L2NormUnitary(s) - } - var norm float64 - if L == 1 { - for _, val := range s { - norm += math.Abs(val) - } - return norm - } - if math.IsInf(L, 1) { - for _, val := range s { - norm = math.Max(norm, math.Abs(val)) - } - return norm - } - for _, val := range s { - norm += math.Pow(math.Abs(val), L) - } - return math.Pow(norm, 1/L) -} - -// ParseWithNA converts the string s to a float64 in v. -// If s equals missing, w is returned as 0, otherwise 1. -func ParseWithNA(s, missing string) (v, w float64, err error) { - if s == missing { - return 0, 0, nil - } - v, err = strconv.ParseFloat(s, 64) - if err == nil { - w = 1 - } - return v, w, err -} - -// Prod returns the product of the elements of the slice. -// Returns 1 if len(s) = 0. -func Prod(s []float64) float64 { - prod := 1.0 - for _, val := range s { - prod *= val - } - return prod -} - -// Reverse reverses the order of elements in the slice. -func Reverse(s []float64) { - for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 { - s[i], s[j] = s[j], s[i] - } -} - -// Round returns the half away from zero rounded value of x with prec precision. -// -// Special cases are: -// Round(±0) = +0 -// Round(±Inf) = ±Inf -// Round(NaN) = NaN -func Round(x float64, prec int) float64 { - if x == 0 { - // Make sure zero is returned - // without the negative bit set. - return 0 - } - // Fast path for positive precision on integers. - if prec >= 0 && x == math.Trunc(x) { - return x - } - pow := math.Pow10(prec) - intermed := x * pow - if math.IsInf(intermed, 0) { - return x - } - if x < 0 { - x = math.Ceil(intermed - 0.5) - } else { - x = math.Floor(intermed + 0.5) - } - - if x == 0 { - return 0 - } - - return x / pow -} - -// RoundEven returns the half even rounded value of x with prec precision. -// -// Special cases are: -// RoundEven(±0) = +0 -// RoundEven(±Inf) = ±Inf -// RoundEven(NaN) = NaN -func RoundEven(x float64, prec int) float64 { - if x == 0 { - // Make sure zero is returned - // without the negative bit set. - return 0 - } - // Fast path for positive precision on integers. - if prec >= 0 && x == math.Trunc(x) { - return x - } - pow := math.Pow10(prec) - intermed := x * pow - if math.IsInf(intermed, 0) { - return x - } - if isHalfway(intermed) { - correction, _ := math.Modf(math.Mod(intermed, 2)) - intermed += correction - if intermed > 0 { - x = math.Floor(intermed) - } else { - x = math.Ceil(intermed) - } - } else { - if x < 0 { - x = math.Ceil(intermed - 0.5) - } else { - x = math.Floor(intermed + 0.5) - } - } - - if x == 0 { - return 0 - } - - return x / pow -} - -func isHalfway(x float64) bool { - _, frac := math.Modf(x) - frac = math.Abs(frac) - return frac == 0.5 || (math.Nextafter(frac, math.Inf(-1)) < 0.5 && math.Nextafter(frac, math.Inf(1)) > 0.5) -} - -// Same returns true if the input slices have the same length and the all elements -// have the same value with NaN treated as the same. -func Same(s, t []float64) bool { - if len(s) != len(t) { - return false - } - for i, v := range s { - w := t[i] - if v != w && !(math.IsNaN(v) && math.IsNaN(w)) { - return false - } - } - return true -} - -// Scale multiplies every element in dst by the scalar c. -func Scale(c float64, dst []float64) { - if len(dst) > 0 { - f64.ScalUnitary(c, dst) - } -} - -// ScaleTo multiplies the elements in s by c and stores the result in dst. -func ScaleTo(dst []float64, c float64, s []float64) []float64 { - if len(dst) != len(s) { - panic("floats: lengths of slices do not match") - } - if len(dst) > 0 { - f64.ScalUnitaryTo(dst, c, s) - } - return dst -} - -// Span returns a set of N equally spaced points between l and u, where N -// is equal to the length of the destination. The first element of the destination -// is l, the final element of the destination is u. -// -// Panics if len(dst) < 2. -// -// Span also returns the mutated slice dst, so that it can be used in range expressions, -// like: -// -// for i, x := range Span(dst, l, u) { ... } -func Span(dst []float64, l, u float64) []float64 { - n := len(dst) - if n < 2 { - panic("floats: destination must have length >1") - } - - // Special cases for Inf and NaN. - switch { - case math.IsNaN(l): - for i := range dst[:len(dst)-1] { - dst[i] = math.NaN() - } - dst[len(dst)-1] = u - return dst - case math.IsNaN(u): - for i := range dst[1:] { - dst[i+1] = math.NaN() - } - dst[0] = l - return dst - case math.IsInf(l, 0) && math.IsInf(u, 0): - for i := range dst[:len(dst)/2] { - dst[i] = l - dst[len(dst)-i-1] = u - } - if len(dst)%2 == 1 { - if l != u { - dst[len(dst)/2] = 0 - } else { - dst[len(dst)/2] = l - } - } - return dst - case math.IsInf(l, 0): - for i := range dst[:len(dst)-1] { - dst[i] = l - } - dst[len(dst)-1] = u - return dst - case math.IsInf(u, 0): - for i := range dst[1:] { - dst[i+1] = u - } - dst[0] = l - return dst - } - - step := (u - l) / float64(n-1) - for i := range dst { - dst[i] = l + step*float64(i) - } - return dst -} - -// Sub subtracts, element-wise, the elements of s from dst. Panics if -// the lengths of dst and s do not match. -func Sub(dst, s []float64) { - if len(dst) != len(s) { - panic("floats: length of the slices do not match") - } - f64.AxpyUnitaryTo(dst, -1, s, dst) -} - -// SubTo subtracts, element-wise, the elements of t from s and -// stores the result in dst. Panics if the lengths of s, t and dst do not match. -func SubTo(dst, s, t []float64) []float64 { - if len(s) != len(t) { - panic("floats: length of subtractor and subtractee do not match") - } - if len(dst) != len(s) { - panic("floats: length of destination does not match length of subtractor") - } - f64.AxpyUnitaryTo(dst, -1, t, s) - return dst -} - -// Sum returns the sum of the elements of the slice. -func Sum(s []float64) float64 { - return f64.Sum(s) -} - -// Within returns the first index i where s[i] <= v < s[i+1]. Within panics if: -// - len(s) < 2 -// - s is not sorted -func Within(s []float64, v float64) int { - if len(s) < 2 { - panic("floats: slice length less than 2") - } - if !sort.Float64sAreSorted(s) { - panic("floats: input slice not sorted") - } - if v < s[0] || v >= s[len(s)-1] || math.IsNaN(v) { - return -1 - } - for i, f := range s[1:] { - if v < f { - return i - } - } - return -1 -} diff --git a/vendor/gonum.org/v1/gonum/graph/.gitignore b/vendor/gonum.org/v1/gonum/graph/.gitignore deleted file mode 100644 index 86e0d24..0000000 --- a/vendor/gonum.org/v1/gonum/graph/.gitignore +++ /dev/null @@ -1 +0,0 @@ -test.out \ No newline at end of file diff --git a/vendor/gonum.org/v1/gonum/graph/README.md b/vendor/gonum.org/v1/gonum/graph/README.md deleted file mode 100644 index f0a9505..0000000 --- a/vendor/gonum.org/v1/gonum/graph/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Gonum graph [![GoDoc](https://godoc.org/gonum.org/v1/gonum/graph?status.svg)](https://godoc.org/gonum.org/v1/gonum/graph) - -This is a generalized graph package for the Go language. diff --git a/vendor/gonum.org/v1/gonum/graph/complement.go b/vendor/gonum.org/v1/gonum/graph/complement.go deleted file mode 100644 index 2591f3a..0000000 --- a/vendor/gonum.org/v1/gonum/graph/complement.go +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright ©2019 The Gonum 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 graph - -// Complement provides the complement of a graph. The complement will not include -// self-edges, and edges within the complement will not hold any information other -// than the nodes in the original graph and the connection topology. Nodes returned -// by the Complement directly or via queries to returned Edges will be those stored -// in the original graph. -type Complement struct { - Graph -} - -// Edge returns the edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -func (g Complement) Edge(uid, vid int64) Edge { - if g.Graph.Edge(uid, vid) != nil || uid == vid { - return nil - } - u := g.Node(uid) - v := g.Node(vid) - if u == nil || v == nil { - return nil - } - return shadow{F: u, T: v} -} - -// From returns all nodes in g that can be reached directly from u in -// the complement. -func (g Complement) From(uid int64) Nodes { - if g.Node(uid) == nil { - return Empty - } - // At this point, we guarantee that g.Graph.From(uid) returns a set of - // nodes in g.Nodes(), and that uid corresponds to a node in g.Nodes(). - return newNodeFilterIterator(g.Nodes(), g.Graph.From(uid), uid) -} - -// HasEdgeBetween returns whether an edge exists between nodes x and y. -func (g Complement) HasEdgeBetween(xid, yid int64) bool { - return xid != yid && - g.Node(xid) != nil && g.Node(yid) != nil && - !g.Graph.HasEdgeBetween(xid, yid) -} - -// shadow is an edge that is not exposed to the user. -type shadow struct{ F, T Node } - -func (e shadow) From() Node { return e.F } -func (e shadow) To() Node { return e.T } -func (e shadow) ReversedEdge() Edge { return shadow{F: e.T, T: e.F} } - -// nodeFilterIterator combines Nodes to produce a single stream of -// filtered nodes. -type nodeFilterIterator struct { - src Nodes - - // filter indicates the node in n with the key ID should be filtered out. - filter map[int64]bool -} - -// newNodeFilterIterator returns a new nodeFilterIterator. The nodes in filter and -// the nodes corresponding the root node ID must be in the src set of nodes. This -// invariant is not checked. -func newNodeFilterIterator(src, filter Nodes, root int64) *nodeFilterIterator { - n := nodeFilterIterator{src: src, filter: map[int64]bool{root: true}} - for filter.Next() { - n.filter[filter.Node().ID()] = true - } - filter.Reset() - n.src.Reset() - return &n -} - -func (n *nodeFilterIterator) Len() int { - return n.src.Len() - len(n.filter) -} - -func (n *nodeFilterIterator) Next() bool { - for n.src.Next() { - if !n.filter[n.src.Node().ID()] { - return true - } - } - return false -} - -func (n *nodeFilterIterator) Node() Node { - return n.src.Node() -} - -func (n *nodeFilterIterator) Reset() { - n.src.Reset() -} diff --git a/vendor/gonum.org/v1/gonum/graph/doc.go b/vendor/gonum.org/v1/gonum/graph/doc.go deleted file mode 100644 index 7eedd09..0000000 --- a/vendor/gonum.org/v1/gonum/graph/doc.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright ©2014 The Gonum 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 graph defines graph interfaces. -// -// Routines to test contract compliance by user implemented graph types -// are available in gonum.org/v1/gonum/graph/testgraph. -package graph // import "gonum.org/v1/gonum/graph" diff --git a/vendor/gonum.org/v1/gonum/graph/formats/cytoscapejs/testdata/LICENSE b/vendor/gonum.org/v1/gonum/graph/formats/cytoscapejs/testdata/LICENSE deleted file mode 100644 index 9e21a7e..0000000 --- a/vendor/gonum.org/v1/gonum/graph/formats/cytoscapejs/testdata/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - - -Copyright (c) 2016-2018, The Cytoscape Consortium. - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the “Software”), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/vendor/gonum.org/v1/gonum/graph/formats/sigmajs/testdata/LICENSE.txt b/vendor/gonum.org/v1/gonum/graph/formats/sigmajs/testdata/LICENSE.txt deleted file mode 100644 index 81739df..0000000 --- a/vendor/gonum.org/v1/gonum/graph/formats/sigmajs/testdata/LICENSE.txt +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (C) 2013-2014, Alexis Jacomy, http://sigmajs.org - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. diff --git a/vendor/gonum.org/v1/gonum/graph/graph.go b/vendor/gonum.org/v1/gonum/graph/graph.go deleted file mode 100644 index c973583..0000000 --- a/vendor/gonum.org/v1/gonum/graph/graph.go +++ /dev/null @@ -1,282 +0,0 @@ -// Copyright ©2014 The Gonum 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 graph - -// Node is a graph node. It returns a graph-unique integer ID. -type Node interface { - ID() int64 -} - -// Edge is a graph edge. In directed graphs, the direction of the -// edge is given from -> to, otherwise the edge is semantically -// unordered. -type Edge interface { - // From returns the from node of the edge. - From() Node - - // To returns the to node of the edge. - To() Node - - // ReversedEdge returns an edge that has - // the end points of the receiver swapped. - ReversedEdge() Edge -} - -// WeightedEdge is a weighted graph edge. In directed graphs, the direction -// of the edge is given from -> to, otherwise the edge is semantically -// unordered. -type WeightedEdge interface { - Edge - Weight() float64 -} - -// Graph is a generalized graph. -type Graph interface { - // Node returns the node with the given ID if it exists - // in the graph, and nil otherwise. - Node(id int64) Node - - // Nodes returns all the nodes in the graph. - // - // Nodes must not return nil. - Nodes() Nodes - - // From returns all nodes that can be reached directly - // from the node with the given ID. - // - // From must not return nil. - From(id int64) Nodes - - // HasEdgeBetween returns whether an edge exists between - // nodes with IDs xid and yid without considering direction. - HasEdgeBetween(xid, yid int64) bool - - // Edge returns the edge from u to v, with IDs uid and vid, - // if such an edge exists and nil otherwise. The node v - // must be directly reachable from u as defined by the - // From method. - Edge(uid, vid int64) Edge -} - -// Weighted is a weighted graph. -type Weighted interface { - Graph - - // WeightedEdge returns the weighted edge from u to v - // with IDs uid and vid if such an edge exists and - // nil otherwise. The node v must be directly - // reachable from u as defined by the From method. - WeightedEdge(uid, vid int64) WeightedEdge - - // Weight returns the weight for the edge between - // x and y with IDs xid and yid if Edge(xid, yid) - // returns a non-nil Edge. - // If x and y are the same node or there is no - // joining edge between the two nodes the weight - // value returned is implementation dependent. - // Weight returns true if an edge exists between - // x and y or if x and y have the same ID, false - // otherwise. - Weight(xid, yid int64) (w float64, ok bool) -} - -// Undirected is an undirected graph. -type Undirected interface { - Graph - - // EdgeBetween returns the edge between nodes x and y - // with IDs xid and yid. - EdgeBetween(xid, yid int64) Edge -} - -// WeightedUndirected is a weighted undirected graph. -type WeightedUndirected interface { - Weighted - - // WeightedEdgeBetween returns the edge between nodes - // x and y with IDs xid and yid. - WeightedEdgeBetween(xid, yid int64) WeightedEdge -} - -// Directed is a directed graph. -type Directed interface { - Graph - - // HasEdgeFromTo returns whether an edge exists - // in the graph from u to v with IDs uid and vid. - HasEdgeFromTo(uid, vid int64) bool - - // To returns all nodes that can reach directly - // to the node with the given ID. - // - // To must not return nil. - To(id int64) Nodes -} - -// WeightedDirected is a weighted directed graph. -type WeightedDirected interface { - Weighted - - // HasEdgeFromTo returns whether an edge exists - // in the graph from u to v with the IDs uid and - // vid. - HasEdgeFromTo(uid, vid int64) bool - - // To returns all nodes that can reach directly - // to the node with the given ID. - // - // To must not return nil. - To(id int64) Nodes -} - -// NodeAdder is an interface for adding arbitrary nodes to a graph. -type NodeAdder interface { - // NewNode returns a new Node with a unique - // arbitrary ID. - NewNode() Node - - // AddNode adds a node to the graph. AddNode panics if - // the added node ID matches an existing node ID. - AddNode(Node) -} - -// NodeRemover is an interface for removing nodes from a graph. -type NodeRemover interface { - // RemoveNode removes the node with the given ID - // from the graph, as well as any edges attached - // to it. If the node is not in the graph it is - // a no-op. - RemoveNode(id int64) -} - -// EdgeAdder is an interface for adding edges to a graph. -type EdgeAdder interface { - // NewEdge returns a new Edge from the source to the destination node. - NewEdge(from, to Node) Edge - - // SetEdge adds an edge from one node to another. - // If the graph supports node addition the nodes - // will be added if they do not exist, otherwise - // SetEdge will panic. - // The behavior of an EdgeAdder when the IDs - // returned by e.From() and e.To() are equal is - // implementation-dependent. - // Whether e, e.From() and e.To() are stored - // within the graph is implementation dependent. - SetEdge(e Edge) -} - -// WeightedEdgeAdder is an interface for adding edges to a graph. -type WeightedEdgeAdder interface { - // NewWeightedEdge returns a new WeightedEdge from - // the source to the destination node. - NewWeightedEdge(from, to Node, weight float64) WeightedEdge - - // SetWeightedEdge adds an edge from one node to - // another. If the graph supports node addition - // the nodes will be added if they do not exist, - // otherwise SetWeightedEdge will panic. - // The behavior of a WeightedEdgeAdder when the IDs - // returned by e.From() and e.To() are equal is - // implementation-dependent. - // Whether e, e.From() and e.To() are stored - // within the graph is implementation dependent. - SetWeightedEdge(e WeightedEdge) -} - -// EdgeRemover is an interface for removing nodes from a graph. -type EdgeRemover interface { - // RemoveEdge removes the edge with the given end - // IDs, leaving the terminal nodes. If the edge - // does not exist it is a no-op. - RemoveEdge(fid, tid int64) -} - -// Builder is a graph that can have nodes and edges added. -type Builder interface { - NodeAdder - EdgeAdder -} - -// WeightedBuilder is a graph that can have nodes and weighted edges added. -type WeightedBuilder interface { - NodeAdder - WeightedEdgeAdder -} - -// UndirectedBuilder is an undirected graph builder. -type UndirectedBuilder interface { - Undirected - Builder -} - -// UndirectedWeightedBuilder is an undirected weighted graph builder. -type UndirectedWeightedBuilder interface { - Undirected - WeightedBuilder -} - -// DirectedBuilder is a directed graph builder. -type DirectedBuilder interface { - Directed - Builder -} - -// DirectedWeightedBuilder is a directed weighted graph builder. -type DirectedWeightedBuilder interface { - Directed - WeightedBuilder -} - -// Copy copies nodes and edges as undirected edges from the source to the destination -// without first clearing the destination. Copy will panic if a node ID in the source -// graph matches a node ID in the destination. -// -// If the source is undirected and the destination is directed both directions will -// be present in the destination after the copy is complete. -func Copy(dst Builder, src Graph) { - nodes := src.Nodes() - for nodes.Next() { - dst.AddNode(nodes.Node()) - } - nodes.Reset() - for nodes.Next() { - u := nodes.Node() - uid := u.ID() - to := src.From(uid) - for to.Next() { - v := to.Node() - dst.SetEdge(src.Edge(uid, v.ID())) - } - } -} - -// CopyWeighted copies nodes and edges as undirected edges from the source to the destination -// without first clearing the destination. Copy will panic if a node ID in the source -// graph matches a node ID in the destination. -// -// If the source is undirected and the destination is directed both directions will -// be present in the destination after the copy is complete. -// -// If the source is a directed graph, the destination is undirected, and a fundamental -// cycle exists with two nodes where the edge weights differ, the resulting destination -// graph's edge weight between those nodes is undefined. If there is a defined function -// to resolve such conflicts, an UndirectWeighted may be used to do this. -func CopyWeighted(dst WeightedBuilder, src Weighted) { - nodes := src.Nodes() - for nodes.Next() { - dst.AddNode(nodes.Node()) - } - nodes.Reset() - for nodes.Next() { - u := nodes.Node() - uid := u.ID() - to := src.From(uid) - for to.Next() { - v := to.Node() - dst.SetWeightedEdge(src.WeightedEdge(uid, v.ID())) - } - } -} diff --git a/vendor/gonum.org/v1/gonum/graph/internal/linear/doc.go b/vendor/gonum.org/v1/gonum/graph/internal/linear/doc.go deleted file mode 100644 index 88d1cb8..0000000 --- a/vendor/gonum.org/v1/gonum/graph/internal/linear/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright ©2017 The Gonum 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 linear provides common linear data structures. -package linear // import "gonum.org/v1/gonum/graph/internal/linear" diff --git a/vendor/gonum.org/v1/gonum/graph/internal/linear/linear.go b/vendor/gonum.org/v1/gonum/graph/internal/linear/linear.go deleted file mode 100644 index 62e19db..0000000 --- a/vendor/gonum.org/v1/gonum/graph/internal/linear/linear.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright ©2015 The Gonum 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 linear - -import ( - "gonum.org/v1/gonum/graph" -) - -// NodeStack implements a LIFO stack of graph.Node. -type NodeStack []graph.Node - -// Len returns the number of graph.Nodes on the stack. -func (s *NodeStack) Len() int { return len(*s) } - -// Pop returns the last graph.Node on the stack and removes it -// from the stack. -func (s *NodeStack) Pop() graph.Node { - v := *s - v, n := v[:len(v)-1], v[len(v)-1] - *s = v - return n -} - -// Push adds the node n to the stack at the last position. -func (s *NodeStack) Push(n graph.Node) { *s = append(*s, n) } - -// NodeQueue implements a FIFO queue. -type NodeQueue struct { - head int - data []graph.Node -} - -// Len returns the number of graph.Nodes in the queue. -func (q *NodeQueue) Len() int { return len(q.data) - q.head } - -// Enqueue adds the node n to the back of the queue. -func (q *NodeQueue) Enqueue(n graph.Node) { - if len(q.data) == cap(q.data) && q.head > 0 { - l := q.Len() - copy(q.data, q.data[q.head:]) - q.head = 0 - q.data = append(q.data[:l], n) - } else { - q.data = append(q.data, n) - } -} - -// Dequeue returns the graph.Node at the front of the queue and -// removes it from the queue. -func (q *NodeQueue) Dequeue() graph.Node { - if q.Len() == 0 { - panic("queue: empty queue") - } - - var n graph.Node - n, q.data[q.head] = q.data[q.head], nil - q.head++ - - if q.Len() == 0 { - q.head = 0 - q.data = q.data[:0] - } - - return n -} - -// Reset clears the queue for reuse. -func (q *NodeQueue) Reset() { - q.head = 0 - q.data = q.data[:0] -} diff --git a/vendor/gonum.org/v1/gonum/graph/internal/ordered/doc.go b/vendor/gonum.org/v1/gonum/graph/internal/ordered/doc.go deleted file mode 100644 index 563df6f..0000000 --- a/vendor/gonum.org/v1/gonum/graph/internal/ordered/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright ©2017 The Gonum 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 ordered provides common sort ordering types. -package ordered // import "gonum.org/v1/gonum/graph/internal/ordered" diff --git a/vendor/gonum.org/v1/gonum/graph/internal/ordered/sort.go b/vendor/gonum.org/v1/gonum/graph/internal/ordered/sort.go deleted file mode 100644 index a7250d1..0000000 --- a/vendor/gonum.org/v1/gonum/graph/internal/ordered/sort.go +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright ©2015 The Gonum 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 ordered - -import "gonum.org/v1/gonum/graph" - -// ByID implements the sort.Interface sorting a slice of graph.Node -// by ID. -type ByID []graph.Node - -func (n ByID) Len() int { return len(n) } -func (n ByID) Less(i, j int) bool { return n[i].ID() < n[j].ID() } -func (n ByID) Swap(i, j int) { n[i], n[j] = n[j], n[i] } - -// BySliceValues implements the sort.Interface sorting a slice of -// []int64 lexically by the values of the []int64. -type BySliceValues [][]int64 - -func (c BySliceValues) Len() int { return len(c) } -func (c BySliceValues) Less(i, j int) bool { - a, b := c[i], c[j] - l := len(a) - if len(b) < l { - l = len(b) - } - for k, v := range a[:l] { - if v < b[k] { - return true - } - if v > b[k] { - return false - } - } - return len(a) < len(b) -} -func (c BySliceValues) Swap(i, j int) { c[i], c[j] = c[j], c[i] } - -// BySliceIDs implements the sort.Interface sorting a slice of -// []graph.Node lexically by the IDs of the []graph.Node. -type BySliceIDs [][]graph.Node - -func (c BySliceIDs) Len() int { return len(c) } -func (c BySliceIDs) Less(i, j int) bool { - a, b := c[i], c[j] - l := len(a) - if len(b) < l { - l = len(b) - } - for k, v := range a[:l] { - if v.ID() < b[k].ID() { - return true - } - if v.ID() > b[k].ID() { - return false - } - } - return len(a) < len(b) -} -func (c BySliceIDs) Swap(i, j int) { c[i], c[j] = c[j], c[i] } - -// Int64s implements the sort.Interface sorting a slice of -// int64. -type Int64s []int64 - -func (s Int64s) Len() int { return len(s) } -func (s Int64s) Less(i, j int) bool { return s[i] < s[j] } -func (s Int64s) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -// Reverse reverses the order of nodes. -func Reverse(nodes []graph.Node) { - for i, j := 0, len(nodes)-1; i < j; i, j = i+1, j-1 { - nodes[i], nodes[j] = nodes[j], nodes[i] - } -} - -// LinesByIDs implements the sort.Interface sorting a slice of graph.LinesByIDs -// lexically by the From IDs, then by the To IDs, finally by the Line IDs. -type LinesByIDs []graph.Line - -func (n LinesByIDs) Len() int { return len(n) } -func (n LinesByIDs) Less(i, j int) bool { - a, b := n[i], n[j] - if a.From().ID() != b.From().ID() { - return a.From().ID() < b.From().ID() - } - if a.To().ID() != b.To().ID() { - return a.To().ID() < b.To().ID() - } - return n[i].ID() < n[j].ID() -} -func (n LinesByIDs) Swap(i, j int) { n[i], n[j] = n[j], n[i] } diff --git a/vendor/gonum.org/v1/gonum/graph/internal/set/doc.go b/vendor/gonum.org/v1/gonum/graph/internal/set/doc.go deleted file mode 100644 index 86f2afc..0000000 --- a/vendor/gonum.org/v1/gonum/graph/internal/set/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright ©2017 The Gonum 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 set provides integer and graph.Node sets. -package set // import "gonum.org/v1/gonum/graph/internal/set" diff --git a/vendor/gonum.org/v1/gonum/graph/internal/set/same.go b/vendor/gonum.org/v1/gonum/graph/internal/set/same.go deleted file mode 100644 index f95a4e1..0000000 --- a/vendor/gonum.org/v1/gonum/graph/internal/set/same.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !appengine,!safe - -package set - -import "unsafe" - -// same determines whether two sets are backed by the same store. In the -// current implementation using hash maps it makes use of the fact that -// hash maps are passed as a pointer to a runtime Hmap struct. A map is -// not seen by the runtime as a pointer though, so we use unsafe to get -// the maps' pointer values to compare. -func same(a, b Nodes) bool { - return *(*uintptr)(unsafe.Pointer(&a)) == *(*uintptr)(unsafe.Pointer(&b)) -} - -// intsSame determines whether two sets are backed by the same store. In the -// current implementation using hash maps it makes use of the fact that -// hash maps are passed as a pointer to a runtime Hmap struct. A map is -// not seen by the runtime as a pointer though, so we use unsafe to get -// the maps' pointer values to compare. -func intsSame(a, b Ints) bool { - return *(*uintptr)(unsafe.Pointer(&a)) == *(*uintptr)(unsafe.Pointer(&b)) -} - -// int64sSame determines whether two sets are backed by the same store. In the -// current implementation using hash maps it makes use of the fact that -// hash maps are passed as a pointer to a runtime Hmap struct. A map is -// not seen by the runtime as a pointer though, so we use unsafe to get -// the maps' pointer values to compare. -func int64sSame(a, b Int64s) bool { - return *(*uintptr)(unsafe.Pointer(&a)) == *(*uintptr)(unsafe.Pointer(&b)) -} diff --git a/vendor/gonum.org/v1/gonum/graph/internal/set/same_appengine.go b/vendor/gonum.org/v1/gonum/graph/internal/set/same_appengine.go deleted file mode 100644 index 4ff4f4e..0000000 --- a/vendor/gonum.org/v1/gonum/graph/internal/set/same_appengine.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build appengine safe - -package set - -import "reflect" - -// same determines whether two sets are backed by the same store. In the -// current implementation using hash maps it makes use of the fact that -// hash maps are passed as a pointer to a runtime Hmap struct. A map is -// not seen by the runtime as a pointer though, so we use reflect to get -// the maps' pointer values to compare. -func same(a, b Nodes) bool { - return reflect.ValueOf(a).Pointer() == reflect.ValueOf(b).Pointer() -} - -// intsSame determines whether two sets are backed by the same store. In the -// current implementation using hash maps it makes use of the fact that -// hash maps are passed as a pointer to a runtime Hmap struct. A map is -// not seen by the runtime as a pointer though, so we use reflect to get -// the maps' pointer values to compare. -func intsSame(a, b Ints) bool { - return reflect.ValueOf(a).Pointer() == reflect.ValueOf(b).Pointer() -} - -// int64sSame determines whether two sets are backed by the same store. In the -// current implementation using hash maps it makes use of the fact that -// hash maps are passed as a pointer to a runtime Hmap struct. A map is -// not seen by the runtime as a pointer though, so we use reflect to get -// the maps' pointer values to compare. -func int64sSame(a, b Int64s) bool { - return reflect.ValueOf(a).Pointer() == reflect.ValueOf(b).Pointer() -} diff --git a/vendor/gonum.org/v1/gonum/graph/internal/set/set.go b/vendor/gonum.org/v1/gonum/graph/internal/set/set.go deleted file mode 100644 index 0506b8e..0000000 --- a/vendor/gonum.org/v1/gonum/graph/internal/set/set.go +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright ©2014 The Gonum 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 set - -import "gonum.org/v1/gonum/graph" - -// Ints is a set of int identifiers. -type Ints map[int]struct{} - -// The simple accessor methods for Ints are provided to allow ease of -// implementation change should the need arise. - -// Add inserts an element into the set. -func (s Ints) Add(e int) { - s[e] = struct{}{} -} - -// Has reports the existence of the element in the set. -func (s Ints) Has(e int) bool { - _, ok := s[e] - return ok -} - -// Remove deletes the specified element from the set. -func (s Ints) Remove(e int) { - delete(s, e) -} - -// Count reports the number of elements stored in the set. -func (s Ints) Count() int { - return len(s) -} - -// IntsEqual reports set equality between the parameters. Sets are equal if -// and only if they have the same elements. -func IntsEqual(a, b Ints) bool { - if intsSame(a, b) { - return true - } - - if len(a) != len(b) { - return false - } - - for e := range a { - if _, ok := b[e]; !ok { - return false - } - } - - return true -} - -// Int64s is a set of int64 identifiers. -type Int64s map[int64]struct{} - -// The simple accessor methods for Ints are provided to allow ease of -// implementation change should the need arise. - -// Add inserts an element into the set. -func (s Int64s) Add(e int64) { - s[e] = struct{}{} -} - -// Has reports the existence of the element in the set. -func (s Int64s) Has(e int64) bool { - _, ok := s[e] - return ok -} - -// Remove deletes the specified element from the set. -func (s Int64s) Remove(e int64) { - delete(s, e) -} - -// Count reports the number of elements stored in the set. -func (s Int64s) Count() int { - return len(s) -} - -// Int64sEqual reports set equality between the parameters. Sets are equal if -// and only if they have the same elements. -func Int64sEqual(a, b Int64s) bool { - if int64sSame(a, b) { - return true - } - - if len(a) != len(b) { - return false - } - - for e := range a { - if _, ok := b[e]; !ok { - return false - } - } - - return true -} - -// Nodes is a set of nodes keyed in their integer identifiers. -type Nodes map[int64]graph.Node - -// NewNodes returns a new Nodes. -func NewNodes() Nodes { - return make(Nodes) -} - -// NewNodes returns a new Nodes with the given size hint, n. -func NewNodesSize(n int) Nodes { - return make(Nodes, n) -} - -// The simple accessor methods for Nodes are provided to allow ease of -// implementation change should the need arise. - -// Add inserts an element into the set. -func (s Nodes) Add(n graph.Node) { - s[n.ID()] = n -} - -// Remove deletes the specified element from the set. -func (s Nodes) Remove(e graph.Node) { - delete(s, e.ID()) -} - -// Count returns the number of element in the set. -func (s Nodes) Count() int { - return len(s) -} - -// Has reports the existence of the elements in the set. -func (s Nodes) Has(n graph.Node) bool { - _, ok := s[n.ID()] - return ok -} - -// CloneNodes returns a clone of src. -func CloneNodes(src Nodes) Nodes { - dst := make(Nodes, len(src)) - for e, n := range src { - dst[e] = n - } - return dst -} - -// Equal reports set equality between the parameters. Sets are equal if -// and only if they have the same elements. -func Equal(a, b Nodes) bool { - if same(a, b) { - return true - } - - if len(a) != len(b) { - return false - } - - for e := range a { - if _, ok := b[e]; !ok { - return false - } - } - - return true -} - -// UnionOfNodes returns the union of a and b. -// -// The union of two sets, a and b, is the set containing all the -// elements of each, for instance: -// -// {a,b,c} UNION {d,e,f} = {a,b,c,d,e,f} -// -// Since sets may not have repetition, unions of two sets that overlap -// do not contain repeat elements, that is: -// -// {a,b,c} UNION {b,c,d} = {a,b,c,d} -// -func UnionOfNodes(a, b Nodes) Nodes { - if same(a, b) { - return CloneNodes(a) - } - - dst := make(Nodes) - for e, n := range a { - dst[e] = n - } - for e, n := range b { - dst[e] = n - } - - return dst -} - -// IntersectionOfNodes returns the intersection of a and b. -// -// The intersection of two sets, a and b, is the set containing all -// the elements shared between the two sets, for instance: -// -// {a,b,c} INTERSECT {b,c,d} = {b,c} -// -// The intersection between a set and itself is itself, and thus -// effectively a copy operation: -// -// {a,b,c} INTERSECT {a,b,c} = {a,b,c} -// -// The intersection between two sets that share no elements is the empty -// set: -// -// {a,b,c} INTERSECT {d,e,f} = {} -// -func IntersectionOfNodes(a, b Nodes) Nodes { - if same(a, b) { - return CloneNodes(a) - } - dst := make(Nodes) - if len(a) > len(b) { - a, b = b, a - } - for e, n := range a { - if _, ok := b[e]; ok { - dst[e] = n - } - } - return dst -} diff --git a/vendor/gonum.org/v1/gonum/graph/internal/uid/uid.go b/vendor/gonum.org/v1/gonum/graph/internal/uid/uid.go deleted file mode 100644 index 5f503c1..0000000 --- a/vendor/gonum.org/v1/gonum/graph/internal/uid/uid.go +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright ©2014 The Gonum 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 uid implements unique ID provision for graphs. -package uid - -import "gonum.org/v1/gonum/graph/internal/set" - -// Max is the maximum value of int64. -const Max = int64(^uint64(0) >> 1) - -// Set implements available ID storage. -type Set struct { - maxID int64 - used, free set.Int64s -} - -// NewSet returns a new Set. The returned value should not be passed except by pointer. -func NewSet() Set { - return Set{maxID: -1, used: make(set.Int64s), free: make(set.Int64s)} -} - -// NewID returns a new unique ID. The ID returned is not considered used -// until passed in a call to use. -func (s *Set) NewID() int64 { - for id := range s.free { - return id - } - if s.maxID != Max { - return s.maxID + 1 - } - for id := int64(0); id <= s.maxID+1; id++ { - if !s.used.Has(id) { - return id - } - } - panic("unreachable") -} - -// Use adds the id to the used IDs in the Set. -func (s *Set) Use(id int64) { - s.used.Add(id) - s.free.Remove(id) - if id > s.maxID { - s.maxID = id - } -} - -// Release frees the id for reuse. -func (s *Set) Release(id int64) { - s.free.Add(id) - s.used.Remove(id) -} diff --git a/vendor/gonum.org/v1/gonum/graph/iterator/doc.go b/vendor/gonum.org/v1/gonum/graph/iterator/doc.go deleted file mode 100644 index 0983bc7..0000000 --- a/vendor/gonum.org/v1/gonum/graph/iterator/doc.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright ©2018 The Gonum 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 iterator provides node, edge and line iterators. -// -// The iterators provided satisfy the graph.Nodes, graph.Edges and -// graph.Lines interfaces. -package iterator diff --git a/vendor/gonum.org/v1/gonum/graph/iterator/edges.go b/vendor/gonum.org/v1/gonum/graph/iterator/edges.go deleted file mode 100644 index 21ef043..0000000 --- a/vendor/gonum.org/v1/gonum/graph/iterator/edges.go +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright ©2018 The Gonum 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 iterator - -import "gonum.org/v1/gonum/graph" - -// OrderedEdges implements the graph.Edges and graph.EdgeSlicer interfaces. -// The iteration order of OrderedEdges is the order of edges passed to -// NewEdgeIterator. -type OrderedEdges struct { - idx int - edges []graph.Edge -} - -// NewOrderedEdges returns an OrderedEdges initialized with the provided edges. -func NewOrderedEdges(edges []graph.Edge) *OrderedEdges { - return &OrderedEdges{idx: -1, edges: edges} -} - -// Len returns the remaining number of edges to be iterated over. -func (e *OrderedEdges) Len() int { - if e.idx >= len(e.edges) { - return 0 - } - if e.idx <= 0 { - return len(e.edges) - } - return len(e.edges[e.idx:]) -} - -// Next returns whether the next call of Edge will return a valid edge. -func (e *OrderedEdges) Next() bool { - if uint(e.idx)+1 < uint(len(e.edges)) { - e.idx++ - return true - } - e.idx = len(e.edges) - return false -} - -// Edge returns the current edge of the iterator. Next must have been -// called prior to a call to Edge. -func (e *OrderedEdges) Edge() graph.Edge { - if e.idx >= len(e.edges) || e.idx < 0 { - return nil - } - return e.edges[e.idx] -} - -// EdgeSlice returns all the remaining edges in the iterator and advances -// the iterator. -func (e *OrderedEdges) EdgeSlice() []graph.Edge { - if e.idx >= len(e.edges) { - return nil - } - idx := e.idx - if idx == -1 { - idx = 0 - } - e.idx = len(e.edges) - return e.edges[idx:] -} - -// Reset returns the iterator to its initial state. -func (e *OrderedEdges) Reset() { - e.idx = -1 -} - -// OrderedWeightedEdges implements the graph.Edges and graph.EdgeSlicer interfaces. -// The iteration order of OrderedWeightedEdges is the order of edges passed to -// NewEdgeIterator. -type OrderedWeightedEdges struct { - idx int - edges []graph.WeightedEdge -} - -// NewOrderedWeightedEdges returns an OrderedWeightedEdges initialized with the provided edges. -func NewOrderedWeightedEdges(edges []graph.WeightedEdge) *OrderedWeightedEdges { - return &OrderedWeightedEdges{idx: -1, edges: edges} -} - -// Len returns the remaining number of edges to be iterated over. -func (e *OrderedWeightedEdges) Len() int { - if e.idx >= len(e.edges) { - return 0 - } - if e.idx <= 0 { - return len(e.edges) - } - return len(e.edges[e.idx:]) -} - -// Next returns whether the next call of WeightedEdge will return a valid edge. -func (e *OrderedWeightedEdges) Next() bool { - if uint(e.idx)+1 < uint(len(e.edges)) { - e.idx++ - return true - } - e.idx = len(e.edges) - return false -} - -// WeightedEdge returns the current edge of the iterator. Next must have been -// called prior to a call to WeightedEdge. -func (e *OrderedWeightedEdges) WeightedEdge() graph.WeightedEdge { - if e.idx >= len(e.edges) || e.idx < 0 { - return nil - } - return e.edges[e.idx] -} - -// WeightedEdgeSlice returns all the remaining edges in the iterator and advances -// the iterator. -func (e *OrderedWeightedEdges) WeightedEdgeSlice() []graph.WeightedEdge { - if e.idx >= len(e.edges) { - return nil - } - idx := e.idx - if idx == -1 { - idx = 0 - } - e.idx = len(e.edges) - return e.edges[idx:] -} - -// Reset returns the iterator to its initial state. -func (e *OrderedWeightedEdges) Reset() { - e.idx = -1 -} diff --git a/vendor/gonum.org/v1/gonum/graph/iterator/lines.go b/vendor/gonum.org/v1/gonum/graph/iterator/lines.go deleted file mode 100644 index ed655df..0000000 --- a/vendor/gonum.org/v1/gonum/graph/iterator/lines.go +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright ©2018 The Gonum 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 iterator - -import "gonum.org/v1/gonum/graph" - -// OrderedLines implements the graph.Lines and graph.LineSlicer interfaces. -// The iteration order of OrderedLines is the order of lines passed to -// NewLineIterator. -type OrderedLines struct { - idx int - lines []graph.Line -} - -// NewOrderedLines returns an OrderedLines initialized with the provided lines. -func NewOrderedLines(lines []graph.Line) *OrderedLines { - return &OrderedLines{idx: -1, lines: lines} -} - -// Len returns the remaining number of lines to be iterated over. -func (e *OrderedLines) Len() int { - if e.idx >= len(e.lines) { - return 0 - } - if e.idx <= 0 { - return len(e.lines) - } - return len(e.lines[e.idx:]) -} - -// Next returns whether the next call of Line will return a valid line. -func (e *OrderedLines) Next() bool { - if uint(e.idx)+1 < uint(len(e.lines)) { - e.idx++ - return true - } - e.idx = len(e.lines) - return false -} - -// Line returns the current line of the iterator. Next must have been -// called prior to a call to Line. -func (e *OrderedLines) Line() graph.Line { - if e.idx >= len(e.lines) || e.idx < 0 { - return nil - } - return e.lines[e.idx] -} - -// LineSlice returns all the remaining lines in the iterator and advances -// the iterator. -func (e *OrderedLines) LineSlice() []graph.Line { - if e.idx >= len(e.lines) { - return nil - } - idx := e.idx - if idx == -1 { - idx = 0 - } - e.idx = len(e.lines) - return e.lines[idx:] -} - -// Reset returns the iterator to its initial state. -func (e *OrderedLines) Reset() { - e.idx = -1 -} - -// OrderedWeightedLines implements the graph.Lines and graph.LineSlicer interfaces. -// The iteration order of OrderedWeightedLines is the order of lines passed to -// NewLineIterator. -type OrderedWeightedLines struct { - idx int - lines []graph.WeightedLine -} - -// NewWeightedLineIterator returns an OrderedWeightedLines initialized with the provided lines. -func NewOrderedWeightedLines(lines []graph.WeightedLine) *OrderedWeightedLines { - return &OrderedWeightedLines{idx: -1, lines: lines} -} - -// Len returns the remaining number of lines to be iterated over. -func (e *OrderedWeightedLines) Len() int { - if e.idx >= len(e.lines) { - return 0 - } - if e.idx <= 0 { - return len(e.lines) - } - return len(e.lines[e.idx:]) -} - -// Next returns whether the next call of WeightedLine will return a valid line. -func (e *OrderedWeightedLines) Next() bool { - if uint(e.idx)+1 < uint(len(e.lines)) { - e.idx++ - return true - } - e.idx = len(e.lines) - return false -} - -// WeightedLine returns the current line of the iterator. Next must have been -// called prior to a call to WeightedLine. -func (e *OrderedWeightedLines) WeightedLine() graph.WeightedLine { - if e.idx >= len(e.lines) || e.idx < 0 { - return nil - } - return e.lines[e.idx] -} - -// WeightedLineSlice returns all the remaining lines in the iterator and advances -// the iterator. -func (e *OrderedWeightedLines) WeightedLineSlice() []graph.WeightedLine { - if e.idx >= len(e.lines) { - return nil - } - idx := e.idx - if idx == -1 { - idx = 0 - } - e.idx = len(e.lines) - return e.lines[idx:] -} - -// Reset returns the iterator to its initial state. -func (e *OrderedWeightedLines) Reset() { - e.idx = -1 -} diff --git a/vendor/gonum.org/v1/gonum/graph/iterator/nodes.go b/vendor/gonum.org/v1/gonum/graph/iterator/nodes.go deleted file mode 100644 index f32ec12..0000000 --- a/vendor/gonum.org/v1/gonum/graph/iterator/nodes.go +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright ©2018 The Gonum 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 iterator - -import ( - "reflect" - - "gonum.org/v1/gonum/graph" -) - -// OrderedNodes implements the graph.Nodes and graph.NodeSlicer interfaces. -// The iteration order of OrderedNodes is the order of nodes passed to -// NewNodeIterator. -type OrderedNodes struct { - idx int - nodes []graph.Node -} - -// NewOrderedNodes returns a OrderedNodes initialized with the provided nodes. -func NewOrderedNodes(nodes []graph.Node) *OrderedNodes { - return &OrderedNodes{idx: -1, nodes: nodes} -} - -// Len returns the remaining number of nodes to be iterated over. -func (n *OrderedNodes) Len() int { - if n.idx >= len(n.nodes) { - return 0 - } - if n.idx <= 0 { - return len(n.nodes) - } - return len(n.nodes[n.idx:]) -} - -// Next returns whether the next call of Node will return a valid node. -func (n *OrderedNodes) Next() bool { - if uint(n.idx)+1 < uint(len(n.nodes)) { - n.idx++ - return true - } - n.idx = len(n.nodes) - return false -} - -// Node returns the current node of the iterator. Next must have been -// called prior to a call to Node. -func (n *OrderedNodes) Node() graph.Node { - if n.idx >= len(n.nodes) || n.idx < 0 { - return nil - } - return n.nodes[n.idx] -} - -// NodeSlice returns all the remaining nodes in the iterator and advances -// the iterator. -func (n *OrderedNodes) NodeSlice() []graph.Node { - if n.idx >= len(n.nodes) { - return nil - } - idx := n.idx - if idx == -1 { - idx = 0 - } - n.idx = len(n.nodes) - return n.nodes[idx:] -} - -// Reset returns the iterator to its initial state. -func (n *OrderedNodes) Reset() { - n.idx = -1 -} - -// ImplicitNodes implements the graph.Nodes interface for a set of nodes over -// a contiguous ID range. -type ImplicitNodes struct { - beg, end int - curr int - newNode func(id int) graph.Node -} - -// NewImplicitNodes returns a new implicit node iterator spanning nodes in [beg,end). -// The provided new func maps the id to a graph.Node. NewImplicitNodes will panic -// if beg is greater than end. -func NewImplicitNodes(beg, end int, new func(id int) graph.Node) *ImplicitNodes { - if beg > end { - panic("iterator: invalid range") - } - return &ImplicitNodes{beg: beg, end: end, curr: beg - 1, newNode: new} -} - -// Len returns the remaining number of nodes to be iterated over. -func (n *ImplicitNodes) Len() int { - return n.end - n.curr - 1 -} - -// Next returns whether the next call of Node will return a valid node. -func (n *ImplicitNodes) Next() bool { - if n.curr == n.end { - return false - } - n.curr++ - return n.curr < n.end -} - -// Node returns the current node of the iterator. Next must have been -// called prior to a call to Node. -func (n *ImplicitNodes) Node() graph.Node { - if n.Len() == -1 || n.curr < n.beg { - return nil - } - return n.newNode(n.curr) -} - -// Reset returns the iterator to its initial state. -func (n *ImplicitNodes) Reset() { - n.curr = n.beg - 1 -} - -// NodeSlice returns all the remaining nodes in the iterator and advances -// the iterator. -func (n *ImplicitNodes) NodeSlice() []graph.Node { - nodes := make([]graph.Node, 0, n.Len()) - for n.curr++; n.curr < n.end; n.curr++ { - nodes = append(nodes, n.newNode(n.curr)) - } - return nodes -} - -// Nodes implements the graph.Nodes interfaces. -// The iteration order of Nodes is randomized. -type Nodes struct { - nodes reflect.Value - iter *reflect.MapIter - pos int - curr graph.Node -} - -// NewNodes returns a Nodes initialized with the provided nodes, a -// map of node IDs to graph.Nodes. No check is made that the keys -// match the graph.Node IDs, and the map keys are not used. -// -// Behavior of the Nodes is unspecified if nodes is mutated after -// the call the NewNodes. -func NewNodes(nodes map[int64]graph.Node) *Nodes { - rv := reflect.ValueOf(nodes) - return &Nodes{nodes: rv, iter: rv.MapRange()} -} - -// Len returns the remaining number of nodes to be iterated over. -func (n *Nodes) Len() int { - return n.nodes.Len() - n.pos -} - -// Next returns whether the next call of Node will return a valid node. -func (n *Nodes) Next() bool { - if n.pos >= n.nodes.Len() { - return false - } - ok := n.iter.Next() - if ok { - n.pos++ - n.curr = n.iter.Value().Interface().(graph.Node) - } - return ok -} - -// Node returns the current node of the iterator. Next must have been -// called prior to a call to Node. -func (n *Nodes) Node() graph.Node { - return n.curr -} - -// Reset returns the iterator to its initial state. -func (n *Nodes) Reset() { - n.curr = nil - n.pos = 0 - n.iter = n.nodes.MapRange() -} diff --git a/vendor/gonum.org/v1/gonum/graph/multigraph.go b/vendor/gonum.org/v1/gonum/graph/multigraph.go deleted file mode 100644 index 038a3d5..0000000 --- a/vendor/gonum.org/v1/gonum/graph/multigraph.go +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright ©2014 The Gonum 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 graph - -// Line is an edge in a multigraph. A Line returns an ID that must -// distinguish Lines sharing Node end points. -type Line interface { - // From returns the from node of the edge. - From() Node - - // To returns the to node of the edge. - To() Node - - // ReversedLine returns a line that has the - // end points of the receiver swapped. - ReversedLine() Line - - // ID returns the unique ID for the Line. - ID() int64 -} - -// WeightedLine is a weighted multigraph edge. -type WeightedLine interface { - Line - Weight() float64 -} - -// Multigraph is a generalized multigraph. -type Multigraph interface { - // Node returns the node with the given ID if it exists - // in the multigraph, and nil otherwise. - Node(id int64) Node - - // Nodes returns all the nodes in the multigraph. - // - // Nodes must not return nil. - Nodes() Nodes - - // From returns all nodes that can be reached directly - // from the node with the given ID. - // - // From must not return nil. - From(id int64) Nodes - - // HasEdgeBetween returns whether an edge exists between - // nodes with IDs xid and yid without considering direction. - HasEdgeBetween(xid, yid int64) bool - - // Lines returns the lines from u to v, with IDs uid and - // vid, if any such lines exist and nil otherwise. The - // node v must be directly reachable from u as defined by - // the From method. - // - // Lines must not return nil. - Lines(uid, vid int64) Lines -} - -// WeightedMultigraph is a weighted multigraph. -type WeightedMultigraph interface { - Multigraph - - // WeightedLines returns the weighted lines from u to v - // with IDs uid and vid if any such lines exist and nil - // otherwise. The node v must be directly reachable - // from u as defined by the From method. - // - // WeightedLines must not return nil. - WeightedLines(uid, vid int64) WeightedLines -} - -// UndirectedMultigraph is an undirected multigraph. -type UndirectedMultigraph interface { - Multigraph - - // LinesBetween returns the lines between nodes x and y - // with IDs xid and yid. - // - // LinesBetween must not return nil. - LinesBetween(xid, yid int64) Lines -} - -// WeightedUndirectedMultigraph is a weighted undirected multigraph. -type WeightedUndirectedMultigraph interface { - WeightedMultigraph - - // WeightedLinesBetween returns the lines between nodes - // x and y with IDs xid and yid. - // - // WeightedLinesBetween must not return nil. - WeightedLinesBetween(xid, yid int64) WeightedLines -} - -// DirectedMultigraph is a directed multigraph. -type DirectedMultigraph interface { - Multigraph - - // HasEdgeFromTo returns whether an edge exists - // in the multigraph from u to v with IDs uid - // and vid. - HasEdgeFromTo(uid, vid int64) bool - - // To returns all nodes that can reach directly - // to the node with the given ID. - // - // To must not return nil. - To(id int64) Nodes -} - -// WeightedDirectedMultigraph is a weighted directed multigraph. -type WeightedDirectedMultigraph interface { - WeightedMultigraph - - // HasEdgeFromTo returns whether an edge exists - // in the multigraph from u to v with IDs uid - // and vid. - HasEdgeFromTo(uid, vid int64) bool - - // To returns all nodes that can reach directly - // to the node with the given ID. - // - // To must not return nil. - To(id int64) Nodes -} - -// LineAdder is an interface for adding lines to a multigraph. -type LineAdder interface { - // NewLine returns a new Line from the source to the destination node. - NewLine(from, to Node) Line - - // SetLine adds a Line from one node to another. - // If the multigraph supports node addition the nodes - // will be added if they do not exist, otherwise - // SetLine will panic. - // Whether l, l.From() and l.To() are stored - // within the graph is implementation dependent. - SetLine(l Line) -} - -// WeightedLineAdder is an interface for adding lines to a multigraph. -type WeightedLineAdder interface { - // NewWeightedLine returns a new WeightedLine from - // the source to the destination node. - NewWeightedLine(from, to Node, weight float64) WeightedLine - - // SetWeightedLine adds a weighted line from one node - // to another. If the multigraph supports node addition - // the nodes will be added if they do not exist, - // otherwise SetWeightedLine will panic. - // Whether l, l.From() and l.To() are stored - // within the graph is implementation dependent. - SetWeightedLine(l WeightedLine) -} - -// LineRemover is an interface for removing lines from a multigraph. -type LineRemover interface { - // RemoveLine removes the line with the given end - // and line IDs, leaving the terminal nodes. If - // the line does not exist it is a no-op. - RemoveLine(fid, tid, id int64) -} - -// MultigraphBuilder is a multigraph that can have nodes and lines added. -type MultigraphBuilder interface { - NodeAdder - LineAdder -} - -// WeightedMultigraphBuilder is a multigraph that can have nodes and weighted lines added. -type WeightedMultigraphBuilder interface { - NodeAdder - WeightedLineAdder -} - -// UndirectedMultgraphBuilder is an undirected multigraph builder. -type UndirectedMultigraphBuilder interface { - UndirectedMultigraph - MultigraphBuilder -} - -// UndirectedWeightedMultigraphBuilder is an undirected weighted multigraph builder. -type UndirectedWeightedMultigraphBuilder interface { - UndirectedMultigraph - WeightedMultigraphBuilder -} - -// DirectedMultigraphBuilder is a directed multigraph builder. -type DirectedMultigraphBuilder interface { - DirectedMultigraph - MultigraphBuilder -} - -// DirectedWeightedMultigraphBuilder is a directed weighted multigraph builder. -type DirectedWeightedMultigraphBuilder interface { - DirectedMultigraph - WeightedMultigraphBuilder -} diff --git a/vendor/gonum.org/v1/gonum/graph/nodes_edges.go b/vendor/gonum.org/v1/gonum/graph/nodes_edges.go deleted file mode 100644 index 3d5dae1..0000000 --- a/vendor/gonum.org/v1/gonum/graph/nodes_edges.go +++ /dev/null @@ -1,300 +0,0 @@ -// Copyright ©2018 The Gonum 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 graph - -// Iterator is an item iterator. -type Iterator interface { - // Next advances the iterator and returns whether - // the next call to the item method will return a - // non-nil item. - // - // Next should be called prior to any call to the - // iterator's item retrieval method after the - // iterator has been obtained or reset. - // - // The order of iteration is implementation - // dependent. - Next() bool - - // Len returns the number of items remaining in the - // iterator. - // - // If the number of items in the iterator is unknown, - // too large to materialize or too costly to calculate - // then Len may return a negative value. - // In this case the consuming function must be able - // to operate on the items of the iterator directly - // without materializing the items into a slice. - // The magnitude of a negative length has - // implementation-dependent semantics. - Len() int - - // Reset returns the iterator to its start position. - Reset() -} - -// Nodes is a Node iterator. -type Nodes interface { - Iterator - - // Node returns the current Node from the iterator. - Node() Node -} - -// NodeSlicer wraps the NodeSlice method. -type NodeSlicer interface { - // NodeSlice returns the set of nodes remaining - // to be iterated by a Nodes iterator. - // The holder of the iterator may arbitrarily - // change elements in the returned slice, but - // those changes may be reflected to other - // iterators. - NodeSlice() []Node -} - -// NodesOf returns it.Len() nodes from it. If it is a NodeSlicer, the NodeSlice method -// is used to obtain the nodes. It is safe to pass a nil Nodes to NodesOf. -// -// If the Nodes has an indeterminate length, NodesOf will panic. -func NodesOf(it Nodes) []Node { - if it == nil { - return nil - } - len := it.Len() - switch { - case len == 0: - return nil - case len < 0: - panic("graph: called NodesOf on indeterminate iterator") - } - switch it := it.(type) { - case NodeSlicer: - return it.NodeSlice() - } - n := make([]Node, 0, len) - for it.Next() { - n = append(n, it.Node()) - } - return n -} - -// Edges is an Edge iterator. -type Edges interface { - Iterator - - // Edge returns the current Edge from the iterator. - Edge() Edge -} - -// EdgeSlicer wraps the EdgeSlice method. -type EdgeSlicer interface { - // EdgeSlice returns the set of edges remaining - // to be iterated by an Edges iterator. - // The holder of the iterator may arbitrarily - // change elements in the returned slice, but - // those changes may be reflected to other - // iterators. - EdgeSlice() []Edge -} - -// EdgesOf returns it.Len() nodes from it. If it is an EdgeSlicer, the EdgeSlice method is used -// to obtain the edges. It is safe to pass a nil Edges to EdgesOf. -// -// If the Edges has an indeterminate length, EdgesOf will panic. -func EdgesOf(it Edges) []Edge { - if it == nil { - return nil - } - len := it.Len() - switch { - case len == 0: - return nil - case len < 0: - panic("graph: called EdgesOf on indeterminate iterator") - } - switch it := it.(type) { - case EdgeSlicer: - return it.EdgeSlice() - } - e := make([]Edge, 0, len) - for it.Next() { - e = append(e, it.Edge()) - } - return e -} - -// WeightedEdges is a WeightedEdge iterator. -type WeightedEdges interface { - Iterator - - // Edge returns the current Edge from the iterator. - WeightedEdge() WeightedEdge -} - -// WeightedEdgeSlicer wraps the WeightedEdgeSlice method. -type WeightedEdgeSlicer interface { - // EdgeSlice returns the set of edges remaining - // to be iterated by an Edges iterator. - // The holder of the iterator may arbitrarily - // change elements in the returned slice, but - // those changes may be reflected to other - // iterators. - WeightedEdgeSlice() []WeightedEdge -} - -// WeightedEdgesOf returns it.Len() weighted edge from it. If it is a WeightedEdgeSlicer, the -// WeightedEdgeSlice method is used to obtain the edges. It is safe to pass a nil WeightedEdges -// to WeightedEdgesOf. -// -// If the WeightedEdges has an indeterminate length, WeightedEdgesOf will panic. -func WeightedEdgesOf(it WeightedEdges) []WeightedEdge { - if it == nil { - return nil - } - len := it.Len() - switch { - case len == 0: - return nil - case len < 0: - panic("graph: called WeightedEdgesOf on indeterminate iterator") - } - switch it := it.(type) { - case WeightedEdgeSlicer: - return it.WeightedEdgeSlice() - } - e := make([]WeightedEdge, 0, len) - for it.Next() { - e = append(e, it.WeightedEdge()) - } - return e -} - -// Lines is a Line iterator. -type Lines interface { - Iterator - - // Line returns the current Line from the iterator. - Line() Line -} - -// LineSlicer wraps the LineSlice method. -type LineSlicer interface { - // LineSlice returns the set of lines remaining - // to be iterated by an Lines iterator. - // The holder of the iterator may arbitrarily - // change elements in the returned slice, but - // those changes may be reflected to other - // iterators. - LineSlice() []Line -} - -// LinesOf returns it.Len() nodes from it. If it is a LineSlicer, the LineSlice method is used -// to obtain the lines. It is safe to pass a nil Lines to LinesOf. -// -// If the Lines has an indeterminate length, LinesOf will panic. -func LinesOf(it Lines) []Line { - if it == nil { - return nil - } - len := it.Len() - switch { - case len == 0: - return nil - case len < 0: - panic("graph: called LinesOf on indeterminate iterator") - } - switch it := it.(type) { - case LineSlicer: - return it.LineSlice() - } - l := make([]Line, 0, len) - for it.Next() { - l = append(l, it.Line()) - } - return l -} - -// WeightedLines is a WeightedLine iterator. -type WeightedLines interface { - Iterator - - // Line returns the current Line from the iterator. - WeightedLine() WeightedLine -} - -// WeightedLineSlicer wraps the WeightedLineSlice method. -type WeightedLineSlicer interface { - // LineSlice returns the set of lines remaining - // to be iterated by an Lines iterator. - // The holder of the iterator may arbitrarily - // change elements in the returned slice, but - // those changes may be reflected to other - // iterators. - WeightedLineSlice() []WeightedLine -} - -// WeightedLinesOf returns it.Len() weighted line from it. If it is a WeightedLineSlicer, the -// WeightedLineSlice method is used to obtain the lines. It is safe to pass a nil WeightedLines -// to WeightedLinesOf. -// -// If the WeightedLines has an indeterminate length, WeightedLinesOf will panic. -func WeightedLinesOf(it WeightedLines) []WeightedLine { - if it == nil { - return nil - } - len := it.Len() - switch { - case len == 0: - return nil - case len < 0: - panic("graph: called WeightedLinesOf on indeterminate iterator") - } - switch it := it.(type) { - case WeightedLineSlicer: - return it.WeightedLineSlice() - } - l := make([]WeightedLine, 0, len) - for it.Next() { - l = append(l, it.WeightedLine()) - } - return l -} - -// Empty is an empty set of nodes, edges or lines. It should be used when -// a graph returns a zero-length Iterator. Empty implements the slicer -// interfaces for nodes, edges and lines, returning nil for each of these. -const Empty = nothing - -var ( - _ Iterator = Empty - _ Nodes = Empty - _ NodeSlicer = Empty - _ Edges = Empty - _ EdgeSlicer = Empty - _ WeightedEdges = Empty - _ WeightedEdgeSlicer = Empty - _ Lines = Empty - _ LineSlicer = Empty - _ WeightedLines = Empty - _ WeightedLineSlicer = Empty -) - -const nothing = empty(true) - -type empty bool - -func (empty) Next() bool { return false } -func (empty) Len() int { return 0 } -func (empty) Reset() {} -func (empty) Node() Node { return nil } -func (empty) NodeSlice() []Node { return nil } -func (empty) Edge() Edge { return nil } -func (empty) EdgeSlice() []Edge { return nil } -func (empty) WeightedEdge() WeightedEdge { return nil } -func (empty) WeightedEdgeSlice() []WeightedEdge { return nil } -func (empty) Line() Line { return nil } -func (empty) LineSlice() []Line { return nil } -func (empty) WeightedLine() WeightedLine { return nil } -func (empty) WeightedLineSlice() []WeightedLine { return nil } diff --git a/vendor/gonum.org/v1/gonum/graph/simple/dense_directed_matrix.go b/vendor/gonum.org/v1/gonum/graph/simple/dense_directed_matrix.go deleted file mode 100644 index 3daca9a..0000000 --- a/vendor/gonum.org/v1/gonum/graph/simple/dense_directed_matrix.go +++ /dev/null @@ -1,301 +0,0 @@ -// Copyright ©2014 The Gonum 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 simple - -import ( - "sort" - - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/internal/ordered" - "gonum.org/v1/gonum/graph/iterator" - "gonum.org/v1/gonum/mat" -) - -var ( - dm *DirectedMatrix - - _ graph.Graph = dm - _ graph.Directed = dm - _ edgeSetter = dm - _ weightedEdgeSetter = dm -) - -// DirectedMatrix represents a directed graph using an adjacency -// matrix such that all IDs are in a contiguous block from 0 to n-1. -// Edges are stored implicitly as an edge weight, so edges stored in -// the graph are not recoverable. -type DirectedMatrix struct { - mat *mat.Dense - nodes []graph.Node - - self float64 - absent float64 -} - -// NewDirectedMatrix creates a directed dense graph with n nodes. -// All edges are initialized with the weight given by init. The self parameter -// specifies the cost of self connection, and absent specifies the weight -// returned for absent edges. -func NewDirectedMatrix(n int, init, self, absent float64) *DirectedMatrix { - matrix := make([]float64, n*n) - if init != 0 { - for i := range matrix { - matrix[i] = init - } - } - for i := 0; i < len(matrix); i += n + 1 { - matrix[i] = self - } - return &DirectedMatrix{ - mat: mat.NewDense(n, n, matrix), - self: self, - absent: absent, - } -} - -// NewDirectedMatrixFrom creates a directed dense graph with the given nodes. -// The IDs of the nodes must be contiguous from 0 to len(nodes)-1, but may -// be in any order. If IDs are not contiguous NewDirectedMatrixFrom will panic. -// All edges are initialized with the weight given by init. The self parameter -// specifies the cost of self connection, and absent specifies the weight -// returned for absent edges. -func NewDirectedMatrixFrom(nodes []graph.Node, init, self, absent float64) *DirectedMatrix { - sort.Sort(ordered.ByID(nodes)) - for i, n := range nodes { - if int64(i) != n.ID() { - panic("simple: non-contiguous node IDs") - } - } - g := NewDirectedMatrix(len(nodes), init, self, absent) - g.nodes = nodes - return g -} - -// Edge returns the edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -func (g *DirectedMatrix) Edge(uid, vid int64) graph.Edge { - return g.WeightedEdge(uid, vid) -} - -// Edges returns all the edges in the graph. -func (g *DirectedMatrix) Edges() graph.Edges { - var edges []graph.Edge - r, _ := g.mat.Dims() - for i := 0; i < r; i++ { - for j := 0; j < r; j++ { - if i == j { - continue - } - if w := g.mat.At(i, j); !isSame(w, g.absent) { - edges = append(edges, WeightedEdge{F: g.Node(int64(i)), T: g.Node(int64(j)), W: w}) - } - } - } - if len(edges) == 0 { - return graph.Empty - } - return iterator.NewOrderedEdges(edges) -} - -// From returns all nodes in g that can be reached directly from n. -func (g *DirectedMatrix) From(id int64) graph.Nodes { - if !g.has(id) { - return graph.Empty - } - var nodes []graph.Node - _, c := g.mat.Dims() - for j := 0; j < c; j++ { - if int64(j) == id { - continue - } - // id is not greater than maximum int by this point. - if !isSame(g.mat.At(int(id), j), g.absent) { - nodes = append(nodes, g.Node(int64(j))) - } - } - if len(nodes) == 0 { - return graph.Empty - } - return iterator.NewOrderedNodes(nodes) -} - -// HasEdgeBetween returns whether an edge exists between nodes x and y without -// considering direction. -func (g *DirectedMatrix) HasEdgeBetween(xid, yid int64) bool { - if !g.has(xid) { - return false - } - if !g.has(yid) { - return false - } - // xid and yid are not greater than maximum int by this point. - return xid != yid && (!isSame(g.mat.At(int(xid), int(yid)), g.absent) || !isSame(g.mat.At(int(yid), int(xid)), g.absent)) -} - -// HasEdgeFromTo returns whether an edge exists in the graph from u to v. -func (g *DirectedMatrix) HasEdgeFromTo(uid, vid int64) bool { - if !g.has(uid) { - return false - } - if !g.has(vid) { - return false - } - // uid and vid are not greater than maximum int by this point. - return uid != vid && !isSame(g.mat.At(int(uid), int(vid)), g.absent) -} - -// Matrix returns the mat.Matrix representation of the graph. The orientation -// of the matrix is such that the matrix entry at G_{ij} is the weight of the edge -// from node i to node j. -func (g *DirectedMatrix) Matrix() mat.Matrix { - // Prevent alteration of dimensions of the returned matrix. - m := *g.mat - return &m -} - -// Node returns the node with the given ID if it exists in the graph, -// and nil otherwise. -func (g *DirectedMatrix) Node(id int64) graph.Node { - if !g.has(id) { - return nil - } - if g.nodes == nil { - return Node(id) - } - return g.nodes[id] -} - -// Nodes returns all the nodes in the graph. -func (g *DirectedMatrix) Nodes() graph.Nodes { - if g.nodes != nil { - nodes := make([]graph.Node, len(g.nodes)) - copy(nodes, g.nodes) - return iterator.NewOrderedNodes(nodes) - } - r, _ := g.mat.Dims() - // Matrix graphs must have at least one node. - return iterator.NewImplicitNodes(0, r, newSimpleNode) -} - -// RemoveEdge removes the edge with the given end point nodes from the graph, leaving the terminal -// nodes. If the edge does not exist it is a no-op. -func (g *DirectedMatrix) RemoveEdge(fid, tid int64) { - if !g.has(fid) { - return - } - if !g.has(tid) { - return - } - // fid and tid are not greater than maximum int by this point. - g.mat.Set(int(fid), int(tid), g.absent) -} - -// SetEdge sets e, an edge from one node to another with unit weight. If the ends of the edge -// are not in g or the edge is a self loop, SetEdge panics. SetEdge will store the nodes of -// e in the graph if it was initialized with NewDirectedMatrixFrom. -func (g *DirectedMatrix) SetEdge(e graph.Edge) { - g.setWeightedEdge(e, 1) -} - -// SetWeightedEdge sets e, an edge from one node to another. If the ends of the edge are not in g -// or the edge is a self loop, SetWeightedEdge panics. SetWeightedEdge will store the nodes of -// e in the graph if it was initialized with NewDirectedMatrixFrom. -func (g *DirectedMatrix) SetWeightedEdge(e graph.WeightedEdge) { - g.setWeightedEdge(e, e.Weight()) -} - -func (g *DirectedMatrix) setWeightedEdge(e graph.Edge, weight float64) { - from := e.From() - fid := from.ID() - to := e.To() - tid := to.ID() - if fid == tid { - panic("simple: set illegal edge") - } - if int64(int(fid)) != fid { - panic("simple: unavailable from node ID for dense graph") - } - if int64(int(tid)) != tid { - panic("simple: unavailable to node ID for dense graph") - } - if g.nodes != nil { - g.nodes[fid] = from - g.nodes[tid] = to - } - // fid and tid are not greater than maximum int by this point. - g.mat.Set(int(fid), int(tid), weight) -} - -// To returns all nodes in g that can reach directly to n. -func (g *DirectedMatrix) To(id int64) graph.Nodes { - if !g.has(id) { - return graph.Empty - } - var nodes []graph.Node - r, _ := g.mat.Dims() - for i := 0; i < r; i++ { - if int64(i) == id { - continue - } - // id is not greater than maximum int by this point. - if !isSame(g.mat.At(i, int(id)), g.absent) { - nodes = append(nodes, g.Node(int64(i))) - } - } - if len(nodes) == 0 { - return graph.Empty - } - return iterator.NewOrderedNodes(nodes) -} - -// Weight returns the weight for the edge between x and y if Edge(x, y) returns a non-nil Edge. -// If x and y are the same node or there is no joining edge between the two nodes the weight -// value returned is either the graph's absent or self value. Weight returns true if an edge -// exists between x and y or if x and y have the same ID, false otherwise. -func (g *DirectedMatrix) Weight(xid, yid int64) (w float64, ok bool) { - if xid == yid { - return g.self, true - } - if g.HasEdgeFromTo(xid, yid) { - // xid and yid are not greater than maximum int by this point. - return g.mat.At(int(xid), int(yid)), true - } - return g.absent, false -} - -// WeightedEdge returns the weighted edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -func (g *DirectedMatrix) WeightedEdge(uid, vid int64) graph.WeightedEdge { - if g.HasEdgeFromTo(uid, vid) { - // xid and yid are not greater than maximum int by this point. - return WeightedEdge{F: g.Node(uid), T: g.Node(vid), W: g.mat.At(int(uid), int(vid))} - } - return nil -} - -// WeightedEdges returns all the edges in the graph. -func (g *DirectedMatrix) WeightedEdges() graph.WeightedEdges { - var edges []graph.WeightedEdge - r, _ := g.mat.Dims() - for i := 0; i < r; i++ { - for j := 0; j < r; j++ { - if i == j { - continue - } - if w := g.mat.At(i, j); !isSame(w, g.absent) { - edges = append(edges, WeightedEdge{F: g.Node(int64(i)), T: g.Node(int64(j)), W: w}) - } - } - } - if len(edges) == 0 { - return graph.Empty - } - return iterator.NewOrderedWeightedEdges(edges) -} - -func (g *DirectedMatrix) has(id int64) bool { - r, _ := g.mat.Dims() - return 0 <= id && id < int64(r) -} diff --git a/vendor/gonum.org/v1/gonum/graph/simple/dense_undirected_matrix.go b/vendor/gonum.org/v1/gonum/graph/simple/dense_undirected_matrix.go deleted file mode 100644 index f51debb..0000000 --- a/vendor/gonum.org/v1/gonum/graph/simple/dense_undirected_matrix.go +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright ©2014 The Gonum 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 simple - -import ( - "sort" - - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/internal/ordered" - "gonum.org/v1/gonum/graph/iterator" - "gonum.org/v1/gonum/mat" -) - -var ( - um *UndirectedMatrix - - _ graph.Graph = um - _ graph.Undirected = um - _ edgeSetter = um - _ weightedEdgeSetter = um -) - -// UndirectedMatrix represents an undirected graph using an adjacency -// matrix such that all IDs are in a contiguous block from 0 to n-1. -// Edges are stored implicitly as an edge weight, so edges stored in -// the graph are not recoverable. -type UndirectedMatrix struct { - mat *mat.SymDense - nodes []graph.Node - - self float64 - absent float64 -} - -// NewUndirectedMatrix creates an undirected dense graph with n nodes. -// All edges are initialized with the weight given by init. The self parameter -// specifies the cost of self connection, and absent specifies the weight -// returned for absent edges. -func NewUndirectedMatrix(n int, init, self, absent float64) *UndirectedMatrix { - matrix := make([]float64, n*n) - if init != 0 { - for i := range matrix { - matrix[i] = init - } - } - for i := 0; i < len(matrix); i += n + 1 { - matrix[i] = self - } - return &UndirectedMatrix{ - mat: mat.NewSymDense(n, matrix), - self: self, - absent: absent, - } -} - -// NewUndirectedMatrixFrom creates an undirected dense graph with the given nodes. -// The IDs of the nodes must be contiguous from 0 to len(nodes)-1, but may -// be in any order. If IDs are not contiguous NewUndirectedMatrixFrom will panic. -// All edges are initialized with the weight given by init. The self parameter -// specifies the cost of self connection, and absent specifies the weight -// returned for absent edges. -func NewUndirectedMatrixFrom(nodes []graph.Node, init, self, absent float64) *UndirectedMatrix { - sort.Sort(ordered.ByID(nodes)) - for i, n := range nodes { - if int64(i) != n.ID() { - panic("simple: non-contiguous node IDs") - } - } - g := NewUndirectedMatrix(len(nodes), init, self, absent) - g.nodes = nodes - return g -} - -// Edge returns the edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -func (g *UndirectedMatrix) Edge(uid, vid int64) graph.Edge { - return g.WeightedEdgeBetween(uid, vid) -} - -// EdgeBetween returns the edge between nodes x and y. -func (g *UndirectedMatrix) EdgeBetween(uid, vid int64) graph.Edge { - return g.WeightedEdgeBetween(uid, vid) -} - -// Edges returns all the edges in the graph. -func (g *UndirectedMatrix) Edges() graph.Edges { - var edges []graph.Edge - r, _ := g.mat.Dims() - for i := 0; i < r; i++ { - for j := i + 1; j < r; j++ { - if w := g.mat.At(i, j); !isSame(w, g.absent) { - edges = append(edges, WeightedEdge{F: g.Node(int64(i)), T: g.Node(int64(j)), W: w}) - } - } - } - if len(edges) == 0 { - return graph.Empty - } - return iterator.NewOrderedEdges(edges) -} - -// From returns all nodes in g that can be reached directly from n. -func (g *UndirectedMatrix) From(id int64) graph.Nodes { - if !g.has(id) { - return graph.Empty - } - var nodes []graph.Node - r := g.mat.Symmetric() - for i := 0; i < r; i++ { - if int64(i) == id { - continue - } - // id is not greater than maximum int by this point. - if !isSame(g.mat.At(int(id), i), g.absent) { - nodes = append(nodes, g.Node(int64(i))) - } - } - if len(nodes) == 0 { - return graph.Empty - } - return iterator.NewOrderedNodes(nodes) -} - -// HasEdgeBetween returns whether an edge exists between nodes x and y. -func (g *UndirectedMatrix) HasEdgeBetween(uid, vid int64) bool { - if !g.has(uid) { - return false - } - if !g.has(vid) { - return false - } - // uid and vid are not greater than maximum int by this point. - return uid != vid && !isSame(g.mat.At(int(uid), int(vid)), g.absent) -} - -// Matrix returns the mat.Matrix representation of the graph. -func (g *UndirectedMatrix) Matrix() mat.Matrix { - // Prevent alteration of dimensions of the returned matrix. - m := *g.mat - return &m -} - -// Node returns the node with the given ID if it exists in the graph, -// and nil otherwise. -func (g *UndirectedMatrix) Node(id int64) graph.Node { - if !g.has(id) { - return nil - } - if g.nodes == nil { - return Node(id) - } - return g.nodes[id] -} - -// Nodes returns all the nodes in the graph. -func (g *UndirectedMatrix) Nodes() graph.Nodes { - if g.nodes != nil { - nodes := make([]graph.Node, len(g.nodes)) - copy(nodes, g.nodes) - return iterator.NewOrderedNodes(nodes) - } - r := g.mat.Symmetric() - // Matrix graphs must have at least one node. - return iterator.NewImplicitNodes(0, r, newSimpleNode) -} - -// RemoveEdge removes the edge with the given end point IDs from the graph, leaving the terminal -// nodes. If the edge does not exist it is a no-op. -func (g *UndirectedMatrix) RemoveEdge(fid, tid int64) { - if !g.has(fid) { - return - } - if !g.has(tid) { - return - } - // fid and tid are not greater than maximum int by this point. - g.mat.SetSym(int(fid), int(tid), g.absent) -} - -// SetEdge sets e, an edge from one node to another with unit weight. If the ends of the edge are -// not in g or the edge is a self loop, SetEdge panics. SetEdge will store the nodes of -// e in the graph if it was initialized with NewUndirectedMatrixFrom. -func (g *UndirectedMatrix) SetEdge(e graph.Edge) { - g.setWeightedEdge(e, 1) -} - -// SetWeightedEdge sets e, an edge from one node to another. If the ends of the edge are not in g -// or the edge is a self loop, SetWeightedEdge panics. SetWeightedEdge will store the nodes of -// e in the graph if it was initialized with NewUndirectedMatrixFrom. -func (g *UndirectedMatrix) SetWeightedEdge(e graph.WeightedEdge) { - g.setWeightedEdge(e, e.Weight()) -} - -func (g *UndirectedMatrix) setWeightedEdge(e graph.Edge, weight float64) { - from := e.From() - fid := from.ID() - to := e.To() - tid := to.ID() - if fid == tid { - panic("simple: set illegal edge") - } - if int64(int(fid)) != fid { - panic("simple: unavailable from node ID for dense graph") - } - if int64(int(tid)) != tid { - panic("simple: unavailable to node ID for dense graph") - } - if g.nodes != nil { - g.nodes[fid] = from - g.nodes[tid] = to - } - // fid and tid are not greater than maximum int by this point. - g.mat.SetSym(int(fid), int(tid), weight) -} - -// Weight returns the weight for the edge between x and y if Edge(x, y) returns a non-nil Edge. -// If x and y are the same node or there is no joining edge between the two nodes the weight -// value returned is either the graph's absent or self value. Weight returns true if an edge -// exists between x and y or if x and y have the same ID, false otherwise. -func (g *UndirectedMatrix) Weight(xid, yid int64) (w float64, ok bool) { - if xid == yid { - return g.self, true - } - if g.HasEdgeBetween(xid, yid) { - // xid and yid are not greater than maximum int by this point. - return g.mat.At(int(xid), int(yid)), true - } - return g.absent, false -} - -// WeightedEdge returns the weighted edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -func (g *UndirectedMatrix) WeightedEdge(uid, vid int64) graph.WeightedEdge { - return g.WeightedEdgeBetween(uid, vid) -} - -// WeightedEdgeBetween returns the weighted edge between nodes x and y. -func (g *UndirectedMatrix) WeightedEdgeBetween(uid, vid int64) graph.WeightedEdge { - if g.HasEdgeBetween(uid, vid) { - // uid and vid are not greater than maximum int by this point. - return WeightedEdge{F: g.Node(uid), T: g.Node(vid), W: g.mat.At(int(uid), int(vid))} - } - return nil -} - -// WeightedEdges returns all the edges in the graph. -func (g *UndirectedMatrix) WeightedEdges() graph.WeightedEdges { - var edges []graph.WeightedEdge - r, _ := g.mat.Dims() - for i := 0; i < r; i++ { - for j := i + 1; j < r; j++ { - if w := g.mat.At(i, j); !isSame(w, g.absent) { - edges = append(edges, WeightedEdge{F: g.Node(int64(i)), T: g.Node(int64(j)), W: w}) - } - } - } - if len(edges) == 0 { - return graph.Empty - } - return iterator.NewOrderedWeightedEdges(edges) -} - -func (g *UndirectedMatrix) has(id int64) bool { - r := g.mat.Symmetric() - return 0 <= id && id < int64(r) -} diff --git a/vendor/gonum.org/v1/gonum/graph/simple/directed.go b/vendor/gonum.org/v1/gonum/graph/simple/directed.go deleted file mode 100644 index 08baf50..0000000 --- a/vendor/gonum.org/v1/gonum/graph/simple/directed.go +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright ©2014 The Gonum 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 simple - -import ( - "fmt" - - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/internal/uid" - "gonum.org/v1/gonum/graph/iterator" -) - -var ( - dg *DirectedGraph - - _ graph.Graph = dg - _ graph.Directed = dg - _ graph.NodeAdder = dg - _ graph.NodeRemover = dg - _ graph.EdgeAdder = dg - _ graph.EdgeRemover = dg -) - -// DirectedGraph implements a generalized directed graph. -type DirectedGraph struct { - nodes map[int64]graph.Node - from map[int64]map[int64]graph.Edge - to map[int64]map[int64]graph.Edge - - nodeIDs uid.Set -} - -// NewDirectedGraph returns a DirectedGraph. -func NewDirectedGraph() *DirectedGraph { - return &DirectedGraph{ - nodes: make(map[int64]graph.Node), - from: make(map[int64]map[int64]graph.Edge), - to: make(map[int64]map[int64]graph.Edge), - - nodeIDs: uid.NewSet(), - } -} - -// AddNode adds n to the graph. It panics if the added node ID matches an existing node ID. -func (g *DirectedGraph) AddNode(n graph.Node) { - if _, exists := g.nodes[n.ID()]; exists { - panic(fmt.Sprintf("simple: node ID collision: %d", n.ID())) - } - g.nodes[n.ID()] = n - g.nodeIDs.Use(n.ID()) -} - -// Edge returns the edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -func (g *DirectedGraph) Edge(uid, vid int64) graph.Edge { - edge, ok := g.from[uid][vid] - if !ok { - return nil - } - return edge -} - -// Edges returns all the edges in the graph. -func (g *DirectedGraph) Edges() graph.Edges { - var edges []graph.Edge - for _, u := range g.nodes { - for _, e := range g.from[u.ID()] { - edges = append(edges, e) - } - } - if len(edges) == 0 { - return graph.Empty - } - return iterator.NewOrderedEdges(edges) -} - -// From returns all nodes in g that can be reached directly from n. -func (g *DirectedGraph) From(id int64) graph.Nodes { - if _, ok := g.from[id]; !ok { - return graph.Empty - } - - from := make([]graph.Node, len(g.from[id])) - i := 0 - for vid := range g.from[id] { - from[i] = g.nodes[vid] - i++ - } - if len(from) == 0 { - return graph.Empty - } - return iterator.NewOrderedNodes(from) -} - -// HasEdgeBetween returns whether an edge exists between nodes x and y without -// considering direction. -func (g *DirectedGraph) HasEdgeBetween(xid, yid int64) bool { - if _, ok := g.from[xid][yid]; ok { - return true - } - _, ok := g.from[yid][xid] - return ok -} - -// HasEdgeFromTo returns whether an edge exists in the graph from u to v. -func (g *DirectedGraph) HasEdgeFromTo(uid, vid int64) bool { - if _, ok := g.from[uid][vid]; !ok { - return false - } - return true -} - -// NewEdge returns a new Edge from the source to the destination node. -func (g *DirectedGraph) NewEdge(from, to graph.Node) graph.Edge { - return Edge{F: from, T: to} -} - -// NewNode returns a new unique Node to be added to g. The Node's ID does -// not become valid in g until the Node is added to g. -func (g *DirectedGraph) NewNode() graph.Node { - if len(g.nodes) == 0 { - return Node(0) - } - if int64(len(g.nodes)) == uid.Max { - panic("simple: cannot allocate node: no slot") - } - return Node(g.nodeIDs.NewID()) -} - -// Node returns the node with the given ID if it exists in the graph, -// and nil otherwise. -func (g *DirectedGraph) Node(id int64) graph.Node { - return g.nodes[id] -} - -// Nodes returns all the nodes in the graph. -func (g *DirectedGraph) Nodes() graph.Nodes { - if len(g.nodes) == 0 { - return graph.Empty - } - nodes := make([]graph.Node, len(g.nodes)) - i := 0 - for _, n := range g.nodes { - nodes[i] = n - i++ - } - return iterator.NewOrderedNodes(nodes) -} - -// RemoveEdge removes the edge with the given end point IDs from the graph, leaving the terminal -// nodes. If the edge does not exist it is a no-op. -func (g *DirectedGraph) RemoveEdge(fid, tid int64) { - if _, ok := g.nodes[fid]; !ok { - return - } - if _, ok := g.nodes[tid]; !ok { - return - } - - delete(g.from[fid], tid) - delete(g.to[tid], fid) -} - -// RemoveNode removes the node with the given ID from the graph, as well as any edges attached -// to it. If the node is not in the graph it is a no-op. -func (g *DirectedGraph) RemoveNode(id int64) { - if _, ok := g.nodes[id]; !ok { - return - } - delete(g.nodes, id) - - for from := range g.from[id] { - delete(g.to[from], id) - } - delete(g.from, id) - - for to := range g.to[id] { - delete(g.from[to], id) - } - delete(g.to, id) - - g.nodeIDs.Release(id) -} - -// SetEdge adds e, an edge from one node to another. If the nodes do not exist, they are added -// and are set to the nodes of the edge otherwise. -// It will panic if the IDs of the e.From and e.To are equal. -func (g *DirectedGraph) SetEdge(e graph.Edge) { - var ( - from = e.From() - fid = from.ID() - to = e.To() - tid = to.ID() - ) - - if fid == tid { - panic("simple: adding self edge") - } - - if _, ok := g.nodes[fid]; !ok { - g.AddNode(from) - } else { - g.nodes[fid] = from - } - if _, ok := g.nodes[tid]; !ok { - g.AddNode(to) - } else { - g.nodes[tid] = to - } - - if fm, ok := g.from[fid]; ok { - fm[tid] = e - } else { - g.from[fid] = map[int64]graph.Edge{tid: e} - } - if tm, ok := g.to[tid]; ok { - tm[fid] = e - } else { - g.to[tid] = map[int64]graph.Edge{fid: e} - } -} - -// To returns all nodes in g that can reach directly to n. -func (g *DirectedGraph) To(id int64) graph.Nodes { - if _, ok := g.to[id]; !ok { - return graph.Empty - } - - to := make([]graph.Node, len(g.to[id])) - i := 0 - for uid := range g.to[id] { - to[i] = g.nodes[uid] - i++ - } - if len(to) == 0 { - return graph.Empty - } - return iterator.NewOrderedNodes(to) -} diff --git a/vendor/gonum.org/v1/gonum/graph/simple/doc.go b/vendor/gonum.org/v1/gonum/graph/simple/doc.go deleted file mode 100644 index dc3f24c..0000000 --- a/vendor/gonum.org/v1/gonum/graph/simple/doc.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright ©2017 The Gonum 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 simple provides a suite of simple graph implementations satisfying -// the gonum/graph interfaces. -// -// All types in simple return the graph.Empty value for empty iterators. -package simple // import "gonum.org/v1/gonum/graph/simple" diff --git a/vendor/gonum.org/v1/gonum/graph/simple/simple.go b/vendor/gonum.org/v1/gonum/graph/simple/simple.go deleted file mode 100644 index 3b45765..0000000 --- a/vendor/gonum.org/v1/gonum/graph/simple/simple.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright ©2014 The Gonum 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 simple - -import ( - "math" - - "gonum.org/v1/gonum/graph" -) - -// Node is a simple graph node. -type Node int64 - -// ID returns the ID number of the node. -func (n Node) ID() int64 { - return int64(n) -} - -func newSimpleNode(id int) graph.Node { - return Node(id) -} - -// Edge is a simple graph edge. -type Edge struct { - F, T graph.Node -} - -// From returns the from-node of the edge. -func (e Edge) From() graph.Node { return e.F } - -// To returns the to-node of the edge. -func (e Edge) To() graph.Node { return e.T } - -// ReversedLine returns a new Edge with the F and T fields -// swapped. -func (e Edge) ReversedEdge() graph.Edge { return Edge{F: e.T, T: e.F} } - -// WeightedEdge is a simple weighted graph edge. -type WeightedEdge struct { - F, T graph.Node - W float64 -} - -// From returns the from-node of the edge. -func (e WeightedEdge) From() graph.Node { return e.F } - -// To returns the to-node of the edge. -func (e WeightedEdge) To() graph.Node { return e.T } - -// ReversedLine returns a new Edge with the F and T fields -// swapped. The weight of the new Edge is the same as -// the weight of the receiver. -func (e WeightedEdge) ReversedEdge() graph.Edge { return WeightedEdge{F: e.T, T: e.F, W: e.W} } - -// Weight returns the weight of the edge. -func (e WeightedEdge) Weight() float64 { return e.W } - -// isSame returns whether two float64 values are the same where NaN values -// are equalable. -func isSame(a, b float64) bool { - return a == b || (math.IsNaN(a) && math.IsNaN(b)) -} - -type edgeSetter interface { - SetEdge(e graph.Edge) -} - -type weightedEdgeSetter interface { - SetWeightedEdge(e graph.WeightedEdge) -} diff --git a/vendor/gonum.org/v1/gonum/graph/simple/undirected.go b/vendor/gonum.org/v1/gonum/graph/simple/undirected.go deleted file mode 100644 index ac6cc8d..0000000 --- a/vendor/gonum.org/v1/gonum/graph/simple/undirected.go +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright ©2014 The Gonum 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 simple - -import ( - "fmt" - - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/internal/uid" - "gonum.org/v1/gonum/graph/iterator" -) - -var ( - ug *UndirectedGraph - - _ graph.Graph = ug - _ graph.Undirected = ug - _ graph.NodeAdder = ug - _ graph.NodeRemover = ug - _ graph.EdgeAdder = ug - _ graph.EdgeRemover = ug -) - -// UndirectedGraph implements a generalized undirected graph. -type UndirectedGraph struct { - nodes map[int64]graph.Node - edges map[int64]map[int64]graph.Edge - - nodeIDs uid.Set -} - -// NewUndirectedGraph returns an UndirectedGraph. -func NewUndirectedGraph() *UndirectedGraph { - return &UndirectedGraph{ - nodes: make(map[int64]graph.Node), - edges: make(map[int64]map[int64]graph.Edge), - - nodeIDs: uid.NewSet(), - } -} - -// AddNode adds n to the graph. It panics if the added node ID matches an existing node ID. -func (g *UndirectedGraph) AddNode(n graph.Node) { - if _, exists := g.nodes[n.ID()]; exists { - panic(fmt.Sprintf("simple: node ID collision: %d", n.ID())) - } - g.nodes[n.ID()] = n - g.nodeIDs.Use(n.ID()) -} - -// Edge returns the edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -func (g *UndirectedGraph) Edge(uid, vid int64) graph.Edge { - return g.EdgeBetween(uid, vid) -} - -// EdgeBetween returns the edge between nodes x and y. -func (g *UndirectedGraph) EdgeBetween(xid, yid int64) graph.Edge { - edge, ok := g.edges[xid][yid] - if !ok { - return nil - } - if edge.From().ID() == xid { - return edge - } - return edge.ReversedEdge() -} - -// Edges returns all the edges in the graph. -func (g *UndirectedGraph) Edges() graph.Edges { - if len(g.edges) == 0 { - return graph.Empty - } - var edges []graph.Edge - seen := make(map[[2]int64]struct{}) - for _, u := range g.edges { - for _, e := range u { - uid := e.From().ID() - vid := e.To().ID() - if _, ok := seen[[2]int64{uid, vid}]; ok { - continue - } - seen[[2]int64{uid, vid}] = struct{}{} - seen[[2]int64{vid, uid}] = struct{}{} - edges = append(edges, e) - } - } - if len(edges) == 0 { - return graph.Empty - } - return iterator.NewOrderedEdges(edges) -} - -// From returns all nodes in g that can be reached directly from n. -func (g *UndirectedGraph) From(id int64) graph.Nodes { - if _, ok := g.nodes[id]; !ok { - return graph.Empty - } - - nodes := make([]graph.Node, len(g.edges[id])) - i := 0 - for from := range g.edges[id] { - nodes[i] = g.nodes[from] - i++ - } - if len(nodes) == 0 { - return graph.Empty - } - return iterator.NewOrderedNodes(nodes) -} - -// HasEdgeBetween returns whether an edge exists between nodes x and y. -func (g *UndirectedGraph) HasEdgeBetween(xid, yid int64) bool { - _, ok := g.edges[xid][yid] - return ok -} - -// NewEdge returns a new Edge from the source to the destination node. -func (g *UndirectedGraph) NewEdge(from, to graph.Node) graph.Edge { - return Edge{F: from, T: to} -} - -// NewNode returns a new unique Node to be added to g. The Node's ID does -// not become valid in g until the Node is added to g. -func (g *UndirectedGraph) NewNode() graph.Node { - if len(g.nodes) == 0 { - return Node(0) - } - if int64(len(g.nodes)) == uid.Max { - panic("simple: cannot allocate node: no slot") - } - return Node(g.nodeIDs.NewID()) -} - -// Node returns the node with the given ID if it exists in the graph, -// and nil otherwise. -func (g *UndirectedGraph) Node(id int64) graph.Node { - return g.nodes[id] -} - -// Nodes returns all the nodes in the graph. -func (g *UndirectedGraph) Nodes() graph.Nodes { - if len(g.nodes) == 0 { - return graph.Empty - } - nodes := make([]graph.Node, len(g.nodes)) - i := 0 - for _, n := range g.nodes { - nodes[i] = n - i++ - } - return iterator.NewOrderedNodes(nodes) -} - -// RemoveEdge removes the edge with the given end IDs from the graph, leaving the terminal nodes. -// If the edge does not exist it is a no-op. -func (g *UndirectedGraph) RemoveEdge(fid, tid int64) { - if _, ok := g.nodes[fid]; !ok { - return - } - if _, ok := g.nodes[tid]; !ok { - return - } - - delete(g.edges[fid], tid) - delete(g.edges[tid], fid) -} - -// RemoveNode removes the node with the given ID from the graph, as well as any edges attached -// to it. If the node is not in the graph it is a no-op. -func (g *UndirectedGraph) RemoveNode(id int64) { - if _, ok := g.nodes[id]; !ok { - return - } - delete(g.nodes, id) - - for from := range g.edges[id] { - delete(g.edges[from], id) - } - delete(g.edges, id) - - g.nodeIDs.Release(id) -} - -// SetEdge adds e, an edge from one node to another. If the nodes do not exist, they are added -// and are set to the nodes of the edge otherwise. -// It will panic if the IDs of the e.From and e.To are equal. -func (g *UndirectedGraph) SetEdge(e graph.Edge) { - var ( - from = e.From() - fid = from.ID() - to = e.To() - tid = to.ID() - ) - - if fid == tid { - panic("simple: adding self edge") - } - - if _, ok := g.nodes[fid]; !ok { - g.AddNode(from) - } else { - g.nodes[fid] = from - } - if _, ok := g.nodes[tid]; !ok { - g.AddNode(to) - } else { - g.nodes[tid] = to - } - - if fm, ok := g.edges[fid]; ok { - fm[tid] = e - } else { - g.edges[fid] = map[int64]graph.Edge{tid: e} - } - if tm, ok := g.edges[tid]; ok { - tm[fid] = e - } else { - g.edges[tid] = map[int64]graph.Edge{fid: e} - } -} diff --git a/vendor/gonum.org/v1/gonum/graph/simple/weighted_directed.go b/vendor/gonum.org/v1/gonum/graph/simple/weighted_directed.go deleted file mode 100644 index 2e251df..0000000 --- a/vendor/gonum.org/v1/gonum/graph/simple/weighted_directed.go +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright ©2014 The Gonum 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 simple - -import ( - "fmt" - - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/internal/uid" - "gonum.org/v1/gonum/graph/iterator" -) - -var ( - wdg *WeightedDirectedGraph - - _ graph.Graph = wdg - _ graph.Weighted = wdg - _ graph.Directed = wdg - _ graph.WeightedDirected = wdg - _ graph.NodeAdder = wdg - _ graph.NodeRemover = wdg - _ graph.WeightedEdgeAdder = wdg - _ graph.EdgeRemover = wdg -) - -// WeightedDirectedGraph implements a generalized weighted directed graph. -type WeightedDirectedGraph struct { - nodes map[int64]graph.Node - from map[int64]map[int64]graph.WeightedEdge - to map[int64]map[int64]graph.WeightedEdge - - self, absent float64 - - nodeIDs uid.Set -} - -// NewWeightedDirectedGraph returns a WeightedDirectedGraph with the specified self and absent -// edge weight values. -func NewWeightedDirectedGraph(self, absent float64) *WeightedDirectedGraph { - return &WeightedDirectedGraph{ - nodes: make(map[int64]graph.Node), - from: make(map[int64]map[int64]graph.WeightedEdge), - to: make(map[int64]map[int64]graph.WeightedEdge), - - self: self, - absent: absent, - - nodeIDs: uid.NewSet(), - } -} - -// AddNode adds n to the graph. It panics if the added node ID matches an existing node ID. -func (g *WeightedDirectedGraph) AddNode(n graph.Node) { - if _, exists := g.nodes[n.ID()]; exists { - panic(fmt.Sprintf("simple: node ID collision: %d", n.ID())) - } - g.nodes[n.ID()] = n - g.nodeIDs.Use(n.ID()) -} - -// Edge returns the edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -func (g *WeightedDirectedGraph) Edge(uid, vid int64) graph.Edge { - return g.WeightedEdge(uid, vid) -} - -// Edges returns all the edges in the graph. -func (g *WeightedDirectedGraph) Edges() graph.Edges { - var edges []graph.Edge - for _, u := range g.nodes { - for _, e := range g.from[u.ID()] { - edges = append(edges, e) - } - } - if len(edges) == 0 { - return graph.Empty - } - return iterator.NewOrderedEdges(edges) -} - -// From returns all nodes in g that can be reached directly from n. -func (g *WeightedDirectedGraph) From(id int64) graph.Nodes { - if _, ok := g.from[id]; !ok { - return graph.Empty - } - - from := make([]graph.Node, len(g.from[id])) - i := 0 - for vid := range g.from[id] { - from[i] = g.nodes[vid] - i++ - } - if len(from) == 0 { - return graph.Empty - } - return iterator.NewOrderedNodes(from) -} - -// HasEdgeBetween returns whether an edge exists between nodes x and y without -// considering direction. -func (g *WeightedDirectedGraph) HasEdgeBetween(xid, yid int64) bool { - if _, ok := g.from[xid][yid]; ok { - return true - } - _, ok := g.from[yid][xid] - return ok -} - -// HasEdgeFromTo returns whether an edge exists in the graph from u to v. -func (g *WeightedDirectedGraph) HasEdgeFromTo(uid, vid int64) bool { - if _, ok := g.from[uid][vid]; !ok { - return false - } - return true -} - -// NewNode returns a new unique Node to be added to g. The Node's ID does -// not become valid in g until the Node is added to g. -func (g *WeightedDirectedGraph) NewNode() graph.Node { - if len(g.nodes) == 0 { - return Node(0) - } - if int64(len(g.nodes)) == uid.Max { - panic("simple: cannot allocate node: no slot") - } - return Node(g.nodeIDs.NewID()) -} - -// NewWeightedEdge returns a new weighted edge from the source to the destination node. -func (g *WeightedDirectedGraph) NewWeightedEdge(from, to graph.Node, weight float64) graph.WeightedEdge { - return WeightedEdge{F: from, T: to, W: weight} -} - -// Node returns the node with the given ID if it exists in the graph, -// and nil otherwise. -func (g *WeightedDirectedGraph) Node(id int64) graph.Node { - return g.nodes[id] -} - -// Nodes returns all the nodes in the graph. -func (g *WeightedDirectedGraph) Nodes() graph.Nodes { - if len(g.nodes) == 0 { - return graph.Empty - } - nodes := make([]graph.Node, len(g.nodes)) - i := 0 - for _, n := range g.nodes { - nodes[i] = n - i++ - } - return iterator.NewOrderedNodes(nodes) -} - -// RemoveEdge removes the edge with the given end point IDs from the graph, leaving the terminal -// nodes. If the edge does not exist it is a no-op. -func (g *WeightedDirectedGraph) RemoveEdge(fid, tid int64) { - if _, ok := g.nodes[fid]; !ok { - return - } - if _, ok := g.nodes[tid]; !ok { - return - } - - delete(g.from[fid], tid) - delete(g.to[tid], fid) -} - -// RemoveNode removes the node with the given ID from the graph, as well as any edges attached -// to it. If the node is not in the graph it is a no-op. -func (g *WeightedDirectedGraph) RemoveNode(id int64) { - if _, ok := g.nodes[id]; !ok { - return - } - delete(g.nodes, id) - - for from := range g.from[id] { - delete(g.to[from], id) - } - delete(g.from, id) - - for to := range g.to[id] { - delete(g.from[to], id) - } - delete(g.to, id) - - g.nodeIDs.Release(id) -} - -// SetWeightedEdge adds a weighted edge from one node to another. If the nodes do not exist, they are added -// and are set to the nodes of the edge otherwise. -// It will panic if the IDs of the e.From and e.To are equal. -func (g *WeightedDirectedGraph) SetWeightedEdge(e graph.WeightedEdge) { - var ( - from = e.From() - fid = from.ID() - to = e.To() - tid = to.ID() - ) - - if fid == tid { - panic("simple: adding self edge") - } - - if _, ok := g.nodes[fid]; !ok { - g.AddNode(from) - } else { - g.nodes[fid] = from - } - if _, ok := g.nodes[tid]; !ok { - g.AddNode(to) - } else { - g.nodes[tid] = to - } - - if fm, ok := g.from[fid]; ok { - fm[tid] = e - } else { - g.from[fid] = map[int64]graph.WeightedEdge{tid: e} - } - if tm, ok := g.to[tid]; ok { - tm[fid] = e - } else { - g.to[tid] = map[int64]graph.WeightedEdge{fid: e} - } -} - -// To returns all nodes in g that can reach directly to n. -func (g *WeightedDirectedGraph) To(id int64) graph.Nodes { - if _, ok := g.to[id]; !ok { - return graph.Empty - } - - to := make([]graph.Node, len(g.to[id])) - i := 0 - for uid := range g.to[id] { - to[i] = g.nodes[uid] - i++ - } - if len(to) == 0 { - return graph.Empty - } - return iterator.NewOrderedNodes(to) -} - -// Weight returns the weight for the edge between x and y if Edge(x, y) returns a non-nil Edge. -// If x and y are the same node or there is no joining edge between the two nodes the weight -// value returned is either the graph's absent or self value. Weight returns true if an edge -// exists between x and y or if x and y have the same ID, false otherwise. -func (g *WeightedDirectedGraph) Weight(xid, yid int64) (w float64, ok bool) { - if xid == yid { - return g.self, true - } - if to, ok := g.from[xid]; ok { - if e, ok := to[yid]; ok { - return e.Weight(), true - } - } - return g.absent, false -} - -// WeightedEdge returns the weighted edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -func (g *WeightedDirectedGraph) WeightedEdge(uid, vid int64) graph.WeightedEdge { - edge, ok := g.from[uid][vid] - if !ok { - return nil - } - return edge -} - -// WeightedEdges returns all the weighted edges in the graph. -func (g *WeightedDirectedGraph) WeightedEdges() graph.WeightedEdges { - var edges []graph.WeightedEdge - for _, u := range g.nodes { - for _, e := range g.from[u.ID()] { - edges = append(edges, e) - } - } - if len(edges) == 0 { - return graph.Empty - } - return iterator.NewOrderedWeightedEdges(edges) -} diff --git a/vendor/gonum.org/v1/gonum/graph/simple/weighted_undirected.go b/vendor/gonum.org/v1/gonum/graph/simple/weighted_undirected.go deleted file mode 100644 index e0a1b38..0000000 --- a/vendor/gonum.org/v1/gonum/graph/simple/weighted_undirected.go +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright ©2014 The Gonum 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 simple - -import ( - "fmt" - - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/internal/uid" - "gonum.org/v1/gonum/graph/iterator" -) - -var ( - wug *WeightedUndirectedGraph - - _ graph.Graph = wug - _ graph.Weighted = wug - _ graph.Undirected = wug - _ graph.WeightedUndirected = wug - _ graph.NodeAdder = wug - _ graph.NodeRemover = wug - _ graph.WeightedEdgeAdder = wug - _ graph.EdgeRemover = wug -) - -// WeightedUndirectedGraph implements a generalized weighted undirected graph. -type WeightedUndirectedGraph struct { - nodes map[int64]graph.Node - edges map[int64]map[int64]graph.WeightedEdge - - self, absent float64 - - nodeIDs uid.Set -} - -// NewWeightedUndirectedGraph returns an WeightedUndirectedGraph with the specified self and absent -// edge weight values. -func NewWeightedUndirectedGraph(self, absent float64) *WeightedUndirectedGraph { - return &WeightedUndirectedGraph{ - nodes: make(map[int64]graph.Node), - edges: make(map[int64]map[int64]graph.WeightedEdge), - - self: self, - absent: absent, - - nodeIDs: uid.NewSet(), - } -} - -// AddNode adds n to the graph. It panics if the added node ID matches an existing node ID. -func (g *WeightedUndirectedGraph) AddNode(n graph.Node) { - if _, exists := g.nodes[n.ID()]; exists { - panic(fmt.Sprintf("simple: node ID collision: %d", n.ID())) - } - g.nodes[n.ID()] = n - g.nodeIDs.Use(n.ID()) -} - -// Edge returns the edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -func (g *WeightedUndirectedGraph) Edge(uid, vid int64) graph.Edge { - return g.WeightedEdgeBetween(uid, vid) -} - -// EdgeBetween returns the edge between nodes x and y. -func (g *WeightedUndirectedGraph) EdgeBetween(xid, yid int64) graph.Edge { - return g.WeightedEdgeBetween(xid, yid) -} - -// Edges returns all the edges in the graph. -func (g *WeightedUndirectedGraph) Edges() graph.Edges { - if len(g.edges) == 0 { - return graph.Empty - } - var edges []graph.Edge - seen := make(map[[2]int64]struct{}) - for _, u := range g.edges { - for _, e := range u { - uid := e.From().ID() - vid := e.To().ID() - if _, ok := seen[[2]int64{uid, vid}]; ok { - continue - } - seen[[2]int64{uid, vid}] = struct{}{} - seen[[2]int64{vid, uid}] = struct{}{} - edges = append(edges, e) - } - } - if len(edges) == 0 { - return graph.Empty - } - return iterator.NewOrderedEdges(edges) -} - -// From returns all nodes in g that can be reached directly from n. -func (g *WeightedUndirectedGraph) From(id int64) graph.Nodes { - if _, ok := g.nodes[id]; !ok { - return graph.Empty - } - - nodes := make([]graph.Node, len(g.edges[id])) - i := 0 - for from := range g.edges[id] { - nodes[i] = g.nodes[from] - i++ - } - if len(nodes) == 0 { - return graph.Empty - } - return iterator.NewOrderedNodes(nodes) -} - -// HasEdgeBetween returns whether an edge exists between nodes x and y. -func (g *WeightedUndirectedGraph) HasEdgeBetween(xid, yid int64) bool { - _, ok := g.edges[xid][yid] - return ok -} - -// NewNode returns a new unique Node to be added to g. The Node's ID does -// not become valid in g until the Node is added to g. -func (g *WeightedUndirectedGraph) NewNode() graph.Node { - if len(g.nodes) == 0 { - return Node(0) - } - if int64(len(g.nodes)) == uid.Max { - panic("simple: cannot allocate node: no slot") - } - return Node(g.nodeIDs.NewID()) -} - -// NewWeightedEdge returns a new weighted edge from the source to the destination node. -func (g *WeightedUndirectedGraph) NewWeightedEdge(from, to graph.Node, weight float64) graph.WeightedEdge { - return WeightedEdge{F: from, T: to, W: weight} -} - -// Node returns the node with the given ID if it exists in the graph, -// and nil otherwise. -func (g *WeightedUndirectedGraph) Node(id int64) graph.Node { - return g.nodes[id] -} - -// Nodes returns all the nodes in the graph. -func (g *WeightedUndirectedGraph) Nodes() graph.Nodes { - if len(g.nodes) == 0 { - return graph.Empty - } - nodes := make([]graph.Node, len(g.nodes)) - i := 0 - for _, n := range g.nodes { - nodes[i] = n - i++ - } - return iterator.NewOrderedNodes(nodes) -} - -// RemoveEdge removes the edge with the given end point IDs from the graph, leaving the terminal -// nodes. If the edge does not exist it is a no-op. -func (g *WeightedUndirectedGraph) RemoveEdge(fid, tid int64) { - if _, ok := g.nodes[fid]; !ok { - return - } - if _, ok := g.nodes[tid]; !ok { - return - } - - delete(g.edges[fid], tid) - delete(g.edges[tid], fid) -} - -// RemoveNode removes the node with the given ID from the graph, as well as any edges attached -// to it. If the node is not in the graph it is a no-op. -func (g *WeightedUndirectedGraph) RemoveNode(id int64) { - if _, ok := g.nodes[id]; !ok { - return - } - delete(g.nodes, id) - - for from := range g.edges[id] { - delete(g.edges[from], id) - } - delete(g.edges, id) - - g.nodeIDs.Release(id) -} - -// SetWeightedEdge adds a weighted edge from one node to another. If the nodes do not exist, they are added -// and are set to the nodes of the edge otherwise. -// It will panic if the IDs of the e.From and e.To are equal. -func (g *WeightedUndirectedGraph) SetWeightedEdge(e graph.WeightedEdge) { - var ( - from = e.From() - fid = from.ID() - to = e.To() - tid = to.ID() - ) - - if fid == tid { - panic("simple: adding self edge") - } - - if _, ok := g.nodes[fid]; !ok { - g.AddNode(from) - } else { - g.nodes[fid] = from - } - if _, ok := g.nodes[tid]; !ok { - g.AddNode(to) - } else { - g.nodes[tid] = to - } - - if fm, ok := g.edges[fid]; ok { - fm[tid] = e - } else { - g.edges[fid] = map[int64]graph.WeightedEdge{tid: e} - } - if tm, ok := g.edges[tid]; ok { - tm[fid] = e - } else { - g.edges[tid] = map[int64]graph.WeightedEdge{fid: e} - } -} - -// Weight returns the weight for the edge between x and y if Edge(x, y) returns a non-nil Edge. -// If x and y are the same node or there is no joining edge between the two nodes the weight -// value returned is either the graph's absent or self value. Weight returns true if an edge -// exists between x and y or if x and y have the same ID, false otherwise. -func (g *WeightedUndirectedGraph) Weight(xid, yid int64) (w float64, ok bool) { - if xid == yid { - return g.self, true - } - if n, ok := g.edges[xid]; ok { - if e, ok := n[yid]; ok { - return e.Weight(), true - } - } - return g.absent, false -} - -// WeightedEdge returns the weighted edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -func (g *WeightedUndirectedGraph) WeightedEdge(uid, vid int64) graph.WeightedEdge { - return g.WeightedEdgeBetween(uid, vid) -} - -// WeightedEdgeBetween returns the weighted edge between nodes x and y. -func (g *WeightedUndirectedGraph) WeightedEdgeBetween(xid, yid int64) graph.WeightedEdge { - edge, ok := g.edges[xid][yid] - if !ok { - return nil - } - if edge.From().ID() == xid { - return edge - } - return edge.ReversedEdge().(graph.WeightedEdge) -} - -// WeightedEdges returns all the weighted edges in the graph. -func (g *WeightedUndirectedGraph) WeightedEdges() graph.WeightedEdges { - var edges []graph.WeightedEdge - seen := make(map[[2]int64]struct{}) - for _, u := range g.edges { - for _, e := range u { - uid := e.From().ID() - vid := e.To().ID() - if _, ok := seen[[2]int64{uid, vid}]; ok { - continue - } - seen[[2]int64{uid, vid}] = struct{}{} - seen[[2]int64{vid, uid}] = struct{}{} - edges = append(edges, e) - } - } - if len(edges) == 0 { - return graph.Empty - } - return iterator.NewOrderedWeightedEdges(edges) -} diff --git a/vendor/gonum.org/v1/gonum/graph/topo/bron_kerbosch.go b/vendor/gonum.org/v1/gonum/graph/topo/bron_kerbosch.go deleted file mode 100644 index 83fdb5b..0000000 --- a/vendor/gonum.org/v1/gonum/graph/topo/bron_kerbosch.go +++ /dev/null @@ -1,250 +0,0 @@ -// Copyright ©2015 The Gonum 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 topo - -import ( - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/internal/ordered" - "gonum.org/v1/gonum/graph/internal/set" -) - -// DegeneracyOrdering returns the degeneracy ordering and the k-cores of -// the undirected graph g. -func DegeneracyOrdering(g graph.Undirected) (order []graph.Node, cores [][]graph.Node) { - order, offsets := degeneracyOrdering(g) - - ordered.Reverse(order) - cores = make([][]graph.Node, len(offsets)) - offset := len(order) - for i, n := range offsets { - cores[i] = order[offset-n : offset] - offset -= n - } - return order, cores -} - -// KCore returns the k-core of the undirected graph g with nodes in an -// optimal ordering for the coloring number. -func KCore(k int, g graph.Undirected) []graph.Node { - order, offsets := degeneracyOrdering(g) - - var offset int - for _, n := range offsets[:k] { - offset += n - } - core := make([]graph.Node, len(order)-offset) - copy(core, order[offset:]) - return core -} - -// degeneracyOrdering is the common code for DegeneracyOrdering and KCore. It -// returns l, the nodes of g in optimal ordering for coloring number and -// s, a set of relative offsets into l for each k-core, where k is an index -// into s. -func degeneracyOrdering(g graph.Undirected) (l []graph.Node, s []int) { - nodes := graph.NodesOf(g.Nodes()) - - // The algorithm used here is essentially as described at - // http://en.wikipedia.org/w/index.php?title=Degeneracy_%28graph_theory%29&oldid=640308710 - - // Initialize an output list L in return parameters. - - // Compute a number d_v for each vertex v in G, - // the number of neighbors of v that are not already in L. - // Initially, these numbers are just the degrees of the vertices. - dv := make(map[int64]int, len(nodes)) - var ( - maxDegree int - neighbours = make(map[int64][]graph.Node) - ) - for _, n := range nodes { - id := n.ID() - adj := graph.NodesOf(g.From(id)) - neighbours[id] = adj - dv[id] = len(adj) - if len(adj) > maxDegree { - maxDegree = len(adj) - } - } - - // Initialize an array D such that D[i] contains a list of the - // vertices v that are not already in L for which d_v = i. - d := make([][]graph.Node, maxDegree+1) - for _, n := range nodes { - deg := dv[n.ID()] - d[deg] = append(d[deg], n) - } - - // Initialize k to 0. - k := 0 - // Repeat n times: - s = []int{0} - for range nodes { - // Scan the array cells D[0], D[1], ... until - // finding an i for which D[i] is nonempty. - var ( - i int - di []graph.Node - ) - for i, di = range d { - if len(di) != 0 { - break - } - } - - // Set k to max(k,i). - if i > k { - k = i - s = append(s, make([]int, k-len(s)+1)...) - } - - // Select a vertex v from D[i]. Add v to the - // beginning of L and remove it from D[i]. - var v graph.Node - v, d[i] = di[len(di)-1], di[:len(di)-1] - l = append(l, v) - s[k]++ - delete(dv, v.ID()) - - // For each neighbor w of v not already in L, - // subtract one from d_w and move w to the - // cell of D corresponding to the new value of d_w. - for _, w := range neighbours[v.ID()] { - dw, ok := dv[w.ID()] - if !ok { - continue - } - for i, n := range d[dw] { - if n.ID() == w.ID() { - d[dw][i], d[dw] = d[dw][len(d[dw])-1], d[dw][:len(d[dw])-1] - dw-- - d[dw] = append(d[dw], w) - break - } - } - dv[w.ID()] = dw - } - } - - return l, s -} - -// BronKerbosch returns the set of maximal cliques of the undirected graph g. -func BronKerbosch(g graph.Undirected) [][]graph.Node { - nodes := graph.NodesOf(g.Nodes()) - - // The algorithm used here is essentially BronKerbosch3 as described at - // http://en.wikipedia.org/w/index.php?title=Bron%E2%80%93Kerbosch_algorithm&oldid=656805858 - - p := set.NewNodesSize(len(nodes)) - for _, n := range nodes { - p.Add(n) - } - x := set.NewNodes() - var bk bronKerbosch - order, _ := degeneracyOrdering(g) - ordered.Reverse(order) - for _, v := range order { - neighbours := graph.NodesOf(g.From(v.ID())) - nv := set.NewNodesSize(len(neighbours)) - for _, n := range neighbours { - nv.Add(n) - } - bk.maximalCliquePivot(g, []graph.Node{v}, set.IntersectionOfNodes(p, nv), set.IntersectionOfNodes(x, nv)) - p.Remove(v) - x.Add(v) - } - return bk -} - -type bronKerbosch [][]graph.Node - -func (bk *bronKerbosch) maximalCliquePivot(g graph.Undirected, r []graph.Node, p, x set.Nodes) { - if len(p) == 0 && len(x) == 0 { - *bk = append(*bk, r) - return - } - - neighbours := bk.choosePivotFrom(g, p, x) - nu := set.NewNodesSize(len(neighbours)) - for _, n := range neighbours { - nu.Add(n) - } - for _, v := range p { - if nu.Has(v) { - continue - } - vid := v.ID() - neighbours := graph.NodesOf(g.From(vid)) - nv := set.NewNodesSize(len(neighbours)) - for _, n := range neighbours { - nv.Add(n) - } - - var found bool - for _, n := range r { - if n.ID() == vid { - found = true - break - } - } - var sr []graph.Node - if !found { - sr = append(r[:len(r):len(r)], v) - } - - bk.maximalCliquePivot(g, sr, set.IntersectionOfNodes(p, nv), set.IntersectionOfNodes(x, nv)) - p.Remove(v) - x.Add(v) - } -} - -func (*bronKerbosch) choosePivotFrom(g graph.Undirected, p, x set.Nodes) (neighbors []graph.Node) { - // TODO(kortschak): Investigate the impact of pivot choice that maximises - // |p ⋂ neighbours(u)| as a function of input size. Until then, leave as - // compile time option. - if !tomitaTanakaTakahashi { - for _, n := range p { - return graph.NodesOf(g.From(n.ID())) - } - for _, n := range x { - return graph.NodesOf(g.From(n.ID())) - } - panic("bronKerbosch: empty set") - } - - var ( - max = -1 - pivot graph.Node - ) - maxNeighbors := func(s set.Nodes) { - outer: - for _, u := range s { - nb := graph.NodesOf(g.From(u.ID())) - c := len(nb) - if c <= max { - continue - } - for n := range nb { - if _, ok := p[int64(n)]; ok { - continue - } - c-- - if c <= max { - continue outer - } - } - max = c - pivot = u - neighbors = nb - } - } - maxNeighbors(p) - maxNeighbors(x) - if pivot == nil { - panic("bronKerbosch: empty set") - } - return neighbors -} diff --git a/vendor/gonum.org/v1/gonum/graph/topo/clique_graph.go b/vendor/gonum.org/v1/gonum/graph/topo/clique_graph.go deleted file mode 100644 index 28f1b96..0000000 --- a/vendor/gonum.org/v1/gonum/graph/topo/clique_graph.go +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright ©2017 The Gonum 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 topo - -import ( - "sort" - - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/internal/ordered" - "gonum.org/v1/gonum/graph/internal/set" -) - -// Builder is a pure topological graph construction type. -type Builder interface { - AddNode(graph.Node) - SetEdge(graph.Edge) -} - -// CliqueGraph builds the clique graph of g in dst using Clique and CliqueGraphEdge -// nodes and edges. The nodes returned by calls to Nodes on the nodes and edges of -// the constructed graph are the cliques and the common nodes between cliques -// respectively. The dst graph is not cleared. -func CliqueGraph(dst Builder, g graph.Undirected) { - cliques := BronKerbosch(g) - - // Construct a consistent view of cliques in g. Sorting costs - // us a little, but not as much as the cliques themselves. - for _, c := range cliques { - sort.Sort(ordered.ByID(c)) - } - sort.Sort(ordered.BySliceIDs(cliques)) - - cliqueNodes := make(cliqueNodeSets, len(cliques)) - for id, c := range cliques { - s := set.NewNodesSize(len(c)) - for _, n := range c { - s.Add(n) - } - ns := &nodeSet{Clique: Clique{id: int64(id), nodes: c}, nodes: s} - dst.AddNode(ns.Clique) - for _, n := range c { - nid := n.ID() - cliqueNodes[nid] = append(cliqueNodes[nid], ns) - } - } - - for _, cliques := range cliqueNodes { - for i, uc := range cliques { - for _, vc := range cliques[i+1:] { - // Retain the nodes that contribute to the - // edge between the cliques. - var edgeNodes []graph.Node - switch 1 { - case len(uc.Clique.nodes): - edgeNodes = []graph.Node{uc.Clique.nodes[0]} - case len(vc.Clique.nodes): - edgeNodes = []graph.Node{vc.Clique.nodes[0]} - default: - for _, n := range set.IntersectionOfNodes(uc.nodes, vc.nodes) { - edgeNodes = append(edgeNodes, n) - } - sort.Sort(ordered.ByID(edgeNodes)) - } - - dst.SetEdge(CliqueGraphEdge{from: uc.Clique, to: vc.Clique, nodes: edgeNodes}) - } - } - } -} - -type cliqueNodeSets map[int64][]*nodeSet - -type nodeSet struct { - Clique - nodes set.Nodes -} - -// Clique is a node in a clique graph. -type Clique struct { - id int64 - nodes []graph.Node -} - -// ID returns the node ID. -func (n Clique) ID() int64 { return n.id } - -// Nodes returns the nodes in the clique. -func (n Clique) Nodes() []graph.Node { return n.nodes } - -// CliqueGraphEdge is an edge in a clique graph. -type CliqueGraphEdge struct { - from, to Clique - nodes []graph.Node -} - -// From returns the from node of the edge. -func (e CliqueGraphEdge) From() graph.Node { return e.from } - -// To returns the to node of the edge. -func (e CliqueGraphEdge) To() graph.Node { return e.to } - -// ReversedEdge returns a new CliqueGraphEdge with -// the edge end points swapped. The nodes of the -// new edge are shared with the receiver. -func (e CliqueGraphEdge) ReversedEdge() graph.Edge { e.from, e.to = e.to, e.from; return e } - -// Nodes returns the common nodes in the cliques of the underlying graph -// corresponding to the from and to nodes in the clique graph. -func (e CliqueGraphEdge) Nodes() []graph.Node { return e.nodes } diff --git a/vendor/gonum.org/v1/gonum/graph/topo/doc.go b/vendor/gonum.org/v1/gonum/graph/topo/doc.go deleted file mode 100644 index cbcdff1..0000000 --- a/vendor/gonum.org/v1/gonum/graph/topo/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright ©2017 The Gonum 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 topo provides graph topology analysis functions. -package topo // import "gonum.org/v1/gonum/graph/topo" diff --git a/vendor/gonum.org/v1/gonum/graph/topo/johnson_cycles.go b/vendor/gonum.org/v1/gonum/graph/topo/johnson_cycles.go deleted file mode 100644 index 8a78ba2..0000000 --- a/vendor/gonum.org/v1/gonum/graph/topo/johnson_cycles.go +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright ©2015 The Gonum 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 topo - -import ( - "sort" - - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/internal/ordered" - "gonum.org/v1/gonum/graph/internal/set" - "gonum.org/v1/gonum/graph/iterator" -) - -// johnson implements Johnson's "Finding all the elementary -// circuits of a directed graph" algorithm. SIAM J. Comput. 4(1):1975. -// -// Comments in the johnson methods are kept in sync with the comments -// and labels from the paper. -type johnson struct { - adjacent johnsonGraph // SCC adjacency list. - b []set.Ints // Johnson's "B-list". - blocked []bool - s int - - stack []graph.Node - - result [][]graph.Node -} - -// DirectedCyclesIn returns the set of elementary cycles in the graph g. -func DirectedCyclesIn(g graph.Directed) [][]graph.Node { - jg := johnsonGraphFrom(g) - j := johnson{ - adjacent: jg, - b: make([]set.Ints, len(jg.orig)), - blocked: make([]bool, len(jg.orig)), - } - - // len(j.nodes) is the order of g. - for j.s < len(j.adjacent.orig)-1 { - // We use the previous SCC adjacency to reduce the work needed. - sccs := TarjanSCC(j.adjacent.subgraph(j.s)) - // A_k = adjacency structure of strong component K with least - // vertex in subgraph of G induced by {s, s+1, ... ,n}. - j.adjacent = j.adjacent.sccSubGraph(sccs, 2) // Only allow SCCs with >= 2 vertices. - if j.adjacent.order() == 0 { - break - } - - // s = least vertex in V_k - if s := j.adjacent.leastVertexIndex(); s < j.s { - j.s = s - } - for i, v := range j.adjacent.orig { - if !j.adjacent.nodes.Has(v.ID()) { - continue - } - if len(j.adjacent.succ[v.ID()]) > 0 { - j.blocked[i] = false - j.b[i] = make(set.Ints) - } - } - //L3: - _ = j.circuit(j.s) - j.s++ - } - - return j.result -} - -// circuit is the CIRCUIT sub-procedure in the paper. -func (j *johnson) circuit(v int) bool { - f := false - n := j.adjacent.orig[v] - j.stack = append(j.stack, n) - j.blocked[v] = true - - //L1: - for w := range j.adjacent.succ[n.ID()] { - w := j.adjacent.indexOf(w) - if w == j.s { - // Output circuit composed of stack followed by s. - r := make([]graph.Node, len(j.stack)+1) - copy(r, j.stack) - r[len(r)-1] = j.adjacent.orig[j.s] - j.result = append(j.result, r) - f = true - } else if !j.blocked[w] { - if j.circuit(w) { - f = true - } - } - } - - //L2: - if f { - j.unblock(v) - } else { - for w := range j.adjacent.succ[n.ID()] { - j.b[j.adjacent.indexOf(w)].Add(v) - } - } - j.stack = j.stack[:len(j.stack)-1] - - return f -} - -// unblock is the UNBLOCK sub-procedure in the paper. -func (j *johnson) unblock(u int) { - j.blocked[u] = false - for w := range j.b[u] { - j.b[u].Remove(w) - if j.blocked[w] { - j.unblock(w) - } - } -} - -// johnsonGraph is an edge list representation of a graph with helpers -// necessary for Johnson's algorithm -type johnsonGraph struct { - // Keep the original graph nodes and a - // look-up to into the non-sparse - // collection of potentially sparse IDs. - orig []graph.Node - index map[int64]int - - nodes set.Int64s - succ map[int64]set.Int64s -} - -// johnsonGraphFrom returns a deep copy of the graph g. -func johnsonGraphFrom(g graph.Directed) johnsonGraph { - nodes := graph.NodesOf(g.Nodes()) - sort.Sort(ordered.ByID(nodes)) - c := johnsonGraph{ - orig: nodes, - index: make(map[int64]int, len(nodes)), - - nodes: make(set.Int64s, len(nodes)), - succ: make(map[int64]set.Int64s), - } - for i, u := range nodes { - uid := u.ID() - c.index[uid] = i - for _, v := range graph.NodesOf(g.From(uid)) { - if c.succ[uid] == nil { - c.succ[uid] = make(set.Int64s) - c.nodes.Add(uid) - } - c.nodes.Add(v.ID()) - c.succ[uid].Add(v.ID()) - } - } - return c -} - -// order returns the order of the graph. -func (g johnsonGraph) order() int { return g.nodes.Count() } - -// indexOf returns the index of the retained node for the given node ID. -func (g johnsonGraph) indexOf(id int64) int { - return g.index[id] -} - -// leastVertexIndex returns the index into orig of the least vertex. -func (g johnsonGraph) leastVertexIndex() int { - for _, v := range g.orig { - if g.nodes.Has(v.ID()) { - return g.indexOf(v.ID()) - } - } - panic("johnsonCycles: empty set") -} - -// subgraph returns a subgraph of g induced by {s, s+1, ... , n}. The -// subgraph is destructively generated in g. -func (g johnsonGraph) subgraph(s int) johnsonGraph { - sn := g.orig[s].ID() - for u, e := range g.succ { - if u < sn { - g.nodes.Remove(u) - delete(g.succ, u) - continue - } - for v := range e { - if v < sn { - g.succ[u].Remove(v) - } - } - } - return g -} - -// sccSubGraph returns the graph of the tarjan's strongly connected -// components with each SCC containing at least min vertices. -// sccSubGraph returns nil if there is no SCC with at least min -// members. -func (g johnsonGraph) sccSubGraph(sccs [][]graph.Node, min int) johnsonGraph { - if len(g.nodes) == 0 { - g.nodes = nil - g.succ = nil - return g - } - sub := johnsonGraph{ - orig: g.orig, - index: g.index, - nodes: make(set.Int64s), - succ: make(map[int64]set.Int64s), - } - - var n int - for _, scc := range sccs { - if len(scc) < min { - continue - } - n++ - for _, u := range scc { - for _, v := range scc { - if _, ok := g.succ[u.ID()][v.ID()]; ok { - if sub.succ[u.ID()] == nil { - sub.succ[u.ID()] = make(set.Int64s) - sub.nodes.Add(u.ID()) - } - sub.nodes.Add(v.ID()) - sub.succ[u.ID()].Add(v.ID()) - } - } - } - } - if n == 0 { - g.nodes = nil - g.succ = nil - return g - } - - return sub -} - -// Nodes is required to satisfy Tarjan. -func (g johnsonGraph) Nodes() graph.Nodes { - n := make([]graph.Node, 0, len(g.nodes)) - for id := range g.nodes { - n = append(n, johnsonGraphNode(id)) - } - return iterator.NewOrderedNodes(n) -} - -// Successors is required to satisfy Tarjan. -func (g johnsonGraph) From(id int64) graph.Nodes { - adj := g.succ[id] - if len(adj) == 0 { - return graph.Empty - } - succ := make([]graph.Node, 0, len(adj)) - for id := range adj { - succ = append(succ, johnsonGraphNode(id)) - } - return iterator.NewOrderedNodes(succ) -} - -func (johnsonGraph) Has(int64) bool { - panic("topo: unintended use of johnsonGraph") -} -func (johnsonGraph) Node(int64) graph.Node { - panic("topo: unintended use of johnsonGraph") -} -func (johnsonGraph) HasEdgeBetween(_, _ int64) bool { - panic("topo: unintended use of johnsonGraph") -} -func (johnsonGraph) Edge(_, _ int64) graph.Edge { - panic("topo: unintended use of johnsonGraph") -} -func (johnsonGraph) HasEdgeFromTo(_, _ int64) bool { - panic("topo: unintended use of johnsonGraph") -} -func (johnsonGraph) To(int64) graph.Nodes { - panic("topo: unintended use of johnsonGraph") -} - -type johnsonGraphNode int64 - -func (n johnsonGraphNode) ID() int64 { return int64(n) } diff --git a/vendor/gonum.org/v1/gonum/graph/topo/non_tomita_choice.go b/vendor/gonum.org/v1/gonum/graph/topo/non_tomita_choice.go deleted file mode 100644 index 36171d6..0000000 --- a/vendor/gonum.org/v1/gonum/graph/topo/non_tomita_choice.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !tomita - -package topo - -const tomitaTanakaTakahashi = false diff --git a/vendor/gonum.org/v1/gonum/graph/topo/paton_cycles.go b/vendor/gonum.org/v1/gonum/graph/topo/paton_cycles.go deleted file mode 100644 index 44b362a..0000000 --- a/vendor/gonum.org/v1/gonum/graph/topo/paton_cycles.go +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright ©2017 The Gonum 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 topo - -import ( - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/internal/linear" - "gonum.org/v1/gonum/graph/internal/set" -) - -// UndirectedCyclesIn returns a set of cycles that forms a cycle basis in the graph g. -// Any cycle in g can be constructed as a symmetric difference of its elements. -func UndirectedCyclesIn(g graph.Undirected) [][]graph.Node { - // From "An algorithm for finding a fundamental set of cycles of a graph" - // https://doi.org/10.1145/363219.363232 - - var cycles [][]graph.Node - done := make(set.Int64s) - var tree linear.NodeStack - nodes := g.Nodes() - for nodes.Next() { - n := nodes.Node() - id := n.ID() - if done.Has(id) { - continue - } - done.Add(id) - - tree = tree[:0] - tree.Push(n) - from := sets{id: set.Int64s{}} - to := map[int64]graph.Node{id: n} - - for tree.Len() != 0 { - u := tree.Pop() - uid := u.ID() - adj := from[uid] - for _, v := range graph.NodesOf(g.From(uid)) { - vid := v.ID() - switch { - case uid == vid: - cycles = append(cycles, []graph.Node{u}) - case !from.has(vid): - done.Add(vid) - to[vid] = u - tree.Push(v) - from.add(uid, vid) - case !adj.Has(vid): - c := []graph.Node{v, u} - adj := from[vid] - p := to[uid] - for !adj.Has(p.ID()) { - c = append(c, p) - p = to[p.ID()] - } - c = append(c, p, c[0]) - cycles = append(cycles, c) - adj.Add(uid) - } - } - } - } - - return cycles -} - -type sets map[int64]set.Int64s - -func (s sets) add(uid, vid int64) { - e, ok := s[vid] - if !ok { - e = make(set.Int64s) - s[vid] = e - } - e.Add(uid) -} - -func (s sets) has(uid int64) bool { - _, ok := s[uid] - return ok -} diff --git a/vendor/gonum.org/v1/gonum/graph/topo/tarjan.go b/vendor/gonum.org/v1/gonum/graph/topo/tarjan.go deleted file mode 100644 index 6471292..0000000 --- a/vendor/gonum.org/v1/gonum/graph/topo/tarjan.go +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright ©2015 The Gonum 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 topo - -import ( - "fmt" - "sort" - - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/internal/ordered" - "gonum.org/v1/gonum/graph/internal/set" -) - -// Unorderable is an error containing sets of unorderable graph.Nodes. -type Unorderable [][]graph.Node - -// Error satisfies the error interface. -func (e Unorderable) Error() string { - const maxNodes = 10 - var n int - for _, c := range e { - n += len(c) - } - if n > maxNodes { - // Don't return errors that are too long. - return fmt.Sprintf("topo: no topological ordering: %d nodes in %d cyclic components", n, len(e)) - } - return fmt.Sprintf("topo: no topological ordering: cyclic components: %v", [][]graph.Node(e)) -} - -func lexical(nodes []graph.Node) { sort.Sort(ordered.ByID(nodes)) } - -// Sort performs a topological sort of the directed graph g returning the 'from' to 'to' -// sort order. If a topological ordering is not possible, an Unorderable error is returned -// listing cyclic components in g with each cyclic component's members sorted by ID. When -// an Unorderable error is returned, each cyclic component's topological position within -// the sorted nodes is marked with a nil graph.Node. -func Sort(g graph.Directed) (sorted []graph.Node, err error) { - sccs := TarjanSCC(g) - return sortedFrom(sccs, lexical) -} - -// SortStabilized performs a topological sort of the directed graph g returning the 'from' -// to 'to' sort order, or the order defined by the in place order sort function where there -// is no unambiguous topological ordering. If a topological ordering is not possible, an -// Unorderable error is returned listing cyclic components in g with each cyclic component's -// members sorted by the provided order function. If order is nil, nodes are ordered lexically -// by node ID. When an Unorderable error is returned, each cyclic component's topological -// position within the sorted nodes is marked with a nil graph.Node. -func SortStabilized(g graph.Directed, order func([]graph.Node)) (sorted []graph.Node, err error) { - if order == nil { - order = lexical - } - sccs := tarjanSCCstabilized(g, order) - return sortedFrom(sccs, order) -} - -func sortedFrom(sccs [][]graph.Node, order func([]graph.Node)) ([]graph.Node, error) { - sorted := make([]graph.Node, 0, len(sccs)) - var sc Unorderable - for _, s := range sccs { - if len(s) != 1 { - order(s) - sc = append(sc, s) - sorted = append(sorted, nil) - continue - } - sorted = append(sorted, s[0]) - } - var err error - if sc != nil { - for i, j := 0, len(sc)-1; i < j; i, j = i+1, j-1 { - sc[i], sc[j] = sc[j], sc[i] - } - err = sc - } - ordered.Reverse(sorted) - return sorted, err -} - -// TarjanSCC returns the strongly connected components of the graph g using Tarjan's algorithm. -// -// A strongly connected component of a graph is a set of vertices where it's possible to reach any -// vertex in the set from any other (meaning there's a cycle between them.) -// -// Generally speaking, a directed graph where the number of strongly connected components is equal -// to the number of nodes is acyclic, unless you count reflexive edges as a cycle (which requires -// only a little extra testing.) -// -func TarjanSCC(g graph.Directed) [][]graph.Node { - return tarjanSCCstabilized(g, nil) -} - -func tarjanSCCstabilized(g graph.Directed, order func([]graph.Node)) [][]graph.Node { - nodes := graph.NodesOf(g.Nodes()) - var succ func(id int64) []graph.Node - if order == nil { - succ = func(id int64) []graph.Node { - return graph.NodesOf(g.From(id)) - } - } else { - order(nodes) - ordered.Reverse(nodes) - - succ = func(id int64) []graph.Node { - to := graph.NodesOf(g.From(id)) - order(to) - ordered.Reverse(to) - return to - } - } - - t := tarjan{ - succ: succ, - - indexTable: make(map[int64]int, len(nodes)), - lowLink: make(map[int64]int, len(nodes)), - onStack: make(set.Int64s), - } - for _, v := range nodes { - if t.indexTable[v.ID()] == 0 { - t.strongconnect(v) - } - } - return t.sccs -} - -// tarjan implements Tarjan's strongly connected component finding -// algorithm. The implementation is from the pseudocode at -// -// http://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm?oldid=642744644 -// -type tarjan struct { - succ func(id int64) []graph.Node - - index int - indexTable map[int64]int - lowLink map[int64]int - onStack set.Int64s - - stack []graph.Node - - sccs [][]graph.Node -} - -// strongconnect is the strongconnect function described in the -// wikipedia article. -func (t *tarjan) strongconnect(v graph.Node) { - vID := v.ID() - - // Set the depth index for v to the smallest unused index. - t.index++ - t.indexTable[vID] = t.index - t.lowLink[vID] = t.index - t.stack = append(t.stack, v) - t.onStack.Add(vID) - - // Consider successors of v. - for _, w := range t.succ(vID) { - wID := w.ID() - if t.indexTable[wID] == 0 { - // Successor w has not yet been visited; recur on it. - t.strongconnect(w) - t.lowLink[vID] = min(t.lowLink[vID], t.lowLink[wID]) - } else if t.onStack.Has(wID) { - // Successor w is in stack s and hence in the current SCC. - t.lowLink[vID] = min(t.lowLink[vID], t.indexTable[wID]) - } - } - - // If v is a root node, pop the stack and generate an SCC. - if t.lowLink[vID] == t.indexTable[vID] { - // Start a new strongly connected component. - var ( - scc []graph.Node - w graph.Node - ) - for { - w, t.stack = t.stack[len(t.stack)-1], t.stack[:len(t.stack)-1] - t.onStack.Remove(w.ID()) - // Add w to current strongly connected component. - scc = append(scc, w) - if w.ID() == vID { - break - } - } - // Output the current strongly connected component. - t.sccs = append(t.sccs, scc) - } -} - -func min(a, b int) int { - if a < b { - return a - } - return b -} diff --git a/vendor/gonum.org/v1/gonum/graph/topo/tomita_choice.go b/vendor/gonum.org/v1/gonum/graph/topo/tomita_choice.go deleted file mode 100644 index f85a0d6..0000000 --- a/vendor/gonum.org/v1/gonum/graph/topo/tomita_choice.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build tomita - -package topo - -const tomitaTanakaTakahashi = true diff --git a/vendor/gonum.org/v1/gonum/graph/topo/topo.go b/vendor/gonum.org/v1/gonum/graph/topo/topo.go deleted file mode 100644 index bc977b4..0000000 --- a/vendor/gonum.org/v1/gonum/graph/topo/topo.go +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright ©2014 The Gonum 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 topo - -import ( - "sort" - - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/internal/ordered" - "gonum.org/v1/gonum/graph/traverse" -) - -// IsPathIn returns whether path is a path in g. -// -// As special cases, IsPathIn returns true for a zero length path or for -// a path of length 1 when the node in path exists in the graph. -func IsPathIn(g graph.Graph, path []graph.Node) bool { - switch len(path) { - case 0: - return true - case 1: - return g.Node(path[0].ID()) != nil - default: - var canReach func(uid, vid int64) bool - switch g := g.(type) { - case graph.Directed: - canReach = g.HasEdgeFromTo - default: - canReach = g.HasEdgeBetween - } - - for i, u := range path[:len(path)-1] { - if !canReach(u.ID(), path[i+1].ID()) { - return false - } - } - return true - } -} - -// PathExistsIn returns whether there is a path in g starting at from extending -// to to. -// -// PathExistsIn exists as a helper function. If many tests for path existence -// are being performed, other approaches will be more efficient. -func PathExistsIn(g graph.Graph, from, to graph.Node) bool { - var t traverse.BreadthFirst - return t.Walk(g, from, func(n graph.Node, _ int) bool { return n.ID() == to.ID() }) != nil -} - -// ConnectedComponents returns the connected components of the undirected graph g. -func ConnectedComponents(g graph.Undirected) [][]graph.Node { - var ( - w traverse.DepthFirst - c []graph.Node - cc [][]graph.Node - ) - during := func(n graph.Node) { - c = append(c, n) - } - after := func() { - cc = append(cc, []graph.Node(nil)) - cc[len(cc)-1] = append(cc[len(cc)-1], c...) - c = c[:0] - } - w.WalkAll(g, nil, after, during) - - return cc -} - -// Equal returns whether two graphs are topologically equal. To be -// considered topologically equal, a and b must have identical sets -// of nodes and be identically traversable. -func Equal(a, b graph.Graph) bool { - aNodes := a.Nodes() - bNodes := b.Nodes() - if aNodes.Len() != bNodes.Len() { - return false - } - - aNodeSlice := graph.NodesOf(aNodes) - bNodeSlice := graph.NodesOf(bNodes) - sort.Sort(ordered.ByID(aNodeSlice)) - sort.Sort(ordered.ByID(bNodeSlice)) - for i, aU := range aNodeSlice { - id := aU.ID() - if id != bNodeSlice[i].ID() { - return false - } - - toA := a.From(id) - toB := b.From(id) - if toA.Len() != toB.Len() { - return false - } - - aAdjacent := graph.NodesOf(toA) - bAdjacent := graph.NodesOf(toB) - sort.Sort(ordered.ByID(aAdjacent)) - sort.Sort(ordered.ByID(bAdjacent)) - for i, aV := range aAdjacent { - id := aV.ID() - if id != bAdjacent[i].ID() { - return false - } - } - } - - return true -} diff --git a/vendor/gonum.org/v1/gonum/graph/traverse/doc.go b/vendor/gonum.org/v1/gonum/graph/traverse/doc.go deleted file mode 100644 index dc98bbf..0000000 --- a/vendor/gonum.org/v1/gonum/graph/traverse/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright ©2017 The Gonum 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 traverse provides basic graph traversal primitives. -package traverse // import "gonum.org/v1/gonum/graph/traverse" diff --git a/vendor/gonum.org/v1/gonum/graph/traverse/traverse.go b/vendor/gonum.org/v1/gonum/graph/traverse/traverse.go deleted file mode 100644 index 125b161..0000000 --- a/vendor/gonum.org/v1/gonum/graph/traverse/traverse.go +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright ©2015 The Gonum 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 traverse - -import ( - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/internal/linear" - "gonum.org/v1/gonum/graph/internal/set" -) - -var _ Graph = graph.Graph(nil) - -// Graph is the subset of graph.Graph necessary for graph traversal. -type Graph interface { - // From returns all nodes that can be reached directly - // from the node with the given ID. - From(id int64) graph.Nodes - - // Edge returns the edge from u to v, with IDs uid and vid, - // if such an edge exists and nil otherwise. The node v - // must be directly reachable from u as defined by - // the From method. - Edge(uid, vid int64) graph.Edge -} - -// BreadthFirst implements stateful breadth-first graph traversal. -type BreadthFirst struct { - // Visit is called on all nodes on their first visit. - Visit func(graph.Node) - - // Traverse is called on all edges that may be traversed - // during the walk. This includes edges that would hop to - // an already visited node. - // - // The value returned by Traverse determines whether - // an edge can be traversed during the walk. - Traverse func(graph.Edge) bool - - queue linear.NodeQueue - visited set.Int64s -} - -// Walk performs a breadth-first traversal of the graph g starting from the given node, -// depending on the Traverse field and the until parameter if they are non-nil. -// The traversal follows edges for which Traverse(edge) is true and returns the first node -// for which until(node, depth) is true. During the traversal, if the Visit field is -// non-nil, it is called with each node the first time it is visited. -func (b *BreadthFirst) Walk(g Graph, from graph.Node, until func(n graph.Node, d int) bool) graph.Node { - if b.visited == nil { - b.visited = make(set.Int64s) - } - b.queue.Enqueue(from) - if b.Visit != nil && !b.visited.Has(from.ID()) { - b.Visit(from) - } - b.visited.Add(from.ID()) - - var ( - depth int - children int - untilNext = 1 - ) - for b.queue.Len() > 0 { - t := b.queue.Dequeue() - if until != nil && until(t, depth) { - return t - } - tid := t.ID() - to := g.From(tid) - for to.Next() { - n := to.Node() - nid := n.ID() - if b.Traverse != nil && !b.Traverse(g.Edge(tid, nid)) { - continue - } - if b.visited.Has(nid) { - continue - } - if b.Visit != nil { - b.Visit(n) - } - b.visited.Add(nid) - children++ - b.queue.Enqueue(n) - } - if untilNext--; untilNext == 0 { - depth++ - untilNext = children - children = 0 - } - } - - return nil -} - -// WalkAll calls Walk for each unvisited node of the graph g using edges independent -// of their direction. The functions before and after are called prior to commencing -// and after completing each walk if they are non-nil respectively. The function -// during is called on each node as it is traversed. -func (b *BreadthFirst) WalkAll(g graph.Undirected, before, after func(), during func(graph.Node)) { - b.Reset() - nodes := g.Nodes() - for nodes.Next() { - from := nodes.Node() - if b.Visited(from) { - continue - } - if before != nil { - before() - } - b.Walk(g, from, func(n graph.Node, _ int) bool { - if during != nil { - during(n) - } - return false - }) - if after != nil { - after() - } - } -} - -// Visited returned whether the node n was visited during a traverse. -func (b *BreadthFirst) Visited(n graph.Node) bool { - return b.visited.Has(n.ID()) -} - -// Reset resets the state of the traverser for reuse. -func (b *BreadthFirst) Reset() { - b.queue.Reset() - b.visited = nil -} - -// DepthFirst implements stateful depth-first graph traversal. -type DepthFirst struct { - // Visit is called on all nodes on their first visit. - Visit func(graph.Node) - - // Traverse is called on all edges that may be traversed - // during the walk. This includes edges that would hop to - // an already visited node. - // - // The value returned by Traverse determines whether an - // edge can be traversed during the walk. - Traverse func(graph.Edge) bool - - stack linear.NodeStack - visited set.Int64s -} - -// Walk performs a depth-first traversal of the graph g starting from the given node, -// depending on the Traverse field and the until parameter if they are non-nil. -// The traversal follows edges for which Traverse(edge) is true and returns the first node -// for which until(node) is true. During the traversal, if the Visit field is non-nil, it -// is called with each node the first time it is visited. -func (d *DepthFirst) Walk(g Graph, from graph.Node, until func(graph.Node) bool) graph.Node { - if d.visited == nil { - d.visited = make(set.Int64s) - } - d.stack.Push(from) - if d.Visit != nil && !d.visited.Has(from.ID()) { - d.Visit(from) - } - d.visited.Add(from.ID()) - - for d.stack.Len() > 0 { - t := d.stack.Pop() - if until != nil && until(t) { - return t - } - tid := t.ID() - to := g.From(tid) - for to.Next() { - n := to.Node() - nid := n.ID() - if d.Traverse != nil && !d.Traverse(g.Edge(tid, nid)) { - continue - } - if d.visited.Has(nid) { - continue - } - if d.Visit != nil { - d.Visit(n) - } - d.visited.Add(nid) - d.stack.Push(n) - } - } - - return nil -} - -// WalkAll calls Walk for each unvisited node of the graph g using edges independent -// of their direction. The functions before and after are called prior to commencing -// and after completing each walk if they are non-nil respectively. The function -// during is called on each node as it is traversed. -func (d *DepthFirst) WalkAll(g graph.Undirected, before, after func(), during func(graph.Node)) { - d.Reset() - nodes := g.Nodes() - for nodes.Next() { - from := nodes.Node() - if d.Visited(from) { - continue - } - if before != nil { - before() - } - d.Walk(g, from, func(n graph.Node) bool { - if during != nil { - during(n) - } - return false - }) - if after != nil { - after() - } - } -} - -// Visited returned whether the node n was visited during a traverse. -func (d *DepthFirst) Visited(n graph.Node) bool { - return d.visited.Has(n.ID()) -} - -// Reset resets the state of the traverser for reuse. -func (d *DepthFirst) Reset() { - d.stack = d.stack[:0] - d.visited = nil -} diff --git a/vendor/gonum.org/v1/gonum/graph/undirect.go b/vendor/gonum.org/v1/gonum/graph/undirect.go deleted file mode 100644 index 1f146a4..0000000 --- a/vendor/gonum.org/v1/gonum/graph/undirect.go +++ /dev/null @@ -1,284 +0,0 @@ -// Copyright ©2015 The Gonum 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 graph - -// Undirect converts a directed graph to an undirected graph. -type Undirect struct { - G Directed -} - -var _ Undirected = Undirect{} - -// Node returns the node with the given ID if it exists in the graph, -// and nil otherwise. -func (g Undirect) Node(id int64) Node { return g.G.Node(id) } - -// Nodes returns all the nodes in the graph. -func (g Undirect) Nodes() Nodes { return g.G.Nodes() } - -// From returns all nodes in g that can be reached directly from u. -func (g Undirect) From(uid int64) Nodes { - if g.G.Node(uid) == nil { - return Empty - } - return newNodeIteratorPair(g.G.From(uid), g.G.To(uid)) -} - -// HasEdgeBetween returns whether an edge exists between nodes x and y. -func (g Undirect) HasEdgeBetween(xid, yid int64) bool { return g.G.HasEdgeBetween(xid, yid) } - -// Edge returns the edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -// If an edge exists, the Edge returned is an EdgePair. The weight of -// the edge is determined by applying the Merge func to the weights of the -// edges between u and v. -func (g Undirect) Edge(uid, vid int64) Edge { return g.EdgeBetween(uid, vid) } - -// EdgeBetween returns the edge between nodes x and y. If an edge exists, the -// Edge returned is an EdgePair. The weight of the edge is determined by -// applying the Merge func to the weights of edges between x and y. -func (g Undirect) EdgeBetween(xid, yid int64) Edge { - fe := g.G.Edge(xid, yid) - re := g.G.Edge(yid, xid) - if fe == nil && re == nil { - return nil - } - - return EdgePair{fe, re} -} - -// UndirectWeighted converts a directed weighted graph to an undirected weighted graph, -// resolving edge weight conflicts. -type UndirectWeighted struct { - G WeightedDirected - - // Absent is the value used to - // represent absent edge weights - // passed to Merge if the reverse - // edge is present. - Absent float64 - - // Merge defines how discordant edge - // weights in G are resolved. A merge - // is performed if at least one edge - // exists between the nodes being - // considered. The edges corresponding - // to the two weights are also passed, - // in the same order. - // The order of weight parameters - // passed to Merge is not defined, so - // the function should be commutative. - // If Merge is nil, the arithmetic - // mean is used to merge weights. - Merge func(x, y float64, xe, ye Edge) float64 -} - -var ( - _ Undirected = UndirectWeighted{} - _ WeightedUndirected = UndirectWeighted{} -) - -// Node returns the node with the given ID if it exists in the graph, -// and nil otherwise. -func (g UndirectWeighted) Node(id int64) Node { return g.G.Node(id) } - -// Nodes returns all the nodes in the graph. -func (g UndirectWeighted) Nodes() Nodes { return g.G.Nodes() } - -// From returns all nodes in g that can be reached directly from u. -func (g UndirectWeighted) From(uid int64) Nodes { - if g.G.Node(uid) == nil { - return Empty - } - return newNodeIteratorPair(g.G.From(uid), g.G.To(uid)) -} - -// HasEdgeBetween returns whether an edge exists between nodes x and y. -func (g UndirectWeighted) HasEdgeBetween(xid, yid int64) bool { return g.G.HasEdgeBetween(xid, yid) } - -// Edge returns the edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -// If an edge exists, the Edge returned is an EdgePair. The weight of -// the edge is determined by applying the Merge func to the weights of the -// edges between u and v. -func (g UndirectWeighted) Edge(uid, vid int64) Edge { return g.WeightedEdgeBetween(uid, vid) } - -// WeightedEdge returns the weighted edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -// If an edge exists, the Edge returned is an EdgePair. The weight of -// the edge is determined by applying the Merge func to the weights of the -// edges between u and v. -func (g UndirectWeighted) WeightedEdge(uid, vid int64) WeightedEdge { - return g.WeightedEdgeBetween(uid, vid) -} - -// EdgeBetween returns the edge between nodes x and y. If an edge exists, the -// Edge returned is an EdgePair. The weight of the edge is determined by -// applying the Merge func to the weights of edges between x and y. -func (g UndirectWeighted) EdgeBetween(xid, yid int64) Edge { - return g.WeightedEdgeBetween(xid, yid) -} - -// WeightedEdgeBetween returns the weighted edge between nodes x and y. If an edge exists, the -// Edge returned is an EdgePair. The weight of the edge is determined by -// applying the Merge func to the weights of edges between x and y. -func (g UndirectWeighted) WeightedEdgeBetween(xid, yid int64) WeightedEdge { - fe := g.G.Edge(xid, yid) - re := g.G.Edge(yid, xid) - if fe == nil && re == nil { - return nil - } - - f, ok := g.G.Weight(xid, yid) - if !ok { - f = g.Absent - } - r, ok := g.G.Weight(yid, xid) - if !ok { - r = g.Absent - } - - var w float64 - if g.Merge == nil { - w = (f + r) / 2 - } else { - w = g.Merge(f, r, fe, re) - } - return WeightedEdgePair{EdgePair: [2]Edge{fe, re}, W: w} -} - -// Weight returns the weight for the edge between x and y if Edge(x, y) returns a non-nil Edge. -// If x and y are the same node the internal node weight is returned. If there is no joining -// edge between the two nodes the weight value returned is zero. Weight returns true if an edge -// exists between x and y or if x and y have the same ID, false otherwise. -func (g UndirectWeighted) Weight(xid, yid int64) (w float64, ok bool) { - fe := g.G.Edge(xid, yid) - re := g.G.Edge(yid, xid) - - f, fOk := g.G.Weight(xid, yid) - if !fOk { - f = g.Absent - } - r, rOK := g.G.Weight(yid, xid) - if !rOK { - r = g.Absent - } - ok = fOk || rOK - - if g.Merge == nil { - return (f + r) / 2, ok - } - return g.Merge(f, r, fe, re), ok -} - -// EdgePair is an opposed pair of directed edges. -type EdgePair [2]Edge - -// From returns the from node of the first non-nil edge, or nil. -func (e EdgePair) From() Node { - if e[0] != nil { - return e[0].From() - } else if e[1] != nil { - return e[1].From() - } - return nil -} - -// To returns the to node of the first non-nil edge, or nil. -func (e EdgePair) To() Node { - if e[0] != nil { - return e[0].To() - } else if e[1] != nil { - return e[1].To() - } - return nil -} - -// ReversedEdge returns a new Edge with the end point of the -// edges in the pair swapped. -func (e EdgePair) ReversedEdge() Edge { - if e[0] != nil { - e[0] = e[0].ReversedEdge() - } - if e[1] != nil { - e[1] = e[1].ReversedEdge() - } - return e -} - -// WeightedEdgePair is an opposed pair of directed edges. -type WeightedEdgePair struct { - EdgePair - W float64 -} - -// ReversedEdge returns a new Edge with the end point of the -// edges in the pair swapped. -func (e WeightedEdgePair) ReversedEdge() Edge { - e.EdgePair = e.EdgePair.ReversedEdge().(EdgePair) - return e -} - -// Weight returns the merged edge weights of the two edges. -func (e WeightedEdgePair) Weight() float64 { return e.W } - -// nodeIteratorPair combines two Nodes to produce a single stream of -// unique nodes. -type nodeIteratorPair struct { - a, b Nodes - - curr, cnt int - - // unique indicates the node in b with the key ID is unique. - unique map[int64]bool -} - -func newNodeIteratorPair(a, b Nodes) *nodeIteratorPair { - n := nodeIteratorPair{a: a, b: b, unique: make(map[int64]bool)} - for n.b.Next() { - n.unique[n.b.Node().ID()] = true - n.cnt++ - } - n.b.Reset() - for n.a.Next() { - if _, ok := n.unique[n.a.Node().ID()]; !ok { - n.cnt++ - } - n.unique[n.a.Node().ID()] = false - } - n.a.Reset() - return &n -} - -func (n *nodeIteratorPair) Len() int { - return n.cnt - n.curr -} - -func (n *nodeIteratorPair) Next() bool { - if n.a.Next() { - n.curr++ - return true - } - for n.b.Next() { - if n.unique[n.b.Node().ID()] { - n.curr++ - return true - } - } - return false -} - -func (n *nodeIteratorPair) Node() Node { - if n.a.Len() != 0 { - return n.a.Node() - } - return n.b.Node() -} - -func (n *nodeIteratorPair) Reset() { - n.curr = 0 - n.a.Reset() - n.b.Reset() -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyinc_amd64.s deleted file mode 100644 index 68490e5..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyinc_amd64.s +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// MOVDDUP X2, X3 -#define MOVDDUP_X2_X3 BYTE $0xF2; BYTE $0x0F; BYTE $0x12; BYTE $0xDA -// MOVDDUP X4, X5 -#define MOVDDUP_X4_X5 BYTE $0xF2; BYTE $0x0F; BYTE $0x12; BYTE $0xEC -// MOVDDUP X6, X7 -#define MOVDDUP_X6_X7 BYTE $0xF2; BYTE $0x0F; BYTE $0x12; BYTE $0xFE -// MOVDDUP X8, X9 -#define MOVDDUP_X8_X9 BYTE $0xF2; BYTE $0x45; BYTE $0x0F; BYTE $0x12; BYTE $0xC8 - -// ADDSUBPD X2, X3 -#define ADDSUBPD_X2_X3 BYTE $0x66; BYTE $0x0F; BYTE $0xD0; BYTE $0xDA -// ADDSUBPD X4, X5 -#define ADDSUBPD_X4_X5 BYTE $0x66; BYTE $0x0F; BYTE $0xD0; BYTE $0xEC -// ADDSUBPD X6, X7 -#define ADDSUBPD_X6_X7 BYTE $0x66; BYTE $0x0F; BYTE $0xD0; BYTE $0xFE -// ADDSUBPD X8, X9 -#define ADDSUBPD_X8_X9 BYTE $0x66; BYTE $0x45; BYTE $0x0F; BYTE $0xD0; BYTE $0xC8 - -// func AxpyInc(alpha complex128, x, y []complex128, n, incX, incY, ix, iy uintptr) -TEXT ·AxpyInc(SB), NOSPLIT, $0 - MOVQ x_base+16(FP), SI // SI = &x - MOVQ y_base+40(FP), DI // DI = &y - MOVQ n+64(FP), CX // CX = n - CMPQ CX, $0 // if n==0 { return } - JE axpyi_end - MOVQ ix+88(FP), R8 // R8 = ix // Load the first index - SHLQ $4, R8 // R8 *= sizeof(complex128) - MOVQ iy+96(FP), R9 // R9 = iy - SHLQ $4, R9 // R9 *= sizeof(complex128) - LEAQ (SI)(R8*1), SI // SI = &(x[ix]) - LEAQ (DI)(R9*1), DI // DI = &(y[iy]) - MOVQ DI, DX // DX = DI // Separate Read/Write pointers - MOVQ incX+72(FP), R8 // R8 = incX - SHLQ $4, R8 // R8 *= sizeof(complex128) - MOVQ incY+80(FP), R9 // R9 = iy - SHLQ $4, R9 // R9 *= sizeof(complex128) - MOVUPS alpha+0(FP), X0 // X0 = { imag(a), real(a) } - MOVAPS X0, X1 - SHUFPD $0x1, X1, X1 // X1 = { real(a), imag(a) } - MOVAPS X0, X10 // Copy X0 and X1 for pipelining - MOVAPS X1, X11 - MOVQ CX, BX - ANDQ $3, CX // CX = n % 4 - SHRQ $2, BX // BX = floor( n / 4 ) - JZ axpyi_tail // if BX == 0 { goto axpyi_tail } - -axpyi_loop: // do { - MOVUPS (SI), X2 // X_i = { imag(x[i]), real(x[i]) } - MOVUPS (SI)(R8*1), X4 - LEAQ (SI)(R8*2), SI // SI = &(SI[incX*2]) - MOVUPS (SI), X6 - MOVUPS (SI)(R8*1), X8 - - // X_(i+1) = { real(x[i], real(x[i]) } - MOVDDUP_X2_X3 - MOVDDUP_X4_X5 - MOVDDUP_X6_X7 - MOVDDUP_X8_X9 - - // X_i = { imag(x[i]), imag(x[i]) } - SHUFPD $0x3, X2, X2 - SHUFPD $0x3, X4, X4 - SHUFPD $0x3, X6, X6 - SHUFPD $0x3, X8, X8 - - // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - MULPD X1, X2 - MULPD X0, X3 - MULPD X11, X4 - MULPD X10, X5 - MULPD X1, X6 - MULPD X0, X7 - MULPD X11, X8 - MULPD X10, X9 - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDSUBPD_X4_X5 - ADDSUBPD_X6_X7 - ADDSUBPD_X8_X9 - - // X_(i+1) = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]) } - ADDPD (DX), X3 - ADDPD (DX)(R9*1), X5 - LEAQ (DX)(R9*2), DX // DX = &(DX[incY*2]) - ADDPD (DX), X7 - ADDPD (DX)(R9*1), X9 - MOVUPS X3, (DI) // dst[i] = X_(i+1) - MOVUPS X5, (DI)(R9*1) - LEAQ (DI)(R9*2), DI - MOVUPS X7, (DI) - MOVUPS X9, (DI)(R9*1) - LEAQ (SI)(R8*2), SI // SI = &(SI[incX*2]) - LEAQ (DX)(R9*2), DX // DX = &(DX[incY*2]) - LEAQ (DI)(R9*2), DI // DI = &(DI[incY*2]) - DECQ BX - JNZ axpyi_loop // } while --BX > 0 - CMPQ CX, $0 // if CX == 0 { return } - JE axpyi_end - -axpyi_tail: // do { - MOVUPS (SI), X2 // X_i = { imag(x[i]), real(x[i]) } - MOVDDUP_X2_X3 // X_(i+1) = { real(x[i], real(x[i]) } - SHUFPD $0x3, X2, X2 // X_i = { imag(x[i]), imag(x[i]) } - MULPD X1, X2 // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPD X0, X3 // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - - // X_(i+1) = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]) } - ADDPD (DI), X3 - MOVUPS X3, (DI) // y[i] = X_i - ADDQ R8, SI // SI = &(SI[incX]) - ADDQ R9, DI // DI = &(DI[incY]) - LOOP axpyi_tail // } while --CX > 0 - -axpyi_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyincto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyincto_amd64.s deleted file mode 100644 index 50d21f2..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyincto_amd64.s +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// MOVDDUP X2, X3 -#define MOVDDUP_X2_X3 BYTE $0xF2; BYTE $0x0F; BYTE $0x12; BYTE $0xDA -// MOVDDUP X4, X5 -#define MOVDDUP_X4_X5 BYTE $0xF2; BYTE $0x0F; BYTE $0x12; BYTE $0xEC -// MOVDDUP X6, X7 -#define MOVDDUP_X6_X7 BYTE $0xF2; BYTE $0x0F; BYTE $0x12; BYTE $0xFE -// MOVDDUP X8, X9 -#define MOVDDUP_X8_X9 BYTE $0xF2; BYTE $0x45; BYTE $0x0F; BYTE $0x12; BYTE $0xC8 - -// ADDSUBPD X2, X3 -#define ADDSUBPD_X2_X3 BYTE $0x66; BYTE $0x0F; BYTE $0xD0; BYTE $0xDA -// ADDSUBPD X4, X5 -#define ADDSUBPD_X4_X5 BYTE $0x66; BYTE $0x0F; BYTE $0xD0; BYTE $0xEC -// ADDSUBPD X6, X7 -#define ADDSUBPD_X6_X7 BYTE $0x66; BYTE $0x0F; BYTE $0xD0; BYTE $0xFE -// ADDSUBPD X8, X9 -#define ADDSUBPD_X8_X9 BYTE $0x66; BYTE $0x45; BYTE $0x0F; BYTE $0xD0; BYTE $0xC8 - -// func AxpyIncTo(dst []complex128, incDst, idst uintptr, alpha complex128, x, y []complex128, n, incX, incY, ix, iy uintptr) -TEXT ·AxpyIncTo(SB), NOSPLIT, $0 - MOVQ dst_base+0(FP), DI // DI = &dst - MOVQ x_base+56(FP), SI // SI = &x - MOVQ y_base+80(FP), DX // DX = &y - MOVQ n+104(FP), CX // CX = n - CMPQ CX, $0 // if n==0 { return } - JE axpyi_end - MOVQ ix+128(FP), R8 // R8 = ix // Load the first index - SHLQ $4, R8 // R8 *= sizeof(complex128) - MOVQ iy+136(FP), R9 // R9 = iy - SHLQ $4, R9 // R9 *= sizeof(complex128) - MOVQ idst+32(FP), R10 // R10 = idst - SHLQ $4, R10 // R10 *= sizeof(complex128) - LEAQ (SI)(R8*1), SI // SI = &(x[ix]) - LEAQ (DX)(R9*1), DX // DX = &(y[iy]) - LEAQ (DI)(R10*1), DI // DI = &(dst[idst]) - MOVQ incX+112(FP), R8 // R8 = incX - SHLQ $4, R8 // R8 *= sizeof(complex128) - MOVQ incY+120(FP), R9 // R9 = incY - SHLQ $4, R9 // R9 *= sizeof(complex128) - MOVQ incDst+24(FP), R10 // R10 = incDst - SHLQ $4, R10 // R10 *= sizeof(complex128) - MOVUPS alpha+40(FP), X0 // X0 = { imag(a), real(a) } - MOVAPS X0, X1 - SHUFPD $0x1, X1, X1 // X1 = { real(a), imag(a) } - MOVAPS X0, X10 // Copy X0 and X1 for pipelining - MOVAPS X1, X11 - MOVQ CX, BX - ANDQ $3, CX // CX = n % 4 - SHRQ $2, BX // BX = floor( n / 4 ) - JZ axpyi_tail // if BX == 0 { goto axpyi_tail } - -axpyi_loop: // do { - MOVUPS (SI), X2 // X_i = { imag(x[i]), real(x[i]) } - MOVUPS (SI)(R8*1), X4 - LEAQ (SI)(R8*2), SI // SI = &(SI[incX*2]) - - MOVUPS (SI), X6 - MOVUPS (SI)(R8*1), X8 - - // X_(i+1) = { real(x[i], real(x[i]) } - MOVDDUP_X2_X3 - MOVDDUP_X4_X5 - MOVDDUP_X6_X7 - MOVDDUP_X8_X9 - - // X_i = { imag(x[i]), imag(x[i]) } - SHUFPD $0x3, X2, X2 - SHUFPD $0x3, X4, X4 - SHUFPD $0x3, X6, X6 - SHUFPD $0x3, X8, X8 - - // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - MULPD X1, X2 - MULPD X0, X3 - MULPD X11, X4 - MULPD X10, X5 - MULPD X1, X6 - MULPD X0, X7 - MULPD X11, X8 - MULPD X10, X9 - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDSUBPD_X4_X5 - ADDSUBPD_X6_X7 - ADDSUBPD_X8_X9 - - // X_(i+1) = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]) } - ADDPD (DX), X3 - ADDPD (DX)(R9*1), X5 - LEAQ (DX)(R9*2), DX // DX = &(DX[incY*2]) - ADDPD (DX), X7 - ADDPD (DX)(R9*1), X9 - MOVUPS X3, (DI) // dst[i] = X_(i+1) - MOVUPS X5, (DI)(R10*1) - LEAQ (DI)(R10*2), DI - MOVUPS X7, (DI) - MOVUPS X9, (DI)(R10*1) - LEAQ (SI)(R8*2), SI // SI = &(SI[incX*2]) - LEAQ (DX)(R9*2), DX // DX = &(DX[incY*2]) - LEAQ (DI)(R10*2), DI // DI = &(DI[incDst*2]) - DECQ BX - JNZ axpyi_loop // } while --BX > 0 - CMPQ CX, $0 // if CX == 0 { return } - JE axpyi_end - -axpyi_tail: // do { - MOVUPS (SI), X2 // X_i = { imag(x[i]), real(x[i]) } - MOVDDUP_X2_X3 // X_(i+1) = { real(x[i], real(x[i]) } - SHUFPD $0x3, X2, X2 // X_i = { imag(x[i]), imag(x[i]) } - MULPD X1, X2 // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPD X0, X3 // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - - // X_(i+1) = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]) } - ADDPD (DX), X3 - MOVUPS X3, (DI) // y[i] X_(i+1) - ADDQ R8, SI // SI += incX - ADDQ R9, DX // DX += incY - ADDQ R10, DI // DI += incDst - LOOP axpyi_tail // } while --CX > 0 - -axpyi_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyunitary_amd64.s deleted file mode 100644 index ccf8289..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyunitary_amd64.s +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// MOVDDUP X2, X3 -#define MOVDDUP_X2_X3 BYTE $0xF2; BYTE $0x0F; BYTE $0x12; BYTE $0xDA -// MOVDDUP X4, X5 -#define MOVDDUP_X4_X5 BYTE $0xF2; BYTE $0x0F; BYTE $0x12; BYTE $0xEC -// MOVDDUP X6, X7 -#define MOVDDUP_X6_X7 BYTE $0xF2; BYTE $0x0F; BYTE $0x12; BYTE $0xFE -// MOVDDUP X8, X9 -#define MOVDDUP_X8_X9 BYTE $0xF2; BYTE $0x45; BYTE $0x0F; BYTE $0x12; BYTE $0xC8 - -// ADDSUBPD X2, X3 -#define ADDSUBPD_X2_X3 BYTE $0x66; BYTE $0x0F; BYTE $0xD0; BYTE $0xDA -// ADDSUBPD X4, X5 -#define ADDSUBPD_X4_X5 BYTE $0x66; BYTE $0x0F; BYTE $0xD0; BYTE $0xEC -// ADDSUBPD X6, X7 -#define ADDSUBPD_X6_X7 BYTE $0x66; BYTE $0x0F; BYTE $0xD0; BYTE $0xFE -// ADDSUBPD X8, X9 -#define ADDSUBPD_X8_X9 BYTE $0x66; BYTE $0x45; BYTE $0x0F; BYTE $0xD0; BYTE $0xC8 - -// func AxpyUnitary(alpha complex128, x, y []complex128) -TEXT ·AxpyUnitary(SB), NOSPLIT, $0 - MOVQ x_base+16(FP), SI // SI = &x - MOVQ y_base+40(FP), DI // DI = &y - MOVQ x_len+24(FP), CX // CX = min( len(x), len(y) ) - CMPQ y_len+48(FP), CX - CMOVQLE y_len+48(FP), CX - CMPQ CX, $0 // if CX == 0 { return } - JE caxy_end - PXOR X0, X0 // Clear work registers and cache-align loop - PXOR X1, X1 - MOVUPS alpha+0(FP), X0 // X0 = { imag(a), real(a) } - MOVAPS X0, X1 - SHUFPD $0x1, X1, X1 // X1 = { real(a), imag(a) } - XORQ AX, AX // i = 0 - MOVAPS X0, X10 // Copy X0 and X1 for pipelining - MOVAPS X1, X11 - MOVQ CX, BX - ANDQ $3, CX // CX = n % 4 - SHRQ $2, BX // BX = floor( n / 4 ) - JZ caxy_tail // if BX == 0 { goto caxy_tail } - -caxy_loop: // do { - MOVUPS (SI)(AX*8), X2 // X_i = { imag(x[i]), real(x[i]) } - MOVUPS 16(SI)(AX*8), X4 - MOVUPS 32(SI)(AX*8), X6 - MOVUPS 48(SI)(AX*8), X8 - - // X_(i+1) = { real(x[i], real(x[i]) } - MOVDDUP_X2_X3 - MOVDDUP_X4_X5 - MOVDDUP_X6_X7 - MOVDDUP_X8_X9 - - // X_i = { imag(x[i]), imag(x[i]) } - SHUFPD $0x3, X2, X2 - SHUFPD $0x3, X4, X4 - SHUFPD $0x3, X6, X6 - SHUFPD $0x3, X8, X8 - - // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - MULPD X1, X2 - MULPD X0, X3 - MULPD X11, X4 - MULPD X10, X5 - MULPD X1, X6 - MULPD X0, X7 - MULPD X11, X8 - MULPD X10, X9 - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDSUBPD_X4_X5 - ADDSUBPD_X6_X7 - ADDSUBPD_X8_X9 - - // X_(i+1) = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]) } - ADDPD (DI)(AX*8), X3 - ADDPD 16(DI)(AX*8), X5 - ADDPD 32(DI)(AX*8), X7 - ADDPD 48(DI)(AX*8), X9 - MOVUPS X3, (DI)(AX*8) // y[i] = X_(i+1) - MOVUPS X5, 16(DI)(AX*8) - MOVUPS X7, 32(DI)(AX*8) - MOVUPS X9, 48(DI)(AX*8) - ADDQ $8, AX // i += 8 - DECQ BX - JNZ caxy_loop // } while --BX > 0 - CMPQ CX, $0 // if CX == 0 { return } - JE caxy_end - -caxy_tail: // do { - MOVUPS (SI)(AX*8), X2 // X_i = { imag(x[i]), real(x[i]) } - MOVDDUP_X2_X3 // X_(i+1) = { real(x[i], real(x[i]) } - SHUFPD $0x3, X2, X2 // X_i = { imag(x[i]), imag(x[i]) } - MULPD X1, X2 // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPD X0, X3 // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - - // X_(i+1) = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]) } - ADDPD (DI)(AX*8), X3 - MOVUPS X3, (DI)(AX*8) // y[i] = X_(i+1) - ADDQ $2, AX // i += 2 - LOOP caxy_tail // } while --CX > 0 - -caxy_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyunitaryto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyunitaryto_amd64.s deleted file mode 100644 index 07ceabc..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyunitaryto_amd64.s +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// MOVDDUP X2, X3 -#define MOVDDUP_X2_X3 BYTE $0xF2; BYTE $0x0F; BYTE $0x12; BYTE $0xDA -// MOVDDUP X4, X5 -#define MOVDDUP_X4_X5 BYTE $0xF2; BYTE $0x0F; BYTE $0x12; BYTE $0xEC -// MOVDDUP X6, X7 -#define MOVDDUP_X6_X7 BYTE $0xF2; BYTE $0x0F; BYTE $0x12; BYTE $0xFE -// MOVDDUP X8, X9 -#define MOVDDUP_X8_X9 BYTE $0xF2; BYTE $0x45; BYTE $0x0F; BYTE $0x12; BYTE $0xC8 - -// ADDSUBPD X2, X3 -#define ADDSUBPD_X2_X3 BYTE $0x66; BYTE $0x0F; BYTE $0xD0; BYTE $0xDA -// ADDSUBPD X4, X5 -#define ADDSUBPD_X4_X5 BYTE $0x66; BYTE $0x0F; BYTE $0xD0; BYTE $0xEC -// ADDSUBPD X6, X7 -#define ADDSUBPD_X6_X7 BYTE $0x66; BYTE $0x0F; BYTE $0xD0; BYTE $0xFE -// ADDSUBPD X8, X9 -#define ADDSUBPD_X8_X9 BYTE $0x66; BYTE $0x45; BYTE $0x0F; BYTE $0xD0; BYTE $0xC8 - -// func AxpyUnitaryTo(dst []complex128, alpha complex64, x, y []complex128) -TEXT ·AxpyUnitaryTo(SB), NOSPLIT, $0 - MOVQ dst_base+0(FP), DI // DI = &dst - MOVQ x_base+40(FP), SI // SI = &x - MOVQ y_base+64(FP), DX // DX = &y - MOVQ x_len+48(FP), CX // CX = min( len(x), len(y), len(dst) ) - CMPQ y_len+72(FP), CX - CMOVQLE y_len+72(FP), CX - CMPQ dst_len+8(FP), CX - CMOVQLE dst_len+8(FP), CX - CMPQ CX, $0 // if CX == 0 { return } - JE caxy_end - MOVUPS alpha+24(FP), X0 // X0 = { imag(a), real(a) } - MOVAPS X0, X1 - SHUFPD $0x1, X1, X1 // X1 = { real(a), imag(a) } - XORQ AX, AX // i = 0 - MOVAPS X0, X10 // Copy X0 and X1 for pipelining - MOVAPS X1, X11 - MOVQ CX, BX - ANDQ $3, CX // CX = n % 4 - SHRQ $2, BX // BX = floor( n / 4 ) - JZ caxy_tail // if BX == 0 { goto caxy_tail } - -caxy_loop: // do { - MOVUPS (SI)(AX*8), X2 // X_i = { imag(x[i]), real(x[i]) } - MOVUPS 16(SI)(AX*8), X4 - MOVUPS 32(SI)(AX*8), X6 - MOVUPS 48(SI)(AX*8), X8 - - // X_(i+1) = { real(x[i], real(x[i]) } - MOVDDUP_X2_X3 // Load and duplicate imag elements (xi, xi) - MOVDDUP_X4_X5 - MOVDDUP_X6_X7 - MOVDDUP_X8_X9 - - // X_i = { imag(x[i]), imag(x[i]) } - SHUFPD $0x3, X2, X2 // duplicate real elements (xr, xr) - SHUFPD $0x3, X4, X4 - SHUFPD $0x3, X6, X6 - SHUFPD $0x3, X8, X8 - - // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - MULPD X1, X2 - MULPD X0, X3 - MULPD X11, X4 - MULPD X10, X5 - MULPD X1, X6 - MULPD X0, X7 - MULPD X11, X8 - MULPD X10, X9 - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDSUBPD_X4_X5 - ADDSUBPD_X6_X7 - ADDSUBPD_X8_X9 - - // X_(i+1) = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]) } - ADDPD (DX)(AX*8), X3 - ADDPD 16(DX)(AX*8), X5 - ADDPD 32(DX)(AX*8), X7 - ADDPD 48(DX)(AX*8), X9 - MOVUPS X3, (DI)(AX*8) // y[i] = X_(i+1) - MOVUPS X5, 16(DI)(AX*8) - MOVUPS X7, 32(DI)(AX*8) - MOVUPS X9, 48(DI)(AX*8) - ADDQ $8, AX // i += 8 - DECQ BX - JNZ caxy_loop // } while --BX > 0 - CMPQ CX, $0 // if CX == 0 { return } - JE caxy_end - -caxy_tail: // Same calculation, but read in values to avoid trampling memory - MOVUPS (SI)(AX*8), X2 // X_i = { imag(x[i]), real(x[i]) } - MOVDDUP_X2_X3 // X_(i+1) = { real(x[i], real(x[i]) } - SHUFPD $0x3, X2, X2 // X_i = { imag(x[i]), imag(x[i]) } - MULPD X1, X2 // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPD X0, X3 // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - - // X_(i+1) = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]) } - ADDPD (DX)(AX*8), X3 - MOVUPS X3, (DI)(AX*8) // y[i] = X_(i+1) - ADDQ $2, AX // i += 2 - LOOP caxy_tail // } while --CX > 0 - -caxy_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/doc.go b/vendor/gonum.org/v1/gonum/internal/asm/c128/doc.go deleted file mode 100644 index 8802ff1..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright ©2017 The Gonum 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 c128 provides complex128 vector primitives. -package c128 // import "gonum.org/v1/gonum/internal/asm/c128" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/dotcinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/dotcinc_amd64.s deleted file mode 100644 index 03c07db..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/dotcinc_amd64.s +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define MOVDDUP_XPTR__X3 LONG $0x1E120FF2 // MOVDDUP (SI), X3 -#define MOVDDUP_XPTR_INCX__X5 LONG $0x120F42F2; WORD $0x062C // MOVDDUP (SI)(R8*1), X5 -#define MOVDDUP_XPTR_INCX_2__X7 LONG $0x120F42F2; WORD $0x463C // MOVDDUP (SI)(R8*2), X7 -#define MOVDDUP_XPTR_INCx3X__X9 LONG $0x120F46F2; WORD $0x0E0C // MOVDDUP (SI)(R9*1), X9 - -#define MOVDDUP_8_XPTR__X2 LONG $0x56120FF2; BYTE $0x08 // MOVDDUP 8(SI), X2 -#define MOVDDUP_8_XPTR_INCX__X4 LONG $0x120F42F2; WORD $0x0664; BYTE $0x08 // MOVDDUP 8(SI)(R8*1), X4 -#define MOVDDUP_8_XPTR_INCX_2__X6 LONG $0x120F42F2; WORD $0x4674; BYTE $0x08 // MOVDDUP 8(SI)(R8*2), X6 -#define MOVDDUP_8_XPTR_INCx3X__X8 LONG $0x120F46F2; WORD $0x0E44; BYTE $0x08 // MOVDDUP 8(SI)(R9*1), X8 - -#define ADDSUBPD_X2_X3 LONG $0xDAD00F66 // ADDSUBPD X2, X3 -#define ADDSUBPD_X4_X5 LONG $0xECD00F66 // ADDSUBPD X4, X5 -#define ADDSUBPD_X6_X7 LONG $0xFED00F66 // ADDSUBPD X6, X7 -#define ADDSUBPD_X8_X9 LONG $0xD00F4566; BYTE $0xC8 // ADDSUBPD X8, X9 - -#define X_PTR SI -#define Y_PTR DI -#define LEN CX -#define TAIL BX -#define SUM X0 -#define P_SUM X1 -#define INC_X R8 -#define INCx3_X R9 -#define INC_Y R10 -#define INCx3_Y R11 -#define NEG1 X15 -#define P_NEG1 X14 - -// func DotcInc(x, y []complex128, n, incX, incY, ix, iy uintptr) (sum complex128) -TEXT ·DotcInc(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_PTR // X_PTR = &x - MOVQ y_base+24(FP), Y_PTR // Y_PTR = &y - MOVQ n+48(FP), LEN // LEN = n - PXOR SUM, SUM // SUM = 0 - CMPQ LEN, $0 // if LEN == 0 { return } - JE dot_end - PXOR P_SUM, P_SUM // P_SUM = 0 - MOVQ ix+72(FP), INC_X // INC_X = ix * sizeof(complex128) - SHLQ $4, INC_X - MOVQ iy+80(FP), INC_Y // INC_Y = iy * sizeof(complex128) - SHLQ $4, INC_Y - LEAQ (X_PTR)(INC_X*1), X_PTR // X_PTR = &(X_PTR[ix]) - LEAQ (Y_PTR)(INC_Y*1), Y_PTR // Y_PTR = &(Y_PTR[iy]) - MOVQ incX+56(FP), INC_X // INC_X = incX - SHLQ $4, INC_X // INC_X *= sizeof(complex128) - MOVQ incY+64(FP), INC_Y // INC_Y = incY - SHLQ $4, INC_Y // INC_Y *= sizeof(complex128) - MOVSD $(-1.0), NEG1 - SHUFPD $0, NEG1, NEG1 // { -1, -1 } - MOVQ LEN, TAIL - ANDQ $3, TAIL // TAIL = n % 4 - SHRQ $2, LEN // LEN = floor( n / 4 ) - JZ dot_tail // if n <= 4 { goto dot_tail } - MOVAPS NEG1, P_NEG1 // Copy NEG1 to P_NEG1 for pipelining - LEAQ (INC_X)(INC_X*2), INCx3_X // INCx3_X = 3 * incX * sizeof(complex128) - LEAQ (INC_Y)(INC_Y*2), INCx3_Y // INCx3_Y = 3 * incY * sizeof(complex128) - -dot_loop: // do { - MOVDDUP_XPTR__X3 // X_(i+1) = { real(x[i], real(x[i]) } - MOVDDUP_XPTR_INCX__X5 - MOVDDUP_XPTR_INCX_2__X7 - MOVDDUP_XPTR_INCx3X__X9 - - MOVDDUP_8_XPTR__X2 // X_i = { imag(x[i]), imag(x[i]) } - MOVDDUP_8_XPTR_INCX__X4 - MOVDDUP_8_XPTR_INCX_2__X6 - MOVDDUP_8_XPTR_INCx3X__X8 - - // X_i = { -imag(x[i]), -imag(x[i]) } - MULPD NEG1, X2 - MULPD P_NEG1, X4 - MULPD NEG1, X6 - MULPD P_NEG1, X8 - - // X_j = { imag(y[i]), real(y[i]) } - MOVUPS (Y_PTR), X10 - MOVUPS (Y_PTR)(INC_Y*1), X11 - MOVUPS (Y_PTR)(INC_Y*2), X12 - MOVUPS (Y_PTR)(INCx3_Y*1), X13 - - // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - MULPD X10, X3 - MULPD X11, X5 - MULPD X12, X7 - MULPD X13, X9 - - // X_j = { real(y[i]), imag(y[i]) } - SHUFPD $0x1, X10, X10 - SHUFPD $0x1, X11, X11 - SHUFPD $0x1, X12, X12 - SHUFPD $0x1, X13, X13 - - // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPD X10, X2 - MULPD X11, X4 - MULPD X12, X6 - MULPD X13, X8 - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDSUBPD_X4_X5 - ADDSUBPD_X6_X7 - ADDSUBPD_X8_X9 - - // psum += result[i] - ADDPD X3, SUM - ADDPD X5, P_SUM - ADDPD X7, SUM - ADDPD X9, P_SUM - - LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(X_PTR[incX*4]) - LEAQ (Y_PTR)(INC_Y*4), Y_PTR // Y_PTR = &(Y_PTR[incY*4]) - - DECQ LEN - JNZ dot_loop // } while --LEN > 0 - ADDPD P_SUM, SUM // sum += psum - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE dot_end - -dot_tail: // do { - MOVDDUP_XPTR__X3 // X_(i+1) = { real(x[i], real(x[i]) } - MOVDDUP_8_XPTR__X2 // X_i = { imag(x[i]), imag(x[i]) } - MULPD NEG1, X2 // X_i = { -imag(x[i]) , -imag(x[i]) } - MOVUPS (Y_PTR), X10 // X_j = { imag(y[i]) , real(y[i]) } - MULPD X10, X3 // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - SHUFPD $0x1, X10, X10 // X_j = { real(y[i]) , imag(y[i]) } - MULPD X10, X2 // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDPD X3, SUM // sum += result[i] - ADDQ INC_X, X_PTR // X_PTR += incX - ADDQ INC_Y, Y_PTR // Y_PTR += incY - DECQ TAIL - JNZ dot_tail // } while --TAIL > 0 - -dot_end: - MOVUPS SUM, sum+88(FP) - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/dotcunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/dotcunitary_amd64.s deleted file mode 100644 index adce85e..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/dotcunitary_amd64.s +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define MOVDDUP_XPTR_IDX_8__X3 LONG $0x1C120FF2; BYTE $0xC6 // MOVDDUP (SI)(AX*8), X3 -#define MOVDDUP_16_XPTR_IDX_8__X5 LONG $0x6C120FF2; WORD $0x10C6 // MOVDDUP 16(SI)(AX*8), X5 -#define MOVDDUP_32_XPTR_IDX_8__X7 LONG $0x7C120FF2; WORD $0x20C6 // MOVDDUP 32(SI)(AX*8), X7 -#define MOVDDUP_48_XPTR_IDX_8__X9 LONG $0x120F44F2; WORD $0xC64C; BYTE $0x30 // MOVDDUP 48(SI)(AX*8), X9 - -#define MOVDDUP_XPTR_IIDX_8__X2 LONG $0x14120FF2; BYTE $0xD6 // MOVDDUP (SI)(DX*8), X2 -#define MOVDDUP_16_XPTR_IIDX_8__X4 LONG $0x64120FF2; WORD $0x10D6 // MOVDDUP 16(SI)(DX*8), X4 -#define MOVDDUP_32_XPTR_IIDX_8__X6 LONG $0x74120FF2; WORD $0x20D6 // MOVDDUP 32(SI)(DX*8), X6 -#define MOVDDUP_48_XPTR_IIDX_8__X8 LONG $0x120F44F2; WORD $0xD644; BYTE $0x30 // MOVDDUP 48(SI)(DX*8), X8 - -#define ADDSUBPD_X2_X3 LONG $0xDAD00F66 // ADDSUBPD X2, X3 -#define ADDSUBPD_X4_X5 LONG $0xECD00F66 // ADDSUBPD X4, X5 -#define ADDSUBPD_X6_X7 LONG $0xFED00F66 // ADDSUBPD X6, X7 -#define ADDSUBPD_X8_X9 LONG $0xD00F4566; BYTE $0xC8 // ADDSUBPD X8, X9 - -#define X_PTR SI -#define Y_PTR DI -#define LEN CX -#define TAIL BX -#define SUM X0 -#define P_SUM X1 -#define IDX AX -#define I_IDX DX -#define NEG1 X15 -#define P_NEG1 X14 - -// func DotcUnitary(x, y []complex128) (sum complex128) -TEXT ·DotcUnitary(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_PTR // X_PTR = &x - MOVQ y_base+24(FP), Y_PTR // Y_PTR = &y - MOVQ x_len+8(FP), LEN // LEN = min( len(x), len(y) ) - CMPQ y_len+32(FP), LEN - CMOVQLE y_len+32(FP), LEN - PXOR SUM, SUM // sum = 0 - CMPQ LEN, $0 // if LEN == 0 { return } - JE dot_end - XORPS P_SUM, P_SUM // psum = 0 - MOVSD $(-1.0), NEG1 - SHUFPD $0, NEG1, NEG1 // { -1, -1 } - XORQ IDX, IDX // i := 0 - MOVQ $1, I_IDX // j := 1 - MOVQ LEN, TAIL - ANDQ $3, TAIL // TAIL = floor( TAIL / 4 ) - SHRQ $2, LEN // LEN = TAIL % 4 - JZ dot_tail // if LEN == 0 { goto dot_tail } - - MOVAPS NEG1, P_NEG1 // Copy NEG1 to P_NEG1 for pipelining - -dot_loop: // do { - MOVDDUP_XPTR_IDX_8__X3 // X_(i+1) = { real(x[i], real(x[i]) } - MOVDDUP_16_XPTR_IDX_8__X5 - MOVDDUP_32_XPTR_IDX_8__X7 - MOVDDUP_48_XPTR_IDX_8__X9 - - MOVDDUP_XPTR_IIDX_8__X2 // X_i = { imag(x[i]), imag(x[i]) } - MOVDDUP_16_XPTR_IIDX_8__X4 - MOVDDUP_32_XPTR_IIDX_8__X6 - MOVDDUP_48_XPTR_IIDX_8__X8 - - // X_i = { -imag(x[i]), -imag(x[i]) } - MULPD NEG1, X2 - MULPD P_NEG1, X4 - MULPD NEG1, X6 - MULPD P_NEG1, X8 - - // X_j = { imag(y[i]), real(y[i]) } - MOVUPS (Y_PTR)(IDX*8), X10 - MOVUPS 16(Y_PTR)(IDX*8), X11 - MOVUPS 32(Y_PTR)(IDX*8), X12 - MOVUPS 48(Y_PTR)(IDX*8), X13 - - // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - MULPD X10, X3 - MULPD X11, X5 - MULPD X12, X7 - MULPD X13, X9 - - // X_j = { real(y[i]), imag(y[i]) } - SHUFPD $0x1, X10, X10 - SHUFPD $0x1, X11, X11 - SHUFPD $0x1, X12, X12 - SHUFPD $0x1, X13, X13 - - // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPD X10, X2 - MULPD X11, X4 - MULPD X12, X6 - MULPD X13, X8 - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDSUBPD_X4_X5 - ADDSUBPD_X6_X7 - ADDSUBPD_X8_X9 - - // psum += result[i] - ADDPD X3, SUM - ADDPD X5, P_SUM - ADDPD X7, SUM - ADDPD X9, P_SUM - - ADDQ $8, IDX // IDX += 8 - ADDQ $8, I_IDX // I_IDX += 8 - DECQ LEN - JNZ dot_loop // } while --LEN > 0 - ADDPD P_SUM, SUM // sum += psum - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE dot_end - -dot_tail: // do { - MOVDDUP_XPTR_IDX_8__X3 // X_(i+1) = { real(x[i]) , real(x[i]) } - MOVDDUP_XPTR_IIDX_8__X2 // X_i = { imag(x[i]) , imag(x[i]) } - MULPD NEG1, X2 // X_i = { -imag(x[i]) , -imag(x[i]) } - MOVUPS (Y_PTR)(IDX*8), X10 // X_j = { imag(y[i]) , real(y[i]) } - MULPD X10, X3 // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - SHUFPD $0x1, X10, X10 // X_j = { real(y[i]) , imag(y[i]) } - MULPD X10, X2 // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDPD X3, SUM // SUM += result[i] - ADDQ $2, IDX // IDX += 2 - ADDQ $2, I_IDX // I_IDX += 2 - DECQ TAIL - JNZ dot_tail // } while --TAIL > 0 - -dot_end: - MOVUPS SUM, sum+48(FP) - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/dotuinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/dotuinc_amd64.s deleted file mode 100644 index 5b15444..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/dotuinc_amd64.s +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define MOVDDUP_XPTR__X3 LONG $0x1E120FF2 // MOVDDUP (SI), X3 -#define MOVDDUP_XPTR_INCX__X5 LONG $0x120F42F2; WORD $0x062C // MOVDDUP (SI)(R8*1), X5 -#define MOVDDUP_XPTR_INCX_2__X7 LONG $0x120F42F2; WORD $0x463C // MOVDDUP (SI)(R8*2), X7 -#define MOVDDUP_XPTR_INCx3X__X9 LONG $0x120F46F2; WORD $0x0E0C // MOVDDUP (SI)(R9*1), X9 - -#define MOVDDUP_8_XPTR__X2 LONG $0x56120FF2; BYTE $0x08 // MOVDDUP 8(SI), X2 -#define MOVDDUP_8_XPTR_INCX__X4 LONG $0x120F42F2; WORD $0x0664; BYTE $0x08 // MOVDDUP 8(SI)(R8*1), X4 -#define MOVDDUP_8_XPTR_INCX_2__X6 LONG $0x120F42F2; WORD $0x4674; BYTE $0x08 // MOVDDUP 8(SI)(R8*2), X6 -#define MOVDDUP_8_XPTR_INCx3X__X8 LONG $0x120F46F2; WORD $0x0E44; BYTE $0x08 // MOVDDUP 8(SI)(R9*1), X8 - -#define ADDSUBPD_X2_X3 LONG $0xDAD00F66 // ADDSUBPD X2, X3 -#define ADDSUBPD_X4_X5 LONG $0xECD00F66 // ADDSUBPD X4, X5 -#define ADDSUBPD_X6_X7 LONG $0xFED00F66 // ADDSUBPD X6, X7 -#define ADDSUBPD_X8_X9 LONG $0xD00F4566; BYTE $0xC8 // ADDSUBPD X8, X9 - -#define X_PTR SI -#define Y_PTR DI -#define LEN CX -#define TAIL BX -#define SUM X0 -#define P_SUM X1 -#define INC_X R8 -#define INCx3_X R9 -#define INC_Y R10 -#define INCx3_Y R11 - -// func DotuInc(x, y []complex128, n, incX, incY, ix, iy uintptr) (sum complex128) -TEXT ·DotuInc(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_PTR // X_PTR = &x - MOVQ y_base+24(FP), Y_PTR // Y_PTR = &y - MOVQ n+48(FP), LEN // LEN = n - PXOR SUM, SUM // sum = 0 - CMPQ LEN, $0 // if LEN == 0 { return } - JE dot_end - MOVQ ix+72(FP), INC_X // INC_X = ix * sizeof(complex128) - SHLQ $4, INC_X - MOVQ iy+80(FP), INC_Y // INC_Y = iy * sizeof(complex128) - SHLQ $4, INC_Y - LEAQ (X_PTR)(INC_X*1), X_PTR // X_PTR = &(X_PTR[ix]) - LEAQ (Y_PTR)(INC_Y*1), Y_PTR // Y_PTR = &(Y_PTR[iy]) - MOVQ incX+56(FP), INC_X // INC_X = incX - SHLQ $4, INC_X // INC_X *= sizeof(complex128) - MOVQ incY+64(FP), INC_Y // INC_Y = incY - SHLQ $4, INC_Y // INC_Y *= sizeof(complex128) - MOVQ LEN, TAIL - ANDQ $3, TAIL // LEN = LEN % 4 - SHRQ $2, LEN // LEN = floor( LEN / 4 ) - JZ dot_tail // if LEN <= 4 { goto dot_tail } - PXOR P_SUM, P_SUM // psum = 0 - LEAQ (INC_X)(INC_X*2), INCx3_X // INCx3_X = 3 * incX * sizeof(complex128) - LEAQ (INC_Y)(INC_Y*2), INCx3_Y // INCx3_Y = 3 * incY * sizeof(complex128) - -dot_loop: // do { - MOVDDUP_XPTR__X3 // X_(i+1) = { real(x[i], real(x[i]) } - MOVDDUP_XPTR_INCX__X5 - MOVDDUP_XPTR_INCX_2__X7 - MOVDDUP_XPTR_INCx3X__X9 - - MOVDDUP_8_XPTR__X2 // X_i = { imag(x[i]), imag(x[i]) } - MOVDDUP_8_XPTR_INCX__X4 - MOVDDUP_8_XPTR_INCX_2__X6 - MOVDDUP_8_XPTR_INCx3X__X8 - - // X_j = { imag(y[i]), real(y[i]) } - MOVUPS (Y_PTR), X10 - MOVUPS (Y_PTR)(INC_Y*1), X11 - MOVUPS (Y_PTR)(INC_Y*2), X12 - MOVUPS (Y_PTR)(INCx3_Y*1), X13 - - // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - MULPD X10, X3 - MULPD X11, X5 - MULPD X12, X7 - MULPD X13, X9 - - // X_j = { real(y[i]), imag(y[i]) } - SHUFPD $0x1, X10, X10 - SHUFPD $0x1, X11, X11 - SHUFPD $0x1, X12, X12 - SHUFPD $0x1, X13, X13 - - // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPD X10, X2 - MULPD X11, X4 - MULPD X12, X6 - MULPD X13, X8 - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDSUBPD_X4_X5 - ADDSUBPD_X6_X7 - ADDSUBPD_X8_X9 - - // psum += result[i] - ADDPD X3, SUM - ADDPD X5, P_SUM - ADDPD X7, SUM - ADDPD X9, P_SUM - - LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(X_PTR[incX*4]) - LEAQ (Y_PTR)(INC_Y*4), Y_PTR // Y_PTR = &(Y_PTR[incY*4]) - - DECQ LEN - JNZ dot_loop // } while --BX > 0 - ADDPD P_SUM, SUM // sum += psum - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE dot_end - -dot_tail: // do { - MOVDDUP_XPTR__X3 // X_(i+1) = { real(x[i], real(x[i]) } - MOVDDUP_8_XPTR__X2 // X_i = { imag(x[i]), imag(x[i]) } - MOVUPS (Y_PTR), X10 // X_j = { imag(y[i]) , real(y[i]) } - MULPD X10, X3 // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - SHUFPD $0x1, X10, X10 // X_j = { real(y[i]) , imag(y[i]) } - MULPD X10, X2 // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDPD X3, SUM // sum += result[i] - ADDQ INC_X, X_PTR // X_PTR += incX - ADDQ INC_Y, Y_PTR // Y_PTR += incY - DECQ TAIL // --TAIL - JNZ dot_tail // } while TAIL > 0 - -dot_end: - MOVUPS SUM, sum+88(FP) - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/dotuunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/dotuunitary_amd64.s deleted file mode 100644 index a45f31e..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/dotuunitary_amd64.s +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define MOVDDUP_XPTR_IDX_8__X3 LONG $0x1C120FF2; BYTE $0xC6 // MOVDDUP (SI)(AX*8), X3 -#define MOVDDUP_16_XPTR_IDX_8__X5 LONG $0x6C120FF2; WORD $0x10C6 // MOVDDUP 16(SI)(AX*8), X5 -#define MOVDDUP_32_XPTR_IDX_8__X7 LONG $0x7C120FF2; WORD $0x20C6 // MOVDDUP 32(SI)(AX*8), X7 -#define MOVDDUP_48_XPTR_IDX_8__X9 LONG $0x120F44F2; WORD $0xC64C; BYTE $0x30 // MOVDDUP 48(SI)(AX*8), X9 - -#define MOVDDUP_XPTR_IIDX_8__X2 LONG $0x14120FF2; BYTE $0xD6 // MOVDDUP (SI)(DX*8), X2 -#define MOVDDUP_16_XPTR_IIDX_8__X4 LONG $0x64120FF2; WORD $0x10D6 // MOVDDUP 16(SI)(DX*8), X4 -#define MOVDDUP_32_XPTR_IIDX_8__X6 LONG $0x74120FF2; WORD $0x20D6 // MOVDDUP 32(SI)(DX*8), X6 -#define MOVDDUP_48_XPTR_IIDX_8__X8 LONG $0x120F44F2; WORD $0xD644; BYTE $0x30 // MOVDDUP 48(SI)(DX*8), X8 - -#define ADDSUBPD_X2_X3 LONG $0xDAD00F66 // ADDSUBPD X2, X3 -#define ADDSUBPD_X4_X5 LONG $0xECD00F66 // ADDSUBPD X4, X5 -#define ADDSUBPD_X6_X7 LONG $0xFED00F66 // ADDSUBPD X6, X7 -#define ADDSUBPD_X8_X9 LONG $0xD00F4566; BYTE $0xC8 // ADDSUBPD X8, X9 - -#define X_PTR SI -#define Y_PTR DI -#define LEN CX -#define TAIL BX -#define SUM X0 -#define P_SUM X1 -#define IDX AX -#define I_IDX DX - -// func DotuUnitary(x, y []complex128) (sum complex128) -TEXT ·DotuUnitary(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_PTR // X_PTR = &x - MOVQ y_base+24(FP), Y_PTR // Y_PTR = &y - MOVQ x_len+8(FP), LEN // LEN = min( len(x), len(y) ) - CMPQ y_len+32(FP), LEN - CMOVQLE y_len+32(FP), LEN - PXOR SUM, SUM // SUM = 0 - CMPQ LEN, $0 // if LEN == 0 { return } - JE dot_end - PXOR P_SUM, P_SUM // P_SUM = 0 - XORQ IDX, IDX // IDX = 0 - MOVQ $1, DX // j = 1 - MOVQ LEN, TAIL - ANDQ $3, TAIL // TAIL = floor( LEN / 4 ) - SHRQ $2, LEN // LEN = LEN % 4 - JZ dot_tail // if LEN == 0 { goto dot_tail } - -dot_loop: // do { - MOVDDUP_XPTR_IDX_8__X3 // X_(i+1) = { real(x[i], real(x[i]) } - MOVDDUP_16_XPTR_IDX_8__X5 - MOVDDUP_32_XPTR_IDX_8__X7 - MOVDDUP_48_XPTR_IDX_8__X9 - - MOVDDUP_XPTR_IIDX_8__X2 // X_i = { imag(x[i]), imag(x[i]) } - MOVDDUP_16_XPTR_IIDX_8__X4 - MOVDDUP_32_XPTR_IIDX_8__X6 - MOVDDUP_48_XPTR_IIDX_8__X8 - - // X_j = { imag(y[i]), real(y[i]) } - MOVUPS (Y_PTR)(IDX*8), X10 - MOVUPS 16(Y_PTR)(IDX*8), X11 - MOVUPS 32(Y_PTR)(IDX*8), X12 - MOVUPS 48(Y_PTR)(IDX*8), X13 - - // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - MULPD X10, X3 - MULPD X11, X5 - MULPD X12, X7 - MULPD X13, X9 - - // X_j = { real(y[i]), imag(y[i]) } - SHUFPD $0x1, X10, X10 - SHUFPD $0x1, X11, X11 - SHUFPD $0x1, X12, X12 - SHUFPD $0x1, X13, X13 - - // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPD X10, X2 - MULPD X11, X4 - MULPD X12, X6 - MULPD X13, X8 - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDSUBPD_X4_X5 - ADDSUBPD_X6_X7 - ADDSUBPD_X8_X9 - - // psum += result[i] - ADDPD X3, SUM - ADDPD X5, P_SUM - ADDPD X7, SUM - ADDPD X9, P_SUM - - ADDQ $8, IDX // IDX += 8 - ADDQ $8, I_IDX // I_IDX += 8 - DECQ LEN - JNZ dot_loop // } while --LEN > 0 - ADDPD P_SUM, SUM // SUM += P_SUM - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE dot_end - -dot_tail: // do { - MOVDDUP_XPTR_IDX_8__X3 // X_(i+1) = { real(x[i] , real(x[i]) } - MOVDDUP_XPTR_IIDX_8__X2 // X_i = { imag(x[i]) , imag(x[i]) } - MOVUPS (Y_PTR)(IDX*8), X10 // X_j = { imag(y[i]) , real(y[i]) } - MULPD X10, X3 // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - SHUFPD $0x1, X10, X10 // X_j = { real(y[i]) , imag(y[i]) } - MULPD X10, X2 // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDPD X3, SUM // psum += result[i] - ADDQ $2, IDX // IDX += 2 - ADDQ $2, I_IDX // I_IDX += 2 - DECQ TAIL // --TAIL - JNZ dot_tail // } while TAIL > 0 - -dot_end: - MOVUPS SUM, sum+48(FP) - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/dscalinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/dscalinc_amd64.s deleted file mode 100644 index d8fd54d..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/dscalinc_amd64.s +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define SRC SI -#define DST SI -#define LEN CX -#define TAIL BX -#define INC R9 -#define INC3 R10 -#define ALPHA X0 -#define ALPHA_2 X1 - -#define MOVDDUP_ALPHA LONG $0x44120FF2; WORD $0x0824 // MOVDDUP 8(SP), X0 - -// func DscalInc(alpha float64, x []complex128, n, inc uintptr) -TEXT ·DscalInc(SB), NOSPLIT, $0 - MOVQ x_base+8(FP), SRC // SRC = &x - MOVQ n+32(FP), LEN // LEN = n - CMPQ LEN, $0 // if LEN == 0 { return } - JE dscal_end - - MOVDDUP_ALPHA // ALPHA = alpha - MOVQ inc+40(FP), INC // INC = inc - SHLQ $4, INC // INC = INC * sizeof(complex128) - LEAQ (INC)(INC*2), INC3 // INC3 = 3 * INC - MOVUPS ALPHA, ALPHA_2 // Copy ALPHA and ALPHA_2 for pipelining - MOVQ LEN, TAIL // TAIL = LEN - SHRQ $2, LEN // LEN = floor( n / 4 ) - JZ dscal_tail // if LEN == 0 { goto dscal_tail } - -dscal_loop: // do { - MOVUPS (SRC), X2 // X_i = x[i] - MOVUPS (SRC)(INC*1), X3 - MOVUPS (SRC)(INC*2), X4 - MOVUPS (SRC)(INC3*1), X5 - - MULPD ALPHA, X2 // X_i *= ALPHA - MULPD ALPHA_2, X3 - MULPD ALPHA, X4 - MULPD ALPHA_2, X5 - - MOVUPS X2, (DST) // x[i] = X_i - MOVUPS X3, (DST)(INC*1) - MOVUPS X4, (DST)(INC*2) - MOVUPS X5, (DST)(INC3*1) - - LEAQ (SRC)(INC*4), SRC // SRC += INC*4 - DECQ LEN - JNZ dscal_loop // } while --LEN > 0 - -dscal_tail: - ANDQ $3, TAIL // TAIL = TAIL % 4 - JE dscal_end // if TAIL == 0 { return } - -dscal_tail_loop: // do { - MOVUPS (SRC), X2 // X_i = x[i] - MULPD ALPHA, X2 // X_i *= ALPHA - MOVUPS X2, (DST) // x[i] = X_i - ADDQ INC, SRC // SRC += INC - DECQ TAIL - JNZ dscal_tail_loop // } while --TAIL > 0 - -dscal_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/dscalunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/dscalunitary_amd64.s deleted file mode 100644 index 6ed900a..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/dscalunitary_amd64.s +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define SRC SI -#define DST SI -#define LEN CX -#define IDX AX -#define TAIL BX -#define ALPHA X0 -#define ALPHA_2 X1 - -#define MOVDDUP_ALPHA LONG $0x44120FF2; WORD $0x0824 // MOVDDUP 8(SP), X0 - -// func DscalUnitary(alpha float64, x []complex128) -TEXT ·DscalUnitary(SB), NOSPLIT, $0 - MOVQ x_base+8(FP), SRC // SRC = &x - MOVQ x_len+16(FP), LEN // LEN = len(x) - CMPQ LEN, $0 // if LEN == 0 { return } - JE dscal_end - - MOVDDUP_ALPHA // ALPHA = alpha - XORQ IDX, IDX // IDX = 0 - MOVUPS ALPHA, ALPHA_2 // Copy ALPHA to ALPHA_2 for pipelining - MOVQ LEN, TAIL // TAIL = LEN - SHRQ $2, LEN // LEN = floor( n / 4 ) - JZ dscal_tail // if LEN == 0 { goto dscal_tail } - -dscal_loop: // do { - MOVUPS (SRC)(IDX*8), X2 // X_i = x[i] - MOVUPS 16(SRC)(IDX*8), X3 - MOVUPS 32(SRC)(IDX*8), X4 - MOVUPS 48(SRC)(IDX*8), X5 - - MULPD ALPHA, X2 // X_i *= ALPHA - MULPD ALPHA_2, X3 - MULPD ALPHA, X4 - MULPD ALPHA_2, X5 - - MOVUPS X2, (DST)(IDX*8) // x[i] = X_i - MOVUPS X3, 16(DST)(IDX*8) - MOVUPS X4, 32(DST)(IDX*8) - MOVUPS X5, 48(DST)(IDX*8) - - ADDQ $8, IDX // IDX += 8 - DECQ LEN - JNZ dscal_loop // } while --LEN > 0 - -dscal_tail: - ANDQ $3, TAIL // TAIL = TAIL % 4 - JZ dscal_end // if TAIL == 0 { return } - -dscal_tail_loop: // do { - MOVUPS (SRC)(IDX*8), X2 // X_i = x[i] - MULPD ALPHA, X2 // X_i *= ALPHA - MOVUPS X2, (DST)(IDX*8) // x[i] = X_i - ADDQ $2, IDX // IDX += 2 - DECQ TAIL - JNZ dscal_tail_loop // } while --TAIL > 0 - -dscal_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/scal.go b/vendor/gonum.org/v1/gonum/internal/asm/c128/scal.go deleted file mode 100644 index 47a80e5..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/scal.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright ©2016 The Gonum 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 c128 - -// ScalUnitaryTo is -// for i, v := range x { -// dst[i] = alpha * v -// } -func ScalUnitaryTo(dst []complex128, alpha complex128, x []complex128) { - for i, v := range x { - dst[i] = alpha * v - } -} - -// ScalIncTo is -// var idst, ix uintptr -// for i := 0; i < int(n); i++ { -// dst[idst] = alpha * x[ix] -// ix += incX -// idst += incDst -// } -func ScalIncTo(dst []complex128, incDst uintptr, alpha complex128, x []complex128, n, incX uintptr) { - var idst, ix uintptr - for i := 0; i < int(n); i++ { - dst[idst] = alpha * x[ix] - ix += incX - idst += incDst - } -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/scalUnitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/scalUnitary_amd64.s deleted file mode 100644 index f08590e..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/scalUnitary_amd64.s +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define SRC SI -#define DST SI -#define LEN CX -#define IDX AX -#define TAIL BX -#define ALPHA X0 -#define ALPHA_C X1 -#define ALPHA2 X10 -#define ALPHA_C2 X11 - -#define MOVDDUP_X2_X3 LONG $0xDA120FF2 // MOVDDUP X2, X3 -#define MOVDDUP_X4_X5 LONG $0xEC120FF2 // MOVDDUP X4, X5 -#define MOVDDUP_X6_X7 LONG $0xFE120FF2 // MOVDDUP X6, X7 -#define MOVDDUP_X8_X9 LONG $0x120F45F2; BYTE $0xC8 // MOVDDUP X8, X9 - -#define ADDSUBPD_X2_X3 LONG $0xDAD00F66 // ADDSUBPD X2, X3 -#define ADDSUBPD_X4_X5 LONG $0xECD00F66 // ADDSUBPD X4, X5 -#define ADDSUBPD_X6_X7 LONG $0xFED00F66 // ADDSUBPD X6, X7 -#define ADDSUBPD_X8_X9 LONG $0xD00F4566; BYTE $0xC8 // ADDSUBPD X8, X9 - -// func ScalUnitary(alpha complex128, x []complex128) -TEXT ·ScalUnitary(SB), NOSPLIT, $0 - MOVQ x_base+16(FP), SRC // SRC = &x - MOVQ x_len+24(FP), LEN // LEN = len(x) - CMPQ LEN, $0 // if LEN == 0 { return } - JE scal_end - - MOVUPS alpha+0(FP), ALPHA // ALPHA = { imag(alpha), real(alpha) } - MOVAPS ALPHA, ALPHA_C - SHUFPD $0x1, ALPHA_C, ALPHA_C // ALPHA_C = { real(alpha), imag(alpha) } - - XORQ IDX, IDX // IDX = 0 - MOVAPS ALPHA, ALPHA2 // Copy ALPHA and ALPHA_C for pipelining - MOVAPS ALPHA_C, ALPHA_C2 - MOVQ LEN, TAIL - SHRQ $2, LEN // LEN = floor( n / 4 ) - JZ scal_tail // if BX == 0 { goto scal_tail } - -scal_loop: // do { - MOVUPS (SRC)(IDX*8), X2 // X_i = { imag(x[i]), real(x[i]) } - MOVUPS 16(SRC)(IDX*8), X4 - MOVUPS 32(SRC)(IDX*8), X6 - MOVUPS 48(SRC)(IDX*8), X8 - - // X_(i+1) = { real(x[i], real(x[i]) } - MOVDDUP_X2_X3 - MOVDDUP_X4_X5 - MOVDDUP_X6_X7 - MOVDDUP_X8_X9 - - // X_i = { imag(x[i]), imag(x[i]) } - SHUFPD $0x3, X2, X2 - SHUFPD $0x3, X4, X4 - SHUFPD $0x3, X6, X6 - SHUFPD $0x3, X8, X8 - - // X_i = { real(ALPHA) * imag(x[i]), imag(ALPHA) * imag(x[i]) } - // X_(i+1) = { imag(ALPHA) * real(x[i]), real(ALPHA) * real(x[i]) } - MULPD ALPHA_C, X2 - MULPD ALPHA, X3 - MULPD ALPHA_C2, X4 - MULPD ALPHA2, X5 - MULPD ALPHA_C, X6 - MULPD ALPHA, X7 - MULPD ALPHA_C2, X8 - MULPD ALPHA2, X9 - - // X_(i+1) = { - // imag(result[i]): imag(ALPHA)*real(x[i]) + real(ALPHA)*imag(x[i]), - // real(result[i]): real(ALPHA)*real(x[i]) - imag(ALPHA)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDSUBPD_X4_X5 - ADDSUBPD_X6_X7 - ADDSUBPD_X8_X9 - - MOVUPS X3, (DST)(IDX*8) // x[i] = X_(i+1) - MOVUPS X5, 16(DST)(IDX*8) - MOVUPS X7, 32(DST)(IDX*8) - MOVUPS X9, 48(DST)(IDX*8) - ADDQ $8, IDX // IDX += 8 - DECQ LEN - JNZ scal_loop // } while --LEN > 0 - -scal_tail: - ANDQ $3, TAIL // TAIL = TAIL % 4 - JZ scal_end // if TAIL == 0 { return } - -scal_tail_loop: // do { - MOVUPS (SRC)(IDX*8), X2 // X_i = { imag(x[i]), real(x[i]) } - MOVDDUP_X2_X3 // X_(i+1) = { real(x[i], real(x[i]) } - SHUFPD $0x3, X2, X2 // X_i = { imag(x[i]), imag(x[i]) } - MULPD ALPHA_C, X2 // X_i = { real(ALPHA) * imag(x[i]), imag(ALPHA) * imag(x[i]) } - MULPD ALPHA, X3 // X_(i+1) = { imag(ALPHA) * real(x[i]), real(ALPHA) * real(x[i]) } - - // X_(i+1) = { - // imag(result[i]): imag(ALPHA)*real(x[i]) + real(ALPHA)*imag(x[i]), - // real(result[i]): real(ALPHA)*real(x[i]) - imag(ALPHA)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - - MOVUPS X3, (DST)(IDX*8) // x[i] = X_(i+1) - ADDQ $2, IDX // IDX += 2 - DECQ TAIL - JNZ scal_tail_loop // } while --LEN > 0 - -scal_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/scalinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/scalinc_amd64.s deleted file mode 100644 index 5829ee5..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/scalinc_amd64.s +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define SRC SI -#define DST SI -#define LEN CX -#define TAIL BX -#define INC R9 -#define INC3 R10 -#define ALPHA X0 -#define ALPHA_C X1 -#define ALPHA2 X10 -#define ALPHA_C2 X11 - -#define MOVDDUP_X2_X3 LONG $0xDA120FF2 // MOVDDUP X2, X3 -#define MOVDDUP_X4_X5 LONG $0xEC120FF2 // MOVDDUP X4, X5 -#define MOVDDUP_X6_X7 LONG $0xFE120FF2 // MOVDDUP X6, X7 -#define MOVDDUP_X8_X9 LONG $0x120F45F2; BYTE $0xC8 // MOVDDUP X8, X9 - -#define ADDSUBPD_X2_X3 LONG $0xDAD00F66 // ADDSUBPD X2, X3 -#define ADDSUBPD_X4_X5 LONG $0xECD00F66 // ADDSUBPD X4, X5 -#define ADDSUBPD_X6_X7 LONG $0xFED00F66 // ADDSUBPD X6, X7 -#define ADDSUBPD_X8_X9 LONG $0xD00F4566; BYTE $0xC8 // ADDSUBPD X8, X9 - -// func ScalInc(alpha complex128, x []complex128, n, inc uintptr) -TEXT ·ScalInc(SB), NOSPLIT, $0 - MOVQ x_base+16(FP), SRC // SRC = &x - MOVQ n+40(FP), LEN // LEN = len(x) - CMPQ LEN, $0 - JE scal_end // if LEN == 0 { return } - - MOVQ inc+48(FP), INC // INC = inc - SHLQ $4, INC // INC = INC * sizeof(complex128) - LEAQ (INC)(INC*2), INC3 // INC3 = 3 * INC - - MOVUPS alpha+0(FP), ALPHA // ALPHA = { imag(alpha), real(alpha) } - MOVAPS ALPHA, ALPHA_C - SHUFPD $0x1, ALPHA_C, ALPHA_C // ALPHA_C = { real(alpha), imag(alpha) } - - MOVAPS ALPHA, ALPHA2 // Copy ALPHA and ALPHA_C for pipelining - MOVAPS ALPHA_C, ALPHA_C2 - MOVQ LEN, TAIL - SHRQ $2, LEN // LEN = floor( n / 4 ) - JZ scal_tail // if BX == 0 { goto scal_tail } - -scal_loop: // do { - MOVUPS (SRC), X2 // X_i = { imag(x[i]), real(x[i]) } - MOVUPS (SRC)(INC*1), X4 - MOVUPS (SRC)(INC*2), X6 - MOVUPS (SRC)(INC3*1), X8 - - // X_(i+1) = { real(x[i], real(x[i]) } - MOVDDUP_X2_X3 - MOVDDUP_X4_X5 - MOVDDUP_X6_X7 - MOVDDUP_X8_X9 - - // X_i = { imag(x[i]), imag(x[i]) } - SHUFPD $0x3, X2, X2 - SHUFPD $0x3, X4, X4 - SHUFPD $0x3, X6, X6 - SHUFPD $0x3, X8, X8 - - // X_i = { real(ALPHA) * imag(x[i]), imag(ALPHA) * imag(x[i]) } - // X_(i+1) = { imag(ALPHA) * real(x[i]), real(ALPHA) * real(x[i]) } - MULPD ALPHA_C, X2 - MULPD ALPHA, X3 - MULPD ALPHA_C2, X4 - MULPD ALPHA2, X5 - MULPD ALPHA_C, X6 - MULPD ALPHA, X7 - MULPD ALPHA_C2, X8 - MULPD ALPHA2, X9 - - // X_(i+1) = { - // imag(result[i]): imag(ALPHA)*real(x[i]) + real(ALPHA)*imag(x[i]), - // real(result[i]): real(ALPHA)*real(x[i]) - imag(ALPHA)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDSUBPD_X4_X5 - ADDSUBPD_X6_X7 - ADDSUBPD_X8_X9 - - MOVUPS X3, (DST) // x[i] = X_(i+1) - MOVUPS X5, (DST)(INC*1) - MOVUPS X7, (DST)(INC*2) - MOVUPS X9, (DST)(INC3*1) - - LEAQ (SRC)(INC*4), SRC // SRC = &(SRC[inc*4]) - DECQ LEN - JNZ scal_loop // } while --BX > 0 - -scal_tail: - ANDQ $3, TAIL // TAIL = TAIL % 4 - JE scal_end // if TAIL == 0 { return } - -scal_tail_loop: // do { - MOVUPS (SRC), X2 // X_i = { imag(x[i]), real(x[i]) } - MOVDDUP_X2_X3 // X_(i+1) = { real(x[i], real(x[i]) } - SHUFPD $0x3, X2, X2 // X_i = { imag(x[i]), imag(x[i]) } - MULPD ALPHA_C, X2 // X_i = { real(ALPHA) * imag(x[i]), imag(ALPHA) * imag(x[i]) } - MULPD ALPHA, X3 // X_(i+1) = { imag(ALPHA) * real(x[i]), real(ALPHA) * real(x[i]) } - - // X_(i+1) = { - // imag(result[i]): imag(ALPHA)*real(x[i]) + real(ALPHA)*imag(x[i]), - // real(result[i]): real(ALPHA)*real(x[i]) - imag(ALPHA)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - - MOVUPS X3, (DST) // x[i] = X_i - ADDQ INC, SRC // SRC = &(SRC[incX]) - DECQ TAIL - JNZ scal_tail_loop // } while --TAIL > 0 - -scal_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/stubs_amd64.go b/vendor/gonum.org/v1/gonum/internal/asm/c128/stubs_amd64.go deleted file mode 100644 index ad6b23c..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/stubs_amd64.go +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -package c128 - -// AxpyUnitary is -// for i, v := range x { -// y[i] += alpha * v -// } -func AxpyUnitary(alpha complex128, x, y []complex128) - -// AxpyUnitaryTo is -// for i, v := range x { -// dst[i] = alpha*v + y[i] -// } -func AxpyUnitaryTo(dst []complex128, alpha complex128, x, y []complex128) - -// AxpyInc is -// for i := 0; i < int(n); i++ { -// y[iy] += alpha * x[ix] -// ix += incX -// iy += incY -// } -func AxpyInc(alpha complex128, x, y []complex128, n, incX, incY, ix, iy uintptr) - -// AxpyIncTo is -// for i := 0; i < int(n); i++ { -// dst[idst] = alpha*x[ix] + y[iy] -// ix += incX -// iy += incY -// idst += incDst -// } -func AxpyIncTo(dst []complex128, incDst, idst uintptr, alpha complex128, x, y []complex128, n, incX, incY, ix, iy uintptr) - -// DscalUnitary is -// for i, v := range x { -// x[i] = complex(real(v)*alpha, imag(v)*alpha) -// } -func DscalUnitary(alpha float64, x []complex128) - -// DscalInc is -// var ix uintptr -// for i := 0; i < int(n); i++ { -// x[ix] = complex(real(x[ix])*alpha, imag(x[ix])*alpha) -// ix += inc -// } -func DscalInc(alpha float64, x []complex128, n, inc uintptr) - -// ScalInc is -// var ix uintptr -// for i := 0; i < int(n); i++ { -// x[ix] *= alpha -// ix += incX -// } -func ScalInc(alpha complex128, x []complex128, n, inc uintptr) - -// ScalUnitary is -// for i := range x { -// x[i] *= alpha -// } -func ScalUnitary(alpha complex128, x []complex128) - -// DotcUnitary is -// for i, v := range x { -// sum += y[i] * cmplx.Conj(v) -// } -// return sum -func DotcUnitary(x, y []complex128) (sum complex128) - -// DotcInc is -// for i := 0; i < int(n); i++ { -// sum += y[iy] * cmplx.Conj(x[ix]) -// ix += incX -// iy += incY -// } -// return sum -func DotcInc(x, y []complex128, n, incX, incY, ix, iy uintptr) (sum complex128) - -// DotuUnitary is -// for i, v := range x { -// sum += y[i] * v -// } -// return sum -func DotuUnitary(x, y []complex128) (sum complex128) - -// DotuInc is -// for i := 0; i < int(n); i++ { -// sum += y[iy] * x[ix] -// ix += incX -// iy += incY -// } -// return sum -func DotuInc(x, y []complex128, n, incX, incY, ix, iy uintptr) (sum complex128) diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/stubs_noasm.go b/vendor/gonum.org/v1/gonum/internal/asm/c128/stubs_noasm.go deleted file mode 100644 index 6313e57..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/stubs_noasm.go +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !amd64 noasm appengine safe - -package c128 - -import "math/cmplx" - -// AxpyUnitary is -// for i, v := range x { -// y[i] += alpha * v -// } -func AxpyUnitary(alpha complex128, x, y []complex128) { - for i, v := range x { - y[i] += alpha * v - } -} - -// AxpyUnitaryTo is -// for i, v := range x { -// dst[i] = alpha*v + y[i] -// } -func AxpyUnitaryTo(dst []complex128, alpha complex128, x, y []complex128) { - for i, v := range x { - dst[i] = alpha*v + y[i] - } -} - -// AxpyInc is -// for i := 0; i < int(n); i++ { -// y[iy] += alpha * x[ix] -// ix += incX -// iy += incY -// } -func AxpyInc(alpha complex128, x, y []complex128, n, incX, incY, ix, iy uintptr) { - for i := 0; i < int(n); i++ { - y[iy] += alpha * x[ix] - ix += incX - iy += incY - } -} - -// AxpyIncTo is -// for i := 0; i < int(n); i++ { -// dst[idst] = alpha*x[ix] + y[iy] -// ix += incX -// iy += incY -// idst += incDst -// } -func AxpyIncTo(dst []complex128, incDst, idst uintptr, alpha complex128, x, y []complex128, n, incX, incY, ix, iy uintptr) { - for i := 0; i < int(n); i++ { - dst[idst] = alpha*x[ix] + y[iy] - ix += incX - iy += incY - idst += incDst - } -} - -// DscalUnitary is -// for i, v := range x { -// x[i] = complex(real(v)*alpha, imag(v)*alpha) -// } -func DscalUnitary(alpha float64, x []complex128) { - for i, v := range x { - x[i] = complex(real(v)*alpha, imag(v)*alpha) - } -} - -// DscalInc is -// var ix uintptr -// for i := 0; i < int(n); i++ { -// x[ix] = complex(real(x[ix])*alpha, imag(x[ix])*alpha) -// ix += inc -// } -func DscalInc(alpha float64, x []complex128, n, inc uintptr) { - var ix uintptr - for i := 0; i < int(n); i++ { - x[ix] = complex(real(x[ix])*alpha, imag(x[ix])*alpha) - ix += inc - } -} - -// ScalInc is -// var ix uintptr -// for i := 0; i < int(n); i++ { -// x[ix] *= alpha -// ix += incX -// } -func ScalInc(alpha complex128, x []complex128, n, inc uintptr) { - var ix uintptr - for i := 0; i < int(n); i++ { - x[ix] *= alpha - ix += inc - } -} - -// ScalUnitary is -// for i := range x { -// x[i] *= alpha -// } -func ScalUnitary(alpha complex128, x []complex128) { - for i := range x { - x[i] *= alpha - } -} - -// DotcUnitary is -// for i, v := range x { -// sum += y[i] * cmplx.Conj(v) -// } -// return sum -func DotcUnitary(x, y []complex128) (sum complex128) { - for i, v := range x { - sum += y[i] * cmplx.Conj(v) - } - return sum -} - -// DotcInc is -// for i := 0; i < int(n); i++ { -// sum += y[iy] * cmplx.Conj(x[ix]) -// ix += incX -// iy += incY -// } -// return sum -func DotcInc(x, y []complex128, n, incX, incY, ix, iy uintptr) (sum complex128) { - for i := 0; i < int(n); i++ { - sum += y[iy] * cmplx.Conj(x[ix]) - ix += incX - iy += incY - } - return sum -} - -// DotuUnitary is -// for i, v := range x { -// sum += y[i] * v -// } -// return sum -func DotuUnitary(x, y []complex128) (sum complex128) { - for i, v := range x { - sum += y[i] * v - } - return sum -} - -// DotuInc is -// for i := 0; i < int(n); i++ { -// sum += y[iy] * x[ix] -// ix += incX -// iy += incY -// } -// return sum -func DotuInc(x, y []complex128, n, incX, incY, ix, iy uintptr) (sum complex128) { - for i := 0; i < int(n); i++ { - sum += y[iy] * x[ix] - ix += incX - iy += incY - } - return sum -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyinc_amd64.s deleted file mode 100644 index 5f10511..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyinc_amd64.s +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// MOVSHDUP X3, X2 -#define MOVSHDUP_X3_X2 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xD3 -// MOVSLDUP X3, X3 -#define MOVSLDUP_X3_X3 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xDB -// ADDSUBPS X2, X3 -#define ADDSUBPS_X2_X3 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xDA - -// MOVSHDUP X5, X4 -#define MOVSHDUP_X5_X4 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xE5 -// MOVSLDUP X5, X5 -#define MOVSLDUP_X5_X5 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xED -// ADDSUBPS X4, X5 -#define ADDSUBPS_X4_X5 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xEC - -// MOVSHDUP X7, X6 -#define MOVSHDUP_X7_X6 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xF7 -// MOVSLDUP X7, X7 -#define MOVSLDUP_X7_X7 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xFF -// ADDSUBPS X6, X7 -#define ADDSUBPS_X6_X7 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xFE - -// MOVSHDUP X9, X8 -#define MOVSHDUP_X9_X8 BYTE $0xF3; BYTE $0x45; BYTE $0x0F; BYTE $0x16; BYTE $0xC1 -// MOVSLDUP X9, X9 -#define MOVSLDUP_X9_X9 BYTE $0xF3; BYTE $0x45; BYTE $0x0F; BYTE $0x12; BYTE $0xC9 -// ADDSUBPS X8, X9 -#define ADDSUBPS_X8_X9 BYTE $0xF2; BYTE $0x45; BYTE $0x0F; BYTE $0xD0; BYTE $0xC8 - -// func AxpyInc(alpha complex64, x, y []complex64, n, incX, incY, ix, iy uintptr) -TEXT ·AxpyInc(SB), NOSPLIT, $0 - MOVQ x_base+8(FP), SI // SI = &x - MOVQ y_base+32(FP), DI // DI = &y - MOVQ n+56(FP), CX // CX = n - CMPQ CX, $0 // if n==0 { return } - JE axpyi_end - MOVQ ix+80(FP), R8 // R8 = ix - MOVQ iy+88(FP), R9 // R9 = iy - LEAQ (SI)(R8*8), SI // SI = &(x[ix]) - LEAQ (DI)(R9*8), DI // DI = &(y[iy]) - MOVQ DI, DX // DX = DI // Read/Write pointers - MOVQ incX+64(FP), R8 // R8 = incX - SHLQ $3, R8 // R8 *= sizeof(complex64) - MOVQ incY+72(FP), R9 // R9 = incY - SHLQ $3, R9 // R9 *= sizeof(complex64) - MOVSD alpha+0(FP), X0 // X0 = { 0, 0, imag(a), real(a) } - MOVAPS X0, X1 - SHUFPS $0x11, X1, X1 // X1 = { 0, 0, real(a), imag(a) } - MOVAPS X0, X10 // Copy X0 and X1 for pipelining - MOVAPS X1, X11 - MOVQ CX, BX - ANDQ $3, CX // CX = n % 4 - SHRQ $2, BX // BX = floor( n / 4 ) - JZ axpyi_tail // if BX == 0 { goto axpyi_tail } - -axpyi_loop: // do { - MOVSD (SI), X3 // X_i = { imag(x[i+1]), real(x[i+1]) } - MOVSD (SI)(R8*1), X5 - LEAQ (SI)(R8*2), SI // SI = &(SI[incX*2]) - MOVSD (SI), X7 - MOVSD (SI)(R8*1), X9 - - // X_(i-1) = { imag(x[i]), imag(x[i]) } - MOVSHDUP_X3_X2 - MOVSHDUP_X5_X4 - MOVSHDUP_X7_X6 - MOVSHDUP_X9_X8 - - // X_i = { real(x[i]), real(x[i]) } - MOVSLDUP_X3_X3 - MOVSLDUP_X5_X5 - MOVSLDUP_X7_X7 - MOVSLDUP_X9_X9 - - // X_(i-1) = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - // X_i = { imag(a) * real(x[i]), real(a) * real(x[i]) } - MULPS X1, X2 - MULPS X0, X3 - MULPS X11, X4 - MULPS X10, X5 - MULPS X1, X6 - MULPS X0, X7 - MULPS X11, X8 - MULPS X10, X9 - - // X_i = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]), - // } - ADDSUBPS_X2_X3 - ADDSUBPS_X4_X5 - ADDSUBPS_X6_X7 - ADDSUBPS_X8_X9 - - // X_i = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]) } - MOVSD (DX), X2 - MOVSD (DX)(R9*1), X4 - LEAQ (DX)(R9*2), DX // DX = &(DX[incY*2]) - MOVSD (DX), X6 - MOVSD (DX)(R9*1), X8 - ADDPS X2, X3 - ADDPS X4, X5 - ADDPS X6, X7 - ADDPS X8, X9 - - MOVSD X3, (DI) // y[i] = X_i - MOVSD X5, (DI)(R9*1) - LEAQ (DI)(R9*2), DI // DI = &(DI[incDst]) - MOVSD X7, (DI) - MOVSD X9, (DI)(R9*1) - LEAQ (SI)(R8*2), SI // SI = &(SI[incX*2]) - LEAQ (DX)(R9*2), DX // DX = &(DX[incY*2]) - LEAQ (DI)(R9*2), DI // DI = &(DI[incDst]) - DECQ BX - JNZ axpyi_loop // } while --BX > 0 - CMPQ CX, $0 // if CX == 0 { return } - JE axpyi_end - -axpyi_tail: // do { - MOVSD (SI), X3 // X_i = { imag(x[i+1]), real(x[i+1]) } - MOVSHDUP_X3_X2 // X_(i-1) = { real(x[i]), real(x[i]) } - MOVSLDUP_X3_X3 // X_i = { imag(x[i]), imag(x[i]) } - - // X_i = { imag(a) * real(x[i]), real(a) * real(x[i]) } - // X_(i-1) = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPS X1, X2 - MULPS X0, X3 - - // X_i = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]), - // } - ADDSUBPS_X2_X3 // (ai*x1r+ar*x1i, ar*x1r-ai*x1i) - - // X_i = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]) } - MOVSD (DI), X4 - ADDPS X4, X3 - MOVSD X3, (DI) // y[i] = X_i - ADDQ R8, SI // SI += incX - ADDQ R9, DI // DI += incY - LOOP axpyi_tail // } while --CX > 0 - -axpyi_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyincto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyincto_amd64.s deleted file mode 100644 index 5b0e284..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyincto_amd64.s +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// MOVSHDUP X3, X2 -#define MOVSHDUP_X3_X2 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xD3 -// MOVSLDUP X3, X3 -#define MOVSLDUP_X3_X3 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xDB -// ADDSUBPS X2, X3 -#define ADDSUBPS_X2_X3 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xDA - -// MOVSHDUP X5, X4 -#define MOVSHDUP_X5_X4 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xE5 -// MOVSLDUP X5, X5 -#define MOVSLDUP_X5_X5 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xED -// ADDSUBPS X4, X5 -#define ADDSUBPS_X4_X5 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xEC - -// MOVSHDUP X7, X6 -#define MOVSHDUP_X7_X6 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xF7 -// MOVSLDUP X7, X7 -#define MOVSLDUP_X7_X7 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xFF -// ADDSUBPS X6, X7 -#define ADDSUBPS_X6_X7 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xFE - -// MOVSHDUP X9, X8 -#define MOVSHDUP_X9_X8 BYTE $0xF3; BYTE $0x45; BYTE $0x0F; BYTE $0x16; BYTE $0xC1 -// MOVSLDUP X9, X9 -#define MOVSLDUP_X9_X9 BYTE $0xF3; BYTE $0x45; BYTE $0x0F; BYTE $0x12; BYTE $0xC9 -// ADDSUBPS X8, X9 -#define ADDSUBPS_X8_X9 BYTE $0xF2; BYTE $0x45; BYTE $0x0F; BYTE $0xD0; BYTE $0xC8 - -// func AxpyIncTo(dst []complex64, incDst, idst uintptr, alpha complex64, x, y []complex64, n, incX, incY, ix, iy uintptr) -TEXT ·AxpyIncTo(SB), NOSPLIT, $0 - MOVQ dst_base+0(FP), DI // DI = &dst - MOVQ x_base+48(FP), SI // SI = &x - MOVQ y_base+72(FP), DX // DX = &y - MOVQ n+96(FP), CX // CX = n - CMPQ CX, $0 // if n==0 { return } - JE axpyi_end - MOVQ ix+120(FP), R8 // Load the first index - MOVQ iy+128(FP), R9 - MOVQ idst+32(FP), R10 - LEAQ (SI)(R8*8), SI // SI = &(x[ix]) - LEAQ (DX)(R9*8), DX // DX = &(y[iy]) - LEAQ (DI)(R10*8), DI // DI = &(dst[idst]) - MOVQ incX+104(FP), R8 // Incrementors*8 for easy iteration (ADDQ) - SHLQ $3, R8 - MOVQ incY+112(FP), R9 - SHLQ $3, R9 - MOVQ incDst+24(FP), R10 - SHLQ $3, R10 - MOVSD alpha+40(FP), X0 // X0 = { 0, 0, imag(a), real(a) } - MOVAPS X0, X1 - SHUFPS $0x11, X1, X1 // X1 = { 0, 0, real(a), imag(a) } - MOVAPS X0, X10 // Copy X0 and X1 for pipelining - MOVAPS X1, X11 - MOVQ CX, BX - ANDQ $3, CX // CX = n % 4 - SHRQ $2, BX // BX = floor( n / 4 ) - JZ axpyi_tail // if BX == 0 { goto axpyi_tail } - -axpyi_loop: // do { - MOVSD (SI), X3 // X_i = { imag(x[i]), real(x[i]) } - MOVSD (SI)(R8*1), X5 - LEAQ (SI)(R8*2), SI // SI = &(SI[incX*2]) - MOVSD (SI), X7 - MOVSD (SI)(R8*1), X9 - - // X_(i-1) = { imag(x[i]), imag(x[i]) } - MOVSHDUP_X3_X2 - MOVSHDUP_X5_X4 - MOVSHDUP_X7_X6 - MOVSHDUP_X9_X8 - - // X_i = { real(x[i]), real(x[i]) } - MOVSLDUP_X3_X3 - MOVSLDUP_X5_X5 - MOVSLDUP_X7_X7 - MOVSLDUP_X9_X9 - - // X_(i-1) = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - // X_i = { imag(a) * real(x[i]), real(a) * real(x[i]) } - MULPS X1, X2 - MULPS X0, X3 - MULPS X11, X4 - MULPS X10, X5 - MULPS X1, X6 - MULPS X0, X7 - MULPS X11, X8 - MULPS X10, X9 - - // X_i = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]), - // } - ADDSUBPS_X2_X3 - ADDSUBPS_X4_X5 - ADDSUBPS_X6_X7 - ADDSUBPS_X8_X9 - - // X_i = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]) } - MOVSD (DX), X2 - MOVSD (DX)(R9*1), X4 - LEAQ (DX)(R9*2), DX // DX = &(DX[incY*2]) - MOVSD (DX), X6 - MOVSD (DX)(R9*1), X8 - ADDPS X2, X3 - ADDPS X4, X5 - ADDPS X6, X7 - ADDPS X8, X9 - - MOVSD X3, (DI) // y[i] = X_i - MOVSD X5, (DI)(R10*1) - LEAQ (DI)(R10*2), DI // DI = &(DI[incDst]) - MOVSD X7, (DI) - MOVSD X9, (DI)(R10*1) - LEAQ (SI)(R8*2), SI // SI = &(SI[incX*2]) - LEAQ (DX)(R9*2), DX // DX = &(DX[incY*2]) - LEAQ (DI)(R10*2), DI // DI = &(DI[incDst]) - DECQ BX - JNZ axpyi_loop // } while --BX > 0 - CMPQ CX, $0 // if CX == 0 { return } - JE axpyi_end - -axpyi_tail: - MOVSD (SI), X3 // X_i = { imag(x[i]), real(x[i]) } - MOVSHDUP_X3_X2 // X_(i-1) = { imag(x[i]), imag(x[i]) } - MOVSLDUP_X3_X3 // X_i = { real(x[i]), real(x[i]) } - - // X_i = { imag(a) * real(x[i]), real(a) * real(x[i]) } - // X_(i-1) = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPS X1, X2 - MULPS X0, X3 - - // X_i = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]), - // } - ADDSUBPS_X2_X3 - - // X_i = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]) } - MOVSD (DX), X4 - ADDPS X4, X3 - MOVSD X3, (DI) // y[i] = X_i - ADDQ R8, SI // SI += incX - ADDQ R9, DX // DX += incY - ADDQ R10, DI // DI += incDst - LOOP axpyi_tail // } while --CX > 0 - -axpyi_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyunitary_amd64.s deleted file mode 100644 index c38cb3c..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyunitary_amd64.s +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// MOVSHDUP X3, X2 -#define MOVSHDUP_X3_X2 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xD3 -// MOVSLDUP X3, X3 -#define MOVSLDUP_X3_X3 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xDB -// ADDSUBPS X2, X3 -#define ADDSUBPS_X2_X3 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xDA - -// MOVSHDUP X5, X4 -#define MOVSHDUP_X5_X4 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xE5 -// MOVSLDUP X5, X5 -#define MOVSLDUP_X5_X5 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xED -// ADDSUBPS X4, X5 -#define ADDSUBPS_X4_X5 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xEC - -// MOVSHDUP X7, X6 -#define MOVSHDUP_X7_X6 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xF7 -// MOVSLDUP X7, X7 -#define MOVSLDUP_X7_X7 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xFF -// ADDSUBPS X6, X7 -#define ADDSUBPS_X6_X7 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xFE - -// MOVSHDUP X9, X8 -#define MOVSHDUP_X9_X8 BYTE $0xF3; BYTE $0x45; BYTE $0x0F; BYTE $0x16; BYTE $0xC1 -// MOVSLDUP X9, X9 -#define MOVSLDUP_X9_X9 BYTE $0xF3; BYTE $0x45; BYTE $0x0F; BYTE $0x12; BYTE $0xC9 -// ADDSUBPS X8, X9 -#define ADDSUBPS_X8_X9 BYTE $0xF2; BYTE $0x45; BYTE $0x0F; BYTE $0xD0; BYTE $0xC8 - -// func AxpyUnitary(alpha complex64, x, y []complex64) -TEXT ·AxpyUnitary(SB), NOSPLIT, $0 - MOVQ x_base+8(FP), SI // SI = &x - MOVQ y_base+32(FP), DI // DI = &y - MOVQ x_len+16(FP), CX // CX = min( len(x), len(y) ) - CMPQ y_len+40(FP), CX - CMOVQLE y_len+40(FP), CX - CMPQ CX, $0 // if CX == 0 { return } - JE caxy_end - PXOR X0, X0 // Clear work registers and cache-align loop - PXOR X1, X1 - MOVSD alpha+0(FP), X0 // X0 = { 0, 0, imag(a), real(a) } - SHUFPD $0, X0, X0 // X0 = { imag(a), real(a), imag(a), real(a) } - MOVAPS X0, X1 - SHUFPS $0x11, X1, X1 // X1 = { real(a), imag(a), real(a), imag(a) } - XORQ AX, AX // i = 0 - MOVQ DI, BX // Align on 16-byte boundary for ADDPS - ANDQ $15, BX // BX = &y & 15 - JZ caxy_no_trim // if BX == 0 { goto caxy_no_trim } - - // Trim first value in unaligned buffer - XORPS X2, X2 // Clear work registers and cache-align loop - XORPS X3, X3 - XORPS X4, X4 - MOVSD (SI)(AX*8), X3 // X3 = { imag(x[i]), real(x[i]) } - MOVSHDUP_X3_X2 // X2 = { imag(x[i]), imag(x[i]) } - MOVSLDUP_X3_X3 // X3 = { real(x[i]), real(x[i]) } - MULPS X1, X2 // X2 = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPS X0, X3 // X3 = { imag(a) * real(x[i]), real(a) * real(x[i]) } - - // X3 = { imag(a)*real(x[i]) + real(a)*imag(x[i]), real(a)*real(x[i]) - imag(a)*imag(x[i]) } - ADDSUBPS_X2_X3 - MOVSD (DI)(AX*8), X4 // X3 += y[i] - ADDPS X4, X3 - MOVSD X3, (DI)(AX*8) // y[i] = X3 - INCQ AX // i++ - DECQ CX // --CX - JZ caxy_end // if CX == 0 { return } - -caxy_no_trim: - MOVAPS X0, X10 // Copy X0 and X1 for pipelineing - MOVAPS X1, X11 - MOVQ CX, BX - ANDQ $7, CX // CX = n % 8 - SHRQ $3, BX // BX = floor( n / 8 ) - JZ caxy_tail // if BX == 0 { goto caxy_tail } - -caxy_loop: // do { - // X_i = { imag(x[i]), real(x[i]), imag(x[i+1]), real(x[i+1]) } - MOVUPS (SI)(AX*8), X3 - MOVUPS 16(SI)(AX*8), X5 - MOVUPS 32(SI)(AX*8), X7 - MOVUPS 48(SI)(AX*8), X9 - - // X_(i-1) = { imag(x[i]), imag(x[i]), imag(x[i]+1), imag(x[i]+1) } - MOVSHDUP_X3_X2 - MOVSHDUP_X5_X4 - MOVSHDUP_X7_X6 - MOVSHDUP_X9_X8 - - // X_i = { real(x[i]), real(x[i]), real(x[i+1]), real(x[i+1]) } - MOVSLDUP_X3_X3 - MOVSLDUP_X5_X5 - MOVSLDUP_X7_X7 - MOVSLDUP_X9_X9 - - // X_i = { imag(a) * real(x[i]), real(a) * real(x[i]), - // imag(a) * real(x[i+1]), real(a) * real(x[i+1]) } - // X_(i-1) = { real(a) * imag(x[i]), imag(a) * imag(x[i]), - // real(a) * imag(x[i+1]), imag(a) * imag(x[i+1]) } - MULPS X1, X2 - MULPS X0, X3 - MULPS X11, X4 - MULPS X10, X5 - MULPS X1, X6 - MULPS X0, X7 - MULPS X11, X8 - MULPS X10, X9 - - // X_i = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]), - // imag(result[i+1]): imag(a)*real(x[i+1]) + real(a)*imag(x[i+1]), - // real(result[i+1]): real(a)*real(x[i+1]) - imag(a)*imag(x[i+1]), - // } - ADDSUBPS_X2_X3 - ADDSUBPS_X4_X5 - ADDSUBPS_X6_X7 - ADDSUBPS_X8_X9 - - // X_i = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]), - // imag(result[i+1]) + imag(y[i+1]), real(result[i+1]) + real(y[i+1]) } - ADDPS (DI)(AX*8), X3 - ADDPS 16(DI)(AX*8), X5 - ADDPS 32(DI)(AX*8), X7 - ADDPS 48(DI)(AX*8), X9 - MOVUPS X3, (DI)(AX*8) // y[i:i+1] = X_i - MOVUPS X5, 16(DI)(AX*8) - MOVUPS X7, 32(DI)(AX*8) - MOVUPS X9, 48(DI)(AX*8) - ADDQ $8, AX // i += 8 - DECQ BX // --BX - JNZ caxy_loop // } while BX > 0 - CMPQ CX, $0 // if CX == 0 { return } - JE caxy_end - -caxy_tail: // do { - MOVSD (SI)(AX*8), X3 // X3 = { imag(x[i]), real(x[i]) } - MOVSHDUP_X3_X2 // X2 = { imag(x[i]), imag(x[i]) } - MOVSLDUP_X3_X3 // X3 = { real(x[i]), real(x[i]) } - MULPS X1, X2 // X2 = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPS X0, X3 // X3 = { imag(a) * real(x[i]), real(a) * real(x[i]) } - - // X3 = { imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(a)*real(x[i]) - imag(a)*imag(x[i]) } - ADDSUBPS_X2_X3 - MOVSD (DI)(AX*8), X4 // X3 += y[i] - ADDPS X4, X3 - MOVSD X3, (DI)(AX*8) // y[i] = X3 - INCQ AX // ++i - LOOP caxy_tail // } while --CX > 0 - -caxy_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyunitaryto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyunitaryto_amd64.s deleted file mode 100644 index fee4bb9..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyunitaryto_amd64.s +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// MOVSHDUP X3, X2 -#define MOVSHDUP_X3_X2 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xD3 -// MOVSLDUP X3, X3 -#define MOVSLDUP_X3_X3 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xDB -// ADDSUBPS X2, X3 -#define ADDSUBPS_X2_X3 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xDA - -// MOVSHDUP X5, X4 -#define MOVSHDUP_X5_X4 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xE5 -// MOVSLDUP X5, X5 -#define MOVSLDUP_X5_X5 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xED -// ADDSUBPS X4, X5 -#define ADDSUBPS_X4_X5 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xEC - -// MOVSHDUP X7, X6 -#define MOVSHDUP_X7_X6 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xF7 -// MOVSLDUP X7, X7 -#define MOVSLDUP_X7_X7 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xFF -// ADDSUBPS X6, X7 -#define ADDSUBPS_X6_X7 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xFE - -// MOVSHDUP X9, X8 -#define MOVSHDUP_X9_X8 BYTE $0xF3; BYTE $0x45; BYTE $0x0F; BYTE $0x16; BYTE $0xC1 -// MOVSLDUP X9, X9 -#define MOVSLDUP_X9_X9 BYTE $0xF3; BYTE $0x45; BYTE $0x0F; BYTE $0x12; BYTE $0xC9 -// ADDSUBPS X8, X9 -#define ADDSUBPS_X8_X9 BYTE $0xF2; BYTE $0x45; BYTE $0x0F; BYTE $0xD0; BYTE $0xC8 - -// func AxpyUnitaryTo(dst []complex64, alpha complex64, x, y []complex64) -TEXT ·AxpyUnitaryTo(SB), NOSPLIT, $0 - MOVQ dst_base+0(FP), DI // DI = &dst - MOVQ x_base+32(FP), SI // SI = &x - MOVQ y_base+56(FP), DX // DX = &y - MOVQ x_len+40(FP), CX - CMPQ y_len+64(FP), CX // CX = min( len(x), len(y), len(dst) ) - CMOVQLE y_len+64(FP), CX - CMPQ dst_len+8(FP), CX - CMOVQLE dst_len+8(FP), CX - CMPQ CX, $0 // if CX == 0 { return } - JE caxy_end - MOVSD alpha+24(FP), X0 // X0 = { 0, 0, imag(a), real(a) } - SHUFPD $0, X0, X0 // X0 = { imag(a), real(a), imag(a), real(a) } - MOVAPS X0, X1 - SHUFPS $0x11, X1, X1 // X1 = { real(a), imag(a), real(a), imag(a) } - XORQ AX, AX // i = 0 - MOVQ DX, BX // Align on 16-byte boundary for ADDPS - ANDQ $15, BX // BX = &y & 15 - JZ caxy_no_trim // if BX == 0 { goto caxy_no_trim } - - MOVSD (SI)(AX*8), X3 // X3 = { imag(x[i]), real(x[i]) } - MOVSHDUP_X3_X2 // X2 = { imag(x[i]), imag(x[i]) } - MOVSLDUP_X3_X3 // X3 = { real(x[i]), real(x[i]) } - MULPS X1, X2 // X2 = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPS X0, X3 // X3 = { imag(a) * real(x[i]), real(a) * real(x[i]) } - - // X3 = { imag(a)*real(x[i]) + real(a)*imag(x[i]), real(a)*real(x[i]) - imag(a)*imag(x[i]) } - ADDSUBPS_X2_X3 - MOVSD (DX)(AX*8), X4 // X3 += y[i] - ADDPS X4, X3 - MOVSD X3, (DI)(AX*8) // dst[i] = X3 - INCQ AX // i++ - DECQ CX // --CX - JZ caxy_tail // if BX == 0 { goto caxy_tail } - -caxy_no_trim: - MOVAPS X0, X10 // Copy X0 and X1 for pipelineing - MOVAPS X1, X11 - MOVQ CX, BX - ANDQ $7, CX // CX = n % 8 - SHRQ $3, BX // BX = floor( n / 8 ) - JZ caxy_tail // if BX == 0 { goto caxy_tail } - -caxy_loop: - // X_i = { imag(x[i]), real(x[i]), imag(x[i+1]), real(x[i+1]) } - MOVUPS (SI)(AX*8), X3 - MOVUPS 16(SI)(AX*8), X5 - MOVUPS 32(SI)(AX*8), X7 - MOVUPS 48(SI)(AX*8), X9 - - // X_(i-1) = { imag(x[i]), imag(x[i]), imag(x[i]+1), imag(x[i]+1) } - MOVSHDUP_X3_X2 - MOVSHDUP_X5_X4 - MOVSHDUP_X7_X6 - MOVSHDUP_X9_X8 - - // X_i = { real(x[i]), real(x[i]), real(x[i+1]), real(x[i+1]) } - MOVSLDUP_X3_X3 - MOVSLDUP_X5_X5 - MOVSLDUP_X7_X7 - MOVSLDUP_X9_X9 - - // X_i = { imag(a) * real(x[i]), real(a) * real(x[i]), - // imag(a) * real(x[i+1]), real(a) * real(x[i+1]) } - // X_(i-1) = { real(a) * imag(x[i]), imag(a) * imag(x[i]), - // real(a) * imag(x[i+1]), imag(a) * imag(x[i+1]) } - MULPS X1, X2 - MULPS X0, X3 - MULPS X11, X4 - MULPS X10, X5 - MULPS X1, X6 - MULPS X0, X7 - MULPS X11, X8 - MULPS X10, X9 - - // X_i = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]), - // imag(result[i+1]): imag(a)*real(x[i+1]) + real(a)*imag(x[i+1]), - // real(result[i+1]): real(a)*real(x[i+1]) - imag(a)*imag(x[i+1]), - // } - ADDSUBPS_X2_X3 - ADDSUBPS_X4_X5 - ADDSUBPS_X6_X7 - ADDSUBPS_X8_X9 - - // X_i = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]), - // imag(result[i+1]) + imag(y[i+1]), real(result[i+1]) + real(y[i+1]) } - ADDPS (DX)(AX*8), X3 - ADDPS 16(DX)(AX*8), X5 - ADDPS 32(DX)(AX*8), X7 - ADDPS 48(DX)(AX*8), X9 - MOVUPS X3, (DI)(AX*8) // y[i:i+1] = X_i - MOVUPS X5, 16(DI)(AX*8) - MOVUPS X7, 32(DI)(AX*8) - MOVUPS X9, 48(DI)(AX*8) - ADDQ $8, AX // i += 8 - DECQ BX // --BX - JNZ caxy_loop // } while BX > 0 - CMPQ CX, $0 // if CX == 0 { return } - JE caxy_end - -caxy_tail: // do { - MOVSD (SI)(AX*8), X3 // X3 = { imag(x[i]), real(x[i]) } - MOVSHDUP_X3_X2 // X2 = { imag(x[i]), imag(x[i]) } - MOVSLDUP_X3_X3 // X3 = { real(x[i]), real(x[i]) } - MULPS X1, X2 // X2 = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPS X0, X3 // X3 = { imag(a) * real(x[i]), real(a) * real(x[i]) } - - // X3 = { imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(a)*real(x[i]) - imag(a)*imag(x[i]) } - ADDSUBPS_X2_X3 - MOVSD (DX)(AX*8), X4 // X3 += y[i] - ADDPS X4, X3 - MOVSD X3, (DI)(AX*8) // y[i] = X3 - INCQ AX // ++i - LOOP caxy_tail // } while --CX > 0 - -caxy_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/conj.go b/vendor/gonum.org/v1/gonum/internal/asm/c64/conj.go deleted file mode 100644 index 910e1e5..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/conj.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright ©2015 The Gonum 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 c64 - -func conj(c complex64) complex64 { return complex(real(c), -imag(c)) } diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/doc.go b/vendor/gonum.org/v1/gonum/internal/asm/c64/doc.go deleted file mode 100644 index 35f1b2a..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright ©2017 The Gonum 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 c64 provides complex64 vector primitives. -package c64 // import "gonum.org/v1/gonum/internal/asm/c64" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/dotcinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c64/dotcinc_amd64.s deleted file mode 100644 index 2161643..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/dotcinc_amd64.s +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define MOVSHDUP_X3_X2 LONG $0xD3160FF3 // MOVSHDUP X3, X2 -#define MOVSHDUP_X5_X4 LONG $0xE5160FF3 // MOVSHDUP X5, X4 -#define MOVSHDUP_X7_X6 LONG $0xF7160FF3 // MOVSHDUP X7, X6 -#define MOVSHDUP_X9_X8 LONG $0x160F45F3; BYTE $0xC1 // MOVSHDUP X9, X8 - -#define MOVSLDUP_X3_X3 LONG $0xDB120FF3 // MOVSLDUP X3, X3 -#define MOVSLDUP_X5_X5 LONG $0xED120FF3 // MOVSLDUP X5, X5 -#define MOVSLDUP_X7_X7 LONG $0xFF120FF3 // MOVSLDUP X7, X7 -#define MOVSLDUP_X9_X9 LONG $0x120F45F3; BYTE $0xC9 // MOVSLDUP X9, X9 - -#define ADDSUBPS_X2_X3 LONG $0xDAD00FF2 // ADDSUBPS X2, X3 -#define ADDSUBPS_X4_X5 LONG $0xECD00FF2 // ADDSUBPS X4, X5 -#define ADDSUBPS_X6_X7 LONG $0xFED00FF2 // ADDSUBPS X6, X7 -#define ADDSUBPS_X8_X9 LONG $0xD00F45F2; BYTE $0xC8 // ADDSUBPS X8, X9 - -#define X_PTR SI -#define Y_PTR DI -#define LEN CX -#define TAIL BX -#define SUM X0 -#define P_SUM X1 -#define INC_X R8 -#define INCx3_X R9 -#define INC_Y R10 -#define INCx3_Y R11 -#define NEG1 X15 -#define P_NEG1 X14 - -// func DotcInc(x, y []complex64, n, incX, incY, ix, iy uintptr) (sum complex64) -TEXT ·DotcInc(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_PTR // X_PTR = &x - MOVQ y_base+24(FP), Y_PTR // Y_PTR = &y - PXOR SUM, SUM // SUM = 0 - PXOR P_SUM, P_SUM // P_SUM = 0 - MOVQ n+48(FP), LEN // LEN = n - CMPQ LEN, $0 // if LEN == 0 { return } - JE dotc_end - MOVQ ix+72(FP), INC_X - MOVQ iy+80(FP), INC_Y - LEAQ (X_PTR)(INC_X*8), X_PTR // X_PTR = &(X_PTR[ix]) - LEAQ (Y_PTR)(INC_Y*8), Y_PTR // Y_PTR = &(Y_PTR[iy]) - MOVQ incX+56(FP), INC_X // INC_X = incX * sizeof(complex64) - SHLQ $3, INC_X - MOVQ incY+64(FP), INC_Y // INC_Y = incY * sizeof(complex64) - SHLQ $3, INC_Y - MOVSS $(-1.0), NEG1 - SHUFPS $0, NEG1, NEG1 // { -1, -1, -1, -1 } - - MOVQ LEN, TAIL - ANDQ $3, TAIL // TAIL = LEN % 4 - SHRQ $2, LEN // LEN = floor( LEN / 4 ) - JZ dotc_tail // if LEN == 0 { goto dotc_tail } - - MOVUPS NEG1, P_NEG1 // Copy NEG1 for pipelining - LEAQ (INC_X)(INC_X*2), INCx3_X // INCx3_X = INC_X * 3 - LEAQ (INC_Y)(INC_Y*2), INCx3_Y // INCx3_Y = INC_Y * 3 - -dotc_loop: // do { - MOVSD (X_PTR), X3 // X_i = { imag(x[i]), real(x[i]) } - MOVSD (X_PTR)(INC_X*1), X5 - MOVSD (X_PTR)(INC_X*2), X7 - MOVSD (X_PTR)(INCx3_X*1), X9 - - // X_(i-1) = { imag(x[i]), imag(x[i]) } - MOVSHDUP_X3_X2 - MOVSHDUP_X5_X4 - MOVSHDUP_X7_X6 - MOVSHDUP_X9_X8 - - // X_i = { real(x[i]), real(x[i]) } - MOVSLDUP_X3_X3 - MOVSLDUP_X5_X5 - MOVSLDUP_X7_X7 - MOVSLDUP_X9_X9 - - // X_(i-1) = { -imag(x[i]), -imag(x[i]) } - MULPS NEG1, X2 - MULPS P_NEG1, X4 - MULPS NEG1, X6 - MULPS P_NEG1, X8 - - // X_j = { imag(y[i]), real(y[i]) } - MOVSD (Y_PTR), X10 - MOVSD (Y_PTR)(INC_Y*1), X11 - MOVSD (Y_PTR)(INC_Y*2), X12 - MOVSD (Y_PTR)(INCx3_Y*1), X13 - - // X_i = { imag(y[i]) * real(x[i]), real(y[i]) * real(x[i]) } - MULPS X10, X3 - MULPS X11, X5 - MULPS X12, X7 - MULPS X13, X9 - - // X_j = { real(y[i]), imag(y[i]) } - SHUFPS $0xB1, X10, X10 - SHUFPS $0xB1, X11, X11 - SHUFPS $0xB1, X12, X12 - SHUFPS $0xB1, X13, X13 - - // X_(i-1) = { real(y[i]) * imag(x[i]), imag(y[i]) * imag(x[i]) } - MULPS X10, X2 - MULPS X11, X4 - MULPS X12, X6 - MULPS X13, X8 - - // X_i = { - // imag(result[i]): imag(y[i]) * real(x[i]) + real(y[i]) * imag(x[i]), - // real(result[i]): real(y[i]) * real(x[i]) - imag(y[i]) * imag(x[i]) } - ADDSUBPS_X2_X3 - ADDSUBPS_X4_X5 - ADDSUBPS_X6_X7 - ADDSUBPS_X8_X9 - - // SUM += X_i - ADDPS X3, SUM - ADDPS X5, P_SUM - ADDPS X7, SUM - ADDPS X9, P_SUM - - LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(X_PTR[INC_X*4]) - LEAQ (Y_PTR)(INC_Y*4), Y_PTR // Y_PTR = &(Y_PTR[INC_Y*4]) - - DECQ LEN - JNZ dotc_loop // } while --LEN > 0 - - ADDPS P_SUM, SUM // SUM = { P_SUM + SUM } - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE dotc_end - -dotc_tail: // do { - MOVSD (X_PTR), X3 // X_i = { imag(x[i]), real(x[i]) } - MOVSHDUP_X3_X2 // X_(i-1) = { imag(x[i]), imag(x[i]) } - MOVSLDUP_X3_X3 // X_i = { real(x[i]), real(x[i]) } - MULPS NEG1, X2 // X_(i-1) = { -imag(x[i]), imag(x[i]) } - MOVUPS (Y_PTR), X10 // X_j = { imag(y[i]), real(y[i]) } - MULPS X10, X3 // X_i = { imag(y[i]) * real(x[i]), real(y[i]) * real(x[i]) } - SHUFPS $0x1, X10, X10 // X_j = { real(y[i]), imag(y[i]) } - MULPS X10, X2 // X_(i-1) = { real(y[i]) * imag(x[i]), imag(y[i]) * imag(x[i]) } - - // X_i = { - // imag(result[i]): imag(y[i])*real(x[i]) + real(y[i])*imag(x[i]), - // real(result[i]): real(y[i])*real(x[i]) - imag(y[i])*imag(x[i]) } - ADDSUBPS_X2_X3 - ADDPS X3, SUM // SUM += X_i - ADDQ INC_X, X_PTR // X_PTR += INC_X - ADDQ INC_Y, Y_PTR // Y_PTR += INC_Y - DECQ TAIL - JNZ dotc_tail // } while --TAIL > 0 - -dotc_end: - MOVSD SUM, sum+88(FP) // return SUM - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/dotcunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c64/dotcunitary_amd64.s deleted file mode 100644 index 4efc52b..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/dotcunitary_amd64.s +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define MOVSLDUP_XPTR_IDX_8__X3 LONG $0x1C120FF3; BYTE $0xC6 // MOVSLDUP (SI)(AX*8), X3 -#define MOVSLDUP_16_XPTR_IDX_8__X5 LONG $0x6C120FF3; WORD $0x10C6 // MOVSLDUP 16(SI)(AX*8), X5 -#define MOVSLDUP_32_XPTR_IDX_8__X7 LONG $0x7C120FF3; WORD $0x20C6 // MOVSLDUP 32(SI)(AX*8), X7 -#define MOVSLDUP_48_XPTR_IDX_8__X9 LONG $0x120F44F3; WORD $0xC64C; BYTE $0x30 // MOVSLDUP 48(SI)(AX*8), X9 - -#define MOVSHDUP_XPTR_IDX_8__X2 LONG $0x14160FF3; BYTE $0xC6 // MOVSHDUP (SI)(AX*8), X2 -#define MOVSHDUP_16_XPTR_IDX_8__X4 LONG $0x64160FF3; WORD $0x10C6 // MOVSHDUP 16(SI)(AX*8), X4 -#define MOVSHDUP_32_XPTR_IDX_8__X6 LONG $0x74160FF3; WORD $0x20C6 // MOVSHDUP 32(SI)(AX*8), X6 -#define MOVSHDUP_48_XPTR_IDX_8__X8 LONG $0x160F44F3; WORD $0xC644; BYTE $0x30 // MOVSHDUP 48(SI)(AX*8), X8 - -#define MOVSHDUP_X3_X2 LONG $0xD3160FF3 // MOVSHDUP X3, X2 -#define MOVSLDUP_X3_X3 LONG $0xDB120FF3 // MOVSLDUP X3, X3 - -#define ADDSUBPS_X2_X3 LONG $0xDAD00FF2 // ADDSUBPS X2, X3 -#define ADDSUBPS_X4_X5 LONG $0xECD00FF2 // ADDSUBPS X4, X5 -#define ADDSUBPS_X6_X7 LONG $0xFED00FF2 // ADDSUBPS X6, X7 -#define ADDSUBPS_X8_X9 LONG $0xD00F45F2; BYTE $0xC8 // ADDSUBPS X8, X9 - -#define X_PTR SI -#define Y_PTR DI -#define LEN CX -#define TAIL BX -#define SUM X0 -#define P_SUM X1 -#define IDX AX -#define I_IDX DX -#define NEG1 X15 -#define P_NEG1 X14 - -// func DotcUnitary(x, y []complex64) (sum complex64) -TEXT ·DotcUnitary(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_PTR // X_PTR = &x - MOVQ y_base+24(FP), Y_PTR // Y_PTR = &y - PXOR SUM, SUM // SUM = 0 - PXOR P_SUM, P_SUM // P_SUM = 0 - MOVQ x_len+8(FP), LEN // LEN = min( len(x), len(y) ) - CMPQ y_len+32(FP), LEN - CMOVQLE y_len+32(FP), LEN - CMPQ LEN, $0 // if LEN == 0 { return } - JE dotc_end - XORQ IDX, IDX // i = 0 - MOVSS $(-1.0), NEG1 - SHUFPS $0, NEG1, NEG1 // { -1, -1, -1, -1 } - - MOVQ X_PTR, DX - ANDQ $15, DX // DX = &x & 15 - JZ dotc_aligned // if DX == 0 { goto dotc_aligned } - - MOVSD (X_PTR)(IDX*8), X3 // X_i = { imag(x[i]), real(x[i]) } - MOVSHDUP_X3_X2 // X_(i-1) = { imag(x[i]), imag(x[i]) } - MOVSLDUP_X3_X3 // X_i = { real(x[i]), real(x[i]) } - MOVSD (Y_PTR)(IDX*8), X10 // X_j = { imag(y[i]), real(y[i]) } - MULPS NEG1, X2 // X_(i-1) = { -imag(x[i]), imag(x[i]) } - MULPS X10, X3 // X_i = { imag(y[i]) * real(x[i]), real(y[i]) * real(x[i]) } - SHUFPS $0x1, X10, X10 // X_j = { real(y[i]), imag(y[i]) } - MULPS X10, X2 // X_(i-1) = { real(y[i]) * imag(x[i]), imag(y[i]) * imag(x[i]) } - - // X_i = { - // imag(result[i]): imag(y[i])*real(x[i]) + real(y[i])*imag(x[i]), - // real(result[i]): real(y[i])*real(x[i]) - imag(y[i])*imag(x[i]) } - ADDSUBPS_X2_X3 - - MOVAPS X3, SUM // SUM = X_i - INCQ IDX // IDX++ - DECQ LEN // LEN-- - JZ dotc_ret // if LEN == 0 { goto dotc_ret } - -dotc_aligned: - MOVQ LEN, TAIL - ANDQ $7, TAIL // TAIL = LEN % 8 - SHRQ $3, LEN // LEN = floor( LEN / 8 ) - JZ dotc_tail // if LEN == 0 { return } - MOVUPS NEG1, P_NEG1 // Copy NEG1 for pipelining - -dotc_loop: // do { - MOVSLDUP_XPTR_IDX_8__X3 // X_i = { real(x[i]), real(x[i]), real(x[i+1]), real(x[i+1]) } - MOVSLDUP_16_XPTR_IDX_8__X5 - MOVSLDUP_32_XPTR_IDX_8__X7 - MOVSLDUP_48_XPTR_IDX_8__X9 - - MOVSHDUP_XPTR_IDX_8__X2 // X_(i-1) = { imag(x[i]), imag(x[i]), imag(x[i+1]), imag(x[i+1]) } - MOVSHDUP_16_XPTR_IDX_8__X4 - MOVSHDUP_32_XPTR_IDX_8__X6 - MOVSHDUP_48_XPTR_IDX_8__X8 - - // X_j = { imag(y[i]), real(y[i]), imag(y[i+1]), real(y[i+1]) } - MOVUPS (Y_PTR)(IDX*8), X10 - MOVUPS 16(Y_PTR)(IDX*8), X11 - MOVUPS 32(Y_PTR)(IDX*8), X12 - MOVUPS 48(Y_PTR)(IDX*8), X13 - - // X_(i-1) = { -imag(x[i]), -imag(x[i]), -imag(x[i]+1), -imag(x[i]+1) } - MULPS NEG1, X2 - MULPS P_NEG1, X4 - MULPS NEG1, X6 - MULPS P_NEG1, X8 - - // X_i = { imag(y[i]) * real(x[i]), real(y[i]) * real(x[i]), - // imag(y[i+1]) * real(x[i+1]), real(y[i+1]) * real(x[i+1]) } - MULPS X10, X3 - MULPS X11, X5 - MULPS X12, X7 - MULPS X13, X9 - - // X_j = { real(y[i]), imag(y[i]), real(y[i+1]), imag(y[i+1]) } - SHUFPS $0xB1, X10, X10 - SHUFPS $0xB1, X11, X11 - SHUFPS $0xB1, X12, X12 - SHUFPS $0xB1, X13, X13 - - // X_(i-1) = { real(y[i]) * imag(x[i]), imag(y[i]) * imag(x[i]), - // real(y[i+1]) * imag(x[i+1]), imag(y[i+1]) * imag(x[i+1]) } - MULPS X10, X2 - MULPS X11, X4 - MULPS X12, X6 - MULPS X13, X8 - - // X_i = { - // imag(result[i]): imag(y[i]) * real(x[i]) + real(y[i]) * imag(x[i]), - // real(result[i]): real(y[i]) * real(x[i]) - imag(y[i]) * imag(x[i]), - // imag(result[i+1]): imag(y[i+1]) * real(x[i+1]) + real(y[i+1]) * imag(x[i+1]), - // real(result[i+1]): real(y[i+1]) * real(x[i+1]) - imag(y[i+1]) * imag(x[i+1]), - // } - ADDSUBPS_X2_X3 - ADDSUBPS_X4_X5 - ADDSUBPS_X6_X7 - ADDSUBPS_X8_X9 - - // SUM += X_i - ADDPS X3, SUM - ADDPS X5, P_SUM - ADDPS X7, SUM - ADDPS X9, P_SUM - - ADDQ $8, IDX // IDX += 8 - DECQ LEN - JNZ dotc_loop // } while --LEN > 0 - - ADDPS SUM, P_SUM // P_SUM = { P_SUM[1] + SUM[1], P_SUM[0] + SUM[0] } - XORPS SUM, SUM // SUM = 0 - - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE dotc_end - -dotc_tail: - MOVQ TAIL, LEN - SHRQ $1, LEN // LEN = floor( LEN / 2 ) - JZ dotc_tail_one // if LEN == 0 { goto dotc_tail_one } - -dotc_tail_two: // do { - MOVSLDUP_XPTR_IDX_8__X3 // X_i = { real(x[i]), real(x[i]), real(x[i+1]), real(x[i+1]) } - MOVSHDUP_XPTR_IDX_8__X2 // X_(i-1) = { imag(x[i]), imag(x[i]), imag(x[i]+1), imag(x[i]+1) } - MOVUPS (Y_PTR)(IDX*8), X10 // X_j = { imag(y[i]), real(y[i]) } - MULPS NEG1, X2 // X_(i-1) = { -imag(x[i]), imag(x[i]) } - MULPS X10, X3 // X_i = { imag(y[i]) * real(x[i]), real(y[i]) * real(x[i]) } - SHUFPS $0xB1, X10, X10 // X_j = { real(y[i]), imag(y[i]) } - MULPS X10, X2 // X_(i-1) = { real(y[i]) * imag(x[i]), imag(y[i]) * imag(x[i]) } - - // X_i = { - // imag(result[i]): imag(y[i])*real(x[i]) + real(y[i])*imag(x[i]), - // real(result[i]): real(y[i])*real(x[i]) - imag(y[i])*imag(x[i]) } - ADDSUBPS_X2_X3 - - ADDPS X3, SUM // SUM += X_i - - ADDQ $2, IDX // IDX += 2 - DECQ LEN - JNZ dotc_tail_two // } while --LEN > 0 - - ADDPS SUM, P_SUM // P_SUM = { P_SUM[1] + SUM[1], P_SUM[0] + SUM[0] } - XORPS SUM, SUM // SUM = 0 - - ANDQ $1, TAIL - JZ dotc_end - -dotc_tail_one: - MOVSD (X_PTR)(IDX*8), X3 // X_i = { imag(x[i]), real(x[i]) } - MOVSHDUP_X3_X2 // X_(i-1) = { imag(x[i]), imag(x[i]) } - MOVSLDUP_X3_X3 // X_i = { real(x[i]), real(x[i]) } - MOVSD (Y_PTR)(IDX*8), X10 // X_j = { imag(y[i]), real(y[i]) } - MULPS NEG1, X2 // X_(i-1) = { -imag(x[i]), imag(x[i]) } - MULPS X10, X3 // X_i = { imag(y[i]) * real(x[i]), real(y[i]) * real(x[i]) } - SHUFPS $0x1, X10, X10 // X_j = { real(y[i]), imag(y[i]) } - MULPS X10, X2 // X_(i-1) = { real(y[i]) * imag(x[i]), imag(y[i]) * imag(x[i]) } - - // X_i = { - // imag(result[i]): imag(y[i])*real(x[i]) + real(y[i])*imag(x[i]), - // real(result[i]): real(y[i])*real(x[i]) - imag(y[i])*imag(x[i]) } - ADDSUBPS_X2_X3 - - ADDPS X3, SUM // SUM += X_i - -dotc_end: - ADDPS P_SUM, SUM // SUM = { P_SUM[0] + SUM[0] } - MOVHLPS P_SUM, P_SUM // P_SUM = { P_SUM[1], P_SUM[1] } - ADDPS P_SUM, SUM // SUM = { P_SUM[1] + SUM[0] } - -dotc_ret: - MOVSD SUM, sum+48(FP) // return SUM - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/dotuinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c64/dotuinc_amd64.s deleted file mode 100644 index 6b26c5a..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/dotuinc_amd64.s +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define MOVSHDUP_X3_X2 LONG $0xD3160FF3 // MOVSHDUP X3, X2 -#define MOVSHDUP_X5_X4 LONG $0xE5160FF3 // MOVSHDUP X5, X4 -#define MOVSHDUP_X7_X6 LONG $0xF7160FF3 // MOVSHDUP X7, X6 -#define MOVSHDUP_X9_X8 LONG $0x160F45F3; BYTE $0xC1 // MOVSHDUP X9, X8 - -#define MOVSLDUP_X3_X3 LONG $0xDB120FF3 // MOVSLDUP X3, X3 -#define MOVSLDUP_X5_X5 LONG $0xED120FF3 // MOVSLDUP X5, X5 -#define MOVSLDUP_X7_X7 LONG $0xFF120FF3 // MOVSLDUP X7, X7 -#define MOVSLDUP_X9_X9 LONG $0x120F45F3; BYTE $0xC9 // MOVSLDUP X9, X9 - -#define ADDSUBPS_X2_X3 LONG $0xDAD00FF2 // ADDSUBPS X2, X3 -#define ADDSUBPS_X4_X5 LONG $0xECD00FF2 // ADDSUBPS X4, X5 -#define ADDSUBPS_X6_X7 LONG $0xFED00FF2 // ADDSUBPS X6, X7 -#define ADDSUBPS_X8_X9 LONG $0xD00F45F2; BYTE $0xC8 // ADDSUBPS X8, X9 - -#define X_PTR SI -#define Y_PTR DI -#define LEN CX -#define TAIL BX -#define SUM X0 -#define P_SUM X1 -#define INC_X R8 -#define INCx3_X R9 -#define INC_Y R10 -#define INCx3_Y R11 - -// func DotuInc(x, y []complex64, n, incX, incY, ix, iy uintptr) (sum complex64) -TEXT ·DotuInc(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_PTR // X_PTR = &x - MOVQ y_base+24(FP), Y_PTR // Y_PTR = &y - PXOR SUM, SUM // SUM = 0 - PXOR P_SUM, P_SUM // P_SUM = 0 - MOVQ n+48(FP), LEN // LEN = n - CMPQ LEN, $0 // if LEN == 0 { return } - JE dotu_end - MOVQ ix+72(FP), INC_X - MOVQ iy+80(FP), INC_Y - LEAQ (X_PTR)(INC_X*8), X_PTR // X_PTR = &(X_PTR[ix]) - LEAQ (Y_PTR)(INC_Y*8), Y_PTR // Y_PTR = &(Y_PTR[iy]) - MOVQ incX+56(FP), INC_X // INC_X = incX * sizeof(complex64) - SHLQ $3, INC_X - MOVQ incY+64(FP), INC_Y // INC_Y = incY * sizeof(complex64) - SHLQ $3, INC_Y - - MOVQ LEN, TAIL - ANDQ $3, TAIL // TAIL = LEN % 4 - SHRQ $2, LEN // LEN = floor( LEN / 4 ) - JZ dotu_tail // if TAIL == 0 { goto dotu_tail } - - LEAQ (INC_X)(INC_X*2), INCx3_X // INCx3_X = INC_X * 3 - LEAQ (INC_Y)(INC_Y*2), INCx3_Y // INCx3_Y = INC_Y * 3 - -dotu_loop: // do { - MOVSD (X_PTR), X3 // X_i = { imag(x[i]), real(x[i]) } - MOVSD (X_PTR)(INC_X*1), X5 - MOVSD (X_PTR)(INC_X*2), X7 - MOVSD (X_PTR)(INCx3_X*1), X9 - - // X_(i-1) = { imag(x[i]), imag(x[i]) } - MOVSHDUP_X3_X2 - MOVSHDUP_X5_X4 - MOVSHDUP_X7_X6 - MOVSHDUP_X9_X8 - - // X_i = { real(x[i]), real(x[i]) } - MOVSLDUP_X3_X3 - MOVSLDUP_X5_X5 - MOVSLDUP_X7_X7 - MOVSLDUP_X9_X9 - - // X_j = { imag(y[i]), real(y[i]) } - MOVSD (Y_PTR), X10 - MOVSD (Y_PTR)(INC_Y*1), X11 - MOVSD (Y_PTR)(INC_Y*2), X12 - MOVSD (Y_PTR)(INCx3_Y*1), X13 - - // X_i = { imag(y[i]) * real(x[i]), real(y[i]) * real(x[i]) } - MULPS X10, X3 - MULPS X11, X5 - MULPS X12, X7 - MULPS X13, X9 - - // X_j = { real(y[i]), imag(y[i]) } - SHUFPS $0xB1, X10, X10 - SHUFPS $0xB1, X11, X11 - SHUFPS $0xB1, X12, X12 - SHUFPS $0xB1, X13, X13 - - // X_(i-1) = { real(y[i]) * imag(x[i]), imag(y[i]) * imag(x[i]) } - MULPS X10, X2 - MULPS X11, X4 - MULPS X12, X6 - MULPS X13, X8 - - // X_i = { - // imag(result[i]): imag(y[i]) * real(x[i]) + real(y[i]) * imag(x[i]), - // real(result[i]): real(y[i]) * real(x[i]) - imag(y[i]) * imag(x[i]) } - ADDSUBPS_X2_X3 - ADDSUBPS_X4_X5 - ADDSUBPS_X6_X7 - ADDSUBPS_X8_X9 - - // SUM += X_i - ADDPS X3, SUM - ADDPS X5, P_SUM - ADDPS X7, SUM - ADDPS X9, P_SUM - - LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(X_PTR[INC_X*4]) - LEAQ (Y_PTR)(INC_Y*4), Y_PTR // Y_PTR = &(Y_PTR[INC_Y*4]) - - DECQ LEN - JNZ dotu_loop // } while --LEN > 0 - - ADDPS P_SUM, SUM // SUM = { P_SUM + SUM } - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE dotu_end - -dotu_tail: // do { - MOVSD (X_PTR), X3 // X_i = { imag(x[i]), real(x[i]) } - MOVSHDUP_X3_X2 // X_(i-1) = { imag(x[i]), imag(x[i]) } - MOVSLDUP_X3_X3 // X_i = { real(x[i]), real(x[i]) } - MOVUPS (Y_PTR), X10 // X_j = { imag(y[i]), real(y[i]) } - MULPS X10, X3 // X_i = { imag(y[i]) * real(x[i]), real(y[i]) * real(x[i]) } - SHUFPS $0x1, X10, X10 // X_j = { real(y[i]), imag(y[i]) } - MULPS X10, X2 // X_(i-1) = { real(y[i]) * imag(x[i]), imag(y[i]) * imag(x[i]) } - - // X_i = { - // imag(result[i]): imag(y[i])*real(x[i]) + real(y[i])*imag(x[i]), - // real(result[i]): real(y[i])*real(x[i]) - imag(y[i])*imag(x[i]) } - ADDSUBPS_X2_X3 - ADDPS X3, SUM // SUM += X_i - ADDQ INC_X, X_PTR // X_PTR += INC_X - ADDQ INC_Y, Y_PTR // Y_PTR += INC_Y - DECQ TAIL - JNZ dotu_tail // } while --TAIL > 0 - -dotu_end: - MOVSD SUM, sum+88(FP) // return SUM - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/dotuunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c64/dotuunitary_amd64.s deleted file mode 100644 index 07a115b..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/dotuunitary_amd64.s +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define MOVSLDUP_XPTR_IDX_8__X3 LONG $0x1C120FF3; BYTE $0xC6 // MOVSLDUP (SI)(AX*8), X3 -#define MOVSLDUP_16_XPTR_IDX_8__X5 LONG $0x6C120FF3; WORD $0x10C6 // MOVSLDUP 16(SI)(AX*8), X5 -#define MOVSLDUP_32_XPTR_IDX_8__X7 LONG $0x7C120FF3; WORD $0x20C6 // MOVSLDUP 32(SI)(AX*8), X7 -#define MOVSLDUP_48_XPTR_IDX_8__X9 LONG $0x120F44F3; WORD $0xC64C; BYTE $0x30 // MOVSLDUP 48(SI)(AX*8), X9 - -#define MOVSHDUP_XPTR_IDX_8__X2 LONG $0x14160FF3; BYTE $0xC6 // MOVSHDUP (SI)(AX*8), X2 -#define MOVSHDUP_16_XPTR_IDX_8__X4 LONG $0x64160FF3; WORD $0x10C6 // MOVSHDUP 16(SI)(AX*8), X4 -#define MOVSHDUP_32_XPTR_IDX_8__X6 LONG $0x74160FF3; WORD $0x20C6 // MOVSHDUP 32(SI)(AX*8), X6 -#define MOVSHDUP_48_XPTR_IDX_8__X8 LONG $0x160F44F3; WORD $0xC644; BYTE $0x30 // MOVSHDUP 48(SI)(AX*8), X8 - -#define MOVSHDUP_X3_X2 LONG $0xD3160FF3 // MOVSHDUP X3, X2 -#define MOVSLDUP_X3_X3 LONG $0xDB120FF3 // MOVSLDUP X3, X3 - -#define ADDSUBPS_X2_X3 LONG $0xDAD00FF2 // ADDSUBPS X2, X3 -#define ADDSUBPS_X4_X5 LONG $0xECD00FF2 // ADDSUBPS X4, X5 -#define ADDSUBPS_X6_X7 LONG $0xFED00FF2 // ADDSUBPS X6, X7 -#define ADDSUBPS_X8_X9 LONG $0xD00F45F2; BYTE $0xC8 // ADDSUBPS X8, X9 - -#define X_PTR SI -#define Y_PTR DI -#define LEN CX -#define TAIL BX -#define SUM X0 -#define P_SUM X1 -#define IDX AX -#define I_IDX DX -#define NEG1 X15 -#define P_NEG1 X14 - -// func DotuUnitary(x, y []complex64) (sum complex64) -TEXT ·DotuUnitary(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_PTR // X_PTR = &x - MOVQ y_base+24(FP), Y_PTR // Y_PTR = &y - PXOR SUM, SUM // SUM = 0 - PXOR P_SUM, P_SUM // P_SUM = 0 - MOVQ x_len+8(FP), LEN // LEN = min( len(x), len(y) ) - CMPQ y_len+32(FP), LEN - CMOVQLE y_len+32(FP), LEN - CMPQ LEN, $0 // if LEN == 0 { return } - JE dotu_end - XORQ IDX, IDX // IDX = 0 - - MOVQ X_PTR, DX - ANDQ $15, DX // DX = &x & 15 - JZ dotu_aligned // if DX == 0 { goto dotu_aligned } - - MOVSD (X_PTR)(IDX*8), X3 // X_i = { imag(x[i]), real(x[i]) } - MOVSHDUP_X3_X2 // X_(i-1) = { imag(x[i]), imag(x[i]) } - MOVSLDUP_X3_X3 // X_i = { real(x[i]), real(x[i]) } - MOVSD (Y_PTR)(IDX*8), X10 // X_j = { imag(y[i]), real(y[i]) } - MULPS X10, X3 // X_i = { imag(y[i]) * real(x[i]), real(y[i]) * real(x[i]) } - SHUFPS $0x1, X10, X10 // X_j = { real(y[i]), imag(y[i]) } - MULPS X10, X2 // X_(i-1) = { real(y[i]) * imag(x[i]), imag(y[i]) * imag(x[i]) } - - // X_i = { - // imag(result[i]): imag(y[i])*real(x[i]) + real(y[i])*imag(x[i]), - // real(result[i]): real(y[i])*real(x[i]) - imag(y[i])*imag(x[i]) } - ADDSUBPS_X2_X3 - - MOVAPS X3, SUM // SUM = X_i - INCQ IDX // IDX++ - DECQ LEN // LEN-- - JZ dotu_end // if LEN == 0 { goto dotu_end } - -dotu_aligned: - MOVQ LEN, TAIL - ANDQ $7, TAIL // TAIL = LEN % 8 - SHRQ $3, LEN // LEN = floor( LEN / 8 ) - JZ dotu_tail // if LEN == 0 { goto dotu_tail } - PXOR P_SUM, P_SUM - -dotu_loop: // do { - MOVSLDUP_XPTR_IDX_8__X3 // X_i = { real(x[i]), real(x[i]), real(x[i+1]), real(x[i+1]) } - MOVSLDUP_16_XPTR_IDX_8__X5 - MOVSLDUP_32_XPTR_IDX_8__X7 - MOVSLDUP_48_XPTR_IDX_8__X9 - - MOVSHDUP_XPTR_IDX_8__X2 // X_(i-1) = { imag(x[i]), imag(x[i]), imag(x[i]+1), imag(x[i]+1) } - MOVSHDUP_16_XPTR_IDX_8__X4 - MOVSHDUP_32_XPTR_IDX_8__X6 - MOVSHDUP_48_XPTR_IDX_8__X8 - - // X_j = { imag(y[i]), real(y[i]), imag(y[i+1]), real(y[i+1]) } - MOVUPS (Y_PTR)(IDX*8), X10 - MOVUPS 16(Y_PTR)(IDX*8), X11 - MOVUPS 32(Y_PTR)(IDX*8), X12 - MOVUPS 48(Y_PTR)(IDX*8), X13 - - // X_i = { imag(y[i]) * real(x[i]), real(y[i]) * real(x[i]), - // imag(y[i+1]) * real(x[i+1]), real(y[i+1]) * real(x[i+1]) } - MULPS X10, X3 - MULPS X11, X5 - MULPS X12, X7 - MULPS X13, X9 - - // X_j = { real(y[i]), imag(y[i]), real(y[i+1]), imag(y[i+1]) } - SHUFPS $0xB1, X10, X10 - SHUFPS $0xB1, X11, X11 - SHUFPS $0xB1, X12, X12 - SHUFPS $0xB1, X13, X13 - - // X_(i-1) = { real(y[i]) * imag(x[i]), imag(y[i]) * imag(x[i]), - // real(y[i+1]) * imag(x[i+1]), imag(y[i+1]) * imag(x[i+1]) } - MULPS X10, X2 - MULPS X11, X4 - MULPS X12, X6 - MULPS X13, X8 - - // X_i = { - // imag(result[i]): imag(y[i]) * real(x[i]) + real(y[i]) * imag(x[i]), - // real(result[i]): real(y[i]) * real(x[i]) - imag(y[i]) * imag(x[i]), - // imag(result[i+1]): imag(y[i+1]) * real(x[i+1]) + real(y[i+1]) * imag(x[i+1]), - // real(result[i+1]): real(y[i+1]) * real(x[i+1]) - imag(y[i+1]) * imag(x[i+1]), - // } - ADDSUBPS_X2_X3 - ADDSUBPS_X4_X5 - ADDSUBPS_X6_X7 - ADDSUBPS_X8_X9 - - // SUM += X_i - ADDPS X3, SUM - ADDPS X5, P_SUM - ADDPS X7, SUM - ADDPS X9, P_SUM - - ADDQ $8, IDX // IDX += 8 - DECQ LEN - JNZ dotu_loop // } while --LEN > 0 - - ADDPS SUM, P_SUM // P_SUM = { P_SUM[1] + SUM[1], P_SUM[0] + SUM[0] } - XORPS SUM, SUM // SUM = 0 - - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE dotu_end - -dotu_tail: - MOVQ TAIL, LEN - SHRQ $1, LEN // LEN = floor( LEN / 2 ) - JZ dotu_tail_one // if LEN == 0 { goto dotc_tail_one } - -dotu_tail_two: // do { - MOVSLDUP_XPTR_IDX_8__X3 // X_i = { real(x[i]), real(x[i]), real(x[i+1]), real(x[i+1]) } - MOVSHDUP_XPTR_IDX_8__X2 // X_(i-1) = { imag(x[i]), imag(x[i]), imag(x[i]+1), imag(x[i]+1) } - MOVUPS (Y_PTR)(IDX*8), X10 // X_j = { imag(y[i]), real(y[i]) } - MULPS X10, X3 // X_i = { imag(y[i]) * real(x[i]), real(y[i]) * real(x[i]) } - SHUFPS $0xB1, X10, X10 // X_j = { real(y[i]), imag(y[i]) } - MULPS X10, X2 // X_(i-1) = { real(y[i]) * imag(x[i]), imag(y[i]) * imag(x[i]) } - - // X_i = { - // imag(result[i]): imag(y[i])*real(x[i]) + real(y[i])*imag(x[i]), - // real(result[i]): real(y[i])*real(x[i]) - imag(y[i])*imag(x[i]) } - ADDSUBPS_X2_X3 - - ADDPS X3, SUM // SUM += X_i - - ADDQ $2, IDX // IDX += 2 - DECQ LEN - JNZ dotu_tail_two // } while --LEN > 0 - - ADDPS SUM, P_SUM // P_SUM = { P_SUM[1] + SUM[1], P_SUM[0] + SUM[0] } - XORPS SUM, SUM // SUM = 0 - - ANDQ $1, TAIL - JZ dotu_end - -dotu_tail_one: - MOVSD (X_PTR)(IDX*8), X3 // X_i = { imag(x[i]), real(x[i]) } - MOVSHDUP_X3_X2 // X_(i-1) = { imag(x[i]), imag(x[i]) } - MOVSLDUP_X3_X3 // X_i = { real(x[i]), real(x[i]) } - MOVSD (Y_PTR)(IDX*8), X10 // X_j = { imag(y[i]), real(y[i]) } - MULPS X10, X3 // X_i = { imag(y[i]) * real(x[i]), real(y[i]) * real(x[i]) } - SHUFPS $0x1, X10, X10 // X_j = { real(y[i]), imag(y[i]) } - MULPS X10, X2 // X_(i-1) = { real(y[i]) * imag(x[i]), imag(y[i]) * imag(x[i]) } - - // X_i = { - // imag(result[i]): imag(y[i])*real(x[i]) + real(y[i])*imag(x[i]), - // real(result[i]): real(y[i])*real(x[i]) - imag(y[i])*imag(x[i]) } - ADDSUBPS_X2_X3 - - ADDPS X3, SUM // SUM += X_i - -dotu_end: - ADDPS P_SUM, SUM // SUM = { P_SUM[0] + SUM[0] } - MOVHLPS P_SUM, P_SUM // P_SUM = { P_SUM[1], P_SUM[1] } - ADDPS P_SUM, SUM // SUM = { P_SUM[1] + SUM[0] } - -dotu_ret: - MOVSD SUM, sum+48(FP) // return SUM - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/scal.go b/vendor/gonum.org/v1/gonum/internal/asm/c64/scal.go deleted file mode 100644 index a84def8..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/scal.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright ©2016 The Gonum 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 c64 - -// ScalUnitary is -// for i := range x { -// x[i] *= alpha -// } -func ScalUnitary(alpha complex64, x []complex64) { - for i := range x { - x[i] *= alpha - } -} - -// ScalUnitaryTo is -// for i, v := range x { -// dst[i] = alpha * v -// } -func ScalUnitaryTo(dst []complex64, alpha complex64, x []complex64) { - for i, v := range x { - dst[i] = alpha * v - } -} - -// ScalInc is -// var ix uintptr -// for i := 0; i < int(n); i++ { -// x[ix] *= alpha -// ix += incX -// } -func ScalInc(alpha complex64, x []complex64, n, incX uintptr) { - var ix uintptr - for i := 0; i < int(n); i++ { - x[ix] *= alpha - ix += incX - } -} - -// ScalIncTo is -// var idst, ix uintptr -// for i := 0; i < int(n); i++ { -// dst[idst] = alpha * x[ix] -// ix += incX -// idst += incDst -// } -func ScalIncTo(dst []complex64, incDst uintptr, alpha complex64, x []complex64, n, incX uintptr) { - var idst, ix uintptr - for i := 0; i < int(n); i++ { - dst[idst] = alpha * x[ix] - ix += incX - idst += incDst - } -} - -// SscalUnitary is -// for i, v := range x { -// x[i] = complex(real(v)*alpha, imag(v)*alpha) -// } -func SscalUnitary(alpha float32, x []complex64) { - for i, v := range x { - x[i] = complex(real(v)*alpha, imag(v)*alpha) - } -} - -// SscalInc is -// var ix uintptr -// for i := 0; i < int(n); i++ { -// x[ix] = complex(real(x[ix])*alpha, imag(x[ix])*alpha) -// ix += inc -// } -func SscalInc(alpha float32, x []complex64, n, inc uintptr) { - var ix uintptr - for i := 0; i < int(n); i++ { - x[ix] = complex(real(x[ix])*alpha, imag(x[ix])*alpha) - ix += inc - } -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/stubs_amd64.go b/vendor/gonum.org/v1/gonum/internal/asm/c64/stubs_amd64.go deleted file mode 100644 index 3e12d6b..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/stubs_amd64.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -package c64 - -// AxpyUnitary is -// for i, v := range x { -// y[i] += alpha * v -// } -func AxpyUnitary(alpha complex64, x, y []complex64) - -// AxpyUnitaryTo is -// for i, v := range x { -// dst[i] = alpha*v + y[i] -// } -func AxpyUnitaryTo(dst []complex64, alpha complex64, x, y []complex64) - -// AxpyInc is -// for i := 0; i < int(n); i++ { -// y[iy] += alpha * x[ix] -// ix += incX -// iy += incY -// } -func AxpyInc(alpha complex64, x, y []complex64, n, incX, incY, ix, iy uintptr) - -// AxpyIncTo is -// for i := 0; i < int(n); i++ { -// dst[idst] = alpha*x[ix] + y[iy] -// ix += incX -// iy += incY -// idst += incDst -// } -func AxpyIncTo(dst []complex64, incDst, idst uintptr, alpha complex64, x, y []complex64, n, incX, incY, ix, iy uintptr) - -// DotcUnitary is -// for i, v := range x { -// sum += y[i] * conj(v) -// } -// return sum -func DotcUnitary(x, y []complex64) (sum complex64) - -// DotcInc is -// for i := 0; i < int(n); i++ { -// sum += y[iy] * conj(x[ix]) -// ix += incX -// iy += incY -// } -// return sum -func DotcInc(x, y []complex64, n, incX, incY, ix, iy uintptr) (sum complex64) - -// DotuUnitary is -// for i, v := range x { -// sum += y[i] * v -// } -// return sum -func DotuUnitary(x, y []complex64) (sum complex64) - -// DotuInc is -// for i := 0; i < int(n); i++ { -// sum += y[iy] * x[ix] -// ix += incX -// iy += incY -// } -// return sum -func DotuInc(x, y []complex64, n, incX, incY, ix, iy uintptr) (sum complex64) diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/stubs_noasm.go b/vendor/gonum.org/v1/gonum/internal/asm/c64/stubs_noasm.go deleted file mode 100644 index 411afcb..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/stubs_noasm.go +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !amd64 noasm appengine safe - -package c64 - -// AxpyUnitary is -// for i, v := range x { -// y[i] += alpha * v -// } -func AxpyUnitary(alpha complex64, x, y []complex64) { - for i, v := range x { - y[i] += alpha * v - } -} - -// AxpyUnitaryTo is -// for i, v := range x { -// dst[i] = alpha*v + y[i] -// } -func AxpyUnitaryTo(dst []complex64, alpha complex64, x, y []complex64) { - for i, v := range x { - dst[i] = alpha*v + y[i] - } -} - -// AxpyInc is -// for i := 0; i < int(n); i++ { -// y[iy] += alpha * x[ix] -// ix += incX -// iy += incY -// } -func AxpyInc(alpha complex64, x, y []complex64, n, incX, incY, ix, iy uintptr) { - for i := 0; i < int(n); i++ { - y[iy] += alpha * x[ix] - ix += incX - iy += incY - } -} - -// AxpyIncTo is -// for i := 0; i < int(n); i++ { -// dst[idst] = alpha*x[ix] + y[iy] -// ix += incX -// iy += incY -// idst += incDst -// } -func AxpyIncTo(dst []complex64, incDst, idst uintptr, alpha complex64, x, y []complex64, n, incX, incY, ix, iy uintptr) { - for i := 0; i < int(n); i++ { - dst[idst] = alpha*x[ix] + y[iy] - ix += incX - iy += incY - idst += incDst - } -} - -// DotcUnitary is -// for i, v := range x { -// sum += y[i] * conj(v) -// } -// return sum -func DotcUnitary(x, y []complex64) (sum complex64) { - for i, v := range x { - sum += y[i] * conj(v) - } - return sum -} - -// DotcInc is -// for i := 0; i < int(n); i++ { -// sum += y[iy] * conj(x[ix]) -// ix += incX -// iy += incY -// } -// return sum -func DotcInc(x, y []complex64, n, incX, incY, ix, iy uintptr) (sum complex64) { - for i := 0; i < int(n); i++ { - sum += y[iy] * conj(x[ix]) - ix += incX - iy += incY - } - return sum -} - -// DotuUnitary is -// for i, v := range x { -// sum += y[i] * v -// } -// return sum -func DotuUnitary(x, y []complex64) (sum complex64) { - for i, v := range x { - sum += y[i] * v - } - return sum -} - -// DotuInc is -// for i := 0; i < int(n); i++ { -// sum += y[iy] * x[ix] -// ix += incX -// iy += incY -// } -// return sum -func DotuInc(x, y []complex64, n, incX, incY, ix, iy uintptr) (sum complex64) { - for i := 0; i < int(n); i++ { - sum += y[iy] * x[ix] - ix += incX - iy += incY - } - return sum -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyinc_amd64.s deleted file mode 100644 index ebf360f..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyinc_amd64.s +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// func AxpyInc(alpha float32, x, y []float32, n, incX, incY, ix, iy uintptr) -TEXT ·AxpyInc(SB), NOSPLIT, $0 - MOVQ n+56(FP), CX // CX = n - CMPQ CX, $0 // if n==0 { return } - JLE axpyi_end - MOVQ x_base+8(FP), SI // SI = &x - MOVQ y_base+32(FP), DI // DI = &y - MOVQ ix+80(FP), R8 // R8 = ix - MOVQ iy+88(FP), R9 // R9 = iy - LEAQ (SI)(R8*4), SI // SI = &(x[ix]) - LEAQ (DI)(R9*4), DI // DI = &(y[iy]) - MOVQ DI, DX // DX = DI Read Pointer for y - MOVQ incX+64(FP), R8 // R8 = incX - SHLQ $2, R8 // R8 *= sizeof(float32) - MOVQ incY+72(FP), R9 // R9 = incY - SHLQ $2, R9 // R9 *= sizeof(float32) - MOVSS alpha+0(FP), X0 // X0 = alpha - MOVSS X0, X1 // X1 = X0 // for pipelining - MOVQ CX, BX - ANDQ $3, BX // BX = n % 4 - SHRQ $2, CX // CX = floor( n / 4 ) - JZ axpyi_tail_start // if CX == 0 { goto axpyi_tail_start } - -axpyi_loop: // Loop unrolled 4x do { - MOVSS (SI), X2 // X_i = x[i] - MOVSS (SI)(R8*1), X3 - LEAQ (SI)(R8*2), SI // SI = &(SI[incX*2]) - MOVSS (SI), X4 - MOVSS (SI)(R8*1), X5 - MULSS X1, X2 // X_i *= a - MULSS X0, X3 - MULSS X1, X4 - MULSS X0, X5 - ADDSS (DX), X2 // X_i += y[i] - ADDSS (DX)(R9*1), X3 - LEAQ (DX)(R9*2), DX // DX = &(DX[incY*2]) - ADDSS (DX), X4 - ADDSS (DX)(R9*1), X5 - MOVSS X2, (DI) // y[i] = X_i - MOVSS X3, (DI)(R9*1) - LEAQ (DI)(R9*2), DI // DI = &(DI[incY*2]) - MOVSS X4, (DI) - MOVSS X5, (DI)(R9*1) - LEAQ (SI)(R8*2), SI // SI = &(SI[incX*2]) // Increment addresses - LEAQ (DX)(R9*2), DX // DX = &(DX[incY*2]) - LEAQ (DI)(R9*2), DI // DI = &(DI[incY*2]) - LOOP axpyi_loop // } while --CX > 0 - CMPQ BX, $0 // if BX == 0 { return } - JE axpyi_end - -axpyi_tail_start: // Reset loop registers - MOVQ BX, CX // Loop counter: CX = BX - -axpyi_tail: // do { - MOVSS (SI), X2 // X2 = x[i] - MULSS X1, X2 // X2 *= a - ADDSS (DI), X2 // X2 += y[i] - MOVSS X2, (DI) // y[i] = X2 - ADDQ R8, SI // SI = &(SI[incX]) - ADDQ R9, DI // DI = &(DI[incY]) - LOOP axpyi_tail // } while --CX > 0 - -axpyi_end: - RET - diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyincto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyincto_amd64.s deleted file mode 100644 index 4e9020e..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyincto_amd64.s +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// func AxpyIncTo(dst []float32, incDst, idst uintptr, alpha float32, x, y []float32, n, incX, incY, ix, iy uintptr) -TEXT ·AxpyIncTo(SB), NOSPLIT, $0 - MOVQ n+96(FP), CX // CX = n - CMPQ CX, $0 // if n==0 { return } - JLE axpyi_end - MOVQ dst_base+0(FP), DI // DI = &dst - MOVQ x_base+48(FP), SI // SI = &x - MOVQ y_base+72(FP), DX // DX = &y - MOVQ ix+120(FP), R8 // R8 = ix // Load the first index - MOVQ iy+128(FP), R9 // R9 = iy - MOVQ idst+32(FP), R10 // R10 = idst - LEAQ (SI)(R8*4), SI // SI = &(x[ix]) - LEAQ (DX)(R9*4), DX // DX = &(y[iy]) - LEAQ (DI)(R10*4), DI // DI = &(dst[idst]) - MOVQ incX+104(FP), R8 // R8 = incX - SHLQ $2, R8 // R8 *= sizeof(float32) - MOVQ incY+112(FP), R9 // R9 = incY - SHLQ $2, R9 // R9 *= sizeof(float32) - MOVQ incDst+24(FP), R10 // R10 = incDst - SHLQ $2, R10 // R10 *= sizeof(float32) - MOVSS alpha+40(FP), X0 // X0 = alpha - MOVSS X0, X1 // X1 = X0 // for pipelining - MOVQ CX, BX - ANDQ $3, BX // BX = n % 4 - SHRQ $2, CX // CX = floor( n / 4 ) - JZ axpyi_tail_start // if CX == 0 { goto axpyi_tail_start } - -axpyi_loop: // Loop unrolled 4x do { - MOVSS (SI), X2 // X_i = x[i] - MOVSS (SI)(R8*1), X3 - LEAQ (SI)(R8*2), SI // SI = &(SI[incX*2]) - MOVSS (SI), X4 - MOVSS (SI)(R8*1), X5 - MULSS X1, X2 // X_i *= a - MULSS X0, X3 - MULSS X1, X4 - MULSS X0, X5 - ADDSS (DX), X2 // X_i += y[i] - ADDSS (DX)(R9*1), X3 - LEAQ (DX)(R9*2), DX // DX = &(DX[incY*2]) - ADDSS (DX), X4 - ADDSS (DX)(R9*1), X5 - MOVSS X2, (DI) // dst[i] = X_i - MOVSS X3, (DI)(R10*1) - LEAQ (DI)(R10*2), DI // DI = &(DI[incDst*2]) - MOVSS X4, (DI) - MOVSS X5, (DI)(R10*1) - LEAQ (SI)(R8*2), SI // SI = &(SI[incX*2]) // Increment addresses - LEAQ (DX)(R9*2), DX // DX = &(DX[incY*2]) - LEAQ (DI)(R10*2), DI // DI = &(DI[incDst*2]) - LOOP axpyi_loop // } while --CX > 0 - CMPQ BX, $0 // if BX == 0 { return } - JE axpyi_end - -axpyi_tail_start: // Reset loop registers - MOVQ BX, CX // Loop counter: CX = BX - -axpyi_tail: // do { - MOVSS (SI), X2 // X2 = x[i] - MULSS X1, X2 // X2 *= a - ADDSS (DX), X2 // X2 += y[i] - MOVSS X2, (DI) // dst[i] = X2 - ADDQ R8, SI // SI = &(SI[incX]) - ADDQ R9, DX // DX = &(DX[incY]) - ADDQ R10, DI // DI = &(DI[incY]) - LOOP axpyi_tail // } while --CX > 0 - -axpyi_end: - RET - diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyunitary_amd64.s deleted file mode 100644 index 224b842..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyunitary_amd64.s +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// func AxpyUnitary(alpha float32, x, y []float32) -TEXT ·AxpyUnitary(SB), NOSPLIT, $0 - MOVQ x_base+8(FP), SI // SI = &x - MOVQ y_base+32(FP), DI // DI = &y - MOVQ x_len+16(FP), BX // BX = min( len(x), len(y) ) - CMPQ y_len+40(FP), BX - CMOVQLE y_len+40(FP), BX - CMPQ BX, $0 // if BX == 0 { return } - JE axpy_end - MOVSS alpha+0(FP), X0 - SHUFPS $0, X0, X0 // X0 = { a, a, a, a } - XORQ AX, AX // i = 0 - PXOR X2, X2 // 2 NOP instructions (PXOR) to align - PXOR X3, X3 // loop to cache line - MOVQ DI, CX - ANDQ $0xF, CX // Align on 16-byte boundary for ADDPS - JZ axpy_no_trim // if CX == 0 { goto axpy_no_trim } - - XORQ $0xF, CX // CX = 4 - floor( BX % 16 / 4 ) - INCQ CX - SHRQ $2, CX - -axpy_align: // Trim first value(s) in unaligned buffer do { - MOVSS (SI)(AX*4), X2 // X2 = x[i] - MULSS X0, X2 // X2 *= a - ADDSS (DI)(AX*4), X2 // X2 += y[i] - MOVSS X2, (DI)(AX*4) // y[i] = X2 - INCQ AX // i++ - DECQ BX - JZ axpy_end // if --BX == 0 { return } - LOOP axpy_align // } while --CX > 0 - -axpy_no_trim: - MOVUPS X0, X1 // Copy X0 to X1 for pipelining - MOVQ BX, CX - ANDQ $0xF, BX // BX = len % 16 - SHRQ $4, CX // CX = int( len / 16 ) - JZ axpy_tail4_start // if CX == 0 { return } - -axpy_loop: // Loop unrolled 16x do { - MOVUPS (SI)(AX*4), X2 // X2 = x[i:i+4] - MOVUPS 16(SI)(AX*4), X3 - MOVUPS 32(SI)(AX*4), X4 - MOVUPS 48(SI)(AX*4), X5 - MULPS X0, X2 // X2 *= a - MULPS X1, X3 - MULPS X0, X4 - MULPS X1, X5 - ADDPS (DI)(AX*4), X2 // X2 += y[i:i+4] - ADDPS 16(DI)(AX*4), X3 - ADDPS 32(DI)(AX*4), X4 - ADDPS 48(DI)(AX*4), X5 - MOVUPS X2, (DI)(AX*4) // dst[i:i+4] = X2 - MOVUPS X3, 16(DI)(AX*4) - MOVUPS X4, 32(DI)(AX*4) - MOVUPS X5, 48(DI)(AX*4) - ADDQ $16, AX // i += 16 - LOOP axpy_loop // while (--CX) > 0 - CMPQ BX, $0 // if BX == 0 { return } - JE axpy_end - -axpy_tail4_start: // Reset loop counter for 4-wide tail loop - MOVQ BX, CX // CX = floor( BX / 4 ) - SHRQ $2, CX - JZ axpy_tail_start // if CX == 0 { goto axpy_tail_start } - -axpy_tail4: // Loop unrolled 4x do { - MOVUPS (SI)(AX*4), X2 // X2 = x[i] - MULPS X0, X2 // X2 *= a - ADDPS (DI)(AX*4), X2 // X2 += y[i] - MOVUPS X2, (DI)(AX*4) // y[i] = X2 - ADDQ $4, AX // i += 4 - LOOP axpy_tail4 // } while --CX > 0 - -axpy_tail_start: // Reset loop counter for 1-wide tail loop - MOVQ BX, CX // CX = BX % 4 - ANDQ $3, CX - JZ axpy_end // if CX == 0 { return } - -axpy_tail: - MOVSS (SI)(AX*4), X1 // X1 = x[i] - MULSS X0, X1 // X1 *= a - ADDSS (DI)(AX*4), X1 // X1 += y[i] - MOVSS X1, (DI)(AX*4) // y[i] = X1 - INCQ AX // i++ - LOOP axpy_tail // } while --CX > 0 - -axpy_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyunitaryto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyunitaryto_amd64.s deleted file mode 100644 index e26ccff..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyunitaryto_amd64.s +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// func AxpyUnitaryTo(dst []float32, alpha float32, x, y []float32) -TEXT ·AxpyUnitaryTo(SB), NOSPLIT, $0 - MOVQ dst_base+0(FP), DI // DI = &dst - MOVQ x_base+32(FP), SI // SI = &x - MOVQ y_base+56(FP), DX // DX = &y - MOVQ x_len+40(FP), BX // BX = min( len(x), len(y), len(dst) ) - CMPQ y_len+64(FP), BX - CMOVQLE y_len+64(FP), BX - CMPQ dst_len+8(FP), BX - CMOVQLE dst_len+8(FP), BX - CMPQ BX, $0 // if BX == 0 { return } - JE axpy_end - MOVSS alpha+24(FP), X0 - SHUFPS $0, X0, X0 // X0 = { a, a, a, a, } - XORQ AX, AX // i = 0 - MOVQ DX, CX - ANDQ $0xF, CX // Align on 16-byte boundary for ADDPS - JZ axpy_no_trim // if CX == 0 { goto axpy_no_trim } - - XORQ $0xF, CX // CX = 4 - floor ( B % 16 / 4 ) - INCQ CX - SHRQ $2, CX - -axpy_align: // Trim first value(s) in unaligned buffer do { - MOVSS (SI)(AX*4), X2 // X2 = x[i] - MULSS X0, X2 // X2 *= a - ADDSS (DX)(AX*4), X2 // X2 += y[i] - MOVSS X2, (DI)(AX*4) // y[i] = X2 - INCQ AX // i++ - DECQ BX - JZ axpy_end // if --BX == 0 { return } - LOOP axpy_align // } while --CX > 0 - -axpy_no_trim: - MOVUPS X0, X1 // Copy X0 to X1 for pipelining - MOVQ BX, CX - ANDQ $0xF, BX // BX = len % 16 - SHRQ $4, CX // CX = floor( len / 16 ) - JZ axpy_tail4_start // if CX == 0 { return } - -axpy_loop: // Loop unrolled 16x do { - MOVUPS (SI)(AX*4), X2 // X2 = x[i:i+4] - MOVUPS 16(SI)(AX*4), X3 - MOVUPS 32(SI)(AX*4), X4 - MOVUPS 48(SI)(AX*4), X5 - MULPS X0, X2 // X2 *= a - MULPS X1, X3 - MULPS X0, X4 - MULPS X1, X5 - ADDPS (DX)(AX*4), X2 // X2 += y[i:i+4] - ADDPS 16(DX)(AX*4), X3 - ADDPS 32(DX)(AX*4), X4 - ADDPS 48(DX)(AX*4), X5 - MOVUPS X2, (DI)(AX*4) // dst[i:i+4] = X2 - MOVUPS X3, 16(DI)(AX*4) - MOVUPS X4, 32(DI)(AX*4) - MOVUPS X5, 48(DI)(AX*4) - ADDQ $16, AX // i += 16 - LOOP axpy_loop // while (--CX) > 0 - CMPQ BX, $0 // if BX == 0 { return } - JE axpy_end - -axpy_tail4_start: // Reset loop counter for 4-wide tail loop - MOVQ BX, CX // CX = floor( BX / 4 ) - SHRQ $2, CX - JZ axpy_tail_start // if CX == 0 { goto axpy_tail_start } - -axpy_tail4: // Loop unrolled 4x do { - MOVUPS (SI)(AX*4), X2 // X2 = x[i] - MULPS X0, X2 // X2 *= a - ADDPS (DX)(AX*4), X2 // X2 += y[i] - MOVUPS X2, (DI)(AX*4) // y[i] = X2 - ADDQ $4, AX // i += 4 - LOOP axpy_tail4 // } while --CX > 0 - -axpy_tail_start: // Reset loop counter for 1-wide tail loop - MOVQ BX, CX // CX = BX % 4 - ANDQ $3, CX - JZ axpy_end // if CX == 0 { return } - -axpy_tail: - MOVSS (SI)(AX*4), X1 // X1 = x[i] - MULSS X0, X1 // X1 *= a - ADDSS (DX)(AX*4), X1 // X1 += y[i] - MOVSS X1, (DI)(AX*4) // y[i] = X1 - INCQ AX // i++ - LOOP axpy_tail // } while --CX > 0 - -axpy_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/ddotinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/ddotinc_amd64.s deleted file mode 100644 index de9e312..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/ddotinc_amd64.s +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define X_PTR SI -#define Y_PTR DI -#define LEN CX -#define TAIL BX -#define INC_X R8 -#define INCx3_X R10 -#define INC_Y R9 -#define INCx3_Y R11 -#define SUM X0 -#define P_SUM X1 - -// func DdotInc(x, y []float32, n, incX, incY, ix, iy uintptr) (sum float64) -TEXT ·DdotInc(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_PTR // X_PTR = &x - MOVQ y_base+24(FP), Y_PTR // Y_PTR = &y - MOVQ n+48(FP), LEN // LEN = n - PXOR SUM, SUM // SUM = 0 - CMPQ LEN, $0 - JE dot_end - - MOVQ ix+72(FP), INC_X // INC_X = ix - MOVQ iy+80(FP), INC_Y // INC_Y = iy - LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(x[ix]) - LEAQ (Y_PTR)(INC_Y*4), Y_PTR // Y_PTR = &(y[iy]) - - MOVQ incX+56(FP), INC_X // INC_X = incX * sizeof(float32) - SHLQ $2, INC_X - MOVQ incY+64(FP), INC_Y // INC_Y = incY * sizeof(float32) - SHLQ $2, INC_Y - - MOVQ LEN, TAIL - ANDQ $3, TAIL // TAIL = LEN % 4 - SHRQ $2, LEN // LEN = floor( LEN / 4 ) - JZ dot_tail // if LEN == 0 { goto dot_tail } - - PXOR P_SUM, P_SUM // P_SUM = 0 for pipelining - LEAQ (INC_X)(INC_X*2), INCx3_X // INCx3_X = INC_X * 3 - LEAQ (INC_Y)(INC_Y*2), INCx3_Y // INCx3_Y = INC_Y * 3 - -dot_loop: // Loop unrolled 4x do { - CVTSS2SD (X_PTR), X2 // X_i = x[i:i+1] - CVTSS2SD (X_PTR)(INC_X*1), X3 - CVTSS2SD (X_PTR)(INC_X*2), X4 - CVTSS2SD (X_PTR)(INCx3_X*1), X5 - - CVTSS2SD (Y_PTR), X6 // X_j = y[i:i+1] - CVTSS2SD (Y_PTR)(INC_Y*1), X7 - CVTSS2SD (Y_PTR)(INC_Y*2), X8 - CVTSS2SD (Y_PTR)(INCx3_Y*1), X9 - - MULSD X6, X2 // X_i *= X_j - MULSD X7, X3 - MULSD X8, X4 - MULSD X9, X5 - - ADDSD X2, SUM // SUM += X_i - ADDSD X3, P_SUM - ADDSD X4, SUM - ADDSD X5, P_SUM - - LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(X_PTR[INC_X * 4]) - LEAQ (Y_PTR)(INC_Y*4), Y_PTR // Y_PTR = &(Y_PTR[INC_Y * 4]) - - DECQ LEN - JNZ dot_loop // } while --LEN > 0 - - ADDSD P_SUM, SUM // SUM += P_SUM - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE dot_end - -dot_tail: // do { - CVTSS2SD (X_PTR), X2 // X2 = x[i] - CVTSS2SD (Y_PTR), X3 // X2 *= y[i] - MULSD X3, X2 - ADDSD X2, SUM // SUM += X2 - ADDQ INC_X, X_PTR // X_PTR += INC_X - ADDQ INC_Y, Y_PTR // Y_PTR += INC_Y - DECQ TAIL - JNZ dot_tail // } while --TAIL > 0 - -dot_end: - MOVSD SUM, sum+88(FP) // return SUM - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/ddotunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/ddotunitary_amd64.s deleted file mode 100644 index d39ab78..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/ddotunitary_amd64.s +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define HADDPD_SUM_SUM LONG $0xC07C0F66 // @ HADDPD X0, X0 - -#define X_PTR SI -#define Y_PTR DI -#define LEN CX -#define TAIL BX -#define IDX AX -#define SUM X0 -#define P_SUM X1 - -// func DdotUnitary(x, y []float32) (sum float32) -TEXT ·DdotUnitary(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_PTR // X_PTR = &x - MOVQ y_base+24(FP), Y_PTR // Y_PTR = &y - MOVQ x_len+8(FP), LEN // LEN = min( len(x), len(y) ) - CMPQ y_len+32(FP), LEN - CMOVQLE y_len+32(FP), LEN - PXOR SUM, SUM // psum = 0 - CMPQ LEN, $0 - JE dot_end - - XORQ IDX, IDX - MOVQ Y_PTR, DX - ANDQ $0xF, DX // Align on 16-byte boundary for ADDPS - JZ dot_no_trim // if DX == 0 { goto dot_no_trim } - - SUBQ $16, DX - -dot_align: // Trim first value(s) in unaligned buffer do { - CVTSS2SD (X_PTR)(IDX*4), X2 // X2 = float64(x[i]) - CVTSS2SD (Y_PTR)(IDX*4), X3 // X3 = float64(y[i]) - MULSD X3, X2 - ADDSD X2, SUM // SUM += X2 - INCQ IDX // IDX++ - DECQ LEN - JZ dot_end // if --TAIL == 0 { return } - ADDQ $4, DX - JNZ dot_align // } while --LEN > 0 - -dot_no_trim: - PXOR P_SUM, P_SUM // P_SUM = 0 for pipelining - MOVQ LEN, TAIL - ANDQ $0x7, TAIL // TAIL = LEN % 8 - SHRQ $3, LEN // LEN = floor( LEN / 8 ) - JZ dot_tail_start // if LEN == 0 { goto dot_tail_start } - -dot_loop: // Loop unrolled 8x do { - CVTPS2PD (X_PTR)(IDX*4), X2 // X_i = x[i:i+1] - CVTPS2PD 8(X_PTR)(IDX*4), X3 - CVTPS2PD 16(X_PTR)(IDX*4), X4 - CVTPS2PD 24(X_PTR)(IDX*4), X5 - - CVTPS2PD (Y_PTR)(IDX*4), X6 // X_j = y[i:i+1] - CVTPS2PD 8(Y_PTR)(IDX*4), X7 - CVTPS2PD 16(Y_PTR)(IDX*4), X8 - CVTPS2PD 24(Y_PTR)(IDX*4), X9 - - MULPD X6, X2 // X_i *= X_j - MULPD X7, X3 - MULPD X8, X4 - MULPD X9, X5 - - ADDPD X2, SUM // SUM += X_i - ADDPD X3, P_SUM - ADDPD X4, SUM - ADDPD X5, P_SUM - - ADDQ $8, IDX // IDX += 8 - DECQ LEN - JNZ dot_loop // } while --LEN > 0 - - ADDPD P_SUM, SUM // SUM += P_SUM - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE dot_end - -dot_tail_start: - MOVQ TAIL, LEN - SHRQ $1, LEN - JZ dot_tail_one - -dot_tail_two: - CVTPS2PD (X_PTR)(IDX*4), X2 // X_i = x[i:i+1] - CVTPS2PD (Y_PTR)(IDX*4), X6 // X_j = y[i:i+1] - MULPD X6, X2 // X_i *= X_j - ADDPD X2, SUM // SUM += X_i - ADDQ $2, IDX // IDX += 2 - DECQ LEN - JNZ dot_tail_two // } while --LEN > 0 - - ANDQ $1, TAIL - JZ dot_end - -dot_tail_one: - CVTSS2SD (X_PTR)(IDX*4), X2 // X2 = float64(x[i]) - CVTSS2SD (Y_PTR)(IDX*4), X3 // X3 = float64(y[i]) - MULSD X3, X2 // X2 *= X3 - ADDSD X2, SUM // SUM += X2 - -dot_end: - HADDPD_SUM_SUM // SUM = \sum{ SUM[i] } - MOVSD SUM, sum+48(FP) // return SUM - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/doc.go b/vendor/gonum.org/v1/gonum/internal/asm/f32/doc.go deleted file mode 100644 index 408847a..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright ©2017 The Gonum 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 f32 provides float32 vector primitives. -package f32 // import "gonum.org/v1/gonum/internal/asm/f32" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/dotinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/dotinc_amd64.s deleted file mode 100644 index b6f4021..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/dotinc_amd64.s +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define X_PTR SI -#define Y_PTR DI -#define LEN CX -#define TAIL BX -#define INC_X R8 -#define INCx3_X R10 -#define INC_Y R9 -#define INCx3_Y R11 -#define SUM X0 -#define P_SUM X1 - -// func DotInc(x, y []float32, n, incX, incY, ix, iy uintptr) (sum float32) -TEXT ·DotInc(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_PTR // X_PTR = &x - MOVQ y_base+24(FP), Y_PTR // Y_PTR = &y - PXOR SUM, SUM // SUM = 0 - MOVQ n+48(FP), LEN // LEN = n - CMPQ LEN, $0 - JE dot_end - - MOVQ ix+72(FP), INC_X // INC_X = ix - MOVQ iy+80(FP), INC_Y // INC_Y = iy - LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(x[ix]) - LEAQ (Y_PTR)(INC_Y*4), Y_PTR // Y_PTR = &(y[iy]) - - MOVQ incX+56(FP), INC_X // INC_X := incX * sizeof(float32) - SHLQ $2, INC_X - MOVQ incY+64(FP), INC_Y // INC_Y := incY * sizeof(float32) - SHLQ $2, INC_Y - - MOVQ LEN, TAIL - ANDQ $0x3, TAIL // TAIL = LEN % 4 - SHRQ $2, LEN // LEN = floor( LEN / 4 ) - JZ dot_tail // if LEN == 0 { goto dot_tail } - - PXOR P_SUM, P_SUM // P_SUM = 0 for pipelining - LEAQ (INC_X)(INC_X*2), INCx3_X // INCx3_X = INC_X * 3 - LEAQ (INC_Y)(INC_Y*2), INCx3_Y // INCx3_Y = INC_Y * 3 - -dot_loop: // Loop unrolled 4x do { - MOVSS (X_PTR), X2 // X_i = x[i:i+1] - MOVSS (X_PTR)(INC_X*1), X3 - MOVSS (X_PTR)(INC_X*2), X4 - MOVSS (X_PTR)(INCx3_X*1), X5 - - MULSS (Y_PTR), X2 // X_i *= y[i:i+1] - MULSS (Y_PTR)(INC_Y*1), X3 - MULSS (Y_PTR)(INC_Y*2), X4 - MULSS (Y_PTR)(INCx3_Y*1), X5 - - ADDSS X2, SUM // SUM += X_i - ADDSS X3, P_SUM - ADDSS X4, SUM - ADDSS X5, P_SUM - - LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(X_PTR[INC_X * 4]) - LEAQ (Y_PTR)(INC_Y*4), Y_PTR // Y_PTR = &(Y_PTR[INC_Y * 4]) - - DECQ LEN - JNZ dot_loop // } while --LEN > 0 - - ADDSS P_SUM, SUM // P_SUM += SUM - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE dot_end - -dot_tail: // do { - MOVSS (X_PTR), X2 // X2 = x[i] - MULSS (Y_PTR), X2 // X2 *= y[i] - ADDSS X2, SUM // SUM += X2 - ADDQ INC_X, X_PTR // X_PTR += INC_X - ADDQ INC_Y, Y_PTR // Y_PTR += INC_Y - DECQ TAIL - JNZ dot_tail // } while --TAIL > 0 - -dot_end: - MOVSS SUM, sum+88(FP) // return SUM - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/dotunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/dotunitary_amd64.s deleted file mode 100644 index fd4f7b4..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/dotunitary_amd64.s +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define HADDPS_SUM_SUM LONG $0xC07C0FF2 // @ HADDPS X0, X0 - -#define X_PTR SI -#define Y_PTR DI -#define LEN CX -#define TAIL BX -#define IDX AX -#define SUM X0 -#define P_SUM X1 - -// func DotUnitary(x, y []float32) (sum float32) -TEXT ·DotUnitary(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_PTR // X_PTR = &x - MOVQ y_base+24(FP), Y_PTR // Y_PTR = &y - PXOR SUM, SUM // SUM = 0 - MOVQ x_len+8(FP), LEN // LEN = min( len(x), len(y) ) - CMPQ y_len+32(FP), LEN - CMOVQLE y_len+32(FP), LEN - CMPQ LEN, $0 - JE dot_end - - XORQ IDX, IDX - MOVQ Y_PTR, DX - ANDQ $0xF, DX // Align on 16-byte boundary for MULPS - JZ dot_no_trim // if DX == 0 { goto dot_no_trim } - SUBQ $16, DX - -dot_align: // Trim first value(s) in unaligned buffer do { - MOVSS (X_PTR)(IDX*4), X2 // X2 = x[i] - MULSS (Y_PTR)(IDX*4), X2 // X2 *= y[i] - ADDSS X2, SUM // SUM += X2 - INCQ IDX // IDX++ - DECQ LEN - JZ dot_end // if --TAIL == 0 { return } - ADDQ $4, DX - JNZ dot_align // } while --DX > 0 - -dot_no_trim: - PXOR P_SUM, P_SUM // P_SUM = 0 for pipelining - MOVQ LEN, TAIL - ANDQ $0xF, TAIL // TAIL = LEN % 16 - SHRQ $4, LEN // LEN = floor( LEN / 16 ) - JZ dot_tail4_start // if LEN == 0 { goto dot_tail4_start } - -dot_loop: // Loop unrolled 16x do { - MOVUPS (X_PTR)(IDX*4), X2 // X_i = x[i:i+1] - MOVUPS 16(X_PTR)(IDX*4), X3 - MOVUPS 32(X_PTR)(IDX*4), X4 - MOVUPS 48(X_PTR)(IDX*4), X5 - - MULPS (Y_PTR)(IDX*4), X2 // X_i *= y[i:i+1] - MULPS 16(Y_PTR)(IDX*4), X3 - MULPS 32(Y_PTR)(IDX*4), X4 - MULPS 48(Y_PTR)(IDX*4), X5 - - ADDPS X2, SUM // SUM += X_i - ADDPS X3, P_SUM - ADDPS X4, SUM - ADDPS X5, P_SUM - - ADDQ $16, IDX // IDX += 16 - DECQ LEN - JNZ dot_loop // } while --LEN > 0 - - ADDPS P_SUM, SUM // SUM += P_SUM - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE dot_end - -dot_tail4_start: // Reset loop counter for 4-wide tail loop - MOVQ TAIL, LEN // LEN = floor( TAIL / 4 ) - SHRQ $2, LEN - JZ dot_tail_start // if LEN == 0 { goto dot_tail_start } - -dot_tail4_loop: // Loop unrolled 4x do { - MOVUPS (X_PTR)(IDX*4), X2 // X_i = x[i:i+1] - MULPS (Y_PTR)(IDX*4), X2 // X_i *= y[i:i+1] - ADDPS X2, SUM // SUM += X_i - ADDQ $4, IDX // i += 4 - DECQ LEN - JNZ dot_tail4_loop // } while --LEN > 0 - -dot_tail_start: // Reset loop counter for 1-wide tail loop - ANDQ $3, TAIL // TAIL = TAIL % 4 - JZ dot_end // if TAIL == 0 { return } - -dot_tail: // do { - MOVSS (X_PTR)(IDX*4), X2 // X2 = x[i] - MULSS (Y_PTR)(IDX*4), X2 // X2 *= y[i] - ADDSS X2, SUM // psum += X2 - INCQ IDX // IDX++ - DECQ TAIL - JNZ dot_tail // } while --TAIL > 0 - -dot_end: - HADDPS_SUM_SUM // SUM = \sum{ SUM[i] } - HADDPS_SUM_SUM - MOVSS SUM, sum+48(FP) // return SUM - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_amd64.go b/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_amd64.go deleted file mode 100644 index a27fcaa..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_amd64.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -package f32 - -// Ger performs the rank-one operation -// A += alpha * x * yᵀ -// where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. -func Ger(m, n uintptr, alpha float32, - x []float32, incX uintptr, - y []float32, incY uintptr, - a []float32, lda uintptr) diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_amd64.s deleted file mode 100644 index ecb2641..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_amd64.s +++ /dev/null @@ -1,757 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define SIZE 4 -#define BITSIZE 2 -#define KERNELSIZE 3 - -#define M_DIM m+0(FP) -#define M CX -#define N_DIM n+8(FP) -#define N BX - -#define TMP1 R14 -#define TMP2 R15 - -#define X_PTR SI -#define Y y_base+56(FP) -#define Y_PTR DX -#define A_ROW AX -#define A_PTR DI - -#define INC_X R8 -#define INC3_X R9 - -#define INC_Y R10 -#define INC3_Y R11 - -#define LDA R12 -#define LDA3 R13 - -#define ALPHA X0 -#define ALPHA_SPILL al-16(SP) - -#define LOAD_ALPHA \ - MOVSS alpha+16(FP), ALPHA \ - SHUFPS $0, ALPHA, ALPHA - -#define LOAD_SCALED4 \ - PREFETCHNTA 16*SIZE(X_PTR) \ - MOVDDUP (X_PTR), X1 \ - MOVDDUP 2*SIZE(X_PTR), X3 \ - MOVSHDUP X1, X2 \ - MOVSHDUP X3, X4 \ - MOVSLDUP X1, X1 \ - MOVSLDUP X3, X3 \ - MULPS ALPHA, X1 \ - MULPS ALPHA, X2 \ - MULPS ALPHA, X3 \ - MULPS ALPHA, X4 - -#define LOAD_SCALED2 \ - MOVDDUP (X_PTR), X1 \ - MOVSHDUP X1, X2 \ - MOVSLDUP X1, X1 \ - MULPS ALPHA, X1 \ - MULPS ALPHA, X2 - -#define LOAD_SCALED1 \ - MOVSS (X_PTR), X1 \ - SHUFPS $0, X1, X1 \ - MULPS ALPHA, X1 - -#define LOAD_SCALED4_INC \ - PREFETCHNTA (X_PTR)(INC_X*8) \ - MOVSS (X_PTR), X1 \ - MOVSS (X_PTR)(INC_X*1), X2 \ - MOVSS (X_PTR)(INC_X*2), X3 \ - MOVSS (X_PTR)(INC3_X*1), X4 \ - SHUFPS $0, X1, X1 \ - SHUFPS $0, X2, X2 \ - SHUFPS $0, X3, X3 \ - SHUFPS $0, X4, X4 \ - MULPS ALPHA, X1 \ - MULPS ALPHA, X2 \ - MULPS ALPHA, X3 \ - MULPS ALPHA, X4 - -#define LOAD_SCALED2_INC \ - MOVSS (X_PTR), X1 \ - MOVSS (X_PTR)(INC_X*1), X2 \ - SHUFPS $0, X1, X1 \ - SHUFPS $0, X2, X2 \ - MULPS ALPHA, X1 \ - MULPS ALPHA, X2 - -#define KERNEL_LOAD8 \ - MOVUPS (Y_PTR), X5 \ - MOVUPS 4*SIZE(Y_PTR), X6 - -#define KERNEL_LOAD8_INC \ - MOVSS (Y_PTR), X5 \ - MOVSS (Y_PTR)(INC_Y*1), X6 \ - MOVSS (Y_PTR)(INC_Y*2), X7 \ - MOVSS (Y_PTR)(INC3_Y*1), X8 \ - UNPCKLPS X6, X5 \ - UNPCKLPS X8, X7 \ - MOVLHPS X7, X5 \ - LEAQ (Y_PTR)(INC_Y*4), Y_PTR \ - MOVSS (Y_PTR), X6 \ - MOVSS (Y_PTR)(INC_Y*1), X7 \ - MOVSS (Y_PTR)(INC_Y*2), X8 \ - MOVSS (Y_PTR)(INC3_Y*1), X9 \ - UNPCKLPS X7, X6 \ - UNPCKLPS X9, X8 \ - MOVLHPS X8, X6 - -#define KERNEL_LOAD4 \ - MOVUPS (Y_PTR), X5 - -#define KERNEL_LOAD4_INC \ - MOVSS (Y_PTR), X5 \ - MOVSS (Y_PTR)(INC_Y*1), X6 \ - MOVSS (Y_PTR)(INC_Y*2), X7 \ - MOVSS (Y_PTR)(INC3_Y*1), X8 \ - UNPCKLPS X6, X5 \ - UNPCKLPS X8, X7 \ - MOVLHPS X7, X5 - -#define KERNEL_LOAD2 \ - MOVSD (Y_PTR), X5 - -#define KERNEL_LOAD2_INC \ - MOVSS (Y_PTR), X5 \ - MOVSS (Y_PTR)(INC_Y*1), X6 \ - UNPCKLPS X6, X5 - -#define KERNEL_4x8 \ - MOVUPS X5, X7 \ - MOVUPS X6, X8 \ - MOVUPS X5, X9 \ - MOVUPS X6, X10 \ - MOVUPS X5, X11 \ - MOVUPS X6, X12 \ - MULPS X1, X5 \ - MULPS X1, X6 \ - MULPS X2, X7 \ - MULPS X2, X8 \ - MULPS X3, X9 \ - MULPS X3, X10 \ - MULPS X4, X11 \ - MULPS X4, X12 - -#define STORE_4x8 \ - MOVUPS ALPHA, ALPHA_SPILL \ - MOVUPS (A_PTR), X13 \ - ADDPS X13, X5 \ - MOVUPS 4*SIZE(A_PTR), X14 \ - ADDPS X14, X6 \ - MOVUPS (A_PTR)(LDA*1), X15 \ - ADDPS X15, X7 \ - MOVUPS 4*SIZE(A_PTR)(LDA*1), X0 \ - ADDPS X0, X8 \ - MOVUPS (A_PTR)(LDA*2), X13 \ - ADDPS X13, X9 \ - MOVUPS 4*SIZE(A_PTR)(LDA*2), X14 \ - ADDPS X14, X10 \ - MOVUPS (A_PTR)(LDA3*1), X15 \ - ADDPS X15, X11 \ - MOVUPS 4*SIZE(A_PTR)(LDA3*1), X0 \ - ADDPS X0, X12 \ - MOVUPS X5, (A_PTR) \ - MOVUPS X6, 4*SIZE(A_PTR) \ - MOVUPS X7, (A_PTR)(LDA*1) \ - MOVUPS X8, 4*SIZE(A_PTR)(LDA*1) \ - MOVUPS X9, (A_PTR)(LDA*2) \ - MOVUPS X10, 4*SIZE(A_PTR)(LDA*2) \ - MOVUPS X11, (A_PTR)(LDA3*1) \ - MOVUPS X12, 4*SIZE(A_PTR)(LDA3*1) \ - MOVUPS ALPHA_SPILL, ALPHA \ - ADDQ $8*SIZE, A_PTR - -#define KERNEL_4x4 \ - MOVUPS X5, X6 \ - MOVUPS X5, X7 \ - MOVUPS X5, X8 \ - MULPS X1, X5 \ - MULPS X2, X6 \ - MULPS X3, X7 \ - MULPS X4, X8 - -#define STORE_4x4 \ - MOVUPS (A_PTR), X13 \ - ADDPS X13, X5 \ - MOVUPS (A_PTR)(LDA*1), X14 \ - ADDPS X14, X6 \ - MOVUPS (A_PTR)(LDA*2), X15 \ - ADDPS X15, X7 \ - MOVUPS (A_PTR)(LDA3*1), X13 \ - ADDPS X13, X8 \ - MOVUPS X5, (A_PTR) \ - MOVUPS X6, (A_PTR)(LDA*1) \ - MOVUPS X7, (A_PTR)(LDA*2) \ - MOVUPS X8, (A_PTR)(LDA3*1) \ - ADDQ $4*SIZE, A_PTR - -#define KERNEL_4x2 \ - MOVUPS X5, X6 \ - MOVUPS X5, X7 \ - MOVUPS X5, X8 \ - MULPS X1, X5 \ - MULPS X2, X6 \ - MULPS X3, X7 \ - MULPS X4, X8 - -#define STORE_4x2 \ - MOVSD (A_PTR), X9 \ - ADDPS X9, X5 \ - MOVSD (A_PTR)(LDA*1), X10 \ - ADDPS X10, X6 \ - MOVSD (A_PTR)(LDA*2), X11 \ - ADDPS X11, X7 \ - MOVSD (A_PTR)(LDA3*1), X12 \ - ADDPS X12, X8 \ - MOVSD X5, (A_PTR) \ - MOVSD X6, (A_PTR)(LDA*1) \ - MOVSD X7, (A_PTR)(LDA*2) \ - MOVSD X8, (A_PTR)(LDA3*1) \ - ADDQ $2*SIZE, A_PTR - -#define KERNEL_4x1 \ - MOVSS (Y_PTR), X5 \ - MOVSS X5, X6 \ - MOVSS X5, X7 \ - MOVSS X5, X8 \ - MULSS X1, X5 \ - MULSS X2, X6 \ - MULSS X3, X7 \ - MULSS X4, X8 - -#define STORE_4x1 \ - ADDSS (A_PTR), X5 \ - ADDSS (A_PTR)(LDA*1), X6 \ - ADDSS (A_PTR)(LDA*2), X7 \ - ADDSS (A_PTR)(LDA3*1), X8 \ - MOVSS X5, (A_PTR) \ - MOVSS X6, (A_PTR)(LDA*1) \ - MOVSS X7, (A_PTR)(LDA*2) \ - MOVSS X8, (A_PTR)(LDA3*1) \ - ADDQ $SIZE, A_PTR - -#define KERNEL_2x8 \ - MOVUPS X5, X7 \ - MOVUPS X6, X8 \ - MULPS X1, X5 \ - MULPS X1, X6 \ - MULPS X2, X7 \ - MULPS X2, X8 - -#define STORE_2x8 \ - MOVUPS (A_PTR), X9 \ - ADDPS X9, X5 \ - MOVUPS 4*SIZE(A_PTR), X10 \ - ADDPS X10, X6 \ - MOVUPS (A_PTR)(LDA*1), X11 \ - ADDPS X11, X7 \ - MOVUPS 4*SIZE(A_PTR)(LDA*1), X12 \ - ADDPS X12, X8 \ - MOVUPS X5, (A_PTR) \ - MOVUPS X6, 4*SIZE(A_PTR) \ - MOVUPS X7, (A_PTR)(LDA*1) \ - MOVUPS X8, 4*SIZE(A_PTR)(LDA*1) \ - ADDQ $8*SIZE, A_PTR - -#define KERNEL_2x4 \ - MOVUPS X5, X6 \ - MULPS X1, X5 \ - MULPS X2, X6 - -#define STORE_2x4 \ - MOVUPS (A_PTR), X9 \ - ADDPS X9, X5 \ - MOVUPS (A_PTR)(LDA*1), X11 \ - ADDPS X11, X6 \ - MOVUPS X5, (A_PTR) \ - MOVUPS X6, (A_PTR)(LDA*1) \ - ADDQ $4*SIZE, A_PTR - -#define KERNEL_2x2 \ - MOVSD X5, X6 \ - MULPS X1, X5 \ - MULPS X2, X6 - -#define STORE_2x2 \ - MOVSD (A_PTR), X7 \ - ADDPS X7, X5 \ - MOVSD (A_PTR)(LDA*1), X8 \ - ADDPS X8, X6 \ - MOVSD X5, (A_PTR) \ - MOVSD X6, (A_PTR)(LDA*1) \ - ADDQ $2*SIZE, A_PTR - -#define KERNEL_2x1 \ - MOVSS (Y_PTR), X5 \ - MOVSS X5, X6 \ - MULSS X1, X5 \ - MULSS X2, X6 - -#define STORE_2x1 \ - ADDSS (A_PTR), X5 \ - ADDSS (A_PTR)(LDA*1), X6 \ - MOVSS X5, (A_PTR) \ - MOVSS X6, (A_PTR)(LDA*1) \ - ADDQ $SIZE, A_PTR - -#define KERNEL_1x8 \ - MULPS X1, X5 \ - MULPS X1, X6 - -#define STORE_1x8 \ - MOVUPS (A_PTR), X7 \ - ADDPS X7, X5 \ - MOVUPS 4*SIZE(A_PTR), X8 \ - ADDPS X8, X6 \ - MOVUPS X5, (A_PTR) \ - MOVUPS X6, 4*SIZE(A_PTR) \ - ADDQ $8*SIZE, A_PTR - -#define KERNEL_1x4 \ - MULPS X1, X5 \ - MULPS X1, X6 - -#define STORE_1x4 \ - MOVUPS (A_PTR), X7 \ - ADDPS X7, X5 \ - MOVUPS X5, (A_PTR) \ - ADDQ $4*SIZE, A_PTR - -#define KERNEL_1x2 \ - MULPS X1, X5 - -#define STORE_1x2 \ - MOVSD (A_PTR), X6 \ - ADDPS X6, X5 \ - MOVSD X5, (A_PTR) \ - ADDQ $2*SIZE, A_PTR - -#define KERNEL_1x1 \ - MOVSS (Y_PTR), X5 \ - MULSS X1, X5 - -#define STORE_1x1 \ - ADDSS (A_PTR), X5 \ - MOVSS X5, (A_PTR) \ - ADDQ $SIZE, A_PTR - -// func Ger(m, n uintptr, alpha float32, -// x []float32, incX uintptr, -// y []float32, incY uintptr, -// a []float32, lda uintptr) -TEXT ·Ger(SB), 0, $16-120 - MOVQ M_DIM, M - MOVQ N_DIM, N - CMPQ M, $0 - JE end - CMPQ N, $0 - JE end - - LOAD_ALPHA - - MOVQ x_base+24(FP), X_PTR - MOVQ y_base+56(FP), Y_PTR - MOVQ a_base+88(FP), A_ROW - MOVQ A_ROW, A_PTR - MOVQ lda+112(FP), LDA // LDA = LDA * sizeof(float32) - SHLQ $BITSIZE, LDA - LEAQ (LDA)(LDA*2), LDA3 // LDA3 = LDA * 3 - - CMPQ incY+80(FP), $1 // Check for dense vector Y (fast-path) - JNE inc - CMPQ incX+48(FP), $1 // Check for dense vector X (fast-path) - JNE inc - - SHRQ $2, M - JZ r2 - -r4: - - // LOAD 4 - LOAD_SCALED4 - - MOVQ N_DIM, N - SHRQ $KERNELSIZE, N - JZ r4c4 - -r4c8: - // 4x8 KERNEL - KERNEL_LOAD8 - KERNEL_4x8 - STORE_4x8 - - ADDQ $8*SIZE, Y_PTR - - DECQ N - JNZ r4c8 - -r4c4: - TESTQ $4, N_DIM - JZ r4c2 - - // 4x4 KERNEL - KERNEL_LOAD4 - KERNEL_4x4 - STORE_4x4 - - ADDQ $4*SIZE, Y_PTR - -r4c2: - TESTQ $2, N_DIM - JZ r4c1 - - // 4x2 KERNEL - KERNEL_LOAD2 - KERNEL_4x2 - STORE_4x2 - - ADDQ $2*SIZE, Y_PTR - -r4c1: - TESTQ $1, N_DIM - JZ r4end - - // 4x1 KERNEL - KERNEL_4x1 - STORE_4x1 - - ADDQ $SIZE, Y_PTR - -r4end: - ADDQ $4*SIZE, X_PTR - MOVQ Y, Y_PTR - LEAQ (A_ROW)(LDA*4), A_ROW - MOVQ A_ROW, A_PTR - - DECQ M - JNZ r4 - -r2: - TESTQ $2, M_DIM - JZ r1 - - // LOAD 2 - LOAD_SCALED2 - - MOVQ N_DIM, N - SHRQ $KERNELSIZE, N - JZ r2c4 - -r2c8: - // 2x8 KERNEL - KERNEL_LOAD8 - KERNEL_2x8 - STORE_2x8 - - ADDQ $8*SIZE, Y_PTR - - DECQ N - JNZ r2c8 - -r2c4: - TESTQ $4, N_DIM - JZ r2c2 - - // 2x4 KERNEL - KERNEL_LOAD4 - KERNEL_2x4 - STORE_2x4 - - ADDQ $4*SIZE, Y_PTR - -r2c2: - TESTQ $2, N_DIM - JZ r2c1 - - // 2x2 KERNEL - KERNEL_LOAD2 - KERNEL_2x2 - STORE_2x2 - - ADDQ $2*SIZE, Y_PTR - -r2c1: - TESTQ $1, N_DIM - JZ r2end - - // 2x1 KERNEL - KERNEL_2x1 - STORE_2x1 - - ADDQ $SIZE, Y_PTR - -r2end: - ADDQ $2*SIZE, X_PTR - MOVQ Y, Y_PTR - LEAQ (A_ROW)(LDA*2), A_ROW - MOVQ A_ROW, A_PTR - -r1: - TESTQ $1, M_DIM - JZ end - - // LOAD 1 - LOAD_SCALED1 - - MOVQ N_DIM, N - SHRQ $KERNELSIZE, N - JZ r1c4 - -r1c8: - // 1x8 KERNEL - KERNEL_LOAD8 - KERNEL_1x8 - STORE_1x8 - - ADDQ $8*SIZE, Y_PTR - - DECQ N - JNZ r1c8 - -r1c4: - TESTQ $4, N_DIM - JZ r1c2 - - // 1x4 KERNEL - KERNEL_LOAD4 - KERNEL_1x4 - STORE_1x4 - - ADDQ $4*SIZE, Y_PTR - -r1c2: - TESTQ $2, N_DIM - JZ r1c1 - - // 1x2 KERNEL - KERNEL_LOAD2 - KERNEL_1x2 - STORE_1x2 - - ADDQ $2*SIZE, Y_PTR - -r1c1: - TESTQ $1, N_DIM - JZ end - - // 1x1 KERNEL - KERNEL_1x1 - STORE_1x1 - -end: - RET - -inc: // Algorithm for incY != 0 ( split loads in kernel ) - - MOVQ incX+48(FP), INC_X // INC_X = incX * sizeof(float32) - SHLQ $BITSIZE, INC_X - MOVQ incY+80(FP), INC_Y // INC_Y = incY * sizeof(float32) - SHLQ $BITSIZE, INC_Y - LEAQ (INC_X)(INC_X*2), INC3_X // INC3_X = INC_X * 3 - LEAQ (INC_Y)(INC_Y*2), INC3_Y // INC3_Y = INC_Y * 3 - - XORQ TMP2, TMP2 - MOVQ M, TMP1 - SUBQ $1, TMP1 - IMULQ INC_X, TMP1 - NEGQ TMP1 - CMPQ INC_X, $0 - CMOVQLT TMP1, TMP2 - LEAQ (X_PTR)(TMP2*SIZE), X_PTR - - XORQ TMP2, TMP2 - MOVQ N, TMP1 - SUBQ $1, TMP1 - IMULQ INC_Y, TMP1 - NEGQ TMP1 - CMPQ INC_Y, $0 - CMOVQLT TMP1, TMP2 - LEAQ (Y_PTR)(TMP2*SIZE), Y_PTR - - SHRQ $2, M - JZ inc_r2 - -inc_r4: - // LOAD 4 - LOAD_SCALED4_INC - - MOVQ N_DIM, N - SHRQ $KERNELSIZE, N - JZ inc_r4c4 - -inc_r4c8: - // 4x4 KERNEL - KERNEL_LOAD8_INC - KERNEL_4x8 - STORE_4x8 - - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - DECQ N - JNZ inc_r4c8 - -inc_r4c4: - TESTQ $4, N_DIM - JZ inc_r4c2 - - // 4x4 KERNEL - KERNEL_LOAD4_INC - KERNEL_4x4 - STORE_4x4 - - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - -inc_r4c2: - TESTQ $2, N_DIM - JZ inc_r4c1 - - // 4x2 KERNEL - KERNEL_LOAD2_INC - KERNEL_4x2 - STORE_4x2 - - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -inc_r4c1: - TESTQ $1, N_DIM - JZ inc_r4end - - // 4x1 KERNEL - KERNEL_4x1 - STORE_4x1 - - ADDQ INC_Y, Y_PTR - -inc_r4end: - LEAQ (X_PTR)(INC_X*4), X_PTR - MOVQ Y, Y_PTR - LEAQ (A_ROW)(LDA*4), A_ROW - MOVQ A_ROW, A_PTR - - DECQ M - JNZ inc_r4 - -inc_r2: - TESTQ $2, M_DIM - JZ inc_r1 - - // LOAD 2 - LOAD_SCALED2_INC - - MOVQ N_DIM, N - SHRQ $KERNELSIZE, N - JZ inc_r2c4 - -inc_r2c8: - // 2x8 KERNEL - KERNEL_LOAD8_INC - KERNEL_2x8 - STORE_2x8 - - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - DECQ N - JNZ inc_r2c8 - -inc_r2c4: - TESTQ $4, N_DIM - JZ inc_r2c2 - - // 2x4 KERNEL - KERNEL_LOAD4_INC - KERNEL_2x4 - STORE_2x4 - - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - -inc_r2c2: - TESTQ $2, N_DIM - JZ inc_r2c1 - - // 2x2 KERNEL - KERNEL_LOAD2_INC - KERNEL_2x2 - STORE_2x2 - - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -inc_r2c1: - TESTQ $1, N_DIM - JZ inc_r2end - - // 2x1 KERNEL - KERNEL_2x1 - STORE_2x1 - - ADDQ INC_Y, Y_PTR - -inc_r2end: - LEAQ (X_PTR)(INC_X*2), X_PTR - MOVQ Y, Y_PTR - LEAQ (A_ROW)(LDA*2), A_ROW - MOVQ A_ROW, A_PTR - -inc_r1: - TESTQ $1, M_DIM - JZ end - - // LOAD 1 - LOAD_SCALED1 - - MOVQ N_DIM, N - SHRQ $KERNELSIZE, N - JZ inc_r1c4 - -inc_r1c8: - // 1x8 KERNEL - KERNEL_LOAD8_INC - KERNEL_1x8 - STORE_1x8 - - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - DECQ N - JNZ inc_r1c8 - -inc_r1c4: - TESTQ $4, N_DIM - JZ inc_r1c2 - - // 1x4 KERNEL - KERNEL_LOAD4_INC - KERNEL_1x4 - STORE_1x4 - - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - -inc_r1c2: - TESTQ $2, N_DIM - JZ inc_r1c1 - - // 1x2 KERNEL - KERNEL_LOAD2_INC - KERNEL_1x2 - STORE_1x2 - - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -inc_r1c1: - TESTQ $1, N_DIM - JZ inc_end - - // 1x1 KERNEL - KERNEL_1x1 - STORE_1x1 - -inc_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_noasm.go b/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_noasm.go deleted file mode 100644 index 562302d..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_noasm.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !amd64 noasm appengine safe - -package f32 - -// Ger performs the rank-one operation -// A += alpha * x * yᵀ -// where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. -func Ger(m, n uintptr, alpha float32, x []float32, incX uintptr, y []float32, incY uintptr, a []float32, lda uintptr) { - - if incX == 1 && incY == 1 { - x = x[:m] - y = y[:n] - for i, xv := range x { - AxpyUnitary(alpha*xv, y, a[uintptr(i)*lda:uintptr(i)*lda+n]) - } - return - } - - var ky, kx uintptr - if int(incY) < 0 { - ky = uintptr(-int(n-1) * int(incY)) - } - if int(incX) < 0 { - kx = uintptr(-int(m-1) * int(incX)) - } - - ix := kx - for i := 0; i < int(m); i++ { - AxpyInc(alpha*x[ix], y, a[uintptr(i)*lda:uintptr(i)*lda+n], uintptr(n), uintptr(incY), 1, uintptr(ky), 0) - ix += incX - } -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/l2norm.go b/vendor/gonum.org/v1/gonum/internal/asm/f32/l2norm.go deleted file mode 100644 index 0f2a774..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/l2norm.go +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright ©2019 The Gonum 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 f32 - -import "gonum.org/v1/gonum/internal/math32" - -// L2NormUnitary is the level 2 norm of x. -func L2NormUnitary(x []float32) (sum float32) { - var scale float32 - var sumSquares float32 = 1 - for _, v := range x { - if v == 0 { - continue - } - absxi := math32.Abs(v) - if math32.IsNaN(absxi) { - return math32.NaN() - } - if scale < absxi { - s := scale / absxi - sumSquares = 1 + sumSquares*s*s - scale = absxi - } else { - s := absxi / scale - sumSquares += s * s - } - } - if math32.IsInf(scale, 1) { - return math32.Inf(1) - } - return scale * math32.Sqrt(sumSquares) -} - -// L2NormInc is the level 2 norm of x. -func L2NormInc(x []float32, n, incX uintptr) (sum float32) { - var scale float32 - var sumSquares float32 = 1 - for ix := uintptr(0); ix < n*incX; ix += incX { - val := x[ix] - if val == 0 { - continue - } - absxi := math32.Abs(val) - if math32.IsNaN(absxi) { - return math32.NaN() - } - if scale < absxi { - s := scale / absxi - sumSquares = 1 + sumSquares*s*s - scale = absxi - } else { - s := absxi / scale - sumSquares += s * s - } - } - if math32.IsInf(scale, 1) { - return math32.Inf(1) - } - return scale * math32.Sqrt(sumSquares) -} - -// L2DistanceUnitary is the L2 norm of x-y. -func L2DistanceUnitary(x, y []float32) (sum float32) { - var scale float32 - var sumSquares float32 = 1 - for i, v := range x { - v -= y[i] - if v == 0 { - continue - } - absxi := math32.Abs(v) - if math32.IsNaN(absxi) { - return math32.NaN() - } - if scale < absxi { - s := scale / absxi - sumSquares = 1 + sumSquares*s*s - scale = absxi - } else { - s := absxi / scale - sumSquares += s * s - } - } - if math32.IsInf(scale, 1) { - return math32.Inf(1) - } - return scale * math32.Sqrt(sumSquares) -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/scal.go b/vendor/gonum.org/v1/gonum/internal/asm/f32/scal.go deleted file mode 100644 index d0867a4..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/scal.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright ©2016 The Gonum 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 f32 - -// ScalUnitary is -// for i := range x { -// x[i] *= alpha -// } -func ScalUnitary(alpha float32, x []float32) { - for i := range x { - x[i] *= alpha - } -} - -// ScalUnitaryTo is -// for i, v := range x { -// dst[i] = alpha * v -// } -func ScalUnitaryTo(dst []float32, alpha float32, x []float32) { - for i, v := range x { - dst[i] = alpha * v - } -} - -// ScalInc is -// var ix uintptr -// for i := 0; i < int(n); i++ { -// x[ix] *= alpha -// ix += incX -// } -func ScalInc(alpha float32, x []float32, n, incX uintptr) { - var ix uintptr - for i := 0; i < int(n); i++ { - x[ix] *= alpha - ix += incX - } -} - -// ScalIncTo is -// var idst, ix uintptr -// for i := 0; i < int(n); i++ { -// dst[idst] = alpha * x[ix] -// ix += incX -// idst += incDst -// } -func ScalIncTo(dst []float32, incDst uintptr, alpha float32, x []float32, n, incX uintptr) { - var idst, ix uintptr - for i := 0; i < int(n); i++ { - dst[idst] = alpha * x[ix] - ix += incX - idst += incDst - } -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/stubs_amd64.go b/vendor/gonum.org/v1/gonum/internal/asm/f32/stubs_amd64.go deleted file mode 100644 index fcbce09..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/stubs_amd64.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -package f32 - -// AxpyUnitary is -// for i, v := range x { -// y[i] += alpha * v -// } -func AxpyUnitary(alpha float32, x, y []float32) - -// AxpyUnitaryTo is -// for i, v := range x { -// dst[i] = alpha*v + y[i] -// } -func AxpyUnitaryTo(dst []float32, alpha float32, x, y []float32) - -// AxpyInc is -// for i := 0; i < int(n); i++ { -// y[iy] += alpha * x[ix] -// ix += incX -// iy += incY -// } -func AxpyInc(alpha float32, x, y []float32, n, incX, incY, ix, iy uintptr) - -// AxpyIncTo is -// for i := 0; i < int(n); i++ { -// dst[idst] = alpha*x[ix] + y[iy] -// ix += incX -// iy += incY -// idst += incDst -// } -func AxpyIncTo(dst []float32, incDst, idst uintptr, alpha float32, x, y []float32, n, incX, incY, ix, iy uintptr) - -// DdotUnitary is -// for i, v := range x { -// sum += float64(y[i]) * float64(v) -// } -// return -func DdotUnitary(x, y []float32) (sum float64) - -// DdotInc is -// for i := 0; i < int(n); i++ { -// sum += float64(y[iy]) * float64(x[ix]) -// ix += incX -// iy += incY -// } -// return -func DdotInc(x, y []float32, n, incX, incY, ix, iy uintptr) (sum float64) - -// DotUnitary is -// for i, v := range x { -// sum += y[i] * v -// } -// return sum -func DotUnitary(x, y []float32) (sum float32) - -// DotInc is -// for i := 0; i < int(n); i++ { -// sum += y[iy] * x[ix] -// ix += incX -// iy += incY -// } -// return sum -func DotInc(x, y []float32, n, incX, incY, ix, iy uintptr) (sum float32) diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/stubs_noasm.go b/vendor/gonum.org/v1/gonum/internal/asm/f32/stubs_noasm.go deleted file mode 100644 index 3b5b097..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/stubs_noasm.go +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !amd64 noasm appengine safe - -package f32 - -// AxpyUnitary is -// for i, v := range x { -// y[i] += alpha * v -// } -func AxpyUnitary(alpha float32, x, y []float32) { - for i, v := range x { - y[i] += alpha * v - } -} - -// AxpyUnitaryTo is -// for i, v := range x { -// dst[i] = alpha*v + y[i] -// } -func AxpyUnitaryTo(dst []float32, alpha float32, x, y []float32) { - for i, v := range x { - dst[i] = alpha*v + y[i] - } -} - -// AxpyInc is -// for i := 0; i < int(n); i++ { -// y[iy] += alpha * x[ix] -// ix += incX -// iy += incY -// } -func AxpyInc(alpha float32, x, y []float32, n, incX, incY, ix, iy uintptr) { - for i := 0; i < int(n); i++ { - y[iy] += alpha * x[ix] - ix += incX - iy += incY - } -} - -// AxpyIncTo is -// for i := 0; i < int(n); i++ { -// dst[idst] = alpha*x[ix] + y[iy] -// ix += incX -// iy += incY -// idst += incDst -// } -func AxpyIncTo(dst []float32, incDst, idst uintptr, alpha float32, x, y []float32, n, incX, incY, ix, iy uintptr) { - for i := 0; i < int(n); i++ { - dst[idst] = alpha*x[ix] + y[iy] - ix += incX - iy += incY - idst += incDst - } -} - -// DotUnitary is -// for i, v := range x { -// sum += y[i] * v -// } -// return sum -func DotUnitary(x, y []float32) (sum float32) { - for i, v := range x { - sum += y[i] * v - } - return sum -} - -// DotInc is -// for i := 0; i < int(n); i++ { -// sum += y[iy] * x[ix] -// ix += incX -// iy += incY -// } -// return sum -func DotInc(x, y []float32, n, incX, incY, ix, iy uintptr) (sum float32) { - for i := 0; i < int(n); i++ { - sum += y[iy] * x[ix] - ix += incX - iy += incY - } - return sum -} - -// DdotUnitary is -// for i, v := range x { -// sum += float64(y[i]) * float64(v) -// } -// return -func DdotUnitary(x, y []float32) (sum float64) { - for i, v := range x { - sum += float64(y[i]) * float64(v) - } - return -} - -// DdotInc is -// for i := 0; i < int(n); i++ { -// sum += float64(y[iy]) * float64(x[ix]) -// ix += incX -// iy += incY -// } -// return -func DdotInc(x, y []float32, n, incX, incY, ix, iy uintptr) (sum float64) { - for i := 0; i < int(n); i++ { - sum += float64(y[iy]) * float64(x[ix]) - ix += incX - iy += incY - } - return -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/abssum_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/abssum_amd64.s deleted file mode 100644 index d9d61bb..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/abssum_amd64.s +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// func L1Norm(x []float64) float64 -TEXT ·L1Norm(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), SI // SI = &x - MOVQ x_len+8(FP), CX // CX = len(x) - XORQ AX, AX // i = 0 - PXOR X0, X0 // p_sum_i = 0 - PXOR X1, X1 - PXOR X2, X2 - PXOR X3, X3 - PXOR X4, X4 - PXOR X5, X5 - PXOR X6, X6 - PXOR X7, X7 - CMPQ CX, $0 // if CX == 0 { return 0 } - JE absum_end - MOVQ CX, BX - ANDQ $7, BX // BX = len(x) % 8 - SHRQ $3, CX // CX = floor( len(x) / 8 ) - JZ absum_tail_start // if CX == 0 { goto absum_tail_start } - -absum_loop: // do { - // p_sum += max( p_sum + x[i], p_sum - x[i] ) - MOVUPS (SI)(AX*8), X8 // X_i = x[i:i+1] - MOVUPS 16(SI)(AX*8), X9 - MOVUPS 32(SI)(AX*8), X10 - MOVUPS 48(SI)(AX*8), X11 - ADDPD X8, X0 // p_sum_i += X_i ( positive values ) - ADDPD X9, X2 - ADDPD X10, X4 - ADDPD X11, X6 - SUBPD X8, X1 // p_sum_(i+1) -= X_i ( negative values ) - SUBPD X9, X3 - SUBPD X10, X5 - SUBPD X11, X7 - MAXPD X1, X0 // p_sum_i = max( p_sum_i, p_sum_(i+1) ) - MAXPD X3, X2 - MAXPD X5, X4 - MAXPD X7, X6 - MOVAPS X0, X1 // p_sum_(i+1) = p_sum_i - MOVAPS X2, X3 - MOVAPS X4, X5 - MOVAPS X6, X7 - ADDQ $8, AX // i += 8 - LOOP absum_loop // } while --CX > 0 - - // p_sum_0 = \sum_{i=1}^{3}( p_sum_(i*2) ) - ADDPD X3, X0 - ADDPD X5, X7 - ADDPD X7, X0 - - // p_sum_0[0] = p_sum_0[0] + p_sum_0[1] - MOVAPS X0, X1 - SHUFPD $0x3, X0, X0 // lower( p_sum_0 ) = upper( p_sum_0 ) - ADDSD X1, X0 - CMPQ BX, $0 - JE absum_end // if BX == 0 { goto absum_end } - -absum_tail_start: // Reset loop registers - MOVQ BX, CX // Loop counter: CX = BX - XORPS X8, X8 // X_8 = 0 - -absum_tail: // do { - // p_sum += max( p_sum + x[i], p_sum - x[i] ) - MOVSD (SI)(AX*8), X8 // X_8 = x[i] - MOVSD X0, X1 // p_sum_1 = p_sum_0 - ADDSD X8, X0 // p_sum_0 += X_8 - SUBSD X8, X1 // p_sum_1 -= X_8 - MAXSD X1, X0 // p_sum_0 = max( p_sum_0, p_sum_1 ) - INCQ AX // i++ - LOOP absum_tail // } while --CX > 0 - -absum_end: // return p_sum_0 - MOVSD X0, sum+24(FP) - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/abssuminc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/abssuminc_amd64.s deleted file mode 100644 index cac19aa..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/abssuminc_amd64.s +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// func L1NormInc(x []float64, n, incX int) (sum float64) -TEXT ·L1NormInc(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), SI // SI = &x - MOVQ n+24(FP), CX // CX = n - MOVQ incX+32(FP), AX // AX = increment * sizeof( float64 ) - SHLQ $3, AX - MOVQ AX, DX // DX = AX * 3 - IMULQ $3, DX - PXOR X0, X0 // p_sum_i = 0 - PXOR X1, X1 - PXOR X2, X2 - PXOR X3, X3 - PXOR X4, X4 - PXOR X5, X5 - PXOR X6, X6 - PXOR X7, X7 - CMPQ CX, $0 // if CX == 0 { return 0 } - JE absum_end - MOVQ CX, BX - ANDQ $7, BX // BX = n % 8 - SHRQ $3, CX // CX = floor( n / 8 ) - JZ absum_tail_start // if CX == 0 { goto absum_tail_start } - -absum_loop: // do { - // p_sum = max( p_sum + x[i], p_sum - x[i] ) - MOVSD (SI), X8 // X_i[0] = x[i] - MOVSD (SI)(AX*1), X9 - MOVSD (SI)(AX*2), X10 - MOVSD (SI)(DX*1), X11 - LEAQ (SI)(AX*4), SI // SI = SI + 4 - MOVHPD (SI), X8 // X_i[1] = x[i+4] - MOVHPD (SI)(AX*1), X9 - MOVHPD (SI)(AX*2), X10 - MOVHPD (SI)(DX*1), X11 - ADDPD X8, X0 // p_sum_i += X_i ( positive values ) - ADDPD X9, X2 - ADDPD X10, X4 - ADDPD X11, X6 - SUBPD X8, X1 // p_sum_(i+1) -= X_i ( negative values ) - SUBPD X9, X3 - SUBPD X10, X5 - SUBPD X11, X7 - MAXPD X1, X0 // p_sum_i = max( p_sum_i, p_sum_(i+1) ) - MAXPD X3, X2 - MAXPD X5, X4 - MAXPD X7, X6 - MOVAPS X0, X1 // p_sum_(i+1) = p_sum_i - MOVAPS X2, X3 - MOVAPS X4, X5 - MOVAPS X6, X7 - LEAQ (SI)(AX*4), SI // SI = SI + 4 - LOOP absum_loop // } while --CX > 0 - - // p_sum_0 = \sum_{i=1}^{3}( p_sum_(i*2) ) - ADDPD X3, X0 - ADDPD X5, X7 - ADDPD X7, X0 - - // p_sum_0[0] = p_sum_0[0] + p_sum_0[1] - MOVAPS X0, X1 - SHUFPD $0x3, X0, X0 // lower( p_sum_0 ) = upper( p_sum_0 ) - ADDSD X1, X0 - CMPQ BX, $0 - JE absum_end // if BX == 0 { goto absum_end } - -absum_tail_start: // Reset loop registers - MOVQ BX, CX // Loop counter: CX = BX - XORPS X8, X8 // X_8 = 0 - -absum_tail: // do { - // p_sum += max( p_sum + x[i], p_sum - x[i] ) - MOVSD (SI), X8 // X_8 = x[i] - MOVSD X0, X1 // p_sum_1 = p_sum_0 - ADDSD X8, X0 // p_sum_0 += X_8 - SUBSD X8, X1 // p_sum_1 -= X_8 - MAXSD X1, X0 // p_sum_0 = max( p_sum_0, p_sum_1 ) - ADDQ AX, SI // i++ - LOOP absum_tail // } while --CX > 0 - -absum_end: // return p_sum_0 - MOVSD X0, sum+40(FP) - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/add_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/add_amd64.s deleted file mode 100644 index bc0ea6a..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/add_amd64.s +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// func Add(dst, s []float64) -TEXT ·Add(SB), NOSPLIT, $0 - MOVQ dst_base+0(FP), DI // DI = &dst - MOVQ dst_len+8(FP), CX // CX = len(dst) - MOVQ s_base+24(FP), SI // SI = &s - CMPQ s_len+32(FP), CX // CX = max( CX, len(s) ) - CMOVQLE s_len+32(FP), CX - CMPQ CX, $0 // if CX == 0 { return } - JE add_end - XORQ AX, AX - MOVQ DI, BX - ANDQ $0x0F, BX // BX = &dst & 15 - JZ add_no_trim // if BX == 0 { goto add_no_trim } - - // Align on 16-bit boundary - MOVSD (SI)(AX*8), X0 // X0 = s[i] - ADDSD (DI)(AX*8), X0 // X0 += dst[i] - MOVSD X0, (DI)(AX*8) // dst[i] = X0 - INCQ AX // i++ - DECQ CX // --CX - JE add_end // if CX == 0 { return } - -add_no_trim: - MOVQ CX, BX - ANDQ $7, BX // BX = len(dst) % 8 - SHRQ $3, CX // CX = floor( len(dst) / 8 ) - JZ add_tail_start // if CX == 0 { goto add_tail_start } - -add_loop: // Loop unrolled 8x do { - MOVUPS (SI)(AX*8), X0 // X_i = s[i:i+1] - MOVUPS 16(SI)(AX*8), X1 - MOVUPS 32(SI)(AX*8), X2 - MOVUPS 48(SI)(AX*8), X3 - ADDPD (DI)(AX*8), X0 // X_i += dst[i:i+1] - ADDPD 16(DI)(AX*8), X1 - ADDPD 32(DI)(AX*8), X2 - ADDPD 48(DI)(AX*8), X3 - MOVUPS X0, (DI)(AX*8) // dst[i:i+1] = X_i - MOVUPS X1, 16(DI)(AX*8) - MOVUPS X2, 32(DI)(AX*8) - MOVUPS X3, 48(DI)(AX*8) - ADDQ $8, AX // i += 8 - LOOP add_loop // } while --CX > 0 - CMPQ BX, $0 // if BX == 0 { return } - JE add_end - -add_tail_start: // Reset loop registers - MOVQ BX, CX // Loop counter: CX = BX - -add_tail: // do { - MOVSD (SI)(AX*8), X0 // X0 = s[i] - ADDSD (DI)(AX*8), X0 // X0 += dst[i] - MOVSD X0, (DI)(AX*8) // dst[i] = X0 - INCQ AX // ++i - LOOP add_tail // } while --CX > 0 - -add_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/addconst_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/addconst_amd64.s deleted file mode 100644 index 7cc68c7..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/addconst_amd64.s +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// func Addconst(alpha float64, x []float64) -TEXT ·AddConst(SB), NOSPLIT, $0 - MOVQ x_base+8(FP), SI // SI = &x - MOVQ x_len+16(FP), CX // CX = len(x) - CMPQ CX, $0 // if len(x) == 0 { return } - JE ac_end - MOVSD alpha+0(FP), X4 // X4 = { a, a } - SHUFPD $0, X4, X4 - MOVUPS X4, X5 // X5 = X4 - XORQ AX, AX // i = 0 - MOVQ CX, BX - ANDQ $7, BX // BX = len(x) % 8 - SHRQ $3, CX // CX = floor( len(x) / 8 ) - JZ ac_tail_start // if CX == 0 { goto ac_tail_start } - -ac_loop: // Loop unrolled 8x do { - MOVUPS (SI)(AX*8), X0 // X_i = s[i:i+1] - MOVUPS 16(SI)(AX*8), X1 - MOVUPS 32(SI)(AX*8), X2 - MOVUPS 48(SI)(AX*8), X3 - ADDPD X4, X0 // X_i += a - ADDPD X5, X1 - ADDPD X4, X2 - ADDPD X5, X3 - MOVUPS X0, (SI)(AX*8) // s[i:i+1] = X_i - MOVUPS X1, 16(SI)(AX*8) - MOVUPS X2, 32(SI)(AX*8) - MOVUPS X3, 48(SI)(AX*8) - ADDQ $8, AX // i += 8 - LOOP ac_loop // } while --CX > 0 - CMPQ BX, $0 // if BX == 0 { return } - JE ac_end - -ac_tail_start: // Reset loop counters - MOVQ BX, CX // Loop counter: CX = BX - -ac_tail: // do { - MOVSD (SI)(AX*8), X0 // X0 = s[i] - ADDSD X4, X0 // X0 += a - MOVSD X0, (SI)(AX*8) // s[i] = X0 - INCQ AX // ++i - LOOP ac_tail // } while --CX > 0 - -ac_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpy.go b/vendor/gonum.org/v1/gonum/internal/asm/f64/axpy.go deleted file mode 100644 index b832213..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpy.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !amd64 noasm appengine safe - -package f64 - -// AxpyUnitary is -// for i, v := range x { -// y[i] += alpha * v -// } -func AxpyUnitary(alpha float64, x, y []float64) { - for i, v := range x { - y[i] += alpha * v - } -} - -// AxpyUnitaryTo is -// for i, v := range x { -// dst[i] = alpha*v + y[i] -// } -func AxpyUnitaryTo(dst []float64, alpha float64, x, y []float64) { - for i, v := range x { - dst[i] = alpha*v + y[i] - } -} - -// AxpyInc is -// for i := 0; i < int(n); i++ { -// y[iy] += alpha * x[ix] -// ix += incX -// iy += incY -// } -func AxpyInc(alpha float64, x, y []float64, n, incX, incY, ix, iy uintptr) { - for i := 0; i < int(n); i++ { - y[iy] += alpha * x[ix] - ix += incX - iy += incY - } -} - -// AxpyIncTo is -// for i := 0; i < int(n); i++ { -// dst[idst] = alpha*x[ix] + y[iy] -// ix += incX -// iy += incY -// idst += incDst -// } -func AxpyIncTo(dst []float64, incDst, idst uintptr, alpha float64, x, y []float64, n, incX, incY, ix, iy uintptr) { - for i := 0; i < int(n); i++ { - dst[idst] = alpha*x[ix] + y[iy] - ix += incX - iy += incY - idst += incDst - } -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyinc_amd64.s deleted file mode 100644 index aab22e3..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyinc_amd64.s +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -// -// Some of the loop unrolling code is copied from: -// http://golang.org/src/math/big/arith_amd64.s -// which is distributed under these terms: -// -// Copyright (c) 2012 The Go Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define X_PTR SI -#define Y_PTR DI -#define DST_PTR DI -#define IDX AX -#define LEN CX -#define TAIL BX -#define INC_X R8 -#define INCx3_X R11 -#define INC_Y R9 -#define INCx3_Y R12 -#define INC_DST R9 -#define INCx3_DST R12 -#define ALPHA X0 -#define ALPHA_2 X1 - -// func AxpyInc(alpha float64, x, y []float64, n, incX, incY, ix, iy uintptr) -TEXT ·AxpyInc(SB), NOSPLIT, $0 - MOVQ x_base+8(FP), X_PTR // X_PTR = &x - MOVQ y_base+32(FP), Y_PTR // Y_PTR = &y - MOVQ n+56(FP), LEN // LEN = n - CMPQ LEN, $0 // if LEN == 0 { return } - JE end - - MOVQ ix+80(FP), INC_X - MOVQ iy+88(FP), INC_Y - LEAQ (X_PTR)(INC_X*8), X_PTR // X_PTR = &(x[ix]) - LEAQ (Y_PTR)(INC_Y*8), Y_PTR // Y_PTR = &(y[iy]) - MOVQ Y_PTR, DST_PTR // DST_PTR = Y_PTR // Write pointer - - MOVQ incX+64(FP), INC_X // INC_X = incX * sizeof(float64) - SHLQ $3, INC_X - MOVQ incY+72(FP), INC_Y // INC_Y = incY * sizeof(float64) - SHLQ $3, INC_Y - - MOVSD alpha+0(FP), ALPHA // ALPHA = alpha - MOVQ LEN, TAIL - ANDQ $3, TAIL // TAIL = n % 4 - SHRQ $2, LEN // LEN = floor( n / 4 ) - JZ tail_start // if LEN == 0 { goto tail_start } - - MOVAPS ALPHA, ALPHA_2 // ALPHA_2 = ALPHA for pipelining - LEAQ (INC_X)(INC_X*2), INCx3_X // INCx3_X = INC_X * 3 - LEAQ (INC_Y)(INC_Y*2), INCx3_Y // INCx3_Y = INC_Y * 3 - -loop: // do { // y[i] += alpha * x[i] unrolled 4x. - MOVSD (X_PTR), X2 // X_i = x[i] - MOVSD (X_PTR)(INC_X*1), X3 - MOVSD (X_PTR)(INC_X*2), X4 - MOVSD (X_PTR)(INCx3_X*1), X5 - - MULSD ALPHA, X2 // X_i *= a - MULSD ALPHA_2, X3 - MULSD ALPHA, X4 - MULSD ALPHA_2, X5 - - ADDSD (Y_PTR), X2 // X_i += y[i] - ADDSD (Y_PTR)(INC_Y*1), X3 - ADDSD (Y_PTR)(INC_Y*2), X4 - ADDSD (Y_PTR)(INCx3_Y*1), X5 - - MOVSD X2, (DST_PTR) // y[i] = X_i - MOVSD X3, (DST_PTR)(INC_DST*1) - MOVSD X4, (DST_PTR)(INC_DST*2) - MOVSD X5, (DST_PTR)(INCx3_DST*1) - - LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(X_PTR[incX*4]) - LEAQ (Y_PTR)(INC_Y*4), Y_PTR // Y_PTR = &(Y_PTR[incY*4]) - DECQ LEN - JNZ loop // } while --LEN > 0 - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE end - -tail_start: // Reset Loop registers - MOVQ TAIL, LEN // Loop counter: LEN = TAIL - SHRQ $1, LEN // LEN = floor( LEN / 2 ) - JZ tail_one - -tail_two: - MOVSD (X_PTR), X2 // X_i = x[i] - MOVSD (X_PTR)(INC_X*1), X3 - MULSD ALPHA, X2 // X_i *= a - MULSD ALPHA, X3 - ADDSD (Y_PTR), X2 // X_i += y[i] - ADDSD (Y_PTR)(INC_Y*1), X3 - MOVSD X2, (DST_PTR) // y[i] = X_i - MOVSD X3, (DST_PTR)(INC_DST*1) - - LEAQ (X_PTR)(INC_X*2), X_PTR // X_PTR = &(X_PTR[incX*2]) - LEAQ (Y_PTR)(INC_Y*2), Y_PTR // Y_PTR = &(Y_PTR[incY*2]) - - ANDQ $1, TAIL - JZ end // if TAIL == 0 { goto end } - -tail_one: - // y[i] += alpha * x[i] for the last n % 4 iterations. - MOVSD (X_PTR), X2 // X2 = x[i] - MULSD ALPHA, X2 // X2 *= a - ADDSD (Y_PTR), X2 // X2 += y[i] - MOVSD X2, (DST_PTR) // y[i] = X2 - -end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyincto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyincto_amd64.s deleted file mode 100644 index f2fb977..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyincto_amd64.s +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -// -// Some of the loop unrolling code is copied from: -// http://golang.org/src/math/big/arith_amd64.s -// which is distributed under these terms: -// -// Copyright (c) 2012 The Go Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define X_PTR SI -#define Y_PTR DI -#define DST_PTR DX -#define IDX AX -#define LEN CX -#define TAIL BX -#define INC_X R8 -#define INCx3_X R11 -#define INC_Y R9 -#define INCx3_Y R12 -#define INC_DST R10 -#define INCx3_DST R13 -#define ALPHA X0 -#define ALPHA_2 X1 - -// func AxpyIncTo(dst []float64, incDst, idst uintptr, alpha float64, x, y []float64, n, incX, incY, ix, iy uintptr) -TEXT ·AxpyIncTo(SB), NOSPLIT, $0 - MOVQ dst_base+0(FP), DST_PTR // DST_PTR := &dst - MOVQ x_base+48(FP), X_PTR // X_PTR := &x - MOVQ y_base+72(FP), Y_PTR // Y_PTR := &y - MOVQ n+96(FP), LEN // LEN := n - CMPQ LEN, $0 // if LEN == 0 { return } - JE end - - MOVQ ix+120(FP), INC_X - LEAQ (X_PTR)(INC_X*8), X_PTR // X_PTR = &(x[ix]) - MOVQ iy+128(FP), INC_Y - LEAQ (Y_PTR)(INC_Y*8), Y_PTR // Y_PTR = &(dst[idst]) - MOVQ idst+32(FP), INC_DST - LEAQ (DST_PTR)(INC_DST*8), DST_PTR // DST_PTR = &(y[iy]) - - MOVQ incX+104(FP), INC_X // INC_X = incX * sizeof(float64) - SHLQ $3, INC_X - MOVQ incY+112(FP), INC_Y // INC_Y = incY * sizeof(float64) - SHLQ $3, INC_Y - MOVQ incDst+24(FP), INC_DST // INC_DST = incDst * sizeof(float64) - SHLQ $3, INC_DST - MOVSD alpha+40(FP), ALPHA - - MOVQ LEN, TAIL - ANDQ $3, TAIL // TAIL = n % 4 - SHRQ $2, LEN // LEN = floor( n / 4 ) - JZ tail_start // if LEN == 0 { goto tail_start } - - MOVSD ALPHA, ALPHA_2 // ALPHA_2 = ALPHA for pipelining - LEAQ (INC_X)(INC_X*2), INCx3_X // INCx3_X = INC_X * 3 - LEAQ (INC_Y)(INC_Y*2), INCx3_Y // INCx3_Y = INC_Y * 3 - LEAQ (INC_DST)(INC_DST*2), INCx3_DST // INCx3_DST = INC_DST * 3 - -loop: // do { // y[i] += alpha * x[i] unrolled 2x. - MOVSD (X_PTR), X2 // X_i = x[i] - MOVSD (X_PTR)(INC_X*1), X3 - MOVSD (X_PTR)(INC_X*2), X4 - MOVSD (X_PTR)(INCx3_X*1), X5 - - MULSD ALPHA, X2 // X_i *= a - MULSD ALPHA_2, X3 - MULSD ALPHA, X4 - MULSD ALPHA_2, X5 - - ADDSD (Y_PTR), X2 // X_i += y[i] - ADDSD (Y_PTR)(INC_Y*1), X3 - ADDSD (Y_PTR)(INC_Y*2), X4 - ADDSD (Y_PTR)(INCx3_Y*1), X5 - - MOVSD X2, (DST_PTR) // y[i] = X_i - MOVSD X3, (DST_PTR)(INC_DST*1) - MOVSD X4, (DST_PTR)(INC_DST*2) - MOVSD X5, (DST_PTR)(INCx3_DST*1) - - LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(X_PTR[incX*4]) - LEAQ (Y_PTR)(INC_Y*4), Y_PTR // Y_PTR = &(Y_PTR[incY*4]) - LEAQ (DST_PTR)(INC_DST*4), DST_PTR // DST_PTR = &(DST_PTR[incDst*4] - DECQ LEN - JNZ loop // } while --LEN > 0 - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE end - -tail_start: // Reset Loop registers - MOVQ TAIL, LEN // Loop counter: LEN = TAIL - SHRQ $1, LEN // LEN = floor( LEN / 2 ) - JZ tail_one - -tail_two: - MOVSD (X_PTR), X2 // X_i = x[i] - MOVSD (X_PTR)(INC_X*1), X3 - MULSD ALPHA, X2 // X_i *= a - MULSD ALPHA, X3 - ADDSD (Y_PTR), X2 // X_i += y[i] - ADDSD (Y_PTR)(INC_Y*1), X3 - MOVSD X2, (DST_PTR) // y[i] = X_i - MOVSD X3, (DST_PTR)(INC_DST*1) - - LEAQ (X_PTR)(INC_X*2), X_PTR // X_PTR = &(X_PTR[incX*2]) - LEAQ (Y_PTR)(INC_Y*2), Y_PTR // Y_PTR = &(Y_PTR[incY*2]) - LEAQ (DST_PTR)(INC_DST*2), DST_PTR // DST_PTR = &(DST_PTR[incY*2] - - ANDQ $1, TAIL - JZ end // if TAIL == 0 { goto end } - -tail_one: - MOVSD (X_PTR), X2 // X2 = x[i] - MULSD ALPHA, X2 // X2 *= a - ADDSD (Y_PTR), X2 // X2 += y[i] - MOVSD X2, (DST_PTR) // y[i] = X2 - -end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyunitary_amd64.s deleted file mode 100644 index cc519cf..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyunitary_amd64.s +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -// -// Some of the loop unrolling code is copied from: -// http://golang.org/src/math/big/arith_amd64.s -// which is distributed under these terms: -// -// Copyright (c) 2012 The Go Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define X_PTR SI -#define Y_PTR DI -#define DST_PTR DI -#define IDX AX -#define LEN CX -#define TAIL BX -#define ALPHA X0 -#define ALPHA_2 X1 - -// func AxpyUnitary(alpha float64, x, y []float64) -TEXT ·AxpyUnitary(SB), NOSPLIT, $0 - MOVQ x_base+8(FP), X_PTR // X_PTR := &x - MOVQ y_base+32(FP), Y_PTR // Y_PTR := &y - MOVQ x_len+16(FP), LEN // LEN = min( len(x), len(y) ) - CMPQ y_len+40(FP), LEN - CMOVQLE y_len+40(FP), LEN - CMPQ LEN, $0 // if LEN == 0 { return } - JE end - XORQ IDX, IDX - MOVSD alpha+0(FP), ALPHA // ALPHA := { alpha, alpha } - SHUFPD $0, ALPHA, ALPHA - MOVUPS ALPHA, ALPHA_2 // ALPHA_2 := ALPHA for pipelining - MOVQ Y_PTR, TAIL // Check memory alignment - ANDQ $15, TAIL // TAIL = &y % 16 - JZ no_trim // if TAIL == 0 { goto no_trim } - - // Align on 16-byte boundary - MOVSD (X_PTR), X2 // X2 := x[0] - MULSD ALPHA, X2 // X2 *= a - ADDSD (Y_PTR), X2 // X2 += y[0] - MOVSD X2, (DST_PTR) // y[0] = X2 - INCQ IDX // i++ - DECQ LEN // LEN-- - JZ end // if LEN == 0 { return } - -no_trim: - MOVQ LEN, TAIL - ANDQ $7, TAIL // TAIL := n % 8 - SHRQ $3, LEN // LEN = floor( n / 8 ) - JZ tail_start // if LEN == 0 { goto tail2_start } - -loop: // do { - // y[i] += alpha * x[i] unrolled 8x. - MOVUPS (X_PTR)(IDX*8), X2 // X_i = x[i] - MOVUPS 16(X_PTR)(IDX*8), X3 - MOVUPS 32(X_PTR)(IDX*8), X4 - MOVUPS 48(X_PTR)(IDX*8), X5 - - MULPD ALPHA, X2 // X_i *= a - MULPD ALPHA_2, X3 - MULPD ALPHA, X4 - MULPD ALPHA_2, X5 - - ADDPD (Y_PTR)(IDX*8), X2 // X_i += y[i] - ADDPD 16(Y_PTR)(IDX*8), X3 - ADDPD 32(Y_PTR)(IDX*8), X4 - ADDPD 48(Y_PTR)(IDX*8), X5 - - MOVUPS X2, (DST_PTR)(IDX*8) // y[i] = X_i - MOVUPS X3, 16(DST_PTR)(IDX*8) - MOVUPS X4, 32(DST_PTR)(IDX*8) - MOVUPS X5, 48(DST_PTR)(IDX*8) - - ADDQ $8, IDX // i += 8 - DECQ LEN - JNZ loop // } while --LEN > 0 - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE end - -tail_start: // Reset loop registers - MOVQ TAIL, LEN // Loop counter: LEN = TAIL - SHRQ $1, LEN // LEN = floor( TAIL / 2 ) - JZ tail_one // if TAIL == 0 { goto tail } - -tail_two: // do { - MOVUPS (X_PTR)(IDX*8), X2 // X2 = x[i] - MULPD ALPHA, X2 // X2 *= a - ADDPD (Y_PTR)(IDX*8), X2 // X2 += y[i] - MOVUPS X2, (DST_PTR)(IDX*8) // y[i] = X2 - ADDQ $2, IDX // i += 2 - DECQ LEN - JNZ tail_two // } while --LEN > 0 - - ANDQ $1, TAIL - JZ end // if TAIL == 0 { goto end } - -tail_one: - MOVSD (X_PTR)(IDX*8), X2 // X2 = x[i] - MULSD ALPHA, X2 // X2 *= a - ADDSD (Y_PTR)(IDX*8), X2 // X2 += y[i] - MOVSD X2, (DST_PTR)(IDX*8) // y[i] = X2 - -end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyunitaryto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyunitaryto_amd64.s deleted file mode 100644 index 3918092..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyunitaryto_amd64.s +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -// -// Some of the loop unrolling code is copied from: -// http://golang.org/src/math/big/arith_amd64.s -// which is distributed under these terms: -// -// Copyright (c) 2012 The Go Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define X_PTR SI -#define Y_PTR DX -#define DST_PTR DI -#define IDX AX -#define LEN CX -#define TAIL BX -#define ALPHA X0 -#define ALPHA_2 X1 - -// func AxpyUnitaryTo(dst []float64, alpha float64, x, y []float64) -TEXT ·AxpyUnitaryTo(SB), NOSPLIT, $0 - MOVQ dst_base+0(FP), DST_PTR // DST_PTR := &dst - MOVQ x_base+32(FP), X_PTR // X_PTR := &x - MOVQ y_base+56(FP), Y_PTR // Y_PTR := &y - MOVQ x_len+40(FP), LEN // LEN = min( len(x), len(y), len(dst) ) - CMPQ y_len+64(FP), LEN - CMOVQLE y_len+64(FP), LEN - CMPQ dst_len+8(FP), LEN - CMOVQLE dst_len+8(FP), LEN - - CMPQ LEN, $0 - JE end // if LEN == 0 { return } - - XORQ IDX, IDX // IDX = 0 - MOVSD alpha+24(FP), ALPHA - SHUFPD $0, ALPHA, ALPHA // ALPHA := { alpha, alpha } - MOVQ Y_PTR, TAIL // Check memory alignment - ANDQ $15, TAIL // TAIL = &y % 16 - JZ no_trim // if TAIL == 0 { goto no_trim } - - // Align on 16-byte boundary - MOVSD (X_PTR), X2 // X2 := x[0] - MULSD ALPHA, X2 // X2 *= a - ADDSD (Y_PTR), X2 // X2 += y[0] - MOVSD X2, (DST_PTR) // y[0] = X2 - INCQ IDX // i++ - DECQ LEN // LEN-- - JZ end // if LEN == 0 { return } - -no_trim: - MOVQ LEN, TAIL - ANDQ $7, TAIL // TAIL := n % 8 - SHRQ $3, LEN // LEN = floor( n / 8 ) - JZ tail_start // if LEN == 0 { goto tail_start } - - MOVUPS ALPHA, ALPHA_2 // ALPHA_2 := ALPHA for pipelining - -loop: // do { - // y[i] += alpha * x[i] unrolled 8x. - MOVUPS (X_PTR)(IDX*8), X2 // X_i = x[i] - MOVUPS 16(X_PTR)(IDX*8), X3 - MOVUPS 32(X_PTR)(IDX*8), X4 - MOVUPS 48(X_PTR)(IDX*8), X5 - - MULPD ALPHA, X2 // X_i *= alpha - MULPD ALPHA_2, X3 - MULPD ALPHA, X4 - MULPD ALPHA_2, X5 - - ADDPD (Y_PTR)(IDX*8), X2 // X_i += y[i] - ADDPD 16(Y_PTR)(IDX*8), X3 - ADDPD 32(Y_PTR)(IDX*8), X4 - ADDPD 48(Y_PTR)(IDX*8), X5 - - MOVUPS X2, (DST_PTR)(IDX*8) // y[i] = X_i - MOVUPS X3, 16(DST_PTR)(IDX*8) - MOVUPS X4, 32(DST_PTR)(IDX*8) - MOVUPS X5, 48(DST_PTR)(IDX*8) - - ADDQ $8, IDX // i += 8 - DECQ LEN - JNZ loop // } while --LEN > 0 - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE end - -tail_start: // Reset loop registers - MOVQ TAIL, LEN // Loop counter: LEN = TAIL - SHRQ $1, LEN // LEN = floor( TAIL / 2 ) - JZ tail_one // if LEN == 0 { goto tail } - -tail_two: // do { - MOVUPS (X_PTR)(IDX*8), X2 // X2 = x[i] - MULPD ALPHA, X2 // X2 *= alpha - ADDPD (Y_PTR)(IDX*8), X2 // X2 += y[i] - MOVUPS X2, (DST_PTR)(IDX*8) // y[i] = X2 - ADDQ $2, IDX // i += 2 - DECQ LEN - JNZ tail_two // } while --LEN > 0 - - ANDQ $1, TAIL - JZ end // if TAIL == 0 { goto end } - -tail_one: - MOVSD (X_PTR)(IDX*8), X2 // X2 = x[i] - MULSD ALPHA, X2 // X2 *= a - ADDSD (Y_PTR)(IDX*8), X2 // X2 += y[i] - MOVSD X2, (DST_PTR)(IDX*8) // y[i] = X2 - -end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/cumprod_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/cumprod_amd64.s deleted file mode 100644 index 32bd157..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/cumprod_amd64.s +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -TEXT ·CumProd(SB), NOSPLIT, $0 - MOVQ dst_base+0(FP), DI // DI = &dst - MOVQ dst_len+8(FP), CX // CX = len(dst) - MOVQ s_base+24(FP), SI // SI = &s - CMPQ s_len+32(FP), CX // CX = max( CX, len(s) ) - CMOVQLE s_len+32(FP), CX - MOVQ CX, ret_len+56(FP) // len(ret) = CX - CMPQ CX, $0 // if CX == 0 { return } - JE cp_end - XORQ AX, AX // i = 0 - - MOVSD (SI), X5 // p_prod = { s[0], s[0] } - SHUFPD $0, X5, X5 - MOVSD X5, (DI) // dst[0] = s[0] - INCQ AX // ++i - DECQ CX // -- CX - JZ cp_end // if CX == 0 { return } - - MOVQ CX, BX - ANDQ $3, BX // BX = CX % 4 - SHRQ $2, CX // CX = floor( CX / 4 ) - JZ cp_tail_start // if CX == 0 { goto cp_tail_start } - -cp_loop: // Loop unrolled 4x do { - MOVUPS (SI)(AX*8), X0 // X0 = s[i:i+1] - MOVUPS 16(SI)(AX*8), X2 - MOVAPS X0, X1 // X1 = X0 - MOVAPS X2, X3 - SHUFPD $1, X1, X1 // { X1[0], X1[1] } = { X1[1], X1[0] } - SHUFPD $1, X3, X3 - MULPD X0, X1 // X1 *= X0 - MULPD X2, X3 - SHUFPD $2, X1, X0 // { X0[0], X0[1] } = { X0[0], X1[1] } - SHUFPD $3, X1, X1 // { X1[0], X1[1] } = { X1[1], X1[1] } - SHUFPD $2, X3, X2 - SHUFPD $3, X3, X3 - MULPD X5, X0 // X0 *= p_prod - MULPD X1, X5 // p_prod *= X1 - MULPD X5, X2 - MOVUPS X0, (DI)(AX*8) // dst[i] = X0 - MOVUPS X2, 16(DI)(AX*8) - MULPD X3, X5 - ADDQ $4, AX // i += 4 - LOOP cp_loop // } while --CX > 0 - - // if BX == 0 { return } - CMPQ BX, $0 - JE cp_end - -cp_tail_start: // Reset loop registers - MOVQ BX, CX // Loop counter: CX = BX - -cp_tail: // do { - MULSD (SI)(AX*8), X5 // p_prod *= s[i] - MOVSD X5, (DI)(AX*8) // dst[i] = p_prod - INCQ AX // ++i - LOOP cp_tail // } while --CX > 0 - -cp_end: - MOVQ DI, ret_base+48(FP) // &ret = &dst - MOVQ dst_cap+16(FP), SI // cap(ret) = cap(dst) - MOVQ SI, ret_cap+64(FP) - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/cumsum_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/cumsum_amd64.s deleted file mode 100644 index 10d7fda..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/cumsum_amd64.s +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -TEXT ·CumSum(SB), NOSPLIT, $0 - MOVQ dst_base+0(FP), DI // DI = &dst - MOVQ dst_len+8(FP), CX // CX = len(dst) - MOVQ s_base+24(FP), SI // SI = &s - CMPQ s_len+32(FP), CX // CX = max( CX, len(s) ) - CMOVQLE s_len+32(FP), CX - MOVQ CX, ret_len+56(FP) // len(ret) = CX - CMPQ CX, $0 // if CX == 0 { return } - JE cs_end - XORQ AX, AX // i = 0 - PXOR X5, X5 // p_sum = 0 - MOVQ CX, BX - ANDQ $3, BX // BX = CX % 4 - SHRQ $2, CX // CX = floor( CX / 4 ) - JZ cs_tail_start // if CX == 0 { goto cs_tail_start } - -cs_loop: // Loop unrolled 4x do { - MOVUPS (SI)(AX*8), X0 // X0 = s[i:i+1] - MOVUPS 16(SI)(AX*8), X2 - MOVAPS X0, X1 // X1 = X0 - MOVAPS X2, X3 - SHUFPD $1, X1, X1 // { X1[0], X1[1] } = { X1[1], X1[0] } - SHUFPD $1, X3, X3 - ADDPD X0, X1 // X1 += X0 - ADDPD X2, X3 - SHUFPD $2, X1, X0 // { X0[0], X0[1] } = { X0[0], X1[1] } - SHUFPD $3, X1, X1 // { X1[0], X1[1] } = { X1[1], X1[1] } - SHUFPD $2, X3, X2 - SHUFPD $3, X3, X3 - ADDPD X5, X0 // X0 += p_sum - ADDPD X1, X5 // p_sum += X1 - ADDPD X5, X2 - MOVUPS X0, (DI)(AX*8) // dst[i] = X0 - MOVUPS X2, 16(DI)(AX*8) - ADDPD X3, X5 - ADDQ $4, AX // i += 4 - LOOP cs_loop // } while --CX > 0 - - // if BX == 0 { return } - CMPQ BX, $0 - JE cs_end - -cs_tail_start: // Reset loop registers - MOVQ BX, CX // Loop counter: CX = BX - -cs_tail: // do { - ADDSD (SI)(AX*8), X5 // p_sum *= s[i] - MOVSD X5, (DI)(AX*8) // dst[i] = p_sum - INCQ AX // ++i - LOOP cs_tail // } while --CX > 0 - -cs_end: - MOVQ DI, ret_base+48(FP) // &ret = &dst - MOVQ dst_cap+16(FP), SI // cap(ret) = cap(dst) - MOVQ SI, ret_cap+64(FP) - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/div_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/div_amd64.s deleted file mode 100644 index 1a4e9ee..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/div_amd64.s +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// func Div(dst, s []float64) -TEXT ·Div(SB), NOSPLIT, $0 - MOVQ dst_base+0(FP), DI // DI = &dst - MOVQ dst_len+8(FP), CX // CX = len(dst) - MOVQ s_base+24(FP), SI // SI = &s - CMPQ s_len+32(FP), CX // CX = max( CX, len(s) ) - CMOVQLE s_len+32(FP), CX - CMPQ CX, $0 // if CX == 0 { return } - JE div_end - XORQ AX, AX // i = 0 - MOVQ SI, BX - ANDQ $15, BX // BX = &s & 15 - JZ div_no_trim // if BX == 0 { goto div_no_trim } - - // Align on 16-bit boundary - MOVSD (DI)(AX*8), X0 // X0 = dst[i] - DIVSD (SI)(AX*8), X0 // X0 /= s[i] - MOVSD X0, (DI)(AX*8) // dst[i] = X0 - INCQ AX // ++i - DECQ CX // --CX - JZ div_end // if CX == 0 { return } - -div_no_trim: - MOVQ CX, BX - ANDQ $7, BX // BX = len(dst) % 8 - SHRQ $3, CX // CX = floor( len(dst) / 8 ) - JZ div_tail_start // if CX == 0 { goto div_tail_start } - -div_loop: // Loop unrolled 8x do { - MOVUPS (DI)(AX*8), X0 // X0 = dst[i:i+1] - MOVUPS 16(DI)(AX*8), X1 - MOVUPS 32(DI)(AX*8), X2 - MOVUPS 48(DI)(AX*8), X3 - DIVPD (SI)(AX*8), X0 // X0 /= s[i:i+1] - DIVPD 16(SI)(AX*8), X1 - DIVPD 32(SI)(AX*8), X2 - DIVPD 48(SI)(AX*8), X3 - MOVUPS X0, (DI)(AX*8) // dst[i] = X0 - MOVUPS X1, 16(DI)(AX*8) - MOVUPS X2, 32(DI)(AX*8) - MOVUPS X3, 48(DI)(AX*8) - ADDQ $8, AX // i += 8 - LOOP div_loop // } while --CX > 0 - CMPQ BX, $0 // if BX == 0 { return } - JE div_end - -div_tail_start: // Reset loop registers - MOVQ BX, CX // Loop counter: CX = BX - -div_tail: // do { - MOVSD (DI)(AX*8), X0 // X0 = dst[i] - DIVSD (SI)(AX*8), X0 // X0 /= s[i] - MOVSD X0, (DI)(AX*8) // dst[i] = X0 - INCQ AX // ++i - LOOP div_tail // } while --CX > 0 - -div_end: - RET - diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/divto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/divto_amd64.s deleted file mode 100644 index 16ab9b7..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/divto_amd64.s +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// func DivTo(dst, x, y []float64) -TEXT ·DivTo(SB), NOSPLIT, $0 - MOVQ dst_base+0(FP), DI // DI = &dst - MOVQ dst_len+8(FP), CX // CX = len(dst) - MOVQ x_base+24(FP), SI // SI = &x - MOVQ y_base+48(FP), DX // DX = &y - CMPQ x_len+32(FP), CX // CX = max( len(dst), len(x), len(y) ) - CMOVQLE x_len+32(FP), CX - CMPQ y_len+56(FP), CX - CMOVQLE y_len+56(FP), CX - MOVQ CX, ret_len+80(FP) // len(ret) = CX - CMPQ CX, $0 // if CX == 0 { return } - JE div_end - XORQ AX, AX // i = 0 - MOVQ DX, BX - ANDQ $15, BX // BX = &y & OxF - JZ div_no_trim // if BX == 0 { goto div_no_trim } - - // Align on 16-bit boundary - MOVSD (SI)(AX*8), X0 // X0 = s[i] - DIVSD (DX)(AX*8), X0 // X0 /= t[i] - MOVSD X0, (DI)(AX*8) // dst[i] = X0 - INCQ AX // ++i - DECQ CX // --CX - JZ div_end // if CX == 0 { return } - -div_no_trim: - MOVQ CX, BX - ANDQ $7, BX // BX = len(dst) % 8 - SHRQ $3, CX // CX = floor( len(dst) / 8 ) - JZ div_tail_start // if CX == 0 { goto div_tail_start } - -div_loop: // Loop unrolled 8x do { - MOVUPS (SI)(AX*8), X0 // X0 = x[i:i+1] - MOVUPS 16(SI)(AX*8), X1 - MOVUPS 32(SI)(AX*8), X2 - MOVUPS 48(SI)(AX*8), X3 - DIVPD (DX)(AX*8), X0 // X0 /= y[i:i+1] - DIVPD 16(DX)(AX*8), X1 - DIVPD 32(DX)(AX*8), X2 - DIVPD 48(DX)(AX*8), X3 - MOVUPS X0, (DI)(AX*8) // dst[i:i+1] = X0 - MOVUPS X1, 16(DI)(AX*8) - MOVUPS X2, 32(DI)(AX*8) - MOVUPS X3, 48(DI)(AX*8) - ADDQ $8, AX // i += 8 - LOOP div_loop // } while --CX > 0 - CMPQ BX, $0 // if BX == 0 { return } - JE div_end - -div_tail_start: // Reset loop registers - MOVQ BX, CX // Loop counter: CX = BX - -div_tail: // do { - MOVSD (SI)(AX*8), X0 // X0 = x[i] - DIVSD (DX)(AX*8), X0 // X0 /= y[i] - MOVSD X0, (DI)(AX*8) - INCQ AX // ++i - LOOP div_tail // } while --CX > 0 - -div_end: - MOVQ DI, ret_base+72(FP) // &ret = &dst - MOVQ dst_cap+16(FP), DI // cap(ret) = cap(dst) - MOVQ DI, ret_cap+88(FP) - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/doc.go b/vendor/gonum.org/v1/gonum/internal/asm/f64/doc.go deleted file mode 100644 index 33c76c1..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright ©2017 The Gonum 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 f64 provides float64 vector primitives. -package f64 // import "gonum.org/v1/gonum/internal/asm/f64" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/dot.go b/vendor/gonum.org/v1/gonum/internal/asm/f64/dot.go deleted file mode 100644 index b77138d..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/dot.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !amd64 noasm appengine safe - -package f64 - -// DotUnitary is -// for i, v := range x { -// sum += y[i] * v -// } -// return sum -func DotUnitary(x, y []float64) (sum float64) { - for i, v := range x { - sum += y[i] * v - } - return sum -} - -// DotInc is -// for i := 0; i < int(n); i++ { -// sum += y[iy] * x[ix] -// ix += incX -// iy += incY -// } -// return sum -func DotInc(x, y []float64, n, incX, incY, ix, iy uintptr) (sum float64) { - for i := 0; i < int(n); i++ { - sum += y[iy] * x[ix] - ix += incX - iy += incY - } - return sum -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/dot_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/dot_amd64.s deleted file mode 100644 index 6daba1b..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/dot_amd64.s +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -// -// Some of the loop unrolling code is copied from: -// http://golang.org/src/math/big/arith_amd64.s -// which is distributed under these terms: -// -// Copyright (c) 2012 The Go Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// func DdotUnitary(x, y []float64) (sum float64) -// This function assumes len(y) >= len(x). -TEXT ·DotUnitary(SB), NOSPLIT, $0 - MOVQ x+0(FP), R8 - MOVQ x_len+8(FP), DI // n = len(x) - MOVQ y+24(FP), R9 - - MOVSD $(0.0), X7 // sum = 0 - MOVSD $(0.0), X8 // sum = 0 - - MOVQ $0, SI // i = 0 - SUBQ $4, DI // n -= 4 - JL tail_uni // if n < 0 goto tail_uni - -loop_uni: - // sum += x[i] * y[i] unrolled 4x. - MOVUPD 0(R8)(SI*8), X0 - MOVUPD 0(R9)(SI*8), X1 - MOVUPD 16(R8)(SI*8), X2 - MOVUPD 16(R9)(SI*8), X3 - MULPD X1, X0 - MULPD X3, X2 - ADDPD X0, X7 - ADDPD X2, X8 - - ADDQ $4, SI // i += 4 - SUBQ $4, DI // n -= 4 - JGE loop_uni // if n >= 0 goto loop_uni - -tail_uni: - ADDQ $4, DI // n += 4 - JLE end_uni // if n <= 0 goto end_uni - -onemore_uni: - // sum += x[i] * y[i] for the remaining 1-3 elements. - MOVSD 0(R8)(SI*8), X0 - MOVSD 0(R9)(SI*8), X1 - MULSD X1, X0 - ADDSD X0, X7 - - ADDQ $1, SI // i++ - SUBQ $1, DI // n-- - JNZ onemore_uni // if n != 0 goto onemore_uni - -end_uni: - // Add the four sums together. - ADDPD X8, X7 - MOVSD X7, X0 - UNPCKHPD X7, X7 - ADDSD X0, X7 - MOVSD X7, sum+48(FP) // Return final sum. - RET - -// func DdotInc(x, y []float64, n, incX, incY, ix, iy uintptr) (sum float64) -TEXT ·DotInc(SB), NOSPLIT, $0 - MOVQ x+0(FP), R8 - MOVQ y+24(FP), R9 - MOVQ n+48(FP), CX - MOVQ incX+56(FP), R11 - MOVQ incY+64(FP), R12 - MOVQ ix+72(FP), R13 - MOVQ iy+80(FP), R14 - - MOVSD $(0.0), X7 // sum = 0 - LEAQ (R8)(R13*8), SI // p = &x[ix] - LEAQ (R9)(R14*8), DI // q = &y[ix] - SHLQ $3, R11 // incX *= sizeof(float64) - SHLQ $3, R12 // indY *= sizeof(float64) - - SUBQ $2, CX // n -= 2 - JL tail_inc // if n < 0 goto tail_inc - -loop_inc: - // sum += *p * *q unrolled 2x. - MOVHPD (SI), X0 - MOVHPD (DI), X1 - ADDQ R11, SI // p += incX - ADDQ R12, DI // q += incY - MOVLPD (SI), X0 - MOVLPD (DI), X1 - ADDQ R11, SI // p += incX - ADDQ R12, DI // q += incY - - MULPD X1, X0 - ADDPD X0, X7 - - SUBQ $2, CX // n -= 2 - JGE loop_inc // if n >= 0 goto loop_inc - -tail_inc: - ADDQ $2, CX // n += 2 - JLE end_inc // if n <= 0 goto end_inc - - // sum += *p * *q for the last iteration if n is odd. - MOVSD (SI), X0 - MULSD (DI), X0 - ADDSD X0, X7 - -end_inc: - // Add the two sums together. - MOVSD X7, X0 - UNPCKHPD X7, X7 - ADDSD X0, X7 - MOVSD X7, sum+88(FP) // Return final sum. - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/ge_amd64.go b/vendor/gonum.org/v1/gonum/internal/asm/f64/ge_amd64.go deleted file mode 100644 index 506fdbb..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/ge_amd64.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -package f64 - -// Ger performs the rank-one operation -// A += alpha * x * yᵀ -// where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. -func Ger(m, n uintptr, alpha float64, x []float64, incX uintptr, y []float64, incY uintptr, a []float64, lda uintptr) - -// GemvN computes -// y = alpha * A * x + beta * y -// where A is an m×n dense matrix, x and y are vectors, and alpha and beta are scalars. -func GemvN(m, n uintptr, alpha float64, a []float64, lda uintptr, x []float64, incX uintptr, beta float64, y []float64, incY uintptr) - -// GemvT computes -// y = alpha * Aᵀ * x + beta * y -// where A is an m×n dense matrix, x and y are vectors, and alpha and beta are scalars. -func GemvT(m, n uintptr, alpha float64, a []float64, lda uintptr, x []float64, incX uintptr, beta float64, y []float64, incY uintptr) diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/ge_noasm.go b/vendor/gonum.org/v1/gonum/internal/asm/f64/ge_noasm.go deleted file mode 100644 index 4b949d0..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/ge_noasm.go +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !amd64 noasm appengine safe - -package f64 - -// Ger performs the rank-one operation -// A += alpha * x * yᵀ -// where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. -func Ger(m, n uintptr, alpha float64, x []float64, incX uintptr, y []float64, incY uintptr, a []float64, lda uintptr) { - if incX == 1 && incY == 1 { - x = x[:m] - y = y[:n] - for i, xv := range x { - AxpyUnitary(alpha*xv, y, a[uintptr(i)*lda:uintptr(i)*lda+n]) - } - return - } - - var ky, kx uintptr - if int(incY) < 0 { - ky = uintptr(-int(n-1) * int(incY)) - } - if int(incX) < 0 { - kx = uintptr(-int(m-1) * int(incX)) - } - - ix := kx - for i := 0; i < int(m); i++ { - AxpyInc(alpha*x[ix], y, a[uintptr(i)*lda:uintptr(i)*lda+n], n, incY, 1, ky, 0) - ix += incX - } -} - -// GemvN computes -// y = alpha * A * x + beta * y -// where A is an m×n dense matrix, x and y are vectors, and alpha and beta are scalars. -func GemvN(m, n uintptr, alpha float64, a []float64, lda uintptr, x []float64, incX uintptr, beta float64, y []float64, incY uintptr) { - var kx, ky, i uintptr - if int(incX) < 0 { - kx = uintptr(-int(n-1) * int(incX)) - } - if int(incY) < 0 { - ky = uintptr(-int(m-1) * int(incY)) - } - - if incX == 1 && incY == 1 { - if beta == 0 { - for i = 0; i < m; i++ { - y[i] = alpha * DotUnitary(a[lda*i:lda*i+n], x) - } - return - } - for i = 0; i < m; i++ { - y[i] = y[i]*beta + alpha*DotUnitary(a[lda*i:lda*i+n], x) - } - return - } - iy := ky - if beta == 0 { - for i = 0; i < m; i++ { - y[iy] = alpha * DotInc(x, a[lda*i:lda*i+n], n, incX, 1, kx, 0) - iy += incY - } - return - } - for i = 0; i < m; i++ { - y[iy] = y[iy]*beta + alpha*DotInc(x, a[lda*i:lda*i+n], n, incX, 1, kx, 0) - iy += incY - } -} - -// GemvT computes -// y = alpha * Aᵀ * x + beta * y -// where A is an m×n dense matrix, x and y are vectors, and alpha and beta are scalars. -func GemvT(m, n uintptr, alpha float64, a []float64, lda uintptr, x []float64, incX uintptr, beta float64, y []float64, incY uintptr) { - var kx, ky, i uintptr - if int(incX) < 0 { - kx = uintptr(-int(m-1) * int(incX)) - } - if int(incY) < 0 { - ky = uintptr(-int(n-1) * int(incY)) - } - switch { - case beta == 0: // beta == 0 is special-cased to memclear - if incY == 1 { - for i := range y { - y[i] = 0 - } - } else { - iy := ky - for i := 0; i < int(n); i++ { - y[iy] = 0 - iy += incY - } - } - case int(incY) < 0: - ScalInc(beta, y, n, uintptr(int(-incY))) - case incY == 1: - ScalUnitary(beta, y[:n]) - default: - ScalInc(beta, y, n, incY) - } - - if incX == 1 && incY == 1 { - for i = 0; i < m; i++ { - AxpyUnitaryTo(y, alpha*x[i], a[lda*i:lda*i+n], y) - } - return - } - ix := kx - for i = 0; i < m; i++ { - AxpyInc(alpha*x[ix], a[lda*i:lda*i+n], y, n, 1, incY, 0, ky) - ix += incX - } -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/gemvN_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/gemvN_amd64.s deleted file mode 100644 index f0a98f0..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/gemvN_amd64.s +++ /dev/null @@ -1,685 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define SIZE 8 - -#define M_DIM m+0(FP) -#define M CX -#define N_DIM n+8(FP) -#define N BX - -#define TMP1 R14 -#define TMP2 R15 - -#define X_PTR SI -#define X x_base+56(FP) -#define INC_X R8 -#define INC3_X R9 - -#define Y_PTR DX -#define Y y_base+96(FP) -#define INC_Y R10 -#define INC3_Y R11 - -#define A_ROW AX -#define A_PTR DI -#define LDA R12 -#define LDA3 R13 - -#define ALPHA X15 -#define BETA X14 - -#define INIT4 \ - XORPS X0, X0 \ - XORPS X1, X1 \ - XORPS X2, X2 \ - XORPS X3, X3 - -#define INIT2 \ - XORPS X0, X0 \ - XORPS X1, X1 - -#define INIT1 \ - XORPS X0, X0 - -#define KERNEL_LOAD4 \ - MOVUPS (X_PTR), X12 \ - MOVUPS 2*SIZE(X_PTR), X13 - -#define KERNEL_LOAD2 \ - MOVUPS (X_PTR), X12 - -#define KERNEL_LOAD4_INC \ - MOVSD (X_PTR), X12 \ - MOVHPD (X_PTR)(INC_X*1), X12 \ - MOVSD (X_PTR)(INC_X*2), X13 \ - MOVHPD (X_PTR)(INC3_X*1), X13 - -#define KERNEL_LOAD2_INC \ - MOVSD (X_PTR), X12 \ - MOVHPD (X_PTR)(INC_X*1), X12 - -#define KERNEL_4x4 \ - MOVUPS (A_PTR), X4 \ - MOVUPS 2*SIZE(A_PTR), X5 \ - MOVUPS (A_PTR)(LDA*1), X6 \ - MOVUPS 2*SIZE(A_PTR)(LDA*1), X7 \ - MOVUPS (A_PTR)(LDA*2), X8 \ - MOVUPS 2*SIZE(A_PTR)(LDA*2), X9 \ - MOVUPS (A_PTR)(LDA3*1), X10 \ - MOVUPS 2*SIZE(A_PTR)(LDA3*1), X11 \ - MULPD X12, X4 \ - MULPD X13, X5 \ - MULPD X12, X6 \ - MULPD X13, X7 \ - MULPD X12, X8 \ - MULPD X13, X9 \ - MULPD X12, X10 \ - MULPD X13, X11 \ - ADDPD X4, X0 \ - ADDPD X5, X0 \ - ADDPD X6, X1 \ - ADDPD X7, X1 \ - ADDPD X8, X2 \ - ADDPD X9, X2 \ - ADDPD X10, X3 \ - ADDPD X11, X3 \ - ADDQ $4*SIZE, A_PTR - -#define KERNEL_4x2 \ - MOVUPS (A_PTR), X4 \ - MOVUPS (A_PTR)(LDA*1), X5 \ - MOVUPS (A_PTR)(LDA*2), X6 \ - MOVUPS (A_PTR)(LDA3*1), X7 \ - MULPD X12, X4 \ - MULPD X12, X5 \ - MULPD X12, X6 \ - MULPD X12, X7 \ - ADDPD X4, X0 \ - ADDPD X5, X1 \ - ADDPD X6, X2 \ - ADDPD X7, X3 \ - ADDQ $2*SIZE, A_PTR - -#define KERNEL_4x1 \ - MOVDDUP (X_PTR), X12 \ - MOVSD (A_PTR), X4 \ - MOVHPD (A_PTR)(LDA*1), X4 \ - MOVSD (A_PTR)(LDA*2), X5 \ - MOVHPD (A_PTR)(LDA3*1), X5 \ - MULPD X12, X4 \ - MULPD X12, X5 \ - ADDPD X4, X0 \ - ADDPD X5, X2 \ - ADDQ $SIZE, A_PTR - -#define STORE4 \ - MOVUPS (Y_PTR), X4 \ - MOVUPS 2*SIZE(Y_PTR), X5 \ - MULPD ALPHA, X0 \ - MULPD ALPHA, X2 \ - MULPD BETA, X4 \ - MULPD BETA, X5 \ - ADDPD X0, X4 \ - ADDPD X2, X5 \ - MOVUPS X4, (Y_PTR) \ - MOVUPS X5, 2*SIZE(Y_PTR) - -#define STORE4_INC \ - MOVSD (Y_PTR), X4 \ - MOVHPD (Y_PTR)(INC_Y*1), X4 \ - MOVSD (Y_PTR)(INC_Y*2), X5 \ - MOVHPD (Y_PTR)(INC3_Y*1), X5 \ - MULPD ALPHA, X0 \ - MULPD ALPHA, X2 \ - MULPD BETA, X4 \ - MULPD BETA, X5 \ - ADDPD X0, X4 \ - ADDPD X2, X5 \ - MOVLPD X4, (Y_PTR) \ - MOVHPD X4, (Y_PTR)(INC_Y*1) \ - MOVLPD X5, (Y_PTR)(INC_Y*2) \ - MOVHPD X5, (Y_PTR)(INC3_Y*1) - -#define KERNEL_2x4 \ - MOVUPS (A_PTR), X8 \ - MOVUPS 2*SIZE(A_PTR), X9 \ - MOVUPS (A_PTR)(LDA*1), X10 \ - MOVUPS 2*SIZE(A_PTR)(LDA*1), X11 \ - MULPD X12, X8 \ - MULPD X13, X9 \ - MULPD X12, X10 \ - MULPD X13, X11 \ - ADDPD X8, X0 \ - ADDPD X10, X1 \ - ADDPD X9, X0 \ - ADDPD X11, X1 \ - ADDQ $4*SIZE, A_PTR - -#define KERNEL_2x2 \ - MOVUPS (A_PTR), X8 \ - MOVUPS (A_PTR)(LDA*1), X9 \ - MULPD X12, X8 \ - MULPD X12, X9 \ - ADDPD X8, X0 \ - ADDPD X9, X1 \ - ADDQ $2*SIZE, A_PTR - -#define KERNEL_2x1 \ - MOVDDUP (X_PTR), X12 \ - MOVSD (A_PTR), X8 \ - MOVHPD (A_PTR)(LDA*1), X8 \ - MULPD X12, X8 \ - ADDPD X8, X0 \ - ADDQ $SIZE, A_PTR - -#define STORE2 \ - MOVUPS (Y_PTR), X4 \ - MULPD ALPHA, X0 \ - MULPD BETA, X4 \ - ADDPD X0, X4 \ - MOVUPS X4, (Y_PTR) - -#define STORE2_INC \ - MOVSD (Y_PTR), X4 \ - MOVHPD (Y_PTR)(INC_Y*1), X4 \ - MULPD ALPHA, X0 \ - MULPD BETA, X4 \ - ADDPD X0, X4 \ - MOVSD X4, (Y_PTR) \ - MOVHPD X4, (Y_PTR)(INC_Y*1) - -#define KERNEL_1x4 \ - MOVUPS (A_PTR), X8 \ - MOVUPS 2*SIZE(A_PTR), X9 \ - MULPD X12, X8 \ - MULPD X13, X9 \ - ADDPD X8, X0 \ - ADDPD X9, X0 \ - ADDQ $4*SIZE, A_PTR - -#define KERNEL_1x2 \ - MOVUPS (A_PTR), X8 \ - MULPD X12, X8 \ - ADDPD X8, X0 \ - ADDQ $2*SIZE, A_PTR - -#define KERNEL_1x1 \ - MOVSD (X_PTR), X12 \ - MOVSD (A_PTR), X8 \ - MULSD X12, X8 \ - ADDSD X8, X0 \ - ADDQ $SIZE, A_PTR - -#define STORE1 \ - HADDPD X0, X0 \ - MOVSD (Y_PTR), X4 \ - MULSD ALPHA, X0 \ - MULSD BETA, X4 \ - ADDSD X0, X4 \ - MOVSD X4, (Y_PTR) - -// func GemvN(m, n int, -// alpha float64, -// a []float64, lda int, -// x []float64, incX int, -// beta float64, -// y []float64, incY int) -TEXT ·GemvN(SB), NOSPLIT, $32-128 - MOVQ M_DIM, M - MOVQ N_DIM, N - CMPQ M, $0 - JE end - CMPQ N, $0 - JE end - - MOVDDUP alpha+16(FP), ALPHA - MOVDDUP beta+88(FP), BETA - - MOVQ x_base+56(FP), X_PTR - MOVQ y_base+96(FP), Y_PTR - MOVQ a_base+24(FP), A_ROW - MOVQ incY+120(FP), INC_Y - MOVQ lda+48(FP), LDA // LDA = LDA * sizeof(float64) - SHLQ $3, LDA - LEAQ (LDA)(LDA*2), LDA3 // LDA3 = LDA * 3 - MOVQ A_ROW, A_PTR - - XORQ TMP2, TMP2 - MOVQ M, TMP1 - SUBQ $1, TMP1 - IMULQ INC_Y, TMP1 - NEGQ TMP1 - CMPQ INC_Y, $0 - CMOVQLT TMP1, TMP2 - LEAQ (Y_PTR)(TMP2*SIZE), Y_PTR - MOVQ Y_PTR, Y - - SHLQ $3, INC_Y // INC_Y = incY * sizeof(float64) - LEAQ (INC_Y)(INC_Y*2), INC3_Y // INC3_Y = INC_Y * 3 - - MOVSD $0.0, X0 - COMISD BETA, X0 - JNE gemv_start // if beta != 0 { goto gemv_start } - -gemv_clear: // beta == 0 is special cased to clear memory (no nan handling) - XORPS X0, X0 - XORPS X1, X1 - XORPS X2, X2 - XORPS X3, X3 - - CMPQ incY+120(FP), $1 // Check for dense vector X (fast-path) - JNE inc_clear - - SHRQ $3, M - JZ clear4 - -clear8: - MOVUPS X0, (Y_PTR) - MOVUPS X1, 16(Y_PTR) - MOVUPS X2, 32(Y_PTR) - MOVUPS X3, 48(Y_PTR) - ADDQ $8*SIZE, Y_PTR - DECQ M - JNZ clear8 - -clear4: - TESTQ $4, M_DIM - JZ clear2 - MOVUPS X0, (Y_PTR) - MOVUPS X1, 16(Y_PTR) - ADDQ $4*SIZE, Y_PTR - -clear2: - TESTQ $2, M_DIM - JZ clear1 - MOVUPS X0, (Y_PTR) - ADDQ $2*SIZE, Y_PTR - -clear1: - TESTQ $1, M_DIM - JZ prep_end - MOVSD X0, (Y_PTR) - - JMP prep_end - -inc_clear: - SHRQ $2, M - JZ inc_clear2 - -inc_clear4: - MOVSD X0, (Y_PTR) - MOVSD X1, (Y_PTR)(INC_Y*1) - MOVSD X2, (Y_PTR)(INC_Y*2) - MOVSD X3, (Y_PTR)(INC3_Y*1) - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - DECQ M - JNZ inc_clear4 - -inc_clear2: - TESTQ $2, M_DIM - JZ inc_clear1 - MOVSD X0, (Y_PTR) - MOVSD X1, (Y_PTR)(INC_Y*1) - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -inc_clear1: - TESTQ $1, M_DIM - JZ prep_end - MOVSD X0, (Y_PTR) - -prep_end: - MOVQ Y, Y_PTR - MOVQ M_DIM, M - -gemv_start: - CMPQ incX+80(FP), $1 // Check for dense vector X (fast-path) - JNE inc - - SHRQ $2, M - JZ r2 - -r4: - // LOAD 4 - INIT4 - - MOVQ N_DIM, N - SHRQ $2, N - JZ r4c2 - -r4c4: - // 4x4 KERNEL - KERNEL_LOAD4 - KERNEL_4x4 - - ADDQ $4*SIZE, X_PTR - - DECQ N - JNZ r4c4 - -r4c2: - TESTQ $2, N_DIM - JZ r4c1 - - // 4x2 KERNEL - KERNEL_LOAD2 - KERNEL_4x2 - - ADDQ $2*SIZE, X_PTR - -r4c1: - HADDPD X1, X0 - HADDPD X3, X2 - TESTQ $1, N_DIM - JZ r4end - - // 4x1 KERNEL - KERNEL_4x1 - - ADDQ $SIZE, X_PTR - -r4end: - CMPQ INC_Y, $SIZE - JNZ r4st_inc - - STORE4 - ADDQ $4*SIZE, Y_PTR - JMP r4inc - -r4st_inc: - STORE4_INC - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - -r4inc: - MOVQ X, X_PTR - LEAQ (A_ROW)(LDA*4), A_ROW - MOVQ A_ROW, A_PTR - - DECQ M - JNZ r4 - -r2: - TESTQ $2, M_DIM - JZ r1 - - // LOAD 2 - INIT2 - - MOVQ N_DIM, N - SHRQ $2, N - JZ r2c2 - -r2c4: - // 2x4 KERNEL - KERNEL_LOAD4 - KERNEL_2x4 - - ADDQ $4*SIZE, X_PTR - - DECQ N - JNZ r2c4 - -r2c2: - TESTQ $2, N_DIM - JZ r2c1 - - // 2x2 KERNEL - KERNEL_LOAD2 - KERNEL_2x2 - - ADDQ $2*SIZE, X_PTR - -r2c1: - HADDPD X1, X0 - TESTQ $1, N_DIM - JZ r2end - - // 2x1 KERNEL - KERNEL_2x1 - - ADDQ $SIZE, X_PTR - -r2end: - CMPQ INC_Y, $SIZE - JNE r2st_inc - - STORE2 - ADDQ $2*SIZE, Y_PTR - JMP r2inc - -r2st_inc: - STORE2_INC - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -r2inc: - MOVQ X, X_PTR - LEAQ (A_ROW)(LDA*2), A_ROW - MOVQ A_ROW, A_PTR - -r1: - TESTQ $1, M_DIM - JZ end - - // LOAD 1 - INIT1 - - MOVQ N_DIM, N - SHRQ $2, N - JZ r1c2 - -r1c4: - // 1x4 KERNEL - KERNEL_LOAD4 - KERNEL_1x4 - - ADDQ $4*SIZE, X_PTR - - DECQ N - JNZ r1c4 - -r1c2: - TESTQ $2, N_DIM - JZ r1c1 - - // 1x2 KERNEL - KERNEL_LOAD2 - KERNEL_1x2 - - ADDQ $2*SIZE, X_PTR - -r1c1: - - TESTQ $1, N_DIM - JZ r1end - - // 1x1 KERNEL - KERNEL_1x1 - -r1end: - STORE1 - -end: - RET - -inc: // Algorithm for incX != 1 ( split loads in kernel ) - MOVQ incX+80(FP), INC_X // INC_X = incX - - XORQ TMP2, TMP2 // TMP2 = 0 - MOVQ N, TMP1 // TMP1 = N - SUBQ $1, TMP1 // TMP1 -= 1 - NEGQ TMP1 // TMP1 = -TMP1 - IMULQ INC_X, TMP1 // TMP1 *= INC_X - CMPQ INC_X, $0 // if INC_X < 0 { TMP2 = TMP1 } - CMOVQLT TMP1, TMP2 - LEAQ (X_PTR)(TMP2*SIZE), X_PTR // X_PTR = X_PTR[TMP2] - MOVQ X_PTR, X // X = X_PTR - - SHLQ $3, INC_X - LEAQ (INC_X)(INC_X*2), INC3_X // INC3_X = INC_X * 3 - - SHRQ $2, M - JZ inc_r2 - -inc_r4: - // LOAD 4 - INIT4 - - MOVQ N_DIM, N - SHRQ $2, N - JZ inc_r4c2 - -inc_r4c4: - // 4x4 KERNEL - KERNEL_LOAD4_INC - KERNEL_4x4 - - LEAQ (X_PTR)(INC_X*4), X_PTR - - DECQ N - JNZ inc_r4c4 - -inc_r4c2: - TESTQ $2, N_DIM - JZ inc_r4c1 - - // 4x2 KERNEL - KERNEL_LOAD2_INC - KERNEL_4x2 - - LEAQ (X_PTR)(INC_X*2), X_PTR - -inc_r4c1: - HADDPD X1, X0 - HADDPD X3, X2 - TESTQ $1, N_DIM - JZ inc_r4end - - // 4x1 KERNEL - KERNEL_4x1 - - ADDQ INC_X, X_PTR - -inc_r4end: - CMPQ INC_Y, $SIZE - JNE inc_r4st_inc - - STORE4 - ADDQ $4*SIZE, Y_PTR - JMP inc_r4inc - -inc_r4st_inc: - STORE4_INC - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - -inc_r4inc: - MOVQ X, X_PTR - LEAQ (A_ROW)(LDA*4), A_ROW - MOVQ A_ROW, A_PTR - - DECQ M - JNZ inc_r4 - -inc_r2: - TESTQ $2, M_DIM - JZ inc_r1 - - // LOAD 2 - INIT2 - - MOVQ N_DIM, N - SHRQ $2, N - JZ inc_r2c2 - -inc_r2c4: - // 2x4 KERNEL - KERNEL_LOAD4_INC - KERNEL_2x4 - - LEAQ (X_PTR)(INC_X*4), X_PTR - DECQ N - JNZ inc_r2c4 - -inc_r2c2: - TESTQ $2, N_DIM - JZ inc_r2c1 - - // 2x2 KERNEL - KERNEL_LOAD2_INC - KERNEL_2x2 - - LEAQ (X_PTR)(INC_X*2), X_PTR - -inc_r2c1: - HADDPD X1, X0 - TESTQ $1, N_DIM - JZ inc_r2end - - // 2x1 KERNEL - KERNEL_2x1 - - ADDQ INC_X, X_PTR - -inc_r2end: - CMPQ INC_Y, $SIZE - JNE inc_r2st_inc - - STORE2 - ADDQ $2*SIZE, Y_PTR - JMP inc_r2inc - -inc_r2st_inc: - STORE2_INC - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -inc_r2inc: - MOVQ X, X_PTR - LEAQ (A_ROW)(LDA*2), A_ROW - MOVQ A_ROW, A_PTR - -inc_r1: - TESTQ $1, M_DIM - JZ inc_end - - // LOAD 1 - INIT1 - - MOVQ N_DIM, N - SHRQ $2, N - JZ inc_r1c2 - -inc_r1c4: - // 1x4 KERNEL - KERNEL_LOAD4_INC - KERNEL_1x4 - - LEAQ (X_PTR)(INC_X*4), X_PTR - DECQ N - JNZ inc_r1c4 - -inc_r1c2: - TESTQ $2, N_DIM - JZ inc_r1c1 - - // 1x2 KERNEL - KERNEL_LOAD2_INC - KERNEL_1x2 - - LEAQ (X_PTR)(INC_X*2), X_PTR - -inc_r1c1: - TESTQ $1, N_DIM - JZ inc_r1end - - // 1x1 KERNEL - KERNEL_1x1 - -inc_r1end: - STORE1 - -inc_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/gemvT_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/gemvT_amd64.s deleted file mode 100644 index 87a9445..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/gemvT_amd64.s +++ /dev/null @@ -1,745 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define SIZE 8 - -#define M_DIM n+8(FP) -#define M CX -#define N_DIM m+0(FP) -#define N BX - -#define TMP1 R14 -#define TMP2 R15 - -#define X_PTR SI -#define X x_base+56(FP) -#define Y_PTR DX -#define Y y_base+96(FP) -#define A_ROW AX -#define A_PTR DI - -#define INC_X R8 -#define INC3_X R9 - -#define INC_Y R10 -#define INC3_Y R11 - -#define LDA R12 -#define LDA3 R13 - -#define ALPHA X15 -#define BETA X14 - -#define INIT4 \ - MOVDDUP (X_PTR), X8 \ - MOVDDUP (X_PTR)(INC_X*1), X9 \ - MOVDDUP (X_PTR)(INC_X*2), X10 \ - MOVDDUP (X_PTR)(INC3_X*1), X11 \ - MULPD ALPHA, X8 \ - MULPD ALPHA, X9 \ - MULPD ALPHA, X10 \ - MULPD ALPHA, X11 - -#define INIT2 \ - MOVDDUP (X_PTR), X8 \ - MOVDDUP (X_PTR)(INC_X*1), X9 \ - MULPD ALPHA, X8 \ - MULPD ALPHA, X9 - -#define INIT1 \ - MOVDDUP (X_PTR), X8 \ - MULPD ALPHA, X8 - -#define KERNEL_LOAD4 \ - MOVUPS (Y_PTR), X0 \ - MOVUPS 2*SIZE(Y_PTR), X1 - -#define KERNEL_LOAD2 \ - MOVUPS (Y_PTR), X0 - -#define KERNEL_LOAD4_INC \ - MOVSD (Y_PTR), X0 \ - MOVHPD (Y_PTR)(INC_Y*1), X0 \ - MOVSD (Y_PTR)(INC_Y*2), X1 \ - MOVHPD (Y_PTR)(INC3_Y*1), X1 - -#define KERNEL_LOAD2_INC \ - MOVSD (Y_PTR), X0 \ - MOVHPD (Y_PTR)(INC_Y*1), X0 - -#define KERNEL_4x4 \ - MOVUPS (A_PTR), X4 \ - MOVUPS 2*SIZE(A_PTR), X5 \ - MOVUPS (A_PTR)(LDA*1), X6 \ - MOVUPS 2*SIZE(A_PTR)(LDA*1), X7 \ - MULPD X8, X4 \ - MULPD X8, X5 \ - MULPD X9, X6 \ - MULPD X9, X7 \ - ADDPD X4, X0 \ - ADDPD X5, X1 \ - ADDPD X6, X0 \ - ADDPD X7, X1 \ - MOVUPS (A_PTR)(LDA*2), X4 \ - MOVUPS 2*SIZE(A_PTR)(LDA*2), X5 \ - MOVUPS (A_PTR)(LDA3*1), X6 \ - MOVUPS 2*SIZE(A_PTR)(LDA3*1), X7 \ - MULPD X10, X4 \ - MULPD X10, X5 \ - MULPD X11, X6 \ - MULPD X11, X7 \ - ADDPD X4, X0 \ - ADDPD X5, X1 \ - ADDPD X6, X0 \ - ADDPD X7, X1 \ - ADDQ $4*SIZE, A_PTR - -#define KERNEL_4x2 \ - MOVUPS (A_PTR), X4 \ - MOVUPS 2*SIZE(A_PTR), X5 \ - MOVUPS (A_PTR)(LDA*1), X6 \ - MOVUPS 2*SIZE(A_PTR)(LDA*1), X7 \ - MULPD X8, X4 \ - MULPD X8, X5 \ - MULPD X9, X6 \ - MULPD X9, X7 \ - ADDPD X4, X0 \ - ADDPD X5, X1 \ - ADDPD X6, X0 \ - ADDPD X7, X1 \ - ADDQ $4*SIZE, A_PTR - -#define KERNEL_4x1 \ - MOVUPS (A_PTR), X4 \ - MOVUPS 2*SIZE(A_PTR), X5 \ - MULPD X8, X4 \ - MULPD X8, X5 \ - ADDPD X4, X0 \ - ADDPD X5, X1 \ - ADDQ $4*SIZE, A_PTR - -#define STORE4 \ - MOVUPS X0, (Y_PTR) \ - MOVUPS X1, 2*SIZE(Y_PTR) - -#define STORE4_INC \ - MOVLPD X0, (Y_PTR) \ - MOVHPD X0, (Y_PTR)(INC_Y*1) \ - MOVLPD X1, (Y_PTR)(INC_Y*2) \ - MOVHPD X1, (Y_PTR)(INC3_Y*1) - -#define KERNEL_2x4 \ - MOVUPS (A_PTR), X4 \ - MOVUPS (A_PTR)(LDA*1), X5 \ - MOVUPS (A_PTR)(LDA*2), X6 \ - MOVUPS (A_PTR)(LDA3*1), X7 \ - MULPD X8, X4 \ - MULPD X9, X5 \ - MULPD X10, X6 \ - MULPD X11, X7 \ - ADDPD X4, X0 \ - ADDPD X5, X0 \ - ADDPD X6, X0 \ - ADDPD X7, X0 \ - ADDQ $2*SIZE, A_PTR - -#define KERNEL_2x2 \ - MOVUPS (A_PTR), X4 \ - MOVUPS (A_PTR)(LDA*1), X5 \ - MULPD X8, X4 \ - MULPD X9, X5 \ - ADDPD X4, X0 \ - ADDPD X5, X0 \ - ADDQ $2*SIZE, A_PTR - -#define KERNEL_2x1 \ - MOVUPS (A_PTR), X4 \ - MULPD X8, X4 \ - ADDPD X4, X0 \ - ADDQ $2*SIZE, A_PTR - -#define STORE2 \ - MOVUPS X0, (Y_PTR) - -#define STORE2_INC \ - MOVLPD X0, (Y_PTR) \ - MOVHPD X0, (Y_PTR)(INC_Y*1) - -#define KERNEL_1x4 \ - MOVSD (Y_PTR), X0 \ - MOVSD (A_PTR), X4 \ - MOVSD (A_PTR)(LDA*1), X5 \ - MOVSD (A_PTR)(LDA*2), X6 \ - MOVSD (A_PTR)(LDA3*1), X7 \ - MULSD X8, X4 \ - MULSD X9, X5 \ - MULSD X10, X6 \ - MULSD X11, X7 \ - ADDSD X4, X0 \ - ADDSD X5, X0 \ - ADDSD X6, X0 \ - ADDSD X7, X0 \ - MOVSD X0, (Y_PTR) \ - ADDQ $SIZE, A_PTR - -#define KERNEL_1x2 \ - MOVSD (Y_PTR), X0 \ - MOVSD (A_PTR), X4 \ - MOVSD (A_PTR)(LDA*1), X5 \ - MULSD X8, X4 \ - MULSD X9, X5 \ - ADDSD X4, X0 \ - ADDSD X5, X0 \ - MOVSD X0, (Y_PTR) \ - ADDQ $SIZE, A_PTR - -#define KERNEL_1x1 \ - MOVSD (Y_PTR), X0 \ - MOVSD (A_PTR), X4 \ - MULSD X8, X4 \ - ADDSD X4, X0 \ - MOVSD X0, (Y_PTR) \ - ADDQ $SIZE, A_PTR - -#define SCALE_8(PTR, SCAL) \ - MOVUPS (PTR), X0 \ - MOVUPS 16(PTR), X1 \ - MOVUPS 32(PTR), X2 \ - MOVUPS 48(PTR), X3 \ - MULPD SCAL, X0 \ - MULPD SCAL, X1 \ - MULPD SCAL, X2 \ - MULPD SCAL, X3 \ - MOVUPS X0, (PTR) \ - MOVUPS X1, 16(PTR) \ - MOVUPS X2, 32(PTR) \ - MOVUPS X3, 48(PTR) - -#define SCALE_4(PTR, SCAL) \ - MOVUPS (PTR), X0 \ - MOVUPS 16(PTR), X1 \ - MULPD SCAL, X0 \ - MULPD SCAL, X1 \ - MOVUPS X0, (PTR) \ - MOVUPS X1, 16(PTR) \ - -#define SCALE_2(PTR, SCAL) \ - MOVUPS (PTR), X0 \ - MULPD SCAL, X0 \ - MOVUPS X0, (PTR) \ - -#define SCALE_1(PTR, SCAL) \ - MOVSD (PTR), X0 \ - MULSD SCAL, X0 \ - MOVSD X0, (PTR) \ - -#define SCALEINC_4(PTR, INC, INC3, SCAL) \ - MOVSD (PTR), X0 \ - MOVSD (PTR)(INC*1), X1 \ - MOVSD (PTR)(INC*2), X2 \ - MOVSD (PTR)(INC3*1), X3 \ - MULSD SCAL, X0 \ - MULSD SCAL, X1 \ - MULSD SCAL, X2 \ - MULSD SCAL, X3 \ - MOVSD X0, (PTR) \ - MOVSD X1, (PTR)(INC*1) \ - MOVSD X2, (PTR)(INC*2) \ - MOVSD X3, (PTR)(INC3*1) - -#define SCALEINC_2(PTR, INC, SCAL) \ - MOVSD (PTR), X0 \ - MOVSD (PTR)(INC*1), X1 \ - MULSD SCAL, X0 \ - MULSD SCAL, X1 \ - MOVSD X0, (PTR) \ - MOVSD X1, (PTR)(INC*1) - -// func GemvT(m, n int, -// alpha float64, -// a []float64, lda int, -// x []float64, incX int, -// beta float64, -// y []float64, incY int) -TEXT ·GemvT(SB), NOSPLIT, $32-128 - MOVQ M_DIM, M - MOVQ N_DIM, N - CMPQ M, $0 - JE end - CMPQ N, $0 - JE end - - MOVDDUP alpha+16(FP), ALPHA - - MOVQ x_base+56(FP), X_PTR - MOVQ y_base+96(FP), Y_PTR - MOVQ a_base+24(FP), A_ROW - MOVQ incY+120(FP), INC_Y // INC_Y = incY * sizeof(float64) - MOVQ lda+48(FP), LDA // LDA = LDA * sizeof(float64) - SHLQ $3, LDA - LEAQ (LDA)(LDA*2), LDA3 // LDA3 = LDA * 3 - MOVQ A_ROW, A_PTR - - MOVQ incX+80(FP), INC_X // INC_X = incX * sizeof(float64) - - XORQ TMP2, TMP2 - MOVQ N, TMP1 - SUBQ $1, TMP1 - NEGQ TMP1 - IMULQ INC_X, TMP1 - CMPQ INC_X, $0 - CMOVQLT TMP1, TMP2 - LEAQ (X_PTR)(TMP2*SIZE), X_PTR - MOVQ X_PTR, X - - SHLQ $3, INC_X - LEAQ (INC_X)(INC_X*2), INC3_X // INC3_X = INC_X * 3 - - CMPQ incY+120(FP), $1 // Check for dense vector Y (fast-path) - JNE inc - - MOVSD $1.0, X0 - COMISD beta+88(FP), X0 - JE gemv_start - - MOVSD $0.0, X0 - COMISD beta+88(FP), X0 - JE gemv_clear - - MOVDDUP beta+88(FP), BETA - SHRQ $3, M - JZ scal4 - -scal8: - SCALE_8(Y_PTR, BETA) - ADDQ $8*SIZE, Y_PTR - DECQ M - JNZ scal8 - -scal4: - TESTQ $4, M_DIM - JZ scal2 - SCALE_4(Y_PTR, BETA) - ADDQ $4*SIZE, Y_PTR - -scal2: - TESTQ $2, M_DIM - JZ scal1 - SCALE_2(Y_PTR, BETA) - ADDQ $2*SIZE, Y_PTR - -scal1: - TESTQ $1, M_DIM - JZ prep_end - SCALE_1(Y_PTR, BETA) - - JMP prep_end - -gemv_clear: // beta == 0 is special cased to clear memory (no nan handling) - XORPS X0, X0 - XORPS X1, X1 - XORPS X2, X2 - XORPS X3, X3 - - SHRQ $3, M - JZ clear4 - -clear8: - MOVUPS X0, (Y_PTR) - MOVUPS X1, 16(Y_PTR) - MOVUPS X2, 32(Y_PTR) - MOVUPS X3, 48(Y_PTR) - ADDQ $8*SIZE, Y_PTR - DECQ M - JNZ clear8 - -clear4: - TESTQ $4, M_DIM - JZ clear2 - MOVUPS X0, (Y_PTR) - MOVUPS X1, 16(Y_PTR) - ADDQ $4*SIZE, Y_PTR - -clear2: - TESTQ $2, M_DIM - JZ clear1 - MOVUPS X0, (Y_PTR) - ADDQ $2*SIZE, Y_PTR - -clear1: - TESTQ $1, M_DIM - JZ prep_end - MOVSD X0, (Y_PTR) - -prep_end: - MOVQ Y, Y_PTR - MOVQ M_DIM, M - -gemv_start: - SHRQ $2, N - JZ c2 - -c4: - // LOAD 4 - INIT4 - - MOVQ M_DIM, M - SHRQ $2, M - JZ c4r2 - -c4r4: - // 4x4 KERNEL - KERNEL_LOAD4 - KERNEL_4x4 - STORE4 - - ADDQ $4*SIZE, Y_PTR - - DECQ M - JNZ c4r4 - -c4r2: - TESTQ $2, M_DIM - JZ c4r1 - - // 4x2 KERNEL - KERNEL_LOAD2 - KERNEL_2x4 - STORE2 - - ADDQ $2*SIZE, Y_PTR - -c4r1: - TESTQ $1, M_DIM - JZ c4end - - // 4x1 KERNEL - KERNEL_1x4 - - ADDQ $SIZE, Y_PTR - -c4end: - LEAQ (X_PTR)(INC_X*4), X_PTR - MOVQ Y, Y_PTR - LEAQ (A_ROW)(LDA*4), A_ROW - MOVQ A_ROW, A_PTR - - DECQ N - JNZ c4 - -c2: - TESTQ $2, N_DIM - JZ c1 - - // LOAD 2 - INIT2 - - MOVQ M_DIM, M - SHRQ $2, M - JZ c2r2 - -c2r4: - // 2x4 KERNEL - KERNEL_LOAD4 - KERNEL_4x2 - STORE4 - - ADDQ $4*SIZE, Y_PTR - - DECQ M - JNZ c2r4 - -c2r2: - TESTQ $2, M_DIM - JZ c2r1 - - // 2x2 KERNEL - KERNEL_LOAD2 - KERNEL_2x2 - STORE2 - - ADDQ $2*SIZE, Y_PTR - -c2r1: - TESTQ $1, M_DIM - JZ c2end - - // 2x1 KERNEL - KERNEL_1x2 - - ADDQ $SIZE, Y_PTR - -c2end: - LEAQ (X_PTR)(INC_X*2), X_PTR - MOVQ Y, Y_PTR - LEAQ (A_ROW)(LDA*2), A_ROW - MOVQ A_ROW, A_PTR - -c1: - TESTQ $1, N_DIM - JZ end - - // LOAD 1 - INIT1 - - MOVQ M_DIM, M - SHRQ $2, M - JZ c1r2 - -c1r4: - // 1x4 KERNEL - KERNEL_LOAD4 - KERNEL_4x1 - STORE4 - - ADDQ $4*SIZE, Y_PTR - - DECQ M - JNZ c1r4 - -c1r2: - TESTQ $2, M_DIM - JZ c1r1 - - // 1x2 KERNEL - KERNEL_LOAD2 - KERNEL_2x1 - STORE2 - - ADDQ $2*SIZE, Y_PTR - -c1r1: - TESTQ $1, M_DIM - JZ end - - // 1x1 KERNEL - KERNEL_1x1 - -end: - RET - -inc: // Algorithm for incX != 0 ( split loads in kernel ) - XORQ TMP2, TMP2 - MOVQ M, TMP1 - SUBQ $1, TMP1 - IMULQ INC_Y, TMP1 - NEGQ TMP1 - CMPQ INC_Y, $0 - CMOVQLT TMP1, TMP2 - LEAQ (Y_PTR)(TMP2*SIZE), Y_PTR - MOVQ Y_PTR, Y - - SHLQ $3, INC_Y - LEAQ (INC_Y)(INC_Y*2), INC3_Y // INC3_Y = INC_Y * 3 - - MOVSD $1.0, X0 - COMISD beta+88(FP), X0 - JE inc_gemv_start - - MOVSD $0.0, X0 - COMISD beta+88(FP), X0 - JE inc_gemv_clear - - MOVDDUP beta+88(FP), BETA - SHRQ $2, M - JZ inc_scal2 - -inc_scal4: - SCALEINC_4(Y_PTR, INC_Y, INC3_Y, BETA) - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - DECQ M - JNZ inc_scal4 - -inc_scal2: - TESTQ $2, M_DIM - JZ inc_scal1 - - SCALEINC_2(Y_PTR, INC_Y, BETA) - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -inc_scal1: - TESTQ $1, M_DIM - JZ inc_prep_end - SCALE_1(Y_PTR, BETA) - - JMP inc_prep_end - -inc_gemv_clear: // beta == 0 is special-cased to clear memory (no nan handling) - XORPS X0, X0 - XORPS X1, X1 - XORPS X2, X2 - XORPS X3, X3 - - SHRQ $2, M - JZ inc_clear2 - -inc_clear4: - MOVSD X0, (Y_PTR) - MOVSD X1, (Y_PTR)(INC_Y*1) - MOVSD X2, (Y_PTR)(INC_Y*2) - MOVSD X3, (Y_PTR)(INC3_Y*1) - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - DECQ M - JNZ inc_clear4 - -inc_clear2: - TESTQ $2, M_DIM - JZ inc_clear1 - MOVSD X0, (Y_PTR) - MOVSD X1, (Y_PTR)(INC_Y*1) - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -inc_clear1: - TESTQ $1, M_DIM - JZ inc_prep_end - MOVSD X0, (Y_PTR) - -inc_prep_end: - MOVQ Y, Y_PTR - MOVQ M_DIM, M - -inc_gemv_start: - SHRQ $2, N - JZ inc_c2 - -inc_c4: - // LOAD 4 - INIT4 - - MOVQ M_DIM, M - SHRQ $2, M - JZ inc_c4r2 - -inc_c4r4: - // 4x4 KERNEL - KERNEL_LOAD4_INC - KERNEL_4x4 - STORE4_INC - - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - - DECQ M - JNZ inc_c4r4 - -inc_c4r2: - TESTQ $2, M_DIM - JZ inc_c4r1 - - // 4x2 KERNEL - KERNEL_LOAD2_INC - KERNEL_2x4 - STORE2_INC - - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -inc_c4r1: - TESTQ $1, M_DIM - JZ inc_c4end - - // 4x1 KERNEL - KERNEL_1x4 - - ADDQ INC_Y, Y_PTR - -inc_c4end: - LEAQ (X_PTR)(INC_X*4), X_PTR - MOVQ Y, Y_PTR - LEAQ (A_ROW)(LDA*4), A_ROW - MOVQ A_ROW, A_PTR - - DECQ N - JNZ inc_c4 - -inc_c2: - TESTQ $2, N_DIM - JZ inc_c1 - - // LOAD 2 - INIT2 - - MOVQ M_DIM, M - SHRQ $2, M - JZ inc_c2r2 - -inc_c2r4: - // 2x4 KERNEL - KERNEL_LOAD4_INC - KERNEL_4x2 - STORE4_INC - - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - DECQ M - JNZ inc_c2r4 - -inc_c2r2: - TESTQ $2, M_DIM - JZ inc_c2r1 - - // 2x2 KERNEL - KERNEL_LOAD2_INC - KERNEL_2x2 - STORE2_INC - - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -inc_c2r1: - TESTQ $1, M_DIM - JZ inc_c2end - - // 2x1 KERNEL - KERNEL_1x2 - - ADDQ INC_Y, Y_PTR - -inc_c2end: - LEAQ (X_PTR)(INC_X*2), X_PTR - MOVQ Y, Y_PTR - LEAQ (A_ROW)(LDA*2), A_ROW - MOVQ A_ROW, A_PTR - -inc_c1: - TESTQ $1, N_DIM - JZ inc_end - - // LOAD 1 - INIT1 - - MOVQ M_DIM, M - SHRQ $2, M - JZ inc_c1r2 - -inc_c1r4: - // 1x4 KERNEL - KERNEL_LOAD4_INC - KERNEL_4x1 - STORE4_INC - - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - DECQ M - JNZ inc_c1r4 - -inc_c1r2: - TESTQ $2, M_DIM - JZ inc_c1r1 - - // 1x2 KERNEL - KERNEL_LOAD2_INC - KERNEL_2x1 - STORE2_INC - - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -inc_c1r1: - TESTQ $1, M_DIM - JZ inc_end - - // 1x1 KERNEL - KERNEL_1x1 - -inc_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/ger_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/ger_amd64.s deleted file mode 100644 index 7ae5cf7..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/ger_amd64.s +++ /dev/null @@ -1,591 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define SIZE 8 - -#define M_DIM m+0(FP) -#define M CX -#define N_DIM n+8(FP) -#define N BX - -#define TMP1 R14 -#define TMP2 R15 - -#define X_PTR SI -#define Y y_base+56(FP) -#define Y_PTR DX -#define A_ROW AX -#define A_PTR DI - -#define INC_X R8 -#define INC3_X R9 - -#define INC_Y R10 -#define INC3_Y R11 - -#define LDA R12 -#define LDA3 R13 - -#define ALPHA X0 - -#define LOAD4 \ - PREFETCHNTA (X_PTR )(INC_X*8) \ - MOVDDUP (X_PTR), X1 \ - MOVDDUP (X_PTR)(INC_X*1), X2 \ - MOVDDUP (X_PTR)(INC_X*2), X3 \ - MOVDDUP (X_PTR)(INC3_X*1), X4 \ - MULPD ALPHA, X1 \ - MULPD ALPHA, X2 \ - MULPD ALPHA, X3 \ - MULPD ALPHA, X4 - -#define LOAD2 \ - MOVDDUP (X_PTR), X1 \ - MOVDDUP (X_PTR)(INC_X*1), X2 \ - MULPD ALPHA, X1 \ - MULPD ALPHA, X2 - -#define LOAD1 \ - MOVDDUP (X_PTR), X1 \ - MULPD ALPHA, X1 - -#define KERNEL_LOAD4 \ - MOVUPS (Y_PTR), X5 \ - MOVUPS 2*SIZE(Y_PTR), X6 - -#define KERNEL_LOAD4_INC \ - MOVLPD (Y_PTR), X5 \ - MOVHPD (Y_PTR)(INC_Y*1), X5 \ - MOVLPD (Y_PTR)(INC_Y*2), X6 \ - MOVHPD (Y_PTR)(INC3_Y*1), X6 - -#define KERNEL_LOAD2 \ - MOVUPS (Y_PTR), X5 - -#define KERNEL_LOAD2_INC \ - MOVLPD (Y_PTR), X5 \ - MOVHPD (Y_PTR)(INC_Y*1), X5 - -#define KERNEL_4x4 \ - MOVUPS X5, X7 \ - MOVUPS X6, X8 \ - MOVUPS X5, X9 \ - MOVUPS X6, X10 \ - MOVUPS X5, X11 \ - MOVUPS X6, X12 \ - MULPD X1, X5 \ - MULPD X1, X6 \ - MULPD X2, X7 \ - MULPD X2, X8 \ - MULPD X3, X9 \ - MULPD X3, X10 \ - MULPD X4, X11 \ - MULPD X4, X12 - -#define STORE_4x4 \ - MOVUPS (A_PTR), X13 \ - ADDPD X13, X5 \ - MOVUPS 2*SIZE(A_PTR), X14 \ - ADDPD X14, X6 \ - MOVUPS (A_PTR)(LDA*1), X15 \ - ADDPD X15, X7 \ - MOVUPS 2*SIZE(A_PTR)(LDA*1), X0 \ - ADDPD X0, X8 \ - MOVUPS (A_PTR)(LDA*2), X13 \ - ADDPD X13, X9 \ - MOVUPS 2*SIZE(A_PTR)(LDA*2), X14 \ - ADDPD X14, X10 \ - MOVUPS (A_PTR)(LDA3*1), X15 \ - ADDPD X15, X11 \ - MOVUPS 2*SIZE(A_PTR)(LDA3*1), X0 \ - ADDPD X0, X12 \ - MOVUPS X5, (A_PTR) \ - MOVUPS X6, 2*SIZE(A_PTR) \ - MOVUPS X7, (A_PTR)(LDA*1) \ - MOVUPS X8, 2*SIZE(A_PTR)(LDA*1) \ - MOVUPS X9, (A_PTR)(LDA*2) \ - MOVUPS X10, 2*SIZE(A_PTR)(LDA*2) \ - MOVUPS X11, (A_PTR)(LDA3*1) \ - MOVUPS X12, 2*SIZE(A_PTR)(LDA3*1) \ - ADDQ $4*SIZE, A_PTR - -#define KERNEL_4x2 \ - MOVUPS X5, X6 \ - MOVUPS X5, X7 \ - MOVUPS X5, X8 \ - MULPD X1, X5 \ - MULPD X2, X6 \ - MULPD X3, X7 \ - MULPD X4, X8 - -#define STORE_4x2 \ - MOVUPS (A_PTR), X9 \ - ADDPD X9, X5 \ - MOVUPS (A_PTR)(LDA*1), X10 \ - ADDPD X10, X6 \ - MOVUPS (A_PTR)(LDA*2), X11 \ - ADDPD X11, X7 \ - MOVUPS (A_PTR)(LDA3*1), X12 \ - ADDPD X12, X8 \ - MOVUPS X5, (A_PTR) \ - MOVUPS X6, (A_PTR)(LDA*1) \ - MOVUPS X7, (A_PTR)(LDA*2) \ - MOVUPS X8, (A_PTR)(LDA3*1) \ - ADDQ $2*SIZE, A_PTR - -#define KERNEL_4x1 \ - MOVSD (Y_PTR), X5 \ - MOVSD X5, X6 \ - MOVSD X5, X7 \ - MOVSD X5, X8 \ - MULSD X1, X5 \ - MULSD X2, X6 \ - MULSD X3, X7 \ - MULSD X4, X8 - -#define STORE_4x1 \ - ADDSD (A_PTR), X5 \ - ADDSD (A_PTR)(LDA*1), X6 \ - ADDSD (A_PTR)(LDA*2), X7 \ - ADDSD (A_PTR)(LDA3*1), X8 \ - MOVSD X5, (A_PTR) \ - MOVSD X6, (A_PTR)(LDA*1) \ - MOVSD X7, (A_PTR)(LDA*2) \ - MOVSD X8, (A_PTR)(LDA3*1) \ - ADDQ $SIZE, A_PTR - -#define KERNEL_2x4 \ - MOVUPS X5, X7 \ - MOVUPS X6, X8 \ - MULPD X1, X5 \ - MULPD X1, X6 \ - MULPD X2, X7 \ - MULPD X2, X8 - -#define STORE_2x4 \ - MOVUPS (A_PTR), X9 \ - ADDPD X9, X5 \ - MOVUPS 2*SIZE(A_PTR), X10 \ - ADDPD X10, X6 \ - MOVUPS (A_PTR)(LDA*1), X11 \ - ADDPD X11, X7 \ - MOVUPS 2*SIZE(A_PTR)(LDA*1), X12 \ - ADDPD X12, X8 \ - MOVUPS X5, (A_PTR) \ - MOVUPS X6, 2*SIZE(A_PTR) \ - MOVUPS X7, (A_PTR)(LDA*1) \ - MOVUPS X8, 2*SIZE(A_PTR)(LDA*1) \ - ADDQ $4*SIZE, A_PTR - -#define KERNEL_2x2 \ - MOVUPS X5, X6 \ - MULPD X1, X5 \ - MULPD X2, X6 - -#define STORE_2x2 \ - MOVUPS (A_PTR), X7 \ - ADDPD X7, X5 \ - MOVUPS (A_PTR)(LDA*1), X8 \ - ADDPD X8, X6 \ - MOVUPS X5, (A_PTR) \ - MOVUPS X6, (A_PTR)(LDA*1) \ - ADDQ $2*SIZE, A_PTR - -#define KERNEL_2x1 \ - MOVSD (Y_PTR), X5 \ - MOVSD X5, X6 \ - MULSD X1, X5 \ - MULSD X2, X6 - -#define STORE_2x1 \ - ADDSD (A_PTR), X5 \ - ADDSD (A_PTR)(LDA*1), X6 \ - MOVSD X5, (A_PTR) \ - MOVSD X6, (A_PTR)(LDA*1) \ - ADDQ $SIZE, A_PTR - -#define KERNEL_1x4 \ - MULPD X1, X5 \ - MULPD X1, X6 - -#define STORE_1x4 \ - MOVUPS (A_PTR), X7 \ - ADDPD X7, X5 \ - MOVUPS 2*SIZE(A_PTR), X8 \ - ADDPD X8, X6 \ - MOVUPS X5, (A_PTR) \ - MOVUPS X6, 2*SIZE(A_PTR) \ - ADDQ $4*SIZE, A_PTR - -#define KERNEL_1x2 \ - MULPD X1, X5 - -#define STORE_1x2 \ - MOVUPS (A_PTR), X6 \ - ADDPD X6, X5 \ - MOVUPS X5, (A_PTR) \ - ADDQ $2*SIZE, A_PTR - -#define KERNEL_1x1 \ - MOVSD (Y_PTR), X5 \ - MULSD X1, X5 - -#define STORE_1x1 \ - ADDSD (A_PTR), X5 \ - MOVSD X5, (A_PTR) \ - ADDQ $SIZE, A_PTR - -// func Ger(m, n uintptr, alpha float64, -// x []float64, incX uintptr, -// y []float64, incY uintptr, -// a []float64, lda uintptr) -TEXT ·Ger(SB), NOSPLIT, $0 - MOVQ M_DIM, M - MOVQ N_DIM, N - CMPQ M, $0 - JE end - CMPQ N, $0 - JE end - - MOVDDUP alpha+16(FP), ALPHA - - MOVQ x_base+24(FP), X_PTR - MOVQ y_base+56(FP), Y_PTR - MOVQ a_base+88(FP), A_ROW - MOVQ incX+48(FP), INC_X // INC_X = incX * sizeof(float64) - SHLQ $3, INC_X - MOVQ lda+112(FP), LDA // LDA = LDA * sizeof(float64) - SHLQ $3, LDA - LEAQ (LDA)(LDA*2), LDA3 // LDA3 = LDA * 3 - LEAQ (INC_X)(INC_X*2), INC3_X // INC3_X = INC_X * 3 - MOVQ A_ROW, A_PTR - - XORQ TMP2, TMP2 - MOVQ M, TMP1 - SUBQ $1, TMP1 - IMULQ INC_X, TMP1 - NEGQ TMP1 - CMPQ INC_X, $0 - CMOVQLT TMP1, TMP2 - LEAQ (X_PTR)(TMP2*SIZE), X_PTR - - CMPQ incY+80(FP), $1 // Check for dense vector Y (fast-path) - JG inc - JL end - - SHRQ $2, M - JZ r2 - -r4: - // LOAD 4 - LOAD4 - - MOVQ N_DIM, N - SHRQ $2, N - JZ r4c2 - -r4c4: - // 4x4 KERNEL - KERNEL_LOAD4 - KERNEL_4x4 - STORE_4x4 - - ADDQ $4*SIZE, Y_PTR - - DECQ N - JNZ r4c4 - - // Reload ALPHA after it's clobbered by STORE_4x4 - MOVDDUP alpha+16(FP), ALPHA - -r4c2: - TESTQ $2, N_DIM - JZ r4c1 - - // 4x2 KERNEL - KERNEL_LOAD2 - KERNEL_4x2 - STORE_4x2 - - ADDQ $2*SIZE, Y_PTR - -r4c1: - TESTQ $1, N_DIM - JZ r4end - - // 4x1 KERNEL - KERNEL_4x1 - STORE_4x1 - - ADDQ $SIZE, Y_PTR - -r4end: - LEAQ (X_PTR)(INC_X*4), X_PTR - MOVQ Y, Y_PTR - LEAQ (A_ROW)(LDA*4), A_ROW - MOVQ A_ROW, A_PTR - - DECQ M - JNZ r4 - -r2: - TESTQ $2, M_DIM - JZ r1 - - // LOAD 2 - LOAD2 - - MOVQ N_DIM, N - SHRQ $2, N - JZ r2c2 - -r2c4: - // 2x4 KERNEL - KERNEL_LOAD4 - KERNEL_2x4 - STORE_2x4 - - ADDQ $4*SIZE, Y_PTR - - DECQ N - JNZ r2c4 - -r2c2: - TESTQ $2, N_DIM - JZ r2c1 - - // 2x2 KERNEL - KERNEL_LOAD2 - KERNEL_2x2 - STORE_2x2 - - ADDQ $2*SIZE, Y_PTR - -r2c1: - TESTQ $1, N_DIM - JZ r2end - - // 2x1 KERNEL - KERNEL_2x1 - STORE_2x1 - - ADDQ $SIZE, Y_PTR - -r2end: - LEAQ (X_PTR)(INC_X*2), X_PTR - MOVQ Y, Y_PTR - LEAQ (A_ROW)(LDA*2), A_ROW - MOVQ A_ROW, A_PTR - -r1: - TESTQ $1, M_DIM - JZ end - - // LOAD 1 - LOAD1 - - MOVQ N_DIM, N - SHRQ $2, N - JZ r1c2 - -r1c4: - // 1x4 KERNEL - KERNEL_LOAD4 - KERNEL_1x4 - STORE_1x4 - - ADDQ $4*SIZE, Y_PTR - - DECQ N - JNZ r1c4 - -r1c2: - TESTQ $2, N_DIM - JZ r1c1 - - // 1x2 KERNEL - KERNEL_LOAD2 - KERNEL_1x2 - STORE_1x2 - - ADDQ $2*SIZE, Y_PTR - -r1c1: - TESTQ $1, N_DIM - JZ end - - // 1x1 KERNEL - KERNEL_1x1 - STORE_1x1 - - ADDQ $SIZE, Y_PTR - -end: - RET - -inc: // Algorithm for incY != 1 ( split loads in kernel ) - - MOVQ incY+80(FP), INC_Y // INC_Y = incY * sizeof(float64) - SHLQ $3, INC_Y - LEAQ (INC_Y)(INC_Y*2), INC3_Y // INC3_Y = INC_Y * 3 - - XORQ TMP2, TMP2 - MOVQ N, TMP1 - SUBQ $1, TMP1 - IMULQ INC_Y, TMP1 - NEGQ TMP1 - CMPQ INC_Y, $0 - CMOVQLT TMP1, TMP2 - LEAQ (Y_PTR)(TMP2*SIZE), Y_PTR - - SHRQ $2, M - JZ inc_r2 - -inc_r4: - // LOAD 4 - LOAD4 - - MOVQ N_DIM, N - SHRQ $2, N - JZ inc_r4c2 - -inc_r4c4: - // 4x4 KERNEL - KERNEL_LOAD4_INC - KERNEL_4x4 - STORE_4x4 - - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - DECQ N - JNZ inc_r4c4 - - // Reload ALPHA after it's clobbered by STORE_4x4 - MOVDDUP alpha+16(FP), ALPHA - -inc_r4c2: - TESTQ $2, N_DIM - JZ inc_r4c1 - - // 4x2 KERNEL - KERNEL_LOAD2_INC - KERNEL_4x2 - STORE_4x2 - - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -inc_r4c1: - TESTQ $1, N_DIM - JZ inc_r4end - - // 4x1 KERNEL - KERNEL_4x1 - STORE_4x1 - - ADDQ INC_Y, Y_PTR - -inc_r4end: - LEAQ (X_PTR)(INC_X*4), X_PTR - MOVQ Y, Y_PTR - LEAQ (A_ROW)(LDA*4), A_ROW - MOVQ A_ROW, A_PTR - - DECQ M - JNZ inc_r4 - -inc_r2: - TESTQ $2, M_DIM - JZ inc_r1 - - // LOAD 2 - LOAD2 - - MOVQ N_DIM, N - SHRQ $2, N - JZ inc_r2c2 - -inc_r2c4: - // 2x4 KERNEL - KERNEL_LOAD4_INC - KERNEL_2x4 - STORE_2x4 - - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - DECQ N - JNZ inc_r2c4 - -inc_r2c2: - TESTQ $2, N_DIM - JZ inc_r2c1 - - // 2x2 KERNEL - KERNEL_LOAD2_INC - KERNEL_2x2 - STORE_2x2 - - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -inc_r2c1: - TESTQ $1, N_DIM - JZ inc_r2end - - // 2x1 KERNEL - KERNEL_2x1 - STORE_2x1 - - ADDQ INC_Y, Y_PTR - -inc_r2end: - LEAQ (X_PTR)(INC_X*2), X_PTR - MOVQ Y, Y_PTR - LEAQ (A_ROW)(LDA*2), A_ROW - MOVQ A_ROW, A_PTR - -inc_r1: - TESTQ $1, M_DIM - JZ end - - // LOAD 1 - LOAD1 - - MOVQ N_DIM, N - SHRQ $2, N - JZ inc_r1c2 - -inc_r1c4: - // 1x4 KERNEL - KERNEL_LOAD4_INC - KERNEL_1x4 - STORE_1x4 - - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - DECQ N - JNZ inc_r1c4 - -inc_r1c2: - TESTQ $2, N_DIM - JZ inc_r1c1 - - // 1x2 KERNEL - KERNEL_LOAD2_INC - KERNEL_1x2 - STORE_1x2 - - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -inc_r1c1: - TESTQ $1, N_DIM - JZ end - - // 1x1 KERNEL - KERNEL_1x1 - STORE_1x1 - - ADDQ INC_Y, Y_PTR - -inc_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/l1norm_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/l1norm_amd64.s deleted file mode 100644 index f87f856..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/l1norm_amd64.s +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// func L1Dist(s, t []float64) float64 -TEXT ·L1Dist(SB), NOSPLIT, $0 - MOVQ s_base+0(FP), DI // DI = &s - MOVQ t_base+24(FP), SI // SI = &t - MOVQ s_len+8(FP), CX // CX = len(s) - CMPQ t_len+32(FP), CX // CX = max( CX, len(t) ) - CMOVQLE t_len+32(FP), CX - PXOR X3, X3 // norm = 0 - CMPQ CX, $0 // if CX == 0 { return 0 } - JE l1_end - XORQ AX, AX // i = 0 - MOVQ CX, BX - ANDQ $1, BX // BX = CX % 2 - SHRQ $1, CX // CX = floor( CX / 2 ) - JZ l1_tail_start // if CX == 0 { return 0 } - -l1_loop: // Loop unrolled 2x do { - MOVUPS (SI)(AX*8), X0 // X0 = t[i:i+1] - MOVUPS (DI)(AX*8), X1 // X1 = s[i:i+1] - MOVAPS X0, X2 - SUBPD X1, X0 - SUBPD X2, X1 - MAXPD X1, X0 // X0 = max( X0 - X1, X1 - X0 ) - ADDPD X0, X3 // norm += X0 - ADDQ $2, AX // i += 2 - LOOP l1_loop // } while --CX > 0 - CMPQ BX, $0 // if BX == 0 { return } - JE l1_end - -l1_tail_start: // Reset loop registers - MOVQ BX, CX // Loop counter: CX = BX - PXOR X0, X0 // reset X0, X1 to break dependencies - PXOR X1, X1 - -l1_tail: - MOVSD (SI)(AX*8), X0 // X0 = t[i] - MOVSD (DI)(AX*8), X1 // x1 = s[i] - MOVAPD X0, X2 - SUBSD X1, X0 - SUBSD X2, X1 - MAXSD X1, X0 // X0 = max( X0 - X1, X1 - X0 ) - ADDSD X0, X3 // norm += X0 - -l1_end: - MOVAPS X3, X2 - SHUFPD $1, X2, X2 - ADDSD X3, X2 // X2 = X3[1] + X3[0] - MOVSD X2, ret+48(FP) // return X2 - RET - diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/l2norm_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/l2norm_amd64.s deleted file mode 100644 index f454f75..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/l2norm_amd64.s +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright ©2019 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define SUMSQ X0 -#define ABSX X1 -#define SCALE X2 -#define ZERO X3 -#define TMP X4 -#define ABSMASK X5 -#define INF X7 -#define INFMASK X11 -#define NANMASK X12 -#define IDX AX -#define LEN SI -#define X_ DI - -#define ABSMASK_DATA l2nrodata<>+0(SB) -#define INF_DATA l2nrodata<>+8(SB) -#define NAN_DATA l2nrodata<>+16(SB) -// AbsMask -DATA l2nrodata<>+0(SB)/8, $0x7FFFFFFFFFFFFFFF -// Inf -DATA l2nrodata<>+8(SB)/8, $0x7FF0000000000000 -// NaN -DATA l2nrodata<>+16(SB)/8, $0xFFF8000000000000 -GLOBL l2nrodata<>+0(SB), RODATA, $24 - -// L2NormUnitary returns the L2-norm of x. -// func L2NormUnitary(x []float64) (norm float64) -TEXT ·L2NormUnitary(SB), NOSPLIT, $0 - MOVQ x_len+8(FP), LEN // LEN = len(x) - MOVQ x_base+0(FP), X_ - PXOR ZERO, ZERO - CMPQ LEN, $0 // if LEN == 0 { return 0 } - JZ retZero - - PXOR INFMASK, INFMASK - PXOR NANMASK, NANMASK - MOVSD $1.0, SUMSQ // ssq = 1 - XORPS SCALE, SCALE - MOVSD ABSMASK_DATA, ABSMASK - MOVSD INF_DATA, INF - XORQ IDX, IDX // idx == 0 - -initZero: // for ;x[i]==0; i++ {} - // Skip all leading zeros, to avoid divide by zero NaN - MOVSD (X_)(IDX*8), ABSX // absxi = x[i] - UCOMISD ABSX, ZERO - JP retNaN // if isNaN(x[i]) { return NaN } - JNE loop // if x[i] != 0 { goto loop } - INCQ IDX // i++ - CMPQ IDX, LEN - JE retZero // if i == LEN { return 0 } - JMP initZero - -loop: - MOVSD (X_)(IDX*8), ABSX // absxi = x[i] - MOVUPS ABSX, TMP - CMPSD ABSX, TMP, $3 - ORPD TMP, NANMASK // NANMASK = NANMASK | IsNaN(absxi) - MOVSD INF, TMP - ANDPD ABSMASK, ABSX // absxi == Abs(absxi) - CMPSD ABSX, TMP, $0 - ORPD TMP, INFMASK // INFMASK = INFMASK | IsInf(absxi) - UCOMISD SCALE, ABSX - JA adjScale // IF SCALE > ABSXI { goto adjScale } - - DIVSD SCALE, ABSX // absxi = scale / absxi - MULSD ABSX, ABSX // absxi *= absxi - ADDSD ABSX, SUMSQ // sumsq += absxi - INCQ IDX // i++ - CMPQ IDX, LEN - JNE loop // if i < LEN { continue } - JMP retSum // if i == LEN { goto retSum } - -adjScale: // Scale > Absxi - DIVSD ABSX, SCALE // tmp = absxi / scale - MULSD SCALE, SUMSQ // sumsq *= tmp - MULSD SCALE, SUMSQ // sumsq *= tmp - ADDSD $1.0, SUMSQ // sumsq += 1 - MOVUPS ABSX, SCALE // scale = absxi - INCQ IDX // i++ - CMPQ IDX, LEN - JNE loop // if i < LEN { continue } - -retSum: // Calculate return value - SQRTSD SUMSQ, SUMSQ // sumsq = sqrt(sumsq) - MULSD SCALE, SUMSQ // sumsq += scale - MOVQ SUMSQ, R10 // tmp = sumsq - UCOMISD ZERO, INFMASK - CMOVQPS INF_DATA, R10 // if INFMASK { tmp = INF } - UCOMISD ZERO, NANMASK - CMOVQPS NAN_DATA, R10 // if NANMASK { tmp = NaN } - MOVQ R10, norm+24(FP) // return tmp - RET - -retZero: - MOVSD ZERO, norm+24(FP) // return 0 - RET - -retNaN: - MOVSD NAN_DATA, TMP // return NaN - MOVSD TMP, norm+24(FP) - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/l2norm_noasm.go b/vendor/gonum.org/v1/gonum/internal/asm/f64/l2norm_noasm.go deleted file mode 100644 index 1e1dfa2..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/l2norm_noasm.go +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright ©2019 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !amd64 noasm appengine safe - -package f64 - -import "math" - -// L2NormUnitary returns the L2-norm of x. -func L2NormUnitary(x []float64) (norm float64) { - var scale float64 - sumSquares := 1.0 - for _, v := range x { - if v == 0 { - continue - } - absxi := math.Abs(v) - if math.IsNaN(absxi) { - return math.NaN() - } - if scale < absxi { - s := scale / absxi - sumSquares = 1 + sumSquares*s*s - scale = absxi - } else { - s := absxi / scale - sumSquares += s * s - } - } - if math.IsInf(scale, 1) { - return math.Inf(1) - } - return scale * math.Sqrt(sumSquares) -} - -// L2NormInc returns the L2-norm of x. -func L2NormInc(x []float64, n, incX uintptr) (norm float64) { - var scale float64 - sumSquares := 1.0 - for ix := uintptr(0); ix < n*incX; ix += incX { - val := x[ix] - if val == 0 { - continue - } - absxi := math.Abs(val) - if math.IsNaN(absxi) { - return math.NaN() - } - if scale < absxi { - s := scale / absxi - sumSquares = 1 + sumSquares*s*s - scale = absxi - } else { - s := absxi / scale - sumSquares += s * s - } - } - if math.IsInf(scale, 1) { - return math.Inf(1) - } - return scale * math.Sqrt(sumSquares) -} - -// L2DistanceUnitary returns the L2-norm of x-y. -func L2DistanceUnitary(x, y []float64) (norm float64) { - var scale float64 - sumSquares := 1.0 - for i, v := range x { - v -= y[i] - if v == 0 { - continue - } - absxi := math.Abs(v) - if math.IsNaN(absxi) { - return math.NaN() - } - if scale < absxi { - s := scale / absxi - sumSquares = 1 + sumSquares*s*s - scale = absxi - } else { - s := absxi / scale - sumSquares += s * s - } - } - if math.IsInf(scale, 1) { - return math.Inf(1) - } - return scale * math.Sqrt(sumSquares) -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/l2normdist_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/l2normdist_amd64.s deleted file mode 100644 index 6d10601..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/l2normdist_amd64.s +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright ©2019 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define SUMSQ X0 -#define ABSX X1 -#define SCALE X2 -#define ZERO X3 -#define TMP X4 -#define ABSMASK X5 -#define INF X7 -#define INFMASK X11 -#define NANMASK X12 -#define IDX AX -#define X_ DI -#define Y_ BX -#define LEN SI - -#define ABSMASK_DATA l2nrodata<>+0(SB) -#define INF_DATA l2nrodata<>+8(SB) -#define NAN_DATA l2nrodata<>+16(SB) -// AbsMask -DATA l2nrodata<>+0(SB)/8, $0x7FFFFFFFFFFFFFFF -// Inf -DATA l2nrodata<>+8(SB)/8, $0x7FF0000000000000 -// NaN -DATA l2nrodata<>+16(SB)/8, $0xFFF8000000000000 -GLOBL l2nrodata<>+0(SB), RODATA, $24 - -// L2DistanceUnitary returns the L2-norm of x-y. -// func L2DistanceUnitary(x,y []float64) (norm float64) -TEXT ·L2DistanceUnitary(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_ - MOVQ y_base+24(FP), Y_ - PXOR ZERO, ZERO - MOVQ x_len+8(FP), LEN // LEN = min( len(x), len(y) ) - CMPQ y_len+32(FP), LEN - CMOVQLE y_len+32(FP), LEN - CMPQ LEN, $0 // if LEN == 0 { return 0 } - JZ retZero - - PXOR INFMASK, INFMASK - PXOR NANMASK, NANMASK - MOVSD $1.0, SUMSQ // ssq = 1 - XORPS SCALE, SCALE - MOVSD ABSMASK_DATA, ABSMASK - MOVSD INF_DATA, INF - XORQ IDX, IDX // idx == 0 - -initZero: // for ;x[i]==0; i++ {} - // Skip all leading zeros, to avoid divide by zero NaN - MOVSD (X_)(IDX*8), ABSX // absxi = x[i] - SUBSD (Y_)(IDX*8), ABSX // absxi = x[i]-y[i] - UCOMISD ABSX, ZERO - JP retNaN // if isNaN(absxi) { return NaN } - JNE loop // if absxi != 0 { goto loop } - INCQ IDX // i++ - CMPQ IDX, LEN - JE retZero // if i == LEN { return 0 } - JMP initZero - -loop: - MOVSD (X_)(IDX*8), ABSX // absxi = x[i] - SUBSD (Y_)(IDX*8), ABSX // absxi = x[i]-y[i] - MOVUPS ABSX, TMP - CMPSD ABSX, TMP, $3 - ORPD TMP, NANMASK // NANMASK = NANMASK | IsNaN(absxi) - MOVSD INF, TMP - ANDPD ABSMASK, ABSX // absxi == Abs(absxi) - CMPSD ABSX, TMP, $0 - ORPD TMP, INFMASK // INFMASK = INFMASK | IsInf(absxi) - UCOMISD SCALE, ABSX - JA adjScale // IF SCALE > ABSXI { goto adjScale } - - DIVSD SCALE, ABSX // absxi = scale / absxi - MULSD ABSX, ABSX // absxi *= absxi - ADDSD ABSX, SUMSQ // sumsq += absxi - INCQ IDX // i++ - CMPQ IDX, LEN - JNE loop // if i < LEN { continue } - JMP retSum // if i == LEN { goto retSum } - -adjScale: // Scale > Absxi - DIVSD ABSX, SCALE // tmp = absxi / scale - MULSD SCALE, SUMSQ // sumsq *= tmp - MULSD SCALE, SUMSQ // sumsq *= tmp - ADDSD $1.0, SUMSQ // sumsq += 1 - MOVUPS ABSX, SCALE // scale = absxi - INCQ IDX // i++ - CMPQ IDX, LEN - JNE loop // if i < LEN { continue } - -retSum: // Calculate return value - SQRTSD SUMSQ, SUMSQ // sumsq = sqrt(sumsq) - MULSD SCALE, SUMSQ // sumsq += scale - MOVQ SUMSQ, R10 // tmp = sumsq - UCOMISD ZERO, INFMASK - CMOVQPS INF_DATA, R10 // if INFMASK { tmp = INF } - UCOMISD ZERO, NANMASK - CMOVQPS NAN_DATA, R10 // if NANMASK { tmp = NaN } - MOVQ R10, norm+48(FP) // return tmp - RET - -retZero: - MOVSD ZERO, norm+48(FP) // return 0 - RET - -retNaN: - MOVSD NAN_DATA, TMP // return NaN - MOVSD TMP, norm+48(FP) - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/l2norminc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/l2norminc_amd64.s deleted file mode 100644 index 13ccc16..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/l2norminc_amd64.s +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright ©2019 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define SUMSQ X0 -#define ABSX X1 -#define SCALE X2 -#define ZERO X3 -#define TMP X4 -#define ABSMASK X5 -#define INF X7 -#define INFMASK X11 -#define NANMASK X12 -#define IDX AX -#define LEN SI -#define INC BX -#define X_ DI - -#define ABSMASK_DATA l2nrodata<>+0(SB) -#define INF_DATA l2nrodata<>+8(SB) -#define NAN_DATA l2nrodata<>+16(SB) -// AbsMask -DATA l2nrodata<>+0(SB)/8, $0x7FFFFFFFFFFFFFFF -// Inf -DATA l2nrodata<>+8(SB)/8, $0x7FF0000000000000 -// NaN -DATA l2nrodata<>+16(SB)/8, $0xFFF8000000000000 -GLOBL l2nrodata<>+0(SB), RODATA, $24 - -// func L2NormInc(x []float64, n, incX uintptr) (norm float64) -TEXT ·L2NormInc(SB), NOSPLIT, $0 - MOVQ n+24(FP), LEN // LEN = len(x) - MOVQ incX+32(FP), INC - MOVQ x_base+0(FP), X_ - XORPS ZERO, ZERO - CMPQ LEN, $0 // if LEN == 0 { return 0 } - JZ retZero - - XORPS INFMASK, INFMASK - XORPS NANMASK, NANMASK - MOVSD $1.0, SUMSQ // ssq = 1 - XORPS SCALE, SCALE - MOVSD ABSMASK_DATA, ABSMASK - MOVSD INF_DATA, INF - SHLQ $3, INC // INC *= sizeof(float64) - -initZero: // for ;x[i]==0; i++ {} - // Skip all leading zeros, to avoid divide by zero NaN - MOVSD (X_), ABSX // absxi = x[i] - UCOMISD ABSX, ZERO - JP retNaN // if isNaN(x[i]) { return NaN } - JNZ loop // if x[i] != 0 { goto loop } - ADDQ INC, X_ // i += INC - DECQ LEN // LEN-- - JZ retZero // if LEN == 0 { return 0 } - JMP initZero - -loop: - MOVSD (X_), ABSX // absxi = x[i] - MOVUPS ABSX, TMP - CMPSD ABSX, TMP, $3 - ORPD TMP, NANMASK // NANMASK = NANMASK | IsNaN(absxi) - MOVSD INF, TMP - ANDPD ABSMASK, ABSX // absxi == Abs(absxi) - CMPSD ABSX, TMP, $0 - ORPD TMP, INFMASK // INFMASK = INFMASK | IsInf(absxi) - UCOMISD SCALE, ABSX - JA adjScale // IF SCALE > ABSXI { goto adjScale } - - DIVSD SCALE, ABSX // absxi = scale / absxi - MULSD ABSX, ABSX // absxi *= absxi - ADDSD ABSX, SUMSQ // sumsq += absxi - ADDQ INC, X_ // i += INC - DECQ LEN // LEN-- - JNZ loop // if LEN > 0 { continue } - JMP retSum // if LEN == 0 { goto retSum } - -adjScale: // Scale > Absxi - DIVSD ABSX, SCALE // tmp = absxi / scale - MULSD SCALE, SUMSQ // sumsq *= tmp - MULSD SCALE, SUMSQ // sumsq *= tmp - ADDSD $1.0, SUMSQ // sumsq += 1 - MOVUPS ABSX, SCALE // scale = absxi - ADDQ INC, X_ // i += INC - DECQ LEN // LEN-- - JNZ loop // if LEN > 0 { continue } - -retSum: // Calculate return value - SQRTSD SUMSQ, SUMSQ // sumsq = sqrt(sumsq) - MULSD SCALE, SUMSQ // sumsq += scale - MOVQ SUMSQ, R10 // tmp = sumsq - UCOMISD ZERO, INFMASK - CMOVQPS INF_DATA, R10 // if INFMASK { tmp = INF } - UCOMISD ZERO, NANMASK - CMOVQPS NAN_DATA, R10 // if NANMASK { tmp = NaN } - MOVQ R10, norm+40(FP) // return tmp - RET - -retZero: - MOVSD ZERO, norm+40(FP) // return 0 - RET - -retNaN: - MOVSD NAN_DATA, TMP // return NaN - MOVSD TMP, norm+40(FP) - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/linfnorm_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/linfnorm_amd64.s deleted file mode 100644 index b062592..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/linfnorm_amd64.s +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// func LinfDist(s, t []float64) float64 -TEXT ·LinfDist(SB), NOSPLIT, $0 - MOVQ s_base+0(FP), DI // DI = &s - MOVQ t_base+24(FP), SI // SI = &t - MOVQ s_len+8(FP), CX // CX = len(s) - CMPQ t_len+32(FP), CX // CX = max( CX, len(t) ) - CMOVQLE t_len+32(FP), CX - PXOR X3, X3 // norm = 0 - CMPQ CX, $0 // if CX == 0 { return 0 } - JE l1_end - XORQ AX, AX // i = 0 - MOVQ CX, BX - ANDQ $1, BX // BX = CX % 2 - SHRQ $1, CX // CX = floor( CX / 2 ) - JZ l1_tail_start // if CX == 0 { return 0 } - -l1_loop: // Loop unrolled 2x do { - MOVUPS (SI)(AX*8), X0 // X0 = t[i:i+1] - MOVUPS (DI)(AX*8), X1 // X1 = s[i:i+1] - MOVAPS X0, X2 - SUBPD X1, X0 - SUBPD X2, X1 - MAXPD X1, X0 // X0 = max( X0 - X1, X1 - X0 ) - MAXPD X0, X3 // norm = max( norm, X0 ) - ADDQ $2, AX // i += 2 - LOOP l1_loop // } while --CX > 0 - CMPQ BX, $0 // if BX == 0 { return } - JE l1_end - -l1_tail_start: // Reset loop registers - MOVQ BX, CX // Loop counter: CX = BX - PXOR X0, X0 // reset X0, X1 to break dependencies - PXOR X1, X1 - -l1_tail: - MOVSD (SI)(AX*8), X0 // X0 = t[i] - MOVSD (DI)(AX*8), X1 // X1 = s[i] - MOVAPD X0, X2 - SUBSD X1, X0 - SUBSD X2, X1 - MAXSD X1, X0 // X0 = max( X0 - X1, X1 - X0 ) - MAXSD X0, X3 // norm = max( norm, X0 ) - -l1_end: - MOVAPS X3, X2 - SHUFPD $1, X2, X2 - MAXSD X3, X2 // X2 = max( X3[1], X3[0] ) - MOVSD X2, ret+48(FP) // return X2 - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/scal.go b/vendor/gonum.org/v1/gonum/internal/asm/f64/scal.go deleted file mode 100644 index 3cc7aca..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/scal.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !amd64 noasm appengine safe - -package f64 - -// ScalUnitary is -// for i := range x { -// x[i] *= alpha -// } -func ScalUnitary(alpha float64, x []float64) { - for i := range x { - x[i] *= alpha - } -} - -// ScalUnitaryTo is -// for i, v := range x { -// dst[i] = alpha * v -// } -func ScalUnitaryTo(dst []float64, alpha float64, x []float64) { - for i, v := range x { - dst[i] = alpha * v - } -} - -// ScalInc is -// var ix uintptr -// for i := 0; i < int(n); i++ { -// x[ix] *= alpha -// ix += incX -// } -func ScalInc(alpha float64, x []float64, n, incX uintptr) { - var ix uintptr - for i := 0; i < int(n); i++ { - x[ix] *= alpha - ix += incX - } -} - -// ScalIncTo is -// var idst, ix uintptr -// for i := 0; i < int(n); i++ { -// dst[idst] = alpha * x[ix] -// ix += incX -// idst += incDst -// } -func ScalIncTo(dst []float64, incDst uintptr, alpha float64, x []float64, n, incX uintptr) { - var idst, ix uintptr - for i := 0; i < int(n); i++ { - dst[idst] = alpha * x[ix] - ix += incX - idst += incDst - } -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/scalinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/scalinc_amd64.s deleted file mode 100644 index cf185fc..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/scalinc_amd64.s +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -// -// Some of the loop unrolling code is copied from: -// http://golang.org/src/math/big/arith_amd64.s -// which is distributed under these terms: -// -// Copyright (c) 2012 The Go Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define X_PTR SI -#define LEN CX -#define TAIL BX -#define INC_X R8 -#define INCx3_X R9 -#define ALPHA X0 -#define ALPHA_2 X1 - -// func ScalInc(alpha float64, x []float64, n, incX uintptr) -TEXT ·ScalInc(SB), NOSPLIT, $0 - MOVSD alpha+0(FP), ALPHA // ALPHA = alpha - MOVQ x_base+8(FP), X_PTR // X_PTR = &x - MOVQ incX+40(FP), INC_X // INC_X = incX - SHLQ $3, INC_X // INC_X *= sizeof(float64) - MOVQ n+32(FP), LEN // LEN = n - CMPQ LEN, $0 - JE end // if LEN == 0 { return } - - MOVQ LEN, TAIL - ANDQ $3, TAIL // TAIL = LEN % 4 - SHRQ $2, LEN // LEN = floor( LEN / 4 ) - JZ tail_start // if LEN == 0 { goto tail_start } - - MOVUPS ALPHA, ALPHA_2 // ALPHA_2 = ALPHA for pipelining - LEAQ (INC_X)(INC_X*2), INCx3_X // INCx3_X = INC_X * 3 - -loop: // do { // x[i] *= alpha unrolled 4x. - MOVSD (X_PTR), X2 // X_i = x[i] - MOVSD (X_PTR)(INC_X*1), X3 - MOVSD (X_PTR)(INC_X*2), X4 - MOVSD (X_PTR)(INCx3_X*1), X5 - - MULSD ALPHA, X2 // X_i *= a - MULSD ALPHA_2, X3 - MULSD ALPHA, X4 - MULSD ALPHA_2, X5 - - MOVSD X2, (X_PTR) // x[i] = X_i - MOVSD X3, (X_PTR)(INC_X*1) - MOVSD X4, (X_PTR)(INC_X*2) - MOVSD X5, (X_PTR)(INCx3_X*1) - - LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(X_PTR[incX*4]) - DECQ LEN - JNZ loop // } while --LEN > 0 - CMPQ TAIL, $0 - JE end // if TAIL == 0 { return } - -tail_start: // Reset loop registers - MOVQ TAIL, LEN // Loop counter: LEN = TAIL - SHRQ $1, LEN // LEN = floor( LEN / 2 ) - JZ tail_one - -tail_two: // do { - MOVSD (X_PTR), X2 // X_i = x[i] - MOVSD (X_PTR)(INC_X*1), X3 - MULSD ALPHA, X2 // X_i *= a - MULSD ALPHA, X3 - MOVSD X2, (X_PTR) // x[i] = X_i - MOVSD X3, (X_PTR)(INC_X*1) - - LEAQ (X_PTR)(INC_X*2), X_PTR // X_PTR = &(X_PTR[incX*2]) - - ANDQ $1, TAIL - JZ end - -tail_one: - MOVSD (X_PTR), X2 // X_i = x[i] - MULSD ALPHA, X2 // X_i *= ALPHA - MOVSD X2, (X_PTR) // x[i] = X_i - -end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/scalincto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/scalincto_amd64.s deleted file mode 100644 index cf359ac..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/scalincto_amd64.s +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -// -// Some of the loop unrolling code is copied from: -// http://golang.org/src/math/big/arith_amd64.s -// which is distributed under these terms: -// -// Copyright (c) 2012 The Go Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define X_PTR SI -#define DST_PTR DI -#define LEN CX -#define TAIL BX -#define INC_X R8 -#define INCx3_X R9 -#define INC_DST R10 -#define INCx3_DST R11 -#define ALPHA X0 -#define ALPHA_2 X1 - -// func ScalIncTo(dst []float64, incDst uintptr, alpha float64, x []float64, n, incX uintptr) -TEXT ·ScalIncTo(SB), NOSPLIT, $0 - MOVQ dst_base+0(FP), DST_PTR // DST_PTR = &dst - MOVQ incDst+24(FP), INC_DST // INC_DST = incDst - SHLQ $3, INC_DST // INC_DST *= sizeof(float64) - MOVSD alpha+32(FP), ALPHA // ALPHA = alpha - MOVQ x_base+40(FP), X_PTR // X_PTR = &x - MOVQ n+64(FP), LEN // LEN = n - MOVQ incX+72(FP), INC_X // INC_X = incX - SHLQ $3, INC_X // INC_X *= sizeof(float64) - CMPQ LEN, $0 - JE end // if LEN == 0 { return } - - MOVQ LEN, TAIL - ANDQ $3, TAIL // TAIL = LEN % 4 - SHRQ $2, LEN // LEN = floor( LEN / 4 ) - JZ tail_start // if LEN == 0 { goto tail_start } - - MOVUPS ALPHA, ALPHA_2 // ALPHA_2 = ALPHA for pipelining - LEAQ (INC_X)(INC_X*2), INCx3_X // INCx3_X = INC_X * 3 - LEAQ (INC_DST)(INC_DST*2), INCx3_DST // INCx3_DST = INC_DST * 3 - -loop: // do { // x[i] *= alpha unrolled 4x. - MOVSD (X_PTR), X2 // X_i = x[i] - MOVSD (X_PTR)(INC_X*1), X3 - MOVSD (X_PTR)(INC_X*2), X4 - MOVSD (X_PTR)(INCx3_X*1), X5 - - MULSD ALPHA, X2 // X_i *= a - MULSD ALPHA_2, X3 - MULSD ALPHA, X4 - MULSD ALPHA_2, X5 - - MOVSD X2, (DST_PTR) // dst[i] = X_i - MOVSD X3, (DST_PTR)(INC_DST*1) - MOVSD X4, (DST_PTR)(INC_DST*2) - MOVSD X5, (DST_PTR)(INCx3_DST*1) - - LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(X_PTR[incX*4]) - LEAQ (DST_PTR)(INC_DST*4), DST_PTR // DST_PTR = &(DST_PTR[incDst*4]) - DECQ LEN - JNZ loop // } while --LEN > 0 - CMPQ TAIL, $0 - JE end // if TAIL == 0 { return } - -tail_start: // Reset loop registers - MOVQ TAIL, LEN // Loop counter: LEN = TAIL - SHRQ $1, LEN // LEN = floor( LEN / 2 ) - JZ tail_one - -tail_two: - MOVSD (X_PTR), X2 // X_i = x[i] - MOVSD (X_PTR)(INC_X*1), X3 - MULSD ALPHA, X2 // X_i *= a - MULSD ALPHA, X3 - MOVSD X2, (DST_PTR) // dst[i] = X_i - MOVSD X3, (DST_PTR)(INC_DST*1) - - LEAQ (X_PTR)(INC_X*2), X_PTR // X_PTR = &(X_PTR[incX*2]) - LEAQ (DST_PTR)(INC_DST*2), DST_PTR // DST_PTR = &(DST_PTR[incDst*2]) - - ANDQ $1, TAIL - JZ end - -tail_one: - MOVSD (X_PTR), X2 // X_i = x[i] - MULSD ALPHA, X2 // X_i *= ALPHA - MOVSD X2, (DST_PTR) // x[i] = X_i - -end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/scalunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/scalunitary_amd64.s deleted file mode 100644 index 560aef2..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/scalunitary_amd64.s +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -// -// Some of the loop unrolling code is copied from: -// http://golang.org/src/math/big/arith_amd64.s -// which is distributed under these terms: -// -// Copyright (c) 2012 The Go Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define MOVDDUP_ALPHA LONG $0x44120FF2; WORD $0x0824 // @ MOVDDUP XMM0, 8[RSP] - -#define X_PTR SI -#define DST_PTR DI -#define IDX AX -#define LEN CX -#define TAIL BX -#define ALPHA X0 -#define ALPHA_2 X1 - -// func ScalUnitary(alpha float64, x []float64) -TEXT ·ScalUnitary(SB), NOSPLIT, $0 - MOVDDUP_ALPHA // ALPHA = { alpha, alpha } - MOVQ x_base+8(FP), X_PTR // X_PTR = &x - MOVQ x_len+16(FP), LEN // LEN = len(x) - CMPQ LEN, $0 - JE end // if LEN == 0 { return } - XORQ IDX, IDX // IDX = 0 - - MOVQ LEN, TAIL - ANDQ $7, TAIL // TAIL = LEN % 8 - SHRQ $3, LEN // LEN = floor( LEN / 8 ) - JZ tail_start // if LEN == 0 { goto tail_start } - - MOVUPS ALPHA, ALPHA_2 - -loop: // do { // x[i] *= alpha unrolled 8x. - MOVUPS (X_PTR)(IDX*8), X2 // X_i = x[i] - MOVUPS 16(X_PTR)(IDX*8), X3 - MOVUPS 32(X_PTR)(IDX*8), X4 - MOVUPS 48(X_PTR)(IDX*8), X5 - - MULPD ALPHA, X2 // X_i *= ALPHA - MULPD ALPHA_2, X3 - MULPD ALPHA, X4 - MULPD ALPHA_2, X5 - - MOVUPS X2, (X_PTR)(IDX*8) // x[i] = X_i - MOVUPS X3, 16(X_PTR)(IDX*8) - MOVUPS X4, 32(X_PTR)(IDX*8) - MOVUPS X5, 48(X_PTR)(IDX*8) - - ADDQ $8, IDX // i += 8 - DECQ LEN - JNZ loop // while --LEN > 0 - CMPQ TAIL, $0 - JE end // if TAIL == 0 { return } - -tail_start: // Reset loop registers - MOVQ TAIL, LEN // Loop counter: LEN = TAIL - SHRQ $1, LEN // LEN = floor( TAIL / 2 ) - JZ tail_one // if n == 0 goto end - -tail_two: // do { - MOVUPS (X_PTR)(IDX*8), X2 // X_i = x[i] - MULPD ALPHA, X2 // X_i *= ALPHA - MOVUPS X2, (X_PTR)(IDX*8) // x[i] = X_i - ADDQ $2, IDX // i += 2 - DECQ LEN - JNZ tail_two // while --LEN > 0 - - ANDQ $1, TAIL - JZ end // if TAIL == 0 { return } - -tail_one: - // x[i] *= alpha for the remaining element. - MOVSD (X_PTR)(IDX*8), X2 - MULSD ALPHA, X2 - MOVSD X2, (X_PTR)(IDX*8) - -end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/scalunitaryto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/scalunitaryto_amd64.s deleted file mode 100644 index a5b2b01..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/scalunitaryto_amd64.s +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -// -// Some of the loop unrolling code is copied from: -// http://golang.org/src/math/big/arith_amd64.s -// which is distributed under these terms: -// -// Copyright (c) 2012 The Go Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define MOVDDUP_ALPHA LONG $0x44120FF2; WORD $0x2024 // @ MOVDDUP 32(SP), X0 /*XMM0, 32[RSP]*/ - -#define X_PTR SI -#define DST_PTR DI -#define IDX AX -#define LEN CX -#define TAIL BX -#define ALPHA X0 -#define ALPHA_2 X1 - -// func ScalUnitaryTo(dst []float64, alpha float64, x []float64) -// This function assumes len(dst) >= len(x). -TEXT ·ScalUnitaryTo(SB), NOSPLIT, $0 - MOVQ x_base+32(FP), X_PTR // X_PTR = &x - MOVQ dst_base+0(FP), DST_PTR // DST_PTR = &dst - MOVDDUP_ALPHA // ALPHA = { alpha, alpha } - MOVQ x_len+40(FP), LEN // LEN = len(x) - CMPQ LEN, $0 - JE end // if LEN == 0 { return } - - XORQ IDX, IDX // IDX = 0 - MOVQ LEN, TAIL - ANDQ $7, TAIL // TAIL = LEN % 8 - SHRQ $3, LEN // LEN = floor( LEN / 8 ) - JZ tail_start // if LEN == 0 { goto tail_start } - - MOVUPS ALPHA, ALPHA_2 // ALPHA_2 = ALPHA for pipelining - -loop: // do { // dst[i] = alpha * x[i] unrolled 8x. - MOVUPS (X_PTR)(IDX*8), X2 // X_i = x[i] - MOVUPS 16(X_PTR)(IDX*8), X3 - MOVUPS 32(X_PTR)(IDX*8), X4 - MOVUPS 48(X_PTR)(IDX*8), X5 - - MULPD ALPHA, X2 // X_i *= ALPHA - MULPD ALPHA_2, X3 - MULPD ALPHA, X4 - MULPD ALPHA_2, X5 - - MOVUPS X2, (DST_PTR)(IDX*8) // dst[i] = X_i - MOVUPS X3, 16(DST_PTR)(IDX*8) - MOVUPS X4, 32(DST_PTR)(IDX*8) - MOVUPS X5, 48(DST_PTR)(IDX*8) - - ADDQ $8, IDX // i += 8 - DECQ LEN - JNZ loop // while --LEN > 0 - CMPQ TAIL, $0 - JE end // if TAIL == 0 { return } - -tail_start: // Reset loop counters - MOVQ TAIL, LEN // Loop counter: LEN = TAIL - SHRQ $1, LEN // LEN = floor( TAIL / 2 ) - JZ tail_one // if LEN == 0 { goto tail_one } - -tail_two: // do { - MOVUPS (X_PTR)(IDX*8), X2 // X_i = x[i] - MULPD ALPHA, X2 // X_i *= ALPHA - MOVUPS X2, (DST_PTR)(IDX*8) // dst[i] = X_i - ADDQ $2, IDX // i += 2 - DECQ LEN - JNZ tail_two // while --LEN > 0 - - ANDQ $1, TAIL - JZ end // if TAIL == 0 { return } - -tail_one: - MOVSD (X_PTR)(IDX*8), X2 // X_i = x[i] - MULSD ALPHA, X2 // X_i *= ALPHA - MOVSD X2, (DST_PTR)(IDX*8) // dst[i] = X_i - -end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/stubs_amd64.go b/vendor/gonum.org/v1/gonum/internal/asm/f64/stubs_amd64.go deleted file mode 100644 index 3ff0582..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/stubs_amd64.go +++ /dev/null @@ -1,252 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -package f64 - -// L1Norm is -// for _, v := range x { -// sum += math.Abs(v) -// } -// return sum -func L1Norm(x []float64) (sum float64) - -// L1NormInc is -// for i := 0; i < n*incX; i += incX { -// sum += math.Abs(x[i]) -// } -// return sum -func L1NormInc(x []float64, n, incX int) (sum float64) - -// AddConst is -// for i := range x { -// x[i] += alpha -// } -func AddConst(alpha float64, x []float64) - -// Add is -// for i, v := range s { -// dst[i] += v -// } -func Add(dst, s []float64) - -// AxpyUnitary is -// for i, v := range x { -// y[i] += alpha * v -// } -func AxpyUnitary(alpha float64, x, y []float64) - -// AxpyUnitaryTo is -// for i, v := range x { -// dst[i] = alpha*v + y[i] -// } -func AxpyUnitaryTo(dst []float64, alpha float64, x, y []float64) - -// AxpyInc is -// for i := 0; i < int(n); i++ { -// y[iy] += alpha * x[ix] -// ix += incX -// iy += incY -// } -func AxpyInc(alpha float64, x, y []float64, n, incX, incY, ix, iy uintptr) - -// AxpyIncTo is -// for i := 0; i < int(n); i++ { -// dst[idst] = alpha*x[ix] + y[iy] -// ix += incX -// iy += incY -// idst += incDst -// } -func AxpyIncTo(dst []float64, incDst, idst uintptr, alpha float64, x, y []float64, n, incX, incY, ix, iy uintptr) - -// CumSum is -// if len(s) == 0 { -// return dst -// } -// dst[0] = s[0] -// for i, v := range s[1:] { -// dst[i+1] = dst[i] + v -// } -// return dst -func CumSum(dst, s []float64) []float64 - -// CumProd is -// if len(s) == 0 { -// return dst -// } -// dst[0] = s[0] -// for i, v := range s[1:] { -// dst[i+1] = dst[i] * v -// } -// return dst -func CumProd(dst, s []float64) []float64 - -// Div is -// for i, v := range s { -// dst[i] /= v -// } -func Div(dst, s []float64) - -// DivTo is -// for i, v := range s { -// dst[i] = v / t[i] -// } -// return dst -func DivTo(dst, x, y []float64) []float64 - -// DotUnitary is -// for i, v := range x { -// sum += y[i] * v -// } -// return sum -func DotUnitary(x, y []float64) (sum float64) - -// DotInc is -// for i := 0; i < int(n); i++ { -// sum += y[iy] * x[ix] -// ix += incX -// iy += incY -// } -// return sum -func DotInc(x, y []float64, n, incX, incY, ix, iy uintptr) (sum float64) - -// L1Dist is -// var norm float64 -// for i, v := range s { -// norm += math.Abs(t[i] - v) -// } -// return norm -func L1Dist(s, t []float64) float64 - -// LinfDist is -// var norm float64 -// if len(s) == 0 { -// return 0 -// } -// norm = math.Abs(t[0] - s[0]) -// for i, v := range s[1:] { -// absDiff := math.Abs(t[i+1] - v) -// if absDiff > norm || math.IsNaN(norm) { -// norm = absDiff -// } -// } -// return norm -func LinfDist(s, t []float64) float64 - -// ScalUnitary is -// for i := range x { -// x[i] *= alpha -// } -func ScalUnitary(alpha float64, x []float64) - -// ScalUnitaryTo is -// for i, v := range x { -// dst[i] = alpha * v -// } -func ScalUnitaryTo(dst []float64, alpha float64, x []float64) - -// ScalInc is -// var ix uintptr -// for i := 0; i < int(n); i++ { -// x[ix] *= alpha -// ix += incX -// } -func ScalInc(alpha float64, x []float64, n, incX uintptr) - -// ScalIncTo is -// var idst, ix uintptr -// for i := 0; i < int(n); i++ { -// dst[idst] = alpha * x[ix] -// ix += incX -// idst += incDst -// } -func ScalIncTo(dst []float64, incDst uintptr, alpha float64, x []float64, n, incX uintptr) - -// Sum is -// var sum float64 -// for i := range x { -// sum += x[i] -// } -func Sum(x []float64) float64 - -// L2NormUnitary returns the L2-norm of x. -// var scale float64 -// sumSquares := 1.0 -// for _, v := range x { -// if v == 0 { -// continue -// } -// absxi := math.Abs(v) -// if math.IsNaN(absxi) { -// return math.NaN() -// } -// if scale < absxi { -// s := scale / absxi -// sumSquares = 1 + sumSquares*s*s -// scale = absxi -// } else { -// s := absxi / scale -// sumSquares += s * s -// } -// if math.IsInf(scale, 1) { -// return math.Inf(1) -// } -// } -// return scale * math.Sqrt(sumSquares) -func L2NormUnitary(x []float64) (norm float64) - -// L2NormInc returns the L2-norm of x. -// var scale float64 -// sumSquares := 1.0 -// for ix := uintptr(0); ix < n*incX; ix += incX { -// val := x[ix] -// if val == 0 { -// continue -// } -// absxi := math.Abs(val) -// if math.IsNaN(absxi) { -// return math.NaN() -// } -// if scale < absxi { -// s := scale / absxi -// sumSquares = 1 + sumSquares*s*s -// scale = absxi -// } else { -// s := absxi / scale -// sumSquares += s * s -// } -// } -// if math.IsInf(scale, 1) { -// return math.Inf(1) -// } -// return scale * math.Sqrt(sumSquares) -func L2NormInc(x []float64, n, incX uintptr) (norm float64) - -// L2DistanceUnitary returns the L2-norm of x-y. -// var scale float64 -// sumSquares := 1.0 -// for i, v := range x { -// v -= y[i] -// if v == 0 { -// continue -// } -// absxi := math.Abs(v) -// if math.IsNaN(absxi) { -// return math.NaN() -// } -// if scale < absxi { -// s := scale / absxi -// sumSquares = 1 + sumSquares*s*s -// scale = absxi -// } else { -// s := absxi / scale -// sumSquares += s * s -// } -// } -// if math.IsInf(scale, 1) { -// return math.Inf(1) -// } -// return scale * math.Sqrt(sumSquares) -func L2DistanceUnitary(x, y []float64) (norm float64) diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/stubs_noasm.go b/vendor/gonum.org/v1/gonum/internal/asm/f64/stubs_noasm.go deleted file mode 100644 index 670978a..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/stubs_noasm.go +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !amd64 noasm appengine safe - -package f64 - -import "math" - -// L1Norm is -// for _, v := range x { -// sum += math.Abs(v) -// } -// return sum -func L1Norm(x []float64) (sum float64) { - for _, v := range x { - sum += math.Abs(v) - } - return sum -} - -// L1NormInc is -// for i := 0; i < n*incX; i += incX { -// sum += math.Abs(x[i]) -// } -// return sum -func L1NormInc(x []float64, n, incX int) (sum float64) { - for i := 0; i < n*incX; i += incX { - sum += math.Abs(x[i]) - } - return sum -} - -// Add is -// for i, v := range s { -// dst[i] += v -// } -func Add(dst, s []float64) { - for i, v := range s { - dst[i] += v - } -} - -// AddConst is -// for i := range x { -// x[i] += alpha -// } -func AddConst(alpha float64, x []float64) { - for i := range x { - x[i] += alpha - } -} - -// CumSum is -// if len(s) == 0 { -// return dst -// } -// dst[0] = s[0] -// for i, v := range s[1:] { -// dst[i+1] = dst[i] + v -// } -// return dst -func CumSum(dst, s []float64) []float64 { - if len(s) == 0 { - return dst - } - dst[0] = s[0] - for i, v := range s[1:] { - dst[i+1] = dst[i] + v - } - return dst -} - -// CumProd is -// if len(s) == 0 { -// return dst -// } -// dst[0] = s[0] -// for i, v := range s[1:] { -// dst[i+1] = dst[i] * v -// } -// return dst -func CumProd(dst, s []float64) []float64 { - if len(s) == 0 { - return dst - } - dst[0] = s[0] - for i, v := range s[1:] { - dst[i+1] = dst[i] * v - } - return dst -} - -// Div is -// for i, v := range s { -// dst[i] /= v -// } -func Div(dst, s []float64) { - for i, v := range s { - dst[i] /= v - } -} - -// DivTo is -// for i, v := range s { -// dst[i] = v / t[i] -// } -// return dst -func DivTo(dst, s, t []float64) []float64 { - for i, v := range s { - dst[i] = v / t[i] - } - return dst -} - -// L1Dist is -// var norm float64 -// for i, v := range s { -// norm += math.Abs(t[i] - v) -// } -// return norm -func L1Dist(s, t []float64) float64 { - var norm float64 - for i, v := range s { - norm += math.Abs(t[i] - v) - } - return norm -} - -// LinfDist is -// var norm float64 -// if len(s) == 0 { -// return 0 -// } -// norm = math.Abs(t[0] - s[0]) -// for i, v := range s[1:] { -// absDiff := math.Abs(t[i+1] - v) -// if absDiff > norm || math.IsNaN(norm) { -// norm = absDiff -// } -// } -// return norm -func LinfDist(s, t []float64) float64 { - var norm float64 - if len(s) == 0 { - return 0 - } - norm = math.Abs(t[0] - s[0]) - for i, v := range s[1:] { - absDiff := math.Abs(t[i+1] - v) - if absDiff > norm || math.IsNaN(norm) { - norm = absDiff - } - } - return norm -} - -// Sum is -// var sum float64 -// for i := range x { -// sum += x[i] -// } -func Sum(x []float64) float64 { - var sum float64 - for _, v := range x { - sum += v - } - return sum -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/sum_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/sum_amd64.s deleted file mode 100644 index 4d9d681..0000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/sum_amd64.s +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright ©2018 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define X_PTR SI -#define IDX AX -#define LEN CX -#define TAIL BX -#define SUM X0 -#define SUM_1 X1 -#define SUM_2 X2 -#define SUM_3 X3 - -// func Sum(x []float64) float64 -TEXT ·Sum(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_PTR // X_PTR = &x - MOVQ x_len+8(FP), LEN // LEN = len(x) - XORQ IDX, IDX // i = 0 - PXOR SUM, SUM // p_sum_i = 0 - CMPQ LEN, $0 // if LEN == 0 { return 0 } - JE sum_end - - PXOR SUM_1, SUM_1 - PXOR SUM_2, SUM_2 - PXOR SUM_3, SUM_3 - - MOVQ X_PTR, TAIL // Check memory alignment - ANDQ $15, TAIL // TAIL = &y % 16 - JZ no_trim // if TAIL == 0 { goto no_trim } - - // Align on 16-byte boundary - ADDSD (X_PTR), X0 // X0 += x[0] - INCQ IDX // i++ - DECQ LEN // LEN-- - DECQ TAIL // TAIL-- - JZ sum_end // if TAIL == 0 { return } - -no_trim: - MOVQ LEN, TAIL - SHRQ $4, LEN // LEN = floor( n / 16 ) - JZ sum_tail8 // if LEN == 0 { goto sum_tail8 } - -sum_loop: // sum 16x wide do { - ADDPD (SI)(AX*8), SUM // sum_i += x[i:i+2] - ADDPD 16(SI)(AX*8), SUM_1 - ADDPD 32(SI)(AX*8), SUM_2 - ADDPD 48(SI)(AX*8), SUM_3 - ADDPD 64(SI)(AX*8), SUM - ADDPD 80(SI)(AX*8), SUM_1 - ADDPD 96(SI)(AX*8), SUM_2 - ADDPD 112(SI)(AX*8), SUM_3 - ADDQ $16, IDX // i += 16 - DECQ LEN - JNZ sum_loop // } while --CX > 0 - -sum_tail8: - TESTQ $8, TAIL - JZ sum_tail4 - - ADDPD (SI)(AX*8), SUM // sum_i += x[i:i+2] - ADDPD 16(SI)(AX*8), SUM_1 - ADDPD 32(SI)(AX*8), SUM_2 - ADDPD 48(SI)(AX*8), SUM_3 - ADDQ $8, IDX - -sum_tail4: - ADDPD SUM_3, SUM - ADDPD SUM_2, SUM_1 - - TESTQ $4, TAIL - JZ sum_tail2 - - ADDPD (SI)(AX*8), SUM // sum_i += x[i:i+2] - ADDPD 16(SI)(AX*8), SUM_1 - ADDQ $4, IDX - -sum_tail2: - ADDPD SUM_1, SUM - - TESTQ $2, TAIL - JZ sum_tail1 - - ADDPD (SI)(AX*8), SUM // sum_i += x[i:i+2] - ADDQ $2, IDX - -sum_tail1: - HADDPD SUM, SUM // sum_i[0] += sum_i[1] - - TESTQ $1, TAIL - JZ sum_end - - ADDSD (SI)(IDX*8), SUM - -sum_end: // return sum - MOVSD SUM, ret+24(FP) - RET diff --git a/vendor/gonum.org/v1/gonum/internal/cmplx64/abs.go b/vendor/gonum.org/v1/gonum/internal/cmplx64/abs.go deleted file mode 100644 index ac6eb81..0000000 --- a/vendor/gonum.org/v1/gonum/internal/cmplx64/abs.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Copyright ©2017 The Gonum 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 cmplx64 - -import math "gonum.org/v1/gonum/internal/math32" - -// Abs returns the absolute value (also called the modulus) of x. -func Abs(x complex64) float32 { return math.Hypot(real(x), imag(x)) } diff --git a/vendor/gonum.org/v1/gonum/internal/cmplx64/conj.go b/vendor/gonum.org/v1/gonum/internal/cmplx64/conj.go deleted file mode 100644 index 705262f..0000000 --- a/vendor/gonum.org/v1/gonum/internal/cmplx64/conj.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Copyright ©2017 The Gonum 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 cmplx64 - -// Conj returns the complex conjugate of x. -func Conj(x complex64) complex64 { return complex(real(x), -imag(x)) } diff --git a/vendor/gonum.org/v1/gonum/internal/cmplx64/doc.go b/vendor/gonum.org/v1/gonum/internal/cmplx64/doc.go deleted file mode 100644 index 5424ea0..0000000 --- a/vendor/gonum.org/v1/gonum/internal/cmplx64/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright ©2017 The Gonum 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 cmplx64 provides complex64 versions of standard library math/cmplx -// package routines used by gonum/blas. -package cmplx64 // import "gonum.org/v1/gonum/internal/cmplx64" diff --git a/vendor/gonum.org/v1/gonum/internal/cmplx64/isinf.go b/vendor/gonum.org/v1/gonum/internal/cmplx64/isinf.go deleted file mode 100644 index 21d3d18..0000000 --- a/vendor/gonum.org/v1/gonum/internal/cmplx64/isinf.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Copyright ©2017 The Gonum 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 cmplx64 - -import math "gonum.org/v1/gonum/internal/math32" - -// IsInf returns true if either real(x) or imag(x) is an infinity. -func IsInf(x complex64) bool { - if math.IsInf(real(x), 0) || math.IsInf(imag(x), 0) { - return true - } - return false -} - -// Inf returns a complex infinity, complex(+Inf, +Inf). -func Inf() complex64 { - inf := math.Inf(1) - return complex(inf, inf) -} diff --git a/vendor/gonum.org/v1/gonum/internal/cmplx64/isnan.go b/vendor/gonum.org/v1/gonum/internal/cmplx64/isnan.go deleted file mode 100644 index 7e0bf78..0000000 --- a/vendor/gonum.org/v1/gonum/internal/cmplx64/isnan.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Copyright ©2017 The Gonum 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 cmplx64 - -import math "gonum.org/v1/gonum/internal/math32" - -// IsNaN returns true if either real(x) or imag(x) is NaN -// and neither is an infinity. -func IsNaN(x complex64) bool { - switch { - case math.IsInf(real(x), 0) || math.IsInf(imag(x), 0): - return false - case math.IsNaN(real(x)) || math.IsNaN(imag(x)): - return true - } - return false -} - -// NaN returns a complex ``not-a-number'' value. -func NaN() complex64 { - nan := math.NaN() - return complex(nan, nan) -} diff --git a/vendor/gonum.org/v1/gonum/internal/cmplx64/sqrt.go b/vendor/gonum.org/v1/gonum/internal/cmplx64/sqrt.go deleted file mode 100644 index 439987b..0000000 --- a/vendor/gonum.org/v1/gonum/internal/cmplx64/sqrt.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Copyright ©2017 The Gonum 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 cmplx64 - -import math "gonum.org/v1/gonum/internal/math32" - -// The original C code, the long comment, and the constants -// below are from http://netlib.sandia.gov/cephes/c9x-complex/clog.c. -// The go code is a simplified version of the original C. -// -// Cephes Math Library Release 2.8: June, 2000 -// Copyright 1984, 1987, 1989, 1992, 2000 by Stephen L. Moshier -// -// The readme file at http://netlib.sandia.gov/cephes/ says: -// Some software in this archive may be from the book _Methods and -// Programs for Mathematical Functions_ (Prentice-Hall or Simon & Schuster -// International, 1989) or from the Cephes Mathematical Library, a -// commercial product. In either event, it is copyrighted by the author. -// What you see here may be used freely but it comes with no support or -// guarantee. -// -// The two known misprints in the book are repaired here in the -// source listings for the gamma function and the incomplete beta -// integral. -// -// Stephen L. Moshier -// moshier@na-net.ornl.gov - -// Complex square root -// -// DESCRIPTION: -// -// If z = x + iy, r = |z|, then -// -// 1/2 -// Re w = [ (r + x)/2 ] , -// -// 1/2 -// Im w = [ (r - x)/2 ] . -// -// Cancelation error in r-x or r+x is avoided by using the -// identity 2 Re w Im w = y. -// -// Note that -w is also a square root of z. The root chosen -// is always in the right half plane and Im w has the same sign as y. -// -// ACCURACY: -// -// Relative error: -// arithmetic domain # trials peak rms -// DEC -10,+10 25000 3.2e-17 9.6e-18 -// IEEE -10,+10 1,000,000 2.9e-16 6.1e-17 - -// Sqrt returns the square root of x. -// The result r is chosen so that real(r) ≥ 0 and imag(r) has the same sign as imag(x). -func Sqrt(x complex64) complex64 { - if imag(x) == 0 { - if real(x) == 0 { - return complex(0, 0) - } - if real(x) < 0 { - return complex(0, math.Sqrt(-real(x))) - } - return complex(math.Sqrt(real(x)), 0) - } - if real(x) == 0 { - if imag(x) < 0 { - r := math.Sqrt(-0.5 * imag(x)) - return complex(r, -r) - } - r := math.Sqrt(0.5 * imag(x)) - return complex(r, r) - } - a := real(x) - b := imag(x) - var scale float32 - // Rescale to avoid internal overflow or underflow. - if math.Abs(a) > 4 || math.Abs(b) > 4 { - a *= 0.25 - b *= 0.25 - scale = 2 - } else { - a *= 1.8014398509481984e16 // 2**54 - b *= 1.8014398509481984e16 - scale = 7.450580596923828125e-9 // 2**-27 - } - r := math.Hypot(a, b) - var t float32 - if a > 0 { - t = math.Sqrt(0.5*r + 0.5*a) - r = scale * math.Abs((0.5*b)/t) - t *= scale - } else { - r = math.Sqrt(0.5*r - 0.5*a) - t = scale * math.Abs((0.5*b)/r) - r *= scale - } - if b < 0 { - return complex(t, -r) - } - return complex(t, r) -} diff --git a/vendor/gonum.org/v1/gonum/internal/math32/doc.go b/vendor/gonum.org/v1/gonum/internal/math32/doc.go deleted file mode 100644 index 68917c6..0000000 --- a/vendor/gonum.org/v1/gonum/internal/math32/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright ©2017 The Gonum 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 math32 provides float32 versions of standard library math package -// routines used by gonum/blas/native. -package math32 // import "gonum.org/v1/gonum/internal/math32" diff --git a/vendor/gonum.org/v1/gonum/internal/math32/math.go b/vendor/gonum.org/v1/gonum/internal/math32/math.go deleted file mode 100644 index 56c90be..0000000 --- a/vendor/gonum.org/v1/gonum/internal/math32/math.go +++ /dev/null @@ -1,111 +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. - -// Copyright ©2015 The Gonum 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 math32 - -import ( - "math" -) - -const ( - unan = 0x7fc00000 - uinf = 0x7f800000 - uneginf = 0xff800000 - mask = 0x7f8 >> 3 - shift = 32 - 8 - 1 - bias = 127 -) - -// Abs returns the absolute value of x. -// -// Special cases are: -// Abs(±Inf) = +Inf -// Abs(NaN) = NaN -func Abs(x float32) float32 { - switch { - case x < 0: - return -x - case x == 0: - return 0 // return correctly abs(-0) - } - return x -} - -// Copysign returns a value with the magnitude -// of x and the sign of y. -func Copysign(x, y float32) float32 { - const sign = 1 << 31 - return math.Float32frombits(math.Float32bits(x)&^sign | math.Float32bits(y)&sign) -} - -// Hypot returns Sqrt(p*p + q*q), taking care to avoid -// unnecessary overflow and underflow. -// -// Special cases are: -// Hypot(±Inf, q) = +Inf -// Hypot(p, ±Inf) = +Inf -// Hypot(NaN, q) = NaN -// Hypot(p, NaN) = NaN -func Hypot(p, q float32) float32 { - // special cases - switch { - case IsInf(p, 0) || IsInf(q, 0): - return Inf(1) - case IsNaN(p) || IsNaN(q): - return NaN() - } - if p < 0 { - p = -p - } - if q < 0 { - q = -q - } - if p < q { - p, q = q, p - } - if p == 0 { - return 0 - } - q = q / p - return p * Sqrt(1+q*q) -} - -// Inf returns positive infinity if sign >= 0, negative infinity if sign < 0. -func Inf(sign int) float32 { - var v uint32 - if sign >= 0 { - v = uinf - } else { - v = uneginf - } - return math.Float32frombits(v) -} - -// IsInf reports whether f is an infinity, according to sign. -// If sign > 0, IsInf reports whether f is positive infinity. -// If sign < 0, IsInf reports whether f is negative infinity. -// If sign == 0, IsInf reports whether f is either infinity. -func IsInf(f float32, sign int) bool { - // Test for infinity by comparing against maximum float. - // To avoid the floating-point hardware, could use: - // x := math.Float32bits(f); - // return sign >= 0 && x == uinf || sign <= 0 && x == uneginf; - return sign >= 0 && f > math.MaxFloat32 || sign <= 0 && f < -math.MaxFloat32 -} - -// IsNaN reports whether f is an IEEE 754 ``not-a-number'' value. -func IsNaN(f float32) (is bool) { - // IEEE 754 says that only NaNs satisfy f != f. - // To avoid the floating-point hardware, could use: - // x := math.Float32bits(f); - // return uint32(x>>shift)&mask == mask && x != uinf && x != uneginf - return f != f -} - -// NaN returns an IEEE 754 ``not-a-number'' value. -func NaN() float32 { return math.Float32frombits(unan) } diff --git a/vendor/gonum.org/v1/gonum/internal/math32/signbit.go b/vendor/gonum.org/v1/gonum/internal/math32/signbit.go deleted file mode 100644 index 3e9f0bb..0000000 --- a/vendor/gonum.org/v1/gonum/internal/math32/signbit.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Copyright ©2017 The Gonum 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 math32 - -import "math" - -// Signbit returns true if x is negative or negative zero. -func Signbit(x float32) bool { - return math.Float32bits(x)&(1<<31) != 0 -} diff --git a/vendor/gonum.org/v1/gonum/internal/math32/sqrt.go b/vendor/gonum.org/v1/gonum/internal/math32/sqrt.go deleted file mode 100644 index d5b179e..0000000 --- a/vendor/gonum.org/v1/gonum/internal/math32/sqrt.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !amd64,!arm64 noasm appengine safe - -package math32 - -import ( - "math" -) - -// Sqrt returns the square root of x. -// -// Special cases are: -// Sqrt(+Inf) = +Inf -// Sqrt(±0) = ±0 -// Sqrt(x < 0) = NaN -// Sqrt(NaN) = NaN -func Sqrt(x float32) float32 { - // FIXME(kortschak): Direct translation of the math package - // asm code for 386 fails to build. - return float32(math.Sqrt(float64(x))) -} diff --git a/vendor/gonum.org/v1/gonum/internal/math32/sqrt_amd64.go b/vendor/gonum.org/v1/gonum/internal/math32/sqrt_amd64.go deleted file mode 100644 index 905ae5c..0000000 --- a/vendor/gonum.org/v1/gonum/internal/math32/sqrt_amd64.go +++ /dev/null @@ -1,20 +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. - -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -package math32 - -// Sqrt returns the square root of x. -// -// Special cases are: -// Sqrt(+Inf) = +Inf -// Sqrt(±0) = ±0 -// Sqrt(x < 0) = NaN -// Sqrt(NaN) = NaN -func Sqrt(x float32) float32 diff --git a/vendor/gonum.org/v1/gonum/internal/math32/sqrt_amd64.s b/vendor/gonum.org/v1/gonum/internal/math32/sqrt_amd64.s deleted file mode 100644 index 3b9f6fe..0000000 --- a/vendor/gonum.org/v1/gonum/internal/math32/sqrt_amd64.s +++ /dev/null @@ -1,17 +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. - -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// func Sqrt(x float32) float32 -TEXT ·Sqrt(SB),NOSPLIT,$0 - SQRTSS x+0(FP), X0 - MOVSS X0, ret+8(FP) - RET diff --git a/vendor/gonum.org/v1/gonum/internal/math32/sqrt_arm64.go b/vendor/gonum.org/v1/gonum/internal/math32/sqrt_arm64.go deleted file mode 100644 index 905ae5c..0000000 --- a/vendor/gonum.org/v1/gonum/internal/math32/sqrt_arm64.go +++ /dev/null @@ -1,20 +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. - -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -package math32 - -// Sqrt returns the square root of x. -// -// Special cases are: -// Sqrt(+Inf) = +Inf -// Sqrt(±0) = ±0 -// Sqrt(x < 0) = NaN -// Sqrt(NaN) = NaN -func Sqrt(x float32) float32 diff --git a/vendor/gonum.org/v1/gonum/internal/math32/sqrt_arm64.s b/vendor/gonum.org/v1/gonum/internal/math32/sqrt_arm64.s deleted file mode 100644 index 74df8fd..0000000 --- a/vendor/gonum.org/v1/gonum/internal/math32/sqrt_arm64.s +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Copyright ©2020 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// func Sqrt(x float32) float32 -TEXT ·Sqrt(SB),NOSPLIT,$0 - FMOVS x+0(FP), F0 - FSQRTS F0, F0 - FMOVS F0, ret+8(FP) - RET diff --git a/vendor/gonum.org/v1/gonum/lapack/.gitignore b/vendor/gonum.org/v1/gonum/lapack/.gitignore deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/gonum.org/v1/gonum/lapack/README.md b/vendor/gonum.org/v1/gonum/lapack/README.md deleted file mode 100644 index c355017..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/README.md +++ /dev/null @@ -1,28 +0,0 @@ -Gonum LAPACK [![GoDoc](https://godoc.org/gonum.org/v1/gonum/lapack?status.svg)](https://godoc.org/gonum.org/v1/gonum/lapack) -====== - -A collection of packages to provide LAPACK functionality for the Go programming -language (http://golang.org). This provides a partial implementation in native go -and a wrapper using cgo to a c-based implementation. - -## Installation - -``` - go get gonum.org/v1/gonum/lapack/... -``` - -## Packages - -### lapack - -Defines the LAPACK API based on http://www.netlib.org/lapack/lapacke.html - -### lapack/gonum - -Go implementation of the LAPACK API (incomplete, implements the `float64` API). - -### lapack/lapack64 - -Wrappers for an implementation of the double (i.e., `float64`) precision real parts of -the LAPACK API. - diff --git a/vendor/gonum.org/v1/gonum/lapack/doc.go b/vendor/gonum.org/v1/gonum/lapack/doc.go deleted file mode 100644 index 2475cb4..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright ©2018 The Gonum 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 lapack provides interfaces for the LAPACK linear algebra standard. -package lapack // import "gonum.org/v1/gonum/lapack" diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dbdsqr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dbdsqr.go deleted file mode 100644 index acbf453..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dbdsqr.go +++ /dev/null @@ -1,505 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dbdsqr performs a singular value decomposition of a real n×n bidiagonal matrix. -// -// The SVD of the bidiagonal matrix B is -// B = Q * S * Pᵀ -// where S is a diagonal matrix of singular values, Q is an orthogonal matrix of -// left singular vectors, and P is an orthogonal matrix of right singular vectors. -// -// Q and P are only computed if requested. If left singular vectors are requested, -// this routine returns U * Q instead of Q, and if right singular vectors are -// requested Pᵀ * VT is returned instead of Pᵀ. -// -// Frequently Dbdsqr is used in conjunction with Dgebrd which reduces a general -// matrix A into bidiagonal form. In this case, the SVD of A is -// A = (U * Q) * S * (Pᵀ * VT) -// -// This routine may also compute Qᵀ * C. -// -// d and e contain the elements of the bidiagonal matrix b. d must have length at -// least n, and e must have length at least n-1. Dbdsqr will panic if there is -// insufficient length. On exit, D contains the singular values of B in decreasing -// order. -// -// VT is a matrix of size n×ncvt whose elements are stored in vt. The elements -// of vt are modified to contain Pᵀ * VT on exit. VT is not used if ncvt == 0. -// -// U is a matrix of size nru×n whose elements are stored in u. The elements -// of u are modified to contain U * Q on exit. U is not used if nru == 0. -// -// C is a matrix of size n×ncc whose elements are stored in c. The elements -// of c are modified to contain Qᵀ * C on exit. C is not used if ncc == 0. -// -// work contains temporary storage and must have length at least 4*(n-1). Dbdsqr -// will panic if there is insufficient working memory. -// -// Dbdsqr returns whether the decomposition was successful. -// -// Dbdsqr is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dbdsqr(uplo blas.Uplo, n, ncvt, nru, ncc int, d, e, vt []float64, ldvt int, u []float64, ldu int, c []float64, ldc int, work []float64) (ok bool) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case ncvt < 0: - panic(ncvtLT0) - case nru < 0: - panic(nruLT0) - case ncc < 0: - panic(nccLT0) - case ldvt < max(1, ncvt): - panic(badLdVT) - case (ldu < max(1, n) && nru > 0) || (ldu < 1 && nru == 0): - panic(badLdU) - case ldc < max(1, ncc): - panic(badLdC) - } - - // Quick return if possible. - if n == 0 { - return true - } - - if len(vt) < (n-1)*ldvt+ncvt && ncvt != 0 { - panic(shortVT) - } - if len(u) < (nru-1)*ldu+n && nru != 0 { - panic(shortU) - } - if len(c) < (n-1)*ldc+ncc && ncc != 0 { - panic(shortC) - } - if len(d) < n { - panic(shortD) - } - if len(e) < n-1 { - panic(shortE) - } - if len(work) < 4*(n-1) { - panic(shortWork) - } - - var info int - bi := blas64.Implementation() - const maxIter = 6 - - if n != 1 { - // If the singular vectors do not need to be computed, use qd algorithm. - if !(ncvt > 0 || nru > 0 || ncc > 0) { - info = impl.Dlasq1(n, d, e, work) - // If info is 2 dqds didn't finish, and so try to. - if info != 2 { - return info == 0 - } - } - nm1 := n - 1 - nm12 := nm1 + nm1 - nm13 := nm12 + nm1 - idir := 0 - - eps := dlamchE - unfl := dlamchS - lower := uplo == blas.Lower - var cs, sn, r float64 - if lower { - for i := 0; i < n-1; i++ { - cs, sn, r = impl.Dlartg(d[i], e[i]) - d[i] = r - e[i] = sn * d[i+1] - d[i+1] *= cs - work[i] = cs - work[nm1+i] = sn - } - if nru > 0 { - impl.Dlasr(blas.Right, lapack.Variable, lapack.Forward, nru, n, work, work[n-1:], u, ldu) - } - if ncc > 0 { - impl.Dlasr(blas.Left, lapack.Variable, lapack.Forward, n, ncc, work, work[n-1:], c, ldc) - } - } - // Compute singular values to a relative accuracy of tol. If tol is negative - // the values will be computed to an absolute accuracy of math.Abs(tol) * norm(b) - tolmul := math.Max(10, math.Min(100, math.Pow(eps, -1.0/8))) - tol := tolmul * eps - var smax float64 - for i := 0; i < n; i++ { - smax = math.Max(smax, math.Abs(d[i])) - } - for i := 0; i < n-1; i++ { - smax = math.Max(smax, math.Abs(e[i])) - } - - var sminl float64 - var thresh float64 - if tol >= 0 { - sminoa := math.Abs(d[0]) - if sminoa != 0 { - mu := sminoa - for i := 1; i < n; i++ { - mu = math.Abs(d[i]) * (mu / (mu + math.Abs(e[i-1]))) - sminoa = math.Min(sminoa, mu) - if sminoa == 0 { - break - } - } - } - sminoa = sminoa / math.Sqrt(float64(n)) - thresh = math.Max(tol*sminoa, float64(maxIter*n*n)*unfl) - } else { - thresh = math.Max(math.Abs(tol)*smax, float64(maxIter*n*n)*unfl) - } - // Prepare for the main iteration loop for the singular values. - maxIt := maxIter * n * n - iter := 0 - oldl2 := -1 - oldm := -1 - // m points to the last element of unconverged part of matrix. - m := n - - Outer: - for m > 1 { - if iter > maxIt { - info = 0 - for i := 0; i < n-1; i++ { - if e[i] != 0 { - info++ - } - } - return info == 0 - } - // Find diagonal block of matrix to work on. - if tol < 0 && math.Abs(d[m-1]) <= thresh { - d[m-1] = 0 - } - smax = math.Abs(d[m-1]) - smin := smax - var l2 int - var broke bool - for l3 := 0; l3 < m-1; l3++ { - l2 = m - l3 - 2 - abss := math.Abs(d[l2]) - abse := math.Abs(e[l2]) - if tol < 0 && abss <= thresh { - d[l2] = 0 - } - if abse <= thresh { - broke = true - break - } - smin = math.Min(smin, abss) - smax = math.Max(math.Max(smax, abss), abse) - } - if broke { - e[l2] = 0 - if l2 == m-2 { - // Convergence of bottom singular value, return to top. - m-- - continue - } - l2++ - } else { - l2 = 0 - } - // e[ll] through e[m-2] are nonzero, e[ll-1] is zero - if l2 == m-2 { - // Handle 2×2 block separately. - var sinr, cosr, sinl, cosl float64 - d[m-1], d[m-2], sinr, cosr, sinl, cosl = impl.Dlasv2(d[m-2], e[m-2], d[m-1]) - e[m-2] = 0 - if ncvt > 0 { - bi.Drot(ncvt, vt[(m-2)*ldvt:], 1, vt[(m-1)*ldvt:], 1, cosr, sinr) - } - if nru > 0 { - bi.Drot(nru, u[m-2:], ldu, u[m-1:], ldu, cosl, sinl) - } - if ncc > 0 { - bi.Drot(ncc, c[(m-2)*ldc:], 1, c[(m-1)*ldc:], 1, cosl, sinl) - } - m -= 2 - continue - } - // If working on a new submatrix, choose shift direction from larger end - // diagonal element toward smaller. - if l2 > oldm-1 || m-1 < oldl2 { - if math.Abs(d[l2]) >= math.Abs(d[m-1]) { - idir = 1 - } else { - idir = 2 - } - } - // Apply convergence tests. - // TODO(btracey): There is a lot of similar looking code here. See - // if there is a better way to de-duplicate. - if idir == 1 { - // Run convergence test in forward direction. - // First apply standard test to bottom of matrix. - if math.Abs(e[m-2]) <= math.Abs(tol)*math.Abs(d[m-1]) || (tol < 0 && math.Abs(e[m-2]) <= thresh) { - e[m-2] = 0 - continue - } - if tol >= 0 { - // If relative accuracy desired, apply convergence criterion forward. - mu := math.Abs(d[l2]) - sminl = mu - for l3 := l2; l3 < m-1; l3++ { - if math.Abs(e[l3]) <= tol*mu { - e[l3] = 0 - continue Outer - } - mu = math.Abs(d[l3+1]) * (mu / (mu + math.Abs(e[l3]))) - sminl = math.Min(sminl, mu) - } - } - } else { - // Run convergence test in backward direction. - // First apply standard test to top of matrix. - if math.Abs(e[l2]) <= math.Abs(tol)*math.Abs(d[l2]) || (tol < 0 && math.Abs(e[l2]) <= thresh) { - e[l2] = 0 - continue - } - if tol >= 0 { - // If relative accuracy desired, apply convergence criterion backward. - mu := math.Abs(d[m-1]) - sminl = mu - for l3 := m - 2; l3 >= l2; l3-- { - if math.Abs(e[l3]) <= tol*mu { - e[l3] = 0 - continue Outer - } - mu = math.Abs(d[l3]) * (mu / (mu + math.Abs(e[l3]))) - sminl = math.Min(sminl, mu) - } - } - } - oldl2 = l2 - oldm = m - // Compute shift. First, test if shifting would ruin relative accuracy, - // and if so set the shift to zero. - var shift float64 - if tol >= 0 && float64(n)*tol*(sminl/smax) <= math.Max(eps, (1.0/100)*tol) { - shift = 0 - } else { - var sl2 float64 - if idir == 1 { - sl2 = math.Abs(d[l2]) - shift, _ = impl.Dlas2(d[m-2], e[m-2], d[m-1]) - } else { - sl2 = math.Abs(d[m-1]) - shift, _ = impl.Dlas2(d[l2], e[l2], d[l2+1]) - } - // Test if shift is negligible - if sl2 > 0 { - if (shift/sl2)*(shift/sl2) < eps { - shift = 0 - } - } - } - iter += m - l2 + 1 - // If no shift, do simplified QR iteration. - if shift == 0 { - if idir == 1 { - cs := 1.0 - oldcs := 1.0 - var sn, r, oldsn float64 - for i := l2; i < m-1; i++ { - cs, sn, r = impl.Dlartg(d[i]*cs, e[i]) - if i > l2 { - e[i-1] = oldsn * r - } - oldcs, oldsn, d[i] = impl.Dlartg(oldcs*r, d[i+1]*sn) - work[i-l2] = cs - work[i-l2+nm1] = sn - work[i-l2+nm12] = oldcs - work[i-l2+nm13] = oldsn - } - h := d[m-1] * cs - d[m-1] = h * oldcs - e[m-2] = h * oldsn - if ncvt > 0 { - impl.Dlasr(blas.Left, lapack.Variable, lapack.Forward, m-l2, ncvt, work, work[n-1:], vt[l2*ldvt:], ldvt) - } - if nru > 0 { - impl.Dlasr(blas.Right, lapack.Variable, lapack.Forward, nru, m-l2, work[nm12:], work[nm13:], u[l2:], ldu) - } - if ncc > 0 { - impl.Dlasr(blas.Left, lapack.Variable, lapack.Forward, m-l2, ncc, work[nm12:], work[nm13:], c[l2*ldc:], ldc) - } - if math.Abs(e[m-2]) < thresh { - e[m-2] = 0 - } - } else { - cs := 1.0 - oldcs := 1.0 - var sn, r, oldsn float64 - for i := m - 1; i >= l2+1; i-- { - cs, sn, r = impl.Dlartg(d[i]*cs, e[i-1]) - if i < m-1 { - e[i] = oldsn * r - } - oldcs, oldsn, d[i] = impl.Dlartg(oldcs*r, d[i-1]*sn) - work[i-l2-1] = cs - work[i-l2+nm1-1] = -sn - work[i-l2+nm12-1] = oldcs - work[i-l2+nm13-1] = -oldsn - } - h := d[l2] * cs - d[l2] = h * oldcs - e[l2] = h * oldsn - if ncvt > 0 { - impl.Dlasr(blas.Left, lapack.Variable, lapack.Backward, m-l2, ncvt, work[nm12:], work[nm13:], vt[l2*ldvt:], ldvt) - } - if nru > 0 { - impl.Dlasr(blas.Right, lapack.Variable, lapack.Backward, nru, m-l2, work, work[n-1:], u[l2:], ldu) - } - if ncc > 0 { - impl.Dlasr(blas.Left, lapack.Variable, lapack.Backward, m-l2, ncc, work, work[n-1:], c[l2*ldc:], ldc) - } - if math.Abs(e[l2]) <= thresh { - e[l2] = 0 - } - } - } else { - // Use nonzero shift. - if idir == 1 { - // Chase bulge from top to bottom. Save cosines and sines for - // later singular vector updates. - f := (math.Abs(d[l2]) - shift) * (math.Copysign(1, d[l2]) + shift/d[l2]) - g := e[l2] - var cosl, sinl float64 - for i := l2; i < m-1; i++ { - cosr, sinr, r := impl.Dlartg(f, g) - if i > l2 { - e[i-1] = r - } - f = cosr*d[i] + sinr*e[i] - e[i] = cosr*e[i] - sinr*d[i] - g = sinr * d[i+1] - d[i+1] *= cosr - cosl, sinl, r = impl.Dlartg(f, g) - d[i] = r - f = cosl*e[i] + sinl*d[i+1] - d[i+1] = cosl*d[i+1] - sinl*e[i] - if i < m-2 { - g = sinl * e[i+1] - e[i+1] = cosl * e[i+1] - } - work[i-l2] = cosr - work[i-l2+nm1] = sinr - work[i-l2+nm12] = cosl - work[i-l2+nm13] = sinl - } - e[m-2] = f - if ncvt > 0 { - impl.Dlasr(blas.Left, lapack.Variable, lapack.Forward, m-l2, ncvt, work, work[n-1:], vt[l2*ldvt:], ldvt) - } - if nru > 0 { - impl.Dlasr(blas.Right, lapack.Variable, lapack.Forward, nru, m-l2, work[nm12:], work[nm13:], u[l2:], ldu) - } - if ncc > 0 { - impl.Dlasr(blas.Left, lapack.Variable, lapack.Forward, m-l2, ncc, work[nm12:], work[nm13:], c[l2*ldc:], ldc) - } - if math.Abs(e[m-2]) <= thresh { - e[m-2] = 0 - } - } else { - // Chase bulge from top to bottom. Save cosines and sines for - // later singular vector updates. - f := (math.Abs(d[m-1]) - shift) * (math.Copysign(1, d[m-1]) + shift/d[m-1]) - g := e[m-2] - for i := m - 1; i > l2; i-- { - cosr, sinr, r := impl.Dlartg(f, g) - if i < m-1 { - e[i] = r - } - f = cosr*d[i] + sinr*e[i-1] - e[i-1] = cosr*e[i-1] - sinr*d[i] - g = sinr * d[i-1] - d[i-1] *= cosr - cosl, sinl, r := impl.Dlartg(f, g) - d[i] = r - f = cosl*e[i-1] + sinl*d[i-1] - d[i-1] = cosl*d[i-1] - sinl*e[i-1] - if i > l2+1 { - g = sinl * e[i-2] - e[i-2] *= cosl - } - work[i-l2-1] = cosr - work[i-l2+nm1-1] = -sinr - work[i-l2+nm12-1] = cosl - work[i-l2+nm13-1] = -sinl - } - e[l2] = f - if math.Abs(e[l2]) <= thresh { - e[l2] = 0 - } - if ncvt > 0 { - impl.Dlasr(blas.Left, lapack.Variable, lapack.Backward, m-l2, ncvt, work[nm12:], work[nm13:], vt[l2*ldvt:], ldvt) - } - if nru > 0 { - impl.Dlasr(blas.Right, lapack.Variable, lapack.Backward, nru, m-l2, work, work[n-1:], u[l2:], ldu) - } - if ncc > 0 { - impl.Dlasr(blas.Left, lapack.Variable, lapack.Backward, m-l2, ncc, work, work[n-1:], c[l2*ldc:], ldc) - } - } - } - } - } - - // All singular values converged, make them positive. - for i := 0; i < n; i++ { - if d[i] < 0 { - d[i] *= -1 - if ncvt > 0 { - bi.Dscal(ncvt, -1, vt[i*ldvt:], 1) - } - } - } - - // Sort the singular values in decreasing order. - for i := 0; i < n-1; i++ { - isub := 0 - smin := d[0] - for j := 1; j < n-i; j++ { - if d[j] <= smin { - isub = j - smin = d[j] - } - } - if isub != n-i { - // Swap singular values and vectors. - d[isub] = d[n-i-1] - d[n-i-1] = smin - if ncvt > 0 { - bi.Dswap(ncvt, vt[isub*ldvt:], 1, vt[(n-i-1)*ldvt:], 1) - } - if nru > 0 { - bi.Dswap(nru, u[isub:], ldu, u[n-i-1:], ldu) - } - if ncc > 0 { - bi.Dswap(ncc, c[isub*ldc:], 1, c[(n-i-1)*ldc:], 1) - } - } - } - info = 0 - for i := 0; i < n-1; i++ { - if e[i] != 0 { - info++ - } - } - return info == 0 -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dcombssq.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dcombssq.go deleted file mode 100644 index e807e0a..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dcombssq.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright ©2019 The Gonum 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 gonum - -// Dcombssq adds two scaled sum-of-squares quantities, V := V1 + V2, -// V_scale^2 * V_ssq := V1_scale^2 * V1_ssq + V2_scale^2 * V2_ssq -// and returns the result V. -// -// Dcombssq is an internal routine. It is exported for testing purposes. -func (Implementation) Dcombssq(scale1, ssq1, scale2, ssq2 float64) (scale, ssq float64) { - if scale1 >= scale2 { - if scale1 != 0 { - return scale1, ssq1 + (scale2/scale1)*(scale2/scale1)*ssq2 - } - // If the input is non-negative and we are here, then scale2 must inevitably be 0, too. - return 0, 0 - } - return scale2, ssq2 + (scale1/scale2)*(scale1/scale2)*ssq1 -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgebak.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgebak.go deleted file mode 100644 index b8c6120..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgebak.go +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dgebak updates an n×m matrix V as -// V = P D V if side == lapack.EVRight, -// V = P D^{-1} V if side == lapack.EVLeft, -// where P and D are n×n permutation and scaling matrices, respectively, -// implicitly represented by job, scale, ilo and ihi as returned by Dgebal. -// -// Typically, columns of the matrix V contain the right or left (determined by -// side) eigenvectors of the balanced matrix output by Dgebal, and Dgebak forms -// the eigenvectors of the original matrix. -// -// Dgebak is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dgebak(job lapack.BalanceJob, side lapack.EVSide, n, ilo, ihi int, scale []float64, m int, v []float64, ldv int) { - switch { - case job != lapack.BalanceNone && job != lapack.Permute && job != lapack.Scale && job != lapack.PermuteScale: - panic(badBalanceJob) - case side != lapack.EVLeft && side != lapack.EVRight: - panic(badEVSide) - case n < 0: - panic(nLT0) - case ilo < 0 || max(0, n-1) < ilo: - panic(badIlo) - case ihi < min(ilo, n-1) || n <= ihi: - panic(badIhi) - case m < 0: - panic(mLT0) - case ldv < max(1, m): - panic(badLdV) - } - - // Quick return if possible. - if n == 0 || m == 0 { - return - } - - if len(scale) < n { - panic(shortScale) - } - if len(v) < (n-1)*ldv+m { - panic(shortV) - } - - // Quick return if possible. - if job == lapack.BalanceNone { - return - } - - bi := blas64.Implementation() - if ilo != ihi && job != lapack.Permute { - // Backward balance. - if side == lapack.EVRight { - for i := ilo; i <= ihi; i++ { - bi.Dscal(m, scale[i], v[i*ldv:], 1) - } - } else { - for i := ilo; i <= ihi; i++ { - bi.Dscal(m, 1/scale[i], v[i*ldv:], 1) - } - } - } - if job == lapack.Scale { - return - } - // Backward permutation. - for i := ilo - 1; i >= 0; i-- { - k := int(scale[i]) - if k == i { - continue - } - bi.Dswap(m, v[i*ldv:], 1, v[k*ldv:], 1) - } - for i := ihi + 1; i < n; i++ { - k := int(scale[i]) - if k == i { - continue - } - bi.Dswap(m, v[i*ldv:], 1, v[k*ldv:], 1) - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgebal.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgebal.go deleted file mode 100644 index f4690b5..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgebal.go +++ /dev/null @@ -1,239 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dgebal balances an n×n matrix A. Balancing consists of two stages, permuting -// and scaling. Both steps are optional and depend on the value of job. -// -// Permuting consists of applying a permutation matrix P such that the matrix -// that results from Pᵀ*A*P takes the upper block triangular form -// [ T1 X Y ] -// Pᵀ A P = [ 0 B Z ], -// [ 0 0 T2 ] -// where T1 and T2 are upper triangular matrices and B contains at least one -// nonzero off-diagonal element in each row and column. The indices ilo and ihi -// mark the starting and ending columns of the submatrix B. The eigenvalues of A -// isolated in the first 0 to ilo-1 and last ihi+1 to n-1 elements on the -// diagonal can be read off without any roundoff error. -// -// Scaling consists of applying a diagonal similarity transformation D such that -// D^{-1}*B*D has the 1-norm of each row and its corresponding column nearly -// equal. The output matrix is -// [ T1 X*D Y ] -// [ 0 inv(D)*B*D inv(D)*Z ]. -// [ 0 0 T2 ] -// Scaling may reduce the 1-norm of the matrix, and improve the accuracy of -// the computed eigenvalues and/or eigenvectors. -// -// job specifies the operations that will be performed on A. -// If job is lapack.BalanceNone, Dgebal sets scale[i] = 1 for all i and returns ilo=0, ihi=n-1. -// If job is lapack.Permute, only permuting will be done. -// If job is lapack.Scale, only scaling will be done. -// If job is lapack.PermuteScale, both permuting and scaling will be done. -// -// On return, if job is lapack.Permute or lapack.PermuteScale, it will hold that -// A[i,j] == 0, for i > j and j ∈ {0, ..., ilo-1, ihi+1, ..., n-1}. -// If job is lapack.BalanceNone or lapack.Scale, or if n == 0, it will hold that -// ilo == 0 and ihi == n-1. -// -// On return, scale will contain information about the permutations and scaling -// factors applied to A. If π(j) denotes the index of the column interchanged -// with column j, and D[j,j] denotes the scaling factor applied to column j, -// then -// scale[j] == π(j), for j ∈ {0, ..., ilo-1, ihi+1, ..., n-1}, -// == D[j,j], for j ∈ {ilo, ..., ihi}. -// scale must have length equal to n, otherwise Dgebal will panic. -// -// Dgebal is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dgebal(job lapack.BalanceJob, n int, a []float64, lda int, scale []float64) (ilo, ihi int) { - switch { - case job != lapack.BalanceNone && job != lapack.Permute && job != lapack.Scale && job != lapack.PermuteScale: - panic(badBalanceJob) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - ilo = 0 - ihi = n - 1 - - if n == 0 { - return ilo, ihi - } - - if len(scale) != n { - panic(shortScale) - } - - if job == lapack.BalanceNone { - for i := range scale { - scale[i] = 1 - } - return ilo, ihi - } - - if len(a) < (n-1)*lda+n { - panic(shortA) - } - - bi := blas64.Implementation() - swapped := true - - if job == lapack.Scale { - goto scaling - } - - // Permutation to isolate eigenvalues if possible. - // - // Search for rows isolating an eigenvalue and push them down. - for swapped { - swapped = false - rows: - for i := ihi; i >= 0; i-- { - for j := 0; j <= ihi; j++ { - if i == j { - continue - } - if a[i*lda+j] != 0 { - continue rows - } - } - // Row i has only zero off-diagonal elements in the - // block A[ilo:ihi+1,ilo:ihi+1]. - scale[ihi] = float64(i) - if i != ihi { - bi.Dswap(ihi+1, a[i:], lda, a[ihi:], lda) - bi.Dswap(n, a[i*lda:], 1, a[ihi*lda:], 1) - } - if ihi == 0 { - scale[0] = 1 - return ilo, ihi - } - ihi-- - swapped = true - break - } - } - // Search for columns isolating an eigenvalue and push them left. - swapped = true - for swapped { - swapped = false - columns: - for j := ilo; j <= ihi; j++ { - for i := ilo; i <= ihi; i++ { - if i == j { - continue - } - if a[i*lda+j] != 0 { - continue columns - } - } - // Column j has only zero off-diagonal elements in the - // block A[ilo:ihi+1,ilo:ihi+1]. - scale[ilo] = float64(j) - if j != ilo { - bi.Dswap(ihi+1, a[j:], lda, a[ilo:], lda) - bi.Dswap(n-ilo, a[j*lda+ilo:], 1, a[ilo*lda+ilo:], 1) - } - swapped = true - ilo++ - break - } - } - -scaling: - for i := ilo; i <= ihi; i++ { - scale[i] = 1 - } - - if job == lapack.Permute { - return ilo, ihi - } - - // Balance the submatrix in rows ilo to ihi. - - const ( - // sclfac should be a power of 2 to avoid roundoff errors. - // Elements of scale are restricted to powers of sclfac, - // therefore the matrix will be only nearly balanced. - sclfac = 2 - // factor determines the minimum reduction of the row and column - // norms that is considered non-negligible. It must be less than 1. - factor = 0.95 - ) - sfmin1 := dlamchS / dlamchP - sfmax1 := 1 / sfmin1 - sfmin2 := sfmin1 * sclfac - sfmax2 := 1 / sfmin2 - - // Iterative loop for norm reduction. - var conv bool - for !conv { - conv = true - for i := ilo; i <= ihi; i++ { - c := bi.Dnrm2(ihi-ilo+1, a[ilo*lda+i:], lda) - r := bi.Dnrm2(ihi-ilo+1, a[i*lda+ilo:], 1) - ica := bi.Idamax(ihi+1, a[i:], lda) - ca := math.Abs(a[ica*lda+i]) - ira := bi.Idamax(n-ilo, a[i*lda+ilo:], 1) - ra := math.Abs(a[i*lda+ilo+ira]) - - // Guard against zero c or r due to underflow. - if c == 0 || r == 0 { - continue - } - g := r / sclfac - f := 1.0 - s := c + r - for c < g && math.Max(f, math.Max(c, ca)) < sfmax2 && math.Min(r, math.Min(g, ra)) > sfmin2 { - if math.IsNaN(c + f + ca + r + g + ra) { - // Panic if NaN to avoid infinite loop. - panic("lapack: NaN") - } - f *= sclfac - c *= sclfac - ca *= sclfac - g /= sclfac - r /= sclfac - ra /= sclfac - } - g = c / sclfac - for r <= g && math.Max(r, ra) < sfmax2 && math.Min(math.Min(f, c), math.Min(g, ca)) > sfmin2 { - f /= sclfac - c /= sclfac - ca /= sclfac - g /= sclfac - r *= sclfac - ra *= sclfac - } - - if c+r >= factor*s { - // Reduction would be negligible. - continue - } - if f < 1 && scale[i] < 1 && f*scale[i] <= sfmin1 { - continue - } - if f > 1 && scale[i] > 1 && scale[i] >= sfmax1/f { - continue - } - - // Now balance. - scale[i] *= f - bi.Dscal(n-ilo, 1/f, a[i*lda+ilo:], 1) - bi.Dscal(ihi+1, f, a[i:], lda) - conv = false - } - } - return ilo, ihi -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgebd2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgebd2.go deleted file mode 100644 index 6dc97ce..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgebd2.go +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import "gonum.org/v1/gonum/blas" - -// Dgebd2 reduces an m×n matrix A to upper or lower bidiagonal form by an orthogonal -// transformation. -// Qᵀ * A * P = B -// if m >= n, B is upper diagonal, otherwise B is lower bidiagonal. -// d is the diagonal, len = min(m,n) -// e is the off-diagonal len = min(m,n)-1 -// -// Dgebd2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dgebd2(m, n int, a []float64, lda int, d, e, tauQ, tauP, work []float64) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - minmn := min(m, n) - if minmn == 0 { - return - } - - switch { - case len(d) < minmn: - panic(shortD) - case len(e) < minmn-1: - panic(shortE) - case len(tauQ) < minmn: - panic(shortTauQ) - case len(tauP) < minmn: - panic(shortTauP) - case len(work) < max(m, n): - panic(shortWork) - } - - if m >= n { - for i := 0; i < n; i++ { - a[i*lda+i], tauQ[i] = impl.Dlarfg(m-i, a[i*lda+i], a[min(i+1, m-1)*lda+i:], lda) - d[i] = a[i*lda+i] - a[i*lda+i] = 1 - // Apply H_i to A[i:m, i+1:n] from the left. - if i < n-1 { - impl.Dlarf(blas.Left, m-i, n-i-1, a[i*lda+i:], lda, tauQ[i], a[i*lda+i+1:], lda, work) - } - a[i*lda+i] = d[i] - if i < n-1 { - a[i*lda+i+1], tauP[i] = impl.Dlarfg(n-i-1, a[i*lda+i+1], a[i*lda+min(i+2, n-1):], 1) - e[i] = a[i*lda+i+1] - a[i*lda+i+1] = 1 - impl.Dlarf(blas.Right, m-i-1, n-i-1, a[i*lda+i+1:], 1, tauP[i], a[(i+1)*lda+i+1:], lda, work) - a[i*lda+i+1] = e[i] - } else { - tauP[i] = 0 - } - } - return - } - for i := 0; i < m; i++ { - a[i*lda+i], tauP[i] = impl.Dlarfg(n-i, a[i*lda+i], a[i*lda+min(i+1, n-1):], 1) - d[i] = a[i*lda+i] - a[i*lda+i] = 1 - if i < m-1 { - impl.Dlarf(blas.Right, m-i-1, n-i, a[i*lda+i:], 1, tauP[i], a[(i+1)*lda+i:], lda, work) - } - a[i*lda+i] = d[i] - if i < m-1 { - a[(i+1)*lda+i], tauQ[i] = impl.Dlarfg(m-i-1, a[(i+1)*lda+i], a[min(i+2, m-1)*lda+i:], lda) - e[i] = a[(i+1)*lda+i] - a[(i+1)*lda+i] = 1 - impl.Dlarf(blas.Left, m-i-1, n-i-1, a[(i+1)*lda+i:], lda, tauQ[i], a[(i+1)*lda+i+1:], lda, work) - a[(i+1)*lda+i] = e[i] - } else { - tauQ[i] = 0 - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgebrd.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgebrd.go deleted file mode 100644 index 8faef13..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgebrd.go +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dgebrd reduces a general m×n matrix A to upper or lower bidiagonal form B by -// an orthogonal transformation: -// Qᵀ * A * P = B. -// The diagonal elements of B are stored in d and the off-diagonal elements are stored -// in e. These are additionally stored along the diagonal of A and the off-diagonal -// of A. If m >= n B is an upper-bidiagonal matrix, and if m < n B is a -// lower-bidiagonal matrix. -// -// The remaining elements of A store the data needed to construct Q and P. -// The matrices Q and P are products of elementary reflectors -// if m >= n, Q = H_0 * H_1 * ... * H_{n-1}, -// P = G_0 * G_1 * ... * G_{n-2}, -// if m < n, Q = H_0 * H_1 * ... * H_{m-2}, -// P = G_0 * G_1 * ... * G_{m-1}, -// where -// H_i = I - tauQ[i] * v_i * v_iᵀ, -// G_i = I - tauP[i] * u_i * u_iᵀ. -// -// As an example, on exit the entries of A when m = 6, and n = 5 -// [ d e u1 u1 u1] -// [v1 d e u2 u2] -// [v1 v2 d e u3] -// [v1 v2 v3 d e] -// [v1 v2 v3 v4 d] -// [v1 v2 v3 v4 v5] -// and when m = 5, n = 6 -// [ d u1 u1 u1 u1 u1] -// [ e d u2 u2 u2 u2] -// [v1 e d u3 u3 u3] -// [v1 v2 e d u4 u4] -// [v1 v2 v3 e d u5] -// -// d, tauQ, and tauP must all have length at least min(m,n), and e must have -// length min(m,n) - 1, unless lwork is -1 when there is no check except for -// work which must have a length of at least one. -// -// work is temporary storage, and lwork specifies the usable memory length. -// At minimum, lwork >= max(1,m,n) or be -1 and this function will panic otherwise. -// Dgebrd is blocked decomposition, but the block size is limited -// by the temporary space available. If lwork == -1, instead of performing Dgebrd, -// the optimal work length will be stored into work[0]. -// -// Dgebrd is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dgebrd(m, n int, a []float64, lda int, d, e, tauQ, tauP, work []float64, lwork int) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case lwork < max(1, max(m, n)) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - minmn := min(m, n) - if minmn == 0 { - work[0] = 1 - return - } - - nb := impl.Ilaenv(1, "DGEBRD", " ", m, n, -1, -1) - lwkopt := (m + n) * nb - if lwork == -1 { - work[0] = float64(lwkopt) - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(d) < minmn: - panic(shortD) - case len(e) < minmn-1: - panic(shortE) - case len(tauQ) < minmn: - panic(shortTauQ) - case len(tauP) < minmn: - panic(shortTauP) - } - - nx := minmn - ws := max(m, n) - if 1 < nb && nb < minmn { - // At least one blocked operation can be done. - // Get the crossover point nx. - nx = max(nb, impl.Ilaenv(3, "DGEBRD", " ", m, n, -1, -1)) - // Determine when to switch from blocked to unblocked code. - if nx < minmn { - // At least one blocked operation will be done. - ws = (m + n) * nb - if lwork < ws { - // Not enough work space for the optimal nb, - // consider using a smaller block size. - nbmin := impl.Ilaenv(2, "DGEBRD", " ", m, n, -1, -1) - if lwork >= (m+n)*nbmin { - // Enough work space for minimum block size. - nb = lwork / (m + n) - } else { - nb = minmn - nx = minmn - } - } - } - } - bi := blas64.Implementation() - ldworkx := nb - ldworky := nb - var i int - for i = 0; i < minmn-nx; i += nb { - // Reduce rows and columns i:i+nb to bidiagonal form and return - // the matrices X and Y which are needed to update the unreduced - // part of the matrix. - // X is stored in the first m rows of work, y in the next rows. - x := work[:m*ldworkx] - y := work[m*ldworkx:] - impl.Dlabrd(m-i, n-i, nb, a[i*lda+i:], lda, - d[i:], e[i:], tauQ[i:], tauP[i:], - x, ldworkx, y, ldworky) - - // Update the trailing submatrix A[i+nb:m,i+nb:n], using an update - // of the form A := A - V*Y**T - X*U**T - bi.Dgemm(blas.NoTrans, blas.Trans, m-i-nb, n-i-nb, nb, - -1, a[(i+nb)*lda+i:], lda, y[nb*ldworky:], ldworky, - 1, a[(i+nb)*lda+i+nb:], lda) - - bi.Dgemm(blas.NoTrans, blas.NoTrans, m-i-nb, n-i-nb, nb, - -1, x[nb*ldworkx:], ldworkx, a[i*lda+i+nb:], lda, - 1, a[(i+nb)*lda+i+nb:], lda) - - // Copy diagonal and off-diagonal elements of B back into A. - if m >= n { - for j := i; j < i+nb; j++ { - a[j*lda+j] = d[j] - a[j*lda+j+1] = e[j] - } - } else { - for j := i; j < i+nb; j++ { - a[j*lda+j] = d[j] - a[(j+1)*lda+j] = e[j] - } - } - } - // Use unblocked code to reduce the remainder of the matrix. - impl.Dgebd2(m-i, n-i, a[i*lda+i:], lda, d[i:], e[i:], tauQ[i:], tauP[i:], work) - work[0] = float64(ws) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgecon.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgecon.go deleted file mode 100644 index 1d1ca58..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgecon.go +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dgecon estimates the reciprocal of the condition number of the n×n matrix A -// given the LU decomposition of the matrix. The condition number computed may -// be based on the 1-norm or the ∞-norm. -// -// The slice a contains the result of the LU decomposition of A as computed by Dgetrf. -// -// anorm is the corresponding 1-norm or ∞-norm of the original matrix A. -// -// work is a temporary data slice of length at least 4*n and Dgecon will panic otherwise. -// -// iwork is a temporary data slice of length at least n and Dgecon will panic otherwise. -func (impl Implementation) Dgecon(norm lapack.MatrixNorm, n int, a []float64, lda int, anorm float64, work []float64, iwork []int) float64 { - switch { - case norm != lapack.MaxColumnSum && norm != lapack.MaxRowSum: - panic(badNorm) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if n == 0 { - return 1 - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(work) < 4*n: - panic(shortWork) - case len(iwork) < n: - panic(shortIWork) - } - - // Quick return if possible. - if anorm == 0 { - return 0 - } - - bi := blas64.Implementation() - var rcond, ainvnm float64 - var kase int - var normin bool - isave := new([3]int) - onenrm := norm == lapack.MaxColumnSum - smlnum := dlamchS - kase1 := 2 - if onenrm { - kase1 = 1 - } - for { - ainvnm, kase = impl.Dlacn2(n, work[n:], work, iwork, ainvnm, kase, isave) - if kase == 0 { - if ainvnm != 0 { - rcond = (1 / ainvnm) / anorm - } - return rcond - } - var sl, su float64 - if kase == kase1 { - sl = impl.Dlatrs(blas.Lower, blas.NoTrans, blas.Unit, normin, n, a, lda, work, work[2*n:]) - su = impl.Dlatrs(blas.Upper, blas.NoTrans, blas.NonUnit, normin, n, a, lda, work, work[3*n:]) - } else { - su = impl.Dlatrs(blas.Upper, blas.Trans, blas.NonUnit, normin, n, a, lda, work, work[3*n:]) - sl = impl.Dlatrs(blas.Lower, blas.Trans, blas.Unit, normin, n, a, lda, work, work[2*n:]) - } - scale := sl * su - normin = true - if scale != 1 { - ix := bi.Idamax(n, work, 1) - if scale == 0 || scale < math.Abs(work[ix])*smlnum { - return rcond - } - impl.Drscl(n, scale, work, 1) - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeev.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgeev.go deleted file mode 100644 index 972e36c..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeev.go +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dgeev computes the eigenvalues and, optionally, the left and/or right -// eigenvectors for an n×n real nonsymmetric matrix A. -// -// The right eigenvector v_j of A corresponding to an eigenvalue λ_j -// is defined by -// A v_j = λ_j v_j, -// and the left eigenvector u_j corresponding to an eigenvalue λ_j is defined by -// u_jᴴ A = λ_j u_jᴴ, -// where u_jᴴ is the conjugate transpose of u_j. -// -// On return, A will be overwritten and the left and right eigenvectors will be -// stored, respectively, in the columns of the n×n matrices VL and VR in the -// same order as their eigenvalues. If the j-th eigenvalue is real, then -// u_j = VL[:,j], -// v_j = VR[:,j], -// and if it is not real, then j and j+1 form a complex conjugate pair and the -// eigenvectors can be recovered as -// u_j = VL[:,j] + i*VL[:,j+1], -// u_{j+1} = VL[:,j] - i*VL[:,j+1], -// v_j = VR[:,j] + i*VR[:,j+1], -// v_{j+1} = VR[:,j] - i*VR[:,j+1], -// where i is the imaginary unit. The computed eigenvectors are normalized to -// have Euclidean norm equal to 1 and largest component real. -// -// Left eigenvectors will be computed only if jobvl == lapack.LeftEVCompute, -// otherwise jobvl must be lapack.LeftEVNone. -// Right eigenvectors will be computed only if jobvr == lapack.RightEVCompute, -// otherwise jobvr must be lapack.RightEVNone. -// For other values of jobvl and jobvr Dgeev will panic. -// -// wr and wi contain the real and imaginary parts, respectively, of the computed -// eigenvalues. Complex conjugate pairs of eigenvalues appear consecutively with -// the eigenvalue having the positive imaginary part first. -// wr and wi must have length n, and Dgeev will panic otherwise. -// -// work must have length at least lwork and lwork must be at least max(1,4*n) if -// the left or right eigenvectors are computed, and at least max(1,3*n) if no -// eigenvectors are computed. For good performance, lwork must generally be -// larger. On return, optimal value of lwork will be stored in work[0]. -// -// If lwork == -1, instead of performing Dgeev, the function only calculates the -// optimal value of lwork and stores it into work[0]. -// -// On return, first is the index of the first valid eigenvalue. If first == 0, -// all eigenvalues and eigenvectors have been computed. If first is positive, -// Dgeev failed to compute all the eigenvalues, no eigenvectors have been -// computed and wr[first:] and wi[first:] contain those eigenvalues which have -// converged. -func (impl Implementation) Dgeev(jobvl lapack.LeftEVJob, jobvr lapack.RightEVJob, n int, a []float64, lda int, wr, wi []float64, vl []float64, ldvl int, vr []float64, ldvr int, work []float64, lwork int) (first int) { - wantvl := jobvl == lapack.LeftEVCompute - wantvr := jobvr == lapack.RightEVCompute - var minwrk int - if wantvl || wantvr { - minwrk = max(1, 4*n) - } else { - minwrk = max(1, 3*n) - } - switch { - case jobvl != lapack.LeftEVCompute && jobvl != lapack.LeftEVNone: - panic(badLeftEVJob) - case jobvr != lapack.RightEVCompute && jobvr != lapack.RightEVNone: - panic(badRightEVJob) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case ldvl < 1 || (ldvl < n && wantvl): - panic(badLdVL) - case ldvr < 1 || (ldvr < n && wantvr): - panic(badLdVR) - case lwork < minwrk && lwork != -1: - panic(badLWork) - case len(work) < lwork: - panic(shortWork) - } - - // Quick return if possible. - if n == 0 { - work[0] = 1 - return 0 - } - - maxwrk := 2*n + n*impl.Ilaenv(1, "DGEHRD", " ", n, 1, n, 0) - if wantvl || wantvr { - maxwrk = max(maxwrk, 2*n+(n-1)*impl.Ilaenv(1, "DORGHR", " ", n, 1, n, -1)) - impl.Dhseqr(lapack.EigenvaluesAndSchur, lapack.SchurOrig, n, 0, n-1, - a, lda, wr, wi, nil, n, work, -1) - maxwrk = max(maxwrk, max(n+1, n+int(work[0]))) - side := lapack.EVLeft - if wantvr { - side = lapack.EVRight - } - impl.Dtrevc3(side, lapack.EVAllMulQ, nil, n, a, lda, vl, ldvl, vr, ldvr, - n, work, -1) - maxwrk = max(maxwrk, n+int(work[0])) - maxwrk = max(maxwrk, 4*n) - } else { - impl.Dhseqr(lapack.EigenvaluesOnly, lapack.SchurNone, n, 0, n-1, - a, lda, wr, wi, vr, ldvr, work, -1) - maxwrk = max(maxwrk, max(n+1, n+int(work[0]))) - } - maxwrk = max(maxwrk, minwrk) - - if lwork == -1 { - work[0] = float64(maxwrk) - return 0 - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(wr) != n: - panic(badLenWr) - case len(wi) != n: - panic(badLenWi) - case len(vl) < (n-1)*ldvl+n && wantvl: - panic(shortVL) - case len(vr) < (n-1)*ldvr+n && wantvr: - panic(shortVR) - } - - // Get machine constants. - smlnum := math.Sqrt(dlamchS) / dlamchP - bignum := 1 / smlnum - - // Scale A if max element outside range [smlnum,bignum]. - anrm := impl.Dlange(lapack.MaxAbs, n, n, a, lda, nil) - var scalea bool - var cscale float64 - if 0 < anrm && anrm < smlnum { - scalea = true - cscale = smlnum - } else if anrm > bignum { - scalea = true - cscale = bignum - } - if scalea { - impl.Dlascl(lapack.General, 0, 0, anrm, cscale, n, n, a, lda) - } - - // Balance the matrix. - workbal := work[:n] - ilo, ihi := impl.Dgebal(lapack.PermuteScale, n, a, lda, workbal) - - // Reduce to upper Hessenberg form. - iwrk := 2 * n - tau := work[n : iwrk-1] - impl.Dgehrd(n, ilo, ihi, a, lda, tau, work[iwrk:], lwork-iwrk) - - var side lapack.EVSide - if wantvl { - side = lapack.EVLeft - // Copy Householder vectors to VL. - impl.Dlacpy(blas.Lower, n, n, a, lda, vl, ldvl) - // Generate orthogonal matrix in VL. - impl.Dorghr(n, ilo, ihi, vl, ldvl, tau, work[iwrk:], lwork-iwrk) - // Perform QR iteration, accumulating Schur vectors in VL. - iwrk = n - first = impl.Dhseqr(lapack.EigenvaluesAndSchur, lapack.SchurOrig, n, ilo, ihi, - a, lda, wr, wi, vl, ldvl, work[iwrk:], lwork-iwrk) - if wantvr { - // Want left and right eigenvectors. - // Copy Schur vectors to VR. - side = lapack.EVBoth - impl.Dlacpy(blas.All, n, n, vl, ldvl, vr, ldvr) - } - } else if wantvr { - side = lapack.EVRight - // Copy Householder vectors to VR. - impl.Dlacpy(blas.Lower, n, n, a, lda, vr, ldvr) - // Generate orthogonal matrix in VR. - impl.Dorghr(n, ilo, ihi, vr, ldvr, tau, work[iwrk:], lwork-iwrk) - // Perform QR iteration, accumulating Schur vectors in VR. - iwrk = n - first = impl.Dhseqr(lapack.EigenvaluesAndSchur, lapack.SchurOrig, n, ilo, ihi, - a, lda, wr, wi, vr, ldvr, work[iwrk:], lwork-iwrk) - } else { - // Compute eigenvalues only. - iwrk = n - first = impl.Dhseqr(lapack.EigenvaluesOnly, lapack.SchurNone, n, ilo, ihi, - a, lda, wr, wi, nil, 1, work[iwrk:], lwork-iwrk) - } - - if first > 0 { - if scalea { - // Undo scaling. - impl.Dlascl(lapack.General, 0, 0, cscale, anrm, n-first, 1, wr[first:], 1) - impl.Dlascl(lapack.General, 0, 0, cscale, anrm, n-first, 1, wi[first:], 1) - impl.Dlascl(lapack.General, 0, 0, cscale, anrm, ilo, 1, wr, 1) - impl.Dlascl(lapack.General, 0, 0, cscale, anrm, ilo, 1, wi, 1) - } - work[0] = float64(maxwrk) - return first - } - - if wantvl || wantvr { - // Compute left and/or right eigenvectors. - impl.Dtrevc3(side, lapack.EVAllMulQ, nil, n, - a, lda, vl, ldvl, vr, ldvr, n, work[iwrk:], lwork-iwrk) - } - bi := blas64.Implementation() - if wantvl { - // Undo balancing of left eigenvectors. - impl.Dgebak(lapack.PermuteScale, lapack.EVLeft, n, ilo, ihi, workbal, n, vl, ldvl) - // Normalize left eigenvectors and make largest component real. - for i, wii := range wi { - if wii < 0 { - continue - } - if wii == 0 { - scl := 1 / bi.Dnrm2(n, vl[i:], ldvl) - bi.Dscal(n, scl, vl[i:], ldvl) - continue - } - scl := 1 / impl.Dlapy2(bi.Dnrm2(n, vl[i:], ldvl), bi.Dnrm2(n, vl[i+1:], ldvl)) - bi.Dscal(n, scl, vl[i:], ldvl) - bi.Dscal(n, scl, vl[i+1:], ldvl) - for k := 0; k < n; k++ { - vi := vl[k*ldvl+i] - vi1 := vl[k*ldvl+i+1] - work[iwrk+k] = vi*vi + vi1*vi1 - } - k := bi.Idamax(n, work[iwrk:iwrk+n], 1) - cs, sn, _ := impl.Dlartg(vl[k*ldvl+i], vl[k*ldvl+i+1]) - bi.Drot(n, vl[i:], ldvl, vl[i+1:], ldvl, cs, sn) - vl[k*ldvl+i+1] = 0 - } - } - if wantvr { - // Undo balancing of right eigenvectors. - impl.Dgebak(lapack.PermuteScale, lapack.EVRight, n, ilo, ihi, workbal, n, vr, ldvr) - // Normalize right eigenvectors and make largest component real. - for i, wii := range wi { - if wii < 0 { - continue - } - if wii == 0 { - scl := 1 / bi.Dnrm2(n, vr[i:], ldvr) - bi.Dscal(n, scl, vr[i:], ldvr) - continue - } - scl := 1 / impl.Dlapy2(bi.Dnrm2(n, vr[i:], ldvr), bi.Dnrm2(n, vr[i+1:], ldvr)) - bi.Dscal(n, scl, vr[i:], ldvr) - bi.Dscal(n, scl, vr[i+1:], ldvr) - for k := 0; k < n; k++ { - vi := vr[k*ldvr+i] - vi1 := vr[k*ldvr+i+1] - work[iwrk+k] = vi*vi + vi1*vi1 - } - k := bi.Idamax(n, work[iwrk:iwrk+n], 1) - cs, sn, _ := impl.Dlartg(vr[k*ldvr+i], vr[k*ldvr+i+1]) - bi.Drot(n, vr[i:], ldvr, vr[i+1:], ldvr, cs, sn) - vr[k*ldvr+i+1] = 0 - } - } - - if scalea { - // Undo scaling. - impl.Dlascl(lapack.General, 0, 0, cscale, anrm, n-first, 1, wr[first:], 1) - impl.Dlascl(lapack.General, 0, 0, cscale, anrm, n-first, 1, wi[first:], 1) - } - - work[0] = float64(maxwrk) - return first -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgehd2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgehd2.go deleted file mode 100644 index 15f45b5..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgehd2.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import "gonum.org/v1/gonum/blas" - -// Dgehd2 reduces a block of a general n×n matrix A to upper Hessenberg form H -// by an orthogonal similarity transformation Qᵀ * A * Q = H. -// -// The matrix Q is represented as a product of (ihi-ilo) elementary -// reflectors -// Q = H_{ilo} H_{ilo+1} ... H_{ihi-1}. -// Each H_i has the form -// H_i = I - tau[i] * v * vᵀ -// where v is a real vector with v[0:i+1] = 0, v[i+1] = 1 and v[ihi+1:n] = 0. -// v[i+2:ihi+1] is stored on exit in A[i+2:ihi+1,i]. -// -// On entry, a contains the n×n general matrix to be reduced. On return, the -// upper triangle and the first subdiagonal of A are overwritten with the upper -// Hessenberg matrix H, and the elements below the first subdiagonal, with the -// slice tau, represent the orthogonal matrix Q as a product of elementary -// reflectors. -// -// The contents of A are illustrated by the following example, with n = 7, ilo = -// 1 and ihi = 5. -// On entry, -// [ a a a a a a a ] -// [ a a a a a a ] -// [ a a a a a a ] -// [ a a a a a a ] -// [ a a a a a a ] -// [ a a a a a a ] -// [ a ] -// on return, -// [ a a h h h h a ] -// [ a h h h h a ] -// [ h h h h h h ] -// [ v1 h h h h h ] -// [ v1 v2 h h h h ] -// [ v1 v2 v3 h h h ] -// [ a ] -// where a denotes an element of the original matrix A, h denotes a -// modified element of the upper Hessenberg matrix H, and vi denotes an -// element of the vector defining H_i. -// -// ilo and ihi determine the block of A that will be reduced to upper Hessenberg -// form. It must hold that 0 <= ilo <= ihi <= max(0, n-1), otherwise Dgehd2 will -// panic. -// -// On return, tau will contain the scalar factors of the elementary reflectors. -// It must have length equal to n-1, otherwise Dgehd2 will panic. -// -// work must have length at least n, otherwise Dgehd2 will panic. -// -// Dgehd2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dgehd2(n, ilo, ihi int, a []float64, lda int, tau, work []float64) { - switch { - case n < 0: - panic(nLT0) - case ilo < 0 || max(0, n-1) < ilo: - panic(badIlo) - case ihi < min(ilo, n-1) || n <= ihi: - panic(badIhi) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if n == 0 { - return - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(tau) != n-1: - panic(badLenTau) - case len(work) < n: - panic(shortWork) - } - - for i := ilo; i < ihi; i++ { - // Compute elementary reflector H_i to annihilate A[i+2:ihi+1,i]. - var aii float64 - aii, tau[i] = impl.Dlarfg(ihi-i, a[(i+1)*lda+i], a[min(i+2, n-1)*lda+i:], lda) - a[(i+1)*lda+i] = 1 - - // Apply H_i to A[0:ihi+1,i+1:ihi+1] from the right. - impl.Dlarf(blas.Right, ihi+1, ihi-i, a[(i+1)*lda+i:], lda, tau[i], a[i+1:], lda, work) - - // Apply H_i to A[i+1:ihi+1,i+1:n] from the left. - impl.Dlarf(blas.Left, ihi-i, n-i-1, a[(i+1)*lda+i:], lda, tau[i], a[(i+1)*lda+i+1:], lda, work) - a[(i+1)*lda+i] = aii - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgehrd.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgehrd.go deleted file mode 100644 index 2fc7598..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgehrd.go +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dgehrd reduces a block of a real n×n general matrix A to upper Hessenberg -// form H by an orthogonal similarity transformation Qᵀ * A * Q = H. -// -// The matrix Q is represented as a product of (ihi-ilo) elementary -// reflectors -// Q = H_{ilo} H_{ilo+1} ... H_{ihi-1}. -// Each H_i has the form -// H_i = I - tau[i] * v * vᵀ -// where v is a real vector with v[0:i+1] = 0, v[i+1] = 1 and v[ihi+1:n] = 0. -// v[i+2:ihi+1] is stored on exit in A[i+2:ihi+1,i]. -// -// On entry, a contains the n×n general matrix to be reduced. On return, the -// upper triangle and the first subdiagonal of A will be overwritten with the -// upper Hessenberg matrix H, and the elements below the first subdiagonal, with -// the slice tau, represent the orthogonal matrix Q as a product of elementary -// reflectors. -// -// The contents of a are illustrated by the following example, with n = 7, ilo = -// 1 and ihi = 5. -// On entry, -// [ a a a a a a a ] -// [ a a a a a a ] -// [ a a a a a a ] -// [ a a a a a a ] -// [ a a a a a a ] -// [ a a a a a a ] -// [ a ] -// on return, -// [ a a h h h h a ] -// [ a h h h h a ] -// [ h h h h h h ] -// [ v1 h h h h h ] -// [ v1 v2 h h h h ] -// [ v1 v2 v3 h h h ] -// [ a ] -// where a denotes an element of the original matrix A, h denotes a -// modified element of the upper Hessenberg matrix H, and vi denotes an -// element of the vector defining H_i. -// -// ilo and ihi determine the block of A that will be reduced to upper Hessenberg -// form. It must hold that 0 <= ilo <= ihi < n if n > 0, and ilo == 0 and ihi == -// -1 if n == 0, otherwise Dgehrd will panic. -// -// On return, tau will contain the scalar factors of the elementary reflectors. -// Elements tau[:ilo] and tau[ihi:] will be set to zero. tau must have length -// equal to n-1 if n > 0, otherwise Dgehrd will panic. -// -// work must have length at least lwork and lwork must be at least max(1,n), -// otherwise Dgehrd will panic. On return, work[0] contains the optimal value of -// lwork. -// -// If lwork == -1, instead of performing Dgehrd, only the optimal value of lwork -// will be stored in work[0]. -// -// Dgehrd is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dgehrd(n, ilo, ihi int, a []float64, lda int, tau, work []float64, lwork int) { - switch { - case n < 0: - panic(nLT0) - case ilo < 0 || max(0, n-1) < ilo: - panic(badIlo) - case ihi < min(ilo, n-1) || n <= ihi: - panic(badIhi) - case lda < max(1, n): - panic(badLdA) - case lwork < max(1, n) && lwork != -1: - panic(badLWork) - case len(work) < lwork: - panic(shortWork) - } - - // Quick return if possible. - if n == 0 { - work[0] = 1 - return - } - - const ( - nbmax = 64 - ldt = nbmax + 1 - tsize = ldt * nbmax - ) - // Compute the workspace requirements. - nb := min(nbmax, impl.Ilaenv(1, "DGEHRD", " ", n, ilo, ihi, -1)) - lwkopt := n*nb + tsize - if lwork == -1 { - work[0] = float64(lwkopt) - return - } - - if len(a) < (n-1)*lda+n { - panic(shortA) - } - if len(tau) != n-1 { - panic(badLenTau) - } - - // Set tau[:ilo] and tau[ihi:] to zero. - for i := 0; i < ilo; i++ { - tau[i] = 0 - } - for i := ihi; i < n-1; i++ { - tau[i] = 0 - } - - // Quick return if possible. - nh := ihi - ilo + 1 - if nh <= 1 { - work[0] = 1 - return - } - - // Determine the block size. - nbmin := 2 - var nx int - if 1 < nb && nb < nh { - // Determine when to cross over from blocked to unblocked code - // (last block is always handled by unblocked code). - nx = max(nb, impl.Ilaenv(3, "DGEHRD", " ", n, ilo, ihi, -1)) - if nx < nh { - // Determine if workspace is large enough for blocked code. - if lwork < n*nb+tsize { - // Not enough workspace to use optimal nb: - // determine the minimum value of nb, and reduce - // nb or force use of unblocked code. - nbmin = max(2, impl.Ilaenv(2, "DGEHRD", " ", n, ilo, ihi, -1)) - if lwork >= n*nbmin+tsize { - nb = (lwork - tsize) / n - } else { - nb = 1 - } - } - } - } - ldwork := nb // work is used as an n×nb matrix. - - var i int - if nb < nbmin || nh <= nb { - // Use unblocked code below. - i = ilo - } else { - // Use blocked code. - bi := blas64.Implementation() - iwt := n * nb // Size of the matrix Y and index where the matrix T starts in work. - for i = ilo; i < ihi-nx; i += nb { - ib := min(nb, ihi-i) - - // Reduce columns [i:i+ib] to Hessenberg form, returning the - // matrices V and T of the block reflector H = I - V*T*Vᵀ - // which performs the reduction, and also the matrix Y = A*V*T. - impl.Dlahr2(ihi+1, i+1, ib, a[i:], lda, tau[i:], work[iwt:], ldt, work, ldwork) - - // Apply the block reflector H to A[:ihi+1,i+ib:ihi+1] from the - // right, computing A := A - Y * Vᵀ. V[i+ib,i+ib-1] must be set - // to 1. - ei := a[(i+ib)*lda+i+ib-1] - a[(i+ib)*lda+i+ib-1] = 1 - bi.Dgemm(blas.NoTrans, blas.Trans, ihi+1, ihi-i-ib+1, ib, - -1, work, ldwork, - a[(i+ib)*lda+i:], lda, - 1, a[i+ib:], lda) - a[(i+ib)*lda+i+ib-1] = ei - - // Apply the block reflector H to A[0:i+1,i+1:i+ib-1] from the - // right. - bi.Dtrmm(blas.Right, blas.Lower, blas.Trans, blas.Unit, i+1, ib-1, - 1, a[(i+1)*lda+i:], lda, work, ldwork) - for j := 0; j <= ib-2; j++ { - bi.Daxpy(i+1, -1, work[j:], ldwork, a[i+j+1:], lda) - } - - // Apply the block reflector H to A[i+1:ihi+1,i+ib:n] from the - // left. - impl.Dlarfb(blas.Left, blas.Trans, lapack.Forward, lapack.ColumnWise, - ihi-i, n-i-ib, ib, - a[(i+1)*lda+i:], lda, work[iwt:], ldt, a[(i+1)*lda+i+ib:], lda, work, ldwork) - } - } - // Use unblocked code to reduce the rest of the matrix. - impl.Dgehd2(n, i, ihi, a, lda, tau, work) - work[0] = float64(lwkopt) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgelq2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgelq2.go deleted file mode 100644 index abc96f7..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgelq2.go +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import "gonum.org/v1/gonum/blas" - -// Dgelq2 computes the LQ factorization of the m×n matrix A. -// -// In an LQ factorization, L is a lower triangular m×n matrix, and Q is an n×n -// orthonormal matrix. -// -// a is modified to contain the information to construct L and Q. -// The lower triangle of a contains the matrix L. The upper triangular elements -// (not including the diagonal) contain the elementary reflectors. tau is modified -// to contain the reflector scales. tau must have length of at least k = min(m,n) -// and this function will panic otherwise. -// -// See Dgeqr2 for a description of the elementary reflectors and orthonormal -// matrix Q. Q is constructed as a product of these elementary reflectors, -// Q = H_{k-1} * ... * H_1 * H_0. -// -// work is temporary storage of length at least m and this function will panic otherwise. -// -// Dgelq2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dgelq2(m, n int, a []float64, lda int, tau, work []float64) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - k := min(m, n) - if k == 0 { - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(tau) < k: - panic(shortTau) - case len(work) < m: - panic(shortWork) - } - - for i := 0; i < k; i++ { - a[i*lda+i], tau[i] = impl.Dlarfg(n-i, a[i*lda+i], a[i*lda+min(i+1, n-1):], 1) - if i < m-1 { - aii := a[i*lda+i] - a[i*lda+i] = 1 - impl.Dlarf(blas.Right, m-i-1, n-i, - a[i*lda+i:], 1, - tau[i], - a[(i+1)*lda+i:], lda, - work) - a[i*lda+i] = aii - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgelqf.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgelqf.go deleted file mode 100644 index f1fd13a..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgelqf.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dgelqf computes the LQ factorization of the m×n matrix A using a blocked -// algorithm. See the documentation for Dgelq2 for a description of the -// parameters at entry and exit. -// -// work is temporary storage, and lwork specifies the usable memory length. -// At minimum, lwork >= m, and this function will panic otherwise. -// Dgelqf is a blocked LQ factorization, but the block size is limited -// by the temporary space available. If lwork == -1, instead of performing Dgelqf, -// the optimal work length will be stored into work[0]. -// -// tau must have length at least min(m,n), and this function will panic otherwise. -func (impl Implementation) Dgelqf(m, n int, a []float64, lda int, tau, work []float64, lwork int) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case lwork < max(1, m) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - k := min(m, n) - if k == 0 { - work[0] = 1 - return - } - - nb := impl.Ilaenv(1, "DGELQF", " ", m, n, -1, -1) - if lwork == -1 { - work[0] = float64(m * nb) - return - } - - if len(a) < (m-1)*lda+n { - panic(shortA) - } - if len(tau) < k { - panic(shortTau) - } - - // Find the optimal blocking size based on the size of available memory - // and optimal machine parameters. - nbmin := 2 - var nx int - iws := m - if 1 < nb && nb < k { - nx = max(0, impl.Ilaenv(3, "DGELQF", " ", m, n, -1, -1)) - if nx < k { - iws = m * nb - if lwork < iws { - nb = lwork / m - nbmin = max(2, impl.Ilaenv(2, "DGELQF", " ", m, n, -1, -1)) - } - } - } - ldwork := nb - // Computed blocked LQ factorization. - var i int - if nbmin <= nb && nb < k && nx < k { - for i = 0; i < k-nx; i += nb { - ib := min(k-i, nb) - impl.Dgelq2(ib, n-i, a[i*lda+i:], lda, tau[i:], work) - if i+ib < m { - impl.Dlarft(lapack.Forward, lapack.RowWise, n-i, ib, - a[i*lda+i:], lda, - tau[i:], - work, ldwork) - impl.Dlarfb(blas.Right, blas.NoTrans, lapack.Forward, lapack.RowWise, - m-i-ib, n-i, ib, - a[i*lda+i:], lda, - work, ldwork, - a[(i+ib)*lda+i:], lda, - work[ib*ldwork:], ldwork) - } - } - } - // Perform unblocked LQ factorization on the remainder. - if i < k { - impl.Dgelq2(m-i, n-i, a[i*lda+i:], lda, tau[i:], work) - } - work[0] = float64(iws) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgels.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgels.go deleted file mode 100644 index cb0dbe8..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgels.go +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dgels finds a minimum-norm solution based on the matrices A and B using the -// QR or LQ factorization. Dgels returns false if the matrix -// A is singular, and true if this solution was successfully found. -// -// The minimization problem solved depends on the input parameters. -// -// 1. If m >= n and trans == blas.NoTrans, Dgels finds X such that || A*X - B||_2 -// is minimized. -// 2. If m < n and trans == blas.NoTrans, Dgels finds the minimum norm solution of -// A * X = B. -// 3. If m >= n and trans == blas.Trans, Dgels finds the minimum norm solution of -// Aᵀ * X = B. -// 4. If m < n and trans == blas.Trans, Dgels finds X such that || A*X - B||_2 -// is minimized. -// Note that the least-squares solutions (cases 1 and 3) perform the minimization -// per column of B. This is not the same as finding the minimum-norm matrix. -// -// The matrix A is a general matrix of size m×n and is modified during this call. -// The input matrix B is of size max(m,n)×nrhs, and serves two purposes. On entry, -// the elements of b specify the input matrix B. B has size m×nrhs if -// trans == blas.NoTrans, and n×nrhs if trans == blas.Trans. On exit, the -// leading submatrix of b contains the solution vectors X. If trans == blas.NoTrans, -// this submatrix is of size n×nrhs, and of size m×nrhs otherwise. -// -// work is temporary storage, and lwork specifies the usable memory length. -// At minimum, lwork >= max(m,n) + max(m,n,nrhs), and this function will panic -// otherwise. A longer work will enable blocked algorithms to be called. -// In the special case that lwork == -1, work[0] will be set to the optimal working -// length. -func (impl Implementation) Dgels(trans blas.Transpose, m, n, nrhs int, a []float64, lda int, b []float64, ldb int, work []float64, lwork int) bool { - mn := min(m, n) - minwrk := mn + max(mn, nrhs) - switch { - case trans != blas.NoTrans && trans != blas.Trans && trans != blas.ConjTrans: - panic(badTrans) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case nrhs < 0: - panic(nrhsLT0) - case lda < max(1, n): - panic(badLdA) - case ldb < max(1, nrhs): - panic(badLdB) - case lwork < max(1, minwrk) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - if mn == 0 || nrhs == 0 { - impl.Dlaset(blas.All, max(m, n), nrhs, 0, 0, b, ldb) - work[0] = 1 - return true - } - - // Find optimal block size. - var nb int - if m >= n { - nb = impl.Ilaenv(1, "DGEQRF", " ", m, n, -1, -1) - if trans != blas.NoTrans { - nb = max(nb, impl.Ilaenv(1, "DORMQR", "LN", m, nrhs, n, -1)) - } else { - nb = max(nb, impl.Ilaenv(1, "DORMQR", "LT", m, nrhs, n, -1)) - } - } else { - nb = impl.Ilaenv(1, "DGELQF", " ", m, n, -1, -1) - if trans != blas.NoTrans { - nb = max(nb, impl.Ilaenv(1, "DORMLQ", "LT", n, nrhs, m, -1)) - } else { - nb = max(nb, impl.Ilaenv(1, "DORMLQ", "LN", n, nrhs, m, -1)) - } - } - wsize := max(1, mn+max(mn, nrhs)*nb) - work[0] = float64(wsize) - - if lwork == -1 { - return true - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(b) < (max(m, n)-1)*ldb+nrhs: - panic(shortB) - } - - // Scale the input matrices if they contain extreme values. - smlnum := dlamchS / dlamchP - bignum := 1 / smlnum - anrm := impl.Dlange(lapack.MaxAbs, m, n, a, lda, nil) - var iascl int - if anrm > 0 && anrm < smlnum { - impl.Dlascl(lapack.General, 0, 0, anrm, smlnum, m, n, a, lda) - iascl = 1 - } else if anrm > bignum { - impl.Dlascl(lapack.General, 0, 0, anrm, bignum, m, n, a, lda) - } else if anrm == 0 { - // Matrix is all zeros. - impl.Dlaset(blas.All, max(m, n), nrhs, 0, 0, b, ldb) - return true - } - brow := m - if trans != blas.NoTrans { - brow = n - } - bnrm := impl.Dlange(lapack.MaxAbs, brow, nrhs, b, ldb, nil) - ibscl := 0 - if bnrm > 0 && bnrm < smlnum { - impl.Dlascl(lapack.General, 0, 0, bnrm, smlnum, brow, nrhs, b, ldb) - ibscl = 1 - } else if bnrm > bignum { - impl.Dlascl(lapack.General, 0, 0, bnrm, bignum, brow, nrhs, b, ldb) - ibscl = 2 - } - - // Solve the minimization problem using a QR or an LQ decomposition. - var scllen int - if m >= n { - impl.Dgeqrf(m, n, a, lda, work, work[mn:], lwork-mn) - if trans == blas.NoTrans { - impl.Dormqr(blas.Left, blas.Trans, m, nrhs, n, - a, lda, - work[:n], - b, ldb, - work[mn:], lwork-mn) - ok := impl.Dtrtrs(blas.Upper, blas.NoTrans, blas.NonUnit, n, nrhs, - a, lda, - b, ldb) - if !ok { - return false - } - scllen = n - } else { - ok := impl.Dtrtrs(blas.Upper, blas.Trans, blas.NonUnit, n, nrhs, - a, lda, - b, ldb) - if !ok { - return false - } - for i := n; i < m; i++ { - for j := 0; j < nrhs; j++ { - b[i*ldb+j] = 0 - } - } - impl.Dormqr(blas.Left, blas.NoTrans, m, nrhs, n, - a, lda, - work[:n], - b, ldb, - work[mn:], lwork-mn) - scllen = m - } - } else { - impl.Dgelqf(m, n, a, lda, work, work[mn:], lwork-mn) - if trans == blas.NoTrans { - ok := impl.Dtrtrs(blas.Lower, blas.NoTrans, blas.NonUnit, - m, nrhs, - a, lda, - b, ldb) - if !ok { - return false - } - for i := m; i < n; i++ { - for j := 0; j < nrhs; j++ { - b[i*ldb+j] = 0 - } - } - impl.Dormlq(blas.Left, blas.Trans, n, nrhs, m, - a, lda, - work, - b, ldb, - work[mn:], lwork-mn) - scllen = n - } else { - impl.Dormlq(blas.Left, blas.NoTrans, n, nrhs, m, - a, lda, - work, - b, ldb, - work[mn:], lwork-mn) - ok := impl.Dtrtrs(blas.Lower, blas.Trans, blas.NonUnit, - m, nrhs, - a, lda, - b, ldb) - if !ok { - return false - } - } - } - - // Adjust answer vector based on scaling. - if iascl == 1 { - impl.Dlascl(lapack.General, 0, 0, anrm, smlnum, scllen, nrhs, b, ldb) - } - if iascl == 2 { - impl.Dlascl(lapack.General, 0, 0, anrm, bignum, scllen, nrhs, b, ldb) - } - if ibscl == 1 { - impl.Dlascl(lapack.General, 0, 0, smlnum, bnrm, scllen, nrhs, b, ldb) - } - if ibscl == 2 { - impl.Dlascl(lapack.General, 0, 0, bignum, bnrm, scllen, nrhs, b, ldb) - } - - work[0] = float64(wsize) - return true -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeql2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgeql2.go deleted file mode 100644 index 73e42d1..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeql2.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import "gonum.org/v1/gonum/blas" - -// Dgeql2 computes the QL factorization of the m×n matrix A. That is, Dgeql2 -// computes Q and L such that -// A = Q * L -// where Q is an m×m orthonormal matrix and L is a lower trapezoidal matrix. -// -// Q is represented as a product of elementary reflectors, -// Q = H_{k-1} * ... * H_1 * H_0 -// where k = min(m,n) and each H_i has the form -// H_i = I - tau[i] * v_i * v_iᵀ -// Vector v_i has v[m-k+i+1:m] = 0, v[m-k+i] = 1, and v[:m-k+i+1] is stored on -// exit in A[0:m-k+i-1, n-k+i]. -// -// tau must have length at least min(m,n), and Dgeql2 will panic otherwise. -// -// work is temporary memory storage and must have length at least n. -// -// Dgeql2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dgeql2(m, n int, a []float64, lda int, tau, work []float64) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - k := min(m, n) - if k == 0 { - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(tau) < k: - panic(shortTau) - case len(work) < n: - panic(shortWork) - } - - var aii float64 - for i := k - 1; i >= 0; i-- { - // Generate elementary reflector H_i to annihilate A[0:m-k+i-1, n-k+i]. - aii, tau[i] = impl.Dlarfg(m-k+i+1, a[(m-k+i)*lda+n-k+i], a[n-k+i:], lda) - - // Apply H_i to A[0:m-k+i, 0:n-k+i-1] from the left. - a[(m-k+i)*lda+n-k+i] = 1 - impl.Dlarf(blas.Left, m-k+i+1, n-k+i, a[n-k+i:], lda, tau[i], a, lda, work) - a[(m-k+i)*lda+n-k+i] = aii - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqp3.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqp3.go deleted file mode 100644 index d072d28..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqp3.go +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright ©2017 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dgeqp3 computes a QR factorization with column pivoting of the -// m×n matrix A: A*P = Q*R using Level 3 BLAS. -// -// The matrix Q is represented as a product of elementary reflectors -// Q = H_0 H_1 . . . H_{k-1}, where k = min(m,n). -// Each H_i has the form -// H_i = I - tau * v * vᵀ -// where tau and v are real vectors with v[0:i-1] = 0 and v[i] = 1; -// v[i:m] is stored on exit in A[i:m, i], and tau in tau[i]. -// -// jpvt specifies a column pivot to be applied to A. If -// jpvt[j] is at least zero, the jth column of A is permuted -// to the front of A*P (a leading column), if jpvt[j] is -1 -// the jth column of A is a free column. If jpvt[j] < -1, Dgeqp3 -// will panic. On return, jpvt holds the permutation that was -// applied; the jth column of A*P was the jpvt[j] column of A. -// jpvt must have length n or Dgeqp3 will panic. -// -// tau holds the scalar factors of the elementary reflectors. -// It must have length min(m, n), otherwise Dgeqp3 will panic. -// -// work must have length at least max(1,lwork), and lwork must be at least -// 3*n+1, otherwise Dgeqp3 will panic. For optimal performance lwork must -// be at least 2*n+(n+1)*nb, where nb is the optimal blocksize. On return, -// work[0] will contain the optimal value of lwork. -// -// If lwork == -1, instead of performing Dgeqp3, only the optimal value of lwork -// will be stored in work[0]. -// -// Dgeqp3 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dgeqp3(m, n int, a []float64, lda int, jpvt []int, tau, work []float64, lwork int) { - const ( - inb = 1 - inbmin = 2 - ixover = 3 - ) - - minmn := min(m, n) - iws := 3*n + 1 - if minmn == 0 { - iws = 1 - } - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case lwork < iws && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - if minmn == 0 { - work[0] = 1 - return - } - - nb := impl.Ilaenv(inb, "DGEQRF", " ", m, n, -1, -1) - if lwork == -1 { - work[0] = float64(2*n + (n+1)*nb) - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(jpvt) != n: - panic(badLenJpvt) - case len(tau) < minmn: - panic(shortTau) - } - - for _, v := range jpvt { - if v < -1 || n <= v { - panic(badJpvt) - } - } - - bi := blas64.Implementation() - - // Move initial columns up front. - var nfxd int - for j := 0; j < n; j++ { - if jpvt[j] == -1 { - jpvt[j] = j - continue - } - if j != nfxd { - bi.Dswap(m, a[j:], lda, a[nfxd:], lda) - jpvt[j], jpvt[nfxd] = jpvt[nfxd], j - } else { - jpvt[j] = j - } - nfxd++ - } - - // Factorize nfxd columns. - // - // Compute the QR factorization of nfxd columns and update remaining columns. - if nfxd > 0 { - na := min(m, nfxd) - impl.Dgeqrf(m, na, a, lda, tau, work, lwork) - iws = max(iws, int(work[0])) - if na < n { - impl.Dormqr(blas.Left, blas.Trans, m, n-na, na, a, lda, tau[:na], a[na:], lda, - work, lwork) - iws = max(iws, int(work[0])) - } - } - - if nfxd >= minmn { - work[0] = float64(iws) - return - } - - // Factorize free columns. - sm := m - nfxd - sn := n - nfxd - sminmn := minmn - nfxd - - // Determine the block size. - nb = impl.Ilaenv(inb, "DGEQRF", " ", sm, sn, -1, -1) - nbmin := 2 - nx := 0 - - if 1 < nb && nb < sminmn { - // Determine when to cross over from blocked to unblocked code. - nx = max(0, impl.Ilaenv(ixover, "DGEQRF", " ", sm, sn, -1, -1)) - - if nx < sminmn { - // Determine if workspace is large enough for blocked code. - minws := 2*sn + (sn+1)*nb - iws = max(iws, minws) - if lwork < minws { - // Not enough workspace to use optimal nb. Reduce - // nb and determine the minimum value of nb. - nb = (lwork - 2*sn) / (sn + 1) - nbmin = max(2, impl.Ilaenv(inbmin, "DGEQRF", " ", sm, sn, -1, -1)) - } - } - } - - // Initialize partial column norms. - // The first n elements of work store the exact column norms. - for j := nfxd; j < n; j++ { - work[j] = bi.Dnrm2(sm, a[nfxd*lda+j:], lda) - work[n+j] = work[j] - } - j := nfxd - if nbmin <= nb && nb < sminmn && nx < sminmn { - // Use blocked code initially. - - // Compute factorization. - var fjb int - for topbmn := minmn - nx; j < topbmn; j += fjb { - jb := min(nb, topbmn-j) - - // Factorize jb columns among columns j:n. - fjb = impl.Dlaqps(m, n-j, j, jb, a[j:], lda, jpvt[j:], tau[j:], - work[j:n], work[j+n:2*n], work[2*n:2*n+jb], work[2*n+jb:], jb) - } - } - - // Use unblocked code to factor the last or only block. - if j < minmn { - impl.Dlaqp2(m, n-j, j, a[j:], lda, jpvt[j:], tau[j:], - work[j:n], work[j+n:2*n], work[2*n:]) - } - - work[0] = float64(iws) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqr2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqr2.go deleted file mode 100644 index 57bf377..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqr2.go +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import "gonum.org/v1/gonum/blas" - -// Dgeqr2 computes a QR factorization of the m×n matrix A. -// -// In a QR factorization, Q is an m×m orthonormal matrix, and R is an -// upper triangular m×n matrix. -// -// A is modified to contain the information to construct Q and R. -// The upper triangle of a contains the matrix R. The lower triangular elements -// (not including the diagonal) contain the elementary reflectors. tau is modified -// to contain the reflector scales. tau must have length at least min(m,n), and -// this function will panic otherwise. -// -// The ith elementary reflector can be explicitly constructed by first extracting -// the -// v[j] = 0 j < i -// v[j] = 1 j == i -// v[j] = a[j*lda+i] j > i -// and computing H_i = I - tau[i] * v * vᵀ. -// -// The orthonormal matrix Q can be constructed from a product of these elementary -// reflectors, Q = H_0 * H_1 * ... * H_{k-1}, where k = min(m,n). -// -// work is temporary storage of length at least n and this function will panic otherwise. -// -// Dgeqr2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dgeqr2(m, n int, a []float64, lda int, tau, work []float64) { - // TODO(btracey): This is oriented such that columns of a are eliminated. - // This likely could be re-arranged to take better advantage of row-major - // storage. - - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case len(work) < n: - panic(shortWork) - } - - // Quick return if possible. - k := min(m, n) - if k == 0 { - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(tau) < k: - panic(shortTau) - } - - for i := 0; i < k; i++ { - // Generate elementary reflector H_i. - a[i*lda+i], tau[i] = impl.Dlarfg(m-i, a[i*lda+i], a[min((i+1), m-1)*lda+i:], lda) - if i < n-1 { - aii := a[i*lda+i] - a[i*lda+i] = 1 - impl.Dlarf(blas.Left, m-i, n-i-1, - a[i*lda+i:], lda, - tau[i], - a[i*lda+i+1:], lda, - work) - a[i*lda+i] = aii - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqrf.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqrf.go deleted file mode 100644 index d14088a..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqrf.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dgeqrf computes the QR factorization of the m×n matrix A using a blocked -// algorithm. See the documentation for Dgeqr2 for a description of the -// parameters at entry and exit. -// -// work is temporary storage, and lwork specifies the usable memory length. -// The length of work must be at least max(1, lwork) and lwork must be -1 -// or at least n, otherwise this function will panic. -// Dgeqrf is a blocked QR factorization, but the block size is limited -// by the temporary space available. If lwork == -1, instead of performing Dgeqrf, -// the optimal work length will be stored into work[0]. -// -// tau must have length at least min(m,n), and this function will panic otherwise. -func (impl Implementation) Dgeqrf(m, n int, a []float64, lda int, tau, work []float64, lwork int) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case lwork < max(1, n) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - k := min(m, n) - if k == 0 { - work[0] = 1 - return - } - - // nb is the optimal blocksize, i.e. the number of columns transformed at a time. - nb := impl.Ilaenv(1, "DGEQRF", " ", m, n, -1, -1) - if lwork == -1 { - work[0] = float64(n * nb) - return - } - - if len(a) < (m-1)*lda+n { - panic(shortA) - } - if len(tau) < k { - panic(shortTau) - } - - nbmin := 2 // Minimal block size. - var nx int // Use unblocked (unless changed in the next for loop) - iws := n - // Only consider blocked if the suggested block size is > 1 and the - // number of rows or columns is sufficiently large. - if 1 < nb && nb < k { - // nx is the block size at which the code switches from blocked - // to unblocked. - nx = max(0, impl.Ilaenv(3, "DGEQRF", " ", m, n, -1, -1)) - if k > nx { - iws = n * nb - if lwork < iws { - // Not enough workspace to use the optimal block - // size. Get the minimum block size instead. - nb = lwork / n - nbmin = max(2, impl.Ilaenv(2, "DGEQRF", " ", m, n, -1, -1)) - } - } - } - - // Compute QR using a blocked algorithm. - var i int - if nbmin <= nb && nb < k && nx < k { - ldwork := nb - for i = 0; i < k-nx; i += nb { - ib := min(k-i, nb) - // Compute the QR factorization of the current block. - impl.Dgeqr2(m-i, ib, a[i*lda+i:], lda, tau[i:], work) - if i+ib < n { - // Form the triangular factor of the block reflector and apply Hᵀ - // In Dlarft, work becomes the T matrix. - impl.Dlarft(lapack.Forward, lapack.ColumnWise, m-i, ib, - a[i*lda+i:], lda, - tau[i:], - work, ldwork) - impl.Dlarfb(blas.Left, blas.Trans, lapack.Forward, lapack.ColumnWise, - m-i, n-i-ib, ib, - a[i*lda+i:], lda, - work, ldwork, - a[i*lda+i+ib:], lda, - work[ib*ldwork:], ldwork) - } - } - } - // Call unblocked code on the remaining columns. - if i < k { - impl.Dgeqr2(m-i, n-i, a[i*lda+i:], lda, tau[i:], work) - } - work[0] = float64(iws) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgerq2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgerq2.go deleted file mode 100644 index a06dec5..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgerq2.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright ©2017 The Gonum 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 gonum - -import "gonum.org/v1/gonum/blas" - -// Dgerq2 computes an RQ factorization of the m×n matrix A, -// A = R * Q. -// On exit, if m <= n, the upper triangle of the subarray -// A[0:m, n-m:n] contains the m×m upper triangular matrix R. -// If m >= n, the elements on and above the (m-n)-th subdiagonal -// contain the m×n upper trapezoidal matrix R. -// The remaining elements, with tau, represent the -// orthogonal matrix Q as a product of min(m,n) elementary -// reflectors. -// -// The matrix Q is represented as a product of elementary reflectors -// Q = H_0 H_1 . . . H_{min(m,n)-1}. -// Each H(i) has the form -// H_i = I - tau_i * v * vᵀ -// where v is a vector with v[0:n-k+i-1] stored in A[m-k+i, 0:n-k+i-1], -// v[n-k+i:n] = 0 and v[n-k+i] = 1. -// -// tau must have length min(m,n) and work must have length m, otherwise -// Dgerq2 will panic. -// -// Dgerq2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dgerq2(m, n int, a []float64, lda int, tau, work []float64) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case len(work) < m: - panic(shortWork) - } - - // Quick return if possible. - k := min(m, n) - if k == 0 { - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(tau) < k: - panic(shortTau) - } - - for i := k - 1; i >= 0; i-- { - // Generate elementary reflector H[i] to annihilate - // A[m-k+i, 0:n-k+i-1]. - mki := m - k + i - nki := n - k + i - var aii float64 - aii, tau[i] = impl.Dlarfg(nki+1, a[mki*lda+nki], a[mki*lda:], 1) - - // Apply H[i] to A[0:m-k+i-1, 0:n-k+i] from the right. - a[mki*lda+nki] = 1 - impl.Dlarf(blas.Right, mki, nki+1, a[mki*lda:], 1, tau[i], a, lda, work) - a[mki*lda+nki] = aii - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgerqf.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgerqf.go deleted file mode 100644 index 8611554..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgerqf.go +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright ©2017 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dgerqf computes an RQ factorization of the m×n matrix A, -// A = R * Q. -// On exit, if m <= n, the upper triangle of the subarray -// A[0:m, n-m:n] contains the m×m upper triangular matrix R. -// If m >= n, the elements on and above the (m-n)-th subdiagonal -// contain the m×n upper trapezoidal matrix R. -// The remaining elements, with tau, represent the -// orthogonal matrix Q as a product of min(m,n) elementary -// reflectors. -// -// The matrix Q is represented as a product of elementary reflectors -// Q = H_0 H_1 . . . H_{min(m,n)-1}. -// Each H(i) has the form -// H_i = I - tau_i * v * vᵀ -// where v is a vector with v[0:n-k+i-1] stored in A[m-k+i, 0:n-k+i-1], -// v[n-k+i:n] = 0 and v[n-k+i] = 1. -// -// tau must have length min(m,n), work must have length max(1, lwork), -// and lwork must be -1 or at least max(1, m), otherwise Dgerqf will panic. -// On exit, work[0] will contain the optimal length for work. -// -// Dgerqf is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dgerqf(m, n int, a []float64, lda int, tau, work []float64, lwork int) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case lwork < max(1, m) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - k := min(m, n) - if k == 0 { - work[0] = 1 - return - } - - nb := impl.Ilaenv(1, "DGERQF", " ", m, n, -1, -1) - if lwork == -1 { - work[0] = float64(m * nb) - return - } - - if len(a) < (m-1)*lda+n { - panic(shortA) - } - if len(tau) != k { - panic(badLenTau) - } - - nbmin := 2 - nx := 1 - iws := m - var ldwork int - if 1 < nb && nb < k { - // Determine when to cross over from blocked to unblocked code. - nx = max(0, impl.Ilaenv(3, "DGERQF", " ", m, n, -1, -1)) - if nx < k { - // Determine whether workspace is large enough for blocked code. - iws = m * nb - if lwork < iws { - // Not enough workspace to use optimal nb. Reduce - // nb and determine the minimum value of nb. - nb = lwork / m - nbmin = max(2, impl.Ilaenv(2, "DGERQF", " ", m, n, -1, -1)) - } - ldwork = nb - } - } - - var mu, nu int - if nbmin <= nb && nb < k && nx < k { - // Use blocked code initially. - // The last kk rows are handled by the block method. - ki := ((k - nx - 1) / nb) * nb - kk := min(k, ki+nb) - - var i int - for i = k - kk + ki; i >= k-kk; i -= nb { - ib := min(k-i, nb) - - // Compute the RQ factorization of the current block - // A[m-k+i:m-k+i+ib-1, 0:n-k+i+ib-1]. - impl.Dgerq2(ib, n-k+i+ib, a[(m-k+i)*lda:], lda, tau[i:], work) - if m-k+i > 0 { - // Form the triangular factor of the block reflector - // H = H_{i+ib-1} . . . H_{i+1} H_i. - impl.Dlarft(lapack.Backward, lapack.RowWise, - n-k+i+ib, ib, a[(m-k+i)*lda:], lda, tau[i:], - work, ldwork) - - // Apply H to A[0:m-k+i-1, 0:n-k+i+ib-1] from the right. - impl.Dlarfb(blas.Right, blas.NoTrans, lapack.Backward, lapack.RowWise, - m-k+i, n-k+i+ib, ib, a[(m-k+i)*lda:], lda, - work, ldwork, - a, lda, - work[ib*ldwork:], ldwork) - } - } - mu = m - k + i + nb - nu = n - k + i + nb - } else { - mu = m - nu = n - } - - // Use unblocked code to factor the last or only block. - if mu > 0 && nu > 0 { - impl.Dgerq2(mu, nu, a, lda, tau, work) - } - work[0] = float64(iws) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgesvd.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgesvd.go deleted file mode 100644 index f2e9854..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgesvd.go +++ /dev/null @@ -1,1374 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -const noSVDO = "dgesvd: not coded for overwrite" - -// Dgesvd computes the singular value decomposition of the input matrix A. -// -// The singular value decomposition is -// A = U * Sigma * Vᵀ -// where Sigma is an m×n diagonal matrix containing the singular values of A, -// U is an m×m orthogonal matrix and V is an n×n orthogonal matrix. The first -// min(m,n) columns of U and V are the left and right singular vectors of A -// respectively. -// -// jobU and jobVT are options for computing the singular vectors. The behavior -// is as follows -// jobU == lapack.SVDAll All m columns of U are returned in u -// jobU == lapack.SVDStore The first min(m,n) columns are returned in u -// jobU == lapack.SVDOverwrite The first min(m,n) columns of U are written into a -// jobU == lapack.SVDNone The columns of U are not computed. -// The behavior is the same for jobVT and the rows of Vᵀ. At most one of jobU -// and jobVT can equal lapack.SVDOverwrite, and Dgesvd will panic otherwise. -// -// On entry, a contains the data for the m×n matrix A. During the call to Dgesvd -// the data is overwritten. On exit, A contains the appropriate singular vectors -// if either job is lapack.SVDOverwrite. -// -// s is a slice of length at least min(m,n) and on exit contains the singular -// values in decreasing order. -// -// u contains the left singular vectors on exit, stored column-wise. If -// jobU == lapack.SVDAll, u is of size m×m. If jobU == lapack.SVDStore u is -// of size m×min(m,n). If jobU == lapack.SVDOverwrite or lapack.SVDNone, u is -// not used. -// -// vt contains the left singular vectors on exit, stored row-wise. If -// jobV == lapack.SVDAll, vt is of size n×n. If jobVT == lapack.SVDStore vt is -// of size min(m,n)×n. If jobVT == lapack.SVDOverwrite or lapack.SVDNone, vt is -// not used. -// -// work is a slice for storing temporary memory, and lwork is the usable size of -// the slice. lwork must be at least max(5*min(m,n), 3*min(m,n)+max(m,n)). -// If lwork == -1, instead of performing Dgesvd, the optimal work length will be -// stored into work[0]. Dgesvd will panic if the working memory has insufficient -// storage. -// -// Dgesvd returns whether the decomposition successfully completed. -func (impl Implementation) Dgesvd(jobU, jobVT lapack.SVDJob, m, n int, a []float64, lda int, s, u []float64, ldu int, vt []float64, ldvt int, work []float64, lwork int) (ok bool) { - if jobU == lapack.SVDOverwrite || jobVT == lapack.SVDOverwrite { - panic(noSVDO) - } - - wantua := jobU == lapack.SVDAll - wantus := jobU == lapack.SVDStore - wantuas := wantua || wantus - wantuo := jobU == lapack.SVDOverwrite - wantun := jobU == lapack.SVDNone - if !(wantua || wantus || wantuo || wantun) { - panic(badSVDJob) - } - - wantva := jobVT == lapack.SVDAll - wantvs := jobVT == lapack.SVDStore - wantvas := wantva || wantvs - wantvo := jobVT == lapack.SVDOverwrite - wantvn := jobVT == lapack.SVDNone - if !(wantva || wantvs || wantvo || wantvn) { - panic(badSVDJob) - } - - if wantuo && wantvo { - panic(bothSVDOver) - } - - minmn := min(m, n) - minwork := 1 - if minmn > 0 { - minwork = max(3*minmn+max(m, n), 5*minmn) - } - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case ldu < 1, wantua && ldu < m, wantus && ldu < minmn: - panic(badLdU) - case ldvt < 1 || (wantvas && ldvt < n): - panic(badLdVT) - case lwork < minwork && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - if minmn == 0 { - work[0] = 1 - return true - } - - // Compute optimal workspace size for subroutines. - opts := string(jobU) + string(jobVT) - mnthr := impl.Ilaenv(6, "DGESVD", opts, m, n, 0, 0) - maxwrk := 1 - var wrkbl, bdspac int - if m >= n { - bdspac = 5 * n - impl.Dgeqrf(m, n, a, lda, nil, work, -1) - lwork_dgeqrf := int(work[0]) - - impl.Dorgqr(m, n, n, a, lda, nil, work, -1) - lwork_dorgqr_n := int(work[0]) - impl.Dorgqr(m, m, n, a, lda, nil, work, -1) - lwork_dorgqr_m := int(work[0]) - - impl.Dgebrd(n, n, a, lda, s, nil, nil, nil, work, -1) - lwork_dgebrd := int(work[0]) - - impl.Dorgbr(lapack.GeneratePT, n, n, n, a, lda, nil, work, -1) - lwork_dorgbr_p := int(work[0]) - - impl.Dorgbr(lapack.GenerateQ, n, n, n, a, lda, nil, work, -1) - lwork_dorgbr_q := int(work[0]) - - if m >= mnthr { - if wantun { - // Path 1 (m much larger than n, jobU == None) - maxwrk = n + lwork_dgeqrf - maxwrk = max(maxwrk, 3*n+lwork_dgebrd) - if wantvo || wantvas { - maxwrk = max(maxwrk, 3*n+lwork_dorgbr_p) - } - maxwrk = max(maxwrk, bdspac) - } else if wantuo && wantvn { - // Path 2 (m much larger than n, jobU == Overwrite, jobVT == None) - wrkbl = n + lwork_dgeqrf - wrkbl = max(wrkbl, n+lwork_dorgqr_n) - wrkbl = max(wrkbl, 3*n+lwork_dgebrd) - wrkbl = max(wrkbl, 3*n+lwork_dorgbr_q) - wrkbl = max(wrkbl, bdspac) - maxwrk = max(n*n+wrkbl, n*n+m*n+n) - } else if wantuo && wantvas { - // Path 3 (m much larger than n, jobU == Overwrite, jobVT == Store or All) - wrkbl = n + lwork_dgeqrf - wrkbl = max(wrkbl, n+lwork_dorgqr_n) - wrkbl = max(wrkbl, 3*n+lwork_dgebrd) - wrkbl = max(wrkbl, 3*n+lwork_dorgbr_q) - wrkbl = max(wrkbl, 3*n+lwork_dorgbr_p) - wrkbl = max(wrkbl, bdspac) - maxwrk = max(n*n+wrkbl, n*n+m*n+n) - } else if wantus && wantvn { - // Path 4 (m much larger than n, jobU == Store, jobVT == None) - wrkbl = n + lwork_dgeqrf - wrkbl = max(wrkbl, n+lwork_dorgqr_n) - wrkbl = max(wrkbl, 3*n+lwork_dgebrd) - wrkbl = max(wrkbl, 3*n+lwork_dorgbr_q) - wrkbl = max(wrkbl, bdspac) - maxwrk = n*n + wrkbl - } else if wantus && wantvo { - // Path 5 (m much larger than n, jobU == Store, jobVT == Overwrite) - wrkbl = n + lwork_dgeqrf - wrkbl = max(wrkbl, n+lwork_dorgqr_n) - wrkbl = max(wrkbl, 3*n+lwork_dgebrd) - wrkbl = max(wrkbl, 3*n+lwork_dorgbr_q) - wrkbl = max(wrkbl, 3*n+lwork_dorgbr_p) - wrkbl = max(wrkbl, bdspac) - maxwrk = 2*n*n + wrkbl - } else if wantus && wantvas { - // Path 6 (m much larger than n, jobU == Store, jobVT == Store or All) - wrkbl = n + lwork_dgeqrf - wrkbl = max(wrkbl, n+lwork_dorgqr_n) - wrkbl = max(wrkbl, 3*n+lwork_dgebrd) - wrkbl = max(wrkbl, 3*n+lwork_dorgbr_q) - wrkbl = max(wrkbl, 3*n+lwork_dorgbr_p) - wrkbl = max(wrkbl, bdspac) - maxwrk = n*n + wrkbl - } else if wantua && wantvn { - // Path 7 (m much larger than n, jobU == All, jobVT == None) - wrkbl = n + lwork_dgeqrf - wrkbl = max(wrkbl, n+lwork_dorgqr_m) - wrkbl = max(wrkbl, 3*n+lwork_dgebrd) - wrkbl = max(wrkbl, 3*n+lwork_dorgbr_q) - wrkbl = max(wrkbl, bdspac) - maxwrk = n*n + wrkbl - } else if wantua && wantvo { - // Path 8 (m much larger than n, jobU == All, jobVT == Overwrite) - wrkbl = n + lwork_dgeqrf - wrkbl = max(wrkbl, n+lwork_dorgqr_m) - wrkbl = max(wrkbl, 3*n+lwork_dgebrd) - wrkbl = max(wrkbl, 3*n+lwork_dorgbr_q) - wrkbl = max(wrkbl, 3*n+lwork_dorgbr_p) - wrkbl = max(wrkbl, bdspac) - maxwrk = 2*n*n + wrkbl - } else if wantua && wantvas { - // Path 9 (m much larger than n, jobU == All, jobVT == Store or All) - wrkbl = n + lwork_dgeqrf - wrkbl = max(wrkbl, n+lwork_dorgqr_m) - wrkbl = max(wrkbl, 3*n+lwork_dgebrd) - wrkbl = max(wrkbl, 3*n+lwork_dorgbr_q) - wrkbl = max(wrkbl, 3*n+lwork_dorgbr_p) - wrkbl = max(wrkbl, bdspac) - maxwrk = n*n + wrkbl - } - } else { - // Path 10 (m at least n, but not much larger) - impl.Dgebrd(m, n, a, lda, s, nil, nil, nil, work, -1) - lwork_dgebrd := int(work[0]) - maxwrk = 3*n + lwork_dgebrd - if wantus || wantuo { - impl.Dorgbr(lapack.GenerateQ, m, n, n, a, lda, nil, work, -1) - lwork_dorgbr_q = int(work[0]) - maxwrk = max(maxwrk, 3*n+lwork_dorgbr_q) - } - if wantua { - impl.Dorgbr(lapack.GenerateQ, m, m, n, a, lda, nil, work, -1) - lwork_dorgbr_q := int(work[0]) - maxwrk = max(maxwrk, 3*n+lwork_dorgbr_q) - } - if !wantvn { - maxwrk = max(maxwrk, 3*n+lwork_dorgbr_p) - } - maxwrk = max(maxwrk, bdspac) - } - } else { - bdspac = 5 * m - - impl.Dgelqf(m, n, a, lda, nil, work, -1) - lwork_dgelqf := int(work[0]) - - impl.Dorglq(n, n, m, nil, n, nil, work, -1) - lwork_dorglq_n := int(work[0]) - impl.Dorglq(m, n, m, a, lda, nil, work, -1) - lwork_dorglq_m := int(work[0]) - - impl.Dgebrd(m, m, a, lda, s, nil, nil, nil, work, -1) - lwork_dgebrd := int(work[0]) - - impl.Dorgbr(lapack.GeneratePT, m, m, m, a, n, nil, work, -1) - lwork_dorgbr_p := int(work[0]) - - impl.Dorgbr(lapack.GenerateQ, m, m, m, a, n, nil, work, -1) - lwork_dorgbr_q := int(work[0]) - - if n >= mnthr { - if wantvn { - // Path 1t (n much larger than m, jobVT == None) - maxwrk = m + lwork_dgelqf - maxwrk = max(maxwrk, 3*m+lwork_dgebrd) - if wantuo || wantuas { - maxwrk = max(maxwrk, 3*m+lwork_dorgbr_q) - } - maxwrk = max(maxwrk, bdspac) - } else if wantvo && wantun { - // Path 2t (n much larger than m, jobU == None, jobVT == Overwrite) - wrkbl = m + lwork_dgelqf - wrkbl = max(wrkbl, m+lwork_dorglq_m) - wrkbl = max(wrkbl, 3*m+lwork_dgebrd) - wrkbl = max(wrkbl, 3*m+lwork_dorgbr_p) - wrkbl = max(wrkbl, bdspac) - maxwrk = max(m*m+wrkbl, m*m+m*n+m) - } else if wantvo && wantuas { - // Path 3t (n much larger than m, jobU == Store or All, jobVT == Overwrite) - wrkbl = m + lwork_dgelqf - wrkbl = max(wrkbl, m+lwork_dorglq_m) - wrkbl = max(wrkbl, 3*m+lwork_dgebrd) - wrkbl = max(wrkbl, 3*m+lwork_dorgbr_p) - wrkbl = max(wrkbl, 3*m+lwork_dorgbr_q) - wrkbl = max(wrkbl, bdspac) - maxwrk = max(m*m+wrkbl, m*m+m*n+m) - } else if wantvs && wantun { - // Path 4t (n much larger than m, jobU == None, jobVT == Store) - wrkbl = m + lwork_dgelqf - wrkbl = max(wrkbl, m+lwork_dorglq_m) - wrkbl = max(wrkbl, 3*m+lwork_dgebrd) - wrkbl = max(wrkbl, 3*m+lwork_dorgbr_p) - wrkbl = max(wrkbl, bdspac) - maxwrk = m*m + wrkbl - } else if wantvs && wantuo { - // Path 5t (n much larger than m, jobU == Overwrite, jobVT == Store) - wrkbl = m + lwork_dgelqf - wrkbl = max(wrkbl, m+lwork_dorglq_m) - wrkbl = max(wrkbl, 3*m+lwork_dgebrd) - wrkbl = max(wrkbl, 3*m+lwork_dorgbr_p) - wrkbl = max(wrkbl, 3*m+lwork_dorgbr_q) - wrkbl = max(wrkbl, bdspac) - maxwrk = 2*m*m + wrkbl - } else if wantvs && wantuas { - // Path 6t (n much larger than m, jobU == Store or All, jobVT == Store) - wrkbl = m + lwork_dgelqf - wrkbl = max(wrkbl, m+lwork_dorglq_m) - wrkbl = max(wrkbl, 3*m+lwork_dgebrd) - wrkbl = max(wrkbl, 3*m+lwork_dorgbr_p) - wrkbl = max(wrkbl, 3*m+lwork_dorgbr_q) - wrkbl = max(wrkbl, bdspac) - maxwrk = m*m + wrkbl - } else if wantva && wantun { - // Path 7t (n much larger than m, jobU== None, jobVT == All) - wrkbl = m + lwork_dgelqf - wrkbl = max(wrkbl, m+lwork_dorglq_n) - wrkbl = max(wrkbl, 3*m+lwork_dgebrd) - wrkbl = max(wrkbl, 3*m+lwork_dorgbr_p) - wrkbl = max(wrkbl, bdspac) - maxwrk = m*m + wrkbl - } else if wantva && wantuo { - // Path 8t (n much larger than m, jobU == Overwrite, jobVT == All) - wrkbl = m + lwork_dgelqf - wrkbl = max(wrkbl, m+lwork_dorglq_n) - wrkbl = max(wrkbl, 3*m+lwork_dgebrd) - wrkbl = max(wrkbl, 3*m+lwork_dorgbr_p) - wrkbl = max(wrkbl, 3*m+lwork_dorgbr_q) - wrkbl = max(wrkbl, bdspac) - maxwrk = 2*m*m + wrkbl - } else if wantva && wantuas { - // Path 9t (n much larger than m, jobU == Store or All, jobVT == All) - wrkbl = m + lwork_dgelqf - wrkbl = max(wrkbl, m+lwork_dorglq_n) - wrkbl = max(wrkbl, 3*m+lwork_dgebrd) - wrkbl = max(wrkbl, 3*m+lwork_dorgbr_p) - wrkbl = max(wrkbl, 3*m+lwork_dorgbr_q) - wrkbl = max(wrkbl, bdspac) - maxwrk = m*m + wrkbl - } - } else { - // Path 10t (n greater than m, but not much larger) - impl.Dgebrd(m, n, a, lda, s, nil, nil, nil, work, -1) - lwork_dgebrd = int(work[0]) - maxwrk = 3*m + lwork_dgebrd - if wantvs || wantvo { - impl.Dorgbr(lapack.GeneratePT, m, n, m, a, n, nil, work, -1) - lwork_dorgbr_p = int(work[0]) - maxwrk = max(maxwrk, 3*m+lwork_dorgbr_p) - } - if wantva { - impl.Dorgbr(lapack.GeneratePT, n, n, m, a, n, nil, work, -1) - lwork_dorgbr_p = int(work[0]) - maxwrk = max(maxwrk, 3*m+lwork_dorgbr_p) - } - if !wantun { - maxwrk = max(maxwrk, 3*m+lwork_dorgbr_q) - } - maxwrk = max(maxwrk, bdspac) - } - } - - maxwrk = max(maxwrk, minwork) - if lwork == -1 { - work[0] = float64(maxwrk) - return true - } - - if len(a) < (m-1)*lda+n { - panic(shortA) - } - if len(s) < minmn { - panic(shortS) - } - if (len(u) < (m-1)*ldu+m && wantua) || (len(u) < (m-1)*ldu+minmn && wantus) { - panic(shortU) - } - if (len(vt) < (n-1)*ldvt+n && wantva) || (len(vt) < (minmn-1)*ldvt+n && wantvs) { - panic(shortVT) - } - - // Perform decomposition. - eps := dlamchE - smlnum := math.Sqrt(dlamchS) / eps - bignum := 1 / smlnum - - // Scale A if max element outside range [smlnum, bignum]. - anrm := impl.Dlange(lapack.MaxAbs, m, n, a, lda, nil) - var iscl bool - if anrm > 0 && anrm < smlnum { - iscl = true - impl.Dlascl(lapack.General, 0, 0, anrm, smlnum, m, n, a, lda) - } else if anrm > bignum { - iscl = true - impl.Dlascl(lapack.General, 0, 0, anrm, bignum, m, n, a, lda) - } - - bi := blas64.Implementation() - var ie int - if m >= n { - // If A has sufficiently more rows than columns, use the QR decomposition. - if m >= mnthr { - // m >> n - if wantun { - // Path 1. - itau := 0 - iwork := itau + n - - // Compute A = Q * R. - impl.Dgeqrf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - - // Zero out below R. - impl.Dlaset(blas.Lower, n-1, n-1, 0, 0, a[lda:], lda) - ie = 0 - itauq := ie + n - itaup := itauq + n - iwork = itaup + n - // Bidiagonalize R in A. - impl.Dgebrd(n, n, a, lda, s, work[ie:], work[itauq:], - work[itaup:], work[iwork:], lwork-iwork) - ncvt := 0 - if wantvo || wantvas { - impl.Dorgbr(lapack.GeneratePT, n, n, n, a, lda, work[itaup:], - work[iwork:], lwork-iwork) - ncvt = n - } - iwork = ie + n - - // Perform bidiagonal QR iteration computing right singular vectors - // of A in A if desired. - ok = impl.Dbdsqr(blas.Upper, n, ncvt, 0, 0, s, work[ie:], - a, lda, work, 1, work, 1, work[iwork:]) - - // If right singular vectors desired in VT, copy them there. - if wantvas { - impl.Dlacpy(blas.All, n, n, a, lda, vt, ldvt) - } - } else if wantuo && wantvn { - // Path 2 - panic(noSVDO) - } else if wantuo && wantvas { - // Path 3 - panic(noSVDO) - } else if wantus { - if wantvn { - // Path 4 - if lwork >= n*n+max(4*n, bdspac) { - // Sufficient workspace for a fast algorithm. - ir := 0 - var ldworkr int - if lwork >= wrkbl+lda*n { - ldworkr = lda - } else { - ldworkr = n - } - itau := ir + ldworkr*n - iwork := itau + n - // Compute A = Q * R. - impl.Dgeqrf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - - // Copy R to work[ir:], zeroing out below it. - impl.Dlacpy(blas.Upper, n, n, a, lda, work[ir:], ldworkr) - impl.Dlaset(blas.Lower, n-1, n-1, 0, 0, work[ir+ldworkr:], ldworkr) - - // Generate Q in A. - impl.Dorgqr(m, n, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - ie := itau - itauq := ie + n - itaup := itauq + n - iwork = itaup + n - - // Bidiagonalize R in work[ir:]. - impl.Dgebrd(n, n, work[ir:], ldworkr, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - - // Generate left vectors bidiagonalizing R in work[ir:]. - impl.Dorgbr(lapack.GenerateQ, n, n, n, work[ir:], ldworkr, - work[itauq:], work[iwork:], lwork-iwork) - iwork = ie + n - - // Perform bidiagonal QR iteration, compuing left singular - // vectors of R in work[ir:]. - ok = impl.Dbdsqr(blas.Upper, n, 0, n, 0, s, work[ie:], work, 1, - work[ir:], ldworkr, work, 1, work[iwork:]) - - // Multiply Q in A by left singular vectors of R in - // work[ir:], storing result in U. - bi.Dgemm(blas.NoTrans, blas.NoTrans, m, n, n, 1, a, lda, - work[ir:], ldworkr, 0, u, ldu) - } else { - // Insufficient workspace for a fast algorithm. - itau := 0 - iwork := itau + n - - // Compute A = Q*R, copying result to U. - impl.Dgeqrf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Lower, m, n, a, lda, u, ldu) - - // Generate Q in U. - impl.Dorgqr(m, n, n, u, ldu, work[itau:], work[iwork:], lwork-iwork) - ie := itau - itauq := ie + n - itaup := itauq + n - iwork = itaup + n - - // Zero out below R in A. - impl.Dlaset(blas.Lower, n-1, n-1, 0, 0, a[lda:], lda) - - // Bidiagonalize R in A. - impl.Dgebrd(n, n, a, lda, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - - // Multiply Q in U by left vectors bidiagonalizing R. - impl.Dormbr(lapack.ApplyQ, blas.Right, blas.NoTrans, m, n, n, - a, lda, work[itauq:], u, ldu, work[iwork:], lwork-iwork) - iwork = ie + n - - // Perform bidiagonal QR iteration, computing left - // singular vectors of A in U. - ok = impl.Dbdsqr(blas.Upper, n, 0, m, 0, s, work[ie:], work, 1, - u, ldu, work, 1, work[iwork:]) - } - } else if wantvo { - // Path 5 - panic(noSVDO) - } else if wantvas { - // Path 6 - if lwork >= n*n+max(4*n, bdspac) { - // Sufficient workspace for a fast algorithm. - iu := 0 - var ldworku int - if lwork >= wrkbl+lda*n { - ldworku = lda - } else { - ldworku = n - } - itau := iu + ldworku*n - iwork := itau + n - - // Compute A = Q * R. - impl.Dgeqrf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - // Copy R to work[iu:], zeroing out below it. - impl.Dlacpy(blas.Upper, n, n, a, lda, work[iu:], ldworku) - impl.Dlaset(blas.Lower, n-1, n-1, 0, 0, work[iu+ldworku:], ldworku) - - // Generate Q in A. - impl.Dorgqr(m, n, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - - ie := itau - itauq := ie + n - itaup := itauq + n - iwork = itaup + n - - // Bidiagonalize R in work[iu:], copying result to VT. - impl.Dgebrd(n, n, work[iu:], ldworku, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Upper, n, n, work[iu:], ldworku, vt, ldvt) - - // Generate left bidiagonalizing vectors in work[iu:]. - impl.Dorgbr(lapack.GenerateQ, n, n, n, work[iu:], ldworku, - work[itauq:], work[iwork:], lwork-iwork) - - // Generate right bidiagonalizing vectors in VT. - impl.Dorgbr(lapack.GeneratePT, n, n, n, vt, ldvt, - work[itaup:], work[iwork:], lwork-iwork) - iwork = ie + n - - // Perform bidiagonal QR iteration, computing left singular - // vectors of R in work[iu:], and computing right singular - // vectors of R in VT. - ok = impl.Dbdsqr(blas.Upper, n, n, n, 0, s, work[ie:], - vt, ldvt, work[iu:], ldworku, work, 1, work[iwork:]) - - // Multiply Q in A by left singular vectors of R in - // work[iu:], storing result in U. - bi.Dgemm(blas.NoTrans, blas.NoTrans, m, n, n, 1, a, lda, - work[iu:], ldworku, 0, u, ldu) - } else { - // Insufficient workspace for a fast algorithm. - itau := 0 - iwork := itau + n - - // Compute A = Q * R, copying result to U. - impl.Dgeqrf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Lower, m, n, a, lda, u, ldu) - - // Generate Q in U. - impl.Dorgqr(m, n, n, u, ldu, work[itau:], work[iwork:], lwork-iwork) - - // Copy R to VT, zeroing out below it. - impl.Dlacpy(blas.Upper, n, n, a, lda, vt, ldvt) - impl.Dlaset(blas.Lower, n-1, n-1, 0, 0, vt[ldvt:], ldvt) - - ie := itau - itauq := ie + n - itaup := itauq + n - iwork = itaup + n - - // Bidiagonalize R in VT. - impl.Dgebrd(n, n, vt, ldvt, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - - // Multiply Q in U by left bidiagonalizing vectors in VT. - impl.Dormbr(lapack.ApplyQ, blas.Right, blas.NoTrans, m, n, n, - vt, ldvt, work[itauq:], u, ldu, work[iwork:], lwork-iwork) - - // Generate right bidiagonalizing vectors in VT. - impl.Dorgbr(lapack.GeneratePT, n, n, n, vt, ldvt, - work[itaup:], work[iwork:], lwork-iwork) - iwork = ie + n - - // Perform bidiagonal QR iteration, computing left singular - // vectors of A in U and computing right singular vectors - // of A in VT. - ok = impl.Dbdsqr(blas.Upper, n, n, m, 0, s, work[ie:], - vt, ldvt, u, ldu, work, 1, work[iwork:]) - } - } - } else if wantua { - if wantvn { - // Path 7 - if lwork >= n*n+max(max(n+m, 4*n), bdspac) { - // Sufficient workspace for a fast algorithm. - ir := 0 - var ldworkr int - if lwork >= wrkbl+lda*n { - ldworkr = lda - } else { - ldworkr = n - } - itau := ir + ldworkr*n - iwork := itau + n - - // Compute A = Q*R, copying result to U. - impl.Dgeqrf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Lower, m, n, a, lda, u, ldu) - - // Copy R to work[ir:], zeroing out below it. - impl.Dlacpy(blas.Upper, n, n, a, lda, work[ir:], ldworkr) - impl.Dlaset(blas.Lower, n-1, n-1, 0, 0, work[ir+ldworkr:], ldworkr) - - // Generate Q in U. - impl.Dorgqr(m, m, n, u, ldu, work[itau:], work[iwork:], lwork-iwork) - ie := itau - itauq := ie + n - itaup := itauq + n - iwork = itaup + n - - // Bidiagonalize R in work[ir:]. - impl.Dgebrd(n, n, work[ir:], ldworkr, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - - // Generate left bidiagonalizing vectors in work[ir:]. - impl.Dorgbr(lapack.GenerateQ, n, n, n, work[ir:], ldworkr, - work[itauq:], work[iwork:], lwork-iwork) - iwork = ie + n - - // Perform bidiagonal QR iteration, computing left singular - // vectors of R in work[ir:]. - ok = impl.Dbdsqr(blas.Upper, n, 0, n, 0, s, work[ie:], work, 1, - work[ir:], ldworkr, work, 1, work[iwork:]) - - // Multiply Q in U by left singular vectors of R in - // work[ir:], storing result in A. - bi.Dgemm(blas.NoTrans, blas.NoTrans, m, n, n, 1, u, ldu, - work[ir:], ldworkr, 0, a, lda) - - // Copy left singular vectors of A from A to U. - impl.Dlacpy(blas.All, m, n, a, lda, u, ldu) - } else { - // Insufficient workspace for a fast algorithm. - itau := 0 - iwork := itau + n - - // Compute A = Q*R, copying result to U. - impl.Dgeqrf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Lower, m, n, a, lda, u, ldu) - - // Generate Q in U. - impl.Dorgqr(m, m, n, u, ldu, work[itau:], work[iwork:], lwork-iwork) - ie := itau - itauq := ie + n - itaup := itauq + n - iwork = itaup + n - - // Zero out below R in A. - impl.Dlaset(blas.Lower, n-1, n-1, 0, 0, a[lda:], lda) - - // Bidiagonalize R in A. - impl.Dgebrd(n, n, a, lda, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - - // Multiply Q in U by left bidiagonalizing vectors in A. - impl.Dormbr(lapack.ApplyQ, blas.Right, blas.NoTrans, m, n, n, - a, lda, work[itauq:], u, ldu, work[iwork:], lwork-iwork) - iwork = ie + n - - // Perform bidiagonal QR iteration, computing left - // singular vectors of A in U. - ok = impl.Dbdsqr(blas.Upper, n, 0, m, 0, s, work[ie:], - work, 1, u, ldu, work, 1, work[iwork:]) - } - } else if wantvo { - // Path 8. - panic(noSVDO) - } else if wantvas { - // Path 9. - if lwork >= n*n+max(max(n+m, 4*n), bdspac) { - // Sufficient workspace for a fast algorithm. - iu := 0 - var ldworku int - if lwork >= wrkbl+lda*n { - ldworku = lda - } else { - ldworku = n - } - itau := iu + ldworku*n - iwork := itau + n - - // Compute A = Q * R, copying result to U. - impl.Dgeqrf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Lower, m, n, a, lda, u, ldu) - - // Generate Q in U. - impl.Dorgqr(m, m, n, u, ldu, work[itau:], work[iwork:], lwork-iwork) - - // Copy R to work[iu:], zeroing out below it. - impl.Dlacpy(blas.Upper, n, n, a, lda, work[iu:], ldworku) - impl.Dlaset(blas.Lower, n-1, n-1, 0, 0, work[iu+ldworku:], ldworku) - - ie = itau - itauq := ie + n - itaup := itauq + n - iwork = itaup + n - - // Bidiagonalize R in work[iu:], copying result to VT. - impl.Dgebrd(n, n, work[iu:], ldworku, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Upper, n, n, work[iu:], ldworku, vt, ldvt) - - // Generate left bidiagonalizing vectors in work[iu:]. - impl.Dorgbr(lapack.GenerateQ, n, n, n, work[iu:], ldworku, - work[itauq:], work[iwork:], lwork-iwork) - - // Generate right bidiagonalizing vectors in VT. - impl.Dorgbr(lapack.GeneratePT, n, n, n, vt, ldvt, - work[itaup:], work[iwork:], lwork-iwork) - iwork = ie + n - - // Perform bidiagonal QR iteration, computing left singular - // vectors of R in work[iu:] and computing right - // singular vectors of R in VT. - ok = impl.Dbdsqr(blas.Upper, n, n, n, 0, s, work[ie:], - vt, ldvt, work[iu:], ldworku, work, 1, work[iwork:]) - - // Multiply Q in U by left singular vectors of R in - // work[iu:], storing result in A. - bi.Dgemm(blas.NoTrans, blas.NoTrans, m, n, n, 1, - u, ldu, work[iu:], ldworku, 0, a, lda) - - // Copy left singular vectors of A from A to U. - impl.Dlacpy(blas.All, m, n, a, lda, u, ldu) - - /* - // Bidiagonalize R in VT. - impl.Dgebrd(n, n, vt, ldvt, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - - // Multiply Q in U by left bidiagonalizing vectors in VT. - impl.Dormbr(lapack.ApplyQ, blas.Right, blas.NoTrans, - m, n, n, vt, ldvt, work[itauq:], u, ldu, work[iwork:], lwork-iwork) - - // Generate right bidiagonalizing vectors in VT. - impl.Dorgbr(lapack.GeneratePT, n, n, n, vt, ldvt, - work[itaup:], work[iwork:], lwork-iwork) - iwork = ie + n - - // Perform bidiagonal QR iteration, computing left singular - // vectors of A in U and computing right singular vectors - // of A in VT. - ok = impl.Dbdsqr(blas.Upper, n, n, m, 0, s, work[ie:], - vt, ldvt, u, ldu, work, 1, work[iwork:]) - */ - } else { - // Insufficient workspace for a fast algorithm. - itau := 0 - iwork := itau + n - - // Compute A = Q*R, copying result to U. - impl.Dgeqrf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Lower, m, n, a, lda, u, ldu) - - // Generate Q in U. - impl.Dorgqr(m, m, n, u, ldu, work[itau:], work[iwork:], lwork-iwork) - - // Copy R from A to VT, zeroing out below it. - impl.Dlacpy(blas.Upper, n, n, a, lda, vt, ldvt) - if n > 1 { - impl.Dlaset(blas.Lower, n-1, n-1, 0, 0, vt[ldvt:], ldvt) - } - - ie := itau - itauq := ie + n - itaup := itauq + n - iwork = itaup + n - - // Bidiagonalize R in VT. - impl.Dgebrd(n, n, vt, ldvt, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - - // Multiply Q in U by left bidiagonalizing vectors in VT. - impl.Dormbr(lapack.ApplyQ, blas.Right, blas.NoTrans, - m, n, n, vt, ldvt, work[itauq:], u, ldu, work[iwork:], lwork-iwork) - - // Generate right bidiagonizing vectors in VT. - impl.Dorgbr(lapack.GeneratePT, n, n, n, vt, ldvt, - work[itaup:], work[iwork:], lwork-iwork) - iwork = ie + n - - // Perform bidiagonal QR iteration, computing left singular - // vectors of A in U and computing right singular vectors - // of A in VT. - ok = impl.Dbdsqr(blas.Upper, n, n, m, 0, s, work[ie:], - vt, ldvt, u, ldu, work, 1, work[iwork:]) - } - } - } - } else { - // Path 10. - // M at least N, but not much larger. - ie = 0 - itauq := ie + n - itaup := itauq + n - iwork := itaup + n - - // Bidiagonalize A. - impl.Dgebrd(m, n, a, lda, s, work[ie:], work[itauq:], - work[itaup:], work[iwork:], lwork-iwork) - if wantuas { - // Left singular vectors are desired in U. Copy result to U and - // generate left biadiagonalizing vectors in U. - impl.Dlacpy(blas.Lower, m, n, a, lda, u, ldu) - var ncu int - if wantus { - ncu = n - } - if wantua { - ncu = m - } - impl.Dorgbr(lapack.GenerateQ, m, ncu, n, u, ldu, work[itauq:], work[iwork:], lwork-iwork) - } - if wantvas { - // Right singular vectors are desired in VT. Copy result to VT and - // generate left biadiagonalizing vectors in VT. - impl.Dlacpy(blas.Upper, n, n, a, lda, vt, ldvt) - impl.Dorgbr(lapack.GeneratePT, n, n, n, vt, ldvt, work[itaup:], work[iwork:], lwork-iwork) - } - if wantuo { - panic(noSVDO) - } - if wantvo { - panic(noSVDO) - } - iwork = ie + n - var nru, ncvt int - if wantuas || wantuo { - nru = m - } - if wantun { - nru = 0 - } - if wantvas || wantvo { - ncvt = n - } - if wantvn { - ncvt = 0 - } - if !wantuo && !wantvo { - // Perform bidiagonal QR iteration, if desired, computing left - // singular vectors in U and right singular vectors in VT. - ok = impl.Dbdsqr(blas.Upper, n, ncvt, nru, 0, s, work[ie:], - vt, ldvt, u, ldu, work, 1, work[iwork:]) - } else { - // There will be two branches when the implementation is complete. - panic(noSVDO) - } - } - } else { - // A has more columns than rows. If A has sufficiently more columns than - // rows, first reduce using the LQ decomposition. - if n >= mnthr { - // n >> m. - if wantvn { - // Path 1t. - itau := 0 - iwork := itau + m - - // Compute A = L*Q. - impl.Dgelqf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - - // Zero out above L. - impl.Dlaset(blas.Upper, m-1, m-1, 0, 0, a[1:], lda) - ie := 0 - itauq := ie + m - itaup := itauq + m - iwork = itaup + m - - // Bidiagonalize L in A. - impl.Dgebrd(m, m, a, lda, s, work[ie:itauq], - work[itauq:itaup], work[itaup:iwork], work[iwork:], lwork-iwork) - if wantuo || wantuas { - impl.Dorgbr(lapack.GenerateQ, m, m, m, a, lda, - work[itauq:], work[iwork:], lwork-iwork) - } - iwork = ie + m - nru := 0 - if wantuo || wantuas { - nru = m - } - - // Perform bidiagonal QR iteration, computing left singular vectors - // of A in A if desired. - ok = impl.Dbdsqr(blas.Upper, m, 0, nru, 0, s, work[ie:], - work, 1, a, lda, work, 1, work[iwork:]) - - // If left singular vectors desired in U, copy them there. - if wantuas { - impl.Dlacpy(blas.All, m, m, a, lda, u, ldu) - } - } else if wantvo && wantun { - // Path 2t. - panic(noSVDO) - } else if wantvo && wantuas { - // Path 3t. - panic(noSVDO) - } else if wantvs { - if wantun { - // Path 4t. - if lwork >= m*m+max(4*m, bdspac) { - // Sufficient workspace for a fast algorithm. - ir := 0 - var ldworkr int - if lwork >= wrkbl+lda*m { - ldworkr = lda - } else { - ldworkr = m - } - itau := ir + ldworkr*m - iwork := itau + m - - // Compute A = L*Q. - impl.Dgelqf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - - // Copy L to work[ir:], zeroing out above it. - impl.Dlacpy(blas.Lower, m, m, a, lda, work[ir:], ldworkr) - impl.Dlaset(blas.Upper, m-1, m-1, 0, 0, work[ir+1:], ldworkr) - - // Generate Q in A. - impl.Dorglq(m, n, m, a, lda, work[itau:], work[iwork:], lwork-iwork) - ie := itau - itauq := ie + m - itaup := itauq + m - iwork = itaup + m - - // Bidiagonalize L in work[ir:]. - impl.Dgebrd(m, m, work[ir:], ldworkr, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - - // Generate right vectors bidiagonalizing L in work[ir:]. - impl.Dorgbr(lapack.GeneratePT, m, m, m, work[ir:], ldworkr, - work[itaup:], work[iwork:], lwork-iwork) - iwork = ie + m - - // Perform bidiagonal QR iteration, computing right singular - // vectors of L in work[ir:]. - ok = impl.Dbdsqr(blas.Upper, m, m, 0, 0, s, work[ie:], - work[ir:], ldworkr, work, 1, work, 1, work[iwork:]) - - // Multiply right singular vectors of L in work[ir:] by - // Q in A, storing result in VT. - bi.Dgemm(blas.NoTrans, blas.NoTrans, m, n, m, 1, - work[ir:], ldworkr, a, lda, 0, vt, ldvt) - } else { - // Insufficient workspace for a fast algorithm. - itau := 0 - iwork := itau + m - - // Compute A = L*Q. - impl.Dgelqf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - - // Copy result to VT. - impl.Dlacpy(blas.Upper, m, n, a, lda, vt, ldvt) - - // Generate Q in VT. - impl.Dorglq(m, n, m, vt, ldvt, work[itau:], work[iwork:], lwork-iwork) - ie := itau - itauq := ie + m - itaup := itauq + m - iwork = itaup + m - - // Zero out above L in A. - impl.Dlaset(blas.Upper, m-1, m-1, 0, 0, a[1:], lda) - - // Bidiagonalize L in A. - impl.Dgebrd(m, m, a, lda, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - - // Multiply right vectors bidiagonalizing L by Q in VT. - impl.Dormbr(lapack.ApplyP, blas.Left, blas.Trans, m, n, m, - a, lda, work[itaup:], vt, ldvt, work[iwork:], lwork-iwork) - iwork = ie + m - - // Perform bidiagonal QR iteration, computing right - // singular vectors of A in VT. - ok = impl.Dbdsqr(blas.Upper, m, n, 0, 0, s, work[ie:], - vt, ldvt, work, 1, work, 1, work[iwork:]) - } - } else if wantuo { - // Path 5t. - panic(noSVDO) - } else if wantuas { - // Path 6t. - if lwork >= m*m+max(4*m, bdspac) { - // Sufficient workspace for a fast algorithm. - iu := 0 - var ldworku int - if lwork >= wrkbl+lda*m { - ldworku = lda - } else { - ldworku = m - } - itau := iu + ldworku*m - iwork := itau + m - - // Compute A = L*Q. - impl.Dgelqf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - - // Copy L to work[iu:], zeroing out above it. - impl.Dlacpy(blas.Lower, m, m, a, lda, work[iu:], ldworku) - impl.Dlaset(blas.Upper, m-1, m-1, 0, 0, work[iu+1:], ldworku) - - // Generate Q in A. - impl.Dorglq(m, n, m, a, lda, work[itau:], work[iwork:], lwork-iwork) - ie := itau - itauq := ie + m - itaup := itauq + m - iwork = itaup + m - - // Bidiagonalize L in work[iu:], copying result to U. - impl.Dgebrd(m, m, work[iu:], ldworku, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Lower, m, m, work[iu:], ldworku, u, ldu) - - // Generate right bidiagionalizing vectors in work[iu:]. - impl.Dorgbr(lapack.GeneratePT, m, m, m, work[iu:], ldworku, - work[itaup:], work[iwork:], lwork-iwork) - - // Generate left bidiagonalizing vectors in U. - impl.Dorgbr(lapack.GenerateQ, m, m, m, u, ldu, work[itauq:], work[iwork:], lwork-iwork) - iwork = ie + m - - // Perform bidiagonal QR iteration, computing left singular - // vectors of L in U and computing right singular vectors of - // L in work[iu:]. - ok = impl.Dbdsqr(blas.Upper, m, m, m, 0, s, work[ie:], - work[iu:], ldworku, u, ldu, work, 1, work[iwork:]) - - // Multiply right singular vectors of L in work[iu:] by - // Q in A, storing result in VT. - bi.Dgemm(blas.NoTrans, blas.NoTrans, m, n, m, 1, - work[iu:], ldworku, a, lda, 0, vt, ldvt) - } else { - // Insufficient workspace for a fast algorithm. - itau := 0 - iwork := itau + m - - // Compute A = L*Q, copying result to VT. - impl.Dgelqf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Upper, m, n, a, lda, vt, ldvt) - - // Generate Q in VT. - impl.Dorglq(m, n, m, vt, ldvt, work[itau:], work[iwork:], lwork-iwork) - - // Copy L to U, zeroing out above it. - impl.Dlacpy(blas.Lower, m, m, a, lda, u, ldu) - impl.Dlaset(blas.Upper, m-1, m-1, 0, 0, u[1:], ldu) - - ie := itau - itauq := ie + m - itaup := itauq + m - iwork = itaup + m - - // Bidiagonalize L in U. - impl.Dgebrd(m, m, u, ldu, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - - // Multiply right bidiagonalizing vectors in U by Q in VT. - impl.Dormbr(lapack.ApplyP, blas.Left, blas.Trans, m, n, m, - u, ldu, work[itaup:], vt, ldvt, work[iwork:], lwork-iwork) - - // Generate left bidiagonalizing vectors in U. - impl.Dorgbr(lapack.GenerateQ, m, m, m, u, ldu, work[itauq:], work[iwork:], lwork-iwork) - iwork = ie + m - - // Perform bidiagonal QR iteration, computing left singular - // vectors of A in U and computing right singular vectors - // of A in VT. - ok = impl.Dbdsqr(blas.Upper, m, n, m, 0, s, work[ie:], vt, ldvt, - u, ldu, work, 1, work[iwork:]) - } - } - } else if wantva { - if wantun { - // Path 7t. - if lwork >= m*m+max(max(n+m, 4*m), bdspac) { - // Sufficient workspace for a fast algorithm. - ir := 0 - var ldworkr int - if lwork >= wrkbl+lda*m { - ldworkr = lda - } else { - ldworkr = m - } - itau := ir + ldworkr*m - iwork := itau + m - - // Compute A = L*Q, copying result to VT. - impl.Dgelqf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Upper, m, n, a, lda, vt, ldvt) - - // Copy L to work[ir:], zeroing out above it. - impl.Dlacpy(blas.Lower, m, m, a, lda, work[ir:], ldworkr) - impl.Dlaset(blas.Upper, m-1, m-1, 0, 0, work[ir+1:], ldworkr) - - // Generate Q in VT. - impl.Dorglq(n, n, m, vt, ldvt, work[itau:], work[iwork:], lwork-iwork) - - ie := itau - itauq := ie + m - itaup := itauq + m - iwork = itaup + m - - // Bidiagonalize L in work[ir:]. - impl.Dgebrd(m, m, work[ir:], ldworkr, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - - // Generate right bidiagonalizing vectors in work[ir:]. - impl.Dorgbr(lapack.GeneratePT, m, m, m, work[ir:], ldworkr, - work[itaup:], work[iwork:], lwork-iwork) - iwork = ie + m - - // Perform bidiagonal QR iteration, computing right - // singular vectors of L in work[ir:]. - ok = impl.Dbdsqr(blas.Upper, m, m, 0, 0, s, work[ie:], - work[ir:], ldworkr, work, 1, work, 1, work[iwork:]) - - // Multiply right singular vectors of L in work[ir:] by - // Q in VT, storing result in A. - bi.Dgemm(blas.NoTrans, blas.NoTrans, m, n, m, 1, - work[ir:], ldworkr, vt, ldvt, 0, a, lda) - - // Copy right singular vectors of A from A to VT. - impl.Dlacpy(blas.All, m, n, a, lda, vt, ldvt) - } else { - // Insufficient workspace for a fast algorithm. - itau := 0 - iwork := itau + m - // Compute A = L * Q, copying result to VT. - impl.Dgelqf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Upper, m, n, a, lda, vt, ldvt) - - // Generate Q in VT. - impl.Dorglq(n, n, m, vt, ldvt, work[itau:], work[iwork:], lwork-iwork) - - ie := itau - itauq := ie + m - itaup := itauq + m - iwork = itaup + m - - // Zero out above L in A. - impl.Dlaset(blas.Upper, m-1, m-1, 0, 0, a[1:], lda) - - // Bidiagonalize L in A. - impl.Dgebrd(m, m, a, lda, s, work[ie:], work[itauq:], - work[itaup:], work[iwork:], lwork-iwork) - - // Multiply right bidiagonalizing vectors in A by Q in VT. - impl.Dormbr(lapack.ApplyP, blas.Left, blas.Trans, m, n, m, - a, lda, work[itaup:], vt, ldvt, work[iwork:], lwork-iwork) - iwork = ie + m - - // Perform bidiagonal QR iteration, computing right singular - // vectors of A in VT. - ok = impl.Dbdsqr(blas.Upper, m, n, 0, 0, s, work[ie:], - vt, ldvt, work, 1, work, 1, work[iwork:]) - } - } else if wantuo { - panic(noSVDO) - } else if wantuas { - // Path 9t. - if lwork >= m*m+max(max(m+n, 4*m), bdspac) { - // Sufficient workspace for a fast algorithm. - iu := 0 - - var ldworku int - if lwork >= wrkbl+lda*m { - ldworku = lda - } else { - ldworku = m - } - itau := iu + ldworku*m - iwork := itau + m - - // Generate A = L * Q copying result to VT. - impl.Dgelqf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Upper, m, n, a, lda, vt, ldvt) - - // Generate Q in VT. - impl.Dorglq(n, n, m, vt, ldvt, work[itau:], work[iwork:], lwork-iwork) - - // Copy L to work[iu:], zeroing out above it. - impl.Dlacpy(blas.Lower, m, m, a, lda, work[iu:], ldworku) - impl.Dlaset(blas.Upper, m-1, m-1, 0, 0, work[iu+1:], ldworku) - ie = itau - itauq := ie + m - itaup := itauq + m - iwork = itaup + m - - // Bidiagonalize L in work[iu:], copying result to U. - impl.Dgebrd(m, m, work[iu:], ldworku, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Lower, m, m, work[iu:], ldworku, u, ldu) - - // Generate right bidiagonalizing vectors in work[iu:]. - impl.Dorgbr(lapack.GeneratePT, m, m, m, work[iu:], ldworku, - work[itaup:], work[iwork:], lwork-iwork) - - // Generate left bidiagonalizing vectors in U. - impl.Dorgbr(lapack.GenerateQ, m, m, m, u, ldu, work[itauq:], work[iwork:], lwork-iwork) - iwork = ie + m - - // Perform bidiagonal QR iteration, computing left singular - // vectors of L in U and computing right singular vectors - // of L in work[iu:]. - ok = impl.Dbdsqr(blas.Upper, m, m, m, 0, s, work[ie:], - work[iu:], ldworku, u, ldu, work, 1, work[iwork:]) - - // Multiply right singular vectors of L in work[iu:] - // Q in VT, storing result in A. - bi.Dgemm(blas.NoTrans, blas.NoTrans, m, n, m, 1, - work[iu:], ldworku, vt, ldvt, 0, a, lda) - - // Copy right singular vectors of A from A to VT. - impl.Dlacpy(blas.All, m, n, a, lda, vt, ldvt) - } else { - // Insufficient workspace for a fast algorithm. - itau := 0 - iwork := itau + m - - // Compute A = L * Q, copying result to VT. - impl.Dgelqf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Upper, m, n, a, lda, vt, ldvt) - - // Generate Q in VT. - impl.Dorglq(n, n, m, vt, ldvt, work[itau:], work[iwork:], lwork-iwork) - - // Copy L to U, zeroing out above it. - impl.Dlacpy(blas.Lower, m, m, a, lda, u, ldu) - impl.Dlaset(blas.Upper, m-1, m-1, 0, 0, u[1:], ldu) - - ie = itau - itauq := ie + m - itaup := itauq + m - iwork = itaup + m - - // Bidiagonalize L in U. - impl.Dgebrd(m, m, u, ldu, s, work[ie:], work[itauq:], - work[itaup:], work[iwork:], lwork-iwork) - - // Multiply right bidiagonalizing vectors in U by Q in VT. - impl.Dormbr(lapack.ApplyP, blas.Left, blas.Trans, m, n, m, - u, ldu, work[itaup:], vt, ldvt, work[iwork:], lwork-iwork) - - // Generate left bidiagonalizing vectors in U. - impl.Dorgbr(lapack.GenerateQ, m, m, m, u, ldu, work[itauq:], work[iwork:], lwork-iwork) - iwork = ie + m - - // Perform bidiagonal QR iteration, computing left singular - // vectors of A in U and computing right singular vectors - // of A in VT. - ok = impl.Dbdsqr(blas.Upper, m, n, m, 0, s, work[ie:], - vt, ldvt, u, ldu, work, 1, work[iwork:]) - } - } - } - } else { - // Path 10t. - // N at least M, but not much larger. - ie = 0 - itauq := ie + m - itaup := itauq + m - iwork := itaup + m - - // Bidiagonalize A. - impl.Dgebrd(m, n, a, lda, s, work[ie:], work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - if wantuas { - // If left singular vectors desired in U, copy result to U and - // generate left bidiagonalizing vectors in U. - impl.Dlacpy(blas.Lower, m, m, a, lda, u, ldu) - impl.Dorgbr(lapack.GenerateQ, m, m, n, u, ldu, work[itauq:], work[iwork:], lwork-iwork) - } - if wantvas { - // If right singular vectors desired in VT, copy result to VT - // and generate right bidiagonalizing vectors in VT. - impl.Dlacpy(blas.Upper, m, n, a, lda, vt, ldvt) - var nrvt int - if wantva { - nrvt = n - } else { - nrvt = m - } - impl.Dorgbr(lapack.GeneratePT, nrvt, n, m, vt, ldvt, work[itaup:], work[iwork:], lwork-iwork) - } - if wantuo { - panic(noSVDO) - } - if wantvo { - panic(noSVDO) - } - iwork = ie + m - var nru, ncvt int - if wantuas || wantuo { - nru = m - } - if wantvas || wantvo { - ncvt = n - } - if !wantuo && !wantvo { - // Perform bidiagonal QR iteration, if desired, computing left - // singular vectors in U and computing right singular vectors in - // VT. - ok = impl.Dbdsqr(blas.Lower, m, ncvt, nru, 0, s, work[ie:], - vt, ldvt, u, ldu, work, 1, work[iwork:]) - } else { - // There will be two branches when the implementation is complete. - panic(noSVDO) - } - } - } - if !ok { - if ie > 1 { - for i := 0; i < minmn-1; i++ { - work[i+1] = work[i+ie] - } - } - if ie < 1 { - for i := minmn - 2; i >= 0; i-- { - work[i+1] = work[i+ie] - } - } - } - // Undo scaling if necessary. - if iscl { - if anrm > bignum { - impl.Dlascl(lapack.General, 0, 0, bignum, anrm, 1, minmn, s, minmn) - } - if !ok && anrm > bignum { - impl.Dlascl(lapack.General, 0, 0, bignum, anrm, 1, minmn-1, work[1:], minmn) - } - if anrm < smlnum { - impl.Dlascl(lapack.General, 0, 0, smlnum, anrm, 1, minmn, s, minmn) - } - if !ok && anrm < smlnum { - impl.Dlascl(lapack.General, 0, 0, smlnum, anrm, 1, minmn-1, work[1:], minmn) - } - } - work[0] = float64(maxwrk) - return ok -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgetf2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgetf2.go deleted file mode 100644 index 63ad72e..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgetf2.go +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas/blas64" -) - -// Dgetf2 computes the LU decomposition of the m×n matrix A. -// The LU decomposition is a factorization of a into -// A = P * L * U -// where P is a permutation matrix, L is a unit lower triangular matrix, and -// U is a (usually) non-unit upper triangular matrix. On exit, L and U are stored -// in place into a. -// -// ipiv is a permutation vector. It indicates that row i of the matrix was -// changed with ipiv[i]. ipiv must have length at least min(m,n), and will panic -// otherwise. ipiv is zero-indexed. -// -// Dgetf2 returns whether the matrix A is singular. The LU decomposition will -// be computed regardless of the singularity of A, but division by zero -// will occur if the false is returned and the result is used to solve a -// system of equations. -// -// Dgetf2 is an internal routine. It is exported for testing purposes. -func (Implementation) Dgetf2(m, n int, a []float64, lda int, ipiv []int) (ok bool) { - mn := min(m, n) - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if mn == 0 { - return true - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(ipiv) != mn: - panic(badLenIpiv) - } - - bi := blas64.Implementation() - - sfmin := dlamchS - ok = true - for j := 0; j < mn; j++ { - // Find a pivot and test for singularity. - jp := j + bi.Idamax(m-j, a[j*lda+j:], lda) - ipiv[j] = jp - if a[jp*lda+j] == 0 { - ok = false - } else { - // Swap the rows if necessary. - if jp != j { - bi.Dswap(n, a[j*lda:], 1, a[jp*lda:], 1) - } - if j < m-1 { - aj := a[j*lda+j] - if math.Abs(aj) >= sfmin { - bi.Dscal(m-j-1, 1/aj, a[(j+1)*lda+j:], lda) - } else { - for i := 0; i < m-j-1; i++ { - a[(j+1)*lda+j] = a[(j+1)*lda+j] / a[lda*j+j] - } - } - } - } - if j < mn-1 { - bi.Dger(m-j-1, n-j-1, -1, a[(j+1)*lda+j:], lda, a[j*lda+j+1:], 1, a[(j+1)*lda+j+1:], lda) - } - } - return ok -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgetrf.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgetrf.go deleted file mode 100644 index ad01e71..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgetrf.go +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dgetrf computes the LU decomposition of the m×n matrix A. -// The LU decomposition is a factorization of A into -// A = P * L * U -// where P is a permutation matrix, L is a unit lower triangular matrix, and -// U is a (usually) non-unit upper triangular matrix. On exit, L and U are stored -// in place into a. -// -// ipiv is a permutation vector. It indicates that row i of the matrix was -// changed with ipiv[i]. ipiv must have length at least min(m,n), and will panic -// otherwise. ipiv is zero-indexed. -// -// Dgetrf is the blocked version of the algorithm. -// -// Dgetrf returns whether the matrix A is singular. The LU decomposition will -// be computed regardless of the singularity of A, but division by zero -// will occur if the false is returned and the result is used to solve a -// system of equations. -func (impl Implementation) Dgetrf(m, n int, a []float64, lda int, ipiv []int) (ok bool) { - mn := min(m, n) - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if mn == 0 { - return true - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(ipiv) != mn: - panic(badLenIpiv) - } - - bi := blas64.Implementation() - - nb := impl.Ilaenv(1, "DGETRF", " ", m, n, -1, -1) - if nb <= 1 || mn <= nb { - // Use the unblocked algorithm. - return impl.Dgetf2(m, n, a, lda, ipiv) - } - ok = true - for j := 0; j < mn; j += nb { - jb := min(mn-j, nb) - blockOk := impl.Dgetf2(m-j, jb, a[j*lda+j:], lda, ipiv[j:j+jb]) - if !blockOk { - ok = false - } - for i := j; i <= min(m-1, j+jb-1); i++ { - ipiv[i] = j + ipiv[i] - } - impl.Dlaswp(j, a, lda, j, j+jb-1, ipiv[:j+jb], 1) - if j+jb < n { - impl.Dlaswp(n-j-jb, a[j+jb:], lda, j, j+jb-1, ipiv[:j+jb], 1) - bi.Dtrsm(blas.Left, blas.Lower, blas.NoTrans, blas.Unit, - jb, n-j-jb, 1, - a[j*lda+j:], lda, - a[j*lda+j+jb:], lda) - if j+jb < m { - bi.Dgemm(blas.NoTrans, blas.NoTrans, m-j-jb, n-j-jb, jb, -1, - a[(j+jb)*lda+j:], lda, - a[j*lda+j+jb:], lda, - 1, a[(j+jb)*lda+j+jb:], lda) - } - } - } - return ok -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgetri.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgetri.go deleted file mode 100644 index b2f2ae4..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgetri.go +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dgetri computes the inverse of the matrix A using the LU factorization computed -// by Dgetrf. On entry, a contains the PLU decomposition of A as computed by -// Dgetrf and on exit contains the reciprocal of the original matrix. -// -// Dgetri will not perform the inversion if the matrix is singular, and returns -// a boolean indicating whether the inversion was successful. -// -// work is temporary storage, and lwork specifies the usable memory length. -// At minimum, lwork >= n and this function will panic otherwise. -// Dgetri is a blocked inversion, but the block size is limited -// by the temporary space available. If lwork == -1, instead of performing Dgetri, -// the optimal work length will be stored into work[0]. -func (impl Implementation) Dgetri(n int, a []float64, lda int, ipiv []int, work []float64, lwork int) (ok bool) { - iws := max(1, n) - switch { - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case lwork < iws && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - if n == 0 { - work[0] = 1 - return true - } - - nb := impl.Ilaenv(1, "DGETRI", " ", n, -1, -1, -1) - if lwork == -1 { - work[0] = float64(n * nb) - return true - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(ipiv) != n: - panic(badLenIpiv) - } - - // Form inv(U). - ok = impl.Dtrtri(blas.Upper, blas.NonUnit, n, a, lda) - if !ok { - return false - } - - nbmin := 2 - if 1 < nb && nb < n { - iws = max(n*nb, 1) - if lwork < iws { - nb = lwork / n - nbmin = max(2, impl.Ilaenv(2, "DGETRI", " ", n, -1, -1, -1)) - } - } - ldwork := nb - - bi := blas64.Implementation() - // Solve the equation inv(A)*L = inv(U) for inv(A). - // TODO(btracey): Replace this with a more row-major oriented algorithm. - if nb < nbmin || n <= nb { - // Unblocked code. - for j := n - 1; j >= 0; j-- { - for i := j + 1; i < n; i++ { - // Copy current column of L to work and replace with zeros. - work[i] = a[i*lda+j] - a[i*lda+j] = 0 - } - // Compute current column of inv(A). - if j < n-1 { - bi.Dgemv(blas.NoTrans, n, n-j-1, -1, a[(j+1):], lda, work[(j+1):], 1, 1, a[j:], lda) - } - } - } else { - // Blocked code. - nn := ((n - 1) / nb) * nb - for j := nn; j >= 0; j -= nb { - jb := min(nb, n-j) - // Copy current block column of L to work and replace - // with zeros. - for jj := j; jj < j+jb; jj++ { - for i := jj + 1; i < n; i++ { - work[i*ldwork+(jj-j)] = a[i*lda+jj] - a[i*lda+jj] = 0 - } - } - // Compute current block column of inv(A). - if j+jb < n { - bi.Dgemm(blas.NoTrans, blas.NoTrans, n, jb, n-j-jb, -1, a[(j+jb):], lda, work[(j+jb)*ldwork:], ldwork, 1, a[j:], lda) - } - bi.Dtrsm(blas.Right, blas.Lower, blas.NoTrans, blas.Unit, n, jb, 1, work[j*ldwork:], ldwork, a[j:], lda) - } - } - // Apply column interchanges. - for j := n - 2; j >= 0; j-- { - jp := ipiv[j] - if jp != j { - bi.Dswap(n, a[j:], lda, a[jp:], lda) - } - } - work[0] = float64(iws) - return true -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgetrs.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgetrs.go deleted file mode 100644 index 5531934..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgetrs.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dgetrs solves a system of equations using an LU factorization. -// The system of equations solved is -// A * X = B if trans == blas.Trans -// Aᵀ * X = B if trans == blas.NoTrans -// A is a general n×n matrix with stride lda. B is a general matrix of size n×nrhs. -// -// On entry b contains the elements of the matrix B. On exit, b contains the -// elements of X, the solution to the system of equations. -// -// a and ipiv contain the LU factorization of A and the permutation indices as -// computed by Dgetrf. ipiv is zero-indexed. -func (impl Implementation) Dgetrs(trans blas.Transpose, n, nrhs int, a []float64, lda int, ipiv []int, b []float64, ldb int) { - switch { - case trans != blas.NoTrans && trans != blas.Trans && trans != blas.ConjTrans: - panic(badTrans) - case n < 0: - panic(nLT0) - case nrhs < 0: - panic(nrhsLT0) - case lda < max(1, n): - panic(badLdA) - case ldb < max(1, nrhs): - panic(badLdB) - } - - // Quick return if possible. - if n == 0 || nrhs == 0 { - return - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(b) < (n-1)*ldb+nrhs: - panic(shortB) - case len(ipiv) != n: - panic(badLenIpiv) - } - - bi := blas64.Implementation() - - if trans == blas.NoTrans { - // Solve A * X = B. - impl.Dlaswp(nrhs, b, ldb, 0, n-1, ipiv, 1) - // Solve L * X = B, updating b. - bi.Dtrsm(blas.Left, blas.Lower, blas.NoTrans, blas.Unit, - n, nrhs, 1, a, lda, b, ldb) - // Solve U * X = B, updating b. - bi.Dtrsm(blas.Left, blas.Upper, blas.NoTrans, blas.NonUnit, - n, nrhs, 1, a, lda, b, ldb) - return - } - // Solve Aᵀ * X = B. - // Solve Uᵀ * X = B, updating b. - bi.Dtrsm(blas.Left, blas.Upper, blas.Trans, blas.NonUnit, - n, nrhs, 1, a, lda, b, ldb) - // Solve Lᵀ * X = B, updating b. - bi.Dtrsm(blas.Left, blas.Lower, blas.Trans, blas.Unit, - n, nrhs, 1, a, lda, b, ldb) - impl.Dlaswp(nrhs, b, ldb, 0, n-1, ipiv, -1) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dggsvd3.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dggsvd3.go deleted file mode 100644 index d5c8be9..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dggsvd3.go +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright ©2017 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dggsvd3 computes the generalized singular value decomposition (GSVD) -// of an m×n matrix A and p×n matrix B: -// Uᵀ*A*Q = D1*[ 0 R ] -// -// Vᵀ*B*Q = D2*[ 0 R ] -// where U, V and Q are orthogonal matrices. -// -// Dggsvd3 returns k and l, the dimensions of the sub-blocks. k+l -// is the effective numerical rank of the (m+p)×n matrix [ Aᵀ Bᵀ ]ᵀ. -// R is a (k+l)×(k+l) nonsingular upper triangular matrix, D1 and -// D2 are m×(k+l) and p×(k+l) diagonal matrices and of the following -// structures, respectively: -// -// If m-k-l >= 0, -// -// k l -// D1 = k [ I 0 ] -// l [ 0 C ] -// m-k-l [ 0 0 ] -// -// k l -// D2 = l [ 0 S ] -// p-l [ 0 0 ] -// -// n-k-l k l -// [ 0 R ] = k [ 0 R11 R12 ] k -// l [ 0 0 R22 ] l -// -// where -// -// C = diag( alpha_k, ... , alpha_{k+l} ), -// S = diag( beta_k, ... , beta_{k+l} ), -// C^2 + S^2 = I. -// -// R is stored in -// A[0:k+l, n-k-l:n] -// on exit. -// -// If m-k-l < 0, -// -// k m-k k+l-m -// D1 = k [ I 0 0 ] -// m-k [ 0 C 0 ] -// -// k m-k k+l-m -// D2 = m-k [ 0 S 0 ] -// k+l-m [ 0 0 I ] -// p-l [ 0 0 0 ] -// -// n-k-l k m-k k+l-m -// [ 0 R ] = k [ 0 R11 R12 R13 ] -// m-k [ 0 0 R22 R23 ] -// k+l-m [ 0 0 0 R33 ] -// -// where -// C = diag( alpha_k, ... , alpha_m ), -// S = diag( beta_k, ... , beta_m ), -// C^2 + S^2 = I. -// -// R = [ R11 R12 R13 ] is stored in A[1:m, n-k-l+1:n] -// [ 0 R22 R23 ] -// and R33 is stored in -// B[m-k:l, n+m-k-l:n] on exit. -// -// Dggsvd3 computes C, S, R, and optionally the orthogonal transformation -// matrices U, V and Q. -// -// jobU, jobV and jobQ are options for computing the orthogonal matrices. The behavior -// is as follows -// jobU == lapack.GSVDU Compute orthogonal matrix U -// jobU == lapack.GSVDNone Do not compute orthogonal matrix. -// The behavior is the same for jobV and jobQ with the exception that instead of -// lapack.GSVDU these accept lapack.GSVDV and lapack.GSVDQ respectively. -// The matrices U, V and Q must be m×m, p×p and n×n respectively unless the -// relevant job parameter is lapack.GSVDNone. -// -// alpha and beta must have length n or Dggsvd3 will panic. On exit, alpha and -// beta contain the generalized singular value pairs of A and B -// alpha[0:k] = 1, -// beta[0:k] = 0, -// if m-k-l >= 0, -// alpha[k:k+l] = diag(C), -// beta[k:k+l] = diag(S), -// if m-k-l < 0, -// alpha[k:m]= C, alpha[m:k+l]= 0 -// beta[k:m] = S, beta[m:k+l] = 1. -// if k+l < n, -// alpha[k+l:n] = 0 and -// beta[k+l:n] = 0. -// -// On exit, iwork contains the permutation required to sort alpha descending. -// -// iwork must have length n, work must have length at least max(1, lwork), and -// lwork must be -1 or greater than n, otherwise Dggsvd3 will panic. If -// lwork is -1, work[0] holds the optimal lwork on return, but Dggsvd3 does -// not perform the GSVD. -func (impl Implementation) Dggsvd3(jobU, jobV, jobQ lapack.GSVDJob, m, n, p int, a []float64, lda int, b []float64, ldb int, alpha, beta, u []float64, ldu int, v []float64, ldv int, q []float64, ldq int, work []float64, lwork int, iwork []int) (k, l int, ok bool) { - wantu := jobU == lapack.GSVDU - wantv := jobV == lapack.GSVDV - wantq := jobQ == lapack.GSVDQ - switch { - case !wantu && jobU != lapack.GSVDNone: - panic(badGSVDJob + "U") - case !wantv && jobV != lapack.GSVDNone: - panic(badGSVDJob + "V") - case !wantq && jobQ != lapack.GSVDNone: - panic(badGSVDJob + "Q") - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case p < 0: - panic(pLT0) - case lda < max(1, n): - panic(badLdA) - case ldb < max(1, n): - panic(badLdB) - case ldu < 1, wantu && ldu < m: - panic(badLdU) - case ldv < 1, wantv && ldv < p: - panic(badLdV) - case ldq < 1, wantq && ldq < n: - panic(badLdQ) - case len(iwork) < n: - panic(shortWork) - case lwork < 1 && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Determine optimal work length. - impl.Dggsvp3(jobU, jobV, jobQ, - m, p, n, - a, lda, - b, ldb, - 0, 0, - u, ldu, - v, ldv, - q, ldq, - iwork, - work, work, -1) - lwkopt := n + int(work[0]) - lwkopt = max(lwkopt, 2*n) - lwkopt = max(lwkopt, 1) - work[0] = float64(lwkopt) - if lwork == -1 { - return 0, 0, true - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(b) < (p-1)*ldb+n: - panic(shortB) - case wantu && len(u) < (m-1)*ldu+m: - panic(shortU) - case wantv && len(v) < (p-1)*ldv+p: - panic(shortV) - case wantq && len(q) < (n-1)*ldq+n: - panic(shortQ) - case len(alpha) != n: - panic(badLenAlpha) - case len(beta) != n: - panic(badLenBeta) - } - - // Compute the Frobenius norm of matrices A and B. - anorm := impl.Dlange(lapack.Frobenius, m, n, a, lda, nil) - bnorm := impl.Dlange(lapack.Frobenius, p, n, b, ldb, nil) - - // Get machine precision and set up threshold for determining - // the effective numerical rank of the matrices A and B. - tola := float64(max(m, n)) * math.Max(anorm, dlamchS) * dlamchP - tolb := float64(max(p, n)) * math.Max(bnorm, dlamchS) * dlamchP - - // Preprocessing. - k, l = impl.Dggsvp3(jobU, jobV, jobQ, - m, p, n, - a, lda, - b, ldb, - tola, tolb, - u, ldu, - v, ldv, - q, ldq, - iwork, - work[:n], work[n:], lwork-n) - - // Compute the GSVD of two upper "triangular" matrices. - _, ok = impl.Dtgsja(jobU, jobV, jobQ, - m, p, n, - k, l, - a, lda, - b, ldb, - tola, tolb, - alpha, beta, - u, ldu, - v, ldv, - q, ldq, - work) - - // Sort the singular values and store the pivot indices in iwork - // Copy alpha to work, then sort alpha in work. - bi := blas64.Implementation() - bi.Dcopy(n, alpha, 1, work[:n], 1) - ibnd := min(l, m-k) - for i := 0; i < ibnd; i++ { - // Scan for largest alpha_{k+i}. - isub := i - smax := work[k+i] - for j := i + 1; j < ibnd; j++ { - if v := work[k+j]; v > smax { - isub = j - smax = v - } - } - if isub != i { - work[k+isub] = work[k+i] - work[k+i] = smax - iwork[k+i] = k + isub - } else { - iwork[k+i] = k + i - } - } - - work[0] = float64(lwkopt) - - return k, l, ok -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dggsvp3.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dggsvp3.go deleted file mode 100644 index 902260c..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dggsvp3.go +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright ©2017 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dggsvp3 computes orthogonal matrices U, V and Q such that -// -// n-k-l k l -// Uᵀ*A*Q = k [ 0 A12 A13 ] if m-k-l >= 0; -// l [ 0 0 A23 ] -// m-k-l [ 0 0 0 ] -// -// n-k-l k l -// Uᵀ*A*Q = k [ 0 A12 A13 ] if m-k-l < 0; -// m-k [ 0 0 A23 ] -// -// n-k-l k l -// Vᵀ*B*Q = l [ 0 0 B13 ] -// p-l [ 0 0 0 ] -// -// where the k×k matrix A12 and l×l matrix B13 are non-singular -// upper triangular. A23 is l×l upper triangular if m-k-l >= 0, -// otherwise A23 is (m-k)×l upper trapezoidal. -// -// Dggsvp3 returns k and l, the dimensions of the sub-blocks. k+l -// is the effective numerical rank of the (m+p)×n matrix [ Aᵀ Bᵀ ]ᵀ. -// -// jobU, jobV and jobQ are options for computing the orthogonal matrices. The behavior -// is as follows -// jobU == lapack.GSVDU Compute orthogonal matrix U -// jobU == lapack.GSVDNone Do not compute orthogonal matrix. -// The behavior is the same for jobV and jobQ with the exception that instead of -// lapack.GSVDU these accept lapack.GSVDV and lapack.GSVDQ respectively. -// The matrices U, V and Q must be m×m, p×p and n×n respectively unless the -// relevant job parameter is lapack.GSVDNone. -// -// tola and tolb are the convergence criteria for the Jacobi-Kogbetliantz -// iteration procedure. Generally, they are the same as used in the preprocessing -// step, for example, -// tola = max(m, n)*norm(A)*eps, -// tolb = max(p, n)*norm(B)*eps. -// Where eps is the machine epsilon. -// -// iwork must have length n, work must have length at least max(1, lwork), and -// lwork must be -1 or greater than zero, otherwise Dggsvp3 will panic. -// -// Dggsvp3 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dggsvp3(jobU, jobV, jobQ lapack.GSVDJob, m, p, n int, a []float64, lda int, b []float64, ldb int, tola, tolb float64, u []float64, ldu int, v []float64, ldv int, q []float64, ldq int, iwork []int, tau, work []float64, lwork int) (k, l int) { - wantu := jobU == lapack.GSVDU - wantv := jobV == lapack.GSVDV - wantq := jobQ == lapack.GSVDQ - switch { - case !wantu && jobU != lapack.GSVDNone: - panic(badGSVDJob + "U") - case !wantv && jobV != lapack.GSVDNone: - panic(badGSVDJob + "V") - case !wantq && jobQ != lapack.GSVDNone: - panic(badGSVDJob + "Q") - case m < 0: - panic(mLT0) - case p < 0: - panic(pLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case ldb < max(1, n): - panic(badLdB) - case ldu < 1, wantu && ldu < m: - panic(badLdU) - case ldv < 1, wantv && ldv < p: - panic(badLdV) - case ldq < 1, wantq && ldq < n: - panic(badLdQ) - case len(iwork) != n: - panic(shortWork) - case lwork < 1 && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - var lwkopt int - impl.Dgeqp3(p, n, b, ldb, iwork, tau, work, -1) - lwkopt = int(work[0]) - if wantv { - lwkopt = max(lwkopt, p) - } - lwkopt = max(lwkopt, min(n, p)) - lwkopt = max(lwkopt, m) - if wantq { - lwkopt = max(lwkopt, n) - } - impl.Dgeqp3(m, n, a, lda, iwork, tau, work, -1) - lwkopt = max(lwkopt, int(work[0])) - lwkopt = max(1, lwkopt) - if lwork == -1 { - work[0] = float64(lwkopt) - return 0, 0 - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(b) < (p-1)*ldb+n: - panic(shortB) - case wantu && len(u) < (m-1)*ldu+m: - panic(shortU) - case wantv && len(v) < (p-1)*ldv+p: - panic(shortV) - case wantq && len(q) < (n-1)*ldq+n: - panic(shortQ) - case len(tau) < n: - // tau check must come after lwkopt query since - // the Dggsvd3 call for lwkopt query may have - // lwork == -1, and tau is provided by work. - panic(shortTau) - } - - const forward = true - - // QR with column pivoting of B: B*P = V*[ S11 S12 ]. - // [ 0 0 ] - for i := range iwork[:n] { - iwork[i] = 0 - } - impl.Dgeqp3(p, n, b, ldb, iwork, tau, work, lwork) - - // Update A := A*P. - impl.Dlapmt(forward, m, n, a, lda, iwork) - - // Determine the effective rank of matrix B. - for i := 0; i < min(p, n); i++ { - if math.Abs(b[i*ldb+i]) > tolb { - l++ - } - } - - if wantv { - // Copy the details of V, and form V. - impl.Dlaset(blas.All, p, p, 0, 0, v, ldv) - if p > 1 { - impl.Dlacpy(blas.Lower, p-1, min(p, n), b[ldb:], ldb, v[ldv:], ldv) - } - impl.Dorg2r(p, p, min(p, n), v, ldv, tau, work) - } - - // Clean up B. - for i := 1; i < l; i++ { - r := b[i*ldb : i*ldb+i] - for j := range r { - r[j] = 0 - } - } - if p > l { - impl.Dlaset(blas.All, p-l, n, 0, 0, b[l*ldb:], ldb) - } - - if wantq { - // Set Q = I and update Q := Q*P. - impl.Dlaset(blas.All, n, n, 0, 1, q, ldq) - impl.Dlapmt(forward, n, n, q, ldq, iwork) - } - - if p >= l && n != l { - // RQ factorization of [ S11 S12 ]: [ S11 S12 ] = [ 0 S12 ]*Z. - impl.Dgerq2(l, n, b, ldb, tau, work) - - // Update A := A*Zᵀ. - impl.Dormr2(blas.Right, blas.Trans, m, n, l, b, ldb, tau, a, lda, work) - - if wantq { - // Update Q := Q*Zᵀ. - impl.Dormr2(blas.Right, blas.Trans, n, n, l, b, ldb, tau, q, ldq, work) - } - - // Clean up B. - impl.Dlaset(blas.All, l, n-l, 0, 0, b, ldb) - for i := 1; i < l; i++ { - r := b[i*ldb+n-l : i*ldb+i+n-l] - for j := range r { - r[j] = 0 - } - } - } - - // Let N-L L - // A = [ A11 A12 ] M, - // - // then the following does the complete QR decomposition of A11: - // - // A11 = U*[ 0 T12 ]*P1ᵀ. - // [ 0 0 ] - for i := range iwork[:n-l] { - iwork[i] = 0 - } - impl.Dgeqp3(m, n-l, a, lda, iwork[:n-l], tau, work, lwork) - - // Determine the effective rank of A11. - for i := 0; i < min(m, n-l); i++ { - if math.Abs(a[i*lda+i]) > tola { - k++ - } - } - - // Update A12 := Uᵀ*A12, where A12 = A[0:m, n-l:n]. - impl.Dorm2r(blas.Left, blas.Trans, m, l, min(m, n-l), a, lda, tau, a[n-l:], lda, work) - - if wantu { - // Copy the details of U, and form U. - impl.Dlaset(blas.All, m, m, 0, 0, u, ldu) - if m > 1 { - impl.Dlacpy(blas.Lower, m-1, min(m, n-l), a[lda:], lda, u[ldu:], ldu) - } - impl.Dorg2r(m, m, min(m, n-l), u, ldu, tau, work) - } - - if wantq { - // Update Q[0:n, 0:n-l] := Q[0:n, 0:n-l]*P1. - impl.Dlapmt(forward, n, n-l, q, ldq, iwork[:n-l]) - } - - // Clean up A: set the strictly lower triangular part of - // A[0:k, 0:k] = 0, and A[k:m, 0:n-l] = 0. - for i := 1; i < k; i++ { - r := a[i*lda : i*lda+i] - for j := range r { - r[j] = 0 - } - } - if m > k { - impl.Dlaset(blas.All, m-k, n-l, 0, 0, a[k*lda:], lda) - } - - if n-l > k { - // RQ factorization of [ T11 T12 ] = [ 0 T12 ]*Z1. - impl.Dgerq2(k, n-l, a, lda, tau, work) - - if wantq { - // Update Q[0:n, 0:n-l] := Q[0:n, 0:n-l]*Z1ᵀ. - impl.Dorm2r(blas.Right, blas.Trans, n, n-l, k, a, lda, tau, q, ldq, work) - } - - // Clean up A. - impl.Dlaset(blas.All, k, n-l-k, 0, 0, a, lda) - for i := 1; i < k; i++ { - r := a[i*lda+n-k-l : i*lda+i+n-k-l] - for j := range r { - a[j] = 0 - } - } - } - - if m > k { - // QR factorization of A[k:m, n-l:n]. - impl.Dgeqr2(m-k, l, a[k*lda+n-l:], lda, tau, work) - if wantu { - // Update U[:, k:m) := U[:, k:m]*U1. - impl.Dorm2r(blas.Right, blas.NoTrans, m, m-k, min(m-k, l), a[k*lda+n-l:], lda, tau, u[k:], ldu, work) - } - - // Clean up A. - for i := k + 1; i < m; i++ { - r := a[i*lda+n-l : i*lda+min(n-l+i-k, n)] - for j := range r { - r[j] = 0 - } - } - } - - work[0] = float64(lwkopt) - return k, l -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dhseqr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dhseqr.go deleted file mode 100644 index 61390fb..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dhseqr.go +++ /dev/null @@ -1,252 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dhseqr computes the eigenvalues of an n×n Hessenberg matrix H and, -// optionally, the matrices T and Z from the Schur decomposition -// H = Z T Zᵀ, -// where T is an n×n upper quasi-triangular matrix (the Schur form), and Z is -// the n×n orthogonal matrix of Schur vectors. -// -// Optionally Z may be postmultiplied into an input orthogonal matrix Q so that -// this routine can give the Schur factorization of a matrix A which has been -// reduced to the Hessenberg form H by the orthogonal matrix Q: -// A = Q H Qᵀ = (QZ) T (QZ)ᵀ. -// -// If job == lapack.EigenvaluesOnly, only the eigenvalues will be computed. -// If job == lapack.EigenvaluesAndSchur, the eigenvalues and the Schur form T will -// be computed. -// For other values of job Dhseqr will panic. -// -// If compz == lapack.SchurNone, no Schur vectors will be computed and Z will not be -// referenced. -// If compz == lapack.SchurHess, on return Z will contain the matrix of Schur -// vectors of H. -// If compz == lapack.SchurOrig, on entry z is assumed to contain the orthogonal -// matrix Q that is the identity except for the submatrix -// Q[ilo:ihi+1,ilo:ihi+1]. On return z will be updated to the product Q*Z. -// -// ilo and ihi determine the block of H on which Dhseqr operates. It is assumed -// that H is already upper triangular in rows and columns [0:ilo] and [ihi+1:n], -// although it will be only checked that the block is isolated, that is, -// ilo == 0 or H[ilo,ilo-1] == 0, -// ihi == n-1 or H[ihi+1,ihi] == 0, -// and Dhseqr will panic otherwise. ilo and ihi are typically set by a previous -// call to Dgebal, otherwise they should be set to 0 and n-1, respectively. It -// must hold that -// 0 <= ilo <= ihi < n if n > 0, -// ilo == 0 and ihi == -1 if n == 0. -// -// wr and wi must have length n. -// -// work must have length at least lwork and lwork must be at least max(1,n) -// otherwise Dhseqr will panic. The minimum lwork delivers very good and -// sometimes optimal performance, although lwork as large as 11*n may be -// required. On return, work[0] will contain the optimal value of lwork. -// -// If lwork is -1, instead of performing Dhseqr, the function only estimates the -// optimal workspace size and stores it into work[0]. Neither h nor z are -// accessed. -// -// unconverged indicates whether Dhseqr computed all the eigenvalues. -// -// If unconverged == 0, all the eigenvalues have been computed and their real -// and imaginary parts will be stored on return in wr and wi, respectively. If -// two eigenvalues are computed as a complex conjugate pair, they are stored in -// consecutive elements of wr and wi, say the i-th and (i+1)th, with wi[i] > 0 -// and wi[i+1] < 0. -// -// If unconverged == 0 and job == lapack.EigenvaluesAndSchur, on return H will -// contain the upper quasi-triangular matrix T from the Schur decomposition (the -// Schur form). 2×2 diagonal blocks (corresponding to complex conjugate pairs of -// eigenvalues) will be returned in standard form, with -// H[i,i] == H[i+1,i+1], -// and -// H[i+1,i]*H[i,i+1] < 0. -// The eigenvalues will be stored in wr and wi in the same order as on the -// diagonal of the Schur form returned in H, with -// wr[i] = H[i,i], -// and, if H[i:i+2,i:i+2] is a 2×2 diagonal block, -// wi[i] = sqrt(-H[i+1,i]*H[i,i+1]), -// wi[i+1] = -wi[i]. -// -// If unconverged == 0 and job == lapack.EigenvaluesOnly, the contents of h -// on return is unspecified. -// -// If unconverged > 0, some eigenvalues have not converged, and the blocks -// [0:ilo] and [unconverged:n] of wr and wi will contain those eigenvalues which -// have been successfully computed. Failures are rare. -// -// If unconverged > 0 and job == lapack.EigenvaluesOnly, on return the -// remaining unconverged eigenvalues are the eigenvalues of the upper Hessenberg -// matrix H[ilo:unconverged,ilo:unconverged]. -// -// If unconverged > 0 and job == lapack.EigenvaluesAndSchur, then on -// return -// (initial H) U = U (final H), (*) -// where U is an orthogonal matrix. The final H is upper Hessenberg and -// H[unconverged:ihi+1,unconverged:ihi+1] is upper quasi-triangular. -// -// If unconverged > 0 and compz == lapack.SchurOrig, then on return -// (final Z) = (initial Z) U, -// where U is the orthogonal matrix in (*) regardless of the value of job. -// -// If unconverged > 0 and compz == lapack.SchurHess, then on return -// (final Z) = U, -// where U is the orthogonal matrix in (*) regardless of the value of job. -// -// References: -// [1] R. Byers. LAPACK 3.1 xHSEQR: Tuning and Implementation Notes on the -// Small Bulge Multi-Shift QR Algorithm with Aggressive Early Deflation. -// LAPACK Working Note 187 (2007) -// URL: http://www.netlib.org/lapack/lawnspdf/lawn187.pdf -// [2] K. Braman, R. Byers, R. Mathias. The Multishift QR Algorithm. Part I: -// Maintaining Well-Focused Shifts and Level 3 Performance. SIAM J. Matrix -// Anal. Appl. 23(4) (2002), pp. 929—947 -// URL: http://dx.doi.org/10.1137/S0895479801384573 -// [3] K. Braman, R. Byers, R. Mathias. The Multishift QR Algorithm. Part II: -// Aggressive Early Deflation. SIAM J. Matrix Anal. Appl. 23(4) (2002), pp. 948—973 -// URL: http://dx.doi.org/10.1137/S0895479801384585 -// -// Dhseqr is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dhseqr(job lapack.SchurJob, compz lapack.SchurComp, n, ilo, ihi int, h []float64, ldh int, wr, wi []float64, z []float64, ldz int, work []float64, lwork int) (unconverged int) { - wantt := job == lapack.EigenvaluesAndSchur - wantz := compz == lapack.SchurHess || compz == lapack.SchurOrig - - switch { - case job != lapack.EigenvaluesOnly && job != lapack.EigenvaluesAndSchur: - panic(badSchurJob) - case compz != lapack.SchurNone && compz != lapack.SchurHess && compz != lapack.SchurOrig: - panic(badSchurComp) - case n < 0: - panic(nLT0) - case ilo < 0 || max(0, n-1) < ilo: - panic(badIlo) - case ihi < min(ilo, n-1) || n <= ihi: - panic(badIhi) - case ldh < max(1, n): - panic(badLdH) - case ldz < 1, wantz && ldz < n: - panic(badLdZ) - case lwork < max(1, n) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - if n == 0 { - work[0] = 1 - return 0 - } - - // Quick return in case of a workspace query. - if lwork == -1 { - impl.Dlaqr04(wantt, wantz, n, ilo, ihi, h, ldh, wr, wi, ilo, ihi, z, ldz, work, -1, 1) - work[0] = math.Max(float64(n), work[0]) - return 0 - } - - switch { - case len(h) < (n-1)*ldh+n: - panic(shortH) - case wantz && len(z) < (n-1)*ldz+n: - panic(shortZ) - case len(wr) < n: - panic(shortWr) - case len(wi) < n: - panic(shortWi) - } - - const ( - // Matrices of order ntiny or smaller must be processed by - // Dlahqr because of insufficient subdiagonal scratch space. - // This is a hard limit. - ntiny = 11 - - // nl is the size of a local workspace to help small matrices - // through a rare Dlahqr failure. nl > ntiny is required and - // nl <= nmin = Ilaenv(ispec=12,...) is recommended (the default - // value of nmin is 75). Using nl = 49 allows up to six - // simultaneous shifts and a 16×16 deflation window. - nl = 49 - ) - - // Copy eigenvalues isolated by Dgebal. - for i := 0; i < ilo; i++ { - wr[i] = h[i*ldh+i] - wi[i] = 0 - } - for i := ihi + 1; i < n; i++ { - wr[i] = h[i*ldh+i] - wi[i] = 0 - } - - // Initialize Z to identity matrix if requested. - if compz == lapack.SchurHess { - impl.Dlaset(blas.All, n, n, 0, 1, z, ldz) - } - - // Quick return if possible. - if ilo == ihi { - wr[ilo] = h[ilo*ldh+ilo] - wi[ilo] = 0 - return 0 - } - - // Dlahqr/Dlaqr04 crossover point. - nmin := impl.Ilaenv(12, "DHSEQR", string(job)+string(compz), n, ilo, ihi, lwork) - nmin = max(ntiny, nmin) - - if n > nmin { - // Dlaqr0 for big matrices. - unconverged = impl.Dlaqr04(wantt, wantz, n, ilo, ihi, h, ldh, wr[:ihi+1], wi[:ihi+1], - ilo, ihi, z, ldz, work, lwork, 1) - } else { - // Dlahqr for small matrices. - unconverged = impl.Dlahqr(wantt, wantz, n, ilo, ihi, h, ldh, wr[:ihi+1], wi[:ihi+1], - ilo, ihi, z, ldz) - if unconverged > 0 { - // A rare Dlahqr failure! Dlaqr04 sometimes succeeds - // when Dlahqr fails. - kbot := unconverged - if n >= nl { - // Larger matrices have enough subdiagonal - // scratch space to call Dlaqr04 directly. - unconverged = impl.Dlaqr04(wantt, wantz, n, ilo, kbot, h, ldh, - wr[:ihi+1], wi[:ihi+1], ilo, ihi, z, ldz, work, lwork, 1) - } else { - // Tiny matrices don't have enough subdiagonal - // scratch space to benefit from Dlaqr04. Hence, - // tiny matrices must be copied into a larger - // array before calling Dlaqr04. - var hl [nl * nl]float64 - impl.Dlacpy(blas.All, n, n, h, ldh, hl[:], nl) - impl.Dlaset(blas.All, nl, nl-n, 0, 0, hl[n:], nl) - var workl [nl]float64 - unconverged = impl.Dlaqr04(wantt, wantz, nl, ilo, kbot, hl[:], nl, - wr[:ihi+1], wi[:ihi+1], ilo, ihi, z, ldz, workl[:], nl, 1) - work[0] = workl[0] - if wantt || unconverged > 0 { - impl.Dlacpy(blas.All, n, n, hl[:], nl, h, ldh) - } - } - } - } - // Zero out under the first subdiagonal, if necessary. - if (wantt || unconverged > 0) && n > 2 { - impl.Dlaset(blas.Lower, n-2, n-2, 0, 0, h[2*ldh:], ldh) - } - - work[0] = math.Max(float64(n), work[0]) - return unconverged -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlabrd.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlabrd.go deleted file mode 100644 index 8f7d294..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlabrd.go +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlabrd reduces the first NB rows and columns of a real general m×n matrix -// A to upper or lower bidiagonal form by an orthogonal transformation -// Q**T * A * P -// If m >= n, A is reduced to upper bidiagonal form and upon exit the elements -// on and below the diagonal in the first nb columns represent the elementary -// reflectors, and the elements above the diagonal in the first nb rows represent -// the matrix P. If m < n, A is reduced to lower bidiagonal form and the elements -// P is instead stored above the diagonal. -// -// The reduction to bidiagonal form is stored in d and e, where d are the diagonal -// elements, and e are the off-diagonal elements. -// -// The matrices Q and P are products of elementary reflectors -// Q = H_0 * H_1 * ... * H_{nb-1} -// P = G_0 * G_1 * ... * G_{nb-1} -// where -// H_i = I - tauQ[i] * v_i * v_iᵀ -// G_i = I - tauP[i] * u_i * u_iᵀ -// -// As an example, on exit the entries of A when m = 6, n = 5, and nb = 2 -// [ 1 1 u1 u1 u1] -// [v1 1 1 u2 u2] -// [v1 v2 a a a] -// [v1 v2 a a a] -// [v1 v2 a a a] -// [v1 v2 a a a] -// and when m = 5, n = 6, and nb = 2 -// [ 1 u1 u1 u1 u1 u1] -// [ 1 1 u2 u2 u2 u2] -// [v1 1 a a a a] -// [v1 v2 a a a a] -// [v1 v2 a a a a] -// -// Dlabrd also returns the matrices X and Y which are used with U and V to -// apply the transformation to the unreduced part of the matrix -// A := A - V*Yᵀ - X*Uᵀ -// and returns the matrices X and Y which are needed to apply the -// transformation to the unreduced part of A. -// -// X is an m×nb matrix, Y is an n×nb matrix. d, e, taup, and tauq must all have -// length at least nb. Dlabrd will panic if these size constraints are violated. -// -// Dlabrd is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlabrd(m, n, nb int, a []float64, lda int, d, e, tauQ, tauP, x []float64, ldx int, y []float64, ldy int) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case nb < 0: - panic(nbLT0) - case nb > n: - panic(nbGTN) - case nb > m: - panic(nbGTM) - case lda < max(1, n): - panic(badLdA) - case ldx < max(1, nb): - panic(badLdX) - case ldy < max(1, nb): - panic(badLdY) - } - - if m == 0 || n == 0 || nb == 0 { - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(d) < nb: - panic(shortD) - case len(e) < nb: - panic(shortE) - case len(tauQ) < nb: - panic(shortTauQ) - case len(tauP) < nb: - panic(shortTauP) - case len(x) < (m-1)*ldx+nb: - panic(shortX) - case len(y) < (n-1)*ldy+nb: - panic(shortY) - } - - bi := blas64.Implementation() - - if m >= n { - // Reduce to upper bidiagonal form. - for i := 0; i < nb; i++ { - bi.Dgemv(blas.NoTrans, m-i, i, -1, a[i*lda:], lda, y[i*ldy:], 1, 1, a[i*lda+i:], lda) - bi.Dgemv(blas.NoTrans, m-i, i, -1, x[i*ldx:], ldx, a[i:], lda, 1, a[i*lda+i:], lda) - - a[i*lda+i], tauQ[i] = impl.Dlarfg(m-i, a[i*lda+i], a[min(i+1, m-1)*lda+i:], lda) - d[i] = a[i*lda+i] - if i < n-1 { - // Compute Y[i+1:n, i]. - a[i*lda+i] = 1 - bi.Dgemv(blas.Trans, m-i, n-i-1, 1, a[i*lda+i+1:], lda, a[i*lda+i:], lda, 0, y[(i+1)*ldy+i:], ldy) - bi.Dgemv(blas.Trans, m-i, i, 1, a[i*lda:], lda, a[i*lda+i:], lda, 0, y[i:], ldy) - bi.Dgemv(blas.NoTrans, n-i-1, i, -1, y[(i+1)*ldy:], ldy, y[i:], ldy, 1, y[(i+1)*ldy+i:], ldy) - bi.Dgemv(blas.Trans, m-i, i, 1, x[i*ldx:], ldx, a[i*lda+i:], lda, 0, y[i:], ldy) - bi.Dgemv(blas.Trans, i, n-i-1, -1, a[i+1:], lda, y[i:], ldy, 1, y[(i+1)*ldy+i:], ldy) - bi.Dscal(n-i-1, tauQ[i], y[(i+1)*ldy+i:], ldy) - - // Update A[i, i+1:n]. - bi.Dgemv(blas.NoTrans, n-i-1, i+1, -1, y[(i+1)*ldy:], ldy, a[i*lda:], 1, 1, a[i*lda+i+1:], 1) - bi.Dgemv(blas.Trans, i, n-i-1, -1, a[i+1:], lda, x[i*ldx:], 1, 1, a[i*lda+i+1:], 1) - - // Generate reflection P[i] to annihilate A[i, i+2:n]. - a[i*lda+i+1], tauP[i] = impl.Dlarfg(n-i-1, a[i*lda+i+1], a[i*lda+min(i+2, n-1):], 1) - e[i] = a[i*lda+i+1] - a[i*lda+i+1] = 1 - - // Compute X[i+1:m, i]. - bi.Dgemv(blas.NoTrans, m-i-1, n-i-1, 1, a[(i+1)*lda+i+1:], lda, a[i*lda+i+1:], 1, 0, x[(i+1)*ldx+i:], ldx) - bi.Dgemv(blas.Trans, n-i-1, i+1, 1, y[(i+1)*ldy:], ldy, a[i*lda+i+1:], 1, 0, x[i:], ldx) - bi.Dgemv(blas.NoTrans, m-i-1, i+1, -1, a[(i+1)*lda:], lda, x[i:], ldx, 1, x[(i+1)*ldx+i:], ldx) - bi.Dgemv(blas.NoTrans, i, n-i-1, 1, a[i+1:], lda, a[i*lda+i+1:], 1, 0, x[i:], ldx) - bi.Dgemv(blas.NoTrans, m-i-1, i, -1, x[(i+1)*ldx:], ldx, x[i:], ldx, 1, x[(i+1)*ldx+i:], ldx) - bi.Dscal(m-i-1, tauP[i], x[(i+1)*ldx+i:], ldx) - } - } - return - } - // Reduce to lower bidiagonal form. - for i := 0; i < nb; i++ { - // Update A[i,i:n] - bi.Dgemv(blas.NoTrans, n-i, i, -1, y[i*ldy:], ldy, a[i*lda:], 1, 1, a[i*lda+i:], 1) - bi.Dgemv(blas.Trans, i, n-i, -1, a[i:], lda, x[i*ldx:], 1, 1, a[i*lda+i:], 1) - - // Generate reflection P[i] to annihilate A[i, i+1:n] - a[i*lda+i], tauP[i] = impl.Dlarfg(n-i, a[i*lda+i], a[i*lda+min(i+1, n-1):], 1) - d[i] = a[i*lda+i] - if i < m-1 { - a[i*lda+i] = 1 - // Compute X[i+1:m, i]. - bi.Dgemv(blas.NoTrans, m-i-1, n-i, 1, a[(i+1)*lda+i:], lda, a[i*lda+i:], 1, 0, x[(i+1)*ldx+i:], ldx) - bi.Dgemv(blas.Trans, n-i, i, 1, y[i*ldy:], ldy, a[i*lda+i:], 1, 0, x[i:], ldx) - bi.Dgemv(blas.NoTrans, m-i-1, i, -1, a[(i+1)*lda:], lda, x[i:], ldx, 1, x[(i+1)*ldx+i:], ldx) - bi.Dgemv(blas.NoTrans, i, n-i, 1, a[i:], lda, a[i*lda+i:], 1, 0, x[i:], ldx) - bi.Dgemv(blas.NoTrans, m-i-1, i, -1, x[(i+1)*ldx:], ldx, x[i:], ldx, 1, x[(i+1)*ldx+i:], ldx) - bi.Dscal(m-i-1, tauP[i], x[(i+1)*ldx+i:], ldx) - - // Update A[i+1:m, i]. - bi.Dgemv(blas.NoTrans, m-i-1, i, -1, a[(i+1)*lda:], lda, y[i*ldy:], 1, 1, a[(i+1)*lda+i:], lda) - bi.Dgemv(blas.NoTrans, m-i-1, i+1, -1, x[(i+1)*ldx:], ldx, a[i:], lda, 1, a[(i+1)*lda+i:], lda) - - // Generate reflection Q[i] to annihilate A[i+2:m, i]. - a[(i+1)*lda+i], tauQ[i] = impl.Dlarfg(m-i-1, a[(i+1)*lda+i], a[min(i+2, m-1)*lda+i:], lda) - e[i] = a[(i+1)*lda+i] - a[(i+1)*lda+i] = 1 - - // Compute Y[i+1:n, i]. - bi.Dgemv(blas.Trans, m-i-1, n-i-1, 1, a[(i+1)*lda+i+1:], lda, a[(i+1)*lda+i:], lda, 0, y[(i+1)*ldy+i:], ldy) - bi.Dgemv(blas.Trans, m-i-1, i, 1, a[(i+1)*lda:], lda, a[(i+1)*lda+i:], lda, 0, y[i:], ldy) - bi.Dgemv(blas.NoTrans, n-i-1, i, -1, y[(i+1)*ldy:], ldy, y[i:], ldy, 1, y[(i+1)*ldy+i:], ldy) - bi.Dgemv(blas.Trans, m-i-1, i+1, 1, x[(i+1)*ldx:], ldx, a[(i+1)*lda+i:], lda, 0, y[i:], ldy) - bi.Dgemv(blas.Trans, i+1, n-i-1, -1, a[i+1:], lda, y[i:], ldy, 1, y[(i+1)*ldy+i:], ldy) - bi.Dscal(n-i-1, tauQ[i], y[(i+1)*ldy+i:], ldy) - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlacn2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlacn2.go deleted file mode 100644 index d97e5ed..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlacn2.go +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlacn2 estimates the 1-norm of an n×n matrix A using sequential updates with -// matrix-vector products provided externally. -// -// Dlacn2 is called sequentially and it returns the value of est and kase to be -// used on the next call. -// On the initial call, kase must be 0. -// In between calls, x must be overwritten by -// A * X if kase was returned as 1, -// Aᵀ * X if kase was returned as 2, -// and all other parameters must not be changed. -// On the final return, kase is returned as 0, v contains A*W where W is a -// vector, and est = norm(V)/norm(W) is a lower bound for 1-norm of A. -// -// v, x, and isgn must all have length n and n must be at least 1, otherwise -// Dlacn2 will panic. isave is used for temporary storage. -// -// Dlacn2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlacn2(n int, v, x []float64, isgn []int, est float64, kase int, isave *[3]int) (float64, int) { - switch { - case n < 1: - panic(nLT1) - case len(v) < n: - panic(shortV) - case len(x) < n: - panic(shortX) - case len(isgn) < n: - panic(shortIsgn) - case isave[0] < 0 || 5 < isave[0]: - panic(badIsave) - case isave[0] == 0 && kase != 0: - panic(badIsave) - } - - const itmax = 5 - bi := blas64.Implementation() - - if kase == 0 { - for i := 0; i < n; i++ { - x[i] = 1 / float64(n) - } - kase = 1 - isave[0] = 1 - return est, kase - } - switch isave[0] { - case 1: - if n == 1 { - v[0] = x[0] - est = math.Abs(v[0]) - kase = 0 - return est, kase - } - est = bi.Dasum(n, x, 1) - for i := 0; i < n; i++ { - x[i] = math.Copysign(1, x[i]) - isgn[i] = int(x[i]) - } - kase = 2 - isave[0] = 2 - return est, kase - case 2: - isave[1] = bi.Idamax(n, x, 1) - isave[2] = 2 - for i := 0; i < n; i++ { - x[i] = 0 - } - x[isave[1]] = 1 - kase = 1 - isave[0] = 3 - return est, kase - case 3: - bi.Dcopy(n, x, 1, v, 1) - estold := est - est = bi.Dasum(n, v, 1) - sameSigns := true - for i := 0; i < n; i++ { - if int(math.Copysign(1, x[i])) != isgn[i] { - sameSigns = false - break - } - } - if !sameSigns && est > estold { - for i := 0; i < n; i++ { - x[i] = math.Copysign(1, x[i]) - isgn[i] = int(x[i]) - } - kase = 2 - isave[0] = 4 - return est, kase - } - case 4: - jlast := isave[1] - isave[1] = bi.Idamax(n, x, 1) - if x[jlast] != math.Abs(x[isave[1]]) && isave[2] < itmax { - isave[2] += 1 - for i := 0; i < n; i++ { - x[i] = 0 - } - x[isave[1]] = 1 - kase = 1 - isave[0] = 3 - return est, kase - } - case 5: - tmp := 2 * (bi.Dasum(n, x, 1)) / float64(3*n) - if tmp > est { - bi.Dcopy(n, x, 1, v, 1) - est = tmp - } - kase = 0 - return est, kase - } - // Iteration complete. Final stage - altsgn := 1.0 - for i := 0; i < n; i++ { - x[i] = altsgn * (1 + float64(i)/float64(n-1)) - altsgn *= -1 - } - kase = 1 - isave[0] = 5 - return est, kase -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlacpy.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlacpy.go deleted file mode 100644 index a37f3b0..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlacpy.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import "gonum.org/v1/gonum/blas" - -// Dlacpy copies the elements of A specified by uplo into B. Uplo can specify -// a triangular portion with blas.Upper or blas.Lower, or can specify all of the -// elemest with blas.All. -// -// Dlacpy is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlacpy(uplo blas.Uplo, m, n int, a []float64, lda int, b []float64, ldb int) { - switch { - case uplo != blas.Upper && uplo != blas.Lower && uplo != blas.All: - panic(badUplo) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case ldb < max(1, n): - panic(badLdB) - } - - if m == 0 || n == 0 { - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(b) < (m-1)*ldb+n: - panic(shortB) - } - - switch uplo { - case blas.Upper: - for i := 0; i < m; i++ { - for j := i; j < n; j++ { - b[i*ldb+j] = a[i*lda+j] - } - } - case blas.Lower: - for i := 0; i < m; i++ { - for j := 0; j < min(i+1, n); j++ { - b[i*ldb+j] = a[i*lda+j] - } - } - case blas.All: - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - b[i*ldb+j] = a[i*lda+j] - } - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlae2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlae2.go deleted file mode 100644 index c071fec..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlae2.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import "math" - -// Dlae2 computes the eigenvalues of a 2×2 symmetric matrix -// [a b] -// [b c] -// and returns the eigenvalue with the larger absolute value as rt1 and the -// smaller as rt2. -// -// Dlae2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlae2(a, b, c float64) (rt1, rt2 float64) { - sm := a + c - df := a - c - adf := math.Abs(df) - tb := b + b - ab := math.Abs(tb) - acmx := c - acmn := a - if math.Abs(a) > math.Abs(c) { - acmx = a - acmn = c - } - var rt float64 - if adf > ab { - rt = adf * math.Sqrt(1+(ab/adf)*(ab/adf)) - } else if adf < ab { - rt = ab * math.Sqrt(1+(adf/ab)*(adf/ab)) - } else { - rt = ab * math.Sqrt2 - } - if sm < 0 { - rt1 = 0.5 * (sm - rt) - rt2 = (acmx/rt1)*acmn - (b/rt1)*b - return rt1, rt2 - } - if sm > 0 { - rt1 = 0.5 * (sm + rt) - rt2 = (acmx/rt1)*acmn - (b/rt1)*b - return rt1, rt2 - } - rt1 = 0.5 * rt - rt2 = -0.5 * rt - return rt1, rt2 -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaev2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaev2.go deleted file mode 100644 index 74d75b9..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaev2.go +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import "math" - -// Dlaev2 computes the Eigen decomposition of a symmetric 2×2 matrix. -// The matrix is given by -// [a b] -// [b c] -// Dlaev2 returns rt1 and rt2, the eigenvalues of the matrix where |RT1| > |RT2|, -// and [cs1, sn1] which is the unit right eigenvalue for RT1. -// [ cs1 sn1] [a b] [cs1 -sn1] = [rt1 0] -// [-sn1 cs1] [b c] [sn1 cs1] [ 0 rt2] -// -// Dlaev2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlaev2(a, b, c float64) (rt1, rt2, cs1, sn1 float64) { - sm := a + c - df := a - c - adf := math.Abs(df) - tb := b + b - ab := math.Abs(tb) - acmx := c - acmn := a - if math.Abs(a) > math.Abs(c) { - acmx = a - acmn = c - } - var rt float64 - if adf > ab { - rt = adf * math.Sqrt(1+(ab/adf)*(ab/adf)) - } else if adf < ab { - rt = ab * math.Sqrt(1+(adf/ab)*(adf/ab)) - } else { - rt = ab * math.Sqrt(2) - } - var sgn1 float64 - if sm < 0 { - rt1 = 0.5 * (sm - rt) - sgn1 = -1 - rt2 = (acmx/rt1)*acmn - (b/rt1)*b - } else if sm > 0 { - rt1 = 0.5 * (sm + rt) - sgn1 = 1 - rt2 = (acmx/rt1)*acmn - (b/rt1)*b - } else { - rt1 = 0.5 * rt - rt2 = -0.5 * rt - sgn1 = 1 - } - var cs, sgn2 float64 - if df >= 0 { - cs = df + rt - sgn2 = 1 - } else { - cs = df - rt - sgn2 = -1 - } - acs := math.Abs(cs) - if acs > ab { - ct := -tb / cs - sn1 = 1 / math.Sqrt(1+ct*ct) - cs1 = ct * sn1 - } else { - if ab == 0 { - cs1 = 1 - sn1 = 0 - } else { - tn := -cs / tb - cs1 = 1 / math.Sqrt(1+tn*tn) - sn1 = tn * cs1 - } - } - if sgn1 == sgn2 { - tn := cs1 - cs1 = -sn1 - sn1 = tn - } - return rt1, rt2, cs1, sn1 -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaexc.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaexc.go deleted file mode 100644 index 2b79bd8..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaexc.go +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dlaexc swaps two adjacent diagonal blocks of order 1 or 2 in an n×n upper -// quasi-triangular matrix T by an orthogonal similarity transformation. -// -// T must be in Schur canonical form, that is, block upper triangular with 1×1 -// and 2×2 diagonal blocks; each 2×2 diagonal block has its diagonal elements -// equal and its off-diagonal elements of opposite sign. On return, T will -// contain the updated matrix again in Schur canonical form. -// -// If wantq is true, the transformation is accumulated in the n×n matrix Q, -// otherwise Q is not referenced. -// -// j1 is the index of the first row of the first block. n1 and n2 are the order -// of the first and second block, respectively. -// -// work must have length at least n, otherwise Dlaexc will panic. -// -// If ok is false, the transformed matrix T would be too far from Schur form. -// The blocks are not swapped, and T and Q are not modified. -// -// If n1 and n2 are both equal to 1, Dlaexc will always return true. -// -// Dlaexc is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlaexc(wantq bool, n int, t []float64, ldt int, q []float64, ldq int, j1, n1, n2 int, work []float64) (ok bool) { - switch { - case n < 0: - panic(nLT0) - case ldt < max(1, n): - panic(badLdT) - case wantq && ldt < max(1, n): - panic(badLdQ) - case j1 < 0 || n <= j1: - panic(badJ1) - case len(work) < n: - panic(shortWork) - case n1 < 0 || 2 < n1: - panic(badN1) - case n2 < 0 || 2 < n2: - panic(badN2) - } - - if n == 0 || n1 == 0 || n2 == 0 { - return true - } - - switch { - case len(t) < (n-1)*ldt+n: - panic(shortT) - case wantq && len(q) < (n-1)*ldq+n: - panic(shortQ) - } - - if j1+n1 >= n { - // TODO(vladimir-ch): Reference LAPACK does this check whether - // the start of the second block is in the matrix T. It returns - // true if it is not and moreover it does not check whether the - // whole second block fits into T. This does not feel - // satisfactory. The only caller of Dlaexc is Dtrexc, so if the - // caller makes sure that this does not happen, we could be - // stricter here. - return true - } - - j2 := j1 + 1 - j3 := j1 + 2 - - bi := blas64.Implementation() - - if n1 == 1 && n2 == 1 { - // Swap two 1×1 blocks. - t11 := t[j1*ldt+j1] - t22 := t[j2*ldt+j2] - - // Determine the transformation to perform the interchange. - cs, sn, _ := impl.Dlartg(t[j1*ldt+j2], t22-t11) - - // Apply transformation to the matrix T. - if n-j3 > 0 { - bi.Drot(n-j3, t[j1*ldt+j3:], 1, t[j2*ldt+j3:], 1, cs, sn) - } - if j1 > 0 { - bi.Drot(j1, t[j1:], ldt, t[j2:], ldt, cs, sn) - } - - t[j1*ldt+j1] = t22 - t[j2*ldt+j2] = t11 - - if wantq { - // Accumulate transformation in the matrix Q. - bi.Drot(n, q[j1:], ldq, q[j2:], ldq, cs, sn) - } - - return true - } - - // Swapping involves at least one 2×2 block. - // - // Copy the diagonal block of order n1+n2 to the local array d and - // compute its norm. - nd := n1 + n2 - var d [16]float64 - const ldd = 4 - impl.Dlacpy(blas.All, nd, nd, t[j1*ldt+j1:], ldt, d[:], ldd) - dnorm := impl.Dlange(lapack.MaxAbs, nd, nd, d[:], ldd, work) - - // Compute machine-dependent threshold for test for accepting swap. - eps := dlamchP - thresh := math.Max(10*eps*dnorm, dlamchS/eps) - - // Solve T11*X - X*T22 = scale*T12 for X. - var x [4]float64 - const ldx = 2 - scale, _, _ := impl.Dlasy2(false, false, -1, n1, n2, d[:], ldd, d[n1*ldd+n1:], ldd, d[n1:], ldd, x[:], ldx) - - // Swap the adjacent diagonal blocks. - switch { - case n1 == 1 && n2 == 2: - // Generate elementary reflector H so that - // ( scale, X11, X12 ) H = ( 0, 0, * ) - u := [3]float64{scale, x[0], 1} - _, tau := impl.Dlarfg(3, x[1], u[:2], 1) - t11 := t[j1*ldt+j1] - - // Perform swap provisionally on diagonal block in d. - impl.Dlarfx(blas.Left, 3, 3, u[:], tau, d[:], ldd, work) - impl.Dlarfx(blas.Right, 3, 3, u[:], tau, d[:], ldd, work) - - // Test whether to reject swap. - if math.Max(math.Abs(d[2*ldd]), math.Max(math.Abs(d[2*ldd+1]), math.Abs(d[2*ldd+2]-t11))) > thresh { - return false - } - - // Accept swap: apply transformation to the entire matrix T. - impl.Dlarfx(blas.Left, 3, n-j1, u[:], tau, t[j1*ldt+j1:], ldt, work) - impl.Dlarfx(blas.Right, j2+1, 3, u[:], tau, t[j1:], ldt, work) - - t[j3*ldt+j1] = 0 - t[j3*ldt+j2] = 0 - t[j3*ldt+j3] = t11 - - if wantq { - // Accumulate transformation in the matrix Q. - impl.Dlarfx(blas.Right, n, 3, u[:], tau, q[j1:], ldq, work) - } - - case n1 == 2 && n2 == 1: - // Generate elementary reflector H so that: - // H ( -X11 ) = ( * ) - // ( -X21 ) = ( 0 ) - // ( scale ) = ( 0 ) - u := [3]float64{1, -x[ldx], scale} - _, tau := impl.Dlarfg(3, -x[0], u[1:], 1) - t33 := t[j3*ldt+j3] - - // Perform swap provisionally on diagonal block in D. - impl.Dlarfx(blas.Left, 3, 3, u[:], tau, d[:], ldd, work) - impl.Dlarfx(blas.Right, 3, 3, u[:], tau, d[:], ldd, work) - - // Test whether to reject swap. - if math.Max(math.Abs(d[ldd]), math.Max(math.Abs(d[2*ldd]), math.Abs(d[0]-t33))) > thresh { - return false - } - - // Accept swap: apply transformation to the entire matrix T. - impl.Dlarfx(blas.Right, j3+1, 3, u[:], tau, t[j1:], ldt, work) - impl.Dlarfx(blas.Left, 3, n-j1-1, u[:], tau, t[j1*ldt+j2:], ldt, work) - - t[j1*ldt+j1] = t33 - t[j2*ldt+j1] = 0 - t[j3*ldt+j1] = 0 - - if wantq { - // Accumulate transformation in the matrix Q. - impl.Dlarfx(blas.Right, n, 3, u[:], tau, q[j1:], ldq, work) - } - - default: // n1 == 2 && n2 == 2 - // Generate elementary reflectors H_1 and H_2 so that: - // H_2 H_1 ( -X11 -X12 ) = ( * * ) - // ( -X21 -X22 ) ( 0 * ) - // ( scale 0 ) ( 0 0 ) - // ( 0 scale ) ( 0 0 ) - u1 := [3]float64{1, -x[ldx], scale} - _, tau1 := impl.Dlarfg(3, -x[0], u1[1:], 1) - - temp := -tau1 * (x[1] + u1[1]*x[ldx+1]) - u2 := [3]float64{1, -temp * u1[2], scale} - _, tau2 := impl.Dlarfg(3, -temp*u1[1]-x[ldx+1], u2[1:], 1) - - // Perform swap provisionally on diagonal block in D. - impl.Dlarfx(blas.Left, 3, 4, u1[:], tau1, d[:], ldd, work) - impl.Dlarfx(blas.Right, 4, 3, u1[:], tau1, d[:], ldd, work) - impl.Dlarfx(blas.Left, 3, 4, u2[:], tau2, d[ldd:], ldd, work) - impl.Dlarfx(blas.Right, 4, 3, u2[:], tau2, d[1:], ldd, work) - - // Test whether to reject swap. - m1 := math.Max(math.Abs(d[2*ldd]), math.Abs(d[2*ldd+1])) - m2 := math.Max(math.Abs(d[3*ldd]), math.Abs(d[3*ldd+1])) - if math.Max(m1, m2) > thresh { - return false - } - - // Accept swap: apply transformation to the entire matrix T. - j4 := j1 + 3 - impl.Dlarfx(blas.Left, 3, n-j1, u1[:], tau1, t[j1*ldt+j1:], ldt, work) - impl.Dlarfx(blas.Right, j4+1, 3, u1[:], tau1, t[j1:], ldt, work) - impl.Dlarfx(blas.Left, 3, n-j1, u2[:], tau2, t[j2*ldt+j1:], ldt, work) - impl.Dlarfx(blas.Right, j4+1, 3, u2[:], tau2, t[j2:], ldt, work) - - t[j3*ldt+j1] = 0 - t[j3*ldt+j2] = 0 - t[j4*ldt+j1] = 0 - t[j4*ldt+j2] = 0 - - if wantq { - // Accumulate transformation in the matrix Q. - impl.Dlarfx(blas.Right, n, 3, u1[:], tau1, q[j1:], ldq, work) - impl.Dlarfx(blas.Right, n, 3, u2[:], tau2, q[j2:], ldq, work) - } - } - - if n2 == 2 { - // Standardize new 2×2 block T11. - a, b := t[j1*ldt+j1], t[j1*ldt+j2] - c, d := t[j2*ldt+j1], t[j2*ldt+j2] - var cs, sn float64 - t[j1*ldt+j1], t[j1*ldt+j2], t[j2*ldt+j1], t[j2*ldt+j2], _, _, _, _, cs, sn = impl.Dlanv2(a, b, c, d) - if n-j1-2 > 0 { - bi.Drot(n-j1-2, t[j1*ldt+j1+2:], 1, t[j2*ldt+j1+2:], 1, cs, sn) - } - if j1 > 0 { - bi.Drot(j1, t[j1:], ldt, t[j2:], ldt, cs, sn) - } - if wantq { - bi.Drot(n, q[j1:], ldq, q[j2:], ldq, cs, sn) - } - } - if n1 == 2 { - // Standardize new 2×2 block T22. - j3 := j1 + n2 - j4 := j3 + 1 - a, b := t[j3*ldt+j3], t[j3*ldt+j4] - c, d := t[j4*ldt+j3], t[j4*ldt+j4] - var cs, sn float64 - t[j3*ldt+j3], t[j3*ldt+j4], t[j4*ldt+j3], t[j4*ldt+j4], _, _, _, _, cs, sn = impl.Dlanv2(a, b, c, d) - if n-j3-2 > 0 { - bi.Drot(n-j3-2, t[j3*ldt+j3+2:], 1, t[j4*ldt+j3+2:], 1, cs, sn) - } - bi.Drot(j3, t[j3:], ldt, t[j4:], ldt, cs, sn) - if wantq { - bi.Drot(n, q[j3:], ldq, q[j4:], ldq, cs, sn) - } - } - - return true -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlags2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlags2.go deleted file mode 100644 index 1622275..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlags2.go +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright ©2017 The Gonum 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 gonum - -import "math" - -// Dlags2 computes 2-by-2 orthogonal matrices U, V and Q with the -// triangles of A and B specified by upper. -// -// If upper is true -// -// Uᵀ*A*Q = Uᵀ*[ a1 a2 ]*Q = [ x 0 ] -// [ 0 a3 ] [ x x ] -// and -// Vᵀ*B*Q = Vᵀ*[ b1 b2 ]*Q = [ x 0 ] -// [ 0 b3 ] [ x x ] -// -// otherwise -// -// Uᵀ*A*Q = Uᵀ*[ a1 0 ]*Q = [ x x ] -// [ a2 a3 ] [ 0 x ] -// and -// Vᵀ*B*Q = Vᵀ*[ b1 0 ]*Q = [ x x ] -// [ b2 b3 ] [ 0 x ]. -// -// The rows of the transformed A and B are parallel, where -// -// U = [ csu snu ], V = [ csv snv ], Q = [ csq snq ] -// [ -snu csu ] [ -snv csv ] [ -snq csq ] -// -// Dlags2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlags2(upper bool, a1, a2, a3, b1, b2, b3 float64) (csu, snu, csv, snv, csq, snq float64) { - if upper { - // Input matrices A and B are upper triangular matrices. - // - // Form matrix C = A*adj(B) = [ a b ] - // [ 0 d ] - a := a1 * b3 - d := a3 * b1 - b := a2*b1 - a1*b2 - - // The SVD of real 2-by-2 triangular C. - // - // [ csl -snl ]*[ a b ]*[ csr snr ] = [ r 0 ] - // [ snl csl ] [ 0 d ] [ -snr csr ] [ 0 t ] - _, _, snr, csr, snl, csl := impl.Dlasv2(a, b, d) - - if math.Abs(csl) >= math.Abs(snl) || math.Abs(csr) >= math.Abs(snr) { - // Compute the [0, 0] and [0, 1] elements of Uᵀ*A and Vᵀ*B, - // and [0, 1] element of |U|ᵀ*|A| and |V|ᵀ*|B|. - - ua11r := csl * a1 - ua12 := csl*a2 + snl*a3 - - vb11r := csr * b1 - vb12 := csr*b2 + snr*b3 - - aua12 := math.Abs(csl)*math.Abs(a2) + math.Abs(snl)*math.Abs(a3) - avb12 := math.Abs(csr)*math.Abs(b2) + math.Abs(snr)*math.Abs(b3) - - // Zero [0, 1] elements of Uᵀ*A and Vᵀ*B. - if math.Abs(ua11r)+math.Abs(ua12) != 0 { - if aua12/(math.Abs(ua11r)+math.Abs(ua12)) <= avb12/(math.Abs(vb11r)+math.Abs(vb12)) { - csq, snq, _ = impl.Dlartg(-ua11r, ua12) - } else { - csq, snq, _ = impl.Dlartg(-vb11r, vb12) - } - } else { - csq, snq, _ = impl.Dlartg(-vb11r, vb12) - } - - csu = csl - snu = -snl - csv = csr - snv = -snr - } else { - // Compute the [1, 0] and [1, 1] elements of Uᵀ*A and Vᵀ*B, - // and [1, 1] element of |U|ᵀ*|A| and |V|ᵀ*|B|. - - ua21 := -snl * a1 - ua22 := -snl*a2 + csl*a3 - - vb21 := -snr * b1 - vb22 := -snr*b2 + csr*b3 - - aua22 := math.Abs(snl)*math.Abs(a2) + math.Abs(csl)*math.Abs(a3) - avb22 := math.Abs(snr)*math.Abs(b2) + math.Abs(csr)*math.Abs(b3) - - // Zero [1, 1] elements of Uᵀ*A and Vᵀ*B, and then swap. - if math.Abs(ua21)+math.Abs(ua22) != 0 { - if aua22/(math.Abs(ua21)+math.Abs(ua22)) <= avb22/(math.Abs(vb21)+math.Abs(vb22)) { - csq, snq, _ = impl.Dlartg(-ua21, ua22) - } else { - csq, snq, _ = impl.Dlartg(-vb21, vb22) - } - } else { - csq, snq, _ = impl.Dlartg(-vb21, vb22) - } - - csu = snl - snu = csl - csv = snr - snv = csr - } - } else { - // Input matrices A and B are lower triangular matrices - // - // Form matrix C = A*adj(B) = [ a 0 ] - // [ c d ] - a := a1 * b3 - d := a3 * b1 - c := a2*b3 - a3*b2 - - // The SVD of real 2-by-2 triangular C - // - // [ csl -snl ]*[ a 0 ]*[ csr snr ] = [ r 0 ] - // [ snl csl ] [ c d ] [ -snr csr ] [ 0 t ] - _, _, snr, csr, snl, csl := impl.Dlasv2(a, c, d) - - if math.Abs(csr) >= math.Abs(snr) || math.Abs(csl) >= math.Abs(snl) { - // Compute the [1, 0] and [1, 1] elements of Uᵀ*A and Vᵀ*B, - // and [1, 0] element of |U|ᵀ*|A| and |V|ᵀ*|B|. - - ua21 := -snr*a1 + csr*a2 - ua22r := csr * a3 - - vb21 := -snl*b1 + csl*b2 - vb22r := csl * b3 - - aua21 := math.Abs(snr)*math.Abs(a1) + math.Abs(csr)*math.Abs(a2) - avb21 := math.Abs(snl)*math.Abs(b1) + math.Abs(csl)*math.Abs(b2) - - // Zero [1, 0] elements of Uᵀ*A and Vᵀ*B. - if (math.Abs(ua21) + math.Abs(ua22r)) != 0 { - if aua21/(math.Abs(ua21)+math.Abs(ua22r)) <= avb21/(math.Abs(vb21)+math.Abs(vb22r)) { - csq, snq, _ = impl.Dlartg(ua22r, ua21) - } else { - csq, snq, _ = impl.Dlartg(vb22r, vb21) - } - } else { - csq, snq, _ = impl.Dlartg(vb22r, vb21) - } - - csu = csr - snu = -snr - csv = csl - snv = -snl - } else { - // Compute the [0, 0] and [0, 1] elements of Uᵀ *A and Vᵀ *B, - // and [0, 0] element of |U|ᵀ*|A| and |V|ᵀ*|B|. - - ua11 := csr*a1 + snr*a2 - ua12 := snr * a3 - - vb11 := csl*b1 + snl*b2 - vb12 := snl * b3 - - aua11 := math.Abs(csr)*math.Abs(a1) + math.Abs(snr)*math.Abs(a2) - avb11 := math.Abs(csl)*math.Abs(b1) + math.Abs(snl)*math.Abs(b2) - - // Zero [0, 0] elements of Uᵀ*A and Vᵀ*B, and then swap. - if (math.Abs(ua11) + math.Abs(ua12)) != 0 { - if aua11/(math.Abs(ua11)+math.Abs(ua12)) <= avb11/(math.Abs(vb11)+math.Abs(vb12)) { - csq, snq, _ = impl.Dlartg(ua12, ua11) - } else { - csq, snq, _ = impl.Dlartg(vb12, vb11) - } - } else { - csq, snq, _ = impl.Dlartg(vb12, vb11) - } - - csu = snr - snu = csr - csv = snl - snv = csl - } - } - - return csu, snu, csv, snv, csq, snq -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlahqr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlahqr.go deleted file mode 100644 index 00a869b..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlahqr.go +++ /dev/null @@ -1,431 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlahqr computes the eigenvalues and Schur factorization of a block of an n×n -// upper Hessenberg matrix H, using the double-shift/single-shift QR algorithm. -// -// h and ldh represent the matrix H. Dlahqr works primarily with the Hessenberg -// submatrix H[ilo:ihi+1,ilo:ihi+1], but applies transformations to all of H if -// wantt is true. It is assumed that H[ihi+1:n,ihi+1:n] is already upper -// quasi-triangular, although this is not checked. -// -// It must hold that -// 0 <= ilo <= max(0,ihi), and ihi < n, -// and that -// H[ilo,ilo-1] == 0, if ilo > 0, -// otherwise Dlahqr will panic. -// -// If unconverged is zero on return, wr[ilo:ihi+1] and wi[ilo:ihi+1] will contain -// respectively the real and imaginary parts of the computed eigenvalues ilo -// to ihi. If two eigenvalues are computed as a complex conjugate pair, they are -// stored in consecutive elements of wr and wi, say the i-th and (i+1)th, with -// wi[i] > 0 and wi[i+1] < 0. If wantt is true, the eigenvalues are stored in -// the same order as on the diagonal of the Schur form returned in H, with -// wr[i] = H[i,i], and, if H[i:i+2,i:i+2] is a 2×2 diagonal block, -// wi[i] = sqrt(abs(H[i+1,i]*H[i,i+1])) and wi[i+1] = -wi[i]. -// -// wr and wi must have length ihi+1. -// -// z and ldz represent an n×n matrix Z. If wantz is true, the transformations -// will be applied to the submatrix Z[iloz:ihiz+1,ilo:ihi+1] and it must hold that -// 0 <= iloz <= ilo, and ihi <= ihiz < n. -// If wantz is false, z is not referenced. -// -// unconverged indicates whether Dlahqr computed all the eigenvalues ilo to ihi -// in a total of 30 iterations per eigenvalue. -// -// If unconverged is zero, all the eigenvalues ilo to ihi have been computed and -// will be stored on return in wr[ilo:ihi+1] and wi[ilo:ihi+1]. -// -// If unconverged is zero and wantt is true, H[ilo:ihi+1,ilo:ihi+1] will be -// overwritten on return by upper quasi-triangular full Schur form with any -// 2×2 diagonal blocks in standard form. -// -// If unconverged is zero and if wantt is false, the contents of h on return is -// unspecified. -// -// If unconverged is positive, some eigenvalues have not converged, and -// wr[unconverged:ihi+1] and wi[unconverged:ihi+1] contain those eigenvalues -// which have been successfully computed. -// -// If unconverged is positive and wantt is true, then on return -// (initial H)*U = U*(final H), (*) -// where U is an orthogonal matrix. The final H is upper Hessenberg and -// H[unconverged:ihi+1,unconverged:ihi+1] is upper quasi-triangular. -// -// If unconverged is positive and wantt is false, on return the remaining -// unconverged eigenvalues are the eigenvalues of the upper Hessenberg matrix -// H[ilo:unconverged,ilo:unconverged]. -// -// If unconverged is positive and wantz is true, then on return -// (final Z) = (initial Z)*U, -// where U is the orthogonal matrix in (*) regardless of the value of wantt. -// -// Dlahqr is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlahqr(wantt, wantz bool, n, ilo, ihi int, h []float64, ldh int, wr, wi []float64, iloz, ihiz int, z []float64, ldz int) (unconverged int) { - switch { - case n < 0: - panic(nLT0) - case ilo < 0, max(0, ihi) < ilo: - panic(badIlo) - case ihi >= n: - panic(badIhi) - case ldh < max(1, n): - panic(badLdH) - case wantz && (iloz < 0 || ilo < iloz): - panic(badIloz) - case wantz && (ihiz < ihi || n <= ihiz): - panic(badIhiz) - case ldz < 1, wantz && ldz < n: - panic(badLdZ) - } - - // Quick return if possible. - if n == 0 { - return 0 - } - - switch { - case len(h) < (n-1)*ldh+n: - panic(shortH) - case len(wr) != ihi+1: - panic(shortWr) - case len(wi) != ihi+1: - panic(shortWi) - case wantz && len(z) < (n-1)*ldz+n: - panic(shortZ) - case ilo > 0 && h[ilo*ldh+ilo-1] != 0: - panic(notIsolated) - } - - if ilo == ihi { - wr[ilo] = h[ilo*ldh+ilo] - wi[ilo] = 0 - return 0 - } - - // Clear out the trash. - for j := ilo; j < ihi-2; j++ { - h[(j+2)*ldh+j] = 0 - h[(j+3)*ldh+j] = 0 - } - if ilo <= ihi-2 { - h[ihi*ldh+ihi-2] = 0 - } - - nh := ihi - ilo + 1 - nz := ihiz - iloz + 1 - - // Set machine-dependent constants for the stopping criterion. - ulp := dlamchP - smlnum := float64(nh) / ulp * dlamchS - - // i1 and i2 are the indices of the first row and last column of H to - // which transformations must be applied. If eigenvalues only are being - // computed, i1 and i2 are set inside the main loop. - var i1, i2 int - if wantt { - i1 = 0 - i2 = n - 1 - } - - itmax := 30 * max(10, nh) // Total number of QR iterations allowed. - - // The main loop begins here. i is the loop index and decreases from ihi - // to ilo in steps of 1 or 2. Each iteration of the loop works with the - // active submatrix in rows and columns l to i. Eigenvalues i+1 to ihi - // have already converged. Either l = ilo or H[l,l-1] is negligible so - // that the matrix splits. - bi := blas64.Implementation() - i := ihi - for i >= ilo { - l := ilo - - // Perform QR iterations on rows and columns ilo to i until a - // submatrix of order 1 or 2 splits off at the bottom because a - // subdiagonal element has become negligible. - converged := false - for its := 0; its <= itmax; its++ { - // Look for a single small subdiagonal element. - var k int - for k = i; k > l; k-- { - if math.Abs(h[k*ldh+k-1]) <= smlnum { - break - } - tst := math.Abs(h[(k-1)*ldh+k-1]) + math.Abs(h[k*ldh+k]) - if tst == 0 { - if k-2 >= ilo { - tst += math.Abs(h[(k-1)*ldh+k-2]) - } - if k+1 <= ihi { - tst += math.Abs(h[(k+1)*ldh+k]) - } - } - // The following is a conservative small - // subdiagonal deflation criterion due to Ahues - // & Tisseur (LAWN 122, 1997). It has better - // mathematical foundation and improves accuracy - // in some cases. - if math.Abs(h[k*ldh+k-1]) <= ulp*tst { - ab := math.Max(math.Abs(h[k*ldh+k-1]), math.Abs(h[(k-1)*ldh+k])) - ba := math.Min(math.Abs(h[k*ldh+k-1]), math.Abs(h[(k-1)*ldh+k])) - aa := math.Max(math.Abs(h[k*ldh+k]), math.Abs(h[(k-1)*ldh+k-1]-h[k*ldh+k])) - bb := math.Min(math.Abs(h[k*ldh+k]), math.Abs(h[(k-1)*ldh+k-1]-h[k*ldh+k])) - s := aa + ab - if ab/s*ba <= math.Max(smlnum, aa/s*bb*ulp) { - break - } - } - } - l = k - if l > ilo { - // H[l,l-1] is negligible. - h[l*ldh+l-1] = 0 - } - if l >= i-1 { - // Break the loop because a submatrix of order 1 - // or 2 has split off. - converged = true - break - } - - // Now the active submatrix is in rows and columns l to - // i. If eigenvalues only are being computed, only the - // active submatrix need be transformed. - if !wantt { - i1 = l - i2 = i - } - - const ( - dat1 = 3.0 - dat2 = -0.4375 - ) - var h11, h21, h12, h22 float64 - switch its { - case 10: // Exceptional shift. - s := math.Abs(h[(l+1)*ldh+l]) + math.Abs(h[(l+2)*ldh+l+1]) - h11 = dat1*s + h[l*ldh+l] - h12 = dat2 * s - h21 = s - h22 = h11 - case 20: // Exceptional shift. - s := math.Abs(h[i*ldh+i-1]) + math.Abs(h[(i-1)*ldh+i-2]) - h11 = dat1*s + h[i*ldh+i] - h12 = dat2 * s - h21 = s - h22 = h11 - default: // Prepare to use Francis' double shift (i.e., - // 2nd degree generalized Rayleigh quotient). - h11 = h[(i-1)*ldh+i-1] - h21 = h[i*ldh+i-1] - h12 = h[(i-1)*ldh+i] - h22 = h[i*ldh+i] - } - s := math.Abs(h11) + math.Abs(h12) + math.Abs(h21) + math.Abs(h22) - var ( - rt1r, rt1i float64 - rt2r, rt2i float64 - ) - if s != 0 { - h11 /= s - h21 /= s - h12 /= s - h22 /= s - tr := (h11 + h22) / 2 - det := (h11-tr)*(h22-tr) - h12*h21 - rtdisc := math.Sqrt(math.Abs(det)) - if det >= 0 { - // Complex conjugate shifts. - rt1r = tr * s - rt2r = rt1r - rt1i = rtdisc * s - rt2i = -rt1i - } else { - // Real shifts (use only one of them). - rt1r = tr + rtdisc - rt2r = tr - rtdisc - if math.Abs(rt1r-h22) <= math.Abs(rt2r-h22) { - rt1r *= s - rt2r = rt1r - } else { - rt2r *= s - rt1r = rt2r - } - rt1i = 0 - rt2i = 0 - } - } - - // Look for two consecutive small subdiagonal elements. - var m int - var v [3]float64 - for m = i - 2; m >= l; m-- { - // Determine the effect of starting the - // double-shift QR iteration at row m, and see - // if this would make H[m,m-1] negligible. The - // following uses scaling to avoid overflows and - // most underflows. - h21s := h[(m+1)*ldh+m] - s := math.Abs(h[m*ldh+m]-rt2r) + math.Abs(rt2i) + math.Abs(h21s) - h21s /= s - v[0] = h21s*h[m*ldh+m+1] + (h[m*ldh+m]-rt1r)*((h[m*ldh+m]-rt2r)/s) - rt2i/s*rt1i - v[1] = h21s * (h[m*ldh+m] + h[(m+1)*ldh+m+1] - rt1r - rt2r) - v[2] = h21s * h[(m+2)*ldh+m+1] - s = math.Abs(v[0]) + math.Abs(v[1]) + math.Abs(v[2]) - v[0] /= s - v[1] /= s - v[2] /= s - if m == l { - break - } - dsum := math.Abs(h[(m-1)*ldh+m-1]) + math.Abs(h[m*ldh+m]) + math.Abs(h[(m+1)*ldh+m+1]) - if math.Abs(h[m*ldh+m-1])*(math.Abs(v[1])+math.Abs(v[2])) <= ulp*math.Abs(v[0])*dsum { - break - } - } - - // Double-shift QR step. - for k := m; k < i; k++ { - // The first iteration of this loop determines a - // reflection G from the vector V and applies it - // from left and right to H, thus creating a - // non-zero bulge below the subdiagonal. - // - // Each subsequent iteration determines a - // reflection G to restore the Hessenberg form - // in the (k-1)th column, and thus chases the - // bulge one step toward the bottom of the - // active submatrix. nr is the order of G. - - nr := min(3, i-k+1) - if k > m { - bi.Dcopy(nr, h[k*ldh+k-1:], ldh, v[:], 1) - } - var t0 float64 - v[0], t0 = impl.Dlarfg(nr, v[0], v[1:], 1) - if k > m { - h[k*ldh+k-1] = v[0] - h[(k+1)*ldh+k-1] = 0 - if k < i-1 { - h[(k+2)*ldh+k-1] = 0 - } - } else if m > l { - // Use the following instead of H[k,k-1] = -H[k,k-1] - // to avoid a bug when v[1] and v[2] underflow. - h[k*ldh+k-1] *= 1 - t0 - } - t1 := t0 * v[1] - if nr == 3 { - t2 := t0 * v[2] - - // Apply G from the left to transform - // the rows of the matrix in columns k - // to i2. - for j := k; j <= i2; j++ { - sum := h[k*ldh+j] + v[1]*h[(k+1)*ldh+j] + v[2]*h[(k+2)*ldh+j] - h[k*ldh+j] -= sum * t0 - h[(k+1)*ldh+j] -= sum * t1 - h[(k+2)*ldh+j] -= sum * t2 - } - - // Apply G from the right to transform - // the columns of the matrix in rows i1 - // to min(k+3,i). - for j := i1; j <= min(k+3, i); j++ { - sum := h[j*ldh+k] + v[1]*h[j*ldh+k+1] + v[2]*h[j*ldh+k+2] - h[j*ldh+k] -= sum * t0 - h[j*ldh+k+1] -= sum * t1 - h[j*ldh+k+2] -= sum * t2 - } - - if wantz { - // Accumulate transformations in the matrix Z. - for j := iloz; j <= ihiz; j++ { - sum := z[j*ldz+k] + v[1]*z[j*ldz+k+1] + v[2]*z[j*ldz+k+2] - z[j*ldz+k] -= sum * t0 - z[j*ldz+k+1] -= sum * t1 - z[j*ldz+k+2] -= sum * t2 - } - } - } else if nr == 2 { - // Apply G from the left to transform - // the rows of the matrix in columns k - // to i2. - for j := k; j <= i2; j++ { - sum := h[k*ldh+j] + v[1]*h[(k+1)*ldh+j] - h[k*ldh+j] -= sum * t0 - h[(k+1)*ldh+j] -= sum * t1 - } - - // Apply G from the right to transform - // the columns of the matrix in rows i1 - // to min(k+3,i). - for j := i1; j <= i; j++ { - sum := h[j*ldh+k] + v[1]*h[j*ldh+k+1] - h[j*ldh+k] -= sum * t0 - h[j*ldh+k+1] -= sum * t1 - } - - if wantz { - // Accumulate transformations in the matrix Z. - for j := iloz; j <= ihiz; j++ { - sum := z[j*ldz+k] + v[1]*z[j*ldz+k+1] - z[j*ldz+k] -= sum * t0 - z[j*ldz+k+1] -= sum * t1 - } - } - } - } - } - - if !converged { - // The QR iteration finished without splitting off a - // submatrix of order 1 or 2. - return i + 1 - } - - if l == i { - // H[i,i-1] is negligible: one eigenvalue has converged. - wr[i] = h[i*ldh+i] - wi[i] = 0 - } else if l == i-1 { - // H[i-1,i-2] is negligible: a pair of eigenvalues have converged. - - // Transform the 2×2 submatrix to standard Schur form, - // and compute and store the eigenvalues. - var cs, sn float64 - a, b := h[(i-1)*ldh+i-1], h[(i-1)*ldh+i] - c, d := h[i*ldh+i-1], h[i*ldh+i] - a, b, c, d, wr[i-1], wi[i-1], wr[i], wi[i], cs, sn = impl.Dlanv2(a, b, c, d) - h[(i-1)*ldh+i-1], h[(i-1)*ldh+i] = a, b - h[i*ldh+i-1], h[i*ldh+i] = c, d - - if wantt { - // Apply the transformation to the rest of H. - if i2 > i { - bi.Drot(i2-i, h[(i-1)*ldh+i+1:], 1, h[i*ldh+i+1:], 1, cs, sn) - } - bi.Drot(i-i1-1, h[i1*ldh+i-1:], ldh, h[i1*ldh+i:], ldh, cs, sn) - } - - if wantz { - // Apply the transformation to Z. - bi.Drot(nz, z[iloz*ldz+i-1:], ldz, z[iloz*ldz+i:], ldz, cs, sn) - } - } - - // Return to start of the main loop with new value of i. - i = l - 1 - } - return 0 -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlahr2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlahr2.go deleted file mode 100644 index 43b7308..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlahr2.go +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlahr2 reduces the first nb columns of a real general n×(n-k+1) matrix A so -// that elements below the k-th subdiagonal are zero. The reduction is performed -// by an orthogonal similarity transformation Qᵀ * A * Q. Dlahr2 returns the -// matrices V and T which determine Q as a block reflector I - V*T*Vᵀ, and -// also the matrix Y = A * V * T. -// -// The matrix Q is represented as a product of nb elementary reflectors -// Q = H_0 * H_1 * ... * H_{nb-1}. -// Each H_i has the form -// H_i = I - tau[i] * v * vᵀ, -// where v is a real vector with v[0:i+k-1] = 0 and v[i+k-1] = 1. v[i+k:n] is -// stored on exit in A[i+k+1:n,i]. -// -// The elements of the vectors v together form the (n-k+1)×nb matrix -// V which is needed, with T and Y, to apply the transformation to the -// unreduced part of the matrix, using an update of the form -// A = (I - V*T*Vᵀ) * (A - Y*Vᵀ). -// -// On entry, a contains the n×(n-k+1) general matrix A. On return, the elements -// on and above the k-th subdiagonal in the first nb columns are overwritten -// with the corresponding elements of the reduced matrix; the elements below the -// k-th subdiagonal, with the slice tau, represent the matrix Q as a product of -// elementary reflectors. The other columns of A are unchanged. -// -// The contents of A on exit are illustrated by the following example -// with n = 7, k = 3 and nb = 2: -// [ a a a a a ] -// [ a a a a a ] -// [ a a a a a ] -// [ h h a a a ] -// [ v0 h a a a ] -// [ v0 v1 a a a ] -// [ v0 v1 a a a ] -// where a denotes an element of the original matrix A, h denotes a -// modified element of the upper Hessenberg matrix H, and vi denotes an -// element of the vector defining H_i. -// -// k is the offset for the reduction. Elements below the k-th subdiagonal in the -// first nb columns are reduced to zero. -// -// nb is the number of columns to be reduced. -// -// On entry, a represents the n×(n-k+1) matrix A. On return, the elements on and -// above the k-th subdiagonal in the first nb columns are overwritten with the -// corresponding elements of the reduced matrix. The elements below the k-th -// subdiagonal, with the slice tau, represent the matrix Q as a product of -// elementary reflectors. The other columns of A are unchanged. -// -// tau will contain the scalar factors of the elementary reflectors. It must -// have length at least nb. -// -// t and ldt represent the nb×nb upper triangular matrix T, and y and ldy -// represent the n×nb matrix Y. -// -// Dlahr2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlahr2(n, k, nb int, a []float64, lda int, tau, t []float64, ldt int, y []float64, ldy int) { - switch { - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case nb < 0: - panic(nbLT0) - case nb > n: - panic(nbGTN) - case lda < max(1, n-k+1): - panic(badLdA) - case ldt < max(1, nb): - panic(badLdT) - case ldy < max(1, nb): - panic(badLdY) - } - - // Quick return if possible. - if n < 0 { - return - } - - switch { - case len(a) < (n-1)*lda+n-k+1: - panic(shortA) - case len(tau) < nb: - panic(shortTau) - case len(t) < (nb-1)*ldt+nb: - panic(shortT) - case len(y) < (n-1)*ldy+nb: - panic(shortY) - } - - // Quick return if possible. - if n == 1 { - return - } - - bi := blas64.Implementation() - var ei float64 - for i := 0; i < nb; i++ { - if i > 0 { - // Update A[k:n,i]. - - // Update i-th column of A - Y * Vᵀ. - bi.Dgemv(blas.NoTrans, n-k, i, - -1, y[k*ldy:], ldy, - a[(k+i-1)*lda:], 1, - 1, a[k*lda+i:], lda) - - // Apply I - V * Tᵀ * Vᵀ to this column (call it b) - // from the left, using the last column of T as - // workspace. - // Let V = [ V1 ] and b = [ b1 ] (first i rows) - // [ V2 ] [ b2 ] - // where V1 is unit lower triangular. - // - // w := V1ᵀ * b1. - bi.Dcopy(i, a[k*lda+i:], lda, t[nb-1:], ldt) - bi.Dtrmv(blas.Lower, blas.Trans, blas.Unit, i, - a[k*lda:], lda, t[nb-1:], ldt) - - // w := w + V2ᵀ * b2. - bi.Dgemv(blas.Trans, n-k-i, i, - 1, a[(k+i)*lda:], lda, - a[(k+i)*lda+i:], lda, - 1, t[nb-1:], ldt) - - // w := Tᵀ * w. - bi.Dtrmv(blas.Upper, blas.Trans, blas.NonUnit, i, - t, ldt, t[nb-1:], ldt) - - // b2 := b2 - V2*w. - bi.Dgemv(blas.NoTrans, n-k-i, i, - -1, a[(k+i)*lda:], lda, - t[nb-1:], ldt, - 1, a[(k+i)*lda+i:], lda) - - // b1 := b1 - V1*w. - bi.Dtrmv(blas.Lower, blas.NoTrans, blas.Unit, i, - a[k*lda:], lda, t[nb-1:], ldt) - bi.Daxpy(i, -1, t[nb-1:], ldt, a[k*lda+i:], lda) - - a[(k+i-1)*lda+i-1] = ei - } - - // Generate the elementary reflector H_i to annihilate - // A[k+i+1:n,i]. - ei, tau[i] = impl.Dlarfg(n-k-i, a[(k+i)*lda+i], a[min(k+i+1, n-1)*lda+i:], lda) - a[(k+i)*lda+i] = 1 - - // Compute Y[k:n,i]. - bi.Dgemv(blas.NoTrans, n-k, n-k-i, - 1, a[k*lda+i+1:], lda, - a[(k+i)*lda+i:], lda, - 0, y[k*ldy+i:], ldy) - bi.Dgemv(blas.Trans, n-k-i, i, - 1, a[(k+i)*lda:], lda, - a[(k+i)*lda+i:], lda, - 0, t[i:], ldt) - bi.Dgemv(blas.NoTrans, n-k, i, - -1, y[k*ldy:], ldy, - t[i:], ldt, - 1, y[k*ldy+i:], ldy) - bi.Dscal(n-k, tau[i], y[k*ldy+i:], ldy) - - // Compute T[0:i,i]. - bi.Dscal(i, -tau[i], t[i:], ldt) - bi.Dtrmv(blas.Upper, blas.NoTrans, blas.NonUnit, i, - t, ldt, t[i:], ldt) - - t[i*ldt+i] = tau[i] - } - a[(k+nb-1)*lda+nb-1] = ei - - // Compute Y[0:k,0:nb]. - impl.Dlacpy(blas.All, k, nb, a[1:], lda, y, ldy) - bi.Dtrmm(blas.Right, blas.Lower, blas.NoTrans, blas.Unit, k, nb, - 1, a[k*lda:], lda, y, ldy) - if n > k+nb { - bi.Dgemm(blas.NoTrans, blas.NoTrans, k, nb, n-k-nb, - 1, a[1+nb:], lda, - a[(k+nb)*lda:], lda, - 1, y, ldy) - } - bi.Dtrmm(blas.Right, blas.Upper, blas.NoTrans, blas.NonUnit, k, nb, - 1, t, ldt, y, ldy) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaln2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaln2.go deleted file mode 100644 index df8164a..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaln2.go +++ /dev/null @@ -1,405 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import "math" - -// Dlaln2 solves a linear equation or a system of 2 linear equations of the form -// (ca A - w D) X = scale B if trans == false, -// (ca Aᵀ - w D) X = scale B if trans == true, -// where A is a na×na real matrix, ca is a real scalar, D is a na×na diagonal -// real matrix, w is a scalar, real if nw == 1, complex if nw == 2, and X and B -// are na×1 matrices, real if w is real, complex if w is complex. -// -// If w is complex, X and B are represented as na×2 matrices, the first column -// of each being the real part and the second being the imaginary part. -// -// na and nw must be 1 or 2, otherwise Dlaln2 will panic. -// -// d1 and d2 are the diagonal elements of D. d2 is not used if na == 1. -// -// wr and wi represent the real and imaginary part, respectively, of the scalar -// w. wi is not used if nw == 1. -// -// smin is the desired lower bound on the singular values of A. This should be -// a safe distance away from underflow or overflow, say, between -// (underflow/machine precision) and (overflow*machine precision). -// -// If both singular values of (ca A - w D) are less than smin, smin*identity -// will be used instead of (ca A - w D). If only one singular value is less than -// smin, one element of (ca A - w D) will be perturbed enough to make the -// smallest singular value roughly smin. If both singular values are at least -// smin, (ca A - w D) will not be perturbed. In any case, the perturbation will -// be at most some small multiple of max(smin, ulp*norm(ca A - w D)). The -// singular values are computed by infinity-norm approximations, and thus will -// only be correct to a factor of 2 or so. -// -// All input quantities are assumed to be smaller than overflow by a reasonable -// factor. -// -// scale is a scaling factor less than or equal to 1 which is chosen so that X -// can be computed without overflow. X is further scaled if necessary to assure -// that norm(ca A - w D)*norm(X) is less than overflow. -// -// xnorm contains the infinity-norm of X when X is regarded as a na×nw real -// matrix. -// -// ok will be false if (ca A - w D) had to be perturbed to make its smallest -// singular value greater than smin, otherwise ok will be true. -// -// Dlaln2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlaln2(trans bool, na, nw int, smin, ca float64, a []float64, lda int, d1, d2 float64, b []float64, ldb int, wr, wi float64, x []float64, ldx int) (scale, xnorm float64, ok bool) { - // TODO(vladimir-ch): Consider splitting this function into two, one - // handling the real case (nw == 1) and the other handling the complex - // case (nw == 2). Given that Go has complex types, their signatures - // would be simpler and more natural, and the implementation not as - // convoluted. - - switch { - case na != 1 && na != 2: - panic(badNa) - case nw != 1 && nw != 2: - panic(badNw) - case lda < na: - panic(badLdA) - case len(a) < (na-1)*lda+na: - panic(shortA) - case ldb < nw: - panic(badLdB) - case len(b) < (na-1)*ldb+nw: - panic(shortB) - case ldx < nw: - panic(badLdX) - case len(x) < (na-1)*ldx+nw: - panic(shortX) - } - - smlnum := 2 * dlamchS - bignum := 1 / smlnum - smini := math.Max(smin, smlnum) - - ok = true - scale = 1 - - if na == 1 { - // 1×1 (i.e., scalar) system C X = B. - - if nw == 1 { - // Real 1×1 system. - - // C = ca A - w D. - csr := ca*a[0] - wr*d1 - cnorm := math.Abs(csr) - - // If |C| < smini, use C = smini. - if cnorm < smini { - csr = smini - cnorm = smini - ok = false - } - - // Check scaling for X = B / C. - bnorm := math.Abs(b[0]) - if cnorm < 1 && bnorm > math.Max(1, bignum*cnorm) { - scale = 1 / bnorm - } - - // Compute X. - x[0] = b[0] * scale / csr - xnorm = math.Abs(x[0]) - - return scale, xnorm, ok - } - - // Complex 1×1 system (w is complex). - - // C = ca A - w D. - csr := ca*a[0] - wr*d1 - csi := -wi * d1 - cnorm := math.Abs(csr) + math.Abs(csi) - - // If |C| < smini, use C = smini. - if cnorm < smini { - csr = smini - csi = 0 - cnorm = smini - ok = false - } - - // Check scaling for X = B / C. - bnorm := math.Abs(b[0]) + math.Abs(b[1]) - if cnorm < 1 && bnorm > math.Max(1, bignum*cnorm) { - scale = 1 / bnorm - } - - // Compute X. - cx := complex(scale*b[0], scale*b[1]) / complex(csr, csi) - x[0], x[1] = real(cx), imag(cx) - xnorm = math.Abs(x[0]) + math.Abs(x[1]) - - return scale, xnorm, ok - } - - // 2×2 system. - - // Compute the real part of - // C = ca A - w D - // or - // C = ca Aᵀ - w D. - crv := [4]float64{ - ca*a[0] - wr*d1, - ca * a[1], - ca * a[lda], - ca*a[lda+1] - wr*d2, - } - if trans { - crv[1] = ca * a[lda] - crv[2] = ca * a[1] - } - - pivot := [4][4]int{ - {0, 1, 2, 3}, - {1, 0, 3, 2}, - {2, 3, 0, 1}, - {3, 2, 1, 0}, - } - - if nw == 1 { - // Real 2×2 system (w is real). - - // Find the largest element in C. - var cmax float64 - var icmax int - for j, v := range crv { - v = math.Abs(v) - if v > cmax { - cmax = v - icmax = j - } - } - - // If norm(C) < smini, use smini*identity. - if cmax < smini { - bnorm := math.Max(math.Abs(b[0]), math.Abs(b[ldb])) - if smini < 1 && bnorm > math.Max(1, bignum*smini) { - scale = 1 / bnorm - } - temp := scale / smini - x[0] = temp * b[0] - x[ldx] = temp * b[ldb] - xnorm = temp * bnorm - ok = false - - return scale, xnorm, ok - } - - // Gaussian elimination with complete pivoting. - // Form upper triangular matrix - // [ur11 ur12] - // [ 0 ur22] - ur11 := crv[icmax] - ur12 := crv[pivot[icmax][1]] - cr21 := crv[pivot[icmax][2]] - cr22 := crv[pivot[icmax][3]] - ur11r := 1 / ur11 - lr21 := ur11r * cr21 - ur22 := cr22 - ur12*lr21 - - // If smaller pivot < smini, use smini. - if math.Abs(ur22) < smini { - ur22 = smini - ok = false - } - - var br1, br2 float64 - if icmax > 1 { - // If the pivot lies in the second row, swap the rows. - br1 = b[ldb] - br2 = b[0] - } else { - br1 = b[0] - br2 = b[ldb] - } - br2 -= lr21 * br1 // Apply the Gaussian elimination step to the right-hand side. - - bbnd := math.Max(math.Abs(ur22*ur11r*br1), math.Abs(br2)) - if bbnd > 1 && math.Abs(ur22) < 1 && bbnd >= bignum*math.Abs(ur22) { - scale = 1 / bbnd - } - - // Solve the linear system ur*xr=br. - xr2 := br2 * scale / ur22 - xr1 := scale*br1*ur11r - ur11r*ur12*xr2 - if icmax&0x1 != 0 { - // If the pivot lies in the second column, swap the components of the solution. - x[0] = xr2 - x[ldx] = xr1 - } else { - x[0] = xr1 - x[ldx] = xr2 - } - xnorm = math.Max(math.Abs(xr1), math.Abs(xr2)) - - // Further scaling if norm(A)*norm(X) > overflow. - if xnorm > 1 && cmax > 1 && xnorm > bignum/cmax { - temp := cmax / bignum - x[0] *= temp - x[ldx] *= temp - xnorm *= temp - scale *= temp - } - - return scale, xnorm, ok - } - - // Complex 2×2 system (w is complex). - - // Find the largest element in C. - civ := [4]float64{ - -wi * d1, - 0, - 0, - -wi * d2, - } - var cmax float64 - var icmax int - for j, v := range crv { - v := math.Abs(v) - if v+math.Abs(civ[j]) > cmax { - cmax = v + math.Abs(civ[j]) - icmax = j - } - } - - // If norm(C) < smini, use smini*identity. - if cmax < smini { - br1 := math.Abs(b[0]) + math.Abs(b[1]) - br2 := math.Abs(b[ldb]) + math.Abs(b[ldb+1]) - bnorm := math.Max(br1, br2) - if smini < 1 && bnorm > 1 && bnorm > bignum*smini { - scale = 1 / bnorm - } - temp := scale / smini - x[0] = temp * b[0] - x[1] = temp * b[1] - x[ldb] = temp * b[ldb] - x[ldb+1] = temp * b[ldb+1] - xnorm = temp * bnorm - ok = false - - return scale, xnorm, ok - } - - // Gaussian elimination with complete pivoting. - ur11 := crv[icmax] - ui11 := civ[icmax] - ur12 := crv[pivot[icmax][1]] - ui12 := civ[pivot[icmax][1]] - cr21 := crv[pivot[icmax][2]] - ci21 := civ[pivot[icmax][2]] - cr22 := crv[pivot[icmax][3]] - ci22 := civ[pivot[icmax][3]] - var ( - ur11r, ui11r float64 - lr21, li21 float64 - ur12s, ui12s float64 - ur22, ui22 float64 - ) - if icmax == 0 || icmax == 3 { - // Off-diagonals of pivoted C are real. - if math.Abs(ur11) > math.Abs(ui11) { - temp := ui11 / ur11 - ur11r = 1 / (ur11 * (1 + temp*temp)) - ui11r = -temp * ur11r - } else { - temp := ur11 / ui11 - ui11r = -1 / (ui11 * (1 + temp*temp)) - ur11r = -temp * ui11r - } - lr21 = cr21 * ur11r - li21 = cr21 * ui11r - ur12s = ur12 * ur11r - ui12s = ur12 * ui11r - ur22 = cr22 - ur12*lr21 - ui22 = ci22 - ur12*li21 - } else { - // Diagonals of pivoted C are real. - ur11r = 1 / ur11 - // ui11r is already 0. - lr21 = cr21 * ur11r - li21 = ci21 * ur11r - ur12s = ur12 * ur11r - ui12s = ui12 * ur11r - ur22 = cr22 - ur12*lr21 + ui12*li21 - ui22 = -ur12*li21 - ui12*lr21 - } - u22abs := math.Abs(ur22) + math.Abs(ui22) - - // If smaller pivot < smini, use smini. - if u22abs < smini { - ur22 = smini - ui22 = 0 - ok = false - } - - var br1, bi1 float64 - var br2, bi2 float64 - if icmax > 1 { - // If the pivot lies in the second row, swap the rows. - br1 = b[ldb] - bi1 = b[ldb+1] - br2 = b[0] - bi2 = b[1] - } else { - br1 = b[0] - bi1 = b[1] - br2 = b[ldb] - bi2 = b[ldb+1] - } - br2 += -lr21*br1 + li21*bi1 - bi2 += -li21*br1 - lr21*bi1 - - bbnd1 := u22abs * (math.Abs(ur11r) + math.Abs(ui11r)) * (math.Abs(br1) + math.Abs(bi1)) - bbnd2 := math.Abs(br2) + math.Abs(bi2) - bbnd := math.Max(bbnd1, bbnd2) - if bbnd > 1 && u22abs < 1 && bbnd >= bignum*u22abs { - scale = 1 / bbnd - br1 *= scale - bi1 *= scale - br2 *= scale - bi2 *= scale - } - - cx2 := complex(br2, bi2) / complex(ur22, ui22) - xr2, xi2 := real(cx2), imag(cx2) - xr1 := ur11r*br1 - ui11r*bi1 - ur12s*xr2 + ui12s*xi2 - xi1 := ui11r*br1 + ur11r*bi1 - ui12s*xr2 - ur12s*xi2 - if icmax&0x1 != 0 { - // If the pivot lies in the second column, swap the components of the solution. - x[0] = xr2 - x[1] = xi2 - x[ldx] = xr1 - x[ldx+1] = xi1 - } else { - x[0] = xr1 - x[1] = xi1 - x[ldx] = xr2 - x[ldx+1] = xi2 - } - xnorm = math.Max(math.Abs(xr1)+math.Abs(xi1), math.Abs(xr2)+math.Abs(xi2)) - - // Further scaling if norm(A)*norm(X) > overflow. - if xnorm > 1 && cmax > 1 && xnorm > bignum/cmax { - temp := cmax / bignum - x[0] *= temp - x[1] *= temp - x[ldx] *= temp - x[ldx+1] *= temp - xnorm *= temp - scale *= temp - } - - return scale, xnorm, ok -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlange.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlange.go deleted file mode 100644 index 0594877..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlange.go +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/lapack" -) - -// Dlange returns the value of the specified norm of a general m×n matrix A: -// lapack.MaxAbs: the maximum absolute value of any element. -// lapack.MaxColumnSum: the maximum column sum of the absolute values of the elements (1-norm). -// lapack.MaxRowSum: the maximum row sum of the absolute values of the elements (infinity-norm). -// lapack.Frobenius: the square root of the sum of the squares of the elements (Frobenius norm). -// If norm == lapack.MaxColumnSum, work must be of length n, and this function will -// panic otherwise. There are no restrictions on work for the other matrix norms. -func (impl Implementation) Dlange(norm lapack.MatrixNorm, m, n int, a []float64, lda int, work []float64) float64 { - // TODO(btracey): These should probably be refactored to use BLAS calls. - switch { - case norm != lapack.MaxRowSum && norm != lapack.MaxColumnSum && norm != lapack.Frobenius && norm != lapack.MaxAbs: - panic(badNorm) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return 0 - } - - switch { - case len(a) < (m-1)*lda+n: - panic(badLdA) - case norm == lapack.MaxColumnSum && len(work) < n: - panic(shortWork) - } - - switch norm { - case lapack.MaxAbs: - var value float64 - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - value = math.Max(value, math.Abs(a[i*lda+j])) - } - } - return value - case lapack.MaxColumnSum: - for i := 0; i < n; i++ { - work[i] = 0 - } - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - work[j] += math.Abs(a[i*lda+j]) - } - } - var value float64 - for i := 0; i < n; i++ { - value = math.Max(value, work[i]) - } - return value - case lapack.MaxRowSum: - var value float64 - for i := 0; i < m; i++ { - var sum float64 - for j := 0; j < n; j++ { - sum += math.Abs(a[i*lda+j]) - } - value = math.Max(value, sum) - } - return value - default: - // lapack.Frobenius - scale := 0.0 - sum := 1.0 - for i := 0; i < m; i++ { - rowscale, rowsum := impl.Dlassq(n, a[i*lda:], 1, 0, 1) - scale, sum = impl.Dcombssq(scale, sum, rowscale, rowsum) - } - return scale * math.Sqrt(sum) - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlansb.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlansb.go deleted file mode 100644 index ac29375..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlansb.go +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright ©2019 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dlansb returns the given norm of an n×n symmetric band matrix with kd -// super-diagonals. -// -// When norm is lapack.MaxColumnSum or lapack.MaxRowSum, the length of work must -// be at least n. -func (impl Implementation) Dlansb(norm lapack.MatrixNorm, uplo blas.Uplo, n, kd int, ab []float64, ldab int, work []float64) float64 { - switch { - case norm != lapack.MaxAbs && norm != lapack.MaxRowSum && norm != lapack.MaxColumnSum && norm != lapack.Frobenius: - panic(badNorm) - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case kd < 0: - panic(kdLT0) - case ldab < kd+1: - panic(badLdA) - } - - // Quick return if possible. - if n == 0 { - return 0 - } - - switch { - case len(ab) < (n-1)*ldab+kd+1: - panic(shortAB) - case len(work) < n && (norm == lapack.MaxColumnSum || norm == lapack.MaxRowSum): - panic(shortWork) - } - - var value float64 - switch norm { - case lapack.MaxAbs: - if uplo == blas.Upper { - for i := 0; i < n; i++ { - for j := 0; j < min(n-i, kd+1); j++ { - aij := math.Abs(ab[i*ldab+j]) - if aij > value || math.IsNaN(aij) { - value = aij - } - } - } - } else { - for i := 0; i < n; i++ { - for j := max(0, kd-i); j < kd+1; j++ { - aij := math.Abs(ab[i*ldab+j]) - if aij > value || math.IsNaN(aij) { - value = aij - } - } - } - } - case lapack.MaxColumnSum, lapack.MaxRowSum: - work = work[:n] - var sum float64 - if uplo == blas.Upper { - for i := range work { - work[i] = 0 - } - for i := 0; i < n; i++ { - sum := work[i] + math.Abs(ab[i*ldab]) - for j := i + 1; j < min(i+kd+1, n); j++ { - aij := math.Abs(ab[i*ldab+j-i]) - sum += aij - work[j] += aij - } - if sum > value || math.IsNaN(sum) { - value = sum - } - } - } else { - for i := 0; i < n; i++ { - sum = 0 - for j := max(0, i-kd); j < i; j++ { - aij := math.Abs(ab[i*ldab+kd+j-i]) - sum += aij - work[j] += aij - } - work[i] = sum + math.Abs(ab[i*ldab+kd]) - } - for _, sum := range work { - if sum > value || math.IsNaN(sum) { - value = sum - } - } - } - case lapack.Frobenius: - scale := 0.0 - ssq := 1.0 - if uplo == blas.Upper { - if kd > 0 { - // Sum off-diagonals. - for i := 0; i < n-1; i++ { - ilen := min(n-i-1, kd) - rowscale, rowssq := impl.Dlassq(ilen, ab[i*ldab+1:], 1, 0, 1) - scale, ssq = impl.Dcombssq(scale, ssq, rowscale, rowssq) - } - ssq *= 2 - } - // Sum diagonal. - dscale, dssq := impl.Dlassq(n, ab, ldab, 0, 1) - scale, ssq = impl.Dcombssq(scale, ssq, dscale, dssq) - } else { - if kd > 0 { - // Sum off-diagonals. - for i := 1; i < n; i++ { - ilen := min(i, kd) - rowscale, rowssq := impl.Dlassq(ilen, ab[i*ldab+kd-ilen:], 1, 0, 1) - scale, ssq = impl.Dcombssq(scale, ssq, rowscale, rowssq) - } - ssq *= 2 - } - // Sum diagonal. - dscale, dssq := impl.Dlassq(n, ab[kd:], ldab, 0, 1) - scale, ssq = impl.Dcombssq(scale, ssq, dscale, dssq) - } - value = scale * math.Sqrt(ssq) - } - - return value -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlanst.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlanst.go deleted file mode 100644 index 9ca1897..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlanst.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/lapack" -) - -// Dlanst computes the specified norm of a symmetric tridiagonal matrix A. -// The diagonal elements of A are stored in d and the off-diagonal elements -// are stored in e. -func (impl Implementation) Dlanst(norm lapack.MatrixNorm, n int, d, e []float64) float64 { - switch { - case norm != lapack.MaxRowSum && norm != lapack.MaxColumnSum && norm != lapack.Frobenius && norm != lapack.MaxAbs: - panic(badNorm) - case n < 0: - panic(nLT0) - } - if n == 0 { - return 0 - } - switch { - case len(d) < n: - panic(shortD) - case len(e) < n-1: - panic(shortE) - } - - switch norm { - default: - panic(badNorm) - case lapack.MaxAbs: - anorm := math.Abs(d[n-1]) - for i := 0; i < n-1; i++ { - sum := math.Abs(d[i]) - if anorm < sum || math.IsNaN(sum) { - anorm = sum - } - sum = math.Abs(e[i]) - if anorm < sum || math.IsNaN(sum) { - anorm = sum - } - } - return anorm - case lapack.MaxColumnSum, lapack.MaxRowSum: - if n == 1 { - return math.Abs(d[0]) - } - anorm := math.Abs(d[0]) + math.Abs(e[0]) - sum := math.Abs(e[n-2]) + math.Abs(d[n-1]) - if anorm < sum || math.IsNaN(sum) { - anorm = sum - } - for i := 1; i < n-1; i++ { - sum := math.Abs(d[i]) + math.Abs(e[i]) + math.Abs(e[i-1]) - if anorm < sum || math.IsNaN(sum) { - anorm = sum - } - } - return anorm - case lapack.Frobenius: - var scale float64 - sum := 1.0 - if n > 1 { - scale, sum = impl.Dlassq(n-1, e, 1, scale, sum) - sum = 2 * sum - } - scale, sum = impl.Dlassq(n, d, 1, scale, sum) - return scale * math.Sqrt(sum) - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlansy.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlansy.go deleted file mode 100644 index 2c6f5cf..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlansy.go +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dlansy returns the value of the specified norm of an n×n symmetric matrix. If -// norm == lapack.MaxColumnSum or norm == lapack.MaxRowSum, work must have length -// at least n, otherwise work is unused. -func (impl Implementation) Dlansy(norm lapack.MatrixNorm, uplo blas.Uplo, n int, a []float64, lda int, work []float64) float64 { - switch { - case norm != lapack.MaxRowSum && norm != lapack.MaxColumnSum && norm != lapack.Frobenius && norm != lapack.MaxAbs: - panic(badNorm) - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if n == 0 { - return 0 - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case (norm == lapack.MaxColumnSum || norm == lapack.MaxRowSum) && len(work) < n: - panic(shortWork) - } - - switch norm { - case lapack.MaxAbs: - if uplo == blas.Upper { - var max float64 - for i := 0; i < n; i++ { - for j := i; j < n; j++ { - v := math.Abs(a[i*lda+j]) - if math.IsNaN(v) { - return math.NaN() - } - if v > max { - max = v - } - } - } - return max - } - var max float64 - for i := 0; i < n; i++ { - for j := 0; j <= i; j++ { - v := math.Abs(a[i*lda+j]) - if math.IsNaN(v) { - return math.NaN() - } - if v > max { - max = v - } - } - } - return max - case lapack.MaxRowSum, lapack.MaxColumnSum: - // A symmetric matrix has the same 1-norm and ∞-norm. - for i := 0; i < n; i++ { - work[i] = 0 - } - if uplo == blas.Upper { - for i := 0; i < n; i++ { - work[i] += math.Abs(a[i*lda+i]) - for j := i + 1; j < n; j++ { - v := math.Abs(a[i*lda+j]) - work[i] += v - work[j] += v - } - } - } else { - for i := 0; i < n; i++ { - for j := 0; j < i; j++ { - v := math.Abs(a[i*lda+j]) - work[i] += v - work[j] += v - } - work[i] += math.Abs(a[i*lda+i]) - } - } - var max float64 - for i := 0; i < n; i++ { - v := work[i] - if math.IsNaN(v) { - return math.NaN() - } - if v > max { - max = v - } - } - return max - default: - // lapack.Frobenius: - scale := 0.0 - ssq := 1.0 - // Sum off-diagonals. - if uplo == blas.Upper { - for i := 0; i < n-1; i++ { - rowscale, rowssq := impl.Dlassq(n-i-1, a[i*lda+i+1:], 1, 0, 1) - scale, ssq = impl.Dcombssq(scale, ssq, rowscale, rowssq) - } - } else { - for i := 1; i < n; i++ { - rowscale, rowssq := impl.Dlassq(i, a[i*lda:], 1, 0, 1) - scale, ssq = impl.Dcombssq(scale, ssq, rowscale, rowssq) - } - } - ssq *= 2 - // Sum diagonal. - dscale, dssq := impl.Dlassq(n, a, lda+1, 0, 1) - scale, ssq = impl.Dcombssq(scale, ssq, dscale, dssq) - return scale * math.Sqrt(ssq) - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlantr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlantr.go deleted file mode 100644 index cb40d23..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlantr.go +++ /dev/null @@ -1,256 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dlantr computes the specified norm of an m×n trapezoidal matrix A. If -// norm == lapack.MaxColumnSum work must have length at least n, otherwise work -// is unused. -func (impl Implementation) Dlantr(norm lapack.MatrixNorm, uplo blas.Uplo, diag blas.Diag, m, n int, a []float64, lda int, work []float64) float64 { - switch { - case norm != lapack.MaxRowSum && norm != lapack.MaxColumnSum && norm != lapack.Frobenius && norm != lapack.MaxAbs: - panic(badNorm) - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case diag != blas.Unit && diag != blas.NonUnit: - panic(badDiag) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - minmn := min(m, n) - if minmn == 0 { - return 0 - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case norm == lapack.MaxColumnSum && len(work) < n: - panic(shortWork) - } - - switch norm { - case lapack.MaxAbs: - if diag == blas.Unit { - value := 1.0 - if uplo == blas.Upper { - for i := 0; i < m; i++ { - for j := i + 1; j < n; j++ { - tmp := math.Abs(a[i*lda+j]) - if math.IsNaN(tmp) { - return tmp - } - if tmp > value { - value = tmp - } - } - } - return value - } - for i := 1; i < m; i++ { - for j := 0; j < min(i, n); j++ { - tmp := math.Abs(a[i*lda+j]) - if math.IsNaN(tmp) { - return tmp - } - if tmp > value { - value = tmp - } - } - } - return value - } - var value float64 - if uplo == blas.Upper { - for i := 0; i < m; i++ { - for j := i; j < n; j++ { - tmp := math.Abs(a[i*lda+j]) - if math.IsNaN(tmp) { - return tmp - } - if tmp > value { - value = tmp - } - } - } - return value - } - for i := 0; i < m; i++ { - for j := 0; j <= min(i, n-1); j++ { - tmp := math.Abs(a[i*lda+j]) - if math.IsNaN(tmp) { - return tmp - } - if tmp > value { - value = tmp - } - } - } - return value - case lapack.MaxColumnSum: - if diag == blas.Unit { - for i := 0; i < minmn; i++ { - work[i] = 1 - } - for i := minmn; i < n; i++ { - work[i] = 0 - } - if uplo == blas.Upper { - for i := 0; i < m; i++ { - for j := i + 1; j < n; j++ { - work[j] += math.Abs(a[i*lda+j]) - } - } - } else { - for i := 1; i < m; i++ { - for j := 0; j < min(i, n); j++ { - work[j] += math.Abs(a[i*lda+j]) - } - } - } - } else { - for i := 0; i < n; i++ { - work[i] = 0 - } - if uplo == blas.Upper { - for i := 0; i < m; i++ { - for j := i; j < n; j++ { - work[j] += math.Abs(a[i*lda+j]) - } - } - } else { - for i := 0; i < m; i++ { - for j := 0; j <= min(i, n-1); j++ { - work[j] += math.Abs(a[i*lda+j]) - } - } - } - } - var max float64 - for _, v := range work[:n] { - if math.IsNaN(v) { - return math.NaN() - } - if v > max { - max = v - } - } - return max - case lapack.MaxRowSum: - var maxsum float64 - if diag == blas.Unit { - if uplo == blas.Upper { - for i := 0; i < m; i++ { - var sum float64 - if i < minmn { - sum = 1 - } - for j := i + 1; j < n; j++ { - sum += math.Abs(a[i*lda+j]) - } - if math.IsNaN(sum) { - return math.NaN() - } - if sum > maxsum { - maxsum = sum - } - } - return maxsum - } else { - for i := 0; i < m; i++ { - var sum float64 - if i < minmn { - sum = 1 - } - for j := 0; j < min(i, n); j++ { - sum += math.Abs(a[i*lda+j]) - } - if math.IsNaN(sum) { - return math.NaN() - } - if sum > maxsum { - maxsum = sum - } - } - return maxsum - } - } else { - if uplo == blas.Upper { - for i := 0; i < m; i++ { - var sum float64 - for j := i; j < n; j++ { - sum += math.Abs(a[i*lda+j]) - } - if math.IsNaN(sum) { - return sum - } - if sum > maxsum { - maxsum = sum - } - } - return maxsum - } else { - for i := 0; i < m; i++ { - var sum float64 - for j := 0; j <= min(i, n-1); j++ { - sum += math.Abs(a[i*lda+j]) - } - if math.IsNaN(sum) { - return sum - } - if sum > maxsum { - maxsum = sum - } - } - return maxsum - } - } - default: - // lapack.Frobenius: - var scale, ssq float64 - if diag == blas.Unit { - scale = 1 - ssq = float64(min(m, n)) - if uplo == blas.Upper { - for i := 0; i < min(m, n); i++ { - rowscale, rowssq := impl.Dlassq(n-i-1, a[i*lda+i+1:], 1, 0, 1) - scale, ssq = impl.Dcombssq(scale, ssq, rowscale, rowssq) - } - } else { - for i := 1; i < m; i++ { - rowscale, rowssq := impl.Dlassq(min(i, n), a[i*lda:], 1, 0, 1) - scale, ssq = impl.Dcombssq(scale, ssq, rowscale, rowssq) - } - } - } else { - scale = 0 - ssq = 1 - if uplo == blas.Upper { - for i := 0; i < min(m, n); i++ { - rowscale, rowssq := impl.Dlassq(n-i, a[i*lda+i:], 1, 0, 1) - scale, ssq = impl.Dcombssq(scale, ssq, rowscale, rowssq) - } - } else { - for i := 0; i < m; i++ { - rowscale, rowssq := impl.Dlassq(min(i+1, n), a[i*lda:], 1, 0, 1) - scale, ssq = impl.Dcombssq(scale, ssq, rowscale, rowssq) - } - } - } - return scale * math.Sqrt(ssq) - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlanv2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlanv2.go deleted file mode 100644 index f5bf761..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlanv2.go +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import "math" - -// Dlanv2 computes the Schur factorization of a real 2×2 matrix: -// [ a b ] = [ cs -sn ] * [ aa bb ] * [ cs sn ] -// [ c d ] [ sn cs ] [ cc dd ] * [-sn cs ] -// If cc is zero, aa and dd are real eigenvalues of the matrix. Otherwise it -// holds that aa = dd and bb*cc < 0, and aa ± sqrt(bb*cc) are complex conjugate -// eigenvalues. The real and imaginary parts of the eigenvalues are returned in -// (rt1r,rt1i) and (rt2r,rt2i). -func (impl Implementation) Dlanv2(a, b, c, d float64) (aa, bb, cc, dd float64, rt1r, rt1i, rt2r, rt2i float64, cs, sn float64) { - switch { - case c == 0: // Matrix is already upper triangular. - aa = a - bb = b - cc = 0 - dd = d - cs = 1 - sn = 0 - case b == 0: // Matrix is lower triangular, swap rows and columns. - aa = d - bb = -c - cc = 0 - dd = a - cs = 0 - sn = 1 - case a == d && math.Signbit(b) != math.Signbit(c): // Matrix is already in the standard Schur form. - aa = a - bb = b - cc = c - dd = d - cs = 1 - sn = 0 - default: - temp := a - d - p := temp / 2 - bcmax := math.Max(math.Abs(b), math.Abs(c)) - bcmis := math.Min(math.Abs(b), math.Abs(c)) - if b*c < 0 { - bcmis *= -1 - } - scale := math.Max(math.Abs(p), bcmax) - z := p/scale*p + bcmax/scale*bcmis - eps := dlamchP - - if z >= 4*eps { - // Real eigenvalues. Compute aa and dd. - if p > 0 { - z = p + math.Sqrt(scale)*math.Sqrt(z) - } else { - z = p - math.Sqrt(scale)*math.Sqrt(z) - } - aa = d + z - dd = d - bcmax/z*bcmis - // Compute bb and the rotation matrix. - tau := impl.Dlapy2(c, z) - cs = z / tau - sn = c / tau - bb = b - c - cc = 0 - } else { - // Complex eigenvalues, or real (almost) equal eigenvalues. - // Make diagonal elements equal. - sigma := b + c - tau := impl.Dlapy2(sigma, temp) - cs = math.Sqrt((1 + math.Abs(sigma)/tau) / 2) - sn = -p / (tau * cs) - if sigma < 0 { - sn *= -1 - } - // Compute [ aa bb ] = [ a b ] [ cs -sn ] - // [ cc dd ] [ c d ] [ sn cs ] - aa = a*cs + b*sn - bb = -a*sn + b*cs - cc = c*cs + d*sn - dd = -c*sn + d*cs - // Compute [ a b ] = [ cs sn ] [ aa bb ] - // [ c d ] [-sn cs ] [ cc dd ] - a = aa*cs + cc*sn - b = bb*cs + dd*sn - c = -aa*sn + cc*cs - d = -bb*sn + dd*cs - - temp = (a + d) / 2 - aa = temp - bb = b - cc = c - dd = temp - - if cc != 0 { - if bb != 0 { - if math.Signbit(bb) == math.Signbit(cc) { - // Real eigenvalues, reduce to - // upper triangular form. - sab := math.Sqrt(math.Abs(bb)) - sac := math.Sqrt(math.Abs(cc)) - p = sab * sac - if cc < 0 { - p *= -1 - } - tau = 1 / math.Sqrt(math.Abs(bb+cc)) - aa = temp + p - bb = bb - cc - cc = 0 - dd = temp - p - cs1 := sab * tau - sn1 := sac * tau - cs, sn = cs*cs1-sn*sn1, cs*sn1+sn*cs1 - } - } else { - bb = -cc - cc = 0 - cs, sn = -sn, cs - } - } - } - } - - // Store eigenvalues in (rt1r,rt1i) and (rt2r,rt2i). - rt1r = aa - rt2r = dd - if cc != 0 { - rt1i = math.Sqrt(math.Abs(bb)) * math.Sqrt(math.Abs(cc)) - rt2i = -rt1i - } - return -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlapll.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlapll.go deleted file mode 100644 index bf98c33..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlapll.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright ©2017 The Gonum 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 gonum - -import "gonum.org/v1/gonum/blas/blas64" - -// Dlapll returns the smallest singular value of the n×2 matrix A = [ x y ]. -// The function first computes the QR factorization of A = Q*R, and then computes -// the SVD of the 2-by-2 upper triangular matrix r. -// -// The contents of x and y are overwritten during the call. -// -// Dlapll is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlapll(n int, x []float64, incX int, y []float64, incY int) float64 { - switch { - case n < 0: - panic(nLT0) - case incX <= 0: - panic(badIncX) - case incY <= 0: - panic(badIncY) - } - - // Quick return if possible. - if n == 0 { - return 0 - } - - switch { - case len(x) < 1+(n-1)*incX: - panic(shortX) - case len(y) < 1+(n-1)*incY: - panic(shortY) - } - - // Quick return if possible. - if n == 1 { - return 0 - } - - // Compute the QR factorization of the N-by-2 matrix [ X Y ]. - a00, tau := impl.Dlarfg(n, x[0], x[incX:], incX) - x[0] = 1 - - bi := blas64.Implementation() - c := -tau * bi.Ddot(n, x, incX, y, incY) - bi.Daxpy(n, c, x, incX, y, incY) - a11, _ := impl.Dlarfg(n-1, y[incY], y[2*incY:], incY) - - // Compute the SVD of 2-by-2 upper triangular matrix. - ssmin, _ := impl.Dlas2(a00, y[0], a11) - return ssmin -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlapmt.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlapmt.go deleted file mode 100644 index 55f1567..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlapmt.go +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright ©2017 The Gonum 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 gonum - -import "gonum.org/v1/gonum/blas/blas64" - -// Dlapmt rearranges the columns of the m×n matrix X as specified by the -// permutation k_0, k_1, ..., k_n-1 of the integers 0, ..., n-1. -// -// If forward is true a forward permutation is performed: -// -// X[0:m, k[j]] is moved to X[0:m, j] for j = 0, 1, ..., n-1. -// -// otherwise a backward permutation is performed: -// -// X[0:m, j] is moved to X[0:m, k[j]] for j = 0, 1, ..., n-1. -// -// k must have length n, otherwise Dlapmt will panic. k is zero-indexed. -func (impl Implementation) Dlapmt(forward bool, m, n int, x []float64, ldx int, k []int) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case ldx < max(1, n): - panic(badLdX) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - switch { - case len(x) < (m-1)*ldx+n: - panic(shortX) - case len(k) != n: - panic(badLenK) - } - - // Quick return if possible. - if n == 1 { - return - } - - for i, v := range k { - v++ - k[i] = -v - } - - bi := blas64.Implementation() - - if forward { - for j, v := range k { - if v >= 0 { - continue - } - k[j] = -v - i := -v - 1 - for k[i] < 0 { - bi.Dswap(m, x[j:], ldx, x[i:], ldx) - - k[i] = -k[i] - j = i - i = k[i] - 1 - } - } - } else { - for i, v := range k { - if v >= 0 { - continue - } - k[i] = -v - j := -v - 1 - for j != i { - bi.Dswap(m, x[j:], ldx, x[i:], ldx) - - k[j] = -k[j] - j = k[j] - 1 - } - } - } - - for i := range k { - k[i]-- - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlapy2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlapy2.go deleted file mode 100644 index 19f73ff..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlapy2.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import "math" - -// Dlapy2 is the LAPACK version of math.Hypot. -// -// Dlapy2 is an internal routine. It is exported for testing purposes. -func (Implementation) Dlapy2(x, y float64) float64 { - return math.Hypot(x, y) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqp2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqp2.go deleted file mode 100644 index cc3bc06..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqp2.go +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright ©2017 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlaqp2 computes a QR factorization with column pivoting of the block A[offset:m, 0:n] -// of the m×n matrix A. The block A[0:offset, 0:n] is accordingly pivoted, but not factorized. -// -// On exit, the upper triangle of block A[offset:m, 0:n] is the triangular factor obtained. -// The elements in block A[offset:m, 0:n] below the diagonal, together with tau, represent -// the orthogonal matrix Q as a product of elementary reflectors. -// -// offset is number of rows of the matrix A that must be pivoted but not factorized. -// offset must not be negative otherwise Dlaqp2 will panic. -// -// On exit, jpvt holds the permutation that was applied; the jth column of A*P was the -// jpvt[j] column of A. jpvt must have length n, otherwise Dlaqp2 will panic. -// -// On exit tau holds the scalar factors of the elementary reflectors. It must have length -// at least min(m-offset, n) otherwise Dlaqp2 will panic. -// -// vn1 and vn2 hold the partial and complete column norms respectively. They must have length n, -// otherwise Dlaqp2 will panic. -// -// work must have length n, otherwise Dlaqp2 will panic. -// -// Dlaqp2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlaqp2(m, n, offset int, a []float64, lda int, jpvt []int, tau, vn1, vn2, work []float64) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case offset < 0: - panic(offsetLT0) - case offset > m: - panic(offsetGTM) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - mn := min(m-offset, n) - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(jpvt) != n: - panic(badLenJpvt) - case len(tau) < mn: - panic(shortTau) - case len(vn1) < n: - panic(shortVn1) - case len(vn2) < n: - panic(shortVn2) - case len(work) < n: - panic(shortWork) - } - - tol3z := math.Sqrt(dlamchE) - - bi := blas64.Implementation() - - // Compute factorization. - for i := 0; i < mn; i++ { - offpi := offset + i - - // Determine ith pivot column and swap if necessary. - p := i + bi.Idamax(n-i, vn1[i:], 1) - if p != i { - bi.Dswap(m, a[p:], lda, a[i:], lda) - jpvt[p], jpvt[i] = jpvt[i], jpvt[p] - vn1[p] = vn1[i] - vn2[p] = vn2[i] - } - - // Generate elementary reflector H_i. - if offpi < m-1 { - a[offpi*lda+i], tau[i] = impl.Dlarfg(m-offpi, a[offpi*lda+i], a[(offpi+1)*lda+i:], lda) - } else { - tau[i] = 0 - } - - if i < n-1 { - // Apply H_iᵀ to A[offset+i:m, i:n] from the left. - aii := a[offpi*lda+i] - a[offpi*lda+i] = 1 - impl.Dlarf(blas.Left, m-offpi, n-i-1, a[offpi*lda+i:], lda, tau[i], a[offpi*lda+i+1:], lda, work) - a[offpi*lda+i] = aii - } - - // Update partial column norms. - for j := i + 1; j < n; j++ { - if vn1[j] == 0 { - continue - } - - // The following marked lines follow from the - // analysis in Lapack Working Note 176. - r := math.Abs(a[offpi*lda+j]) / vn1[j] // * - temp := math.Max(0, 1-r*r) // * - r = vn1[j] / vn2[j] // * - temp2 := temp * r * r // * - if temp2 < tol3z { - var v float64 - if offpi < m-1 { - v = bi.Dnrm2(m-offpi-1, a[(offpi+1)*lda+j:], lda) - } - vn1[j] = v - vn2[j] = v - } else { - vn1[j] *= math.Sqrt(temp) // * - } - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqps.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqps.go deleted file mode 100644 index da1a60e..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqps.go +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright ©2017 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlaqps computes a step of QR factorization with column pivoting -// of an m×n matrix A by using Blas-3. It tries to factorize nb -// columns from A starting from the row offset, and updates all -// of the matrix with Dgemm. -// -// In some cases, due to catastrophic cancellations, it cannot -// factorize nb columns. Hence, the actual number of factorized -// columns is returned in kb. -// -// Dlaqps computes a QR factorization with column pivoting of the -// block A[offset:m, 0:nb] of the m×n matrix A. The block -// A[0:offset, 0:n] is accordingly pivoted, but not factorized. -// -// On exit, the upper triangle of block A[offset:m, 0:kb] is the -// triangular factor obtained. The elements in block A[offset:m, 0:n] -// below the diagonal, together with tau, represent the orthogonal -// matrix Q as a product of elementary reflectors. -// -// offset is number of rows of the matrix A that must be pivoted but -// not factorized. offset must not be negative otherwise Dlaqps will panic. -// -// On exit, jpvt holds the permutation that was applied; the jth column -// of A*P was the jpvt[j] column of A. jpvt must have length n, -// otherwise Dlapqs will panic. -// -// On exit tau holds the scalar factors of the elementary reflectors. -// It must have length nb, otherwise Dlapqs will panic. -// -// vn1 and vn2 hold the partial and complete column norms respectively. -// They must have length n, otherwise Dlapqs will panic. -// -// auxv must have length nb, otherwise Dlaqps will panic. -// -// f and ldf represent an n×nb matrix F that is overwritten during the -// call. -// -// Dlaqps is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlaqps(m, n, offset, nb int, a []float64, lda int, jpvt []int, tau, vn1, vn2, auxv, f []float64, ldf int) (kb int) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case offset < 0: - panic(offsetLT0) - case offset > m: - panic(offsetGTM) - case nb < 0: - panic(nbLT0) - case nb > n: - panic(nbGTN) - case lda < max(1, n): - panic(badLdA) - case ldf < max(1, nb): - panic(badLdF) - } - - if m == 0 || n == 0 { - return 0 - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(jpvt) != n: - panic(badLenJpvt) - case len(vn1) < n: - panic(shortVn1) - case len(vn2) < n: - panic(shortVn2) - } - - if nb == 0 { - return 0 - } - - switch { - case len(tau) < nb: - panic(shortTau) - case len(auxv) < nb: - panic(shortAuxv) - case len(f) < (n-1)*ldf+nb: - panic(shortF) - } - - if offset == m { - return 0 - } - - lastrk := min(m, n+offset) - lsticc := -1 - tol3z := math.Sqrt(dlamchE) - - bi := blas64.Implementation() - - var k, rk int - for ; k < nb && lsticc == -1; k++ { - rk = offset + k - - // Determine kth pivot column and swap if necessary. - p := k + bi.Idamax(n-k, vn1[k:], 1) - if p != k { - bi.Dswap(m, a[p:], lda, a[k:], lda) - bi.Dswap(k, f[p*ldf:], 1, f[k*ldf:], 1) - jpvt[p], jpvt[k] = jpvt[k], jpvt[p] - vn1[p] = vn1[k] - vn2[p] = vn2[k] - } - - // Apply previous Householder reflectors to column K: - // - // A[rk:m, k] = A[rk:m, k] - A[rk:m, 0:k-1]*F[k, 0:k-1]ᵀ. - if k > 0 { - bi.Dgemv(blas.NoTrans, m-rk, k, -1, - a[rk*lda:], lda, - f[k*ldf:], 1, - 1, - a[rk*lda+k:], lda) - } - - // Generate elementary reflector H_k. - if rk < m-1 { - a[rk*lda+k], tau[k] = impl.Dlarfg(m-rk, a[rk*lda+k], a[(rk+1)*lda+k:], lda) - } else { - tau[k] = 0 - } - - akk := a[rk*lda+k] - a[rk*lda+k] = 1 - - // Compute kth column of F: - // - // Compute F[k+1:n, k] = tau[k]*A[rk:m, k+1:n]ᵀ*A[rk:m, k]. - if k < n-1 { - bi.Dgemv(blas.Trans, m-rk, n-k-1, tau[k], - a[rk*lda+k+1:], lda, - a[rk*lda+k:], lda, - 0, - f[(k+1)*ldf+k:], ldf) - } - - // Padding F[0:k, k] with zeros. - for j := 0; j < k; j++ { - f[j*ldf+k] = 0 - } - - // Incremental updating of F: - // - // F[0:n, k] := F[0:n, k] - tau[k]*F[0:n, 0:k-1]*A[rk:m, 0:k-1]ᵀ*A[rk:m,k]. - if k > 0 { - bi.Dgemv(blas.Trans, m-rk, k, -tau[k], - a[rk*lda:], lda, - a[rk*lda+k:], lda, - 0, - auxv, 1) - bi.Dgemv(blas.NoTrans, n, k, 1, - f, ldf, - auxv, 1, - 1, - f[k:], ldf) - } - - // Update the current row of A: - // - // A[rk, k+1:n] = A[rk, k+1:n] - A[rk, 0:k]*F[k+1:n, 0:k]ᵀ. - if k < n-1 { - bi.Dgemv(blas.NoTrans, n-k-1, k+1, -1, - f[(k+1)*ldf:], ldf, - a[rk*lda:], 1, - 1, - a[rk*lda+k+1:], 1) - } - - // Update partial column norms. - if rk < lastrk-1 { - for j := k + 1; j < n; j++ { - if vn1[j] == 0 { - continue - } - - // The following marked lines follow from the - // analysis in Lapack Working Note 176. - r := math.Abs(a[rk*lda+j]) / vn1[j] // * - temp := math.Max(0, 1-r*r) // * - r = vn1[j] / vn2[j] // * - temp2 := temp * r * r // * - if temp2 < tol3z { - // vn2 is used here as a collection of - // indices into vn2 and also a collection - // of column norms. - vn2[j] = float64(lsticc) - lsticc = j - } else { - vn1[j] *= math.Sqrt(temp) // * - } - } - } - - a[rk*lda+k] = akk - } - kb = k - rk = offset + kb - - // Apply the block reflector to the rest of the matrix: - // - // A[offset+kb+1:m, kb+1:n] := A[offset+kb+1:m, kb+1:n] - A[offset+kb+1:m, 1:kb]*F[kb+1:n, 1:kb]ᵀ. - if kb < min(n, m-offset) { - bi.Dgemm(blas.NoTrans, blas.Trans, - m-rk, n-kb, kb, -1, - a[rk*lda:], lda, - f[kb*ldf:], ldf, - 1, - a[rk*lda+kb:], lda) - } - - // Recomputation of difficult columns. - for lsticc >= 0 { - itemp := int(vn2[lsticc]) - - // NOTE: The computation of vn1[lsticc] relies on the fact that - // Dnrm2 does not fail on vectors with norm below the value of - // sqrt(dlamchS) - v := bi.Dnrm2(m-rk, a[rk*lda+lsticc:], lda) - vn1[lsticc] = v - vn2[lsticc] = v - - lsticc = itemp - } - - return kb -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr04.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr04.go deleted file mode 100644 index 9a6da40..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr04.go +++ /dev/null @@ -1,478 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" -) - -// Dlaqr04 computes the eigenvalues of a block of an n×n upper Hessenberg matrix -// H, and optionally the matrices T and Z from the Schur decomposition -// H = Z T Zᵀ -// where T is an upper quasi-triangular matrix (the Schur form), and Z is the -// orthogonal matrix of Schur vectors. -// -// wantt indicates whether the full Schur form T is required. If wantt is false, -// then only enough of H will be updated to preserve the eigenvalues. -// -// wantz indicates whether the n×n matrix of Schur vectors Z is required. If it -// is true, the orthogonal similarity transformation will be accumulated into -// Z[iloz:ihiz+1,ilo:ihi+1], otherwise Z will not be referenced. -// -// ilo and ihi determine the block of H on which Dlaqr04 operates. It must hold that -// 0 <= ilo <= ihi < n if n > 0, -// ilo == 0 and ihi == -1 if n == 0, -// and the block must be isolated, that is, -// ilo == 0 or H[ilo,ilo-1] == 0, -// ihi == n-1 or H[ihi+1,ihi] == 0, -// otherwise Dlaqr04 will panic. -// -// wr and wi must have length ihi+1. -// -// iloz and ihiz specify the rows of Z to which transformations will be applied -// if wantz is true. It must hold that -// 0 <= iloz <= ilo, and ihi <= ihiz < n, -// otherwise Dlaqr04 will panic. -// -// work must have length at least lwork and lwork must be -// lwork >= 1 if n <= 11, -// lwork >= n if n > 11, -// otherwise Dlaqr04 will panic. lwork as large as 6*n may be required for -// optimal performance. On return, work[0] will contain the optimal value of -// lwork. -// -// If lwork is -1, instead of performing Dlaqr04, the function only estimates the -// optimal workspace size and stores it into work[0]. Neither h nor z are -// accessed. -// -// recur is the non-negative recursion depth. For recur > 0, Dlaqr04 behaves -// as DLAQR0, for recur == 0 it behaves as DLAQR4. -// -// unconverged indicates whether Dlaqr04 computed all the eigenvalues of H[ilo:ihi+1,ilo:ihi+1]. -// -// If unconverged is zero and wantt is true, H will contain on return the upper -// quasi-triangular matrix T from the Schur decomposition. 2×2 diagonal blocks -// (corresponding to complex conjugate pairs of eigenvalues) will be returned in -// standard form, with H[i,i] == H[i+1,i+1] and H[i+1,i]*H[i,i+1] < 0. -// -// If unconverged is zero and if wantt is false, the contents of h on return is -// unspecified. -// -// If unconverged is zero, all the eigenvalues have been computed and their real -// and imaginary parts will be stored on return in wr[ilo:ihi+1] and -// wi[ilo:ihi+1], respectively. If two eigenvalues are computed as a complex -// conjugate pair, they are stored in consecutive elements of wr and wi, say the -// i-th and (i+1)th, with wi[i] > 0 and wi[i+1] < 0. If wantt is true, then the -// eigenvalues are stored in the same order as on the diagonal of the Schur form -// returned in H, with wr[i] = H[i,i] and, if H[i:i+2,i:i+2] is a 2×2 diagonal -// block, wi[i] = sqrt(-H[i+1,i]*H[i,i+1]) and wi[i+1] = -wi[i]. -// -// If unconverged is positive, some eigenvalues have not converged, and -// wr[unconverged:ihi+1] and wi[unconverged:ihi+1] will contain those -// eigenvalues which have been successfully computed. Failures are rare. -// -// If unconverged is positive and wantt is true, then on return -// (initial H)*U = U*(final H), (*) -// where U is an orthogonal matrix. The final H is upper Hessenberg and -// H[unconverged:ihi+1,unconverged:ihi+1] is upper quasi-triangular. -// -// If unconverged is positive and wantt is false, on return the remaining -// unconverged eigenvalues are the eigenvalues of the upper Hessenberg matrix -// H[ilo:unconverged,ilo:unconverged]. -// -// If unconverged is positive and wantz is true, then on return -// (final Z) = (initial Z)*U, -// where U is the orthogonal matrix in (*) regardless of the value of wantt. -// -// References: -// [1] K. Braman, R. Byers, R. Mathias. The Multishift QR Algorithm. Part I: -// Maintaining Well-Focused Shifts and Level 3 Performance. SIAM J. Matrix -// Anal. Appl. 23(4) (2002), pp. 929—947 -// URL: http://dx.doi.org/10.1137/S0895479801384573 -// [2] K. Braman, R. Byers, R. Mathias. The Multishift QR Algorithm. Part II: -// Aggressive Early Deflation. SIAM J. Matrix Anal. Appl. 23(4) (2002), pp. 948—973 -// URL: http://dx.doi.org/10.1137/S0895479801384585 -// -// Dlaqr04 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlaqr04(wantt, wantz bool, n, ilo, ihi int, h []float64, ldh int, wr, wi []float64, iloz, ihiz int, z []float64, ldz int, work []float64, lwork int, recur int) (unconverged int) { - const ( - // Matrices of order ntiny or smaller must be processed by - // Dlahqr because of insufficient subdiagonal scratch space. - // This is a hard limit. - ntiny = 11 - // Exceptional deflation windows: try to cure rare slow - // convergence by varying the size of the deflation window after - // kexnw iterations. - kexnw = 5 - // Exceptional shifts: try to cure rare slow convergence with - // ad-hoc exceptional shifts every kexsh iterations. - kexsh = 6 - - // See https://github.com/gonum/lapack/pull/151#discussion_r68162802 - // and the surrounding discussion for an explanation where these - // constants come from. - // TODO(vladimir-ch): Similar constants for exceptional shifts - // are used also in dlahqr.go. The first constant is different - // there, it is equal to 3. Why? And does it matter? - wilk1 = 0.75 - wilk2 = -0.4375 - ) - - switch { - case n < 0: - panic(nLT0) - case ilo < 0 || max(0, n-1) < ilo: - panic(badIlo) - case ihi < min(ilo, n-1) || n <= ihi: - panic(badIhi) - case ldh < max(1, n): - panic(badLdH) - case wantz && (iloz < 0 || ilo < iloz): - panic(badIloz) - case wantz && (ihiz < ihi || n <= ihiz): - panic(badIhiz) - case ldz < 1, wantz && ldz < n: - panic(badLdZ) - case lwork < 1 && lwork != -1: - panic(badLWork) - // TODO(vladimir-ch): Enable if and when we figure out what the minimum - // necessary lwork value is. Dlaqr04 says that the minimum is n which - // clashes with Dlaqr23's opinion about optimal work when nw <= 2 - // (independent of n). - // case lwork < n && n > ntiny && lwork != -1: - // panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - case recur < 0: - panic(recurLT0) - } - - // Quick return. - if n == 0 { - work[0] = 1 - return 0 - } - - if lwork != -1 { - switch { - case len(h) < (n-1)*ldh+n: - panic(shortH) - case len(wr) != ihi+1: - panic(badLenWr) - case len(wi) != ihi+1: - panic(badLenWi) - case wantz && len(z) < (n-1)*ldz+n: - panic(shortZ) - case ilo > 0 && h[ilo*ldh+ilo-1] != 0: - panic(notIsolated) - case ihi+1 < n && h[(ihi+1)*ldh+ihi] != 0: - panic(notIsolated) - } - } - - if n <= ntiny { - // Tiny matrices must use Dlahqr. - if lwork == -1 { - work[0] = 1 - return 0 - } - return impl.Dlahqr(wantt, wantz, n, ilo, ihi, h, ldh, wr, wi, iloz, ihiz, z, ldz) - } - - // Use small bulge multi-shift QR with aggressive early deflation on - // larger-than-tiny matrices. - var jbcmpz string - if wantt { - jbcmpz = "S" - } else { - jbcmpz = "E" - } - if wantz { - jbcmpz += "V" - } else { - jbcmpz += "N" - } - - var fname string - if recur > 0 { - fname = "DLAQR0" - } else { - fname = "DLAQR4" - } - // nwr is the recommended deflation window size. n is greater than 11, - // so there is enough subdiagonal workspace for nwr >= 2 as required. - // (In fact, there is enough subdiagonal space for nwr >= 3.) - // TODO(vladimir-ch): If there is enough space for nwr >= 3, should we - // use it? - nwr := impl.Ilaenv(13, fname, jbcmpz, n, ilo, ihi, lwork) - nwr = max(2, nwr) - nwr = min(ihi-ilo+1, min((n-1)/3, nwr)) - - // nsr is the recommended number of simultaneous shifts. n is greater - // than 11, so there is enough subdiagonal workspace for nsr to be even - // and greater than or equal to two as required. - nsr := impl.Ilaenv(15, fname, jbcmpz, n, ilo, ihi, lwork) - nsr = min(nsr, min((n+6)/9, ihi-ilo)) - nsr = max(2, nsr&^1) - - // Workspace query call to Dlaqr23. - impl.Dlaqr23(wantt, wantz, n, ilo, ihi, nwr+1, h, ldh, iloz, ihiz, z, ldz, - wr, wi, h, ldh, n, h, ldh, n, h, ldh, work, -1, recur) - // Optimal workspace is max(Dlaqr5, Dlaqr23). - lwkopt := max(3*nsr/2, int(work[0])) - // Quick return in case of workspace query. - if lwork == -1 { - work[0] = float64(lwkopt) - return 0 - } - - // Dlahqr/Dlaqr04 crossover point. - nmin := impl.Ilaenv(12, fname, jbcmpz, n, ilo, ihi, lwork) - nmin = max(ntiny, nmin) - - // Nibble determines when to skip a multi-shift QR sweep (Dlaqr5). - nibble := impl.Ilaenv(14, fname, jbcmpz, n, ilo, ihi, lwork) - nibble = max(0, nibble) - - // Computation mode of far-from-diagonal orthogonal updates in Dlaqr5. - kacc22 := impl.Ilaenv(16, fname, jbcmpz, n, ilo, ihi, lwork) - kacc22 = max(0, min(kacc22, 2)) - - // nwmax is the largest possible deflation window for which there is - // sufficient workspace. - nwmax := min((n-1)/3, lwork/2) - nw := nwmax // Start with maximum deflation window size. - - // nsmax is the largest number of simultaneous shifts for which there is - // sufficient workspace. - nsmax := min((n+6)/9, 2*lwork/3) &^ 1 - - ndfl := 1 // Number of iterations since last deflation. - ndec := 0 // Deflation window size decrement. - - // Main loop. - var ( - itmax = max(30, 2*kexsh) * max(10, (ihi-ilo+1)) - it = 0 - ) - for kbot := ihi; kbot >= ilo; { - if it == itmax { - unconverged = kbot + 1 - break - } - it++ - - // Locate active block. - ktop := ilo - for k := kbot; k >= ilo+1; k-- { - if h[k*ldh+k-1] == 0 { - ktop = k - break - } - } - - // Select deflation window size nw. - // - // Typical Case: - // If possible and advisable, nibble the entire active block. - // If not, use size min(nwr,nwmax) or min(nwr+1,nwmax) - // depending upon which has the smaller corresponding - // subdiagonal entry (a heuristic). - // - // Exceptional Case: - // If there have been no deflations in kexnw or more - // iterations, then vary the deflation window size. At first, - // because larger windows are, in general, more powerful than - // smaller ones, rapidly increase the window to the maximum - // possible. Then, gradually reduce the window size. - nh := kbot - ktop + 1 - nwupbd := min(nh, nwmax) - if ndfl < kexnw { - nw = min(nwupbd, nwr) - } else { - nw = min(nwupbd, 2*nw) - } - if nw < nwmax { - if nw >= nh-1 { - nw = nh - } else { - kwtop := kbot - nw + 1 - if math.Abs(h[kwtop*ldh+kwtop-1]) > math.Abs(h[(kwtop-1)*ldh+kwtop-2]) { - nw++ - } - } - } - if ndfl < kexnw { - ndec = -1 - } else if ndec >= 0 || nw >= nwupbd { - ndec++ - if nw-ndec < 2 { - ndec = 0 - } - nw -= ndec - } - - // Split workspace under the subdiagonal of H into: - // - an nw×nw work array V in the lower left-hand corner, - // - an nw×nhv horizontal work array along the bottom edge (nhv - // must be at least nw but more is better), - // - an nve×nw vertical work array along the left-hand-edge - // (nhv can be any positive integer but more is better). - kv := n - nw - kt := nw - kwv := nw + 1 - nhv := n - kwv - kt - // Aggressive early deflation. - ls, ld := impl.Dlaqr23(wantt, wantz, n, ktop, kbot, nw, - h, ldh, iloz, ihiz, z, ldz, wr[:kbot+1], wi[:kbot+1], - h[kv*ldh:], ldh, nhv, h[kv*ldh+kt:], ldh, nhv, h[kwv*ldh:], ldh, work, lwork, recur) - - // Adjust kbot accounting for new deflations. - kbot -= ld - // ks points to the shifts. - ks := kbot - ls + 1 - - // Skip an expensive QR sweep if there is a (partly heuristic) - // reason to expect that many eigenvalues will deflate without - // it. Here, the QR sweep is skipped if many eigenvalues have - // just been deflated or if the remaining active block is small. - if ld > 0 && (100*ld > nw*nibble || kbot-ktop+1 <= min(nmin, nwmax)) { - // ld is positive, note progress. - ndfl = 1 - continue - } - - // ns is the nominal number of simultaneous shifts. This may be - // lowered (slightly) if Dlaqr23 did not provide that many - // shifts. - ns := min(min(nsmax, nsr), max(2, kbot-ktop)) &^ 1 - - // If there have been no deflations in a multiple of kexsh - // iterations, then try exceptional shifts. Otherwise use shifts - // provided by Dlaqr23 above or from the eigenvalues of a - // trailing principal submatrix. - if ndfl%kexsh == 0 { - ks = kbot - ns + 1 - for i := kbot; i > max(ks, ktop+1); i -= 2 { - ss := math.Abs(h[i*ldh+i-1]) + math.Abs(h[(i-1)*ldh+i-2]) - aa := wilk1*ss + h[i*ldh+i] - _, _, _, _, wr[i-1], wi[i-1], wr[i], wi[i], _, _ = - impl.Dlanv2(aa, ss, wilk2*ss, aa) - } - if ks == ktop { - wr[ks+1] = h[(ks+1)*ldh+ks+1] - wi[ks+1] = 0 - wr[ks] = wr[ks+1] - wi[ks] = wi[ks+1] - } - } else { - // If we got ns/2 or fewer shifts, use Dlahqr or recur - // into Dlaqr04 on a trailing principal submatrix to get - // more. Since ns <= nsmax <=(n+6)/9, there is enough - // space below the subdiagonal to fit an ns×ns scratch - // array. - if kbot-ks+1 <= ns/2 { - ks = kbot - ns + 1 - kt = n - ns - impl.Dlacpy(blas.All, ns, ns, h[ks*ldh+ks:], ldh, h[kt*ldh:], ldh) - if ns > nmin && recur > 0 { - ks += impl.Dlaqr04(false, false, ns, 1, ns-1, h[kt*ldh:], ldh, - wr[ks:ks+ns], wi[ks:ks+ns], 0, 0, nil, 0, work, lwork, recur-1) - } else { - ks += impl.Dlahqr(false, false, ns, 0, ns-1, h[kt*ldh:], ldh, - wr[ks:ks+ns], wi[ks:ks+ns], 0, 0, nil, 1) - } - // In case of a rare QR failure use eigenvalues - // of the trailing 2×2 principal submatrix. - if ks >= kbot { - aa := h[(kbot-1)*ldh+kbot-1] - bb := h[(kbot-1)*ldh+kbot] - cc := h[kbot*ldh+kbot-1] - dd := h[kbot*ldh+kbot] - _, _, _, _, wr[kbot-1], wi[kbot-1], wr[kbot], wi[kbot], _, _ = - impl.Dlanv2(aa, bb, cc, dd) - ks = kbot - 1 - } - } - - if kbot-ks+1 > ns { - // Sorting the shifts helps a little. Bubble - // sort keeps complex conjugate pairs together. - sorted := false - for k := kbot; k > ks; k-- { - if sorted { - break - } - sorted = true - for i := ks; i < k; i++ { - if math.Abs(wr[i])+math.Abs(wi[i]) >= math.Abs(wr[i+1])+math.Abs(wi[i+1]) { - continue - } - sorted = false - wr[i], wr[i+1] = wr[i+1], wr[i] - wi[i], wi[i+1] = wi[i+1], wi[i] - } - } - } - - // Shuffle shifts into pairs of real shifts and pairs of - // complex conjugate shifts using the fact that complex - // conjugate shifts are already adjacent to one another. - // TODO(vladimir-ch): The shuffling here could probably - // be removed but I'm not sure right now and it's safer - // to leave it. - for i := kbot; i > ks+1; i -= 2 { - if wi[i] == -wi[i-1] { - continue - } - wr[i], wr[i-1], wr[i-2] = wr[i-1], wr[i-2], wr[i] - wi[i], wi[i-1], wi[i-2] = wi[i-1], wi[i-2], wi[i] - } - } - - // If there are only two shifts and both are real, then use only one. - if kbot-ks+1 == 2 && wi[kbot] == 0 { - if math.Abs(wr[kbot]-h[kbot*ldh+kbot]) < math.Abs(wr[kbot-1]-h[kbot*ldh+kbot]) { - wr[kbot-1] = wr[kbot] - } else { - wr[kbot] = wr[kbot-1] - } - } - - // Use up to ns of the smallest magnitude shifts. If there - // aren't ns shifts available, then use them all, possibly - // dropping one to make the number of shifts even. - ns = min(ns, kbot-ks+1) &^ 1 - ks = kbot - ns + 1 - - // Split workspace under the subdiagonal into: - // - a kdu×kdu work array U in the lower left-hand-corner, - // - a kdu×nhv horizontal work array WH along the bottom edge - // (nhv must be at least kdu but more is better), - // - an nhv×kdu vertical work array WV along the left-hand-edge - // (nhv must be at least kdu but more is better). - kdu := 3*ns - 3 - ku := n - kdu - kwh := kdu - kwv = kdu + 3 - nhv = n - kwv - kdu - // Small-bulge multi-shift QR sweep. - impl.Dlaqr5(wantt, wantz, kacc22, n, ktop, kbot, ns, - wr[ks:ks+ns], wi[ks:ks+ns], h, ldh, iloz, ihiz, z, ldz, - work, 3, h[ku*ldh:], ldh, nhv, h[kwv*ldh:], ldh, nhv, h[ku*ldh+kwh:], ldh) - - // Note progress (or the lack of it). - if ld > 0 { - ndfl = 1 - } else { - ndfl++ - } - } - - work[0] = float64(lwkopt) - return unconverged -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr1.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr1.go deleted file mode 100644 index e21373b..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr1.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import "math" - -// Dlaqr1 sets v to a scalar multiple of the first column of the product -// (H - (sr1 + i*si1)*I)*(H - (sr2 + i*si2)*I) -// where H is a 2×2 or 3×3 matrix, I is the identity matrix of the same size, -// and i is the imaginary unit. Scaling is done to avoid overflows and most -// underflows. -// -// n is the order of H and must be either 2 or 3. It must hold that either sr1 = -// sr2 and si1 = -si2, or si1 = si2 = 0. The length of v must be equal to n. If -// any of these conditions is not met, Dlaqr1 will panic. -// -// Dlaqr1 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlaqr1(n int, h []float64, ldh int, sr1, si1, sr2, si2 float64, v []float64) { - switch { - case n != 2 && n != 3: - panic("lapack: n must be 2 or 3") - case ldh < n: - panic(badLdH) - case len(h) < (n-1)*ldh+n: - panic(shortH) - case !((sr1 == sr2 && si1 == -si2) || (si1 == 0 && si2 == 0)): - panic(badShifts) - case len(v) != n: - panic(shortV) - } - - if n == 2 { - s := math.Abs(h[0]-sr2) + math.Abs(si2) + math.Abs(h[ldh]) - if s == 0 { - v[0] = 0 - v[1] = 0 - } else { - h21s := h[ldh] / s - v[0] = h21s*h[1] + (h[0]-sr1)*((h[0]-sr2)/s) - si1*(si2/s) - v[1] = h21s * (h[0] + h[ldh+1] - sr1 - sr2) - } - return - } - - s := math.Abs(h[0]-sr2) + math.Abs(si2) + math.Abs(h[ldh]) + math.Abs(h[2*ldh]) - if s == 0 { - v[0] = 0 - v[1] = 0 - v[2] = 0 - } else { - h21s := h[ldh] / s - h31s := h[2*ldh] / s - v[0] = (h[0]-sr1)*((h[0]-sr2)/s) - si1*(si2/s) + h[1]*h21s + h[2]*h31s - v[1] = h21s*(h[0]+h[ldh+1]-sr1-sr2) + h[ldh+2]*h31s - v[2] = h31s*(h[0]+h[2*ldh+2]-sr1-sr2) + h21s*h[2*ldh+1] - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr23.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr23.go deleted file mode 100644 index 58af1e6..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr23.go +++ /dev/null @@ -1,415 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dlaqr23 performs the orthogonal similarity transformation of an n×n upper -// Hessenberg matrix to detect and deflate fully converged eigenvalues from a -// trailing principal submatrix using aggressive early deflation [1]. -// -// On return, H will be overwritten by a new Hessenberg matrix that is a -// perturbation of an orthogonal similarity transformation of H. It is hoped -// that on output H will have many zero subdiagonal entries. -// -// If wantt is true, the matrix H will be fully updated so that the -// quasi-triangular Schur factor can be computed. If wantt is false, then only -// enough of H will be updated to preserve the eigenvalues. -// -// If wantz is true, the orthogonal similarity transformation will be -// accumulated into Z[iloz:ihiz+1,ktop:kbot+1], otherwise Z is not referenced. -// -// ktop and kbot determine a block [ktop:kbot+1,ktop:kbot+1] along the diagonal -// of H. It must hold that -// 0 <= ilo <= ihi < n if n > 0, -// ilo == 0 and ihi == -1 if n == 0, -// and the block must be isolated, that is, it must hold that -// ktop == 0 or H[ktop,ktop-1] == 0, -// kbot == n-1 or H[kbot+1,kbot] == 0, -// otherwise Dlaqr23 will panic. -// -// nw is the deflation window size. It must hold that -// 0 <= nw <= kbot-ktop+1, -// otherwise Dlaqr23 will panic. -// -// iloz and ihiz specify the rows of the n×n matrix Z to which transformations -// will be applied if wantz is true. It must hold that -// 0 <= iloz <= ktop, and kbot <= ihiz < n, -// otherwise Dlaqr23 will panic. -// -// sr and si must have length kbot+1, otherwise Dlaqr23 will panic. -// -// v and ldv represent an nw×nw work matrix. -// t and ldt represent an nw×nh work matrix, and nh must be at least nw. -// wv and ldwv represent an nv×nw work matrix. -// -// work must have length at least lwork and lwork must be at least max(1,2*nw), -// otherwise Dlaqr23 will panic. Larger values of lwork may result in greater -// efficiency. On return, work[0] will contain the optimal value of lwork. -// -// If lwork is -1, instead of performing Dlaqr23, the function only estimates the -// optimal workspace size and stores it into work[0]. Neither h nor z are -// accessed. -// -// recur is the non-negative recursion depth. For recur > 0, Dlaqr23 behaves -// as DLAQR3, for recur == 0 it behaves as DLAQR2. -// -// On return, ns and nd will contain respectively the number of unconverged -// (i.e., approximate) eigenvalues and converged eigenvalues that are stored in -// sr and si. -// -// On return, the real and imaginary parts of approximate eigenvalues that may -// be used for shifts will be stored respectively in sr[kbot-nd-ns+1:kbot-nd+1] -// and si[kbot-nd-ns+1:kbot-nd+1]. -// -// On return, the real and imaginary parts of converged eigenvalues will be -// stored respectively in sr[kbot-nd+1:kbot+1] and si[kbot-nd+1:kbot+1]. -// -// References: -// [1] K. Braman, R. Byers, R. Mathias. The Multishift QR Algorithm. Part II: -// Aggressive Early Deflation. SIAM J. Matrix Anal. Appl 23(4) (2002), pp. 948—973 -// URL: http://dx.doi.org/10.1137/S0895479801384585 -// -func (impl Implementation) Dlaqr23(wantt, wantz bool, n, ktop, kbot, nw int, h []float64, ldh int, iloz, ihiz int, z []float64, ldz int, sr, si []float64, v []float64, ldv int, nh int, t []float64, ldt int, nv int, wv []float64, ldwv int, work []float64, lwork int, recur int) (ns, nd int) { - switch { - case n < 0: - panic(nLT0) - case ktop < 0 || max(0, n-1) < ktop: - panic(badKtop) - case kbot < min(ktop, n-1) || n <= kbot: - panic(badKbot) - case nw < 0 || kbot-ktop+1+1 < nw: - panic(badNw) - case ldh < max(1, n): - panic(badLdH) - case wantz && (iloz < 0 || ktop < iloz): - panic(badIloz) - case wantz && (ihiz < kbot || n <= ihiz): - panic(badIhiz) - case ldz < 1, wantz && ldz < n: - panic(badLdZ) - case ldv < max(1, nw): - panic(badLdV) - case nh < nw: - panic(badNh) - case ldt < max(1, nh): - panic(badLdT) - case nv < 0: - panic(nvLT0) - case ldwv < max(1, nw): - panic(badLdWV) - case lwork < max(1, 2*nw) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - case recur < 0: - panic(recurLT0) - } - - // Quick return for zero window size. - if nw == 0 { - work[0] = 1 - return 0, 0 - } - - // LAPACK code does not enforce the documented behavior - // nw <= kbot-ktop+1 - // but we do (we panic above). - jw := nw - lwkopt := max(1, 2*nw) - if jw > 2 { - // Workspace query call to Dgehrd. - impl.Dgehrd(jw, 0, jw-2, t, ldt, work, work, -1) - lwk1 := int(work[0]) - // Workspace query call to Dormhr. - impl.Dormhr(blas.Right, blas.NoTrans, jw, jw, 0, jw-2, t, ldt, work, v, ldv, work, -1) - lwk2 := int(work[0]) - if recur > 0 { - // Workspace query call to Dlaqr04. - impl.Dlaqr04(true, true, jw, 0, jw-1, t, ldt, sr, si, 0, jw-1, v, ldv, work, -1, recur-1) - lwk3 := int(work[0]) - // Optimal workspace. - lwkopt = max(jw+max(lwk1, lwk2), lwk3) - } else { - // Optimal workspace. - lwkopt = jw + max(lwk1, lwk2) - } - } - // Quick return in case of workspace query. - if lwork == -1 { - work[0] = float64(lwkopt) - return 0, 0 - } - - // Check input slices only if not doing workspace query. - switch { - case len(h) < (n-1)*ldh+n: - panic(shortH) - case len(v) < (nw-1)*ldv+nw: - panic(shortV) - case len(t) < (nw-1)*ldt+nh: - panic(shortT) - case len(wv) < (nv-1)*ldwv+nw: - panic(shortWV) - case wantz && len(z) < (n-1)*ldz+n: - panic(shortZ) - case len(sr) != kbot+1: - panic(badLenSr) - case len(si) != kbot+1: - panic(badLenSi) - case ktop > 0 && h[ktop*ldh+ktop-1] != 0: - panic(notIsolated) - case kbot+1 < n && h[(kbot+1)*ldh+kbot] != 0: - panic(notIsolated) - } - - // Machine constants. - ulp := dlamchP - smlnum := float64(n) / ulp * dlamchS - - // Setup deflation window. - var s float64 - kwtop := kbot - jw + 1 - if kwtop != ktop { - s = h[kwtop*ldh+kwtop-1] - } - if kwtop == kbot { - // 1×1 deflation window. - sr[kwtop] = h[kwtop*ldh+kwtop] - si[kwtop] = 0 - ns = 1 - nd = 0 - if math.Abs(s) <= math.Max(smlnum, ulp*math.Abs(h[kwtop*ldh+kwtop])) { - ns = 0 - nd = 1 - if kwtop > ktop { - h[kwtop*ldh+kwtop-1] = 0 - } - } - work[0] = 1 - return ns, nd - } - - // Convert to spike-triangular form. In case of a rare QR failure, this - // routine continues to do aggressive early deflation using that part of - // the deflation window that converged using infqr here and there to - // keep track. - impl.Dlacpy(blas.Upper, jw, jw, h[kwtop*ldh+kwtop:], ldh, t, ldt) - bi := blas64.Implementation() - bi.Dcopy(jw-1, h[(kwtop+1)*ldh+kwtop:], ldh+1, t[ldt:], ldt+1) - impl.Dlaset(blas.All, jw, jw, 0, 1, v, ldv) - nmin := impl.Ilaenv(12, "DLAQR3", "SV", jw, 0, jw-1, lwork) - var infqr int - if recur > 0 && jw > nmin { - infqr = impl.Dlaqr04(true, true, jw, 0, jw-1, t, ldt, sr[kwtop:], si[kwtop:], 0, jw-1, v, ldv, work, lwork, recur-1) - } else { - infqr = impl.Dlahqr(true, true, jw, 0, jw-1, t, ldt, sr[kwtop:], si[kwtop:], 0, jw-1, v, ldv) - } - // Note that ilo == 0 which conveniently coincides with the success - // value of infqr, that is, infqr as an index always points to the first - // converged eigenvalue. - - // Dtrexc needs a clean margin near the diagonal. - for j := 0; j < jw-3; j++ { - t[(j+2)*ldt+j] = 0 - t[(j+3)*ldt+j] = 0 - } - if jw >= 3 { - t[(jw-1)*ldt+jw-3] = 0 - } - - ns = jw - ilst := infqr - // Deflation detection loop. - for ilst < ns { - bulge := false - if ns >= 2 { - bulge = t[(ns-1)*ldt+ns-2] != 0 - } - if !bulge { - // Real eigenvalue. - abst := math.Abs(t[(ns-1)*ldt+ns-1]) - if abst == 0 { - abst = math.Abs(s) - } - if math.Abs(s*v[ns-1]) <= math.Max(smlnum, ulp*abst) { - // Deflatable. - ns-- - } else { - // Undeflatable, move it up out of the way. - // Dtrexc can not fail in this case. - _, ilst, _ = impl.Dtrexc(lapack.UpdateSchur, jw, t, ldt, v, ldv, ns-1, ilst, work) - ilst++ - } - continue - } - // Complex conjugate pair. - abst := math.Abs(t[(ns-1)*ldt+ns-1]) + math.Sqrt(math.Abs(t[(ns-1)*ldt+ns-2]))*math.Sqrt(math.Abs(t[(ns-2)*ldt+ns-1])) - if abst == 0 { - abst = math.Abs(s) - } - if math.Max(math.Abs(s*v[ns-1]), math.Abs(s*v[ns-2])) <= math.Max(smlnum, ulp*abst) { - // Deflatable. - ns -= 2 - } else { - // Undeflatable, move them up out of the way. - // Dtrexc does the right thing with ilst in case of a - // rare exchange failure. - _, ilst, _ = impl.Dtrexc(lapack.UpdateSchur, jw, t, ldt, v, ldv, ns-1, ilst, work) - ilst += 2 - } - } - - // Return to Hessenberg form. - if ns == 0 { - s = 0 - } - if ns < jw { - // Sorting diagonal blocks of T improves accuracy for graded - // matrices. Bubble sort deals well with exchange failures. - sorted := false - i := ns - for !sorted { - sorted = true - kend := i - 1 - i = infqr - var k int - if i == ns-1 || t[(i+1)*ldt+i] == 0 { - k = i + 1 - } else { - k = i + 2 - } - for k <= kend { - var evi float64 - if k == i+1 { - evi = math.Abs(t[i*ldt+i]) - } else { - evi = math.Abs(t[i*ldt+i]) + math.Sqrt(math.Abs(t[(i+1)*ldt+i]))*math.Sqrt(math.Abs(t[i*ldt+i+1])) - } - - var evk float64 - if k == kend || t[(k+1)*ldt+k] == 0 { - evk = math.Abs(t[k*ldt+k]) - } else { - evk = math.Abs(t[k*ldt+k]) + math.Sqrt(math.Abs(t[(k+1)*ldt+k]))*math.Sqrt(math.Abs(t[k*ldt+k+1])) - } - - if evi >= evk { - i = k - } else { - sorted = false - _, ilst, ok := impl.Dtrexc(lapack.UpdateSchur, jw, t, ldt, v, ldv, i, k, work) - if ok { - i = ilst - } else { - i = k - } - } - if i == kend || t[(i+1)*ldt+i] == 0 { - k = i + 1 - } else { - k = i + 2 - } - } - } - } - - // Restore shift/eigenvalue array from T. - for i := jw - 1; i >= infqr; { - if i == infqr || t[i*ldt+i-1] == 0 { - sr[kwtop+i] = t[i*ldt+i] - si[kwtop+i] = 0 - i-- - continue - } - aa := t[(i-1)*ldt+i-1] - bb := t[(i-1)*ldt+i] - cc := t[i*ldt+i-1] - dd := t[i*ldt+i] - _, _, _, _, sr[kwtop+i-1], si[kwtop+i-1], sr[kwtop+i], si[kwtop+i], _, _ = impl.Dlanv2(aa, bb, cc, dd) - i -= 2 - } - - if ns < jw || s == 0 { - if ns > 1 && s != 0 { - // Reflect spike back into lower triangle. - bi.Dcopy(ns, v[:ns], 1, work[:ns], 1) - _, tau := impl.Dlarfg(ns, work[0], work[1:ns], 1) - work[0] = 1 - impl.Dlaset(blas.Lower, jw-2, jw-2, 0, 0, t[2*ldt:], ldt) - impl.Dlarf(blas.Left, ns, jw, work[:ns], 1, tau, t, ldt, work[jw:]) - impl.Dlarf(blas.Right, ns, ns, work[:ns], 1, tau, t, ldt, work[jw:]) - impl.Dlarf(blas.Right, jw, ns, work[:ns], 1, tau, v, ldv, work[jw:]) - impl.Dgehrd(jw, 0, ns-1, t, ldt, work[:jw-1], work[jw:], lwork-jw) - } - - // Copy updated reduced window into place. - if kwtop > 0 { - h[kwtop*ldh+kwtop-1] = s * v[0] - } - impl.Dlacpy(blas.Upper, jw, jw, t, ldt, h[kwtop*ldh+kwtop:], ldh) - bi.Dcopy(jw-1, t[ldt:], ldt+1, h[(kwtop+1)*ldh+kwtop:], ldh+1) - - // Accumulate orthogonal matrix in order to update H and Z, if - // requested. - if ns > 1 && s != 0 { - // work[:ns-1] contains the elementary reflectors stored - // by a call to Dgehrd above. - impl.Dormhr(blas.Right, blas.NoTrans, jw, ns, 0, ns-1, - t, ldt, work[:ns-1], v, ldv, work[jw:], lwork-jw) - } - - // Update vertical slab in H. - var ltop int - if !wantt { - ltop = ktop - } - for krow := ltop; krow < kwtop; krow += nv { - kln := min(nv, kwtop-krow) - bi.Dgemm(blas.NoTrans, blas.NoTrans, kln, jw, jw, - 1, h[krow*ldh+kwtop:], ldh, v, ldv, - 0, wv, ldwv) - impl.Dlacpy(blas.All, kln, jw, wv, ldwv, h[krow*ldh+kwtop:], ldh) - } - - // Update horizontal slab in H. - if wantt { - for kcol := kbot + 1; kcol < n; kcol += nh { - kln := min(nh, n-kcol) - bi.Dgemm(blas.Trans, blas.NoTrans, jw, kln, jw, - 1, v, ldv, h[kwtop*ldh+kcol:], ldh, - 0, t, ldt) - impl.Dlacpy(blas.All, jw, kln, t, ldt, h[kwtop*ldh+kcol:], ldh) - } - } - - // Update vertical slab in Z. - if wantz { - for krow := iloz; krow <= ihiz; krow += nv { - kln := min(nv, ihiz-krow+1) - bi.Dgemm(blas.NoTrans, blas.NoTrans, kln, jw, jw, - 1, z[krow*ldz+kwtop:], ldz, v, ldv, - 0, wv, ldwv) - impl.Dlacpy(blas.All, kln, jw, wv, ldwv, z[krow*ldz+kwtop:], ldz) - } - } - } - - // The number of deflations. - nd = jw - ns - // Shifts are converged eigenvalues that could not be deflated. - // Subtracting infqr from the spike length takes care of the case of a - // rare QR failure while calculating eigenvalues of the deflation - // window. - ns -= infqr - work[0] = float64(lwkopt) - return ns, nd -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr5.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr5.go deleted file mode 100644 index 0b0640e..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr5.go +++ /dev/null @@ -1,644 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlaqr5 performs a single small-bulge multi-shift QR sweep on an isolated -// block of a Hessenberg matrix. -// -// wantt and wantz determine whether the quasi-triangular Schur factor and the -// orthogonal Schur factor, respectively, will be computed. -// -// kacc22 specifies the computation mode of far-from-diagonal orthogonal -// updates. Permitted values are: -// 0: Dlaqr5 will not accumulate reflections and will not use matrix-matrix -// multiply to update far-from-diagonal matrix entries. -// 1: Dlaqr5 will accumulate reflections and use matrix-matrix multiply to -// update far-from-diagonal matrix entries. -// 2: Dlaqr5 will accumulate reflections, use matrix-matrix multiply to update -// far-from-diagonal matrix entries, and take advantage of 2×2 block -// structure during matrix multiplies. -// For other values of kacc2 Dlaqr5 will panic. -// -// n is the order of the Hessenberg matrix H. -// -// ktop and kbot are indices of the first and last row and column of an isolated -// diagonal block upon which the QR sweep will be applied. It must hold that -// ktop == 0, or 0 < ktop <= n-1 and H[ktop, ktop-1] == 0, and -// kbot == n-1, or 0 <= kbot < n-1 and H[kbot+1, kbot] == 0, -// otherwise Dlaqr5 will panic. -// -// nshfts is the number of simultaneous shifts. It must be positive and even, -// otherwise Dlaqr5 will panic. -// -// sr and si contain the real and imaginary parts, respectively, of the shifts -// of origin that define the multi-shift QR sweep. On return both slices may be -// reordered by Dlaqr5. Their length must be equal to nshfts, otherwise Dlaqr5 -// will panic. -// -// h and ldh represent the Hessenberg matrix H of size n×n. On return -// multi-shift QR sweep with shifts sr+i*si has been applied to the isolated -// diagonal block in rows and columns ktop through kbot, inclusive. -// -// iloz and ihiz specify the rows of Z to which transformations will be applied -// if wantz is true. It must hold that 0 <= iloz <= ihiz < n, otherwise Dlaqr5 -// will panic. -// -// z and ldz represent the matrix Z of size n×n. If wantz is true, the QR sweep -// orthogonal similarity transformation is accumulated into -// z[iloz:ihiz,iloz:ihiz] from the right, otherwise z not referenced. -// -// v and ldv represent an auxiliary matrix V of size (nshfts/2)×3. Note that V -// is transposed with respect to the reference netlib implementation. -// -// u and ldu represent an auxiliary matrix of size (3*nshfts-3)×(3*nshfts-3). -// -// wh and ldwh represent an auxiliary matrix of size (3*nshfts-3)×nh. -// -// wv and ldwv represent an auxiliary matrix of size nv×(3*nshfts-3). -// -// Dlaqr5 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlaqr5(wantt, wantz bool, kacc22 int, n, ktop, kbot, nshfts int, sr, si []float64, h []float64, ldh int, iloz, ihiz int, z []float64, ldz int, v []float64, ldv int, u []float64, ldu int, nv int, wv []float64, ldwv int, nh int, wh []float64, ldwh int) { - switch { - case kacc22 != 0 && kacc22 != 1 && kacc22 != 2: - panic(badKacc22) - case n < 0: - panic(nLT0) - case ktop < 0 || n <= ktop: - panic(badKtop) - case kbot < 0 || n <= kbot: - panic(badKbot) - - case nshfts < 0: - panic(nshftsLT0) - case nshfts&0x1 != 0: - panic(nshftsOdd) - case len(sr) != nshfts: - panic(badLenSr) - case len(si) != nshfts: - panic(badLenSi) - - case ldh < max(1, n): - panic(badLdH) - case len(h) < (n-1)*ldh+n: - panic(shortH) - - case wantz && ihiz >= n: - panic(badIhiz) - case wantz && iloz < 0 || ihiz < iloz: - panic(badIloz) - case ldz < 1, wantz && ldz < n: - panic(badLdZ) - case wantz && len(z) < (n-1)*ldz+n: - panic(shortZ) - - case ldv < 3: - // V is transposed w.r.t. reference lapack. - panic(badLdV) - case len(v) < (nshfts/2-1)*ldv+3: - panic(shortV) - - case ldu < max(1, 3*nshfts-3): - panic(badLdU) - case len(u) < (3*nshfts-3-1)*ldu+3*nshfts-3: - panic(shortU) - - case nv < 0: - panic(nvLT0) - case ldwv < max(1, 3*nshfts-3): - panic(badLdWV) - case len(wv) < (nv-1)*ldwv+3*nshfts-3: - panic(shortWV) - - case nh < 0: - panic(nhLT0) - case ldwh < max(1, nh): - panic(badLdWH) - case len(wh) < (3*nshfts-3-1)*ldwh+nh: - panic(shortWH) - - case ktop > 0 && h[ktop*ldh+ktop-1] != 0: - panic(notIsolated) - case kbot < n-1 && h[(kbot+1)*ldh+kbot] != 0: - panic(notIsolated) - } - - // If there are no shifts, then there is nothing to do. - if nshfts < 2 { - return - } - // If the active block is empty or 1×1, then there is nothing to do. - if ktop >= kbot { - return - } - - // Shuffle shifts into pairs of real shifts and pairs of complex - // conjugate shifts assuming complex conjugate shifts are already - // adjacent to one another. - for i := 0; i < nshfts-2; i += 2 { - if si[i] == -si[i+1] { - continue - } - sr[i], sr[i+1], sr[i+2] = sr[i+1], sr[i+2], sr[i] - si[i], si[i+1], si[i+2] = si[i+1], si[i+2], si[i] - } - - // Note: lapack says that nshfts must be even but allows it to be odd - // anyway. We panic above if nshfts is not even, so reducing it by one - // is unnecessary. The only caller Dlaqr04 uses only even nshfts. - // - // The original comment and code from lapack-3.6.0/SRC/dlaqr5.f:341: - // * ==== NSHFTS is supposed to be even, but if it is odd, - // * . then simply reduce it by one. The shuffle above - // * . ensures that the dropped shift is real and that - // * . the remaining shifts are paired. ==== - // * - // NS = NSHFTS - MOD( NSHFTS, 2 ) - ns := nshfts - - safmin := dlamchS - ulp := dlamchP - smlnum := safmin * float64(n) / ulp - - // Use accumulated reflections to update far-from-diagonal entries? - accum := kacc22 == 1 || kacc22 == 2 - // If so, exploit the 2×2 block structure? - blk22 := ns > 2 && kacc22 == 2 - - // Clear trash. - if ktop+2 <= kbot { - h[(ktop+2)*ldh+ktop] = 0 - } - - // nbmps = number of 2-shift bulges in the chain. - nbmps := ns / 2 - - // kdu = width of slab. - kdu := 6*nbmps - 3 - - // Create and chase chains of nbmps bulges. - for incol := 3*(1-nbmps) + ktop - 1; incol <= kbot-2; incol += 3*nbmps - 2 { - ndcol := incol + kdu - if accum { - impl.Dlaset(blas.All, kdu, kdu, 0, 1, u, ldu) - } - - // Near-the-diagonal bulge chase. The following loop performs - // the near-the-diagonal part of a small bulge multi-shift QR - // sweep. Each 6*nbmps-2 column diagonal chunk extends from - // column incol to column ndcol (including both column incol and - // column ndcol). The following loop chases a 3*nbmps column - // long chain of nbmps bulges 3*nbmps-2 columns to the right. - // (incol may be less than ktop and ndcol may be greater than - // kbot indicating phantom columns from which to chase bulges - // before they are actually introduced or to which to chase - // bulges beyond column kbot.) - for krcol := incol; krcol <= min(incol+3*nbmps-3, kbot-2); krcol++ { - // Bulges number mtop to mbot are active double implicit - // shift bulges. There may or may not also be small 2×2 - // bulge, if there is room. The inactive bulges (if any) - // must wait until the active bulges have moved down the - // diagonal to make room. The phantom matrix paradigm - // described above helps keep track. - - mtop := max(0, ((ktop-1)-krcol+2)/3) - mbot := min(nbmps, (kbot-krcol)/3) - 1 - m22 := mbot + 1 - bmp22 := (mbot < nbmps-1) && (krcol+3*m22 == kbot-2) - - // Generate reflections to chase the chain right one - // column. (The minimum value of k is ktop-1.) - for m := mtop; m <= mbot; m++ { - k := krcol + 3*m - if k == ktop-1 { - impl.Dlaqr1(3, h[ktop*ldh+ktop:], ldh, - sr[2*m], si[2*m], sr[2*m+1], si[2*m+1], - v[m*ldv:m*ldv+3]) - alpha := v[m*ldv] - _, v[m*ldv] = impl.Dlarfg(3, alpha, v[m*ldv+1:m*ldv+3], 1) - continue - } - beta := h[(k+1)*ldh+k] - v[m*ldv+1] = h[(k+2)*ldh+k] - v[m*ldv+2] = h[(k+3)*ldh+k] - beta, v[m*ldv] = impl.Dlarfg(3, beta, v[m*ldv+1:m*ldv+3], 1) - - // A bulge may collapse because of vigilant deflation or - // destructive underflow. In the underflow case, try the - // two-small-subdiagonals trick to try to reinflate the - // bulge. - if h[(k+3)*ldh+k] != 0 || h[(k+3)*ldh+k+1] != 0 || h[(k+3)*ldh+k+2] == 0 { - // Typical case: not collapsed (yet). - h[(k+1)*ldh+k] = beta - h[(k+2)*ldh+k] = 0 - h[(k+3)*ldh+k] = 0 - continue - } - - // Atypical case: collapsed. Attempt to reintroduce - // ignoring H[k+1,k] and H[k+2,k]. If the fill - // resulting from the new reflector is too large, - // then abandon it. Otherwise, use the new one. - var vt [3]float64 - impl.Dlaqr1(3, h[(k+1)*ldh+k+1:], ldh, sr[2*m], - si[2*m], sr[2*m+1], si[2*m+1], vt[:]) - alpha := vt[0] - _, vt[0] = impl.Dlarfg(3, alpha, vt[1:3], 1) - refsum := vt[0] * (h[(k+1)*ldh+k] + vt[1]*h[(k+2)*ldh+k]) - - dsum := math.Abs(h[k*ldh+k]) + math.Abs(h[(k+1)*ldh+k+1]) + math.Abs(h[(k+2)*ldh+k+2]) - if math.Abs(h[(k+2)*ldh+k]-refsum*vt[1])+math.Abs(refsum*vt[2]) > ulp*dsum { - // Starting a new bulge here would create - // non-negligible fill. Use the old one with - // trepidation. - h[(k+1)*ldh+k] = beta - h[(k+2)*ldh+k] = 0 - h[(k+3)*ldh+k] = 0 - continue - } else { - // Starting a new bulge here would create - // only negligible fill. Replace the old - // reflector with the new one. - h[(k+1)*ldh+k] -= refsum - h[(k+2)*ldh+k] = 0 - h[(k+3)*ldh+k] = 0 - v[m*ldv] = vt[0] - v[m*ldv+1] = vt[1] - v[m*ldv+2] = vt[2] - } - } - - // Generate a 2×2 reflection, if needed. - if bmp22 { - k := krcol + 3*m22 - if k == ktop-1 { - impl.Dlaqr1(2, h[(k+1)*ldh+k+1:], ldh, - sr[2*m22], si[2*m22], sr[2*m22+1], si[2*m22+1], - v[m22*ldv:m22*ldv+2]) - beta := v[m22*ldv] - _, v[m22*ldv] = impl.Dlarfg(2, beta, v[m22*ldv+1:m22*ldv+2], 1) - } else { - beta := h[(k+1)*ldh+k] - v[m22*ldv+1] = h[(k+2)*ldh+k] - beta, v[m22*ldv] = impl.Dlarfg(2, beta, v[m22*ldv+1:m22*ldv+2], 1) - h[(k+1)*ldh+k] = beta - h[(k+2)*ldh+k] = 0 - } - } - - // Multiply H by reflections from the left. - var jbot int - switch { - case accum: - jbot = min(ndcol, kbot) - case wantt: - jbot = n - 1 - default: - jbot = kbot - } - for j := max(ktop, krcol); j <= jbot; j++ { - mend := min(mbot+1, (j-krcol+2)/3) - 1 - for m := mtop; m <= mend; m++ { - k := krcol + 3*m - refsum := v[m*ldv] * (h[(k+1)*ldh+j] + - v[m*ldv+1]*h[(k+2)*ldh+j] + v[m*ldv+2]*h[(k+3)*ldh+j]) - h[(k+1)*ldh+j] -= refsum - h[(k+2)*ldh+j] -= refsum * v[m*ldv+1] - h[(k+3)*ldh+j] -= refsum * v[m*ldv+2] - } - } - if bmp22 { - k := krcol + 3*m22 - for j := max(k+1, ktop); j <= jbot; j++ { - refsum := v[m22*ldv] * (h[(k+1)*ldh+j] + v[m22*ldv+1]*h[(k+2)*ldh+j]) - h[(k+1)*ldh+j] -= refsum - h[(k+2)*ldh+j] -= refsum * v[m22*ldv+1] - } - } - - // Multiply H by reflections from the right. Delay filling in the last row - // until the vigilant deflation check is complete. - var jtop int - switch { - case accum: - jtop = max(ktop, incol) - case wantt: - jtop = 0 - default: - jtop = ktop - } - for m := mtop; m <= mbot; m++ { - if v[m*ldv] == 0 { - continue - } - k := krcol + 3*m - for j := jtop; j <= min(kbot, k+3); j++ { - refsum := v[m*ldv] * (h[j*ldh+k+1] + - v[m*ldv+1]*h[j*ldh+k+2] + v[m*ldv+2]*h[j*ldh+k+3]) - h[j*ldh+k+1] -= refsum - h[j*ldh+k+2] -= refsum * v[m*ldv+1] - h[j*ldh+k+3] -= refsum * v[m*ldv+2] - } - if accum { - // Accumulate U. (If necessary, update Z later with an - // efficient matrix-matrix multiply.) - kms := k - incol - for j := max(0, ktop-incol-1); j < kdu; j++ { - refsum := v[m*ldv] * (u[j*ldu+kms] + - v[m*ldv+1]*u[j*ldu+kms+1] + v[m*ldv+2]*u[j*ldu+kms+2]) - u[j*ldu+kms] -= refsum - u[j*ldu+kms+1] -= refsum * v[m*ldv+1] - u[j*ldu+kms+2] -= refsum * v[m*ldv+2] - } - } else if wantz { - // U is not accumulated, so update Z now by multiplying by - // reflections from the right. - for j := iloz; j <= ihiz; j++ { - refsum := v[m*ldv] * (z[j*ldz+k+1] + - v[m*ldv+1]*z[j*ldz+k+2] + v[m*ldv+2]*z[j*ldz+k+3]) - z[j*ldz+k+1] -= refsum - z[j*ldz+k+2] -= refsum * v[m*ldv+1] - z[j*ldz+k+3] -= refsum * v[m*ldv+2] - } - } - } - - // Special case: 2×2 reflection (if needed). - if bmp22 && v[m22*ldv] != 0 { - k := krcol + 3*m22 - for j := jtop; j <= min(kbot, k+3); j++ { - refsum := v[m22*ldv] * (h[j*ldh+k+1] + v[m22*ldv+1]*h[j*ldh+k+2]) - h[j*ldh+k+1] -= refsum - h[j*ldh+k+2] -= refsum * v[m22*ldv+1] - } - if accum { - kms := k - incol - for j := max(0, ktop-incol-1); j < kdu; j++ { - refsum := v[m22*ldv] * (u[j*ldu+kms] + v[m22*ldv+1]*u[j*ldu+kms+1]) - u[j*ldu+kms] -= refsum - u[j*ldu+kms+1] -= refsum * v[m22*ldv+1] - } - } else if wantz { - for j := iloz; j <= ihiz; j++ { - refsum := v[m22*ldv] * (z[j*ldz+k+1] + v[m22*ldv+1]*z[j*ldz+k+2]) - z[j*ldz+k+1] -= refsum - z[j*ldz+k+2] -= refsum * v[m22*ldv+1] - } - } - } - - // Vigilant deflation check. - mstart := mtop - if krcol+3*mstart < ktop { - mstart++ - } - mend := mbot - if bmp22 { - mend++ - } - if krcol == kbot-2 { - mend++ - } - for m := mstart; m <= mend; m++ { - k := min(kbot-1, krcol+3*m) - - // The following convergence test requires that the tradition - // small-compared-to-nearby-diagonals criterion and the Ahues & - // Tisseur (LAWN 122, 1997) criteria both be satisfied. The latter - // improves accuracy in some examples. Falling back on an alternate - // convergence criterion when tst1 or tst2 is zero (as done here) is - // traditional but probably unnecessary. - - if h[(k+1)*ldh+k] == 0 { - continue - } - tst1 := math.Abs(h[k*ldh+k]) + math.Abs(h[(k+1)*ldh+k+1]) - if tst1 == 0 { - if k >= ktop+1 { - tst1 += math.Abs(h[k*ldh+k-1]) - } - if k >= ktop+2 { - tst1 += math.Abs(h[k*ldh+k-2]) - } - if k >= ktop+3 { - tst1 += math.Abs(h[k*ldh+k-3]) - } - if k <= kbot-2 { - tst1 += math.Abs(h[(k+2)*ldh+k+1]) - } - if k <= kbot-3 { - tst1 += math.Abs(h[(k+3)*ldh+k+1]) - } - if k <= kbot-4 { - tst1 += math.Abs(h[(k+4)*ldh+k+1]) - } - } - if math.Abs(h[(k+1)*ldh+k]) <= math.Max(smlnum, ulp*tst1) { - h12 := math.Max(math.Abs(h[(k+1)*ldh+k]), math.Abs(h[k*ldh+k+1])) - h21 := math.Min(math.Abs(h[(k+1)*ldh+k]), math.Abs(h[k*ldh+k+1])) - h11 := math.Max(math.Abs(h[(k+1)*ldh+k+1]), math.Abs(h[k*ldh+k]-h[(k+1)*ldh+k+1])) - h22 := math.Min(math.Abs(h[(k+1)*ldh+k+1]), math.Abs(h[k*ldh+k]-h[(k+1)*ldh+k+1])) - scl := h11 + h12 - tst2 := h22 * (h11 / scl) - if tst2 == 0 || h21*(h12/scl) <= math.Max(smlnum, ulp*tst2) { - h[(k+1)*ldh+k] = 0 - } - } - } - - // Fill in the last row of each bulge. - mend = min(nbmps, (kbot-krcol-1)/3) - 1 - for m := mtop; m <= mend; m++ { - k := krcol + 3*m - refsum := v[m*ldv] * v[m*ldv+2] * h[(k+4)*ldh+k+3] - h[(k+4)*ldh+k+1] = -refsum - h[(k+4)*ldh+k+2] = -refsum * v[m*ldv+1] - h[(k+4)*ldh+k+3] -= refsum * v[m*ldv+2] - } - } - - // Use U (if accumulated) to update far-from-diagonal entries in H. - // If required, use U to update Z as well. - if !accum { - continue - } - var jtop, jbot int - if wantt { - jtop = 0 - jbot = n - 1 - } else { - jtop = ktop - jbot = kbot - } - bi := blas64.Implementation() - if !blk22 || incol < ktop || kbot < ndcol || ns <= 2 { - // Updates not exploiting the 2×2 block structure of U. k0 and nu keep track - // of the location and size of U in the special cases of introducing bulges - // and chasing bulges off the bottom. In these special cases and in case the - // number of shifts is ns = 2, there is no 2×2 block structure to exploit. - - k0 := max(0, ktop-incol-1) - nu := kdu - max(0, ndcol-kbot) - k0 - - // Horizontal multiply. - for jcol := min(ndcol, kbot) + 1; jcol <= jbot; jcol += nh { - jlen := min(nh, jbot-jcol+1) - bi.Dgemm(blas.Trans, blas.NoTrans, nu, jlen, nu, - 1, u[k0*ldu+k0:], ldu, - h[(incol+k0+1)*ldh+jcol:], ldh, - 0, wh, ldwh) - impl.Dlacpy(blas.All, nu, jlen, wh, ldwh, h[(incol+k0+1)*ldh+jcol:], ldh) - } - - // Vertical multiply. - for jrow := jtop; jrow <= max(ktop, incol)-1; jrow += nv { - jlen := min(nv, max(ktop, incol)-jrow) - bi.Dgemm(blas.NoTrans, blas.NoTrans, jlen, nu, nu, - 1, h[jrow*ldh+incol+k0+1:], ldh, - u[k0*ldu+k0:], ldu, - 0, wv, ldwv) - impl.Dlacpy(blas.All, jlen, nu, wv, ldwv, h[jrow*ldh+incol+k0+1:], ldh) - } - - // Z multiply (also vertical). - if wantz { - for jrow := iloz; jrow <= ihiz; jrow += nv { - jlen := min(nv, ihiz-jrow+1) - bi.Dgemm(blas.NoTrans, blas.NoTrans, jlen, nu, nu, - 1, z[jrow*ldz+incol+k0+1:], ldz, - u[k0*ldu+k0:], ldu, - 0, wv, ldwv) - impl.Dlacpy(blas.All, jlen, nu, wv, ldwv, z[jrow*ldz+incol+k0+1:], ldz) - } - } - - continue - } - - // Updates exploiting U's 2×2 block structure. - - // i2, i4, j2, j4 are the last rows and columns of the blocks. - i2 := (kdu + 1) / 2 - i4 := kdu - j2 := i4 - i2 - j4 := kdu - - // kzs and knz deal with the band of zeros along the diagonal of one of the - // triangular blocks. - kzs := (j4 - j2) - (ns + 1) - knz := ns + 1 - - // Horizontal multiply. - for jcol := min(ndcol, kbot) + 1; jcol <= jbot; jcol += nh { - jlen := min(nh, jbot-jcol+1) - - // Copy bottom of H to top+kzs of scratch (the first kzs - // rows get multiplied by zero). - impl.Dlacpy(blas.All, knz, jlen, h[(incol+1+j2)*ldh+jcol:], ldh, wh[kzs*ldwh:], ldwh) - - // Multiply by U21ᵀ. - impl.Dlaset(blas.All, kzs, jlen, 0, 0, wh, ldwh) - bi.Dtrmm(blas.Left, blas.Upper, blas.Trans, blas.NonUnit, knz, jlen, - 1, u[j2*ldu+kzs:], ldu, wh[kzs*ldwh:], ldwh) - - // Multiply top of H by U11ᵀ. - bi.Dgemm(blas.Trans, blas.NoTrans, i2, jlen, j2, - 1, u, ldu, h[(incol+1)*ldh+jcol:], ldh, - 1, wh, ldwh) - - // Copy top of H to bottom of WH. - impl.Dlacpy(blas.All, j2, jlen, h[(incol+1)*ldh+jcol:], ldh, wh[i2*ldwh:], ldwh) - - // Multiply by U21ᵀ. - bi.Dtrmm(blas.Left, blas.Lower, blas.Trans, blas.NonUnit, j2, jlen, - 1, u[i2:], ldu, wh[i2*ldwh:], ldwh) - - // Multiply by U22. - bi.Dgemm(blas.Trans, blas.NoTrans, i4-i2, jlen, j4-j2, - 1, u[j2*ldu+i2:], ldu, h[(incol+1+j2)*ldh+jcol:], ldh, - 1, wh[i2*ldwh:], ldwh) - - // Copy it back. - impl.Dlacpy(blas.All, kdu, jlen, wh, ldwh, h[(incol+1)*ldh+jcol:], ldh) - } - - // Vertical multiply. - for jrow := jtop; jrow <= max(incol, ktop)-1; jrow += nv { - jlen := min(nv, max(incol, ktop)-jrow) - - // Copy right of H to scratch (the first kzs columns get multiplied - // by zero). - impl.Dlacpy(blas.All, jlen, knz, h[jrow*ldh+incol+1+j2:], ldh, wv[kzs:], ldwv) - - // Multiply by U21. - impl.Dlaset(blas.All, jlen, kzs, 0, 0, wv, ldwv) - bi.Dtrmm(blas.Right, blas.Upper, blas.NoTrans, blas.NonUnit, jlen, knz, - 1, u[j2*ldu+kzs:], ldu, wv[kzs:], ldwv) - - // Multiply by U11. - bi.Dgemm(blas.NoTrans, blas.NoTrans, jlen, i2, j2, - 1, h[jrow*ldh+incol+1:], ldh, u, ldu, - 1, wv, ldwv) - - // Copy left of H to right of scratch. - impl.Dlacpy(blas.All, jlen, j2, h[jrow*ldh+incol+1:], ldh, wv[i2:], ldwv) - - // Multiply by U21. - bi.Dtrmm(blas.Right, blas.Lower, blas.NoTrans, blas.NonUnit, jlen, i4-i2, - 1, u[i2:], ldu, wv[i2:], ldwv) - - // Multiply by U22. - bi.Dgemm(blas.NoTrans, blas.NoTrans, jlen, i4-i2, j4-j2, - 1, h[jrow*ldh+incol+1+j2:], ldh, u[j2*ldu+i2:], ldu, - 1, wv[i2:], ldwv) - - // Copy it back. - impl.Dlacpy(blas.All, jlen, kdu, wv, ldwv, h[jrow*ldh+incol+1:], ldh) - } - - if !wantz { - continue - } - // Multiply Z (also vertical). - for jrow := iloz; jrow <= ihiz; jrow += nv { - jlen := min(nv, ihiz-jrow+1) - - // Copy right of Z to left of scratch (first kzs columns get - // multiplied by zero). - impl.Dlacpy(blas.All, jlen, knz, z[jrow*ldz+incol+1+j2:], ldz, wv[kzs:], ldwv) - - // Multiply by U12. - impl.Dlaset(blas.All, jlen, kzs, 0, 0, wv, ldwv) - bi.Dtrmm(blas.Right, blas.Upper, blas.NoTrans, blas.NonUnit, jlen, knz, - 1, u[j2*ldu+kzs:], ldu, wv[kzs:], ldwv) - - // Multiply by U11. - bi.Dgemm(blas.NoTrans, blas.NoTrans, jlen, i2, j2, - 1, z[jrow*ldz+incol+1:], ldz, u, ldu, - 1, wv, ldwv) - - // Copy left of Z to right of scratch. - impl.Dlacpy(blas.All, jlen, j2, z[jrow*ldz+incol+1:], ldz, wv[i2:], ldwv) - - // Multiply by U21. - bi.Dtrmm(blas.Right, blas.Lower, blas.NoTrans, blas.NonUnit, jlen, i4-i2, - 1, u[i2:], ldu, wv[i2:], ldwv) - - // Multiply by U22. - bi.Dgemm(blas.NoTrans, blas.NoTrans, jlen, i4-i2, j4-j2, - 1, z[jrow*ldz+incol+1+j2:], ldz, u[j2*ldu+i2:], ldu, - 1, wv[i2:], ldwv) - - // Copy the result back to Z. - impl.Dlacpy(blas.All, jlen, kdu, wv, ldwv, z[jrow*ldz+incol+1:], ldz) - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarf.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlarf.go deleted file mode 100644 index 0d85182..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarf.go +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlarf applies an elementary reflector H to an m×n matrix C: -// C = H * C if side == blas.Left -// C = C * H if side == blas.Right -// H is represented in the form -// H = I - tau * v * vᵀ -// where tau is a scalar and v is a vector. -// -// work must have length at least m if side == blas.Left and -// at least n if side == blas.Right. -// -// Dlarf is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlarf(side blas.Side, m, n int, v []float64, incv int, tau float64, c []float64, ldc int, work []float64) { - switch { - case side != blas.Left && side != blas.Right: - panic(badSide) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case incv == 0: - panic(zeroIncV) - case ldc < max(1, n): - panic(badLdC) - } - - if m == 0 || n == 0 { - return - } - - applyleft := side == blas.Left - lenV := n - if applyleft { - lenV = m - } - - switch { - case len(v) < 1+(lenV-1)*abs(incv): - panic(shortV) - case len(c) < (m-1)*ldc+n: - panic(shortC) - case (applyleft && len(work) < n) || (!applyleft && len(work) < m): - panic(shortWork) - } - - lastv := -1 // last non-zero element of v - lastc := -1 // last non-zero row/column of C - if tau != 0 { - if applyleft { - lastv = m - 1 - } else { - lastv = n - 1 - } - var i int - if incv > 0 { - i = lastv * incv - } - // Look for the last non-zero row in v. - for lastv >= 0 && v[i] == 0 { - lastv-- - i -= incv - } - if applyleft { - // Scan for the last non-zero column in C[0:lastv, :] - lastc = impl.Iladlc(lastv+1, n, c, ldc) - } else { - // Scan for the last non-zero row in C[:, 0:lastv] - lastc = impl.Iladlr(m, lastv+1, c, ldc) - } - } - if lastv == -1 || lastc == -1 { - return - } - bi := blas64.Implementation() - if applyleft { - // Form H * C - // w[0:lastc+1] = c[1:lastv+1, 1:lastc+1]ᵀ * v[1:lastv+1,1] - bi.Dgemv(blas.Trans, lastv+1, lastc+1, 1, c, ldc, v, incv, 0, work, 1) - // c[0: lastv, 0: lastc] = c[...] - w[0:lastv, 1] * v[1:lastc, 1]ᵀ - bi.Dger(lastv+1, lastc+1, -tau, v, incv, work, 1, c, ldc) - } else { - // Form C * H - // w[0:lastc+1,1] := c[0:lastc+1,0:lastv+1] * v[0:lastv+1,1] - bi.Dgemv(blas.NoTrans, lastc+1, lastv+1, 1, c, ldc, v, incv, 0, work, 1) - // c[0:lastc+1,0:lastv+1] = c[...] - w[0:lastc+1,0] * v[0:lastv+1,0]ᵀ - bi.Dger(lastc+1, lastv+1, -tau, work, 1, v, incv, c, ldc) - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfb.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfb.go deleted file mode 100644 index d3ddc8e..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfb.go +++ /dev/null @@ -1,449 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dlarfb applies a block reflector to a matrix. -// -// In the call to Dlarfb, the mxn c is multiplied by the implicitly defined matrix h as follows: -// c = h * c if side == Left and trans == NoTrans -// c = c * h if side == Right and trans == NoTrans -// c = hᵀ * c if side == Left and trans == Trans -// c = c * hᵀ if side == Right and trans == Trans -// h is a product of elementary reflectors. direct sets the direction of multiplication -// h = h_1 * h_2 * ... * h_k if direct == Forward -// h = h_k * h_k-1 * ... * h_1 if direct == Backward -// The combination of direct and store defines the orientation of the elementary -// reflectors. In all cases the ones on the diagonal are implicitly represented. -// -// If direct == lapack.Forward and store == lapack.ColumnWise -// V = [ 1 ] -// [v1 1 ] -// [v1 v2 1] -// [v1 v2 v3] -// [v1 v2 v3] -// If direct == lapack.Forward and store == lapack.RowWise -// V = [ 1 v1 v1 v1 v1] -// [ 1 v2 v2 v2] -// [ 1 v3 v3] -// If direct == lapack.Backward and store == lapack.ColumnWise -// V = [v1 v2 v3] -// [v1 v2 v3] -// [ 1 v2 v3] -// [ 1 v3] -// [ 1] -// If direct == lapack.Backward and store == lapack.RowWise -// V = [v1 v1 1 ] -// [v2 v2 v2 1 ] -// [v3 v3 v3 v3 1] -// An elementary reflector can be explicitly constructed by extracting the -// corresponding elements of v, placing a 1 where the diagonal would be, and -// placing zeros in the remaining elements. -// -// t is a k×k matrix containing the block reflector, and this function will panic -// if t is not of sufficient size. See Dlarft for more information. -// -// work is a temporary storage matrix with stride ldwork. -// work must be of size at least n×k side == Left and m×k if side == Right, and -// this function will panic if this size is not met. -// -// Dlarfb is an internal routine. It is exported for testing purposes. -func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack.Direct, store lapack.StoreV, m, n, k int, v []float64, ldv int, t []float64, ldt int, c []float64, ldc int, work []float64, ldwork int) { - nv := m - if side == blas.Right { - nv = n - } - switch { - case side != blas.Left && side != blas.Right: - panic(badSide) - case trans != blas.Trans && trans != blas.NoTrans: - panic(badTrans) - case direct != lapack.Forward && direct != lapack.Backward: - panic(badDirect) - case store != lapack.ColumnWise && store != lapack.RowWise: - panic(badStoreV) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case store == lapack.ColumnWise && ldv < max(1, k): - panic(badLdV) - case store == lapack.RowWise && ldv < max(1, nv): - panic(badLdV) - case ldt < max(1, k): - panic(badLdT) - case ldc < max(1, n): - panic(badLdC) - case ldwork < max(1, k): - panic(badLdWork) - } - - if m == 0 || n == 0 { - return - } - - nw := n - if side == blas.Right { - nw = m - } - switch { - case store == lapack.ColumnWise && len(v) < (nv-1)*ldv+k: - panic(shortV) - case store == lapack.RowWise && len(v) < (k-1)*ldv+nv: - panic(shortV) - case len(t) < (k-1)*ldt+k: - panic(shortT) - case len(c) < (m-1)*ldc+n: - panic(shortC) - case len(work) < (nw-1)*ldwork+k: - panic(shortWork) - } - - bi := blas64.Implementation() - - transt := blas.Trans - if trans == blas.Trans { - transt = blas.NoTrans - } - // TODO(btracey): This follows the original Lapack code where the - // elements are copied into the columns of the working array. The - // loops should go in the other direction so the data is written - // into the rows of work so the copy is not strided. A bigger change - // would be to replace work with workᵀ, but benchmarks would be - // needed to see if the change is merited. - if store == lapack.ColumnWise { - if direct == lapack.Forward { - // V1 is the first k rows of C. V2 is the remaining rows. - if side == blas.Left { - // W = Cᵀ V = C1ᵀ V1 + C2ᵀ V2 (stored in work). - - // W = C1. - for j := 0; j < k; j++ { - bi.Dcopy(n, c[j*ldc:], 1, work[j:], ldwork) - } - // W = W * V1. - bi.Dtrmm(blas.Right, blas.Lower, blas.NoTrans, blas.Unit, - n, k, 1, - v, ldv, - work, ldwork) - if m > k { - // W = W + C2ᵀ V2. - bi.Dgemm(blas.Trans, blas.NoTrans, n, k, m-k, - 1, c[k*ldc:], ldc, v[k*ldv:], ldv, - 1, work, ldwork) - } - // W = W * Tᵀ or W * T. - bi.Dtrmm(blas.Right, blas.Upper, transt, blas.NonUnit, n, k, - 1, t, ldt, - work, ldwork) - // C -= V * Wᵀ. - if m > k { - // C2 -= V2 * Wᵀ. - bi.Dgemm(blas.NoTrans, blas.Trans, m-k, n, k, - -1, v[k*ldv:], ldv, work, ldwork, - 1, c[k*ldc:], ldc) - } - // W *= V1ᵀ. - bi.Dtrmm(blas.Right, blas.Lower, blas.Trans, blas.Unit, n, k, - 1, v, ldv, - work, ldwork) - // C1 -= Wᵀ. - // TODO(btracey): This should use blas.Axpy. - for i := 0; i < n; i++ { - for j := 0; j < k; j++ { - c[j*ldc+i] -= work[i*ldwork+j] - } - } - return - } - // Form C = C * H or C * Hᵀ, where C = (C1 C2). - - // W = C1. - for i := 0; i < k; i++ { - bi.Dcopy(m, c[i:], ldc, work[i:], ldwork) - } - // W *= V1. - bi.Dtrmm(blas.Right, blas.Lower, blas.NoTrans, blas.Unit, m, k, - 1, v, ldv, - work, ldwork) - if n > k { - bi.Dgemm(blas.NoTrans, blas.NoTrans, m, k, n-k, - 1, c[k:], ldc, v[k*ldv:], ldv, - 1, work, ldwork) - } - // W *= T or Tᵀ. - bi.Dtrmm(blas.Right, blas.Upper, trans, blas.NonUnit, m, k, - 1, t, ldt, - work, ldwork) - if n > k { - bi.Dgemm(blas.NoTrans, blas.Trans, m, n-k, k, - -1, work, ldwork, v[k*ldv:], ldv, - 1, c[k:], ldc) - } - // C -= W * Vᵀ. - bi.Dtrmm(blas.Right, blas.Lower, blas.Trans, blas.Unit, m, k, - 1, v, ldv, - work, ldwork) - // C -= W. - // TODO(btracey): This should use blas.Axpy. - for i := 0; i < m; i++ { - for j := 0; j < k; j++ { - c[i*ldc+j] -= work[i*ldwork+j] - } - } - return - } - // V = (V1) - // = (V2) (last k rows) - // Where V2 is unit upper triangular. - if side == blas.Left { - // Form H * C or - // W = Cᵀ V. - - // W = C2ᵀ. - for j := 0; j < k; j++ { - bi.Dcopy(n, c[(m-k+j)*ldc:], 1, work[j:], ldwork) - } - // W *= V2. - bi.Dtrmm(blas.Right, blas.Upper, blas.NoTrans, blas.Unit, n, k, - 1, v[(m-k)*ldv:], ldv, - work, ldwork) - if m > k { - // W += C1ᵀ * V1. - bi.Dgemm(blas.Trans, blas.NoTrans, n, k, m-k, - 1, c, ldc, v, ldv, - 1, work, ldwork) - } - // W *= T or Tᵀ. - bi.Dtrmm(blas.Right, blas.Lower, transt, blas.NonUnit, n, k, - 1, t, ldt, - work, ldwork) - // C -= V * Wᵀ. - if m > k { - bi.Dgemm(blas.NoTrans, blas.Trans, m-k, n, k, - -1, v, ldv, work, ldwork, - 1, c, ldc) - } - // W *= V2ᵀ. - bi.Dtrmm(blas.Right, blas.Upper, blas.Trans, blas.Unit, n, k, - 1, v[(m-k)*ldv:], ldv, - work, ldwork) - // C2 -= Wᵀ. - // TODO(btracey): This should use blas.Axpy. - for i := 0; i < n; i++ { - for j := 0; j < k; j++ { - c[(m-k+j)*ldc+i] -= work[i*ldwork+j] - } - } - return - } - // Form C * H or C * Hᵀ where C = (C1 C2). - // W = C * V. - - // W = C2. - for j := 0; j < k; j++ { - bi.Dcopy(m, c[n-k+j:], ldc, work[j:], ldwork) - } - - // W = W * V2. - bi.Dtrmm(blas.Right, blas.Upper, blas.NoTrans, blas.Unit, m, k, - 1, v[(n-k)*ldv:], ldv, - work, ldwork) - if n > k { - bi.Dgemm(blas.NoTrans, blas.NoTrans, m, k, n-k, - 1, c, ldc, v, ldv, - 1, work, ldwork) - } - // W *= T or Tᵀ. - bi.Dtrmm(blas.Right, blas.Lower, trans, blas.NonUnit, m, k, - 1, t, ldt, - work, ldwork) - // C -= W * Vᵀ. - if n > k { - // C1 -= W * V1ᵀ. - bi.Dgemm(blas.NoTrans, blas.Trans, m, n-k, k, - -1, work, ldwork, v, ldv, - 1, c, ldc) - } - // W *= V2ᵀ. - bi.Dtrmm(blas.Right, blas.Upper, blas.Trans, blas.Unit, m, k, - 1, v[(n-k)*ldv:], ldv, - work, ldwork) - // C2 -= W. - // TODO(btracey): This should use blas.Axpy. - for i := 0; i < m; i++ { - for j := 0; j < k; j++ { - c[i*ldc+n-k+j] -= work[i*ldwork+j] - } - } - return - } - // Store = Rowwise. - if direct == lapack.Forward { - // V = (V1 V2) where v1 is unit upper triangular. - if side == blas.Left { - // Form H * C or Hᵀ * C where C = (C1; C2). - // W = Cᵀ * Vᵀ. - - // W = C1ᵀ. - for j := 0; j < k; j++ { - bi.Dcopy(n, c[j*ldc:], 1, work[j:], ldwork) - } - // W *= V1ᵀ. - bi.Dtrmm(blas.Right, blas.Upper, blas.Trans, blas.Unit, n, k, - 1, v, ldv, - work, ldwork) - if m > k { - bi.Dgemm(blas.Trans, blas.Trans, n, k, m-k, - 1, c[k*ldc:], ldc, v[k:], ldv, - 1, work, ldwork) - } - // W *= T or Tᵀ. - bi.Dtrmm(blas.Right, blas.Upper, transt, blas.NonUnit, n, k, - 1, t, ldt, - work, ldwork) - // C -= Vᵀ * Wᵀ. - if m > k { - bi.Dgemm(blas.Trans, blas.Trans, m-k, n, k, - -1, v[k:], ldv, work, ldwork, - 1, c[k*ldc:], ldc) - } - // W *= V1. - bi.Dtrmm(blas.Right, blas.Upper, blas.NoTrans, blas.Unit, n, k, - 1, v, ldv, - work, ldwork) - // C1 -= Wᵀ. - // TODO(btracey): This should use blas.Axpy. - for i := 0; i < n; i++ { - for j := 0; j < k; j++ { - c[j*ldc+i] -= work[i*ldwork+j] - } - } - return - } - // Form C * H or C * Hᵀ where C = (C1 C2). - // W = C * Vᵀ. - - // W = C1. - for j := 0; j < k; j++ { - bi.Dcopy(m, c[j:], ldc, work[j:], ldwork) - } - // W *= V1ᵀ. - bi.Dtrmm(blas.Right, blas.Upper, blas.Trans, blas.Unit, m, k, - 1, v, ldv, - work, ldwork) - if n > k { - bi.Dgemm(blas.NoTrans, blas.Trans, m, k, n-k, - 1, c[k:], ldc, v[k:], ldv, - 1, work, ldwork) - } - // W *= T or Tᵀ. - bi.Dtrmm(blas.Right, blas.Upper, trans, blas.NonUnit, m, k, - 1, t, ldt, - work, ldwork) - // C -= W * V. - if n > k { - bi.Dgemm(blas.NoTrans, blas.NoTrans, m, n-k, k, - -1, work, ldwork, v[k:], ldv, - 1, c[k:], ldc) - } - // W *= V1. - bi.Dtrmm(blas.Right, blas.Upper, blas.NoTrans, blas.Unit, m, k, - 1, v, ldv, - work, ldwork) - // C1 -= W. - // TODO(btracey): This should use blas.Axpy. - for i := 0; i < m; i++ { - for j := 0; j < k; j++ { - c[i*ldc+j] -= work[i*ldwork+j] - } - } - return - } - // V = (V1 V2) where V2 is the last k columns and is lower unit triangular. - if side == blas.Left { - // Form H * C or Hᵀ C where C = (C1 ; C2). - // W = Cᵀ * Vᵀ. - - // W = C2ᵀ. - for j := 0; j < k; j++ { - bi.Dcopy(n, c[(m-k+j)*ldc:], 1, work[j:], ldwork) - } - // W *= V2ᵀ. - bi.Dtrmm(blas.Right, blas.Lower, blas.Trans, blas.Unit, n, k, - 1, v[m-k:], ldv, - work, ldwork) - if m > k { - bi.Dgemm(blas.Trans, blas.Trans, n, k, m-k, - 1, c, ldc, v, ldv, - 1, work, ldwork) - } - // W *= T or Tᵀ. - bi.Dtrmm(blas.Right, blas.Lower, transt, blas.NonUnit, n, k, - 1, t, ldt, - work, ldwork) - // C -= Vᵀ * Wᵀ. - if m > k { - bi.Dgemm(blas.Trans, blas.Trans, m-k, n, k, - -1, v, ldv, work, ldwork, - 1, c, ldc) - } - // W *= V2. - bi.Dtrmm(blas.Right, blas.Lower, blas.NoTrans, blas.Unit, n, k, - 1, v[m-k:], ldv, - work, ldwork) - // C2 -= Wᵀ. - // TODO(btracey): This should use blas.Axpy. - for i := 0; i < n; i++ { - for j := 0; j < k; j++ { - c[(m-k+j)*ldc+i] -= work[i*ldwork+j] - } - } - return - } - // Form C * H or C * Hᵀ where C = (C1 C2). - // W = C * Vᵀ. - // W = C2. - for j := 0; j < k; j++ { - bi.Dcopy(m, c[n-k+j:], ldc, work[j:], ldwork) - } - // W *= V2ᵀ. - bi.Dtrmm(blas.Right, blas.Lower, blas.Trans, blas.Unit, m, k, - 1, v[n-k:], ldv, - work, ldwork) - if n > k { - bi.Dgemm(blas.NoTrans, blas.Trans, m, k, n-k, - 1, c, ldc, v, ldv, - 1, work, ldwork) - } - // W *= T or Tᵀ. - bi.Dtrmm(blas.Right, blas.Lower, trans, blas.NonUnit, m, k, - 1, t, ldt, - work, ldwork) - // C -= W * V. - if n > k { - bi.Dgemm(blas.NoTrans, blas.NoTrans, m, n-k, k, - -1, work, ldwork, v, ldv, - 1, c, ldc) - } - // W *= V2. - bi.Dtrmm(blas.Right, blas.Lower, blas.NoTrans, blas.Unit, m, k, - 1, v[n-k:], ldv, - work, ldwork) - // C1 -= W. - // TODO(btracey): This should use blas.Axpy. - for i := 0; i < m; i++ { - for j := 0; j < k; j++ { - c[i*ldc+n-k+j] -= work[i*ldwork+j] - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfg.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfg.go deleted file mode 100644 index 3f614b0..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfg.go +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlarfg generates an elementary reflector for a Householder matrix. It creates -// a real elementary reflector of order n such that -// H * (alpha) = (beta) -// ( x) ( 0) -// Hᵀ * H = I -// H is represented in the form -// H = 1 - tau * (1; v) * (1 vᵀ) -// where tau is a real scalar. -// -// On entry, x contains the vector x, on exit it contains v. -// -// Dlarfg is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlarfg(n int, alpha float64, x []float64, incX int) (beta, tau float64) { - switch { - case n < 0: - panic(nLT0) - case incX <= 0: - panic(badIncX) - } - - if n <= 1 { - return alpha, 0 - } - - if len(x) < 1+(n-2)*abs(incX) { - panic(shortX) - } - - bi := blas64.Implementation() - - xnorm := bi.Dnrm2(n-1, x, incX) - if xnorm == 0 { - return alpha, 0 - } - beta = -math.Copysign(impl.Dlapy2(alpha, xnorm), alpha) - safmin := dlamchS / dlamchE - knt := 0 - if math.Abs(beta) < safmin { - // xnorm and beta may be inaccurate, scale x and recompute. - rsafmn := 1 / safmin - for { - knt++ - bi.Dscal(n-1, rsafmn, x, incX) - beta *= rsafmn - alpha *= rsafmn - if math.Abs(beta) >= safmin { - break - } - } - xnorm = bi.Dnrm2(n-1, x, incX) - beta = -math.Copysign(impl.Dlapy2(alpha, xnorm), alpha) - } - tau = (beta - alpha) / beta - bi.Dscal(n-1, 1/(alpha-beta), x, incX) - for j := 0; j < knt; j++ { - beta *= safmin - } - return beta, tau -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarft.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlarft.go deleted file mode 100644 index 1d84fb5..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarft.go +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dlarft forms the triangular factor T of a block reflector H, storing the answer -// in t. -// H = I - V * T * Vᵀ if store == lapack.ColumnWise -// H = I - Vᵀ * T * V if store == lapack.RowWise -// H is defined by a product of the elementary reflectors where -// H = H_0 * H_1 * ... * H_{k-1} if direct == lapack.Forward -// H = H_{k-1} * ... * H_1 * H_0 if direct == lapack.Backward -// -// t is a k×k triangular matrix. t is upper triangular if direct = lapack.Forward -// and lower triangular otherwise. This function will panic if t is not of -// sufficient size. -// -// store describes the storage of the elementary reflectors in v. See -// Dlarfb for a description of layout. -// -// tau contains the scalar factors of the elementary reflectors H_i. -// -// Dlarft is an internal routine. It is exported for testing purposes. -func (Implementation) Dlarft(direct lapack.Direct, store lapack.StoreV, n, k int, v []float64, ldv int, tau []float64, t []float64, ldt int) { - mv, nv := n, k - if store == lapack.RowWise { - mv, nv = k, n - } - switch { - case direct != lapack.Forward && direct != lapack.Backward: - panic(badDirect) - case store != lapack.RowWise && store != lapack.ColumnWise: - panic(badStoreV) - case n < 0: - panic(nLT0) - case k < 1: - panic(kLT1) - case ldv < max(1, nv): - panic(badLdV) - case len(tau) < k: - panic(shortTau) - case ldt < max(1, k): - panic(shortT) - } - - if n == 0 { - return - } - - switch { - case len(v) < (mv-1)*ldv+nv: - panic(shortV) - case len(t) < (k-1)*ldt+k: - panic(shortT) - } - - bi := blas64.Implementation() - - // TODO(btracey): There are a number of minor obvious loop optimizations here. - // TODO(btracey): It may be possible to rearrange some of the code so that - // index of 1 is more common in the Dgemv. - if direct == lapack.Forward { - prevlastv := n - 1 - for i := 0; i < k; i++ { - prevlastv = max(i, prevlastv) - if tau[i] == 0 { - for j := 0; j <= i; j++ { - t[j*ldt+i] = 0 - } - continue - } - var lastv int - if store == lapack.ColumnWise { - // skip trailing zeros - for lastv = n - 1; lastv >= i+1; lastv-- { - if v[lastv*ldv+i] != 0 { - break - } - } - for j := 0; j < i; j++ { - t[j*ldt+i] = -tau[i] * v[i*ldv+j] - } - j := min(lastv, prevlastv) - bi.Dgemv(blas.Trans, j-i, i, - -tau[i], v[(i+1)*ldv:], ldv, v[(i+1)*ldv+i:], ldv, - 1, t[i:], ldt) - } else { - for lastv = n - 1; lastv >= i+1; lastv-- { - if v[i*ldv+lastv] != 0 { - break - } - } - for j := 0; j < i; j++ { - t[j*ldt+i] = -tau[i] * v[j*ldv+i] - } - j := min(lastv, prevlastv) - bi.Dgemv(blas.NoTrans, i, j-i, - -tau[i], v[i+1:], ldv, v[i*ldv+i+1:], 1, - 1, t[i:], ldt) - } - bi.Dtrmv(blas.Upper, blas.NoTrans, blas.NonUnit, i, t, ldt, t[i:], ldt) - t[i*ldt+i] = tau[i] - if i > 1 { - prevlastv = max(prevlastv, lastv) - } else { - prevlastv = lastv - } - } - return - } - prevlastv := 0 - for i := k - 1; i >= 0; i-- { - if tau[i] == 0 { - for j := i; j < k; j++ { - t[j*ldt+i] = 0 - } - continue - } - var lastv int - if i < k-1 { - if store == lapack.ColumnWise { - for lastv = 0; lastv < i; lastv++ { - if v[lastv*ldv+i] != 0 { - break - } - } - for j := i + 1; j < k; j++ { - t[j*ldt+i] = -tau[i] * v[(n-k+i)*ldv+j] - } - j := max(lastv, prevlastv) - bi.Dgemv(blas.Trans, n-k+i-j, k-i-1, - -tau[i], v[j*ldv+i+1:], ldv, v[j*ldv+i:], ldv, - 1, t[(i+1)*ldt+i:], ldt) - } else { - for lastv = 0; lastv < i; lastv++ { - if v[i*ldv+lastv] != 0 { - break - } - } - for j := i + 1; j < k; j++ { - t[j*ldt+i] = -tau[i] * v[j*ldv+n-k+i] - } - j := max(lastv, prevlastv) - bi.Dgemv(blas.NoTrans, k-i-1, n-k+i-j, - -tau[i], v[(i+1)*ldv+j:], ldv, v[i*ldv+j:], 1, - 1, t[(i+1)*ldt+i:], ldt) - } - bi.Dtrmv(blas.Lower, blas.NoTrans, blas.NonUnit, k-i-1, - t[(i+1)*ldt+i+1:], ldt, - t[(i+1)*ldt+i:], ldt) - if i > 0 { - prevlastv = min(prevlastv, lastv) - } else { - prevlastv = lastv - } - } - t[i*ldt+i] = tau[i] - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfx.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfx.go deleted file mode 100644 index a018593..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfx.go +++ /dev/null @@ -1,550 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import "gonum.org/v1/gonum/blas" - -// Dlarfx applies an elementary reflector H to a real m×n matrix C, from either -// the left or the right, with loop unrolling when the reflector has order less -// than 11. -// -// H is represented in the form -// H = I - tau * v * vᵀ, -// where tau is a real scalar and v is a real vector. If tau = 0, then H is -// taken to be the identity matrix. -// -// v must have length equal to m if side == blas.Left, and equal to n if side == -// blas.Right, otherwise Dlarfx will panic. -// -// c and ldc represent the m×n matrix C. On return, C is overwritten by the -// matrix H * C if side == blas.Left, or C * H if side == blas.Right. -// -// work must have length at least n if side == blas.Left, and at least m if side -// == blas.Right, otherwise Dlarfx will panic. work is not referenced if H has -// order < 11. -// -// Dlarfx is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlarfx(side blas.Side, m, n int, v []float64, tau float64, c []float64, ldc int, work []float64) { - switch { - case side != blas.Left && side != blas.Right: - panic(badSide) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - nh := m - lwork := n - if side == blas.Right { - nh = n - lwork = m - } - switch { - case len(v) < nh: - panic(shortV) - case len(c) < (m-1)*ldc+n: - panic(shortC) - case nh > 10 && len(work) < lwork: - panic(shortWork) - } - - if tau == 0 { - return - } - - if side == blas.Left { - // Form H * C, where H has order m. - switch m { - default: // Code for general m. - impl.Dlarf(side, m, n, v, 1, tau, c, ldc, work) - return - - case 0: // No-op for zero size matrix. - return - - case 1: // Special code for 1×1 Householder matrix. - t0 := 1 - tau*v[0]*v[0] - for j := 0; j < n; j++ { - c[j] *= t0 - } - return - - case 2: // Special code for 2×2 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - for j := 0; j < n; j++ { - sum := v0*c[j] + v1*c[ldc+j] - c[j] -= sum * t0 - c[ldc+j] -= sum * t1 - } - return - - case 3: // Special code for 3×3 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - for j := 0; j < n; j++ { - sum := v0*c[j] + v1*c[ldc+j] + v2*c[2*ldc+j] - c[j] -= sum * t0 - c[ldc+j] -= sum * t1 - c[2*ldc+j] -= sum * t2 - } - return - - case 4: // Special code for 4×4 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - for j := 0; j < n; j++ { - sum := v0*c[j] + v1*c[ldc+j] + v2*c[2*ldc+j] + v3*c[3*ldc+j] - c[j] -= sum * t0 - c[ldc+j] -= sum * t1 - c[2*ldc+j] -= sum * t2 - c[3*ldc+j] -= sum * t3 - } - return - - case 5: // Special code for 5×5 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - v4 := v[4] - t4 := tau * v4 - for j := 0; j < n; j++ { - sum := v0*c[j] + v1*c[ldc+j] + v2*c[2*ldc+j] + v3*c[3*ldc+j] + v4*c[4*ldc+j] - c[j] -= sum * t0 - c[ldc+j] -= sum * t1 - c[2*ldc+j] -= sum * t2 - c[3*ldc+j] -= sum * t3 - c[4*ldc+j] -= sum * t4 - } - return - - case 6: // Special code for 6×6 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - v4 := v[4] - t4 := tau * v4 - v5 := v[5] - t5 := tau * v5 - for j := 0; j < n; j++ { - sum := v0*c[j] + v1*c[ldc+j] + v2*c[2*ldc+j] + v3*c[3*ldc+j] + v4*c[4*ldc+j] + - v5*c[5*ldc+j] - c[j] -= sum * t0 - c[ldc+j] -= sum * t1 - c[2*ldc+j] -= sum * t2 - c[3*ldc+j] -= sum * t3 - c[4*ldc+j] -= sum * t4 - c[5*ldc+j] -= sum * t5 - } - return - - case 7: // Special code for 7×7 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - v4 := v[4] - t4 := tau * v4 - v5 := v[5] - t5 := tau * v5 - v6 := v[6] - t6 := tau * v6 - for j := 0; j < n; j++ { - sum := v0*c[j] + v1*c[ldc+j] + v2*c[2*ldc+j] + v3*c[3*ldc+j] + v4*c[4*ldc+j] + - v5*c[5*ldc+j] + v6*c[6*ldc+j] - c[j] -= sum * t0 - c[ldc+j] -= sum * t1 - c[2*ldc+j] -= sum * t2 - c[3*ldc+j] -= sum * t3 - c[4*ldc+j] -= sum * t4 - c[5*ldc+j] -= sum * t5 - c[6*ldc+j] -= sum * t6 - } - return - - case 8: // Special code for 8×8 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - v4 := v[4] - t4 := tau * v4 - v5 := v[5] - t5 := tau * v5 - v6 := v[6] - t6 := tau * v6 - v7 := v[7] - t7 := tau * v7 - for j := 0; j < n; j++ { - sum := v0*c[j] + v1*c[ldc+j] + v2*c[2*ldc+j] + v3*c[3*ldc+j] + v4*c[4*ldc+j] + - v5*c[5*ldc+j] + v6*c[6*ldc+j] + v7*c[7*ldc+j] - c[j] -= sum * t0 - c[ldc+j] -= sum * t1 - c[2*ldc+j] -= sum * t2 - c[3*ldc+j] -= sum * t3 - c[4*ldc+j] -= sum * t4 - c[5*ldc+j] -= sum * t5 - c[6*ldc+j] -= sum * t6 - c[7*ldc+j] -= sum * t7 - } - return - - case 9: // Special code for 9×9 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - v4 := v[4] - t4 := tau * v4 - v5 := v[5] - t5 := tau * v5 - v6 := v[6] - t6 := tau * v6 - v7 := v[7] - t7 := tau * v7 - v8 := v[8] - t8 := tau * v8 - for j := 0; j < n; j++ { - sum := v0*c[j] + v1*c[ldc+j] + v2*c[2*ldc+j] + v3*c[3*ldc+j] + v4*c[4*ldc+j] + - v5*c[5*ldc+j] + v6*c[6*ldc+j] + v7*c[7*ldc+j] + v8*c[8*ldc+j] - c[j] -= sum * t0 - c[ldc+j] -= sum * t1 - c[2*ldc+j] -= sum * t2 - c[3*ldc+j] -= sum * t3 - c[4*ldc+j] -= sum * t4 - c[5*ldc+j] -= sum * t5 - c[6*ldc+j] -= sum * t6 - c[7*ldc+j] -= sum * t7 - c[8*ldc+j] -= sum * t8 - } - return - - case 10: // Special code for 10×10 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - v4 := v[4] - t4 := tau * v4 - v5 := v[5] - t5 := tau * v5 - v6 := v[6] - t6 := tau * v6 - v7 := v[7] - t7 := tau * v7 - v8 := v[8] - t8 := tau * v8 - v9 := v[9] - t9 := tau * v9 - for j := 0; j < n; j++ { - sum := v0*c[j] + v1*c[ldc+j] + v2*c[2*ldc+j] + v3*c[3*ldc+j] + v4*c[4*ldc+j] + - v5*c[5*ldc+j] + v6*c[6*ldc+j] + v7*c[7*ldc+j] + v8*c[8*ldc+j] + v9*c[9*ldc+j] - c[j] -= sum * t0 - c[ldc+j] -= sum * t1 - c[2*ldc+j] -= sum * t2 - c[3*ldc+j] -= sum * t3 - c[4*ldc+j] -= sum * t4 - c[5*ldc+j] -= sum * t5 - c[6*ldc+j] -= sum * t6 - c[7*ldc+j] -= sum * t7 - c[8*ldc+j] -= sum * t8 - c[9*ldc+j] -= sum * t9 - } - return - } - } - - // Form C * H, where H has order n. - switch n { - default: // Code for general n. - impl.Dlarf(side, m, n, v, 1, tau, c, ldc, work) - return - - case 0: // No-op for zero size matrix. - return - - case 1: // Special code for 1×1 Householder matrix. - t0 := 1 - tau*v[0]*v[0] - for j := 0; j < m; j++ { - c[j*ldc] *= t0 - } - return - - case 2: // Special code for 2×2 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - for j := 0; j < m; j++ { - cs := c[j*ldc:] - sum := v0*cs[0] + v1*cs[1] - cs[0] -= sum * t0 - cs[1] -= sum * t1 - } - return - - case 3: // Special code for 3×3 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - for j := 0; j < m; j++ { - cs := c[j*ldc:] - sum := v0*cs[0] + v1*cs[1] + v2*cs[2] - cs[0] -= sum * t0 - cs[1] -= sum * t1 - cs[2] -= sum * t2 - } - return - - case 4: // Special code for 4×4 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - for j := 0; j < m; j++ { - cs := c[j*ldc:] - sum := v0*cs[0] + v1*cs[1] + v2*cs[2] + v3*cs[3] - cs[0] -= sum * t0 - cs[1] -= sum * t1 - cs[2] -= sum * t2 - cs[3] -= sum * t3 - } - return - - case 5: // Special code for 5×5 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - v4 := v[4] - t4 := tau * v4 - for j := 0; j < m; j++ { - cs := c[j*ldc:] - sum := v0*cs[0] + v1*cs[1] + v2*cs[2] + v3*cs[3] + v4*cs[4] - cs[0] -= sum * t0 - cs[1] -= sum * t1 - cs[2] -= sum * t2 - cs[3] -= sum * t3 - cs[4] -= sum * t4 - } - return - - case 6: // Special code for 6×6 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - v4 := v[4] - t4 := tau * v4 - v5 := v[5] - t5 := tau * v5 - for j := 0; j < m; j++ { - cs := c[j*ldc:] - sum := v0*cs[0] + v1*cs[1] + v2*cs[2] + v3*cs[3] + v4*cs[4] + v5*cs[5] - cs[0] -= sum * t0 - cs[1] -= sum * t1 - cs[2] -= sum * t2 - cs[3] -= sum * t3 - cs[4] -= sum * t4 - cs[5] -= sum * t5 - } - return - - case 7: // Special code for 7×7 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - v4 := v[4] - t4 := tau * v4 - v5 := v[5] - t5 := tau * v5 - v6 := v[6] - t6 := tau * v6 - for j := 0; j < m; j++ { - cs := c[j*ldc:] - sum := v0*cs[0] + v1*cs[1] + v2*cs[2] + v3*cs[3] + v4*cs[4] + - v5*cs[5] + v6*cs[6] - cs[0] -= sum * t0 - cs[1] -= sum * t1 - cs[2] -= sum * t2 - cs[3] -= sum * t3 - cs[4] -= sum * t4 - cs[5] -= sum * t5 - cs[6] -= sum * t6 - } - return - - case 8: // Special code for 8×8 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - v4 := v[4] - t4 := tau * v4 - v5 := v[5] - t5 := tau * v5 - v6 := v[6] - t6 := tau * v6 - v7 := v[7] - t7 := tau * v7 - for j := 0; j < m; j++ { - cs := c[j*ldc:] - sum := v0*cs[0] + v1*cs[1] + v2*cs[2] + v3*cs[3] + v4*cs[4] + - v5*cs[5] + v6*cs[6] + v7*cs[7] - cs[0] -= sum * t0 - cs[1] -= sum * t1 - cs[2] -= sum * t2 - cs[3] -= sum * t3 - cs[4] -= sum * t4 - cs[5] -= sum * t5 - cs[6] -= sum * t6 - cs[7] -= sum * t7 - } - return - - case 9: // Special code for 9×9 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - v4 := v[4] - t4 := tau * v4 - v5 := v[5] - t5 := tau * v5 - v6 := v[6] - t6 := tau * v6 - v7 := v[7] - t7 := tau * v7 - v8 := v[8] - t8 := tau * v8 - for j := 0; j < m; j++ { - cs := c[j*ldc:] - sum := v0*cs[0] + v1*cs[1] + v2*cs[2] + v3*cs[3] + v4*cs[4] + - v5*cs[5] + v6*cs[6] + v7*cs[7] + v8*cs[8] - cs[0] -= sum * t0 - cs[1] -= sum * t1 - cs[2] -= sum * t2 - cs[3] -= sum * t3 - cs[4] -= sum * t4 - cs[5] -= sum * t5 - cs[6] -= sum * t6 - cs[7] -= sum * t7 - cs[8] -= sum * t8 - } - return - - case 10: // Special code for 10×10 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - v4 := v[4] - t4 := tau * v4 - v5 := v[5] - t5 := tau * v5 - v6 := v[6] - t6 := tau * v6 - v7 := v[7] - t7 := tau * v7 - v8 := v[8] - t8 := tau * v8 - v9 := v[9] - t9 := tau * v9 - for j := 0; j < m; j++ { - cs := c[j*ldc:] - sum := v0*cs[0] + v1*cs[1] + v2*cs[2] + v3*cs[3] + v4*cs[4] + - v5*cs[5] + v6*cs[6] + v7*cs[7] + v8*cs[8] + v9*cs[9] - cs[0] -= sum * t0 - cs[1] -= sum * t1 - cs[2] -= sum * t2 - cs[3] -= sum * t3 - cs[4] -= sum * t4 - cs[5] -= sum * t5 - cs[6] -= sum * t6 - cs[7] -= sum * t7 - cs[8] -= sum * t8 - cs[9] -= sum * t9 - } - return - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlartg.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlartg.go deleted file mode 100644 index ad64546..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlartg.go +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import "math" - -// Dlartg generates a plane rotation so that -// [ cs sn] * [f] = [r] -// [-sn cs] [g] = [0] -// This is a more accurate version of BLAS drotg, with the other differences that -// if g = 0, then cs = 1 and sn = 0, and if f = 0 and g != 0, then cs = 0 and sn = 1. -// If abs(f) > abs(g), cs will be positive. -// -// Dlartg is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlartg(f, g float64) (cs, sn, r float64) { - safmn2 := math.Pow(dlamchB, math.Trunc(math.Log(dlamchS/dlamchE)/math.Log(dlamchB)/2)) - safmx2 := 1 / safmn2 - if g == 0 { - cs = 1 - sn = 0 - r = f - return cs, sn, r - } - if f == 0 { - cs = 0 - sn = 1 - r = g - return cs, sn, r - } - f1 := f - g1 := g - scale := math.Max(math.Abs(f1), math.Abs(g1)) - if scale >= safmx2 { - var count int - for { - count++ - f1 *= safmn2 - g1 *= safmn2 - scale = math.Max(math.Abs(f1), math.Abs(g1)) - if scale < safmx2 { - break - } - } - r = math.Sqrt(f1*f1 + g1*g1) - cs = f1 / r - sn = g1 / r - for i := 0; i < count; i++ { - r *= safmx2 - } - } else if scale <= safmn2 { - var count int - for { - count++ - f1 *= safmx2 - g1 *= safmx2 - scale = math.Max(math.Abs(f1), math.Abs(g1)) - if scale >= safmn2 { - break - } - } - r = math.Sqrt(f1*f1 + g1*g1) - cs = f1 / r - sn = g1 / r - for i := 0; i < count; i++ { - r *= safmn2 - } - } else { - r = math.Sqrt(f1*f1 + g1*g1) - cs = f1 / r - sn = g1 / r - } - if math.Abs(f) > math.Abs(g) && cs < 0 { - cs *= -1 - sn *= -1 - r *= -1 - } - return cs, sn, r -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlas2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlas2.go deleted file mode 100644 index 9922b4a..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlas2.go +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import "math" - -// Dlas2 computes the singular values of the 2×2 matrix defined by -// [F G] -// [0 H] -// The smaller and larger singular values are returned in that order. -// -// Dlas2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlas2(f, g, h float64) (ssmin, ssmax float64) { - fa := math.Abs(f) - ga := math.Abs(g) - ha := math.Abs(h) - fhmin := math.Min(fa, ha) - fhmax := math.Max(fa, ha) - if fhmin == 0 { - if fhmax == 0 { - return 0, ga - } - v := math.Min(fhmax, ga) / math.Max(fhmax, ga) - return 0, math.Max(fhmax, ga) * math.Sqrt(1+v*v) - } - if ga < fhmax { - as := 1 + fhmin/fhmax - at := (fhmax - fhmin) / fhmax - au := (ga / fhmax) * (ga / fhmax) - c := 2 / (math.Sqrt(as*as+au) + math.Sqrt(at*at+au)) - return fhmin * c, fhmax / c - } - au := fhmax / ga - if au == 0 { - return fhmin * fhmax / ga, ga - } - as := 1 + fhmin/fhmax - at := (fhmax - fhmin) / fhmax - c := 1 / (math.Sqrt(1+(as*au)*(as*au)) + math.Sqrt(1+(at*au)*(at*au))) - return 2 * (fhmin * c) * au, ga / (c + c) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlascl.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlascl.go deleted file mode 100644 index 61c4eb7..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlascl.go +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/lapack" -) - -// Dlascl multiplies an m×n matrix by the scalar cto/cfrom. -// -// cfrom must not be zero, and cto and cfrom must not be NaN, otherwise Dlascl -// will panic. -// -// Dlascl is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlascl(kind lapack.MatrixType, kl, ku int, cfrom, cto float64, m, n int, a []float64, lda int) { - switch kind { - default: - panic(badMatrixType) - case 'H', 'B', 'Q', 'Z': // See dlascl.f. - panic("not implemented") - case lapack.General, lapack.UpperTri, lapack.LowerTri: - if lda < max(1, n) { - panic(badLdA) - } - } - switch { - case cfrom == 0: - panic(zeroCFrom) - case math.IsNaN(cfrom): - panic(nanCFrom) - case math.IsNaN(cto): - panic(nanCTo) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - } - - if n == 0 || m == 0 { - return - } - - switch kind { - case lapack.General, lapack.UpperTri, lapack.LowerTri: - if len(a) < (m-1)*lda+n { - panic(shortA) - } - } - - smlnum := dlamchS - bignum := 1 / smlnum - cfromc := cfrom - ctoc := cto - cfrom1 := cfromc * smlnum - for { - var done bool - var mul, ctol float64 - if cfrom1 == cfromc { - // cfromc is inf. - mul = ctoc / cfromc - done = true - ctol = ctoc - } else { - ctol = ctoc / bignum - if ctol == ctoc { - // ctoc is either 0 or inf. - mul = ctoc - done = true - cfromc = 1 - } else if math.Abs(cfrom1) > math.Abs(ctoc) && ctoc != 0 { - mul = smlnum - done = false - cfromc = cfrom1 - } else if math.Abs(ctol) > math.Abs(cfromc) { - mul = bignum - done = false - ctoc = ctol - } else { - mul = ctoc / cfromc - done = true - } - } - switch kind { - case lapack.General: - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - a[i*lda+j] = a[i*lda+j] * mul - } - } - case lapack.UpperTri: - for i := 0; i < m; i++ { - for j := i; j < n; j++ { - a[i*lda+j] = a[i*lda+j] * mul - } - } - case lapack.LowerTri: - for i := 0; i < m; i++ { - for j := 0; j <= min(i, n-1); j++ { - a[i*lda+j] = a[i*lda+j] * mul - } - } - } - if done { - break - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaset.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaset.go deleted file mode 100644 index b8b6b0f..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaset.go +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import "gonum.org/v1/gonum/blas" - -// Dlaset sets the off-diagonal elements of A to alpha, and the diagonal -// elements to beta. If uplo == blas.Upper, only the elements in the upper -// triangular part are set. If uplo == blas.Lower, only the elements in the -// lower triangular part are set. If uplo is otherwise, all of the elements of A -// are set. -// -// Dlaset is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlaset(uplo blas.Uplo, m, n int, alpha, beta float64, a []float64, lda int) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - minmn := min(m, n) - if minmn == 0 { - return - } - - if len(a) < (m-1)*lda+n { - panic(shortA) - } - - switch uplo { - case blas.Upper: - for i := 0; i < m; i++ { - for j := i + 1; j < n; j++ { - a[i*lda+j] = alpha - } - } - case blas.Lower: - for i := 0; i < m; i++ { - for j := 0; j < min(i, n); j++ { - a[i*lda+j] = alpha - } - } - default: - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - a[i*lda+j] = alpha - } - } - } - for i := 0; i < minmn; i++ { - a[i*lda+i] = beta - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq1.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq1.go deleted file mode 100644 index 1f1d1dc..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq1.go +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dlasq1 computes the singular values of an n×n bidiagonal matrix with diagonal -// d and off-diagonal e. On exit, d contains the singular values in decreasing -// order, and e is overwritten. d must have length at least n, e must have -// length at least n-1, and the input work must have length at least 4*n. Dlasq1 -// will panic if these conditions are not met. -// -// Dlasq1 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlasq1(n int, d, e, work []float64) (info int) { - if n < 0 { - panic(nLT0) - } - - if n == 0 { - return info - } - - switch { - case len(d) < n: - panic(shortD) - case len(e) < n-1: - panic(shortE) - case len(work) < 4*n: - panic(shortWork) - } - - if n == 1 { - d[0] = math.Abs(d[0]) - return info - } - - if n == 2 { - d[1], d[0] = impl.Dlas2(d[0], e[0], d[1]) - return info - } - - // Estimate the largest singular value. - var sigmx float64 - for i := 0; i < n-1; i++ { - d[i] = math.Abs(d[i]) - sigmx = math.Max(sigmx, math.Abs(e[i])) - } - d[n-1] = math.Abs(d[n-1]) - // Early return if sigmx is zero (matrix is already diagonal). - if sigmx == 0 { - impl.Dlasrt(lapack.SortDecreasing, n, d) - return info - } - - for i := 0; i < n; i++ { - sigmx = math.Max(sigmx, d[i]) - } - - // Copy D and E into WORK (in the Z format) and scale (squaring the - // input data makes scaling by a power of the radix pointless). - - eps := dlamchP - safmin := dlamchS - scale := math.Sqrt(eps / safmin) - bi := blas64.Implementation() - bi.Dcopy(n, d, 1, work, 2) - bi.Dcopy(n-1, e, 1, work[1:], 2) - impl.Dlascl(lapack.General, 0, 0, sigmx, scale, 2*n-1, 1, work, 1) - - // Compute the q's and e's. - for i := 0; i < 2*n-1; i++ { - work[i] *= work[i] - } - work[2*n-1] = 0 - - info = impl.Dlasq2(n, work) - if info == 0 { - for i := 0; i < n; i++ { - d[i] = math.Sqrt(work[i]) - } - impl.Dlascl(lapack.General, 0, 0, scale, sigmx, n, 1, d, 1) - } else if info == 2 { - // Maximum number of iterations exceeded. Move data from work - // into D and E so the calling subroutine can try to finish. - for i := 0; i < n; i++ { - d[i] = math.Sqrt(work[2*i]) - e[i] = math.Sqrt(work[2*i+1]) - } - impl.Dlascl(lapack.General, 0, 0, scale, sigmx, n, 1, d, 1) - impl.Dlascl(lapack.General, 0, 0, scale, sigmx, n, 1, e, 1) - } - return info -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq2.go deleted file mode 100644 index fd24a55..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq2.go +++ /dev/null @@ -1,369 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/lapack" -) - -// Dlasq2 computes all the eigenvalues of the symmetric positive -// definite tridiagonal matrix associated with the qd array Z. Eigevalues -// are computed to high relative accuracy avoiding denormalization, underflow -// and overflow. -// -// To see the relation of Z to the tridiagonal matrix, let L be a -// unit lower bidiagonal matrix with sub-diagonals Z(2,4,6,,..) and -// let U be an upper bidiagonal matrix with 1's above and diagonal -// Z(1,3,5,,..). The tridiagonal is L*U or, if you prefer, the -// symmetric tridiagonal to which it is similar. -// -// info returns a status error. The return codes mean as follows: -// 0: The algorithm completed successfully. -// 1: A split was marked by a positive value in e. -// 2: Current block of Z not diagonalized after 100*n iterations (in inner -// while loop). On exit Z holds a qd array with the same eigenvalues as -// the given Z. -// 3: Termination criterion of outer while loop not met (program created more -// than N unreduced blocks). -// -// z must have length at least 4*n, and must not contain any negative elements. -// Dlasq2 will panic otherwise. -// -// Dlasq2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlasq2(n int, z []float64) (info int) { - if n < 0 { - panic(nLT0) - } - - if n == 0 { - return info - } - - if len(z) < 4*n { - panic(shortZ) - } - - if n == 1 { - if z[0] < 0 { - panic(negZ) - } - return info - } - - const cbias = 1.5 - - eps := dlamchP - safmin := dlamchS - tol := eps * 100 - tol2 := tol * tol - if n == 2 { - if z[1] < 0 || z[2] < 0 { - panic(negZ) - } else if z[2] > z[0] { - z[0], z[2] = z[2], z[0] - } - z[4] = z[0] + z[1] + z[2] - if z[1] > z[2]*tol2 { - t := 0.5 * (z[0] - z[2] + z[1]) - s := z[2] * (z[1] / t) - if s <= t { - s = z[2] * (z[1] / (t * (1 + math.Sqrt(1+s/t)))) - } else { - s = z[2] * (z[1] / (t + math.Sqrt(t)*math.Sqrt(t+s))) - } - t = z[0] + s + z[1] - z[2] *= z[0] / t - z[0] = t - } - z[1] = z[2] - z[5] = z[1] + z[0] - return info - } - // Check for negative data and compute sums of q's and e's. - z[2*n-1] = 0 - emin := z[1] - var d, e, qmax float64 - var i1, n1 int - for k := 0; k < 2*(n-1); k += 2 { - if z[k] < 0 || z[k+1] < 0 { - panic(negZ) - } - d += z[k] - e += z[k+1] - qmax = math.Max(qmax, z[k]) - emin = math.Min(emin, z[k+1]) - } - if z[2*(n-1)] < 0 { - panic(negZ) - } - d += z[2*(n-1)] - // Check for diagonality. - if e == 0 { - for k := 1; k < n; k++ { - z[k] = z[2*k] - } - impl.Dlasrt(lapack.SortDecreasing, n, z) - z[2*(n-1)] = d - return info - } - trace := d + e - // Check for zero data. - if trace == 0 { - z[2*(n-1)] = 0 - return info - } - // Rearrange data for locality: Z=(q1,qq1,e1,ee1,q2,qq2,e2,ee2,...). - for k := 2 * n; k >= 2; k -= 2 { - z[2*k-1] = 0 - z[2*k-2] = z[k-1] - z[2*k-3] = 0 - z[2*k-4] = z[k-2] - } - i0 := 0 - n0 := n - 1 - - // Reverse the qd-array, if warranted. - // z[4*i0-3] --> z[4*(i0+1)-3-1] --> z[4*i0] - if cbias*z[4*i0] < z[4*n0] { - ipn4Out := 4 * (i0 + n0 + 2) - for i4loop := 4 * (i0 + 1); i4loop <= 2*(i0+n0+1); i4loop += 4 { - i4 := i4loop - 1 - ipn4 := ipn4Out - 1 - z[i4-3], z[ipn4-i4-4] = z[ipn4-i4-4], z[i4-3] - z[i4-1], z[ipn4-i4-6] = z[ipn4-i4-6], z[i4-1] - } - } - - // Initial split checking via dqd and Li's test. - pp := 0 - for k := 0; k < 2; k++ { - d = z[4*n0+pp] - for i4loop := 4*n0 + pp; i4loop >= 4*(i0+1)+pp; i4loop -= 4 { - i4 := i4loop - 1 - if z[i4-1] <= tol2*d { - z[i4-1] = math.Copysign(0, -1) - d = z[i4-3] - } else { - d = z[i4-3] * (d / (d + z[i4-1])) - } - } - // dqd maps Z to ZZ plus Li's test. - emin = z[4*(i0+1)+pp] - d = z[4*i0+pp] - for i4loop := 4*(i0+1) + pp; i4loop <= 4*n0+pp; i4loop += 4 { - i4 := i4loop - 1 - z[i4-2*pp-2] = d + z[i4-1] - if z[i4-1] <= tol2*d { - z[i4-1] = math.Copysign(0, -1) - z[i4-2*pp-2] = d - z[i4-2*pp] = 0 - d = z[i4+1] - } else if safmin*z[i4+1] < z[i4-2*pp-2] && safmin*z[i4-2*pp-2] < z[i4+1] { - tmp := z[i4+1] / z[i4-2*pp-2] - z[i4-2*pp] = z[i4-1] * tmp - d *= tmp - } else { - z[i4-2*pp] = z[i4+1] * (z[i4-1] / z[i4-2*pp-2]) - d = z[i4+1] * (d / z[i4-2*pp-2]) - } - emin = math.Min(emin, z[i4-2*pp]) - } - z[4*(n0+1)-pp-3] = d - - // Now find qmax. - qmax = z[4*(i0+1)-pp-3] - for i4loop := 4*(i0+1) - pp + 2; i4loop <= 4*(n0+1)+pp-2; i4loop += 4 { - i4 := i4loop - 1 - qmax = math.Max(qmax, z[i4]) - } - // Prepare for the next iteration on K. - pp = 1 - pp - } - - // Initialise variables to pass to DLASQ3. - var ttype int - var dmin1, dmin2, dn, dn1, dn2, g, tau float64 - var tempq float64 - iter := 2 - var nFail int - nDiv := 2 * (n0 - i0) - var i4 int -outer: - for iwhila := 1; iwhila <= n+1; iwhila++ { - // Test for completion. - if n0 < 0 { - // Move q's to the front. - for k := 1; k < n; k++ { - z[k] = z[4*k] - } - // Sort and compute sum of eigenvalues. - impl.Dlasrt(lapack.SortDecreasing, n, z) - e = 0 - for k := n - 1; k >= 0; k-- { - e += z[k] - } - // Store trace, sum(eigenvalues) and information on performance. - z[2*n] = trace - z[2*n+1] = e - z[2*n+2] = float64(iter) - z[2*n+3] = float64(nDiv) / float64(n*n) - z[2*n+4] = 100 * float64(nFail) / float64(iter) - return info - } - - // While array unfinished do - // e[n0] holds the value of sigma when submatrix in i0:n0 - // splits from the rest of the array, but is negated. - var desig float64 - var sigma float64 - if n0 != n-1 { - sigma = -z[4*(n0+1)-2] - } - if sigma < 0 { - info = 1 - return info - } - // Find last unreduced submatrix's top index i0, find qmax and - // emin. Find Gershgorin-type bound if Q's much greater than E's. - var emax float64 - if n0 > i0 { - emin = math.Abs(z[4*(n0+1)-6]) - } else { - emin = 0 - } - qmin := z[4*(n0+1)-4] - qmax = qmin - zSmall := false - for i4loop := 4 * (n0 + 1); i4loop >= 8; i4loop -= 4 { - i4 = i4loop - 1 - if z[i4-5] <= 0 { - zSmall = true - break - } - if qmin >= 4*emax { - qmin = math.Min(qmin, z[i4-3]) - emax = math.Max(emax, z[i4-5]) - } - qmax = math.Max(qmax, z[i4-7]+z[i4-5]) - emin = math.Min(emin, z[i4-5]) - } - if !zSmall { - i4 = 3 - } - i0 = (i4+1)/4 - 1 - pp = 0 - if n0-i0 > 1 { - dee := z[4*i0] - deemin := dee - kmin := i0 - for i4loop := 4*(i0+1) + 1; i4loop <= 4*(n0+1)-3; i4loop += 4 { - i4 := i4loop - 1 - dee = z[i4] * (dee / (dee + z[i4-2])) - if dee <= deemin { - deemin = dee - kmin = (i4+4)/4 - 1 - } - } - if (kmin-i0)*2 < n0-kmin && deemin <= 0.5*z[4*n0] { - ipn4Out := 4 * (i0 + n0 + 2) - pp = 2 - for i4loop := 4 * (i0 + 1); i4loop <= 2*(i0+n0+1); i4loop += 4 { - i4 := i4loop - 1 - ipn4 := ipn4Out - 1 - z[i4-3], z[ipn4-i4-4] = z[ipn4-i4-4], z[i4-3] - z[i4-2], z[ipn4-i4-3] = z[ipn4-i4-3], z[i4-2] - z[i4-1], z[ipn4-i4-6] = z[ipn4-i4-6], z[i4-1] - z[i4], z[ipn4-i4-5] = z[ipn4-i4-5], z[i4] - } - } - } - // Put -(initial shift) into DMIN. - dmin := -math.Max(0, qmin-2*math.Sqrt(qmin)*math.Sqrt(emax)) - - // Now i0:n0 is unreduced. - // PP = 0 for ping, PP = 1 for pong. - // PP = 2 indicates that flipping was applied to the Z array and - // and that the tests for deflation upon entry in Dlasq3 - // should not be performed. - nbig := 100 * (n0 - i0 + 1) - for iwhilb := 0; iwhilb < nbig; iwhilb++ { - if i0 > n0 { - continue outer - } - - // While submatrix unfinished take a good dqds step. - i0, n0, pp, dmin, sigma, desig, qmax, nFail, iter, nDiv, ttype, dmin1, dmin2, dn, dn1, dn2, g, tau = - impl.Dlasq3(i0, n0, z, pp, dmin, sigma, desig, qmax, nFail, iter, nDiv, ttype, dmin1, dmin2, dn, dn1, dn2, g, tau) - - pp = 1 - pp - // When emin is very small check for splits. - if pp == 0 && n0-i0 >= 3 { - if z[4*(n0+1)-1] <= tol2*qmax || z[4*(n0+1)-2] <= tol2*sigma { - splt := i0 - 1 - qmax = z[4*i0] - emin = z[4*(i0+1)-2] - oldemn := z[4*(i0+1)-1] - for i4loop := 4 * (i0 + 1); i4loop <= 4*(n0-2); i4loop += 4 { - i4 := i4loop - 1 - if z[i4] <= tol2*z[i4-3] || z[i4-1] <= tol2*sigma { - z[i4-1] = -sigma - splt = i4 / 4 - qmax = 0 - emin = z[i4+3] - oldemn = z[i4+4] - } else { - qmax = math.Max(qmax, z[i4+1]) - emin = math.Min(emin, z[i4-1]) - oldemn = math.Min(oldemn, z[i4]) - } - } - z[4*(n0+1)-2] = emin - z[4*(n0+1)-1] = oldemn - i0 = splt + 1 - } - } - } - // Maximum number of iterations exceeded, restore the shift - // sigma and place the new d's and e's in a qd array. - // This might need to be done for several blocks. - info = 2 - i1 = i0 - for { - tempq = z[4*i0] - z[4*i0] += sigma - for k := i0 + 1; k <= n0; k++ { - tempe := z[4*(k+1)-6] - z[4*(k+1)-6] *= tempq / z[4*(k+1)-8] - tempq = z[4*k] - z[4*k] += sigma + tempe - z[4*(k+1)-6] - } - // Prepare to do this on the previous block if there is one. - if i1 <= 0 { - break - } - n1 = i1 - 1 - for i1 >= 1 && z[4*(i1+1)-6] >= 0 { - i1 -= 1 - } - sigma = -z[4*(n1+1)-2] - } - for k := 0; k < n; k++ { - z[2*k] = z[4*k] - // Only the block 1..N0 is unfinished. The rest of the e's - // must be essentially zero, although sometimes other data - // has been stored in them. - if k < n0 { - z[2*(k+1)-1] = z[4*(k+1)-1] - } else { - z[2*(k+1)] = 0 - } - } - return info - } - info = 3 - return info -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq3.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq3.go deleted file mode 100644 index a05e94e..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq3.go +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import "math" - -// Dlasq3 checks for deflation, computes a shift (tau) and calls dqds. -// In case of failure it changes shifts, and tries again until output -// is positive. -// -// Dlasq3 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlasq3(i0, n0 int, z []float64, pp int, dmin, sigma, desig, qmax float64, nFail, iter, nDiv int, ttype int, dmin1, dmin2, dn, dn1, dn2, g, tau float64) ( - i0Out, n0Out, ppOut int, dminOut, sigmaOut, desigOut, qmaxOut float64, nFailOut, iterOut, nDivOut, ttypeOut int, dmin1Out, dmin2Out, dnOut, dn1Out, dn2Out, gOut, tauOut float64) { - switch { - case i0 < 0: - panic(i0LT0) - case n0 < 0: - panic(n0LT0) - case len(z) < 4*n0: - panic(shortZ) - case pp != 0 && pp != 1 && pp != 2: - panic(badPp) - } - - const cbias = 1.5 - - n0in := n0 - eps := dlamchP - tol := eps * 100 - tol2 := tol * tol - var nn int - var t float64 - for { - if n0 < i0 { - return i0, n0, pp, dmin, sigma, desig, qmax, nFail, iter, nDiv, ttype, dmin1, dmin2, dn, dn1, dn2, g, tau - } - if n0 == i0 { - z[4*(n0+1)-4] = z[4*(n0+1)+pp-4] + sigma - n0-- - continue - } - nn = 4*(n0+1) + pp - 1 - if n0 != i0+1 { - // Check whether e[n0-1] is negligible, 1 eigenvalue. - if z[nn-5] > tol2*(sigma+z[nn-3]) && z[nn-2*pp-4] > tol2*z[nn-7] { - // Check whether e[n0-2] is negligible, 2 eigenvalues. - if z[nn-9] > tol2*sigma && z[nn-2*pp-8] > tol2*z[nn-11] { - break - } - } else { - z[4*(n0+1)-4] = z[4*(n0+1)+pp-4] + sigma - n0-- - continue - } - } - if z[nn-3] > z[nn-7] { - z[nn-3], z[nn-7] = z[nn-7], z[nn-3] - } - t = 0.5 * (z[nn-7] - z[nn-3] + z[nn-5]) - if z[nn-5] > z[nn-3]*tol2 && t != 0 { - s := z[nn-3] * (z[nn-5] / t) - if s <= t { - s = z[nn-3] * (z[nn-5] / (t * (1 + math.Sqrt(1+s/t)))) - } else { - s = z[nn-3] * (z[nn-5] / (t + math.Sqrt(t)*math.Sqrt(t+s))) - } - t = z[nn-7] + (s + z[nn-5]) - z[nn-3] *= z[nn-7] / t - z[nn-7] = t - } - z[4*(n0+1)-8] = z[nn-7] + sigma - z[4*(n0+1)-4] = z[nn-3] + sigma - n0 -= 2 - } - if pp == 2 { - pp = 0 - } - - // Reverse the qd-array, if warranted. - if dmin <= 0 || n0 < n0in { - if cbias*z[4*(i0+1)+pp-4] < z[4*(n0+1)+pp-4] { - ipn4Out := 4 * (i0 + n0 + 2) - for j4loop := 4 * (i0 + 1); j4loop <= 2*((i0+1)+(n0+1)-1); j4loop += 4 { - ipn4 := ipn4Out - 1 - j4 := j4loop - 1 - - z[j4-3], z[ipn4-j4-4] = z[ipn4-j4-4], z[j4-3] - z[j4-2], z[ipn4-j4-3] = z[ipn4-j4-3], z[j4-2] - z[j4-1], z[ipn4-j4-6] = z[ipn4-j4-6], z[j4-1] - z[j4], z[ipn4-j4-5] = z[ipn4-j4-5], z[j4] - } - if n0-i0 <= 4 { - z[4*(n0+1)+pp-2] = z[4*(i0+1)+pp-2] - z[4*(n0+1)-pp-1] = z[4*(i0+1)-pp-1] - } - dmin2 = math.Min(dmin2, z[4*(i0+1)-pp-2]) - z[4*(n0+1)+pp-2] = math.Min(math.Min(z[4*(n0+1)+pp-2], z[4*(i0+1)+pp-2]), z[4*(i0+1)+pp+2]) - z[4*(n0+1)-pp-1] = math.Min(math.Min(z[4*(n0+1)-pp-1], z[4*(i0+1)-pp-1]), z[4*(i0+1)-pp+3]) - qmax = math.Max(math.Max(qmax, z[4*(i0+1)+pp-4]), z[4*(i0+1)+pp]) - dmin = math.Copysign(0, -1) // Fortran code has -zero, but -0 in go is 0 - } - } - - // Choose a shift. - tau, ttype, g = impl.Dlasq4(i0, n0, z, pp, n0in, dmin, dmin1, dmin2, dn, dn1, dn2, tau, ttype, g) - - // Call dqds until dmin > 0. -loop: - for { - i0, n0, pp, tau, sigma, dmin, dmin1, dmin2, dn, dn1, dn2 = impl.Dlasq5(i0, n0, z, pp, tau, sigma) - - nDiv += n0 - i0 + 2 - iter++ - switch { - case dmin >= 0 && dmin1 >= 0: - // Success. - goto done - - case dmin < 0 && dmin1 > 0 && z[4*n0-pp-1] < tol*(sigma+dn1) && math.Abs(dn) < tol*sigma: - // Convergence hidden by negative dn. - z[4*n0-pp+1] = 0 - dmin = 0 - goto done - - case dmin < 0: - // Tau too big. Select new Tau and try again. - nFail++ - if ttype < -22 { - // Failed twice. Play it safe. - tau = 0 - } else if dmin1 > 0 { - // Late failure. Gives excellent shift. - tau = (tau + dmin) * (1 - 2*eps) - ttype -= 11 - } else { - // Early failure. Divide by 4. - tau = tau / 4 - ttype -= 12 - } - - case math.IsNaN(dmin): - if tau == 0 { - break loop - } - tau = 0 - - default: - // Possible underflow. Play it safe. - break loop - } - } - - // Risk of underflow. - dmin, dmin1, dmin2, dn, dn1, dn2 = impl.Dlasq6(i0, n0, z, pp) - nDiv += n0 - i0 + 2 - iter++ - tau = 0 - -done: - if tau < sigma { - desig += tau - t = sigma + desig - desig -= t - sigma - } else { - t = sigma + tau - desig += sigma - (t - tau) - } - sigma = t - return i0, n0, pp, dmin, sigma, desig, qmax, nFail, iter, nDiv, ttype, dmin1, dmin2, dn, dn1, dn2, g, tau -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq4.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq4.go deleted file mode 100644 index f6dbb31..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq4.go +++ /dev/null @@ -1,249 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import "math" - -// Dlasq4 computes an approximation to the smallest eigenvalue using values of d -// from the previous transform. -// i0, n0, and n0in are zero-indexed. -// -// Dlasq4 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlasq4(i0, n0 int, z []float64, pp int, n0in int, dmin, dmin1, dmin2, dn, dn1, dn2, tau float64, ttype int, g float64) (tauOut float64, ttypeOut int, gOut float64) { - switch { - case i0 < 0: - panic(i0LT0) - case n0 < 0: - panic(n0LT0) - case len(z) < 4*n0: - panic(shortZ) - case pp != 0 && pp != 1: - panic(badPp) - } - - const ( - cnst1 = 0.563 - cnst2 = 1.01 - cnst3 = 1.05 - - cnstthird = 0.333 // TODO(btracey): Fix? - ) - // A negative dmin forces the shift to take that absolute value - // ttype records the type of shift. - if dmin <= 0 { - tau = -dmin - ttype = -1 - return tau, ttype, g - } - nn := 4*(n0+1) + pp - 1 // -1 for zero indexing - s := math.NaN() // Poison s so that failure to take a path below is obvious - if n0in == n0 { - // No eigenvalues deflated. - if dmin == dn || dmin == dn1 { - b1 := math.Sqrt(z[nn-3]) * math.Sqrt(z[nn-5]) - b2 := math.Sqrt(z[nn-7]) * math.Sqrt(z[nn-9]) - a2 := z[nn-7] + z[nn-5] - if dmin == dn && dmin1 == dn1 { - gap2 := dmin2 - a2 - dmin2/4 - var gap1 float64 - if gap2 > 0 && gap2 > b2 { - gap1 = a2 - dn - (b2/gap2)*b2 - } else { - gap1 = a2 - dn - (b1 + b2) - } - if gap1 > 0 && gap1 > b1 { - s = math.Max(dn-(b1/gap1)*b1, 0.5*dmin) - ttype = -2 - } else { - s = 0 - if dn > b1 { - s = dn - b1 - } - if a2 > b1+b2 { - s = math.Min(s, a2-(b1+b2)) - } - s = math.Max(s, cnstthird*dmin) - ttype = -3 - } - } else { - ttype = -4 - s = dmin / 4 - var gam float64 - var np int - if dmin == dn { - gam = dn - a2 = 0 - if z[nn-5] > z[nn-7] { - return tau, ttype, g - } - b2 = z[nn-5] / z[nn-7] - np = nn - 9 - } else { - np = nn - 2*pp - gam = dn1 - if z[np-4] > z[np-2] { - return tau, ttype, g - } - a2 = z[np-4] / z[np-2] - if z[nn-9] > z[nn-11] { - return tau, ttype, g - } - b2 = z[nn-9] / z[nn-11] - np = nn - 13 - } - // Approximate contribution to norm squared from i < nn-1. - a2 += b2 - for i4loop := np + 1; i4loop >= 4*(i0+1)-1+pp; i4loop -= 4 { - i4 := i4loop - 1 - if b2 == 0 { - break - } - b1 = b2 - if z[i4] > z[i4-2] { - return tau, ttype, g - } - b2 *= z[i4] / z[i4-2] - a2 += b2 - if 100*math.Max(b2, b1) < a2 || cnst1 < a2 { - break - } - } - a2 *= cnst3 - // Rayleigh quotient residual bound. - if a2 < cnst1 { - s = gam * (1 - math.Sqrt(a2)) / (1 + a2) - } - } - } else if dmin == dn2 { - ttype = -5 - s = dmin / 4 - // Compute contribution to norm squared from i > nn-2. - np := nn - 2*pp - b1 := z[np-2] - b2 := z[np-6] - gam := dn2 - if z[np-8] > b2 || z[np-4] > b1 { - return tau, ttype, g - } - a2 := (z[np-8] / b2) * (1 + z[np-4]/b1) - // Approximate contribution to norm squared from i < nn-2. - if n0-i0 > 2 { - b2 = z[nn-13] / z[nn-15] - a2 += b2 - for i4loop := (nn + 1) - 17; i4loop >= 4*(i0+1)-1+pp; i4loop -= 4 { - i4 := i4loop - 1 - if b2 == 0 { - break - } - b1 = b2 - if z[i4] > z[i4-2] { - return tau, ttype, g - } - b2 *= z[i4] / z[i4-2] - a2 += b2 - if 100*math.Max(b2, b1) < a2 || cnst1 < a2 { - break - } - } - a2 *= cnst3 - } - if a2 < cnst1 { - s = gam * (1 - math.Sqrt(a2)) / (1 + a2) - } - } else { - // Case 6, no information to guide us. - if ttype == -6 { - g += cnstthird * (1 - g) - } else if ttype == -18 { - g = cnstthird / 4 - } else { - g = 1.0 / 4 - } - s = g * dmin - ttype = -6 - } - } else if n0in == (n0 + 1) { - // One eigenvalue just deflated. Use DMIN1, DN1 for DMIN and DN. - if dmin1 == dn1 && dmin2 == dn2 { - ttype = -7 - s = cnstthird * dmin1 - if z[nn-5] > z[nn-7] { - return tau, ttype, g - } - b1 := z[nn-5] / z[nn-7] - b2 := b1 - if b2 != 0 { - for i4loop := 4*(n0+1) - 9 + pp; i4loop >= 4*(i0+1)-1+pp; i4loop -= 4 { - i4 := i4loop - 1 - a2 := b1 - if z[i4] > z[i4-2] { - return tau, ttype, g - } - b1 *= z[i4] / z[i4-2] - b2 += b1 - if 100*math.Max(b1, a2) < b2 { - break - } - } - } - b2 = math.Sqrt(cnst3 * b2) - a2 := dmin1 / (1 + b2*b2) - gap2 := 0.5*dmin2 - a2 - if gap2 > 0 && gap2 > b2*a2 { - s = math.Max(s, a2*(1-cnst2*a2*(b2/gap2)*b2)) - } else { - s = math.Max(s, a2*(1-cnst2*b2)) - ttype = -8 - } - } else { - s = dmin1 / 4 - if dmin1 == dn1 { - s = 0.5 * dmin1 - } - ttype = -9 - } - } else if n0in == (n0 + 2) { - // Two eigenvalues deflated. Use DMIN2, DN2 for DMIN and DN. - if dmin2 == dn2 && 2*z[nn-5] < z[nn-7] { - ttype = -10 - s = cnstthird * dmin2 - if z[nn-5] > z[nn-7] { - return tau, ttype, g - } - b1 := z[nn-5] / z[nn-7] - b2 := b1 - if b2 != 0 { - for i4loop := 4*(n0+1) - 9 + pp; i4loop >= 4*(i0+1)-1+pp; i4loop -= 4 { - i4 := i4loop - 1 - if z[i4] > z[i4-2] { - return tau, ttype, g - } - b1 *= z[i4] / z[i4-2] - b2 += b1 - if 100*b1 < b2 { - break - } - } - } - b2 = math.Sqrt(cnst3 * b2) - a2 := dmin2 / (1 + b2*b2) - gap2 := z[nn-7] + z[nn-9] - math.Sqrt(z[nn-11])*math.Sqrt(z[nn-9]) - a2 - if gap2 > 0 && gap2 > b2*a2 { - s = math.Max(s, a2*(1-cnst2*a2*(b2/gap2)*b2)) - } else { - s = math.Max(s, a2*(1-cnst2*b2)) - } - } else { - s = dmin2 / 4 - ttype = -11 - } - } else if n0in > n0+2 { - // Case 12, more than two eigenvalues deflated. No information. - s = 0 - ttype = -12 - } - tau = s - return tau, ttype, g -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq5.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq5.go deleted file mode 100644 index d3826d9..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq5.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import "math" - -// Dlasq5 computes one dqds transform in ping-pong form. -// i0 and n0 are zero-indexed. -// -// Dlasq5 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlasq5(i0, n0 int, z []float64, pp int, tau, sigma float64) (i0Out, n0Out, ppOut int, tauOut, sigmaOut, dmin, dmin1, dmin2, dn, dnm1, dnm2 float64) { - // The lapack function has inputs for ieee and eps, but Go requires ieee so - // these are unnecessary. - - switch { - case i0 < 0: - panic(i0LT0) - case n0 < 0: - panic(n0LT0) - case len(z) < 4*n0: - panic(shortZ) - case pp != 0 && pp != 1: - panic(badPp) - } - - if n0-i0-1 <= 0 { - return i0, n0, pp, tau, sigma, dmin, dmin1, dmin2, dn, dnm1, dnm2 - } - - eps := dlamchP - dthresh := eps * (sigma + tau) - if tau < dthresh*0.5 { - tau = 0 - } - var j4 int - var emin float64 - if tau != 0 { - j4 = 4*i0 + pp - emin = z[j4+4] - d := z[j4] - tau - dmin = d - // In the reference there are code paths that actually return this value. - // dmin1 = -z[j4] - if pp == 0 { - for j4loop := 4 * (i0 + 1); j4loop <= 4*((n0+1)-3); j4loop += 4 { - j4 := j4loop - 1 - z[j4-2] = d + z[j4-1] - tmp := z[j4+1] / z[j4-2] - d = d*tmp - tau - dmin = math.Min(dmin, d) - z[j4] = z[j4-1] * tmp - emin = math.Min(z[j4], emin) - } - } else { - for j4loop := 4 * (i0 + 1); j4loop <= 4*((n0+1)-3); j4loop += 4 { - j4 := j4loop - 1 - z[j4-3] = d + z[j4] - tmp := z[j4+2] / z[j4-3] - d = d*tmp - tau - dmin = math.Min(dmin, d) - z[j4-1] = z[j4] * tmp - emin = math.Min(z[j4-1], emin) - } - } - // Unroll the last two steps. - dnm2 = d - dmin2 = dmin - j4 = 4*((n0+1)-2) - pp - 1 - j4p2 := j4 + 2*pp - 1 - z[j4-2] = dnm2 + z[j4p2] - z[j4] = z[j4p2+2] * (z[j4p2] / z[j4-2]) - dnm1 = z[j4p2+2]*(dnm2/z[j4-2]) - tau - dmin = math.Min(dmin, dnm1) - - dmin1 = dmin - j4 += 4 - j4p2 = j4 + 2*pp - 1 - z[j4-2] = dnm1 + z[j4p2] - z[j4] = z[j4p2+2] * (z[j4p2] / z[j4-2]) - dn = z[j4p2+2]*(dnm1/z[j4-2]) - tau - dmin = math.Min(dmin, dn) - } else { - // This is the version that sets d's to zero if they are small enough. - j4 = 4*(i0+1) + pp - 4 - emin = z[j4+4] - d := z[j4] - tau - dmin = d - // In the reference there are code paths that actually return this value. - // dmin1 = -z[j4] - if pp == 0 { - for j4loop := 4 * (i0 + 1); j4loop <= 4*((n0+1)-3); j4loop += 4 { - j4 := j4loop - 1 - z[j4-2] = d + z[j4-1] - tmp := z[j4+1] / z[j4-2] - d = d*tmp - tau - if d < dthresh { - d = 0 - } - dmin = math.Min(dmin, d) - z[j4] = z[j4-1] * tmp - emin = math.Min(z[j4], emin) - } - } else { - for j4loop := 4 * (i0 + 1); j4loop <= 4*((n0+1)-3); j4loop += 4 { - j4 := j4loop - 1 - z[j4-3] = d + z[j4] - tmp := z[j4+2] / z[j4-3] - d = d*tmp - tau - if d < dthresh { - d = 0 - } - dmin = math.Min(dmin, d) - z[j4-1] = z[j4] * tmp - emin = math.Min(z[j4-1], emin) - } - } - // Unroll the last two steps. - dnm2 = d - dmin2 = dmin - j4 = 4*((n0+1)-2) - pp - 1 - j4p2 := j4 + 2*pp - 1 - z[j4-2] = dnm2 + z[j4p2] - z[j4] = z[j4p2+2] * (z[j4p2] / z[j4-2]) - dnm1 = z[j4p2+2]*(dnm2/z[j4-2]) - tau - dmin = math.Min(dmin, dnm1) - - dmin1 = dmin - j4 += 4 - j4p2 = j4 + 2*pp - 1 - z[j4-2] = dnm1 + z[j4p2] - z[j4] = z[j4p2+2] * (z[j4p2] / z[j4-2]) - dn = z[j4p2+2]*(dnm1/z[j4-2]) - tau - dmin = math.Min(dmin, dn) - } - z[j4+2] = dn - z[4*(n0+1)-pp-1] = emin - return i0, n0, pp, tau, sigma, dmin, dmin1, dmin2, dn, dnm1, dnm2 -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq6.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq6.go deleted file mode 100644 index 54bf587..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq6.go +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import "math" - -// Dlasq6 computes one dqd transform in ping-pong form with protection against -// overflow and underflow. z has length at least 4*(n0+1) and holds the qd array. -// i0 is the zero-based first index. -// n0 is the zero-based last index. -// -// Dlasq6 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlasq6(i0, n0 int, z []float64, pp int) (dmin, dmin1, dmin2, dn, dnm1, dnm2 float64) { - switch { - case i0 < 0: - panic(i0LT0) - case n0 < 0: - panic(n0LT0) - case len(z) < 4*n0: - panic(shortZ) - case pp != 0 && pp != 1: - panic(badPp) - } - - if n0-i0-1 <= 0 { - return dmin, dmin1, dmin2, dn, dnm1, dnm2 - } - - safmin := dlamchS - j4 := 4*(i0+1) + pp - 4 // -4 rather than -3 for zero indexing - emin := z[j4+4] - d := z[j4] - dmin = d - if pp == 0 { - for j4loop := 4 * (i0 + 1); j4loop <= 4*((n0+1)-3); j4loop += 4 { - j4 := j4loop - 1 // Translate back to zero-indexed. - z[j4-2] = d + z[j4-1] - if z[j4-2] == 0 { - z[j4] = 0 - d = z[j4+1] - dmin = d - emin = 0 - } else if safmin*z[j4+1] < z[j4-2] && safmin*z[j4-2] < z[j4+1] { - tmp := z[j4+1] / z[j4-2] - z[j4] = z[j4-1] * tmp - d *= tmp - } else { - z[j4] = z[j4+1] * (z[j4-1] / z[j4-2]) - d = z[j4+1] * (d / z[j4-2]) - } - dmin = math.Min(dmin, d) - emin = math.Min(emin, z[j4]) - } - } else { - for j4loop := 4 * (i0 + 1); j4loop <= 4*((n0+1)-3); j4loop += 4 { - j4 := j4loop - 1 - z[j4-3] = d + z[j4] - if z[j4-3] == 0 { - z[j4-1] = 0 - d = z[j4+2] - dmin = d - emin = 0 - } else if safmin*z[j4+2] < z[j4-3] && safmin*z[j4-3] < z[j4+2] { - tmp := z[j4+2] / z[j4-3] - z[j4-1] = z[j4] * tmp - d *= tmp - } else { - z[j4-1] = z[j4+2] * (z[j4] / z[j4-3]) - d = z[j4+2] * (d / z[j4-3]) - } - dmin = math.Min(dmin, d) - emin = math.Min(emin, z[j4-1]) - } - } - // Unroll last two steps. - dnm2 = d - dmin2 = dmin - j4 = 4*(n0-1) - pp - 1 - j4p2 := j4 + 2*pp - 1 - z[j4-2] = dnm2 + z[j4p2] - if z[j4-2] == 0 { - z[j4] = 0 - dnm1 = z[j4p2+2] - dmin = dnm1 - emin = 0 - } else if safmin*z[j4p2+2] < z[j4-2] && safmin*z[j4-2] < z[j4p2+2] { - tmp := z[j4p2+2] / z[j4-2] - z[j4] = z[j4p2] * tmp - dnm1 = dnm2 * tmp - } else { - z[j4] = z[j4p2+2] * (z[j4p2] / z[j4-2]) - dnm1 = z[j4p2+2] * (dnm2 / z[j4-2]) - } - dmin = math.Min(dmin, dnm1) - dmin1 = dmin - j4 += 4 - j4p2 = j4 + 2*pp - 1 - z[j4-2] = dnm1 + z[j4p2] - if z[j4-2] == 0 { - z[j4] = 0 - dn = z[j4p2+2] - dmin = dn - emin = 0 - } else if safmin*z[j4p2+2] < z[j4-2] && safmin*z[j4-2] < z[j4p2+2] { - tmp := z[j4p2+2] / z[j4-2] - z[j4] = z[j4p2] * tmp - dn = dnm1 * tmp - } else { - z[j4] = z[j4p2+2] * (z[j4p2] / z[j4-2]) - dn = z[j4p2+2] * (dnm1 / z[j4-2]) - } - dmin = math.Min(dmin, dn) - z[j4+2] = dn - z[4*(n0+1)-pp-1] = emin - return dmin, dmin1, dmin2, dn, dnm1, dnm2 -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlasr.go deleted file mode 100644 index 6bacca5..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasr.go +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dlasr applies a sequence of plane rotations to the m×n matrix A. This series -// of plane rotations is implicitly represented by a matrix P. P is multiplied -// by a depending on the value of side -- A = P * A if side == lapack.Left, -// A = A * Pᵀ if side == lapack.Right. -// -// The exact value of P depends on the value of pivot, but in all cases P is -// implicitly represented by a series of 2×2 rotation matrices. The entries of -// rotation matrix k are defined by s[k] and c[k] -// R(k) = [ c[k] s[k]] -// [-s[k] s[k]] -// If direct == lapack.Forward, the rotation matrices are applied as -// P = P(z-1) * ... * P(2) * P(1), while if direct == lapack.Backward they are -// applied as P = P(1) * P(2) * ... * P(n). -// -// pivot defines the mapping of the elements in R(k) to P(k). -// If pivot == lapack.Variable, the rotation is performed for the (k, k+1) plane. -// P(k) = [1 ] -// [ ... ] -// [ 1 ] -// [ c[k] s[k] ] -// [ -s[k] c[k] ] -// [ 1 ] -// [ ... ] -// [ 1] -// if pivot == lapack.Top, the rotation is performed for the (1, k+1) plane, -// P(k) = [c[k] s[k] ] -// [ 1 ] -// [ ... ] -// [ 1 ] -// [-s[k] c[k] ] -// [ 1 ] -// [ ... ] -// [ 1] -// and if pivot == lapack.Bottom, the rotation is performed for the (k, z) plane. -// P(k) = [1 ] -// [ ... ] -// [ 1 ] -// [ c[k] s[k]] -// [ 1 ] -// [ ... ] -// [ 1 ] -// [ -s[k] c[k]] -// s and c have length m - 1 if side == blas.Left, and n - 1 if side == blas.Right. -// -// Dlasr is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlasr(side blas.Side, pivot lapack.Pivot, direct lapack.Direct, m, n int, c, s, a []float64, lda int) { - switch { - case side != blas.Left && side != blas.Right: - panic(badSide) - case pivot != lapack.Variable && pivot != lapack.Top && pivot != lapack.Bottom: - panic(badPivot) - case direct != lapack.Forward && direct != lapack.Backward: - panic(badDirect) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - if side == blas.Left { - if len(c) < m-1 { - panic(shortC) - } - if len(s) < m-1 { - panic(shortS) - } - } else { - if len(c) < n-1 { - panic(shortC) - } - if len(s) < n-1 { - panic(shortS) - } - } - if len(a) < (m-1)*lda+n { - panic(shortA) - } - - if side == blas.Left { - if pivot == lapack.Variable { - if direct == lapack.Forward { - for j := 0; j < m-1; j++ { - ctmp := c[j] - stmp := s[j] - if ctmp != 1 || stmp != 0 { - for i := 0; i < n; i++ { - tmp2 := a[j*lda+i] - tmp := a[(j+1)*lda+i] - a[(j+1)*lda+i] = ctmp*tmp - stmp*tmp2 - a[j*lda+i] = stmp*tmp + ctmp*tmp2 - } - } - } - return - } - for j := m - 2; j >= 0; j-- { - ctmp := c[j] - stmp := s[j] - if ctmp != 1 || stmp != 0 { - for i := 0; i < n; i++ { - tmp2 := a[j*lda+i] - tmp := a[(j+1)*lda+i] - a[(j+1)*lda+i] = ctmp*tmp - stmp*tmp2 - a[j*lda+i] = stmp*tmp + ctmp*tmp2 - } - } - } - return - } else if pivot == lapack.Top { - if direct == lapack.Forward { - for j := 1; j < m; j++ { - ctmp := c[j-1] - stmp := s[j-1] - if ctmp != 1 || stmp != 0 { - for i := 0; i < n; i++ { - tmp := a[j*lda+i] - tmp2 := a[i] - a[j*lda+i] = ctmp*tmp - stmp*tmp2 - a[i] = stmp*tmp + ctmp*tmp2 - } - } - } - return - } - for j := m - 1; j >= 1; j-- { - ctmp := c[j-1] - stmp := s[j-1] - if ctmp != 1 || stmp != 0 { - for i := 0; i < n; i++ { - ctmp := c[j-1] - stmp := s[j-1] - if ctmp != 1 || stmp != 0 { - for i := 0; i < n; i++ { - tmp := a[j*lda+i] - tmp2 := a[i] - a[j*lda+i] = ctmp*tmp - stmp*tmp2 - a[i] = stmp*tmp + ctmp*tmp2 - } - } - } - } - } - return - } - if direct == lapack.Forward { - for j := 0; j < m-1; j++ { - ctmp := c[j] - stmp := s[j] - if ctmp != 1 || stmp != 0 { - for i := 0; i < n; i++ { - tmp := a[j*lda+i] - tmp2 := a[(m-1)*lda+i] - a[j*lda+i] = stmp*tmp2 + ctmp*tmp - a[(m-1)*lda+i] = ctmp*tmp2 - stmp*tmp - } - } - } - return - } - for j := m - 2; j >= 0; j-- { - ctmp := c[j] - stmp := s[j] - if ctmp != 1 || stmp != 0 { - for i := 0; i < n; i++ { - tmp := a[j*lda+i] - tmp2 := a[(m-1)*lda+i] - a[j*lda+i] = stmp*tmp2 + ctmp*tmp - a[(m-1)*lda+i] = ctmp*tmp2 - stmp*tmp - } - } - } - return - } - if pivot == lapack.Variable { - if direct == lapack.Forward { - for j := 0; j < n-1; j++ { - ctmp := c[j] - stmp := s[j] - if ctmp != 1 || stmp != 0 { - for i := 0; i < m; i++ { - tmp := a[i*lda+j+1] - tmp2 := a[i*lda+j] - a[i*lda+j+1] = ctmp*tmp - stmp*tmp2 - a[i*lda+j] = stmp*tmp + ctmp*tmp2 - } - } - } - return - } - for j := n - 2; j >= 0; j-- { - ctmp := c[j] - stmp := s[j] - if ctmp != 1 || stmp != 0 { - for i := 0; i < m; i++ { - tmp := a[i*lda+j+1] - tmp2 := a[i*lda+j] - a[i*lda+j+1] = ctmp*tmp - stmp*tmp2 - a[i*lda+j] = stmp*tmp + ctmp*tmp2 - } - } - } - return - } else if pivot == lapack.Top { - if direct == lapack.Forward { - for j := 1; j < n; j++ { - ctmp := c[j-1] - stmp := s[j-1] - if ctmp != 1 || stmp != 0 { - for i := 0; i < m; i++ { - tmp := a[i*lda+j] - tmp2 := a[i*lda] - a[i*lda+j] = ctmp*tmp - stmp*tmp2 - a[i*lda] = stmp*tmp + ctmp*tmp2 - } - } - } - return - } - for j := n - 1; j >= 1; j-- { - ctmp := c[j-1] - stmp := s[j-1] - if ctmp != 1 || stmp != 0 { - for i := 0; i < m; i++ { - tmp := a[i*lda+j] - tmp2 := a[i*lda] - a[i*lda+j] = ctmp*tmp - stmp*tmp2 - a[i*lda] = stmp*tmp + ctmp*tmp2 - } - } - } - return - } - if direct == lapack.Forward { - for j := 0; j < n-1; j++ { - ctmp := c[j] - stmp := s[j] - if ctmp != 1 || stmp != 0 { - for i := 0; i < m; i++ { - tmp := a[i*lda+j] - tmp2 := a[i*lda+n-1] - a[i*lda+j] = stmp*tmp2 + ctmp*tmp - a[i*lda+n-1] = ctmp*tmp2 - stmp*tmp - } - - } - } - return - } - for j := n - 2; j >= 0; j-- { - ctmp := c[j] - stmp := s[j] - if ctmp != 1 || stmp != 0 { - for i := 0; i < m; i++ { - tmp := a[i*lda+j] - tmp2 := a[i*lda+n-1] - a[i*lda+j] = stmp*tmp2 + ctmp*tmp - a[i*lda+n-1] = ctmp*tmp2 - stmp*tmp - } - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasrt.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlasrt.go deleted file mode 100644 index be47280..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasrt.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "sort" - - "gonum.org/v1/gonum/lapack" -) - -// Dlasrt sorts the numbers in the input slice d. If s == lapack.SortIncreasing, -// the elements are sorted in increasing order. If s == lapack.SortDecreasing, -// the elements are sorted in decreasing order. For other values of s Dlasrt -// will panic. -// -// Dlasrt is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlasrt(s lapack.Sort, n int, d []float64) { - switch { - case n < 0: - panic(nLT0) - case len(d) < n: - panic(shortD) - } - - d = d[:n] - switch s { - default: - panic(badSort) - case lapack.SortIncreasing: - sort.Float64s(d) - case lapack.SortDecreasing: - sort.Sort(sort.Reverse(sort.Float64Slice(d))) - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlassq.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlassq.go deleted file mode 100644 index 9c2dc77..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlassq.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import "math" - -// Dlassq updates a sum of squares in scaled form. The input parameters scale and -// sumsq represent the current scale and total sum of squares. These values are -// updated with the information in the first n elements of the vector specified -// by x and incX. -// -// Dlassq is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlassq(n int, x []float64, incx int, scale float64, sumsq float64) (scl, smsq float64) { - switch { - case n < 0: - panic(nLT0) - case incx <= 0: - panic(badIncX) - case len(x) < 1+(n-1)*incx: - panic(shortX) - } - - if n == 0 { - return scale, sumsq - } - - for ix := 0; ix <= (n-1)*incx; ix += incx { - absxi := math.Abs(x[ix]) - if absxi > 0 || math.IsNaN(absxi) { - if scale < absxi { - sumsq = 1 + sumsq*(scale/absxi)*(scale/absxi) - scale = absxi - } else { - sumsq += (absxi / scale) * (absxi / scale) - } - } - } - return scale, sumsq -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasv2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlasv2.go deleted file mode 100644 index 204af19..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasv2.go +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import "math" - -// Dlasv2 computes the singular value decomposition of a 2×2 matrix. -// [ csl snl] [f g] [csr -snr] = [ssmax 0] -// [-snl csl] [0 h] [snr csr] = [ 0 ssmin] -// ssmax is the larger absolute singular value, and ssmin is the smaller absolute -// singular value. [cls, snl] and [csr, snr] are the left and right singular vectors. -// -// Dlasv2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlasv2(f, g, h float64) (ssmin, ssmax, snr, csr, snl, csl float64) { - ft := f - fa := math.Abs(ft) - ht := h - ha := math.Abs(h) - // pmax points to the largest element of the matrix in terms of absolute value. - // 1 if F, 2 if G, 3 if H. - pmax := 1 - swap := ha > fa - if swap { - pmax = 3 - ft, ht = ht, ft - fa, ha = ha, fa - } - gt := g - ga := math.Abs(gt) - var clt, crt, slt, srt float64 - if ga == 0 { - ssmin = ha - ssmax = fa - clt = 1 - crt = 1 - slt = 0 - srt = 0 - } else { - gasmall := true - if ga > fa { - pmax = 2 - if (fa / ga) < dlamchE { - gasmall = false - ssmax = ga - if ha > 1 { - ssmin = fa / (ga / ha) - } else { - ssmin = (fa / ga) * ha - } - clt = 1 - slt = ht / gt - srt = 1 - crt = ft / gt - } - } - if gasmall { - d := fa - ha - l := d / fa - if d == fa { // deal with inf - l = 1 - } - m := gt / ft - t := 2 - l - s := math.Hypot(t, m) - var r float64 - if l == 0 { - r = math.Abs(m) - } else { - r = math.Hypot(l, m) - } - a := 0.5 * (s + r) - ssmin = ha / a - ssmax = fa * a - if m == 0 { - if l == 0 { - t = math.Copysign(2, ft) * math.Copysign(1, gt) - } else { - t = gt/math.Copysign(d, ft) + m/t - } - } else { - t = (m/(s+t) + m/(r+l)) * (1 + a) - } - l = math.Hypot(t, 2) - crt = 2 / l - srt = t / l - clt = (crt + srt*m) / a - slt = (ht / ft) * srt / a - } - } - if swap { - csl = srt - snl = crt - csr = slt - snr = clt - } else { - csl = clt - snl = slt - csr = crt - snr = srt - } - var tsign float64 - switch pmax { - case 1: - tsign = math.Copysign(1, csr) * math.Copysign(1, csl) * math.Copysign(1, f) - case 2: - tsign = math.Copysign(1, snr) * math.Copysign(1, csl) * math.Copysign(1, g) - case 3: - tsign = math.Copysign(1, snr) * math.Copysign(1, snl) * math.Copysign(1, h) - } - ssmax = math.Copysign(ssmax, tsign) - ssmin = math.Copysign(ssmin, tsign*math.Copysign(1, f)*math.Copysign(1, h)) - return ssmin, ssmax, snr, csr, snl, csl -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaswp.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaswp.go deleted file mode 100644 index b207d12..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaswp.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import "gonum.org/v1/gonum/blas/blas64" - -// Dlaswp swaps the rows k1 to k2 of a rectangular matrix A according to the -// indices in ipiv so that row k is swapped with ipiv[k]. -// -// n is the number of columns of A and incX is the increment for ipiv. If incX -// is 1, the swaps are applied from k1 to k2. If incX is -1, the swaps are -// applied in reverse order from k2 to k1. For other values of incX Dlaswp will -// panic. ipiv must have length k2+1, otherwise Dlaswp will panic. -// -// The indices k1, k2, and the elements of ipiv are zero-based. -// -// Dlaswp is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlaswp(n int, a []float64, lda int, k1, k2 int, ipiv []int, incX int) { - switch { - case n < 0: - panic(nLT0) - case k2 < 0: - panic(badK2) - case k1 < 0 || k2 < k1: - panic(badK1) - case lda < max(1, n): - panic(badLdA) - case len(a) < (k2-1)*lda+n: - panic(shortA) - case len(ipiv) != k2+1: - panic(badLenIpiv) - case incX != 1 && incX != -1: - panic(absIncNotOne) - } - - if n == 0 { - return - } - - bi := blas64.Implementation() - if incX == 1 { - for k := k1; k <= k2; k++ { - bi.Dswap(n, a[k*lda:], 1, a[ipiv[k]*lda:], 1) - } - return - } - for k := k2; k >= k1; k-- { - bi.Dswap(n, a[k*lda:], 1, a[ipiv[k]*lda:], 1) - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasy2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlasy2.go deleted file mode 100644 index d670f40..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasy2.go +++ /dev/null @@ -1,290 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlasy2 solves the Sylvester matrix equation where the matrices are of order 1 -// or 2. It computes the unknown n1×n2 matrix X so that -// TL*X + sgn*X*TR = scale*B if tranl == false and tranr == false, -// TLᵀ*X + sgn*X*TR = scale*B if tranl == true and tranr == false, -// TL*X + sgn*X*TRᵀ = scale*B if tranl == false and tranr == true, -// TLᵀ*X + sgn*X*TRᵀ = scale*B if tranl == true and tranr == true, -// where TL is n1×n1, TR is n2×n2, B is n1×n2, and 1 <= n1,n2 <= 2. -// -// isgn must be 1 or -1, and n1 and n2 must be 0, 1, or 2, but these conditions -// are not checked. -// -// Dlasy2 returns three values, a scale factor that is chosen less than or equal -// to 1 to prevent the solution overflowing, the infinity norm of the solution, -// and an indicator of success. If ok is false, TL and TR have eigenvalues that -// are too close, so TL or TR is perturbed to get a non-singular equation. -// -// Dlasy2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlasy2(tranl, tranr bool, isgn, n1, n2 int, tl []float64, ldtl int, tr []float64, ldtr int, b []float64, ldb int, x []float64, ldx int) (scale, xnorm float64, ok bool) { - // TODO(vladimir-ch): Add input validation checks conditionally skipped - // using the build tag mechanism. - - ok = true - // Quick return if possible. - if n1 == 0 || n2 == 0 { - return scale, xnorm, ok - } - - // Set constants to control overflow. - eps := dlamchP - smlnum := dlamchS / eps - sgn := float64(isgn) - - if n1 == 1 && n2 == 1 { - // 1×1 case: TL11*X + sgn*X*TR11 = B11. - tau1 := tl[0] + sgn*tr[0] - bet := math.Abs(tau1) - if bet <= smlnum { - tau1 = smlnum - bet = smlnum - ok = false - } - scale = 1 - gam := math.Abs(b[0]) - if smlnum*gam > bet { - scale = 1 / gam - } - x[0] = b[0] * scale / tau1 - xnorm = math.Abs(x[0]) - return scale, xnorm, ok - } - - if n1+n2 == 3 { - // 1×2 or 2×1 case. - var ( - smin float64 - tmp [4]float64 // tmp is used as a 2×2 row-major matrix. - btmp [2]float64 - ) - if n1 == 1 && n2 == 2 { - // 1×2 case: TL11*[X11 X12] + sgn*[X11 X12]*op[TR11 TR12] = [B11 B12]. - // [TR21 TR22] - smin = math.Abs(tl[0]) - smin = math.Max(smin, math.Max(math.Abs(tr[0]), math.Abs(tr[1]))) - smin = math.Max(smin, math.Max(math.Abs(tr[ldtr]), math.Abs(tr[ldtr+1]))) - smin = math.Max(eps*smin, smlnum) - tmp[0] = tl[0] + sgn*tr[0] - tmp[3] = tl[0] + sgn*tr[ldtr+1] - if tranr { - tmp[1] = sgn * tr[1] - tmp[2] = sgn * tr[ldtr] - } else { - tmp[1] = sgn * tr[ldtr] - tmp[2] = sgn * tr[1] - } - btmp[0] = b[0] - btmp[1] = b[1] - } else { - // 2×1 case: op[TL11 TL12]*[X11] + sgn*[X11]*TR11 = [B11]. - // [TL21 TL22]*[X21] [X21] [B21] - smin = math.Abs(tr[0]) - smin = math.Max(smin, math.Max(math.Abs(tl[0]), math.Abs(tl[1]))) - smin = math.Max(smin, math.Max(math.Abs(tl[ldtl]), math.Abs(tl[ldtl+1]))) - smin = math.Max(eps*smin, smlnum) - tmp[0] = tl[0] + sgn*tr[0] - tmp[3] = tl[ldtl+1] + sgn*tr[0] - if tranl { - tmp[1] = tl[ldtl] - tmp[2] = tl[1] - } else { - tmp[1] = tl[1] - tmp[2] = tl[ldtl] - } - btmp[0] = b[0] - btmp[1] = b[ldb] - } - - // Solve 2×2 system using complete pivoting. - // Set pivots less than smin to smin. - - bi := blas64.Implementation() - ipiv := bi.Idamax(len(tmp), tmp[:], 1) - // Compute the upper triangular matrix [u11 u12]. - // [ 0 u22] - u11 := tmp[ipiv] - if math.Abs(u11) <= smin { - ok = false - u11 = smin - } - locu12 := [4]int{1, 0, 3, 2} // Index in tmp of the element on the same row as the pivot. - u12 := tmp[locu12[ipiv]] - locl21 := [4]int{2, 3, 0, 1} // Index in tmp of the element on the same column as the pivot. - l21 := tmp[locl21[ipiv]] / u11 - locu22 := [4]int{3, 2, 1, 0} // Index in tmp of the remaining element. - u22 := tmp[locu22[ipiv]] - l21*u12 - if math.Abs(u22) <= smin { - ok = false - u22 = smin - } - if ipiv&0x2 != 0 { // true for ipiv equal to 2 and 3. - // The pivot was in the second row, swap the elements of - // the right-hand side. - btmp[0], btmp[1] = btmp[1], btmp[0]-l21*btmp[1] - } else { - btmp[1] -= l21 * btmp[0] - } - scale = 1 - if 2*smlnum*math.Abs(btmp[1]) > math.Abs(u22) || 2*smlnum*math.Abs(btmp[0]) > math.Abs(u11) { - scale = 0.5 / math.Max(math.Abs(btmp[0]), math.Abs(btmp[1])) - btmp[0] *= scale - btmp[1] *= scale - } - // Solve the system [u11 u12] [x21] = [ btmp[0] ]. - // [ 0 u22] [x22] [ btmp[1] ] - x22 := btmp[1] / u22 - x21 := btmp[0]/u11 - (u12/u11)*x22 - if ipiv&0x1 != 0 { // true for ipiv equal to 1 and 3. - // The pivot was in the second column, swap the elements - // of the solution. - x21, x22 = x22, x21 - } - x[0] = x21 - if n1 == 1 { - x[1] = x22 - xnorm = math.Abs(x[0]) + math.Abs(x[1]) - } else { - x[ldx] = x22 - xnorm = math.Max(math.Abs(x[0]), math.Abs(x[ldx])) - } - return scale, xnorm, ok - } - - // 2×2 case: op[TL11 TL12]*[X11 X12] + SGN*[X11 X12]*op[TR11 TR12] = [B11 B12]. - // [TL21 TL22] [X21 X22] [X21 X22] [TR21 TR22] [B21 B22] - // - // Solve equivalent 4×4 system using complete pivoting. - // Set pivots less than smin to smin. - - smin := math.Max(math.Abs(tr[0]), math.Abs(tr[1])) - smin = math.Max(smin, math.Max(math.Abs(tr[ldtr]), math.Abs(tr[ldtr+1]))) - smin = math.Max(smin, math.Max(math.Abs(tl[0]), math.Abs(tl[1]))) - smin = math.Max(smin, math.Max(math.Abs(tl[ldtl]), math.Abs(tl[ldtl+1]))) - smin = math.Max(eps*smin, smlnum) - - var t [4][4]float64 - t[0][0] = tl[0] + sgn*tr[0] - t[1][1] = tl[0] + sgn*tr[ldtr+1] - t[2][2] = tl[ldtl+1] + sgn*tr[0] - t[3][3] = tl[ldtl+1] + sgn*tr[ldtr+1] - if tranl { - t[0][2] = tl[ldtl] - t[1][3] = tl[ldtl] - t[2][0] = tl[1] - t[3][1] = tl[1] - } else { - t[0][2] = tl[1] - t[1][3] = tl[1] - t[2][0] = tl[ldtl] - t[3][1] = tl[ldtl] - } - if tranr { - t[0][1] = sgn * tr[1] - t[1][0] = sgn * tr[ldtr] - t[2][3] = sgn * tr[1] - t[3][2] = sgn * tr[ldtr] - } else { - t[0][1] = sgn * tr[ldtr] - t[1][0] = sgn * tr[1] - t[2][3] = sgn * tr[ldtr] - t[3][2] = sgn * tr[1] - } - - var btmp [4]float64 - btmp[0] = b[0] - btmp[1] = b[1] - btmp[2] = b[ldb] - btmp[3] = b[ldb+1] - - // Perform elimination. - var jpiv [4]int // jpiv records any column swaps for pivoting. - for i := 0; i < 3; i++ { - var ( - xmax float64 - ipsv, jpsv int - ) - for ip := i; ip < 4; ip++ { - for jp := i; jp < 4; jp++ { - if math.Abs(t[ip][jp]) >= xmax { - xmax = math.Abs(t[ip][jp]) - ipsv = ip - jpsv = jp - } - } - } - if ipsv != i { - // The pivot is not in the top row of the unprocessed - // block, swap rows ipsv and i of t and btmp. - t[ipsv], t[i] = t[i], t[ipsv] - btmp[ipsv], btmp[i] = btmp[i], btmp[ipsv] - } - if jpsv != i { - // The pivot is not in the left column of the - // unprocessed block, swap columns jpsv and i of t. - for k := 0; k < 4; k++ { - t[k][jpsv], t[k][i] = t[k][i], t[k][jpsv] - } - } - jpiv[i] = jpsv - if math.Abs(t[i][i]) < smin { - ok = false - t[i][i] = smin - } - for k := i + 1; k < 4; k++ { - t[k][i] /= t[i][i] - btmp[k] -= t[k][i] * btmp[i] - for j := i + 1; j < 4; j++ { - t[k][j] -= t[k][i] * t[i][j] - } - } - } - if math.Abs(t[3][3]) < smin { - ok = false - t[3][3] = smin - } - scale = 1 - if 8*smlnum*math.Abs(btmp[0]) > math.Abs(t[0][0]) || - 8*smlnum*math.Abs(btmp[1]) > math.Abs(t[1][1]) || - 8*smlnum*math.Abs(btmp[2]) > math.Abs(t[2][2]) || - 8*smlnum*math.Abs(btmp[3]) > math.Abs(t[3][3]) { - - maxbtmp := math.Max(math.Abs(btmp[0]), math.Abs(btmp[1])) - maxbtmp = math.Max(maxbtmp, math.Max(math.Abs(btmp[2]), math.Abs(btmp[3]))) - scale = 1 / 8 / maxbtmp - btmp[0] *= scale - btmp[1] *= scale - btmp[2] *= scale - btmp[3] *= scale - } - // Compute the solution of the upper triangular system t * tmp = btmp. - var tmp [4]float64 - for i := 3; i >= 0; i-- { - temp := 1 / t[i][i] - tmp[i] = btmp[i] * temp - for j := i + 1; j < 4; j++ { - tmp[i] -= temp * t[i][j] * tmp[j] - } - } - for i := 2; i >= 0; i-- { - if jpiv[i] != i { - tmp[i], tmp[jpiv[i]] = tmp[jpiv[i]], tmp[i] - } - } - x[0] = tmp[0] - x[1] = tmp[1] - x[ldx] = tmp[2] - x[ldx+1] = tmp[3] - xnorm = math.Max(math.Abs(tmp[0])+math.Abs(tmp[1]), math.Abs(tmp[2])+math.Abs(tmp[3])) - return scale, xnorm, ok -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlatbs.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlatbs.go deleted file mode 100644 index 0d3cf9f..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlatbs.go +++ /dev/null @@ -1,452 +0,0 @@ -// Copyright ©2019 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlatbs solves a triangular banded system of equations -// A * x = s*b if trans == blas.NoTrans -// Aᵀ * x = s*b if trans == blas.Trans or blas.ConjTrans -// where A is an upper or lower triangular band matrix, x and b are n-element -// vectors, and s is a scaling factor chosen so that the components of x will be -// less than the overflow threshold. -// -// On entry, x contains the right-hand side b of the triangular system. -// On return, x is overwritten by the solution vector x. -// -// normin specifies whether the cnorm parameter contains the column norms of A on -// entry. If it is true, cnorm[j] contains the norm of the off-diagonal part of -// the j-th column of A. If it is false, the norms will be computed and stored -// in cnorm. -// -// Dlatbs returns the scaling factor s for the triangular system. If the matrix -// A is singular (A[j,j]==0 for some j), then scale is set to 0 and a -// non-trivial solution to A*x = 0 is returned. -// -// Dlatbs is an internal routine. It is exported for testing purposes. -func (Implementation) Dlatbs(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, normin bool, n, kd int, ab []float64, ldab int, x, cnorm []float64) (scale float64) { - noTran := trans == blas.NoTrans - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case !noTran && trans != blas.Trans && trans != blas.ConjTrans: - panic(badTrans) - case diag != blas.NonUnit && diag != blas.Unit: - panic(badDiag) - case n < 0: - panic(nLT0) - case kd < 0: - panic(kdLT0) - case ldab < kd+1: - panic(badLdA) - } - - // Quick return if possible. - if n == 0 { - return 0 - } - - switch { - case len(ab) < (n-1)*ldab+kd+1: - panic(shortAB) - case len(x) < n: - panic(shortX) - case len(cnorm) < n: - panic(shortCNorm) - } - - // Parameters to control overflow. - smlnum := dlamchS / dlamchP - bignum := 1 / smlnum - - bi := blas64.Implementation() - kld := max(1, ldab-1) - if !normin { - // Compute the 1-norm of each column, not including the diagonal. - if uplo == blas.Upper { - for j := 0; j < n; j++ { - jlen := min(j, kd) - if jlen > 0 { - cnorm[j] = bi.Dasum(jlen, ab[(j-jlen)*ldab+jlen:], kld) - } else { - cnorm[j] = 0 - } - } - } else { - for j := 0; j < n; j++ { - jlen := min(n-j-1, kd) - if jlen > 0 { - cnorm[j] = bi.Dasum(jlen, ab[(j+1)*ldab+kd-1:], kld) - } else { - cnorm[j] = 0 - } - } - } - } - - // Set up indices and increments for loops below. - var ( - jFirst, jLast, jInc int - maind int - ) - if noTran { - if uplo == blas.Upper { - jFirst = n - 1 - jLast = -1 - jInc = -1 - maind = 0 - } else { - jFirst = 0 - jLast = n - jInc = 1 - maind = kd - } - } else { - if uplo == blas.Upper { - jFirst = 0 - jLast = n - jInc = 1 - maind = 0 - } else { - jFirst = n - 1 - jLast = -1 - jInc = -1 - maind = kd - } - } - - // Scale the column norms by tscal if the maximum element in cnorm is - // greater than bignum. - tmax := cnorm[bi.Idamax(n, cnorm, 1)] - tscal := 1.0 - if tmax > bignum { - tscal = 1 / (smlnum * tmax) - bi.Dscal(n, tscal, cnorm, 1) - } - - // Compute a bound on the computed solution vector to see if the Level 2 - // BLAS routine Dtbsv can be used. - - xMax := math.Abs(x[bi.Idamax(n, x, 1)]) - xBnd := xMax - grow := 0.0 - // Compute the growth only if the maximum element in cnorm is NOT greater - // than bignum. - if tscal != 1 { - goto skipComputeGrow - } - if noTran { - // Compute the growth in A * x = b. - if diag == blas.NonUnit { - // A is non-unit triangular. - // - // Compute grow = 1/G_j and xBnd = 1/M_j. - // Initially, G_0 = max{x(i), i=1,...,n}. - grow = 1 / math.Max(xBnd, smlnum) - xBnd = grow - for j := jFirst; j != jLast; j += jInc { - if grow <= smlnum { - // Exit the loop because the growth factor is too small. - goto skipComputeGrow - } - // M_j = G_{j-1} / abs(A[j,j]) - tjj := math.Abs(ab[j*ldab+maind]) - xBnd = math.Min(xBnd, math.Min(1, tjj)*grow) - if tjj+cnorm[j] >= smlnum { - // G_j = G_{j-1}*( 1 + cnorm[j] / abs(A[j,j]) ) - grow *= tjj / (tjj + cnorm[j]) - } else { - // G_j could overflow, set grow to 0. - grow = 0 - } - } - grow = xBnd - } else { - // A is unit triangular. - // - // Compute grow = 1/G_j, where G_0 = max{x(i), i=1,...,n}. - grow = math.Min(1, 1/math.Max(xBnd, smlnum)) - for j := jFirst; j != jLast; j += jInc { - if grow <= smlnum { - // Exit the loop because the growth factor is too small. - goto skipComputeGrow - } - // G_j = G_{j-1}*( 1 + cnorm[j] ) - grow /= 1 + cnorm[j] - } - } - } else { - // Compute the growth in Aᵀ * x = b. - if diag == blas.NonUnit { - // A is non-unit triangular. - // - // Compute grow = 1/G_j and xBnd = 1/M_j. - // Initially, G_0 = max{x(i), i=1,...,n}. - grow = 1 / math.Max(xBnd, smlnum) - xBnd = grow - for j := jFirst; j != jLast; j += jInc { - if grow <= smlnum { - // Exit the loop because the growth factor is too small. - goto skipComputeGrow - } - // G_j = max( G_{j-1}, M_{j-1}*( 1 + cnorm[j] ) ) - xj := 1 + cnorm[j] - grow = math.Min(grow, xBnd/xj) - // M_j = M_{j-1}*( 1 + cnorm[j] ) / abs(A[j,j]) - tjj := math.Abs(ab[j*ldab+maind]) - if xj > tjj { - xBnd *= tjj / xj - } - } - grow = math.Min(grow, xBnd) - } else { - // A is unit triangular. - // - // Compute grow = 1/G_j, where G_0 = max{x(i), i=1,...,n}. - grow = math.Min(1, 1/math.Max(xBnd, smlnum)) - for j := jFirst; j != jLast; j += jInc { - if grow <= smlnum { - // Exit the loop because the growth factor is too small. - goto skipComputeGrow - } - // G_j = G_{j-1}*( 1 + cnorm[j] ) - grow /= 1 + cnorm[j] - } - } - } -skipComputeGrow: - - if grow*tscal > smlnum { - // The reciprocal of the bound on elements of X is not too small, use - // the Level 2 BLAS solve. - bi.Dtbsv(uplo, trans, diag, n, kd, ab, ldab, x, 1) - // Scale the column norms by 1/tscal for return. - if tscal != 1 { - bi.Dscal(n, 1/tscal, cnorm, 1) - } - return 1 - } - - // Use a Level 1 BLAS solve, scaling intermediate results. - - scale = 1 - if xMax > bignum { - // Scale x so that its components are less than or equal to bignum in - // absolute value. - scale = bignum / xMax - bi.Dscal(n, scale, x, 1) - xMax = bignum - } - - if noTran { - // Solve A * x = b. - for j := jFirst; j != jLast; j += jInc { - // Compute x[j] = b[j] / A[j,j], scaling x if necessary. - xj := math.Abs(x[j]) - tjjs := tscal - if diag == blas.NonUnit { - tjjs *= ab[j*ldab+maind] - } - tjj := math.Abs(tjjs) - switch { - case tjj > smlnum: - // smlnum < abs(A[j,j]) - if tjj < 1 && xj > tjj*bignum { - // Scale x by 1/b[j]. - rec := 1 / xj - bi.Dscal(n, rec, x, 1) - scale *= rec - xMax *= rec - } - x[j] /= tjjs - xj = math.Abs(x[j]) - case tjj > 0: - // 0 < abs(A[j,j]) <= smlnum - if xj > tjj*bignum { - // Scale x by (1/abs(x[j]))*abs(A[j,j])*bignum to avoid - // overflow when dividing by A[j,j]. - rec := tjj * bignum / xj - if cnorm[j] > 1 { - // Scale by 1/cnorm[j] to avoid overflow when - // multiplying x[j] times column j. - rec /= cnorm[j] - } - bi.Dscal(n, rec, x, 1) - scale *= rec - xMax *= rec - } - x[j] /= tjjs - xj = math.Abs(x[j]) - default: - // A[j,j] == 0: Set x[0:n] = 0, x[j] = 1, and scale = 0, and - // compute a solution to A*x = 0. - for i := range x[:n] { - x[i] = 0 - } - x[j] = 1 - xj = 1 - scale = 0 - xMax = 0 - } - - // Scale x if necessary to avoid overflow when adding a multiple of - // column j of A. - switch { - case xj > 1: - rec := 1 / xj - if cnorm[j] > (bignum-xMax)*rec { - // Scale x by 1/(2*abs(x[j])). - rec *= 0.5 - bi.Dscal(n, rec, x, 1) - scale *= rec - } - case xj*cnorm[j] > bignum-xMax: - // Scale x by 1/2. - bi.Dscal(n, 0.5, x, 1) - scale *= 0.5 - } - - if uplo == blas.Upper { - if j > 0 { - // Compute the update - // x[max(0,j-kd):j] := x[max(0,j-kd):j] - x[j] * A[max(0,j-kd):j,j] - jlen := min(j, kd) - if jlen > 0 { - bi.Daxpy(jlen, -x[j]*tscal, ab[(j-jlen)*ldab+jlen:], kld, x[j-jlen:], 1) - } - i := bi.Idamax(j, x, 1) - xMax = math.Abs(x[i]) - } - } else if j < n-1 { - // Compute the update - // x[j+1:min(j+kd,n)] := x[j+1:min(j+kd,n)] - x[j] * A[j+1:min(j+kd,n),j] - jlen := min(kd, n-j-1) - if jlen > 0 { - bi.Daxpy(jlen, -x[j]*tscal, ab[(j+1)*ldab+kd-1:], kld, x[j+1:], 1) - } - i := j + 1 + bi.Idamax(n-j-1, x[j+1:], 1) - xMax = math.Abs(x[i]) - } - } - } else { - // Solve Aᵀ * x = b. - for j := jFirst; j != jLast; j += jInc { - // Compute x[j] = b[j] - sum A[k,j]*x[k]. - // k!=j - xj := math.Abs(x[j]) - tjjs := tscal - if diag == blas.NonUnit { - tjjs *= ab[j*ldab+maind] - } - tjj := math.Abs(tjjs) - rec := 1 / math.Max(1, xMax) - uscal := tscal - if cnorm[j] > (bignum-xj)*rec { - // If x[j] could overflow, scale x by 1/(2*xMax). - rec *= 0.5 - if tjj > 1 { - // Divide by A[j,j] when scaling x if A[j,j] > 1. - rec = math.Min(1, rec*tjj) - uscal /= tjjs - } - if rec < 1 { - bi.Dscal(n, rec, x, 1) - scale *= rec - xMax *= rec - } - } - - var sumj float64 - if uscal == 1 { - // If the scaling needed for A in the dot product is 1, call - // Ddot to perform the dot product... - if uplo == blas.Upper { - jlen := min(j, kd) - if jlen > 0 { - sumj = bi.Ddot(jlen, ab[(j-jlen)*ldab+jlen:], kld, x[j-jlen:], 1) - } - } else { - jlen := min(n-j-1, kd) - if jlen > 0 { - sumj = bi.Ddot(jlen, ab[(j+1)*ldab+kd-1:], kld, x[j+1:], 1) - } - } - } else { - // ...otherwise, use in-line code for the dot product. - if uplo == blas.Upper { - jlen := min(j, kd) - for i := 0; i < jlen; i++ { - sumj += (ab[(j-jlen+i)*ldab+jlen-i] * uscal) * x[j-jlen+i] - } - } else { - jlen := min(n-j-1, kd) - for i := 0; i < jlen; i++ { - sumj += (ab[(j+1+i)*ldab+kd-1-i] * uscal) * x[j+i+1] - } - } - } - - if uscal == tscal { - // Compute x[j] := ( x[j] - sumj ) / A[j,j] - // if 1/A[j,j] was not used to scale the dot product. - x[j] -= sumj - xj = math.Abs(x[j]) - // Compute x[j] = x[j] / A[j,j], scaling if necessary. - // Note: the reference implementation skips this step for blas.Unit matrices - // when tscal is equal to 1 but it complicates the logic and only saves - // the comparison and division in the first switch-case. Not skipping it - // is also consistent with the NoTrans case above. - switch { - case tjj > smlnum: - // smlnum < abs(A[j,j]): - if tjj < 1 && xj > tjj*bignum { - // Scale x by 1/abs(x[j]). - rec := 1 / xj - bi.Dscal(n, rec, x, 1) - scale *= rec - xMax *= rec - } - x[j] /= tjjs - case tjj > 0: - // 0 < abs(A[j,j]) <= smlnum: - if xj > tjj*bignum { - // Scale x by (1/abs(x[j]))*abs(A[j,j])*bignum. - rec := (tjj * bignum) / xj - bi.Dscal(n, rec, x, 1) - scale *= rec - xMax *= rec - } - x[j] /= tjjs - default: - // A[j,j] == 0: Set x[0:n] = 0, x[j] = 1, and scale = 0, and - // compute a solution Aᵀ * x = 0. - for i := range x[:n] { - x[i] = 0 - } - x[j] = 1 - scale = 0 - xMax = 0 - } - } else { - // Compute x[j] := x[j] / A[j,j] - sumj - // if the dot product has already been divided by 1/A[j,j]. - x[j] = x[j]/tjjs - sumj - } - xMax = math.Max(xMax, math.Abs(x[j])) - } - scale /= tscal - } - - // Scale the column norms by 1/tscal for return. - if tscal != 1 { - bi.Dscal(n, 1/tscal, cnorm, 1) - } - return scale -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlatrd.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlatrd.go deleted file mode 100644 index 1e057aa..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlatrd.go +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlatrd reduces nb rows and columns of a real n×n symmetric matrix A to symmetric -// tridiagonal form. It computes the orthonormal similarity transformation -// Qᵀ * A * Q -// and returns the matrices V and W to apply to the unreduced part of A. If -// uplo == blas.Upper, the upper triangle is supplied and the last nb rows are -// reduced. If uplo == blas.Lower, the lower triangle is supplied and the first -// nb rows are reduced. -// -// a contains the symmetric matrix on entry with active triangular half specified -// by uplo. On exit, the nb columns have been reduced to tridiagonal form. The -// diagonal contains the diagonal of the reduced matrix, the off-diagonal is -// set to 1, and the remaining elements contain the data to construct Q. -// -// If uplo == blas.Upper, with n = 5 and nb = 2 on exit a is -// [ a a a v4 v5] -// [ a a v4 v5] -// [ a 1 v5] -// [ d 1] -// [ d] -// -// If uplo == blas.Lower, with n = 5 and nb = 2, on exit a is -// [ d ] -// [ 1 d ] -// [v1 1 a ] -// [v1 v2 a a ] -// [v1 v2 a a a] -// -// e contains the superdiagonal elements of the reduced matrix. If uplo == blas.Upper, -// e[n-nb:n-1] contains the last nb columns of the reduced matrix, while if -// uplo == blas.Lower, e[:nb] contains the first nb columns of the reduced matrix. -// e must have length at least n-1, and Dlatrd will panic otherwise. -// -// tau contains the scalar factors of the elementary reflectors needed to construct Q. -// The reflectors are stored in tau[n-nb:n-1] if uplo == blas.Upper, and in -// tau[:nb] if uplo == blas.Lower. tau must have length n-1, and Dlatrd will panic -// otherwise. -// -// w is an n×nb matrix. On exit it contains the data to update the unreduced part -// of A. -// -// The matrix Q is represented as a product of elementary reflectors. Each reflector -// H has the form -// I - tau * v * vᵀ -// If uplo == blas.Upper, -// Q = H_{n-1} * H_{n-2} * ... * H_{n-nb} -// where v[:i-1] is stored in A[:i-1,i], v[i-1] = 1, and v[i:n] = 0. -// -// If uplo == blas.Lower, -// Q = H_0 * H_1 * ... * H_{nb-1} -// where v[:i+1] = 0, v[i+1] = 1, and v[i+2:n] is stored in A[i+2:n,i]. -// -// The vectors v form the n×nb matrix V which is used with W to apply a -// symmetric rank-2 update to the unreduced part of A -// A = A - V * Wᵀ - W * Vᵀ -// -// Dlatrd is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlatrd(uplo blas.Uplo, n, nb int, a []float64, lda int, e, tau, w []float64, ldw int) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case nb < 0: - panic(nbLT0) - case nb > n: - panic(nbGTN) - case lda < max(1, n): - panic(badLdA) - case ldw < max(1, nb): - panic(badLdW) - } - - if n == 0 { - return - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(w) < (n-1)*ldw+nb: - panic(shortW) - case len(e) < n-1: - panic(shortE) - case len(tau) < n-1: - panic(shortTau) - } - - bi := blas64.Implementation() - - if uplo == blas.Upper { - for i := n - 1; i >= n-nb; i-- { - iw := i - n + nb - if i < n-1 { - // Update A(0:i, i). - bi.Dgemv(blas.NoTrans, i+1, n-i-1, -1, a[i+1:], lda, - w[i*ldw+iw+1:], 1, 1, a[i:], lda) - bi.Dgemv(blas.NoTrans, i+1, n-i-1, -1, w[iw+1:], ldw, - a[i*lda+i+1:], 1, 1, a[i:], lda) - } - if i > 0 { - // Generate elementary reflector H_i to annihilate A(0:i-2,i). - e[i-1], tau[i-1] = impl.Dlarfg(i, a[(i-1)*lda+i], a[i:], lda) - a[(i-1)*lda+i] = 1 - - // Compute W(0:i-1, i). - bi.Dsymv(blas.Upper, i, 1, a, lda, a[i:], lda, 0, w[iw:], ldw) - if i < n-1 { - bi.Dgemv(blas.Trans, i, n-i-1, 1, w[iw+1:], ldw, - a[i:], lda, 0, w[(i+1)*ldw+iw:], ldw) - bi.Dgemv(blas.NoTrans, i, n-i-1, -1, a[i+1:], lda, - w[(i+1)*ldw+iw:], ldw, 1, w[iw:], ldw) - bi.Dgemv(blas.Trans, i, n-i-1, 1, a[i+1:], lda, - a[i:], lda, 0, w[(i+1)*ldw+iw:], ldw) - bi.Dgemv(blas.NoTrans, i, n-i-1, -1, w[iw+1:], ldw, - w[(i+1)*ldw+iw:], ldw, 1, w[iw:], ldw) - } - bi.Dscal(i, tau[i-1], w[iw:], ldw) - alpha := -0.5 * tau[i-1] * bi.Ddot(i, w[iw:], ldw, a[i:], lda) - bi.Daxpy(i, alpha, a[i:], lda, w[iw:], ldw) - } - } - } else { - // Reduce first nb columns of lower triangle. - for i := 0; i < nb; i++ { - // Update A(i:n, i) - bi.Dgemv(blas.NoTrans, n-i, i, -1, a[i*lda:], lda, - w[i*ldw:], 1, 1, a[i*lda+i:], lda) - bi.Dgemv(blas.NoTrans, n-i, i, -1, w[i*ldw:], ldw, - a[i*lda:], 1, 1, a[i*lda+i:], lda) - if i < n-1 { - // Generate elementary reflector H_i to annihilate A(i+2:n,i). - e[i], tau[i] = impl.Dlarfg(n-i-1, a[(i+1)*lda+i], a[min(i+2, n-1)*lda+i:], lda) - a[(i+1)*lda+i] = 1 - - // Compute W(i+1:n,i). - bi.Dsymv(blas.Lower, n-i-1, 1, a[(i+1)*lda+i+1:], lda, - a[(i+1)*lda+i:], lda, 0, w[(i+1)*ldw+i:], ldw) - bi.Dgemv(blas.Trans, n-i-1, i, 1, w[(i+1)*ldw:], ldw, - a[(i+1)*lda+i:], lda, 0, w[i:], ldw) - bi.Dgemv(blas.NoTrans, n-i-1, i, -1, a[(i+1)*lda:], lda, - w[i:], ldw, 1, w[(i+1)*ldw+i:], ldw) - bi.Dgemv(blas.Trans, n-i-1, i, 1, a[(i+1)*lda:], lda, - a[(i+1)*lda+i:], lda, 0, w[i:], ldw) - bi.Dgemv(blas.NoTrans, n-i-1, i, -1, w[(i+1)*ldw:], ldw, - w[i:], ldw, 1, w[(i+1)*ldw+i:], ldw) - bi.Dscal(n-i-1, tau[i], w[(i+1)*ldw+i:], ldw) - alpha := -0.5 * tau[i] * bi.Ddot(n-i-1, w[(i+1)*ldw+i:], ldw, - a[(i+1)*lda+i:], lda) - bi.Daxpy(n-i-1, alpha, a[(i+1)*lda+i:], lda, - w[(i+1)*ldw+i:], ldw) - } - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlatrs.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlatrs.go deleted file mode 100644 index 73970bc..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlatrs.go +++ /dev/null @@ -1,359 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlatrs solves a triangular system of equations scaled to prevent overflow. It -// solves -// A * x = scale * b if trans == blas.NoTrans -// Aᵀ * x = scale * b if trans == blas.Trans -// where the scale s is set for numeric stability. -// -// A is an n×n triangular matrix. On entry, the slice x contains the values of -// b, and on exit it contains the solution vector x. -// -// If normin == true, cnorm is an input and cnorm[j] contains the norm of the off-diagonal -// part of the j^th column of A. If trans == blas.NoTrans, cnorm[j] must be greater -// than or equal to the infinity norm, and greater than or equal to the one-norm -// otherwise. If normin == false, then cnorm is treated as an output, and is set -// to contain the 1-norm of the off-diagonal part of the j^th column of A. -// -// Dlatrs is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlatrs(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, normin bool, n int, a []float64, lda int, x []float64, cnorm []float64) (scale float64) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case trans != blas.NoTrans && trans != blas.Trans && trans != blas.ConjTrans: - panic(badTrans) - case diag != blas.Unit && diag != blas.NonUnit: - panic(badDiag) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if n == 0 { - return 0 - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(x) < n: - panic(shortX) - case len(cnorm) < n: - panic(shortCNorm) - } - - upper := uplo == blas.Upper - nonUnit := diag == blas.NonUnit - - smlnum := dlamchS / dlamchP - bignum := 1 / smlnum - scale = 1 - - bi := blas64.Implementation() - - if !normin { - if upper { - cnorm[0] = 0 - for j := 1; j < n; j++ { - cnorm[j] = bi.Dasum(j, a[j:], lda) - } - } else { - for j := 0; j < n-1; j++ { - cnorm[j] = bi.Dasum(n-j-1, a[(j+1)*lda+j:], lda) - } - cnorm[n-1] = 0 - } - } - // Scale the column norms by tscal if the maximum element in cnorm is greater than bignum. - imax := bi.Idamax(n, cnorm, 1) - tmax := cnorm[imax] - var tscal float64 - if tmax <= bignum { - tscal = 1 - } else { - tscal = 1 / (smlnum * tmax) - bi.Dscal(n, tscal, cnorm, 1) - } - - // Compute a bound on the computed solution vector to see if bi.Dtrsv can be used. - j := bi.Idamax(n, x, 1) - xmax := math.Abs(x[j]) - xbnd := xmax - var grow float64 - var jfirst, jlast, jinc int - if trans == blas.NoTrans { - if upper { - jfirst = n - 1 - jlast = -1 - jinc = -1 - } else { - jfirst = 0 - jlast = n - jinc = 1 - } - // Compute the growth in A * x = b. - if tscal != 1 { - grow = 0 - goto Solve - } - if nonUnit { - grow = 1 / math.Max(xbnd, smlnum) - xbnd = grow - for j := jfirst; j != jlast; j += jinc { - if grow <= smlnum { - goto Solve - } - tjj := math.Abs(a[j*lda+j]) - xbnd = math.Min(xbnd, math.Min(1, tjj)*grow) - if tjj+cnorm[j] >= smlnum { - grow *= tjj / (tjj + cnorm[j]) - } else { - grow = 0 - } - } - grow = xbnd - } else { - grow = math.Min(1, 1/math.Max(xbnd, smlnum)) - for j := jfirst; j != jlast; j += jinc { - if grow <= smlnum { - goto Solve - } - grow *= 1 / (1 + cnorm[j]) - } - } - } else { - if upper { - jfirst = 0 - jlast = n - jinc = 1 - } else { - jfirst = n - 1 - jlast = -1 - jinc = -1 - } - if tscal != 1 { - grow = 0 - goto Solve - } - if nonUnit { - grow = 1 / (math.Max(xbnd, smlnum)) - xbnd = grow - for j := jfirst; j != jlast; j += jinc { - if grow <= smlnum { - goto Solve - } - xj := 1 + cnorm[j] - grow = math.Min(grow, xbnd/xj) - tjj := math.Abs(a[j*lda+j]) - if xj > tjj { - xbnd *= tjj / xj - } - } - grow = math.Min(grow, xbnd) - } else { - grow = math.Min(1, 1/math.Max(xbnd, smlnum)) - for j := jfirst; j != jlast; j += jinc { - if grow <= smlnum { - goto Solve - } - xj := 1 + cnorm[j] - grow /= xj - } - } - } - -Solve: - if grow*tscal > smlnum { - // Use the Level 2 BLAS solve if the reciprocal of the bound on - // elements of X is not too small. - bi.Dtrsv(uplo, trans, diag, n, a, lda, x, 1) - if tscal != 1 { - bi.Dscal(n, 1/tscal, cnorm, 1) - } - return scale - } - - // Use a Level 1 BLAS solve, scaling intermediate results. - if xmax > bignum { - scale = bignum / xmax - bi.Dscal(n, scale, x, 1) - xmax = bignum - } - if trans == blas.NoTrans { - for j := jfirst; j != jlast; j += jinc { - xj := math.Abs(x[j]) - var tjj, tjjs float64 - if nonUnit { - tjjs = a[j*lda+j] * tscal - } else { - tjjs = tscal - if tscal == 1 { - goto Skip1 - } - } - tjj = math.Abs(tjjs) - if tjj > smlnum { - if tjj < 1 { - if xj > tjj*bignum { - rec := 1 / xj - bi.Dscal(n, rec, x, 1) - scale *= rec - xmax *= rec - } - } - x[j] /= tjjs - xj = math.Abs(x[j]) - } else if tjj > 0 { - if xj > tjj*bignum { - rec := (tjj * bignum) / xj - if cnorm[j] > 1 { - rec /= cnorm[j] - } - bi.Dscal(n, rec, x, 1) - scale *= rec - xmax *= rec - } - x[j] /= tjjs - xj = math.Abs(x[j]) - } else { - for i := 0; i < n; i++ { - x[i] = 0 - } - x[j] = 1 - xj = 1 - scale = 0 - xmax = 0 - } - Skip1: - if xj > 1 { - rec := 1 / xj - if cnorm[j] > (bignum-xmax)*rec { - rec *= 0.5 - bi.Dscal(n, rec, x, 1) - scale *= rec - } - } else if xj*cnorm[j] > bignum-xmax { - bi.Dscal(n, 0.5, x, 1) - scale *= 0.5 - } - if upper { - if j > 0 { - bi.Daxpy(j, -x[j]*tscal, a[j:], lda, x, 1) - i := bi.Idamax(j, x, 1) - xmax = math.Abs(x[i]) - } - } else { - if j < n-1 { - bi.Daxpy(n-j-1, -x[j]*tscal, a[(j+1)*lda+j:], lda, x[j+1:], 1) - i := j + bi.Idamax(n-j-1, x[j+1:], 1) - xmax = math.Abs(x[i]) - } - } - } - } else { - for j := jfirst; j != jlast; j += jinc { - xj := math.Abs(x[j]) - uscal := tscal - rec := 1 / math.Max(xmax, 1) - var tjjs float64 - if cnorm[j] > (bignum-xj)*rec { - rec *= 0.5 - if nonUnit { - tjjs = a[j*lda+j] * tscal - } else { - tjjs = tscal - } - tjj := math.Abs(tjjs) - if tjj > 1 { - rec = math.Min(1, rec*tjj) - uscal /= tjjs - } - if rec < 1 { - bi.Dscal(n, rec, x, 1) - scale *= rec - xmax *= rec - } - } - var sumj float64 - if uscal == 1 { - if upper { - sumj = bi.Ddot(j, a[j:], lda, x, 1) - } else if j < n-1 { - sumj = bi.Ddot(n-j-1, a[(j+1)*lda+j:], lda, x[j+1:], 1) - } - } else { - if upper { - for i := 0; i < j; i++ { - sumj += (a[i*lda+j] * uscal) * x[i] - } - } else if j < n { - for i := j + 1; i < n; i++ { - sumj += (a[i*lda+j] * uscal) * x[i] - } - } - } - if uscal == tscal { - x[j] -= sumj - xj := math.Abs(x[j]) - var tjjs float64 - if nonUnit { - tjjs = a[j*lda+j] * tscal - } else { - tjjs = tscal - if tscal == 1 { - goto Skip2 - } - } - tjj := math.Abs(tjjs) - if tjj > smlnum { - if tjj < 1 { - if xj > tjj*bignum { - rec = 1 / xj - bi.Dscal(n, rec, x, 1) - scale *= rec - xmax *= rec - } - } - x[j] /= tjjs - } else if tjj > 0 { - if xj > tjj*bignum { - rec = (tjj * bignum) / xj - bi.Dscal(n, rec, x, 1) - scale *= rec - xmax *= rec - } - x[j] /= tjjs - } else { - for i := 0; i < n; i++ { - x[i] = 0 - } - x[j] = 1 - scale = 0 - xmax = 0 - } - } else { - x[j] = x[j]/tjjs - sumj - } - Skip2: - xmax = math.Max(xmax, math.Abs(x[j])) - } - } - scale /= tscal - if tscal != 1 { - bi.Dscal(n, 1/tscal, cnorm, 1) - } - return scale -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlauu2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlauu2.go deleted file mode 100644 index 24e98dd..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlauu2.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright ©2018 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlauu2 computes the product -// U * Uᵀ if uplo is blas.Upper -// Lᵀ * L if uplo is blas.Lower -// where U or L is stored in the upper or lower triangular part of A. -// Only the upper or lower triangle of the result is stored, overwriting -// the corresponding factor in A. -func (impl Implementation) Dlauu2(uplo blas.Uplo, n int, a []float64, lda int) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if n == 0 { - return - } - - if len(a) < (n-1)*lda+n { - panic(shortA) - } - - bi := blas64.Implementation() - - if uplo == blas.Upper { - // Compute the product U*Uᵀ. - for i := 0; i < n; i++ { - aii := a[i*lda+i] - if i < n-1 { - a[i*lda+i] = bi.Ddot(n-i, a[i*lda+i:], 1, a[i*lda+i:], 1) - bi.Dgemv(blas.NoTrans, i, n-i-1, 1, a[i+1:], lda, a[i*lda+i+1:], 1, - aii, a[i:], lda) - } else { - bi.Dscal(i+1, aii, a[i:], lda) - } - } - } else { - // Compute the product Lᵀ*L. - for i := 0; i < n; i++ { - aii := a[i*lda+i] - if i < n-1 { - a[i*lda+i] = bi.Ddot(n-i, a[i*lda+i:], lda, a[i*lda+i:], lda) - bi.Dgemv(blas.Trans, n-i-1, i, 1, a[(i+1)*lda:], lda, a[(i+1)*lda+i:], lda, - aii, a[i*lda:], 1) - } else { - bi.Dscal(i+1, aii, a[i*lda:], 1) - } - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlauum.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlauum.go deleted file mode 100644 index 995fdc0..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlauum.go +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright ©2018 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlauum computes the product -// U * Uᵀ if uplo is blas.Upper -// Lᵀ * L if uplo is blas.Lower -// where U or L is stored in the upper or lower triangular part of A. -// Only the upper or lower triangle of the result is stored, overwriting -// the corresponding factor in A. -func (impl Implementation) Dlauum(uplo blas.Uplo, n int, a []float64, lda int) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if n == 0 { - return - } - - if len(a) < (n-1)*lda+n { - panic(shortA) - } - - // Determine the block size. - opts := "U" - if uplo == blas.Lower { - opts = "L" - } - nb := impl.Ilaenv(1, "DLAUUM", opts, n, -1, -1, -1) - - if nb <= 1 || n <= nb { - // Use unblocked code. - impl.Dlauu2(uplo, n, a, lda) - return - } - - // Use blocked code. - bi := blas64.Implementation() - if uplo == blas.Upper { - // Compute the product U*Uᵀ. - for i := 0; i < n; i += nb { - ib := min(nb, n-i) - bi.Dtrmm(blas.Right, blas.Upper, blas.Trans, blas.NonUnit, - i, ib, 1, a[i*lda+i:], lda, a[i:], lda) - impl.Dlauu2(blas.Upper, ib, a[i*lda+i:], lda) - if n-i-ib > 0 { - bi.Dgemm(blas.NoTrans, blas.Trans, i, ib, n-i-ib, - 1, a[i+ib:], lda, a[i*lda+i+ib:], lda, 1, a[i:], lda) - bi.Dsyrk(blas.Upper, blas.NoTrans, ib, n-i-ib, - 1, a[i*lda+i+ib:], lda, 1, a[i*lda+i:], lda) - } - } - } else { - // Compute the product Lᵀ*L. - for i := 0; i < n; i += nb { - ib := min(nb, n-i) - bi.Dtrmm(blas.Left, blas.Lower, blas.Trans, blas.NonUnit, - ib, i, 1, a[i*lda+i:], lda, a[i*lda:], lda) - impl.Dlauu2(blas.Lower, ib, a[i*lda+i:], lda) - if n-i-ib > 0 { - bi.Dgemm(blas.Trans, blas.NoTrans, ib, i, n-i-ib, - 1, a[(i+ib)*lda+i:], lda, a[(i+ib)*lda:], lda, 1, a[i*lda:], lda) - bi.Dsyrk(blas.Lower, blas.Trans, ib, n-i-ib, - 1, a[(i+ib)*lda+i:], lda, 1, a[i*lda+i:], lda) - } - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/doc.go b/vendor/gonum.org/v1/gonum/lapack/gonum/doc.go deleted file mode 100644 index 1857c50..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/doc.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum is a pure-go implementation of the LAPACK API. The LAPACK API defines -// a set of algorithms for advanced matrix operations. -// -// The function definitions and implementations follow that of the netlib reference -// implementation. See http://www.netlib.org/lapack/explore-html/ for more -// information, and http://www.netlib.org/lapack/explore-html/d4/de1/_l_i_c_e_n_s_e_source.html -// for more license information. -// -// Slice function arguments frequently represent vectors and matrices. The data -// layout is identical to that found in https://godoc.org/gonum.org/v1/gonum/blas/gonum. -// -// Most LAPACK functions are built on top the routines defined in the BLAS API, -// and as such the computation time for many LAPACK functions is -// dominated by BLAS calls. Here, BLAS is accessed through the -// blas64 package (https://godoc.org/golang.org/v1/gonum/blas/blas64). In particular, -// this implies that an external BLAS library will be used if it is -// registered in blas64. -// -// The full LAPACK capability has not been implemented at present. The full -// API is very large, containing approximately 200 functions for double precision -// alone. Future additions will be focused on supporting the Gonum matrix -// package (https://godoc.org/github.com/gonum/matrix/mat64), though pull requests -// with implementations and tests for LAPACK function are encouraged. -package gonum // import "gonum.org/v1/gonum/lapack/gonum" diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dorg2l.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dorg2l.go deleted file mode 100644 index a20765a..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dorg2l.go +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dorg2l generates an m×n matrix Q with orthonormal columns which is defined -// as the last n columns of a product of k elementary reflectors of order m. -// Q = H_{k-1} * ... * H_1 * H_0 -// See Dgelqf for more information. It must be that m >= n >= k. -// -// tau contains the scalar reflectors computed by Dgeqlf. tau must have length -// at least k, and Dorg2l will panic otherwise. -// -// work contains temporary memory, and must have length at least n. Dorg2l will -// panic otherwise. -// -// Dorg2l is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dorg2l(m, n, k int, a []float64, lda int, tau, work []float64) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case n > m: - panic(nGTM) - case k < 0: - panic(kLT0) - case k > n: - panic(kGTN) - case lda < max(1, n): - panic(badLdA) - } - - if n == 0 { - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(tau) < k: - panic(shortTau) - case len(work) < n: - panic(shortWork) - } - - // Initialize columns 0:n-k to columns of the unit matrix. - for j := 0; j < n-k; j++ { - for l := 0; l < m; l++ { - a[l*lda+j] = 0 - } - a[(m-n+j)*lda+j] = 1 - } - - bi := blas64.Implementation() - for i := 0; i < k; i++ { - ii := n - k + i - - // Apply H_i to A[0:m-k+i, 0:n-k+i] from the left. - a[(m-n+ii)*lda+ii] = 1 - impl.Dlarf(blas.Left, m-n+ii+1, ii, a[ii:], lda, tau[i], a, lda, work) - bi.Dscal(m-n+ii, -tau[i], a[ii:], lda) - a[(m-n+ii)*lda+ii] = 1 - tau[i] - - // Set A[m-k+i:m, n-k+i+1] to zero. - for l := m - n + ii + 1; l < m; l++ { - a[l*lda+ii] = 0 - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dorg2r.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dorg2r.go deleted file mode 100644 index de44775..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dorg2r.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dorg2r generates an m×n matrix Q with orthonormal columns defined by the -// product of elementary reflectors as computed by Dgeqrf. -// Q = H_0 * H_1 * ... * H_{k-1} -// len(tau) >= k, 0 <= k <= n, 0 <= n <= m, len(work) >= n. -// Dorg2r will panic if these conditions are not met. -// -// Dorg2r is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dorg2r(m, n, k int, a []float64, lda int, tau []float64, work []float64) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case n > m: - panic(nGTM) - case k < 0: - panic(kLT0) - case k > n: - panic(kGTN) - case lda < max(1, n): - panic(badLdA) - } - - if n == 0 { - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(tau) < k: - panic(shortTau) - case len(work) < n: - panic(shortWork) - } - - bi := blas64.Implementation() - - // Initialize columns k+1:n to columns of the unit matrix. - for l := 0; l < m; l++ { - for j := k; j < n; j++ { - a[l*lda+j] = 0 - } - } - for j := k; j < n; j++ { - a[j*lda+j] = 1 - } - for i := k - 1; i >= 0; i-- { - for i := range work { - work[i] = 0 - } - if i < n-1 { - a[i*lda+i] = 1 - impl.Dlarf(blas.Left, m-i, n-i-1, a[i*lda+i:], lda, tau[i], a[i*lda+i+1:], lda, work) - } - if i < m-1 { - bi.Dscal(m-i-1, -tau[i], a[(i+1)*lda+i:], lda) - } - a[i*lda+i] = 1 - tau[i] - for l := 0; l < i; l++ { - a[l*lda+i] = 0 - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dorgbr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dorgbr.go deleted file mode 100644 index 8a4fe2b..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dorgbr.go +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import "gonum.org/v1/gonum/lapack" - -// Dorgbr generates one of the matrices Q or Pᵀ computed by Dgebrd -// computed from the decomposition Dgebrd. See Dgebd2 for the description of -// Q and Pᵀ. -// -// If vect == lapack.GenerateQ, then a is assumed to have been an m×k matrix and -// Q is of order m. If m >= k, then Dorgbr returns the first n columns of Q -// where m >= n >= k. If m < k, then Dorgbr returns Q as an m×m matrix. -// -// If vect == lapack.GeneratePT, then A is assumed to have been a k×n matrix, and -// Pᵀ is of order n. If k < n, then Dorgbr returns the first m rows of Pᵀ, -// where n >= m >= k. If k >= n, then Dorgbr returns Pᵀ as an n×n matrix. -// -// Dorgbr is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dorgbr(vect lapack.GenOrtho, m, n, k int, a []float64, lda int, tau, work []float64, lwork int) { - wantq := vect == lapack.GenerateQ - mn := min(m, n) - switch { - case vect != lapack.GenerateQ && vect != lapack.GeneratePT: - panic(badGenOrtho) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case wantq && n > m: - panic(nGTM) - case wantq && n < min(m, k): - panic("lapack: n < min(m,k)") - case !wantq && m > n: - panic(mGTN) - case !wantq && m < min(n, k): - panic("lapack: m < min(n,k)") - case lda < max(1, n) && lwork != -1: - // Normally, we follow the reference and require the leading - // dimension to be always valid, even in case of workspace - // queries. However, if a caller provided a placeholder value - // for lda (and a) when doing a workspace query that didn't - // fulfill the condition here, it would cause a panic. This is - // exactly what Dgesvd does. - panic(badLdA) - case lwork < max(1, mn) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - work[0] = 1 - if m == 0 || n == 0 { - return - } - - if wantq { - if m >= k { - impl.Dorgqr(m, n, k, a, lda, tau, work, -1) - } else if m > 1 { - impl.Dorgqr(m-1, m-1, m-1, a[lda+1:], lda, tau, work, -1) - } - } else { - if k < n { - impl.Dorglq(m, n, k, a, lda, tau, work, -1) - } else if n > 1 { - impl.Dorglq(n-1, n-1, n-1, a[lda+1:], lda, tau, work, -1) - } - } - lworkopt := int(work[0]) - lworkopt = max(lworkopt, mn) - if lwork == -1 { - work[0] = float64(lworkopt) - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case wantq && len(tau) < min(m, k): - panic(shortTau) - case !wantq && len(tau) < min(n, k): - panic(shortTau) - } - - if wantq { - // Form Q, determined by a call to Dgebrd to reduce an m×k matrix. - if m >= k { - impl.Dorgqr(m, n, k, a, lda, tau, work, lwork) - } else { - // Shift the vectors which define the elementary reflectors one - // column to the right, and set the first row and column of Q to - // those of the unit matrix. - for j := m - 1; j >= 1; j-- { - a[j] = 0 - for i := j + 1; i < m; i++ { - a[i*lda+j] = a[i*lda+j-1] - } - } - a[0] = 1 - for i := 1; i < m; i++ { - a[i*lda] = 0 - } - if m > 1 { - // Form Q[1:m-1, 1:m-1] - impl.Dorgqr(m-1, m-1, m-1, a[lda+1:], lda, tau, work, lwork) - } - } - } else { - // Form Pᵀ, determined by a call to Dgebrd to reduce a k×n matrix. - if k < n { - impl.Dorglq(m, n, k, a, lda, tau, work, lwork) - } else { - // Shift the vectors which define the elementary reflectors one - // row downward, and set the first row and column of Pᵀ to - // those of the unit matrix. - a[0] = 1 - for i := 1; i < n; i++ { - a[i*lda] = 0 - } - for j := 1; j < n; j++ { - for i := j - 1; i >= 1; i-- { - a[i*lda+j] = a[(i-1)*lda+j] - } - a[j] = 0 - } - if n > 1 { - impl.Dorglq(n-1, n-1, n-1, a[lda+1:], lda, tau, work, lwork) - } - } - } - work[0] = float64(lworkopt) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dorghr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dorghr.go deleted file mode 100644 index fd65531..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dorghr.go +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -// Dorghr generates an n×n orthogonal matrix Q which is defined as the product -// of ihi-ilo elementary reflectors: -// Q = H_{ilo} H_{ilo+1} ... H_{ihi-1}. -// -// a and lda represent an n×n matrix that contains the elementary reflectors, as -// returned by Dgehrd. On return, a is overwritten by the n×n orthogonal matrix -// Q. Q will be equal to the identity matrix except in the submatrix -// Q[ilo+1:ihi+1,ilo+1:ihi+1]. -// -// ilo and ihi must have the same values as in the previous call of Dgehrd. It -// must hold that -// 0 <= ilo <= ihi < n if n > 0, -// ilo = 0, ihi = -1 if n == 0. -// -// tau contains the scalar factors of the elementary reflectors, as returned by -// Dgehrd. tau must have length n-1. -// -// work must have length at least max(1,lwork) and lwork must be at least -// ihi-ilo. For optimum performance lwork must be at least (ihi-ilo)*nb where nb -// is the optimal blocksize. On return, work[0] will contain the optimal value -// of lwork. -// -// If lwork == -1, instead of performing Dorghr, only the optimal value of lwork -// will be stored into work[0]. -// -// If any requirement on input sizes is not met, Dorghr will panic. -// -// Dorghr is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dorghr(n, ilo, ihi int, a []float64, lda int, tau, work []float64, lwork int) { - nh := ihi - ilo - switch { - case ilo < 0 || max(1, n) <= ilo: - panic(badIlo) - case ihi < min(ilo, n-1) || n <= ihi: - panic(badIhi) - case lda < max(1, n): - panic(badLdA) - case lwork < max(1, nh) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - if n == 0 { - work[0] = 1 - return - } - - lwkopt := max(1, nh) * impl.Ilaenv(1, "DORGQR", " ", nh, nh, nh, -1) - if lwork == -1 { - work[0] = float64(lwkopt) - return - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(tau) < n-1: - panic(shortTau) - } - - // Shift the vectors which define the elementary reflectors one column - // to the right. - for i := ilo + 2; i < ihi+1; i++ { - copy(a[i*lda+ilo+1:i*lda+i], a[i*lda+ilo:i*lda+i-1]) - } - // Set the first ilo+1 and the last n-ihi-1 rows and columns to those of - // the identity matrix. - for i := 0; i < ilo+1; i++ { - for j := 0; j < n; j++ { - a[i*lda+j] = 0 - } - a[i*lda+i] = 1 - } - for i := ilo + 1; i < ihi+1; i++ { - for j := 0; j <= ilo; j++ { - a[i*lda+j] = 0 - } - for j := i; j < n; j++ { - a[i*lda+j] = 0 - } - } - for i := ihi + 1; i < n; i++ { - for j := 0; j < n; j++ { - a[i*lda+j] = 0 - } - a[i*lda+i] = 1 - } - if nh > 0 { - // Generate Q[ilo+1:ihi+1,ilo+1:ihi+1]. - impl.Dorgqr(nh, nh, nh, a[(ilo+1)*lda+ilo+1:], lda, tau[ilo:ihi], work, lwork) - } - work[0] = float64(lwkopt) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dorgl2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dorgl2.go deleted file mode 100644 index b5566b9..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dorgl2.go +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dorgl2 generates an m×n matrix Q with orthonormal rows defined by the -// first m rows product of elementary reflectors as computed by Dgelqf. -// Q = H_0 * H_1 * ... * H_{k-1} -// len(tau) >= k, 0 <= k <= m, 0 <= m <= n, len(work) >= m. -// Dorgl2 will panic if these conditions are not met. -// -// Dorgl2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dorgl2(m, n, k int, a []float64, lda int, tau, work []float64) { - switch { - case m < 0: - panic(mLT0) - case n < m: - panic(nLTM) - case k < 0: - panic(kLT0) - case k > m: - panic(kGTM) - case lda < max(1, m): - panic(badLdA) - } - - if m == 0 { - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(tau) < k: - panic(shortTau) - case len(work) < m: - panic(shortWork) - } - - bi := blas64.Implementation() - - if k < m { - for i := k; i < m; i++ { - for j := 0; j < n; j++ { - a[i*lda+j] = 0 - } - } - for j := k; j < m; j++ { - a[j*lda+j] = 1 - } - } - for i := k - 1; i >= 0; i-- { - if i < n-1 { - if i < m-1 { - a[i*lda+i] = 1 - impl.Dlarf(blas.Right, m-i-1, n-i, a[i*lda+i:], 1, tau[i], a[(i+1)*lda+i:], lda, work) - } - bi.Dscal(n-i-1, -tau[i], a[i*lda+i+1:], 1) - } - a[i*lda+i] = 1 - tau[i] - for l := 0; l < i; l++ { - a[i*lda+l] = 0 - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dorglq.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dorglq.go deleted file mode 100644 index a6dd980..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dorglq.go +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dorglq generates an m×n matrix Q with orthonormal columns defined by the -// product of elementary reflectors as computed by Dgelqf. -// Q = H_0 * H_1 * ... * H_{k-1} -// Dorglq is the blocked version of Dorgl2 that makes greater use of level-3 BLAS -// routines. -// -// len(tau) >= k, 0 <= k <= m, and 0 <= m <= n. -// -// work is temporary storage, and lwork specifies the usable memory length. At minimum, -// lwork >= m, and the amount of blocking is limited by the usable length. -// If lwork == -1, instead of computing Dorglq the optimal work length is stored -// into work[0]. -// -// Dorglq will panic if the conditions on input values are not met. -// -// Dorglq is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dorglq(m, n, k int, a []float64, lda int, tau, work []float64, lwork int) { - switch { - case m < 0: - panic(mLT0) - case n < m: - panic(nLTM) - case k < 0: - panic(kLT0) - case k > m: - panic(kGTM) - case lda < max(1, n): - panic(badLdA) - case lwork < max(1, m) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - if m == 0 { - work[0] = 1 - return - } - - nb := impl.Ilaenv(1, "DORGLQ", " ", m, n, k, -1) - if lwork == -1 { - work[0] = float64(m * nb) - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(tau) < k: - panic(shortTau) - } - - nbmin := 2 // Minimum block size - var nx int // Crossover size from blocked to unbloked code - iws := m // Length of work needed - var ldwork int - if 1 < nb && nb < k { - nx = max(0, impl.Ilaenv(3, "DORGLQ", " ", m, n, k, -1)) - if nx < k { - ldwork = nb - iws = m * ldwork - if lwork < iws { - nb = lwork / m - ldwork = nb - nbmin = max(2, impl.Ilaenv(2, "DORGLQ", " ", m, n, k, -1)) - } - } - } - - var ki, kk int - if nbmin <= nb && nb < k && nx < k { - // The first kk rows are handled by the blocked method. - ki = ((k - nx - 1) / nb) * nb - kk = min(k, ki+nb) - for i := kk; i < m; i++ { - for j := 0; j < kk; j++ { - a[i*lda+j] = 0 - } - } - } - if kk < m { - // Perform the operation on colums kk to the end. - impl.Dorgl2(m-kk, n-kk, k-kk, a[kk*lda+kk:], lda, tau[kk:], work) - } - if kk > 0 { - // Perform the operation on column-blocks - for i := ki; i >= 0; i -= nb { - ib := min(nb, k-i) - if i+ib < m { - impl.Dlarft(lapack.Forward, lapack.RowWise, - n-i, ib, - a[i*lda+i:], lda, - tau[i:], - work, ldwork) - - impl.Dlarfb(blas.Right, blas.Trans, lapack.Forward, lapack.RowWise, - m-i-ib, n-i, ib, - a[i*lda+i:], lda, - work, ldwork, - a[(i+ib)*lda+i:], lda, - work[ib*ldwork:], ldwork) - } - impl.Dorgl2(ib, n-i, ib, a[i*lda+i:], lda, tau[i:], work) - for l := i; l < i+ib; l++ { - for j := 0; j < i; j++ { - a[l*lda+j] = 0 - } - } - } - } - work[0] = float64(iws) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dorgql.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dorgql.go deleted file mode 100644 index 6927ba4..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dorgql.go +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dorgql generates the m×n matrix Q with orthonormal columns defined as the -// last n columns of a product of k elementary reflectors of order m -// Q = H_{k-1} * ... * H_1 * H_0. -// -// It must hold that -// 0 <= k <= n <= m, -// and Dorgql will panic otherwise. -// -// On entry, the (n-k+i)-th column of A must contain the vector which defines -// the elementary reflector H_i, for i=0,...,k-1, and tau[i] must contain its -// scalar factor. On return, a contains the m×n matrix Q. -// -// tau must have length at least k, and Dorgql will panic otherwise. -// -// work must have length at least max(1,lwork), and lwork must be at least -// max(1,n), otherwise Dorgql will panic. For optimum performance lwork must -// be a sufficiently large multiple of n. -// -// If lwork == -1, instead of computing Dorgql the optimal work length is stored -// into work[0]. -// -// Dorgql is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dorgql(m, n, k int, a []float64, lda int, tau, work []float64, lwork int) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case n > m: - panic(nGTM) - case k < 0: - panic(kLT0) - case k > n: - panic(kGTN) - case lda < max(1, n): - panic(badLdA) - case lwork < max(1, n) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - if n == 0 { - work[0] = 1 - return - } - - nb := impl.Ilaenv(1, "DORGQL", " ", m, n, k, -1) - if lwork == -1 { - work[0] = float64(n * nb) - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(tau) < k: - panic(shortTau) - } - - nbmin := 2 - var nx, ldwork int - iws := n - if 1 < nb && nb < k { - // Determine when to cross over from blocked to unblocked code. - nx = max(0, impl.Ilaenv(3, "DORGQL", " ", m, n, k, -1)) - if nx < k { - // Determine if workspace is large enough for blocked code. - iws = n * nb - if lwork < iws { - // Not enough workspace to use optimal nb: reduce nb and determine - // the minimum value of nb. - nb = lwork / n - nbmin = max(2, impl.Ilaenv(2, "DORGQL", " ", m, n, k, -1)) - } - ldwork = nb - } - } - - var kk int - if nbmin <= nb && nb < k && nx < k { - // Use blocked code after the first block. The last kk columns are handled - // by the block method. - kk = min(k, ((k-nx+nb-1)/nb)*nb) - - // Set A(m-kk:m, 0:n-kk) to zero. - for i := m - kk; i < m; i++ { - for j := 0; j < n-kk; j++ { - a[i*lda+j] = 0 - } - } - } - - // Use unblocked code for the first or only block. - impl.Dorg2l(m-kk, n-kk, k-kk, a, lda, tau, work) - if kk > 0 { - // Use blocked code. - for i := k - kk; i < k; i += nb { - ib := min(nb, k-i) - if n-k+i > 0 { - // Form the triangular factor of the block reflector - // H = H_{i+ib-1} * ... * H_{i+1} * H_i. - impl.Dlarft(lapack.Backward, lapack.ColumnWise, m-k+i+ib, ib, - a[n-k+i:], lda, tau[i:], work, ldwork) - - // Apply H to A[0:m-k+i+ib, 0:n-k+i] from the left. - impl.Dlarfb(blas.Left, blas.NoTrans, lapack.Backward, lapack.ColumnWise, - m-k+i+ib, n-k+i, ib, a[n-k+i:], lda, work, ldwork, - a, lda, work[ib*ldwork:], ldwork) - } - - // Apply H to rows 0:m-k+i+ib of current block. - impl.Dorg2l(m-k+i+ib, ib, ib, a[n-k+i:], lda, tau[i:], work) - - // Set rows m-k+i+ib:m of current block to zero. - for j := n - k + i; j < n-k+i+ib; j++ { - for l := m - k + i + ib; l < m; l++ { - a[l*lda+j] = 0 - } - } - } - } - work[0] = float64(iws) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dorgqr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dorgqr.go deleted file mode 100644 index f07fdaf..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dorgqr.go +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dorgqr generates an m×n matrix Q with orthonormal columns defined by the -// product of elementary reflectors -// Q = H_0 * H_1 * ... * H_{k-1} -// as computed by Dgeqrf. -// Dorgqr is the blocked version of Dorg2r that makes greater use of level-3 BLAS -// routines. -// -// The length of tau must be at least k, and the length of work must be at least n. -// It also must be that 0 <= k <= n and 0 <= n <= m. -// -// work is temporary storage, and lwork specifies the usable memory length. At -// minimum, lwork >= n, and the amount of blocking is limited by the usable -// length. If lwork == -1, instead of computing Dorgqr the optimal work length -// is stored into work[0]. -// -// Dorgqr will panic if the conditions on input values are not met. -// -// Dorgqr is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dorgqr(m, n, k int, a []float64, lda int, tau, work []float64, lwork int) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case n > m: - panic(nGTM) - case k < 0: - panic(kLT0) - case k > n: - panic(kGTN) - case lda < max(1, n) && lwork != -1: - // Normally, we follow the reference and require the leading - // dimension to be always valid, even in case of workspace - // queries. However, if a caller provided a placeholder value - // for lda (and a) when doing a workspace query that didn't - // fulfill the condition here, it would cause a panic. This is - // exactly what Dgesvd does. - panic(badLdA) - case lwork < max(1, n) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - if n == 0 { - work[0] = 1 - return - } - - nb := impl.Ilaenv(1, "DORGQR", " ", m, n, k, -1) - // work is treated as an n×nb matrix - if lwork == -1 { - work[0] = float64(n * nb) - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(tau) < k: - panic(shortTau) - } - - nbmin := 2 // Minimum block size - var nx int // Crossover size from blocked to unbloked code - iws := n // Length of work needed - var ldwork int - if 1 < nb && nb < k { - nx = max(0, impl.Ilaenv(3, "DORGQR", " ", m, n, k, -1)) - if nx < k { - ldwork = nb - iws = n * ldwork - if lwork < iws { - nb = lwork / n - ldwork = nb - nbmin = max(2, impl.Ilaenv(2, "DORGQR", " ", m, n, k, -1)) - } - } - } - var ki, kk int - if nbmin <= nb && nb < k && nx < k { - // The first kk columns are handled by the blocked method. - ki = ((k - nx - 1) / nb) * nb - kk = min(k, ki+nb) - for i := 0; i < kk; i++ { - for j := kk; j < n; j++ { - a[i*lda+j] = 0 - } - } - } - if kk < n { - // Perform the operation on colums kk to the end. - impl.Dorg2r(m-kk, n-kk, k-kk, a[kk*lda+kk:], lda, tau[kk:], work) - } - if kk > 0 { - // Perform the operation on column-blocks. - for i := ki; i >= 0; i -= nb { - ib := min(nb, k-i) - if i+ib < n { - impl.Dlarft(lapack.Forward, lapack.ColumnWise, - m-i, ib, - a[i*lda+i:], lda, - tau[i:], - work, ldwork) - - impl.Dlarfb(blas.Left, blas.NoTrans, lapack.Forward, lapack.ColumnWise, - m-i, n-i-ib, ib, - a[i*lda+i:], lda, - work, ldwork, - a[i*lda+i+ib:], lda, - work[ib*ldwork:], ldwork) - } - impl.Dorg2r(m-i, ib, ib, a[i*lda+i:], lda, tau[i:], work) - // Set rows 0:i-1 of current block to zero. - for j := i; j < i+ib; j++ { - for l := 0; l < i; l++ { - a[l*lda+j] = 0 - } - } - } - } - work[0] = float64(iws) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dorgtr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dorgtr.go deleted file mode 100644 index 483fbca..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dorgtr.go +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import "gonum.org/v1/gonum/blas" - -// Dorgtr generates a real orthogonal matrix Q which is defined as the product -// of n-1 elementary reflectors of order n as returned by Dsytrd. -// -// The construction of Q depends on the value of uplo: -// Q = H_{n-1} * ... * H_1 * H_0 if uplo == blas.Upper -// Q = H_0 * H_1 * ... * H_{n-1} if uplo == blas.Lower -// where H_i is constructed from the elementary reflectors as computed by Dsytrd. -// See the documentation for Dsytrd for more information. -// -// tau must have length at least n-1, and Dorgtr will panic otherwise. -// -// work is temporary storage, and lwork specifies the usable memory length. At -// minimum, lwork >= max(1,n-1), and Dorgtr will panic otherwise. The amount of blocking -// is limited by the usable length. -// If lwork == -1, instead of computing Dorgtr the optimal work length is stored -// into work[0]. -// -// Dorgtr is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dorgtr(uplo blas.Uplo, n int, a []float64, lda int, tau, work []float64, lwork int) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case lwork < max(1, n-1) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - if n == 0 { - work[0] = 1 - return - } - - var nb int - if uplo == blas.Upper { - nb = impl.Ilaenv(1, "DORGQL", " ", n-1, n-1, n-1, -1) - } else { - nb = impl.Ilaenv(1, "DORGQR", " ", n-1, n-1, n-1, -1) - } - lworkopt := max(1, n-1) * nb - if lwork == -1 { - work[0] = float64(lworkopt) - return - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(tau) < n-1: - panic(shortTau) - } - - if uplo == blas.Upper { - // Q was determined by a call to Dsytrd with uplo == blas.Upper. - // Shift the vectors which define the elementary reflectors one column - // to the left, and set the last row and column of Q to those of the unit - // matrix. - for j := 0; j < n-1; j++ { - for i := 0; i < j; i++ { - a[i*lda+j] = a[i*lda+j+1] - } - a[(n-1)*lda+j] = 0 - } - for i := 0; i < n-1; i++ { - a[i*lda+n-1] = 0 - } - a[(n-1)*lda+n-1] = 1 - - // Generate Q[0:n-1, 0:n-1]. - impl.Dorgql(n-1, n-1, n-1, a, lda, tau, work, lwork) - } else { - // Q was determined by a call to Dsytrd with uplo == blas.Upper. - // Shift the vectors which define the elementary reflectors one column - // to the right, and set the first row and column of Q to those of the unit - // matrix. - for j := n - 1; j > 0; j-- { - a[j] = 0 - for i := j + 1; i < n; i++ { - a[i*lda+j] = a[i*lda+j-1] - } - } - a[0] = 1 - for i := 1; i < n; i++ { - a[i*lda] = 0 - } - if n > 1 { - // Generate Q[1:n, 1:n]. - impl.Dorgqr(n-1, n-1, n-1, a[lda+1:], lda, tau, work, lwork) - } - } - work[0] = float64(lworkopt) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dorm2r.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dorm2r.go deleted file mode 100644 index 8311f74..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dorm2r.go +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import "gonum.org/v1/gonum/blas" - -// Dorm2r multiplies a general matrix C by an orthogonal matrix from a QR factorization -// determined by Dgeqrf. -// C = Q * C if side == blas.Left and trans == blas.NoTrans -// C = Qᵀ * C if side == blas.Left and trans == blas.Trans -// C = C * Q if side == blas.Right and trans == blas.NoTrans -// C = C * Qᵀ if side == blas.Right and trans == blas.Trans -// If side == blas.Left, a is a matrix of size m×k, and if side == blas.Right -// a is of size n×k. -// -// tau contains the Householder factors and is of length at least k and this function -// will panic otherwise. -// -// work is temporary storage of length at least n if side == blas.Left -// and at least m if side == blas.Right and this function will panic otherwise. -// -// Dorm2r is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dorm2r(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64) { - left := side == blas.Left - switch { - case !left && side != blas.Right: - panic(badSide) - case trans != blas.Trans && trans != blas.NoTrans: - panic(badTrans) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case left && k > m: - panic(kGTM) - case !left && k > n: - panic(kGTN) - case lda < max(1, k): - panic(badLdA) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if m == 0 || n == 0 || k == 0 { - return - } - - switch { - case left && len(a) < (m-1)*lda+k: - panic(shortA) - case !left && len(a) < (n-1)*lda+k: - panic(shortA) - case len(c) < (m-1)*ldc+n: - panic(shortC) - case len(tau) < k: - panic(shortTau) - case left && len(work) < n: - panic(shortWork) - case !left && len(work) < m: - panic(shortWork) - } - - if left { - if trans == blas.NoTrans { - for i := k - 1; i >= 0; i-- { - aii := a[i*lda+i] - a[i*lda+i] = 1 - impl.Dlarf(side, m-i, n, a[i*lda+i:], lda, tau[i], c[i*ldc:], ldc, work) - a[i*lda+i] = aii - } - return - } - for i := 0; i < k; i++ { - aii := a[i*lda+i] - a[i*lda+i] = 1 - impl.Dlarf(side, m-i, n, a[i*lda+i:], lda, tau[i], c[i*ldc:], ldc, work) - a[i*lda+i] = aii - } - return - } - if trans == blas.NoTrans { - for i := 0; i < k; i++ { - aii := a[i*lda+i] - a[i*lda+i] = 1 - impl.Dlarf(side, m, n-i, a[i*lda+i:], lda, tau[i], c[i:], ldc, work) - a[i*lda+i] = aii - } - return - } - for i := k - 1; i >= 0; i-- { - aii := a[i*lda+i] - a[i*lda+i] = 1 - impl.Dlarf(side, m, n-i, a[i*lda+i:], lda, tau[i], c[i:], ldc, work) - a[i*lda+i] = aii - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dormbr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dormbr.go deleted file mode 100644 index e1b3737..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dormbr.go +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dormbr applies a multiplicative update to the matrix C based on a -// decomposition computed by Dgebrd. -// -// Dormbr overwrites the m×n matrix C with -// Q * C if vect == lapack.ApplyQ, side == blas.Left, and trans == blas.NoTrans -// C * Q if vect == lapack.ApplyQ, side == blas.Right, and trans == blas.NoTrans -// Qᵀ * C if vect == lapack.ApplyQ, side == blas.Left, and trans == blas.Trans -// C * Qᵀ if vect == lapack.ApplyQ, side == blas.Right, and trans == blas.Trans -// -// P * C if vect == lapack.ApplyP, side == blas.Left, and trans == blas.NoTrans -// C * P if vect == lapack.ApplyP, side == blas.Right, and trans == blas.NoTrans -// Pᵀ * C if vect == lapack.ApplyP, side == blas.Left, and trans == blas.Trans -// C * Pᵀ if vect == lapack.ApplyP, side == blas.Right, and trans == blas.Trans -// where P and Q are the orthogonal matrices determined by Dgebrd when reducing -// a matrix A to bidiagonal form: A = Q * B * Pᵀ. See Dgebrd for the -// definitions of Q and P. -// -// If vect == lapack.ApplyQ, A is assumed to have been an nq×k matrix, while if -// vect == lapack.ApplyP, A is assumed to have been a k×nq matrix. nq = m if -// side == blas.Left, while nq = n if side == blas.Right. -// -// tau must have length min(nq,k), and Dormbr will panic otherwise. tau contains -// the elementary reflectors to construct Q or P depending on the value of -// vect. -// -// work must have length at least max(1,lwork), and lwork must be either -1 or -// at least max(1,n) if side == blas.Left, and at least max(1,m) if side == -// blas.Right. For optimum performance lwork should be at least n*nb if side == -// blas.Left, and at least m*nb if side == blas.Right, where nb is the optimal -// block size. On return, work[0] will contain the optimal value of lwork. -// -// If lwork == -1, the function only calculates the optimal value of lwork and -// returns it in work[0]. -// -// Dormbr is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dormbr(vect lapack.ApplyOrtho, side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) { - nq := n - nw := m - if side == blas.Left { - nq = m - nw = n - } - applyQ := vect == lapack.ApplyQ - switch { - case !applyQ && vect != lapack.ApplyP: - panic(badApplyOrtho) - case side != blas.Left && side != blas.Right: - panic(badSide) - case trans != blas.NoTrans && trans != blas.Trans: - panic(badTrans) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case applyQ && lda < max(1, min(nq, k)): - panic(badLdA) - case !applyQ && lda < max(1, nq): - panic(badLdA) - case ldc < max(1, n): - panic(badLdC) - case lwork < max(1, nw) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - if m == 0 || n == 0 { - work[0] = 1 - return - } - - // The current implementation does not use opts, but a future change may - // use these options so construct them. - var opts string - if side == blas.Left { - opts = "L" - } else { - opts = "R" - } - if trans == blas.Trans { - opts += "T" - } else { - opts += "N" - } - var nb int - if applyQ { - if side == blas.Left { - nb = impl.Ilaenv(1, "DORMQR", opts, m-1, n, m-1, -1) - } else { - nb = impl.Ilaenv(1, "DORMQR", opts, m, n-1, n-1, -1) - } - } else { - if side == blas.Left { - nb = impl.Ilaenv(1, "DORMLQ", opts, m-1, n, m-1, -1) - } else { - nb = impl.Ilaenv(1, "DORMLQ", opts, m, n-1, n-1, -1) - } - } - lworkopt := max(1, nw) * nb - if lwork == -1 { - work[0] = float64(lworkopt) - return - } - - minnqk := min(nq, k) - switch { - case applyQ && len(a) < (nq-1)*lda+minnqk: - panic(shortA) - case !applyQ && len(a) < (minnqk-1)*lda+nq: - panic(shortA) - case len(tau) < minnqk: - panic(shortTau) - case len(c) < (m-1)*ldc+n: - panic(shortC) - } - - if applyQ { - // Change the operation to get Q depending on the size of the initial - // matrix to Dgebrd. The size matters due to the storage location of - // the off-diagonal elements. - if nq >= k { - impl.Dormqr(side, trans, m, n, k, a, lda, tau[:k], c, ldc, work, lwork) - } else if nq > 1 { - mi := m - ni := n - 1 - i1 := 0 - i2 := 1 - if side == blas.Left { - mi = m - 1 - ni = n - i1 = 1 - i2 = 0 - } - impl.Dormqr(side, trans, mi, ni, nq-1, a[1*lda:], lda, tau[:nq-1], c[i1*ldc+i2:], ldc, work, lwork) - } - work[0] = float64(lworkopt) - return - } - - transt := blas.Trans - if trans == blas.Trans { - transt = blas.NoTrans - } - - // Change the operation to get P depending on the size of the initial - // matrix to Dgebrd. The size matters due to the storage location of - // the off-diagonal elements. - if nq > k { - impl.Dormlq(side, transt, m, n, k, a, lda, tau, c, ldc, work, lwork) - } else if nq > 1 { - mi := m - ni := n - 1 - i1 := 0 - i2 := 1 - if side == blas.Left { - mi = m - 1 - ni = n - i1 = 1 - i2 = 0 - } - impl.Dormlq(side, transt, mi, ni, nq-1, a[1:], lda, tau, c[i1*ldc+i2:], ldc, work, lwork) - } - work[0] = float64(lworkopt) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dormhr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dormhr.go deleted file mode 100644 index ac4d3ae..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dormhr.go +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import "gonum.org/v1/gonum/blas" - -// Dormhr multiplies an m×n general matrix C with an nq×nq orthogonal matrix Q -// Q * C if side == blas.Left and trans == blas.NoTrans, -// Qᵀ * C if side == blas.Left and trans == blas.Trans, -// C * Q if side == blas.Right and trans == blas.NoTrans, -// C * Qᵀ if side == blas.Right and trans == blas.Trans, -// where nq == m if side == blas.Left and nq == n if side == blas.Right. -// -// Q is defined implicitly as the product of ihi-ilo elementary reflectors, as -// returned by Dgehrd: -// Q = H_{ilo} H_{ilo+1} ... H_{ihi-1}. -// Q is equal to the identity matrix except in the submatrix -// Q[ilo+1:ihi+1,ilo+1:ihi+1]. -// -// ilo and ihi must have the same values as in the previous call of Dgehrd. It -// must hold that -// 0 <= ilo <= ihi < m if m > 0 and side == blas.Left, -// ilo = 0 and ihi = -1 if m = 0 and side == blas.Left, -// 0 <= ilo <= ihi < n if n > 0 and side == blas.Right, -// ilo = 0 and ihi = -1 if n = 0 and side == blas.Right. -// -// a and lda represent an m×m matrix if side == blas.Left and an n×n matrix if -// side == blas.Right. The matrix contains vectors which define the elementary -// reflectors, as returned by Dgehrd. -// -// tau contains the scalar factors of the elementary reflectors, as returned by -// Dgehrd. tau must have length m-1 if side == blas.Left and n-1 if side == -// blas.Right. -// -// c and ldc represent the m×n matrix C. On return, c is overwritten by the -// product with Q. -// -// work must have length at least max(1,lwork), and lwork must be at least -// max(1,n), if side == blas.Left, and max(1,m), if side == blas.Right. For -// optimum performance lwork should be at least n*nb if side == blas.Left and -// m*nb if side == blas.Right, where nb is the optimal block size. On return, -// work[0] will contain the optimal value of lwork. -// -// If lwork == -1, instead of performing Dormhr, only the optimal value of lwork -// will be stored in work[0]. -// -// If any requirement on input sizes is not met, Dormhr will panic. -// -// Dormhr is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dormhr(side blas.Side, trans blas.Transpose, m, n, ilo, ihi int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) { - nq := n // The order of Q. - nw := m // The minimum length of work. - if side == blas.Left { - nq = m - nw = n - } - switch { - case side != blas.Left && side != blas.Right: - panic(badSide) - case trans != blas.NoTrans && trans != blas.Trans: - panic(badTrans) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case ilo < 0 || max(1, nq) <= ilo: - panic(badIlo) - case ihi < min(ilo, nq-1) || nq <= ihi: - panic(badIhi) - case lda < max(1, nq): - panic(badLdA) - case lwork < max(1, nw) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - if m == 0 || n == 0 { - work[0] = 1 - return - } - - nh := ihi - ilo - var nb int - if side == blas.Left { - opts := "LN" - if trans == blas.Trans { - opts = "LT" - } - nb = impl.Ilaenv(1, "DORMQR", opts, nh, n, nh, -1) - } else { - opts := "RN" - if trans == blas.Trans { - opts = "RT" - } - nb = impl.Ilaenv(1, "DORMQR", opts, m, nh, nh, -1) - } - lwkopt := max(1, nw) * nb - if lwork == -1 { - work[0] = float64(lwkopt) - return - } - - if nh == 0 { - work[0] = 1 - return - } - - switch { - case len(a) < (nq-1)*lda+nq: - panic(shortA) - case len(c) < (m-1)*ldc+n: - panic(shortC) - case len(tau) != nq-1: - panic(badLenTau) - } - - if side == blas.Left { - impl.Dormqr(side, trans, nh, n, nh, a[(ilo+1)*lda+ilo:], lda, - tau[ilo:ihi], c[(ilo+1)*ldc:], ldc, work, lwork) - } else { - impl.Dormqr(side, trans, m, nh, nh, a[(ilo+1)*lda+ilo:], lda, - tau[ilo:ihi], c[ilo+1:], ldc, work, lwork) - } - work[0] = float64(lwkopt) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dorml2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dorml2.go deleted file mode 100644 index df474ca..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dorml2.go +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import "gonum.org/v1/gonum/blas" - -// Dorml2 multiplies a general matrix C by an orthogonal matrix from an LQ factorization -// determined by Dgelqf. -// C = Q * C if side == blas.Left and trans == blas.NoTrans -// C = Qᵀ * C if side == blas.Left and trans == blas.Trans -// C = C * Q if side == blas.Right and trans == blas.NoTrans -// C = C * Qᵀ if side == blas.Right and trans == blas.Trans -// If side == blas.Left, a is a matrix of side k×m, and if side == blas.Right -// a is of size k×n. -// -// tau contains the Householder factors and is of length at least k and this function will -// panic otherwise. -// -// work is temporary storage of length at least n if side == blas.Left -// and at least m if side == blas.Right and this function will panic otherwise. -// -// Dorml2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dorml2(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64) { - left := side == blas.Left - switch { - case !left && side != blas.Right: - panic(badSide) - case trans != blas.Trans && trans != blas.NoTrans: - panic(badTrans) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case left && k > m: - panic(kGTM) - case !left && k > n: - panic(kGTN) - case left && lda < max(1, m): - panic(badLdA) - case !left && lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if m == 0 || n == 0 || k == 0 { - return - } - - switch { - case left && len(a) < (k-1)*lda+m: - panic(shortA) - case !left && len(a) < (k-1)*lda+n: - panic(shortA) - case len(tau) < k: - panic(shortTau) - case len(c) < (m-1)*ldc+n: - panic(shortC) - case left && len(work) < n: - panic(shortWork) - case !left && len(work) < m: - panic(shortWork) - } - - notrans := trans == blas.NoTrans - switch { - case left && notrans: - for i := 0; i < k; i++ { - aii := a[i*lda+i] - a[i*lda+i] = 1 - impl.Dlarf(side, m-i, n, a[i*lda+i:], 1, tau[i], c[i*ldc:], ldc, work) - a[i*lda+i] = aii - } - - case left && !notrans: - for i := k - 1; i >= 0; i-- { - aii := a[i*lda+i] - a[i*lda+i] = 1 - impl.Dlarf(side, m-i, n, a[i*lda+i:], 1, tau[i], c[i*ldc:], ldc, work) - a[i*lda+i] = aii - } - - case !left && notrans: - for i := k - 1; i >= 0; i-- { - aii := a[i*lda+i] - a[i*lda+i] = 1 - impl.Dlarf(side, m, n-i, a[i*lda+i:], 1, tau[i], c[i:], ldc, work) - a[i*lda+i] = aii - } - - case !left && !notrans: - for i := 0; i < k; i++ { - aii := a[i*lda+i] - a[i*lda+i] = 1 - impl.Dlarf(side, m, n-i, a[i*lda+i:], 1, tau[i], c[i:], ldc, work) - a[i*lda+i] = aii - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dormlq.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dormlq.go deleted file mode 100644 index a86a8a5..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dormlq.go +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dormlq multiplies the matrix C by the orthogonal matrix Q defined by the -// slices a and tau. A and tau are as returned from Dgelqf. -// C = Q * C if side == blas.Left and trans == blas.NoTrans -// C = Qᵀ * C if side == blas.Left and trans == blas.Trans -// C = C * Q if side == blas.Right and trans == blas.NoTrans -// C = C * Qᵀ if side == blas.Right and trans == blas.Trans -// If side == blas.Left, A is a matrix of side k×m, and if side == blas.Right -// A is of size k×n. This uses a blocked algorithm. -// -// work is temporary storage, and lwork specifies the usable memory length. -// At minimum, lwork >= m if side == blas.Left and lwork >= n if side == blas.Right, -// and this function will panic otherwise. -// Dormlq uses a block algorithm, but the block size is limited -// by the temporary space available. If lwork == -1, instead of performing Dormlq, -// the optimal work length will be stored into work[0]. -// -// tau contains the Householder scales and must have length at least k, and -// this function will panic otherwise. -func (impl Implementation) Dormlq(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) { - left := side == blas.Left - nw := m - if left { - nw = n - } - switch { - case !left && side != blas.Right: - panic(badSide) - case trans != blas.Trans && trans != blas.NoTrans: - panic(badTrans) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case left && k > m: - panic(kGTM) - case !left && k > n: - panic(kGTN) - case left && lda < max(1, m): - panic(badLdA) - case !left && lda < max(1, n): - panic(badLdA) - case lwork < max(1, nw) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - if m == 0 || n == 0 || k == 0 { - work[0] = 1 - return - } - - const ( - nbmax = 64 - ldt = nbmax - tsize = nbmax * ldt - ) - opts := string(side) + string(trans) - nb := min(nbmax, impl.Ilaenv(1, "DORMLQ", opts, m, n, k, -1)) - lworkopt := max(1, nw)*nb + tsize - if lwork == -1 { - work[0] = float64(lworkopt) - return - } - - switch { - case left && len(a) < (k-1)*lda+m: - panic(shortA) - case !left && len(a) < (k-1)*lda+n: - panic(shortA) - case len(tau) < k: - panic(shortTau) - case len(c) < (m-1)*ldc+n: - panic(shortC) - } - - nbmin := 2 - if 1 < nb && nb < k { - iws := nw*nb + tsize - if lwork < iws { - nb = (lwork - tsize) / nw - nbmin = max(2, impl.Ilaenv(2, "DORMLQ", opts, m, n, k, -1)) - } - } - if nb < nbmin || k <= nb { - // Call unblocked code. - impl.Dorml2(side, trans, m, n, k, a, lda, tau, c, ldc, work) - work[0] = float64(lworkopt) - return - } - - t := work[:tsize] - wrk := work[tsize:] - ldwrk := nb - - notrans := trans == blas.NoTrans - transt := blas.NoTrans - if notrans { - transt = blas.Trans - } - - switch { - case left && notrans: - for i := 0; i < k; i += nb { - ib := min(nb, k-i) - impl.Dlarft(lapack.Forward, lapack.RowWise, m-i, ib, - a[i*lda+i:], lda, - tau[i:], - t, ldt) - impl.Dlarfb(side, transt, lapack.Forward, lapack.RowWise, m-i, n, ib, - a[i*lda+i:], lda, - t, ldt, - c[i*ldc:], ldc, - wrk, ldwrk) - } - - case left && !notrans: - for i := ((k - 1) / nb) * nb; i >= 0; i -= nb { - ib := min(nb, k-i) - impl.Dlarft(lapack.Forward, lapack.RowWise, m-i, ib, - a[i*lda+i:], lda, - tau[i:], - t, ldt) - impl.Dlarfb(side, transt, lapack.Forward, lapack.RowWise, m-i, n, ib, - a[i*lda+i:], lda, - t, ldt, - c[i*ldc:], ldc, - wrk, ldwrk) - } - - case !left && notrans: - for i := ((k - 1) / nb) * nb; i >= 0; i -= nb { - ib := min(nb, k-i) - impl.Dlarft(lapack.Forward, lapack.RowWise, n-i, ib, - a[i*lda+i:], lda, - tau[i:], - t, ldt) - impl.Dlarfb(side, transt, lapack.Forward, lapack.RowWise, m, n-i, ib, - a[i*lda+i:], lda, - t, ldt, - c[i:], ldc, - wrk, ldwrk) - } - - case !left && !notrans: - for i := 0; i < k; i += nb { - ib := min(nb, k-i) - impl.Dlarft(lapack.Forward, lapack.RowWise, n-i, ib, - a[i*lda+i:], lda, - tau[i:], - t, ldt) - impl.Dlarfb(side, transt, lapack.Forward, lapack.RowWise, m, n-i, ib, - a[i*lda+i:], lda, - t, ldt, - c[i:], ldc, - wrk, ldwrk) - } - } - work[0] = float64(lworkopt) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dormqr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dormqr.go deleted file mode 100644 index ae67de5..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dormqr.go +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dormqr multiplies an m×n matrix C by an orthogonal matrix Q as -// C = Q * C if side == blas.Left and trans == blas.NoTrans, -// C = Qᵀ * C if side == blas.Left and trans == blas.Trans, -// C = C * Q if side == blas.Right and trans == blas.NoTrans, -// C = C * Qᵀ if side == blas.Right and trans == blas.Trans, -// where Q is defined as the product of k elementary reflectors -// Q = H_0 * H_1 * ... * H_{k-1}. -// -// If side == blas.Left, A is an m×k matrix and 0 <= k <= m. -// If side == blas.Right, A is an n×k matrix and 0 <= k <= n. -// The ith column of A contains the vector which defines the elementary -// reflector H_i and tau[i] contains its scalar factor. tau must have length k -// and Dormqr will panic otherwise. Dgeqrf returns A and tau in the required -// form. -// -// work must have length at least max(1,lwork), and lwork must be at least n if -// side == blas.Left and at least m if side == blas.Right, otherwise Dormqr will -// panic. -// -// work is temporary storage, and lwork specifies the usable memory length. At -// minimum, lwork >= m if side == blas.Left and lwork >= n if side == -// blas.Right, and this function will panic otherwise. Larger values of lwork -// will generally give better performance. On return, work[0] will contain the -// optimal value of lwork. -// -// If lwork is -1, instead of performing Dormqr, the optimal workspace size will -// be stored into work[0]. -func (impl Implementation) Dormqr(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) { - left := side == blas.Left - nq := n - nw := m - if left { - nq = m - nw = n - } - switch { - case !left && side != blas.Right: - panic(badSide) - case trans != blas.NoTrans && trans != blas.Trans: - panic(badTrans) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case left && k > m: - panic(kGTM) - case !left && k > n: - panic(kGTN) - case lda < max(1, k): - panic(badLdA) - case ldc < max(1, n): - panic(badLdC) - case lwork < max(1, nw) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - if m == 0 || n == 0 || k == 0 { - work[0] = 1 - return - } - - const ( - nbmax = 64 - ldt = nbmax - tsize = nbmax * ldt - ) - opts := string(side) + string(trans) - nb := min(nbmax, impl.Ilaenv(1, "DORMQR", opts, m, n, k, -1)) - lworkopt := max(1, nw)*nb + tsize - if lwork == -1 { - work[0] = float64(lworkopt) - return - } - - switch { - case len(a) < (nq-1)*lda+k: - panic(shortA) - case len(tau) != k: - panic(badLenTau) - case len(c) < (m-1)*ldc+n: - panic(shortC) - } - - nbmin := 2 - if 1 < nb && nb < k { - if lwork < nw*nb+tsize { - nb = (lwork - tsize) / nw - nbmin = max(2, impl.Ilaenv(2, "DORMQR", opts, m, n, k, -1)) - } - } - - if nb < nbmin || k <= nb { - // Call unblocked code. - impl.Dorm2r(side, trans, m, n, k, a, lda, tau, c, ldc, work) - work[0] = float64(lworkopt) - return - } - - var ( - ldwork = nb - notrans = trans == blas.NoTrans - ) - switch { - case left && notrans: - for i := ((k - 1) / nb) * nb; i >= 0; i -= nb { - ib := min(nb, k-i) - impl.Dlarft(lapack.Forward, lapack.ColumnWise, m-i, ib, - a[i*lda+i:], lda, - tau[i:], - work[:tsize], ldt) - impl.Dlarfb(side, trans, lapack.Forward, lapack.ColumnWise, m-i, n, ib, - a[i*lda+i:], lda, - work[:tsize], ldt, - c[i*ldc:], ldc, - work[tsize:], ldwork) - } - - case left && !notrans: - for i := 0; i < k; i += nb { - ib := min(nb, k-i) - impl.Dlarft(lapack.Forward, lapack.ColumnWise, m-i, ib, - a[i*lda+i:], lda, - tau[i:], - work[:tsize], ldt) - impl.Dlarfb(side, trans, lapack.Forward, lapack.ColumnWise, m-i, n, ib, - a[i*lda+i:], lda, - work[:tsize], ldt, - c[i*ldc:], ldc, - work[tsize:], ldwork) - } - - case !left && notrans: - for i := 0; i < k; i += nb { - ib := min(nb, k-i) - impl.Dlarft(lapack.Forward, lapack.ColumnWise, n-i, ib, - a[i*lda+i:], lda, - tau[i:], - work[:tsize], ldt) - impl.Dlarfb(side, trans, lapack.Forward, lapack.ColumnWise, m, n-i, ib, - a[i*lda+i:], lda, - work[:tsize], ldt, - c[i:], ldc, - work[tsize:], ldwork) - } - - case !left && !notrans: - for i := ((k - 1) / nb) * nb; i >= 0; i -= nb { - ib := min(nb, k-i) - impl.Dlarft(lapack.Forward, lapack.ColumnWise, n-i, ib, - a[i*lda+i:], lda, - tau[i:], - work[:tsize], ldt) - impl.Dlarfb(side, trans, lapack.Forward, lapack.ColumnWise, m, n-i, ib, - a[i*lda+i:], lda, - work[:tsize], ldt, - c[i:], ldc, - work[tsize:], ldwork) - } - } - work[0] = float64(lworkopt) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dormr2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dormr2.go deleted file mode 100644 index 4bf0d87..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dormr2.go +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import "gonum.org/v1/gonum/blas" - -// Dormr2 multiplies a general matrix C by an orthogonal matrix from a RQ factorization -// determined by Dgerqf. -// C = Q * C if side == blas.Left and trans == blas.NoTrans -// C = Qᵀ * C if side == blas.Left and trans == blas.Trans -// C = C * Q if side == blas.Right and trans == blas.NoTrans -// C = C * Qᵀ if side == blas.Right and trans == blas.Trans -// If side == blas.Left, a is a matrix of size k×m, and if side == blas.Right -// a is of size k×n. -// -// tau contains the Householder factors and is of length at least k and this function -// will panic otherwise. -// -// work is temporary storage of length at least n if side == blas.Left -// and at least m if side == blas.Right and this function will panic otherwise. -// -// Dormr2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dormr2(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64) { - left := side == blas.Left - nq := n - nw := m - if left { - nq = m - nw = n - } - switch { - case !left && side != blas.Right: - panic(badSide) - case trans != blas.NoTrans && trans != blas.Trans: - panic(badTrans) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case left && k > m: - panic(kGTM) - case !left && k > n: - panic(kGTN) - case lda < max(1, nq): - panic(badLdA) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if m == 0 || n == 0 || k == 0 { - return - } - - switch { - case len(a) < (k-1)*lda+nq: - panic(shortA) - case len(tau) < k: - panic(shortTau) - case len(c) < (m-1)*ldc+n: - panic(shortC) - case len(work) < nw: - panic(shortWork) - } - - if left { - if trans == blas.NoTrans { - for i := k - 1; i >= 0; i-- { - aii := a[i*lda+(m-k+i)] - a[i*lda+(m-k+i)] = 1 - impl.Dlarf(side, m-k+i+1, n, a[i*lda:], 1, tau[i], c, ldc, work) - a[i*lda+(m-k+i)] = aii - } - return - } - for i := 0; i < k; i++ { - aii := a[i*lda+(m-k+i)] - a[i*lda+(m-k+i)] = 1 - impl.Dlarf(side, m-k+i+1, n, a[i*lda:], 1, tau[i], c, ldc, work) - a[i*lda+(m-k+i)] = aii - } - return - } - if trans == blas.NoTrans { - for i := 0; i < k; i++ { - aii := a[i*lda+(n-k+i)] - a[i*lda+(n-k+i)] = 1 - impl.Dlarf(side, m, n-k+i+1, a[i*lda:], 1, tau[i], c, ldc, work) - a[i*lda+(n-k+i)] = aii - } - return - } - for i := k - 1; i >= 0; i-- { - aii := a[i*lda+(n-k+i)] - a[i*lda+(n-k+i)] = 1 - impl.Dlarf(side, m, n-k+i+1, a[i*lda:], 1, tau[i], c, ldc, work) - a[i*lda+(n-k+i)] = aii - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dpbcon.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dpbcon.go deleted file mode 100644 index f55a596..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dpbcon.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright ©2019 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dpbcon returns an estimate of the reciprocal of the condition number (in the -// 1-norm) of an n×n symmetric positive definite band matrix using the Cholesky -// factorization -// A = Uᵀ*U if uplo == blas.Upper -// A = L*Lᵀ if uplo == blas.Lower -// computed by Dpbtrf. The estimate is obtained for norm(inv(A)), and the -// reciprocal of the condition number is computed as -// rcond = 1 / (anorm * norm(inv(A))). -// -// The length of work must be at least 3*n and the length of iwork must be at -// least n. -func (impl Implementation) Dpbcon(uplo blas.Uplo, n, kd int, ab []float64, ldab int, anorm float64, work []float64, iwork []int) (rcond float64) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case kd < 0: - panic(kdLT0) - case ldab < kd+1: - panic(badLdA) - case anorm < 0: - panic(badNorm) - } - - // Quick return if possible. - if n == 0 { - return 1 - } - - switch { - case len(ab) < (n-1)*ldab+kd+1: - panic(shortAB) - case len(work) < 3*n: - panic(shortWork) - case len(iwork) < n: - panic(shortIWork) - } - - // Quick return if possible. - if anorm == 0 { - return 0 - } - - const smlnum = dlamchS - - var ( - ainvnm float64 - kase int - isave [3]int - normin bool - - // Denote work slices. - x = work[:n] - v = work[n : 2*n] - cnorm = work[2*n : 3*n] - ) - // Estimate the 1-norm of the inverse. - bi := blas64.Implementation() - for { - ainvnm, kase = impl.Dlacn2(n, v, x, iwork, ainvnm, kase, &isave) - if kase == 0 { - break - } - var op1, op2 blas.Transpose - if uplo == blas.Upper { - // Multiply x by inv(Uᵀ), - op1 = blas.Trans - // then by inv(Uᵀ). - op2 = blas.NoTrans - } else { - // Multiply x by inv(L), - op1 = blas.NoTrans - // then by inv(Lᵀ). - op2 = blas.Trans - } - scaleL := impl.Dlatbs(uplo, op1, blas.NonUnit, normin, n, kd, ab, ldab, x, cnorm) - normin = true - scaleU := impl.Dlatbs(uplo, op2, blas.NonUnit, normin, n, kd, ab, ldab, x, cnorm) - // Multiply x by 1/scale if doing so will not cause overflow. - scale := scaleL * scaleU - if scale != 1 { - ix := bi.Idamax(n, x, 1) - if scale < math.Abs(x[ix])*smlnum || scale == 0 { - return 0 - } - impl.Drscl(n, scale, x, 1) - } - } - if ainvnm == 0 { - return 0 - } - // Return the estimate of the reciprocal condition number. - return (1 / ainvnm) / anorm -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dpbtf2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dpbtf2.go deleted file mode 100644 index e54bc46..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dpbtf2.go +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright ©2017 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dpbtf2 computes the Cholesky factorization of a symmetric positive banded -// matrix ab. The matrix ab is n×n with kd diagonal bands. The Cholesky -// factorization computed is -// A = Uᵀ * U if ul == blas.Upper -// A = L * Lᵀ if ul == blas.Lower -// ul also specifies the storage of ab. If ul == blas.Upper, then -// ab is stored as an upper-triangular banded matrix with kd super-diagonals, -// and if ul == blas.Lower, ab is stored as a lower-triangular banded matrix -// with kd sub-diagonals. On exit, the banded matrix U or L is stored in-place -// into ab depending on the value of ul. Dpbtf2 returns whether the factorization -// was successfully completed. -// -// The band storage scheme is illustrated below when n = 6, and kd = 2. -// The resulting Cholesky decomposition is stored in the same elements as the -// input band matrix (a11 becomes u11 or l11, etc.). -// -// ul = blas.Upper -// a11 a12 a13 -// a22 a23 a24 -// a33 a34 a35 -// a44 a45 a46 -// a55 a56 * -// a66 * * -// -// ul = blas.Lower -// * * a11 -// * a21 a22 -// a31 a32 a33 -// a42 a43 a44 -// a53 a54 a55 -// a64 a65 a66 -// -// Dpbtf2 is the unblocked version of the algorithm, see Dpbtrf for the blocked -// version. -// -// Dpbtf2 is an internal routine, exported for testing purposes. -func (Implementation) Dpbtf2(uplo blas.Uplo, n, kd int, ab []float64, ldab int) (ok bool) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case kd < 0: - panic(kdLT0) - case ldab < kd+1: - panic(badLdA) - } - - // Quick return if possible. - if n == 0 { - return true - } - - if len(ab) < (n-1)*ldab+kd+1 { - panic(shortAB) - } - - bi := blas64.Implementation() - - kld := max(1, ldab-1) - if uplo == blas.Upper { - // Compute the Cholesky factorization A = Uᵀ * U. - for j := 0; j < n; j++ { - // Compute U(j,j) and test for non-positive-definiteness. - ajj := ab[j*ldab] - if ajj <= 0 { - return false - } - ajj = math.Sqrt(ajj) - ab[j*ldab] = ajj - // Compute elements j+1:j+kn of row j and update the trailing submatrix - // within the band. - kn := min(kd, n-j-1) - if kn > 0 { - bi.Dscal(kn, 1/ajj, ab[j*ldab+1:], 1) - bi.Dsyr(blas.Upper, kn, -1, ab[j*ldab+1:], 1, ab[(j+1)*ldab:], kld) - } - } - return true - } - // Compute the Cholesky factorization A = L * Lᵀ. - for j := 0; j < n; j++ { - // Compute L(j,j) and test for non-positive-definiteness. - ajj := ab[j*ldab+kd] - if ajj <= 0 { - return false - } - ajj = math.Sqrt(ajj) - ab[j*ldab+kd] = ajj - // Compute elements j+1:j+kn of column j and update the trailing submatrix - // within the band. - kn := min(kd, n-j-1) - if kn > 0 { - bi.Dscal(kn, 1/ajj, ab[(j+1)*ldab+kd-1:], kld) - bi.Dsyr(blas.Lower, kn, -1, ab[(j+1)*ldab+kd-1:], kld, ab[(j+1)*ldab+kd:], kld) - } - } - return true -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dpbtrf.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dpbtrf.go deleted file mode 100644 index d8814cd..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dpbtrf.go +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright ©2019 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dpbtrf computes the Cholesky factorization of an n×n symmetric positive -// definite band matrix -// A = Uᵀ * U if uplo == blas.Upper -// A = L * Lᵀ if uplo == blas.Lower -// where U is an upper triangular band matrix and L is lower triangular. kd is -// the number of super- or sub-diagonals of A. -// -// The band storage scheme is illustrated below when n = 6 and kd = 2. Elements -// marked * are not used by the function. -// -// uplo == blas.Upper -// On entry: On return: -// a00 a01 a02 u00 u01 u02 -// a11 a12 a13 u11 u12 u13 -// a22 a23 a24 u22 u23 u24 -// a33 a34 a35 u33 u34 u35 -// a44 a45 * u44 u45 * -// a55 * * u55 * * -// -// uplo == blas.Lower -// On entry: On return: -// * * a00 * * l00 -// * a10 a11 * l10 l11 -// a20 a21 a22 l20 l21 l22 -// a31 a32 a33 l31 l32 l33 -// a42 a43 a44 l42 l43 l44 -// a53 a54 a55 l53 l54 l55 -func (impl Implementation) Dpbtrf(uplo blas.Uplo, n, kd int, ab []float64, ldab int) (ok bool) { - const nbmax = 32 - - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case kd < 0: - panic(kdLT0) - case ldab < kd+1: - panic(badLdA) - } - - // Quick return if possible. - if n == 0 { - return true - } - - if len(ab) < (n-1)*ldab+kd+1 { - panic(shortAB) - } - - opts := string(blas.Upper) - if uplo == blas.Lower { - opts = string(blas.Lower) - } - nb := impl.Ilaenv(1, "DPBTRF", opts, n, kd, -1, -1) - // The block size must not exceed the semi-bandwidth kd, and must not - // exceed the limit set by the size of the local array work. - nb = min(nb, nbmax) - - if nb <= 1 || kd < nb { - // Use unblocked code. - return impl.Dpbtf2(uplo, n, kd, ab, ldab) - } - - // Use blocked code. - ldwork := nb - work := make([]float64, nb*ldwork) - bi := blas64.Implementation() - if uplo == blas.Upper { - // Compute the Cholesky factorization of a symmetric band - // matrix, given the upper triangle of the matrix in band - // storage. - - // Process the band matrix one diagonal block at a time. - for i := 0; i < n; i += nb { - ib := min(nb, n-i) - // Factorize the diagonal block. - ok := impl.Dpotf2(uplo, ib, ab[i*ldab:], ldab-1) - if !ok { - return false - } - if i+ib >= n { - continue - } - // Update the relevant part of the trailing submatrix. - // If A11 denotes the diagonal block which has just been - // factorized, then we need to update the remaining - // blocks in the diagram: - // - // A11 A12 A13 - // A22 A23 - // A33 - // - // The numbers of rows and columns in the partitioning - // are ib, i2, i3 respectively. The blocks A12, A22 and - // A23 are empty if ib = kd. The upper triangle of A13 - // lies outside the band. - i2 := min(kd-ib, n-i-ib) - if i2 > 0 { - // Update A12. - bi.Dtrsm(blas.Left, blas.Upper, blas.Trans, blas.NonUnit, ib, i2, - 1, ab[i*ldab:], ldab-1, ab[i*ldab+ib:], ldab-1) - // Update A22. - bi.Dsyrk(blas.Upper, blas.Trans, i2, ib, - -1, ab[i*ldab+ib:], ldab-1, 1, ab[(i+ib)*ldab:], ldab-1) - } - i3 := min(ib, n-i-kd) - if i3 > 0 { - // Copy the lower triangle of A13 into the work array. - for ii := 0; ii < ib; ii++ { - for jj := 0; jj <= min(ii, i3-1); jj++ { - work[ii*ldwork+jj] = ab[(i+ii)*ldab+kd-ii+jj] - } - } - // Update A13 (in the work array). - bi.Dtrsm(blas.Left, blas.Upper, blas.Trans, blas.NonUnit, ib, i3, - 1, ab[i*ldab:], ldab-1, work, ldwork) - // Update A23. - if i2 > 0 { - bi.Dgemm(blas.Trans, blas.NoTrans, i2, i3, ib, - -1, ab[i*ldab+ib:], ldab-1, work, ldwork, - 1, ab[(i+ib)*ldab+kd-ib:], ldab-1) - } - // Update A33. - bi.Dsyrk(blas.Upper, blas.Trans, i3, ib, - -1, work, ldwork, 1, ab[(i+kd)*ldab:], ldab-1) - // Copy the lower triangle of A13 back into place. - for ii := 0; ii < ib; ii++ { - for jj := 0; jj <= min(ii, i3-1); jj++ { - ab[(i+ii)*ldab+kd-ii+jj] = work[ii*ldwork+jj] - } - } - } - } - } else { - // Compute the Cholesky factorization of a symmetric band - // matrix, given the lower triangle of the matrix in band - // storage. - - // Process the band matrix one diagonal block at a time. - for i := 0; i < n; i += nb { - ib := min(nb, n-i) - // Factorize the diagonal block. - ok := impl.Dpotf2(uplo, ib, ab[i*ldab+kd:], ldab-1) - if !ok { - return false - } - if i+ib >= n { - continue - } - // Update the relevant part of the trailing submatrix. - // If A11 denotes the diagonal block which has just been - // factorized, then we need to update the remaining - // blocks in the diagram: - // - // A11 - // A21 A22 - // A31 A32 A33 - // - // The numbers of rows and columns in the partitioning - // are ib, i2, i3 respectively. The blocks A21, A22 and - // A32 are empty if ib = kd. The lowr triangle of A31 - // lies outside the band. - i2 := min(kd-ib, n-i-ib) - if i2 > 0 { - // Update A21. - bi.Dtrsm(blas.Right, blas.Lower, blas.Trans, blas.NonUnit, i2, ib, - 1, ab[i*ldab+kd:], ldab-1, ab[(i+ib)*ldab+kd-ib:], ldab-1) - // Update A22. - bi.Dsyrk(blas.Lower, blas.NoTrans, i2, ib, - -1, ab[(i+ib)*ldab+kd-ib:], ldab-1, 1, ab[(i+ib)*ldab+kd:], ldab-1) - } - i3 := min(ib, n-i-kd) - if i3 > 0 { - // Copy the upper triangle of A31 into the work array. - for ii := 0; ii < i3; ii++ { - for jj := ii; jj < ib; jj++ { - work[ii*ldwork+jj] = ab[(ii+i+kd)*ldab+jj-ii] - } - } - // Update A31 (in the work array). - bi.Dtrsm(blas.Right, blas.Lower, blas.Trans, blas.NonUnit, i3, ib, - 1, ab[i*ldab+kd:], ldab-1, work, ldwork) - // Update A32. - if i2 > 0 { - bi.Dgemm(blas.NoTrans, blas.Trans, i3, i2, ib, - -1, work, ldwork, ab[(i+ib)*ldab+kd-ib:], ldab-1, - 1, ab[(i+kd)*ldab+ib:], ldab-1) - } - // Update A33. - bi.Dsyrk(blas.Lower, blas.NoTrans, i3, ib, - -1, work, ldwork, 1, ab[(i+kd)*ldab+kd:], ldab-1) - // Copy the upper triangle of A31 back into place. - for ii := 0; ii < i3; ii++ { - for jj := ii; jj < ib; jj++ { - ab[(ii+i+kd)*ldab+jj-ii] = work[ii*ldwork+jj] - } - } - } - } - } - return true -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dpbtrs.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dpbtrs.go deleted file mode 100644 index f3d9559..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dpbtrs.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright ©2019 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dpbtrs solves a system of linear equations A*X = B with an n×n symmetric -// positive definite band matrix A using the Cholesky factorization -// A = Uᵀ * U if uplo == blas.Upper -// A = L * Lᵀ if uplo == blas.Lower -// computed by Dpbtrf. kd is the number of super- or sub-diagonals of A. See the -// documentation for Dpbtrf for a description of the band storage format of A. -// -// On entry, b contains the n×nrhs right hand side matrix B. On return, it is -// overwritten with the solution matrix X. -func (Implementation) Dpbtrs(uplo blas.Uplo, n, kd, nrhs int, ab []float64, ldab int, b []float64, ldb int) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case kd < 0: - panic(kdLT0) - case nrhs < 0: - panic(nrhsLT0) - case ldab < kd+1: - panic(badLdA) - case ldb < max(1, nrhs): - panic(badLdB) - } - - // Quick return if possible. - if n == 0 || nrhs == 0 { - return - } - - if len(ab) < (n-1)*ldab+kd+1 { - panic(shortAB) - } - if len(b) < (n-1)*ldb+nrhs { - panic(shortB) - } - - bi := blas64.Implementation() - if uplo == blas.Upper { - // Solve A*X = B where A = Uᵀ*U. - for j := 0; j < nrhs; j++ { - // Solve Uᵀ*Y = B, overwriting B with Y. - bi.Dtbsv(blas.Upper, blas.Trans, blas.NonUnit, n, kd, ab, ldab, b[j:], ldb) - // Solve U*X = Y, overwriting Y with X. - bi.Dtbsv(blas.Upper, blas.NoTrans, blas.NonUnit, n, kd, ab, ldab, b[j:], ldb) - } - } else { - // Solve A*X = B where A = L*Lᵀ. - for j := 0; j < nrhs; j++ { - // Solve L*Y = B, overwriting B with Y. - bi.Dtbsv(blas.Lower, blas.NoTrans, blas.NonUnit, n, kd, ab, ldab, b[j:], ldb) - // Solve Lᵀ*X = Y, overwriting Y with X. - bi.Dtbsv(blas.Lower, blas.Trans, blas.NonUnit, n, kd, ab, ldab, b[j:], ldb) - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dpocon.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dpocon.go deleted file mode 100644 index 7af4c18..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dpocon.go +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dpocon estimates the reciprocal of the condition number of a positive-definite -// matrix A given the Cholesky decomposition of A. The condition number computed -// is based on the 1-norm and the ∞-norm. -// -// anorm is the 1-norm and the ∞-norm of the original matrix A. -// -// work is a temporary data slice of length at least 3*n and Dpocon will panic otherwise. -// -// iwork is a temporary data slice of length at least n and Dpocon will panic otherwise. -func (impl Implementation) Dpocon(uplo blas.Uplo, n int, a []float64, lda int, anorm float64, work []float64, iwork []int) float64 { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case anorm < 0: - panic(negANorm) - } - - // Quick return if possible. - if n == 0 { - return 1 - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(work) < 3*n: - panic(shortWork) - case len(iwork) < n: - panic(shortIWork) - } - - if anorm == 0 { - return 0 - } - - bi := blas64.Implementation() - - var ( - smlnum = dlamchS - rcond float64 - sl, su float64 - normin bool - ainvnm float64 - kase int - isave [3]int - ) - for { - ainvnm, kase = impl.Dlacn2(n, work[n:], work, iwork, ainvnm, kase, &isave) - if kase == 0 { - if ainvnm != 0 { - rcond = (1 / ainvnm) / anorm - } - return rcond - } - if uplo == blas.Upper { - sl = impl.Dlatrs(blas.Upper, blas.Trans, blas.NonUnit, normin, n, a, lda, work, work[2*n:]) - normin = true - su = impl.Dlatrs(blas.Upper, blas.NoTrans, blas.NonUnit, normin, n, a, lda, work, work[2*n:]) - } else { - sl = impl.Dlatrs(blas.Lower, blas.NoTrans, blas.NonUnit, normin, n, a, lda, work, work[2*n:]) - normin = true - su = impl.Dlatrs(blas.Lower, blas.Trans, blas.NonUnit, normin, n, a, lda, work, work[2*n:]) - } - scale := sl * su - if scale != 1 { - ix := bi.Idamax(n, work, 1) - if scale == 0 || scale < math.Abs(work[ix])*smlnum { - return rcond - } - impl.Drscl(n, scale, work, 1) - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dpotf2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dpotf2.go deleted file mode 100644 index 83411f1..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dpotf2.go +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dpotf2 computes the Cholesky decomposition of the symmetric positive definite -// matrix a. If ul == blas.Upper, then a is stored as an upper-triangular matrix, -// and a = Uᵀ U is stored in place into a. If ul == blas.Lower, then a = L Lᵀ -// is computed and stored in-place into a. If a is not positive definite, false -// is returned. This is the unblocked version of the algorithm. -// -// Dpotf2 is an internal routine. It is exported for testing purposes. -func (Implementation) Dpotf2(ul blas.Uplo, n int, a []float64, lda int) (ok bool) { - switch { - case ul != blas.Upper && ul != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if n == 0 { - return true - } - - if len(a) < (n-1)*lda+n { - panic(shortA) - } - - bi := blas64.Implementation() - - if ul == blas.Upper { - for j := 0; j < n; j++ { - ajj := a[j*lda+j] - if j != 0 { - ajj -= bi.Ddot(j, a[j:], lda, a[j:], lda) - } - if ajj <= 0 || math.IsNaN(ajj) { - a[j*lda+j] = ajj - return false - } - ajj = math.Sqrt(ajj) - a[j*lda+j] = ajj - if j < n-1 { - bi.Dgemv(blas.Trans, j, n-j-1, - -1, a[j+1:], lda, a[j:], lda, - 1, a[j*lda+j+1:], 1) - bi.Dscal(n-j-1, 1/ajj, a[j*lda+j+1:], 1) - } - } - return true - } - for j := 0; j < n; j++ { - ajj := a[j*lda+j] - if j != 0 { - ajj -= bi.Ddot(j, a[j*lda:], 1, a[j*lda:], 1) - } - if ajj <= 0 || math.IsNaN(ajj) { - a[j*lda+j] = ajj - return false - } - ajj = math.Sqrt(ajj) - a[j*lda+j] = ajj - if j < n-1 { - bi.Dgemv(blas.NoTrans, n-j-1, j, - -1, a[(j+1)*lda:], lda, a[j*lda:], 1, - 1, a[(j+1)*lda+j:], lda) - bi.Dscal(n-j-1, 1/ajj, a[(j+1)*lda+j:], lda) - } - } - return true -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dpotrf.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dpotrf.go deleted file mode 100644 index 7c81680..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dpotrf.go +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dpotrf computes the Cholesky decomposition of the symmetric positive definite -// matrix a. If ul == blas.Upper, then a is stored as an upper-triangular matrix, -// and a = Uᵀ U is stored in place into a. If ul == blas.Lower, then a = L Lᵀ -// is computed and stored in-place into a. If a is not positive definite, false -// is returned. This is the blocked version of the algorithm. -func (impl Implementation) Dpotrf(ul blas.Uplo, n int, a []float64, lda int) (ok bool) { - switch { - case ul != blas.Upper && ul != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if n == 0 { - return true - } - - if len(a) < (n-1)*lda+n { - panic(shortA) - } - - nb := impl.Ilaenv(1, "DPOTRF", string(ul), n, -1, -1, -1) - if nb <= 1 || n <= nb { - return impl.Dpotf2(ul, n, a, lda) - } - bi := blas64.Implementation() - if ul == blas.Upper { - for j := 0; j < n; j += nb { - jb := min(nb, n-j) - bi.Dsyrk(blas.Upper, blas.Trans, jb, j, - -1, a[j:], lda, - 1, a[j*lda+j:], lda) - ok = impl.Dpotf2(blas.Upper, jb, a[j*lda+j:], lda) - if !ok { - return ok - } - if j+jb < n { - bi.Dgemm(blas.Trans, blas.NoTrans, jb, n-j-jb, j, - -1, a[j:], lda, a[j+jb:], lda, - 1, a[j*lda+j+jb:], lda) - bi.Dtrsm(blas.Left, blas.Upper, blas.Trans, blas.NonUnit, jb, n-j-jb, - 1, a[j*lda+j:], lda, - a[j*lda+j+jb:], lda) - } - } - return true - } - for j := 0; j < n; j += nb { - jb := min(nb, n-j) - bi.Dsyrk(blas.Lower, blas.NoTrans, jb, j, - -1, a[j*lda:], lda, - 1, a[j*lda+j:], lda) - ok := impl.Dpotf2(blas.Lower, jb, a[j*lda+j:], lda) - if !ok { - return ok - } - if j+jb < n { - bi.Dgemm(blas.NoTrans, blas.Trans, n-j-jb, jb, j, - -1, a[(j+jb)*lda:], lda, a[j*lda:], lda, - 1, a[(j+jb)*lda+j:], lda) - bi.Dtrsm(blas.Right, blas.Lower, blas.Trans, blas.NonUnit, n-j-jb, jb, - 1, a[j*lda+j:], lda, - a[(j+jb)*lda+j:], lda) - } - } - return true -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dpotri.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dpotri.go deleted file mode 100644 index 6fa981c..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dpotri.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright ©2019 The Gonum 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 gonum - -import "gonum.org/v1/gonum/blas" - -// Dpotri computes the inverse of a real symmetric positive definite matrix A -// using its Cholesky factorization. -// -// On entry, a contains the triangular factor U or L from the Cholesky -// factorization A = Uᵀ*U or A = L*Lᵀ, as computed by Dpotrf. -// On return, a contains the upper or lower triangle of the (symmetric) -// inverse of A, overwriting the input factor U or L. -func (impl Implementation) Dpotri(uplo blas.Uplo, n int, a []float64, lda int) (ok bool) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if n == 0 { - return true - } - - if len(a) < (n-1)*lda+n { - panic(shortA) - } - - // Invert the triangular Cholesky factor U or L. - ok = impl.Dtrtri(uplo, blas.NonUnit, n, a, lda) - if !ok { - return false - } - - // Form inv(U)*inv(U)ᵀ or inv(L)ᵀ*inv(L). - impl.Dlauum(uplo, n, a, lda) - return true -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dpotrs.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dpotrs.go deleted file mode 100644 index 8977013..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dpotrs.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright ©2018 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dpotrs solves a system of n linear equations A*X = B where A is an n×n -// symmetric positive definite matrix and B is an n×nrhs matrix. The matrix A is -// represented by its Cholesky factorization -// A = Uᵀ*U if uplo == blas.Upper -// A = L*Lᵀ if uplo == blas.Lower -// as computed by Dpotrf. On entry, B contains the right-hand side matrix B, on -// return it contains the solution matrix X. -func (Implementation) Dpotrs(uplo blas.Uplo, n, nrhs int, a []float64, lda int, b []float64, ldb int) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case nrhs < 0: - panic(nrhsLT0) - case lda < max(1, n): - panic(badLdA) - case ldb < max(1, nrhs): - panic(badLdB) - } - - // Quick return if possible. - if n == 0 || nrhs == 0 { - return - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(b) < (n-1)*ldb+nrhs: - panic(shortB) - } - - bi := blas64.Implementation() - - if uplo == blas.Upper { - // Solve Uᵀ * U * X = B where U is stored in the upper triangle of A. - - // Solve Uᵀ * X = B, overwriting B with X. - bi.Dtrsm(blas.Left, blas.Upper, blas.Trans, blas.NonUnit, n, nrhs, 1, a, lda, b, ldb) - // Solve U * X = B, overwriting B with X. - bi.Dtrsm(blas.Left, blas.Upper, blas.NoTrans, blas.NonUnit, n, nrhs, 1, a, lda, b, ldb) - } else { - // Solve L * Lᵀ * X = B where L is stored in the lower triangle of A. - - // Solve L * X = B, overwriting B with X. - bi.Dtrsm(blas.Left, blas.Lower, blas.NoTrans, blas.NonUnit, n, nrhs, 1, a, lda, b, ldb) - // Solve Lᵀ * X = B, overwriting B with X. - bi.Dtrsm(blas.Left, blas.Lower, blas.Trans, blas.NonUnit, n, nrhs, 1, a, lda, b, ldb) - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/drscl.go b/vendor/gonum.org/v1/gonum/lapack/gonum/drscl.go deleted file mode 100644 index b2772db..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/drscl.go +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas/blas64" -) - -// Drscl multiplies the vector x by 1/a being careful to avoid overflow or -// underflow where possible. -// -// Drscl is an internal routine. It is exported for testing purposes. -func (impl Implementation) Drscl(n int, a float64, x []float64, incX int) { - switch { - case n < 0: - panic(nLT0) - case incX <= 0: - panic(badIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - if len(x) < 1+(n-1)*incX { - panic(shortX) - } - - bi := blas64.Implementation() - - cden := a - cnum := 1.0 - smlnum := dlamchS - bignum := 1 / smlnum - for { - cden1 := cden * smlnum - cnum1 := cnum / bignum - var mul float64 - var done bool - switch { - case cnum != 0 && math.Abs(cden1) > math.Abs(cnum): - mul = smlnum - done = false - cden = cden1 - case math.Abs(cnum1) > math.Abs(cden): - mul = bignum - done = false - cnum = cnum1 - default: - mul = cnum / cden - done = true - } - bi.Dscal(n, mul, x, incX) - if done { - break - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dsteqr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dsteqr.go deleted file mode 100644 index d6c7861..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dsteqr.go +++ /dev/null @@ -1,376 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dsteqr computes the eigenvalues and optionally the eigenvectors of a symmetric -// tridiagonal matrix using the implicit QL or QR method. The eigenvectors of a -// full or band symmetric matrix can also be found if Dsytrd, Dsptrd, or Dsbtrd -// have been used to reduce this matrix to tridiagonal form. -// -// d, on entry, contains the diagonal elements of the tridiagonal matrix. On exit, -// d contains the eigenvalues in ascending order. d must have length n and -// Dsteqr will panic otherwise. -// -// e, on entry, contains the off-diagonal elements of the tridiagonal matrix on -// entry, and is overwritten during the call to Dsteqr. e must have length n-1 and -// Dsteqr will panic otherwise. -// -// z, on entry, contains the n×n orthogonal matrix used in the reduction to -// tridiagonal form if compz == lapack.EVOrig. On exit, if -// compz == lapack.EVOrig, z contains the orthonormal eigenvectors of the -// original symmetric matrix, and if compz == lapack.EVTridiag, z contains the -// orthonormal eigenvectors of the symmetric tridiagonal matrix. z is not used -// if compz == lapack.EVCompNone. -// -// work must have length at least max(1, 2*n-2) if the eigenvectors are computed, -// and Dsteqr will panic otherwise. -// -// Dsteqr is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dsteqr(compz lapack.EVComp, n int, d, e, z []float64, ldz int, work []float64) (ok bool) { - switch { - case compz != lapack.EVCompNone && compz != lapack.EVTridiag && compz != lapack.EVOrig: - panic(badEVComp) - case n < 0: - panic(nLT0) - case ldz < 1, compz != lapack.EVCompNone && ldz < n: - panic(badLdZ) - } - - // Quick return if possible. - if n == 0 { - return true - } - - switch { - case len(d) < n: - panic(shortD) - case len(e) < n-1: - panic(shortE) - case compz != lapack.EVCompNone && len(z) < (n-1)*ldz+n: - panic(shortZ) - case compz != lapack.EVCompNone && len(work) < max(1, 2*n-2): - panic(shortWork) - } - - var icompz int - if compz == lapack.EVOrig { - icompz = 1 - } else if compz == lapack.EVTridiag { - icompz = 2 - } - - if n == 1 { - if icompz == 2 { - z[0] = 1 - } - return true - } - - bi := blas64.Implementation() - - eps := dlamchE - eps2 := eps * eps - safmin := dlamchS - safmax := 1 / safmin - ssfmax := math.Sqrt(safmax) / 3 - ssfmin := math.Sqrt(safmin) / eps2 - - // Compute the eigenvalues and eigenvectors of the tridiagonal matrix. - if icompz == 2 { - impl.Dlaset(blas.All, n, n, 0, 1, z, ldz) - } - const maxit = 30 - nmaxit := n * maxit - - jtot := 0 - - // Determine where the matrix splits and choose QL or QR iteration for each - // block, according to whether top or bottom diagonal element is smaller. - l1 := 0 - nm1 := n - 1 - - type scaletype int - const ( - down scaletype = iota + 1 - up - ) - var iscale scaletype - - for { - if l1 > n-1 { - // Order eigenvalues and eigenvectors. - if icompz == 0 { - impl.Dlasrt(lapack.SortIncreasing, n, d) - } else { - // TODO(btracey): Consider replacing this sort with a call to sort.Sort. - for ii := 1; ii < n; ii++ { - i := ii - 1 - k := i - p := d[i] - for j := ii; j < n; j++ { - if d[j] < p { - k = j - p = d[j] - } - } - if k != i { - d[k] = d[i] - d[i] = p - bi.Dswap(n, z[i:], ldz, z[k:], ldz) - } - } - } - return true - } - if l1 > 0 { - e[l1-1] = 0 - } - var m int - if l1 <= nm1 { - for m = l1; m < nm1; m++ { - test := math.Abs(e[m]) - if test == 0 { - break - } - if test <= (math.Sqrt(math.Abs(d[m]))*math.Sqrt(math.Abs(d[m+1])))*eps { - e[m] = 0 - break - } - } - } - l := l1 - lsv := l - lend := m - lendsv := lend - l1 = m + 1 - if lend == l { - continue - } - - // Scale submatrix in rows and columns L to Lend - anorm := impl.Dlanst(lapack.MaxAbs, lend-l+1, d[l:], e[l:]) - switch { - case anorm == 0: - continue - case anorm > ssfmax: - iscale = down - // Pretend that d and e are matrices with 1 column. - impl.Dlascl(lapack.General, 0, 0, anorm, ssfmax, lend-l+1, 1, d[l:], 1) - impl.Dlascl(lapack.General, 0, 0, anorm, ssfmax, lend-l, 1, e[l:], 1) - case anorm < ssfmin: - iscale = up - impl.Dlascl(lapack.General, 0, 0, anorm, ssfmin, lend-l+1, 1, d[l:], 1) - impl.Dlascl(lapack.General, 0, 0, anorm, ssfmin, lend-l, 1, e[l:], 1) - } - - // Choose between QL and QR. - if math.Abs(d[lend]) < math.Abs(d[l]) { - lend = lsv - l = lendsv - } - if lend > l { - // QL Iteration. Look for small subdiagonal element. - for { - if l != lend { - for m = l; m < lend; m++ { - v := math.Abs(e[m]) - if v*v <= (eps2*math.Abs(d[m]))*math.Abs(d[m+1])+safmin { - break - } - } - } else { - m = lend - } - if m < lend { - e[m] = 0 - } - p := d[l] - if m == l { - // Eigenvalue found. - l++ - if l > lend { - break - } - continue - } - - // If remaining matrix is 2×2, use Dlae2 to compute its eigensystem. - if m == l+1 { - if icompz > 0 { - d[l], d[l+1], work[l], work[n-1+l] = impl.Dlaev2(d[l], e[l], d[l+1]) - impl.Dlasr(blas.Right, lapack.Variable, lapack.Backward, - n, 2, work[l:], work[n-1+l:], z[l:], ldz) - } else { - d[l], d[l+1] = impl.Dlae2(d[l], e[l], d[l+1]) - } - e[l] = 0 - l += 2 - if l > lend { - break - } - continue - } - - if jtot == nmaxit { - break - } - jtot++ - - // Form shift - g := (d[l+1] - p) / (2 * e[l]) - r := impl.Dlapy2(g, 1) - g = d[m] - p + e[l]/(g+math.Copysign(r, g)) - s := 1.0 - c := 1.0 - p = 0.0 - - // Inner loop - for i := m - 1; i >= l; i-- { - f := s * e[i] - b := c * e[i] - c, s, r = impl.Dlartg(g, f) - if i != m-1 { - e[i+1] = r - } - g = d[i+1] - p - r = (d[i]-g)*s + 2*c*b - p = s * r - d[i+1] = g + p - g = c*r - b - - // If eigenvectors are desired, then save rotations. - if icompz > 0 { - work[i] = c - work[n-1+i] = -s - } - } - // If eigenvectors are desired, then apply saved rotations. - if icompz > 0 { - mm := m - l + 1 - impl.Dlasr(blas.Right, lapack.Variable, lapack.Backward, - n, mm, work[l:], work[n-1+l:], z[l:], ldz) - } - d[l] -= p - e[l] = g - } - } else { - // QR Iteration. - // Look for small superdiagonal element. - for { - if l != lend { - for m = l; m > lend; m-- { - v := math.Abs(e[m-1]) - if v*v <= (eps2*math.Abs(d[m])*math.Abs(d[m-1]) + safmin) { - break - } - } - } else { - m = lend - } - if m > lend { - e[m-1] = 0 - } - p := d[l] - if m == l { - // Eigenvalue found - l-- - if l < lend { - break - } - continue - } - - // If remaining matrix is 2×2, use Dlae2 to compute its eigenvalues. - if m == l-1 { - if icompz > 0 { - d[l-1], d[l], work[m], work[n-1+m] = impl.Dlaev2(d[l-1], e[l-1], d[l]) - impl.Dlasr(blas.Right, lapack.Variable, lapack.Forward, - n, 2, work[m:], work[n-1+m:], z[l-1:], ldz) - } else { - d[l-1], d[l] = impl.Dlae2(d[l-1], e[l-1], d[l]) - } - e[l-1] = 0 - l -= 2 - if l < lend { - break - } - continue - } - if jtot == nmaxit { - break - } - jtot++ - - // Form shift. - g := (d[l-1] - p) / (2 * e[l-1]) - r := impl.Dlapy2(g, 1) - g = d[m] - p + (e[l-1])/(g+math.Copysign(r, g)) - s := 1.0 - c := 1.0 - p = 0.0 - - // Inner loop. - for i := m; i < l; i++ { - f := s * e[i] - b := c * e[i] - c, s, r = impl.Dlartg(g, f) - if i != m { - e[i-1] = r - } - g = d[i] - p - r = (d[i+1]-g)*s + 2*c*b - p = s * r - d[i] = g + p - g = c*r - b - - // If eigenvectors are desired, then save rotations. - if icompz > 0 { - work[i] = c - work[n-1+i] = s - } - } - - // If eigenvectors are desired, then apply saved rotations. - if icompz > 0 { - mm := l - m + 1 - impl.Dlasr(blas.Right, lapack.Variable, lapack.Forward, - n, mm, work[m:], work[n-1+m:], z[m:], ldz) - } - d[l] -= p - e[l-1] = g - } - } - - // Undo scaling if necessary. - switch iscale { - case down: - // Pretend that d and e are matrices with 1 column. - impl.Dlascl(lapack.General, 0, 0, ssfmax, anorm, lendsv-lsv+1, 1, d[lsv:], 1) - impl.Dlascl(lapack.General, 0, 0, ssfmax, anorm, lendsv-lsv, 1, e[lsv:], 1) - case up: - impl.Dlascl(lapack.General, 0, 0, ssfmin, anorm, lendsv-lsv+1, 1, d[lsv:], 1) - impl.Dlascl(lapack.General, 0, 0, ssfmin, anorm, lendsv-lsv, 1, e[lsv:], 1) - } - - // Check for no convergence to an eigenvalue after a total of n*maxit iterations. - if jtot >= nmaxit { - break - } - } - for i := 0; i < n-1; i++ { - if e[i] != 0 { - return false - } - } - return true -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dsterf.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dsterf.go deleted file mode 100644 index dc1e178..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dsterf.go +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/lapack" -) - -// Dsterf computes all eigenvalues of a symmetric tridiagonal matrix using the -// Pal-Walker-Kahan variant of the QL or QR algorithm. -// -// d contains the diagonal elements of the tridiagonal matrix on entry, and -// contains the eigenvalues in ascending order on exit. d must have length at -// least n, or Dsterf will panic. -// -// e contains the off-diagonal elements of the tridiagonal matrix on entry, and is -// overwritten during the call to Dsterf. e must have length of at least n-1 or -// Dsterf will panic. -// -// Dsterf is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dsterf(n int, d, e []float64) (ok bool) { - if n < 0 { - panic(nLT0) - } - - // Quick return if possible. - if n == 0 { - return true - } - - switch { - case len(d) < n: - panic(shortD) - case len(e) < n-1: - panic(shortE) - } - - if n == 1 { - return true - } - - const ( - none = 0 // The values are not scaled. - down = 1 // The values are scaled below ssfmax threshold. - up = 2 // The values are scaled below ssfmin threshold. - ) - - // Determine the unit roundoff for this environment. - eps := dlamchE - eps2 := eps * eps - safmin := dlamchS - safmax := 1 / safmin - ssfmax := math.Sqrt(safmax) / 3 - ssfmin := math.Sqrt(safmin) / eps2 - - // Compute the eigenvalues of the tridiagonal matrix. - maxit := 30 - nmaxit := n * maxit - jtot := 0 - - l1 := 0 - - for { - if l1 > n-1 { - impl.Dlasrt(lapack.SortIncreasing, n, d) - return true - } - if l1 > 0 { - e[l1-1] = 0 - } - var m int - for m = l1; m < n-1; m++ { - if math.Abs(e[m]) <= math.Sqrt(math.Abs(d[m]))*math.Sqrt(math.Abs(d[m+1]))*eps { - e[m] = 0 - break - } - } - - l := l1 - lsv := l - lend := m - lendsv := lend - l1 = m + 1 - if lend == 0 { - continue - } - - // Scale submatrix in rows and columns l to lend. - anorm := impl.Dlanst(lapack.MaxAbs, lend-l+1, d[l:], e[l:]) - iscale := none - if anorm == 0 { - continue - } - if anorm > ssfmax { - iscale = down - impl.Dlascl(lapack.General, 0, 0, anorm, ssfmax, lend-l+1, 1, d[l:], n) - impl.Dlascl(lapack.General, 0, 0, anorm, ssfmax, lend-l, 1, e[l:], n) - } else if anorm < ssfmin { - iscale = up - impl.Dlascl(lapack.General, 0, 0, anorm, ssfmin, lend-l+1, 1, d[l:], n) - impl.Dlascl(lapack.General, 0, 0, anorm, ssfmin, lend-l, 1, e[l:], n) - } - - el := e[l:lend] - for i, v := range el { - el[i] *= v - } - - // Choose between QL and QR iteration. - if math.Abs(d[lend]) < math.Abs(d[l]) { - lend = lsv - l = lendsv - } - if lend >= l { - // QL Iteration. - // Look for small sub-diagonal element. - for { - if l != lend { - for m = l; m < lend; m++ { - if math.Abs(e[m]) <= eps2*(math.Abs(d[m]*d[m+1])) { - break - } - } - } else { - m = lend - } - if m < lend { - e[m] = 0 - } - p := d[l] - if m == l { - // Eigenvalue found. - l++ - if l > lend { - break - } - continue - } - // If remaining matrix is 2 by 2, use Dlae2 to compute its eigenvalues. - if m == l+1 { - d[l], d[l+1] = impl.Dlae2(d[l], math.Sqrt(e[l]), d[l+1]) - e[l] = 0 - l += 2 - if l > lend { - break - } - continue - } - if jtot == nmaxit { - break - } - jtot++ - - // Form shift. - rte := math.Sqrt(e[l]) - sigma := (d[l+1] - p) / (2 * rte) - r := impl.Dlapy2(sigma, 1) - sigma = p - (rte / (sigma + math.Copysign(r, sigma))) - - c := 1.0 - s := 0.0 - gamma := d[m] - sigma - p = gamma * gamma - - // Inner loop. - for i := m - 1; i >= l; i-- { - bb := e[i] - r := p + bb - if i != m-1 { - e[i+1] = s * r - } - oldc := c - c = p / r - s = bb / r - oldgam := gamma - alpha := d[i] - gamma = c*(alpha-sigma) - s*oldgam - d[i+1] = oldgam + (alpha - gamma) - if c != 0 { - p = (gamma * gamma) / c - } else { - p = oldc * bb - } - } - e[l] = s * p - d[l] = sigma + gamma - } - } else { - for { - // QR Iteration. - // Look for small super-diagonal element. - for m = l; m > lend; m-- { - if math.Abs(e[m-1]) <= eps2*math.Abs(d[m]*d[m-1]) { - break - } - } - if m > lend { - e[m-1] = 0 - } - p := d[l] - if m == l { - // Eigenvalue found. - l-- - if l < lend { - break - } - continue - } - - // If remaining matrix is 2 by 2, use Dlae2 to compute its eigenvalues. - if m == l-1 { - d[l], d[l-1] = impl.Dlae2(d[l], math.Sqrt(e[l-1]), d[l-1]) - e[l-1] = 0 - l -= 2 - if l < lend { - break - } - continue - } - if jtot == nmaxit { - break - } - jtot++ - - // Form shift. - rte := math.Sqrt(e[l-1]) - sigma := (d[l-1] - p) / (2 * rte) - r := impl.Dlapy2(sigma, 1) - sigma = p - (rte / (sigma + math.Copysign(r, sigma))) - - c := 1.0 - s := 0.0 - gamma := d[m] - sigma - p = gamma * gamma - - // Inner loop. - for i := m; i < l; i++ { - bb := e[i] - r := p + bb - if i != m { - e[i-1] = s * r - } - oldc := c - c = p / r - s = bb / r - oldgam := gamma - alpha := d[i+1] - gamma = c*(alpha-sigma) - s*oldgam - d[i] = oldgam + alpha - gamma - if c != 0 { - p = (gamma * gamma) / c - } else { - p = oldc * bb - } - } - e[l-1] = s * p - d[l] = sigma + gamma - } - } - - // Undo scaling if necessary - switch iscale { - case down: - impl.Dlascl(lapack.General, 0, 0, ssfmax, anorm, lendsv-lsv+1, 1, d[lsv:], n) - case up: - impl.Dlascl(lapack.General, 0, 0, ssfmin, anorm, lendsv-lsv+1, 1, d[lsv:], n) - } - - // Check for no convergence to an eigenvalue after a total of n*maxit iterations. - if jtot >= nmaxit { - break - } - } - for _, v := range e[:n-1] { - if v != 0 { - return false - } - } - impl.Dlasrt(lapack.SortIncreasing, n, d) - return true -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dsyev.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dsyev.go deleted file mode 100644 index 5f57f3a..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dsyev.go +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dsyev computes all eigenvalues and, optionally, the eigenvectors of a real -// symmetric matrix A. -// -// w contains the eigenvalues in ascending order upon return. w must have length -// at least n, and Dsyev will panic otherwise. -// -// On entry, a contains the elements of the symmetric matrix A in the triangular -// portion specified by uplo. If jobz == lapack.EVCompute, a contains the -// orthonormal eigenvectors of A on exit, otherwise jobz must be lapack.EVNone -// and on exit the specified triangular region is overwritten. -// -// work is temporary storage, and lwork specifies the usable memory length. At minimum, -// lwork >= 3*n-1, and Dsyev will panic otherwise. The amount of blocking is -// limited by the usable length. If lwork == -1, instead of computing Dsyev the -// optimal work length is stored into work[0]. -func (impl Implementation) Dsyev(jobz lapack.EVJob, uplo blas.Uplo, n int, a []float64, lda int, w, work []float64, lwork int) (ok bool) { - switch { - case jobz != lapack.EVNone && jobz != lapack.EVCompute: - panic(badEVJob) - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case lwork < max(1, 3*n-1) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - if n == 0 { - return true - } - - var opts string - if uplo == blas.Upper { - opts = "U" - } else { - opts = "L" - } - nb := impl.Ilaenv(1, "DSYTRD", opts, n, -1, -1, -1) - lworkopt := max(1, (nb+2)*n) - if lwork == -1 { - work[0] = float64(lworkopt) - return - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(w) < n: - panic(shortW) - } - - if n == 1 { - w[0] = a[0] - work[0] = 2 - if jobz == lapack.EVCompute { - a[0] = 1 - } - return true - } - - safmin := dlamchS - eps := dlamchP - smlnum := safmin / eps - bignum := 1 / smlnum - rmin := math.Sqrt(smlnum) - rmax := math.Sqrt(bignum) - - // Scale matrix to allowable range, if necessary. - anrm := impl.Dlansy(lapack.MaxAbs, uplo, n, a, lda, work) - scaled := false - var sigma float64 - if anrm > 0 && anrm < rmin { - scaled = true - sigma = rmin / anrm - } else if anrm > rmax { - scaled = true - sigma = rmax / anrm - } - if scaled { - kind := lapack.LowerTri - if uplo == blas.Upper { - kind = lapack.UpperTri - } - impl.Dlascl(kind, 0, 0, 1, sigma, n, n, a, lda) - } - var inde int - indtau := inde + n - indwork := indtau + n - llwork := lwork - indwork - impl.Dsytrd(uplo, n, a, lda, w, work[inde:], work[indtau:], work[indwork:], llwork) - - // For eigenvalues only, call Dsterf. For eigenvectors, first call Dorgtr - // to generate the orthogonal matrix, then call Dsteqr. - if jobz == lapack.EVNone { - ok = impl.Dsterf(n, w, work[inde:]) - } else { - impl.Dorgtr(uplo, n, a, lda, work[indtau:], work[indwork:], llwork) - ok = impl.Dsteqr(lapack.EVComp(jobz), n, w, work[inde:], a, lda, work[indtau:]) - } - if !ok { - return false - } - - // If the matrix was scaled, then rescale eigenvalues appropriately. - if scaled { - bi := blas64.Implementation() - bi.Dscal(n, 1/sigma, w, 1) - } - work[0] = float64(lworkopt) - return true -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dsytd2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dsytd2.go deleted file mode 100644 index 8658f4e..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dsytd2.go +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dsytd2 reduces a symmetric n×n matrix A to symmetric tridiagonal form T by -// an orthogonal similarity transformation -// Qᵀ * A * Q = T -// On entry, the matrix is contained in the specified triangle of a. On exit, -// if uplo == blas.Upper, the diagonal and first super-diagonal of a are -// overwritten with the elements of T. The elements above the first super-diagonal -// are overwritten with the elementary reflectors that are used with -// the elements written to tau in order to construct Q. If uplo == blas.Lower, -// the elements are written in the lower triangular region. -// -// d must have length at least n. e and tau must have length at least n-1. Dsytd2 -// will panic if these sizes are not met. -// -// Q is represented as a product of elementary reflectors. -// If uplo == blas.Upper -// Q = H_{n-2} * ... * H_1 * H_0 -// and if uplo == blas.Lower -// Q = H_0 * H_1 * ... * H_{n-2} -// where -// H_i = I - tau * v * vᵀ -// where tau is stored in tau[i], and v is stored in a. -// -// If uplo == blas.Upper, v[0:i-1] is stored in A[0:i-1,i+1], v[i] = 1, and -// v[i+1:] = 0. The elements of a are -// [ d e v2 v3 v4] -// [ d e v3 v4] -// [ d e v4] -// [ d e] -// [ d] -// If uplo == blas.Lower, v[0:i+1] = 0, v[i+1] = 1, and v[i+2:] is stored in -// A[i+2:n,i]. -// The elements of a are -// [ d ] -// [ e d ] -// [v1 e d ] -// [v1 v2 e d ] -// [v1 v2 v3 e d] -// -// Dsytd2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dsytd2(uplo blas.Uplo, n int, a []float64, lda int, d, e, tau []float64) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if n == 0 { - return - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(d) < n: - panic(shortD) - case len(e) < n-1: - panic(shortE) - case len(tau) < n-1: - panic(shortTau) - } - - bi := blas64.Implementation() - - if uplo == blas.Upper { - // Reduce the upper triangle of A. - for i := n - 2; i >= 0; i-- { - // Generate elementary reflector H_i = I - tau * v * vᵀ to - // annihilate A[i:i-1, i+1]. - var taui float64 - a[i*lda+i+1], taui = impl.Dlarfg(i+1, a[i*lda+i+1], a[i+1:], lda) - e[i] = a[i*lda+i+1] - if taui != 0 { - // Apply H_i from both sides to A[0:i,0:i]. - a[i*lda+i+1] = 1 - - // Compute x := tau * A * v storing x in tau[0:i]. - bi.Dsymv(uplo, i+1, taui, a, lda, a[i+1:], lda, 0, tau, 1) - - // Compute w := x - 1/2 * tau * (xᵀ * v) * v. - alpha := -0.5 * taui * bi.Ddot(i+1, tau, 1, a[i+1:], lda) - bi.Daxpy(i+1, alpha, a[i+1:], lda, tau, 1) - - // Apply the transformation as a rank-2 update - // A = A - v * wᵀ - w * vᵀ. - bi.Dsyr2(uplo, i+1, -1, a[i+1:], lda, tau, 1, a, lda) - a[i*lda+i+1] = e[i] - } - d[i+1] = a[(i+1)*lda+i+1] - tau[i] = taui - } - d[0] = a[0] - return - } - // Reduce the lower triangle of A. - for i := 0; i < n-1; i++ { - // Generate elementary reflector H_i = I - tau * v * vᵀ to - // annihilate A[i+2:n, i]. - var taui float64 - a[(i+1)*lda+i], taui = impl.Dlarfg(n-i-1, a[(i+1)*lda+i], a[min(i+2, n-1)*lda+i:], lda) - e[i] = a[(i+1)*lda+i] - if taui != 0 { - // Apply H_i from both sides to A[i+1:n, i+1:n]. - a[(i+1)*lda+i] = 1 - - // Compute x := tau * A * v, storing y in tau[i:n-1]. - bi.Dsymv(uplo, n-i-1, taui, a[(i+1)*lda+i+1:], lda, a[(i+1)*lda+i:], lda, 0, tau[i:], 1) - - // Compute w := x - 1/2 * tau * (xᵀ * v) * v. - alpha := -0.5 * taui * bi.Ddot(n-i-1, tau[i:], 1, a[(i+1)*lda+i:], lda) - bi.Daxpy(n-i-1, alpha, a[(i+1)*lda+i:], lda, tau[i:], 1) - - // Apply the transformation as a rank-2 update - // A = A - v * wᵀ - w * vᵀ. - bi.Dsyr2(uplo, n-i-1, -1, a[(i+1)*lda+i:], lda, tau[i:], 1, a[(i+1)*lda+i+1:], lda) - a[(i+1)*lda+i] = e[i] - } - d[i] = a[i*lda+i] - tau[i] = taui - } - d[n-1] = a[(n-1)*lda+n-1] -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dsytrd.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dsytrd.go deleted file mode 100644 index 262a56c..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dsytrd.go +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dsytrd reduces a symmetric n×n matrix A to symmetric tridiagonal form by an -// orthogonal similarity transformation -// Qᵀ * A * Q = T -// where Q is an orthonormal matrix and T is symmetric and tridiagonal. -// -// On entry, a contains the elements of the input matrix in the triangle specified -// by uplo. On exit, the diagonal and sub/super-diagonal are overwritten by the -// corresponding elements of the tridiagonal matrix T. The remaining elements in -// the triangle, along with the array tau, contain the data to construct Q as -// the product of elementary reflectors. -// -// If uplo == blas.Upper, Q is constructed with -// Q = H_{n-2} * ... * H_1 * H_0 -// where -// H_i = I - tau_i * v * vᵀ -// v is constructed as v[i+1:n] = 0, v[i] = 1, v[0:i-1] is stored in A[0:i-1, i+1]. -// The elements of A are -// [ d e v1 v2 v3] -// [ d e v2 v3] -// [ d e v3] -// [ d e] -// [ e] -// -// If uplo == blas.Lower, Q is constructed with -// Q = H_0 * H_1 * ... * H_{n-2} -// where -// H_i = I - tau_i * v * vᵀ -// v is constructed as v[0:i+1] = 0, v[i+1] = 1, v[i+2:n] is stored in A[i+2:n, i]. -// The elements of A are -// [ d ] -// [ e d ] -// [v0 e d ] -// [v0 v1 e d ] -// [v0 v1 v2 e d] -// -// d must have length n, and e and tau must have length n-1. Dsytrd will panic if -// these conditions are not met. -// -// work is temporary storage, and lwork specifies the usable memory length. At minimum, -// lwork >= 1, and Dsytrd will panic otherwise. The amount of blocking is -// limited by the usable length. -// If lwork == -1, instead of computing Dsytrd the optimal work length is stored -// into work[0]. -// -// Dsytrd is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dsytrd(uplo blas.Uplo, n int, a []float64, lda int, d, e, tau, work []float64, lwork int) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case lwork < 1 && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - if n == 0 { - work[0] = 1 - return - } - - nb := impl.Ilaenv(1, "DSYTRD", string(uplo), n, -1, -1, -1) - lworkopt := n * nb - if lwork == -1 { - work[0] = float64(lworkopt) - return - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(d) < n: - panic(shortD) - case len(e) < n-1: - panic(shortE) - case len(tau) < n-1: - panic(shortTau) - } - - bi := blas64.Implementation() - - nx := n - iws := 1 - var ldwork int - if 1 < nb && nb < n { - // Determine when to cross over from blocked to unblocked code. The last - // block is always handled by unblocked code. - nx = max(nb, impl.Ilaenv(3, "DSYTRD", string(uplo), n, -1, -1, -1)) - if nx < n { - // Determine if workspace is large enough for blocked code. - ldwork = nb - iws = n * ldwork - if lwork < iws { - // Not enough workspace to use optimal nb: determine the minimum - // value of nb and reduce nb or force use of unblocked code by - // setting nx = n. - nb = max(lwork/n, 1) - nbmin := impl.Ilaenv(2, "DSYTRD", string(uplo), n, -1, -1, -1) - if nb < nbmin { - nx = n - } - } - } else { - nx = n - } - } else { - nb = 1 - } - ldwork = nb - - if uplo == blas.Upper { - // Reduce the upper triangle of A. Columns 0:kk are handled by the - // unblocked method. - var i int - kk := n - ((n-nx+nb-1)/nb)*nb - for i = n - nb; i >= kk; i -= nb { - // Reduce columns i:i+nb to tridiagonal form and form the matrix W - // which is needed to update the unreduced part of the matrix. - impl.Dlatrd(uplo, i+nb, nb, a, lda, e, tau, work, ldwork) - - // Update the unreduced submatrix A[0:i-1,0:i-1], using an update - // of the form A = A - V*Wᵀ - W*Vᵀ. - bi.Dsyr2k(uplo, blas.NoTrans, i, nb, -1, a[i:], lda, work, ldwork, 1, a, lda) - - // Copy superdiagonal elements back into A, and diagonal elements into D. - for j := i; j < i+nb; j++ { - a[(j-1)*lda+j] = e[j-1] - d[j] = a[j*lda+j] - } - } - // Use unblocked code to reduce the last or only block - // check that i == kk. - impl.Dsytd2(uplo, kk, a, lda, d, e, tau) - } else { - var i int - // Reduce the lower triangle of A. - for i = 0; i < n-nx; i += nb { - // Reduce columns 0:i+nb to tridiagonal form and form the matrix W - // which is needed to update the unreduced part of the matrix. - impl.Dlatrd(uplo, n-i, nb, a[i*lda+i:], lda, e[i:], tau[i:], work, ldwork) - - // Update the unreduced submatrix A[i+ib:n, i+ib:n], using an update - // of the form A = A + V*Wᵀ - W*Vᵀ. - bi.Dsyr2k(uplo, blas.NoTrans, n-i-nb, nb, -1, a[(i+nb)*lda+i:], lda, - work[nb*ldwork:], ldwork, 1, a[(i+nb)*lda+i+nb:], lda) - - // Copy subdiagonal elements back into A, and diagonal elements into D. - for j := i; j < i+nb; j++ { - a[(j+1)*lda+j] = e[j] - d[j] = a[j*lda+j] - } - } - // Use unblocked code to reduce the last or only block. - impl.Dsytd2(uplo, n-i, a[i*lda+i:], lda, d[i:], e[i:], tau[i:]) - } - work[0] = float64(iws) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dtgsja.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dtgsja.go deleted file mode 100644 index 3628ca6..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dtgsja.go +++ /dev/null @@ -1,373 +0,0 @@ -// Copyright ©2017 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dtgsja computes the generalized singular value decomposition (GSVD) -// of two real upper triangular or trapezoidal matrices A and B. -// -// A and B have the following forms, which may be obtained by the -// preprocessing subroutine Dggsvp from a general m×n matrix A and p×n -// matrix B: -// -// n-k-l k l -// A = k [ 0 A12 A13 ] if m-k-l >= 0; -// l [ 0 0 A23 ] -// m-k-l [ 0 0 0 ] -// -// n-k-l k l -// A = k [ 0 A12 A13 ] if m-k-l < 0; -// m-k [ 0 0 A23 ] -// -// n-k-l k l -// B = l [ 0 0 B13 ] -// p-l [ 0 0 0 ] -// -// where the k×k matrix A12 and l×l matrix B13 are non-singular -// upper triangular. A23 is l×l upper triangular if m-k-l >= 0, -// otherwise A23 is (m-k)×l upper trapezoidal. -// -// On exit, -// -// Uᵀ*A*Q = D1*[ 0 R ], Vᵀ*B*Q = D2*[ 0 R ], -// -// where U, V and Q are orthogonal matrices. -// R is a non-singular upper triangular matrix, and D1 and D2 are -// diagonal matrices, which are of the following structures: -// -// If m-k-l >= 0, -// -// k l -// D1 = k [ I 0 ] -// l [ 0 C ] -// m-k-l [ 0 0 ] -// -// k l -// D2 = l [ 0 S ] -// p-l [ 0 0 ] -// -// n-k-l k l -// [ 0 R ] = k [ 0 R11 R12 ] k -// l [ 0 0 R22 ] l -// -// where -// -// C = diag( alpha_k, ... , alpha_{k+l} ), -// S = diag( beta_k, ... , beta_{k+l} ), -// C^2 + S^2 = I. -// -// R is stored in -// A[0:k+l, n-k-l:n] -// on exit. -// -// If m-k-l < 0, -// -// k m-k k+l-m -// D1 = k [ I 0 0 ] -// m-k [ 0 C 0 ] -// -// k m-k k+l-m -// D2 = m-k [ 0 S 0 ] -// k+l-m [ 0 0 I ] -// p-l [ 0 0 0 ] -// -// n-k-l k m-k k+l-m -// [ 0 R ] = k [ 0 R11 R12 R13 ] -// m-k [ 0 0 R22 R23 ] -// k+l-m [ 0 0 0 R33 ] -// -// where -// C = diag( alpha_k, ... , alpha_m ), -// S = diag( beta_k, ... , beta_m ), -// C^2 + S^2 = I. -// -// R = [ R11 R12 R13 ] is stored in A[0:m, n-k-l:n] -// [ 0 R22 R23 ] -// and R33 is stored in -// B[m-k:l, n+m-k-l:n] on exit. -// -// The computation of the orthogonal transformation matrices U, V or Q -// is optional. These matrices may either be formed explicitly, or they -// may be post-multiplied into input matrices U1, V1, or Q1. -// -// Dtgsja essentially uses a variant of Kogbetliantz algorithm to reduce -// min(l,m-k)×l triangular or trapezoidal matrix A23 and l×l -// matrix B13 to the form: -// -// U1ᵀ*A13*Q1 = C1*R1; V1ᵀ*B13*Q1 = S1*R1, -// -// where U1, V1 and Q1 are orthogonal matrices. C1 and S1 are diagonal -// matrices satisfying -// -// C1^2 + S1^2 = I, -// -// and R1 is an l×l non-singular upper triangular matrix. -// -// jobU, jobV and jobQ are options for computing the orthogonal matrices. The behavior -// is as follows -// jobU == lapack.GSVDU Compute orthogonal matrix U -// jobU == lapack.GSVDUnit Use unit-initialized matrix -// jobU == lapack.GSVDNone Do not compute orthogonal matrix. -// The behavior is the same for jobV and jobQ with the exception that instead of -// lapack.GSVDU these accept lapack.GSVDV and lapack.GSVDQ respectively. -// The matrices U, V and Q must be m×m, p×p and n×n respectively unless the -// relevant job parameter is lapack.GSVDNone. -// -// k and l specify the sub-blocks in the input matrices A and B: -// A23 = A[k:min(k+l,m), n-l:n) and B13 = B[0:l, n-l:n] -// of A and B, whose GSVD is going to be computed by Dtgsja. -// -// tola and tolb are the convergence criteria for the Jacobi-Kogbetliantz -// iteration procedure. Generally, they are the same as used in the preprocessing -// step, for example, -// tola = max(m, n)*norm(A)*eps, -// tolb = max(p, n)*norm(B)*eps, -// where eps is the machine epsilon. -// -// work must have length at least 2*n, otherwise Dtgsja will panic. -// -// alpha and beta must have length n or Dtgsja will panic. On exit, alpha and -// beta contain the generalized singular value pairs of A and B -// alpha[0:k] = 1, -// beta[0:k] = 0, -// if m-k-l >= 0, -// alpha[k:k+l] = diag(C), -// beta[k:k+l] = diag(S), -// if m-k-l < 0, -// alpha[k:m]= C, alpha[m:k+l]= 0 -// beta[k:m] = S, beta[m:k+l] = 1. -// if k+l < n, -// alpha[k+l:n] = 0 and -// beta[k+l:n] = 0. -// -// On exit, A[n-k:n, 0:min(k+l,m)] contains the triangular matrix R or part of R -// and if necessary, B[m-k:l, n+m-k-l:n] contains a part of R. -// -// Dtgsja returns whether the routine converged and the number of iteration cycles -// that were run. -// -// Dtgsja is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dtgsja(jobU, jobV, jobQ lapack.GSVDJob, m, p, n, k, l int, a []float64, lda int, b []float64, ldb int, tola, tolb float64, alpha, beta, u []float64, ldu int, v []float64, ldv int, q []float64, ldq int, work []float64) (cycles int, ok bool) { - const maxit = 40 - - initu := jobU == lapack.GSVDUnit - wantu := initu || jobU == lapack.GSVDU - - initv := jobV == lapack.GSVDUnit - wantv := initv || jobV == lapack.GSVDV - - initq := jobQ == lapack.GSVDUnit - wantq := initq || jobQ == lapack.GSVDQ - - switch { - case !initu && !wantu && jobU != lapack.GSVDNone: - panic(badGSVDJob + "U") - case !initv && !wantv && jobV != lapack.GSVDNone: - panic(badGSVDJob + "V") - case !initq && !wantq && jobQ != lapack.GSVDNone: - panic(badGSVDJob + "Q") - case m < 0: - panic(mLT0) - case p < 0: - panic(pLT0) - case n < 0: - panic(nLT0) - - case lda < max(1, n): - panic(badLdA) - case len(a) < (m-1)*lda+n: - panic(shortA) - - case ldb < max(1, n): - panic(badLdB) - case len(b) < (p-1)*ldb+n: - panic(shortB) - - case len(alpha) != n: - panic(badLenAlpha) - case len(beta) != n: - panic(badLenBeta) - - case ldu < 1, wantu && ldu < m: - panic(badLdU) - case wantu && len(u) < (m-1)*ldu+m: - panic(shortU) - - case ldv < 1, wantv && ldv < p: - panic(badLdV) - case wantv && len(v) < (p-1)*ldv+p: - panic(shortV) - - case ldq < 1, wantq && ldq < n: - panic(badLdQ) - case wantq && len(q) < (n-1)*ldq+n: - panic(shortQ) - - case len(work) < 2*n: - panic(shortWork) - } - - // Initialize U, V and Q, if necessary - if initu { - impl.Dlaset(blas.All, m, m, 0, 1, u, ldu) - } - if initv { - impl.Dlaset(blas.All, p, p, 0, 1, v, ldv) - } - if initq { - impl.Dlaset(blas.All, n, n, 0, 1, q, ldq) - } - - bi := blas64.Implementation() - minTol := math.Min(tola, tolb) - - // Loop until convergence. - upper := false - for cycles = 1; cycles <= maxit; cycles++ { - upper = !upper - - for i := 0; i < l-1; i++ { - for j := i + 1; j < l; j++ { - var a1, a2, a3 float64 - if k+i < m { - a1 = a[(k+i)*lda+n-l+i] - } - if k+j < m { - a3 = a[(k+j)*lda+n-l+j] - } - - b1 := b[i*ldb+n-l+i] - b3 := b[j*ldb+n-l+j] - - var b2 float64 - if upper { - if k+i < m { - a2 = a[(k+i)*lda+n-l+j] - } - b2 = b[i*ldb+n-l+j] - } else { - if k+j < m { - a2 = a[(k+j)*lda+n-l+i] - } - b2 = b[j*ldb+n-l+i] - } - - csu, snu, csv, snv, csq, snq := impl.Dlags2(upper, a1, a2, a3, b1, b2, b3) - - // Update (k+i)-th and (k+j)-th rows of matrix A: Uᵀ*A. - if k+j < m { - bi.Drot(l, a[(k+j)*lda+n-l:], 1, a[(k+i)*lda+n-l:], 1, csu, snu) - } - - // Update i-th and j-th rows of matrix B: Vᵀ*B. - bi.Drot(l, b[j*ldb+n-l:], 1, b[i*ldb+n-l:], 1, csv, snv) - - // Update (n-l+i)-th and (n-l+j)-th columns of matrices - // A and B: A*Q and B*Q. - bi.Drot(min(k+l, m), a[n-l+j:], lda, a[n-l+i:], lda, csq, snq) - bi.Drot(l, b[n-l+j:], ldb, b[n-l+i:], ldb, csq, snq) - - if upper { - if k+i < m { - a[(k+i)*lda+n-l+j] = 0 - } - b[i*ldb+n-l+j] = 0 - } else { - if k+j < m { - a[(k+j)*lda+n-l+i] = 0 - } - b[j*ldb+n-l+i] = 0 - } - - // Update orthogonal matrices U, V, Q, if desired. - if wantu && k+j < m { - bi.Drot(m, u[k+j:], ldu, u[k+i:], ldu, csu, snu) - } - if wantv { - bi.Drot(p, v[j:], ldv, v[i:], ldv, csv, snv) - } - if wantq { - bi.Drot(n, q[n-l+j:], ldq, q[n-l+i:], ldq, csq, snq) - } - } - } - - if !upper { - // The matrices A13 and B13 were lower triangular at the start - // of the cycle, and are now upper triangular. - // - // Convergence test: test the parallelism of the corresponding - // rows of A and B. - var error float64 - for i := 0; i < min(l, m-k); i++ { - bi.Dcopy(l-i, a[(k+i)*lda+n-l+i:], 1, work, 1) - bi.Dcopy(l-i, b[i*ldb+n-l+i:], 1, work[l:], 1) - ssmin := impl.Dlapll(l-i, work, 1, work[l:], 1) - error = math.Max(error, ssmin) - } - if math.Abs(error) <= minTol { - // The algorithm has converged. - // Compute the generalized singular value pairs (alpha, beta) - // and set the triangular matrix R to array A. - for i := 0; i < k; i++ { - alpha[i] = 1 - beta[i] = 0 - } - - for i := 0; i < min(l, m-k); i++ { - a1 := a[(k+i)*lda+n-l+i] - b1 := b[i*ldb+n-l+i] - - if a1 != 0 { - gamma := b1 / a1 - - // Change sign if necessary. - if gamma < 0 { - bi.Dscal(l-i, -1, b[i*ldb+n-l+i:], 1) - if wantv { - bi.Dscal(p, -1, v[i:], ldv) - } - } - beta[k+i], alpha[k+i], _ = impl.Dlartg(math.Abs(gamma), 1) - - if alpha[k+i] >= beta[k+i] { - bi.Dscal(l-i, 1/alpha[k+i], a[(k+i)*lda+n-l+i:], 1) - } else { - bi.Dscal(l-i, 1/beta[k+i], b[i*ldb+n-l+i:], 1) - bi.Dcopy(l-i, b[i*ldb+n-l+i:], 1, a[(k+i)*lda+n-l+i:], 1) - } - } else { - alpha[k+i] = 0 - beta[k+i] = 1 - bi.Dcopy(l-i, b[i*ldb+n-l+i:], 1, a[(k+i)*lda+n-l+i:], 1) - } - } - - for i := m; i < k+l; i++ { - alpha[i] = 0 - beta[i] = 1 - } - if k+l < n { - for i := k + l; i < n; i++ { - alpha[i] = 0 - beta[i] = 0 - } - } - - return cycles, true - } - } - } - - // The algorithm has not converged after maxit cycles. - return cycles, false -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrcon.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dtrcon.go deleted file mode 100644 index 899c95d..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrcon.go +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dtrcon estimates the reciprocal of the condition number of a triangular matrix A. -// The condition number computed may be based on the 1-norm or the ∞-norm. -// -// work is a temporary data slice of length at least 3*n and Dtrcon will panic otherwise. -// -// iwork is a temporary data slice of length at least n and Dtrcon will panic otherwise. -func (impl Implementation) Dtrcon(norm lapack.MatrixNorm, uplo blas.Uplo, diag blas.Diag, n int, a []float64, lda int, work []float64, iwork []int) float64 { - switch { - case norm != lapack.MaxColumnSum && norm != lapack.MaxRowSum: - panic(badNorm) - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case diag != blas.NonUnit && diag != blas.Unit: - panic(badDiag) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - if n == 0 { - return 1 - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(work) < 3*n: - panic(shortWork) - case len(iwork) < n: - panic(shortIWork) - } - - bi := blas64.Implementation() - - var rcond float64 - smlnum := dlamchS * float64(n) - - anorm := impl.Dlantr(norm, uplo, diag, n, n, a, lda, work) - - if anorm <= 0 { - return rcond - } - var ainvnm float64 - var normin bool - kase1 := 2 - if norm == lapack.MaxColumnSum { - kase1 = 1 - } - var kase int - isave := new([3]int) - var scale float64 - for { - ainvnm, kase = impl.Dlacn2(n, work[n:], work, iwork, ainvnm, kase, isave) - if kase == 0 { - if ainvnm != 0 { - rcond = (1 / anorm) / ainvnm - } - return rcond - } - if kase == kase1 { - scale = impl.Dlatrs(uplo, blas.NoTrans, diag, normin, n, a, lda, work, work[2*n:]) - } else { - scale = impl.Dlatrs(uplo, blas.Trans, diag, normin, n, a, lda, work, work[2*n:]) - } - normin = true - if scale != 1 { - ix := bi.Idamax(n, work, 1) - xnorm := math.Abs(work[ix]) - if scale == 0 || scale < xnorm*smlnum { - return rcond - } - impl.Drscl(n, scale, work, 1) - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrevc3.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dtrevc3.go deleted file mode 100644 index c656866..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrevc3.go +++ /dev/null @@ -1,885 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dtrevc3 computes some or all of the right and/or left eigenvectors of an n×n -// upper quasi-triangular matrix T in Schur canonical form. Matrices of this -// type are produced by the Schur factorization of a real general matrix A -// A = Q T Qᵀ, -// as computed by Dhseqr. -// -// The right eigenvector x of T corresponding to an -// eigenvalue λ is defined by -// T x = λ x, -// and the left eigenvector y is defined by -// yᵀ T = λ yᵀ. -// -// The eigenvalues are read directly from the diagonal blocks of T. -// -// This routine returns the matrices X and/or Y of right and left eigenvectors -// of T, or the products Q*X and/or Q*Y, where Q is an input matrix. If Q is the -// orthogonal factor that reduces a matrix A to Schur form T, then Q*X and Q*Y -// are the matrices of right and left eigenvectors of A. -// -// If side == lapack.EVRight, only right eigenvectors will be computed. -// If side == lapack.EVLeft, only left eigenvectors will be computed. -// If side == lapack.EVBoth, both right and left eigenvectors will be computed. -// For other values of side, Dtrevc3 will panic. -// -// If howmny == lapack.EVAll, all right and/or left eigenvectors will be -// computed. -// If howmny == lapack.EVAllMulQ, all right and/or left eigenvectors will be -// computed and multiplied from left by the matrices in VR and/or VL. -// If howmny == lapack.EVSelected, right and/or left eigenvectors will be -// computed as indicated by selected. -// For other values of howmny, Dtrevc3 will panic. -// -// selected specifies which eigenvectors will be computed. It must have length n -// if howmny == lapack.EVSelected, and it is not referenced otherwise. -// If w_j is a real eigenvalue, the corresponding real eigenvector will be -// computed if selected[j] is true. -// If w_j and w_{j+1} are the real and imaginary parts of a complex eigenvalue, -// the corresponding complex eigenvector is computed if either selected[j] or -// selected[j+1] is true, and on return selected[j] will be set to true and -// selected[j+1] will be set to false. -// -// VL and VR are n×mm matrices. If howmny is lapack.EVAll or -// lapack.AllEVMulQ, mm must be at least n. If howmny is -// lapack.EVSelected, mm must be large enough to store the selected -// eigenvectors. Each selected real eigenvector occupies one column and each -// selected complex eigenvector occupies two columns. If mm is not sufficiently -// large, Dtrevc3 will panic. -// -// On entry, if howmny is lapack.EVAllMulQ, it is assumed that VL (if side -// is lapack.EVLeft or lapack.EVBoth) contains an n×n matrix QL, -// and that VR (if side is lapack.EVRight or lapack.EVBoth) contains -// an n×n matrix QR. QL and QR are typically the orthogonal matrix Q of Schur -// vectors returned by Dhseqr. -// -// On return, if side is lapack.EVLeft or lapack.EVBoth, -// VL will contain: -// if howmny == lapack.EVAll, the matrix Y of left eigenvectors of T, -// if howmny == lapack.EVAllMulQ, the matrix Q*Y, -// if howmny == lapack.EVSelected, the left eigenvectors of T specified by -// selected, stored consecutively in the -// columns of VL, in the same order as their -// eigenvalues. -// VL is not referenced if side == lapack.EVRight. -// -// On return, if side is lapack.EVRight or lapack.EVBoth, -// VR will contain: -// if howmny == lapack.EVAll, the matrix X of right eigenvectors of T, -// if howmny == lapack.EVAllMulQ, the matrix Q*X, -// if howmny == lapack.EVSelected, the left eigenvectors of T specified by -// selected, stored consecutively in the -// columns of VR, in the same order as their -// eigenvalues. -// VR is not referenced if side == lapack.EVLeft. -// -// Complex eigenvectors corresponding to a complex eigenvalue are stored in VL -// and VR in two consecutive columns, the first holding the real part, and the -// second the imaginary part. -// -// Each eigenvector will be normalized so that the element of largest magnitude -// has magnitude 1. Here the magnitude of a complex number (x,y) is taken to be -// |x| + |y|. -// -// work must have length at least lwork and lwork must be at least max(1,3*n), -// otherwise Dtrevc3 will panic. For optimum performance, lwork should be at -// least n+2*n*nb, where nb is the optimal blocksize. -// -// If lwork == -1, instead of performing Dtrevc3, the function only estimates -// the optimal workspace size based on n and stores it into work[0]. -// -// Dtrevc3 returns the number of columns in VL and/or VR actually used to store -// the eigenvectors. -// -// Dtrevc3 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dtrevc3(side lapack.EVSide, howmny lapack.EVHowMany, selected []bool, n int, t []float64, ldt int, vl []float64, ldvl int, vr []float64, ldvr int, mm int, work []float64, lwork int) (m int) { - bothv := side == lapack.EVBoth - rightv := side == lapack.EVRight || bothv - leftv := side == lapack.EVLeft || bothv - switch { - case !rightv && !leftv: - panic(badEVSide) - case howmny != lapack.EVAll && howmny != lapack.EVAllMulQ && howmny != lapack.EVSelected: - panic(badEVHowMany) - case n < 0: - panic(nLT0) - case ldt < max(1, n): - panic(badLdT) - case mm < 0: - panic(mmLT0) - case ldvl < 1: - // ldvl and ldvr are also checked below after the computation of - // m (number of columns of VL and VR) in case of howmny == EVSelected. - panic(badLdVL) - case ldvr < 1: - panic(badLdVR) - case lwork < max(1, 3*n) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - if n == 0 { - work[0] = 1 - return 0 - } - - // Normally we don't check slice lengths until after the workspace - // query. However, even in case of the workspace query we need to - // compute and return the value of m, and since the computation accesses t, - // we put the length check of t here. - if len(t) < (n-1)*ldt+n { - panic(shortT) - } - - if howmny == lapack.EVSelected { - if len(selected) != n { - panic(badLenSelected) - } - // Set m to the number of columns required to store the selected - // eigenvectors, and standardize the slice selected. - // Each selected real eigenvector occupies one column and each - // selected complex eigenvector occupies two columns. - for j := 0; j < n; { - if j == n-1 || t[(j+1)*ldt+j] == 0 { - // Diagonal 1×1 block corresponding to a - // real eigenvalue. - if selected[j] { - m++ - } - j++ - } else { - // Diagonal 2×2 block corresponding to a - // complex eigenvalue. - if selected[j] || selected[j+1] { - selected[j] = true - selected[j+1] = false - m += 2 - } - j += 2 - } - } - } else { - m = n - } - if mm < m { - panic(badMm) - } - - // Quick return in case of a workspace query. - nb := impl.Ilaenv(1, "DTREVC", string(side)+string(howmny), n, -1, -1, -1) - if lwork == -1 { - work[0] = float64(n + 2*n*nb) - return m - } - - // Quick return if no eigenvectors were selected. - if m == 0 { - return 0 - } - - switch { - case leftv && ldvl < mm: - panic(badLdVL) - case leftv && len(vl) < (n-1)*ldvl+mm: - panic(shortVL) - - case rightv && ldvr < mm: - panic(badLdVR) - case rightv && len(vr) < (n-1)*ldvr+mm: - panic(shortVR) - } - - // Use blocked version of back-transformation if sufficient workspace. - // Zero-out the workspace to avoid potential NaN propagation. - const ( - nbmin = 8 - nbmax = 128 - ) - if howmny == lapack.EVAllMulQ && lwork >= n+2*n*nbmin { - nb = min((lwork-n)/(2*n), nbmax) - impl.Dlaset(blas.All, n, 1+2*nb, 0, 0, work[:n+2*nb*n], 1+2*nb) - } else { - nb = 1 - } - - // Set the constants to control overflow. - ulp := dlamchP - smlnum := float64(n) / ulp * dlamchS - bignum := (1 - ulp) / smlnum - - // Split work into a vector of column norms and an n×2*nb matrix b. - norms := work[:n] - ldb := 2 * nb - b := work[n : n+n*ldb] - - // Compute 1-norm of each column of strictly upper triangular part of T - // to control overflow in triangular solver. - norms[0] = 0 - for j := 1; j < n; j++ { - var cn float64 - for i := 0; i < j; i++ { - cn += math.Abs(t[i*ldt+j]) - } - norms[j] = cn - } - - bi := blas64.Implementation() - - var ( - x [4]float64 - - iv int // Index of column in current block. - is int - - // ip is used below to specify the real or complex eigenvalue: - // ip == 0, real eigenvalue, - // 1, first of conjugate complex pair (wr,wi), - // -1, second of conjugate complex pair (wr,wi). - ip int - iscomplex [nbmax]int // Stores ip for each column in current block. - ) - - if side == lapack.EVLeft { - goto leftev - } - - // Compute right eigenvectors. - - // For complex right vector, iv-1 is for real part and iv for complex - // part. Non-blocked version always uses iv=1, blocked version starts - // with iv=nb-1 and goes down to 0 or 1. - iv = max(2, nb) - 1 - ip = 0 - is = m - 1 - for ki := n - 1; ki >= 0; ki-- { - if ip == -1 { - // Previous iteration (ki+1) was second of - // conjugate pair, so this ki is first of - // conjugate pair. - ip = 1 - continue - } - - if ki == 0 || t[ki*ldt+ki-1] == 0 { - // Last column or zero on sub-diagonal, so this - // ki must be real eigenvalue. - ip = 0 - } else { - // Non-zero on sub-diagonal, so this ki is - // second of conjugate pair. - ip = -1 - } - - if howmny == lapack.EVSelected { - if ip == 0 { - if !selected[ki] { - continue - } - } else if !selected[ki-1] { - continue - } - } - - // Compute the ki-th eigenvalue (wr,wi). - wr := t[ki*ldt+ki] - var wi float64 - if ip != 0 { - wi = math.Sqrt(math.Abs(t[ki*ldt+ki-1])) * math.Sqrt(math.Abs(t[(ki-1)*ldt+ki])) - } - smin := math.Max(ulp*(math.Abs(wr)+math.Abs(wi)), smlnum) - - if ip == 0 { - // Real right eigenvector. - - b[ki*ldb+iv] = 1 - // Form right-hand side. - for k := 0; k < ki; k++ { - b[k*ldb+iv] = -t[k*ldt+ki] - } - // Solve upper quasi-triangular system: - // [ T[0:ki,0:ki] - wr ]*X = scale*b. - for j := ki - 1; j >= 0; { - if j == 0 || t[j*ldt+j-1] == 0 { - // 1×1 diagonal block. - scale, xnorm, _ := impl.Dlaln2(false, 1, 1, smin, 1, t[j*ldt+j:], ldt, - 1, 1, b[j*ldb+iv:], ldb, wr, 0, x[:1], 2) - // Scale X[0,0] to avoid overflow when updating the - // right-hand side. - if xnorm > 1 && norms[j] > bignum/xnorm { - x[0] /= xnorm - scale /= xnorm - } - // Scale if necessary. - if scale != 1 { - bi.Dscal(ki+1, scale, b[iv:], ldb) - } - b[j*ldb+iv] = x[0] - // Update right-hand side. - bi.Daxpy(j, -x[0], t[j:], ldt, b[iv:], ldb) - j-- - } else { - // 2×2 diagonal block. - scale, xnorm, _ := impl.Dlaln2(false, 2, 1, smin, 1, t[(j-1)*ldt+j-1:], ldt, - 1, 1, b[(j-1)*ldb+iv:], ldb, wr, 0, x[:3], 2) - // Scale X[0,0] and X[1,0] to avoid overflow - // when updating the right-hand side. - if xnorm > 1 { - beta := math.Max(norms[j-1], norms[j]) - if beta > bignum/xnorm { - x[0] /= xnorm - x[2] /= xnorm - scale /= xnorm - } - } - // Scale if necessary. - if scale != 1 { - bi.Dscal(ki+1, scale, b[iv:], ldb) - } - b[(j-1)*ldb+iv] = x[0] - b[j*ldb+iv] = x[2] - // Update right-hand side. - bi.Daxpy(j-1, -x[0], t[j-1:], ldt, b[iv:], ldb) - bi.Daxpy(j-1, -x[2], t[j:], ldt, b[iv:], ldb) - j -= 2 - } - } - // Copy the vector x or Q*x to VR and normalize. - switch { - case howmny != lapack.EVAllMulQ: - // No back-transform: copy x to VR and normalize. - bi.Dcopy(ki+1, b[iv:], ldb, vr[is:], ldvr) - ii := bi.Idamax(ki+1, vr[is:], ldvr) - remax := 1 / math.Abs(vr[ii*ldvr+is]) - bi.Dscal(ki+1, remax, vr[is:], ldvr) - for k := ki + 1; k < n; k++ { - vr[k*ldvr+is] = 0 - } - case nb == 1: - // Version 1: back-transform each vector with GEMV, Q*x. - if ki > 0 { - bi.Dgemv(blas.NoTrans, n, ki, 1, vr, ldvr, b[iv:], ldb, - b[ki*ldb+iv], vr[ki:], ldvr) - } - ii := bi.Idamax(n, vr[ki:], ldvr) - remax := 1 / math.Abs(vr[ii*ldvr+ki]) - bi.Dscal(n, remax, vr[ki:], ldvr) - default: - // Version 2: back-transform block of vectors with GEMM. - // Zero out below vector. - for k := ki + 1; k < n; k++ { - b[k*ldb+iv] = 0 - } - iscomplex[iv] = ip - // Back-transform and normalization is done below. - } - } else { - // Complex right eigenvector. - - // Initial solve - // [ ( T[ki-1,ki-1] T[ki-1,ki] ) - (wr + i*wi) ]*X = 0. - // [ ( T[ki, ki-1] T[ki, ki] ) ] - if math.Abs(t[(ki-1)*ldt+ki]) >= math.Abs(t[ki*ldt+ki-1]) { - b[(ki-1)*ldb+iv-1] = 1 - b[ki*ldb+iv] = wi / t[(ki-1)*ldt+ki] - } else { - b[(ki-1)*ldb+iv-1] = -wi / t[ki*ldt+ki-1] - b[ki*ldb+iv] = 1 - } - b[ki*ldb+iv-1] = 0 - b[(ki-1)*ldb+iv] = 0 - // Form right-hand side. - for k := 0; k < ki-1; k++ { - b[k*ldb+iv-1] = -b[(ki-1)*ldb+iv-1] * t[k*ldt+ki-1] - b[k*ldb+iv] = -b[ki*ldb+iv] * t[k*ldt+ki] - } - // Solve upper quasi-triangular system: - // [ T[0:ki-1,0:ki-1] - (wr+i*wi) ]*X = scale*(b1+i*b2) - for j := ki - 2; j >= 0; { - if j == 0 || t[j*ldt+j-1] == 0 { - // 1×1 diagonal block. - - scale, xnorm, _ := impl.Dlaln2(false, 1, 2, smin, 1, t[j*ldt+j:], ldt, - 1, 1, b[j*ldb+iv-1:], ldb, wr, wi, x[:2], 2) - // Scale X[0,0] and X[0,1] to avoid - // overflow when updating the right-hand side. - if xnorm > 1 && norms[j] > bignum/xnorm { - x[0] /= xnorm - x[1] /= xnorm - scale /= xnorm - } - // Scale if necessary. - if scale != 1 { - bi.Dscal(ki+1, scale, b[iv-1:], ldb) - bi.Dscal(ki+1, scale, b[iv:], ldb) - } - b[j*ldb+iv-1] = x[0] - b[j*ldb+iv] = x[1] - // Update the right-hand side. - bi.Daxpy(j, -x[0], t[j:], ldt, b[iv-1:], ldb) - bi.Daxpy(j, -x[1], t[j:], ldt, b[iv:], ldb) - j-- - } else { - // 2×2 diagonal block. - - scale, xnorm, _ := impl.Dlaln2(false, 2, 2, smin, 1, t[(j-1)*ldt+j-1:], ldt, - 1, 1, b[(j-1)*ldb+iv-1:], ldb, wr, wi, x[:], 2) - // Scale X to avoid overflow when updating - // the right-hand side. - if xnorm > 1 { - beta := math.Max(norms[j-1], norms[j]) - if beta > bignum/xnorm { - rec := 1 / xnorm - x[0] *= rec - x[1] *= rec - x[2] *= rec - x[3] *= rec - scale *= rec - } - } - // Scale if necessary. - if scale != 1 { - bi.Dscal(ki+1, scale, b[iv-1:], ldb) - bi.Dscal(ki+1, scale, b[iv:], ldb) - } - b[(j-1)*ldb+iv-1] = x[0] - b[(j-1)*ldb+iv] = x[1] - b[j*ldb+iv-1] = x[2] - b[j*ldb+iv] = x[3] - // Update the right-hand side. - bi.Daxpy(j-1, -x[0], t[j-1:], ldt, b[iv-1:], ldb) - bi.Daxpy(j-1, -x[1], t[j-1:], ldt, b[iv:], ldb) - bi.Daxpy(j-1, -x[2], t[j:], ldt, b[iv-1:], ldb) - bi.Daxpy(j-1, -x[3], t[j:], ldt, b[iv:], ldb) - j -= 2 - } - } - - // Copy the vector x or Q*x to VR and normalize. - switch { - case howmny != lapack.EVAllMulQ: - // No back-transform: copy x to VR and normalize. - bi.Dcopy(ki+1, b[iv-1:], ldb, vr[is-1:], ldvr) - bi.Dcopy(ki+1, b[iv:], ldb, vr[is:], ldvr) - emax := 0.0 - for k := 0; k <= ki; k++ { - emax = math.Max(emax, math.Abs(vr[k*ldvr+is-1])+math.Abs(vr[k*ldvr+is])) - } - remax := 1 / emax - bi.Dscal(ki+1, remax, vr[is-1:], ldvr) - bi.Dscal(ki+1, remax, vr[is:], ldvr) - for k := ki + 1; k < n; k++ { - vr[k*ldvr+is-1] = 0 - vr[k*ldvr+is] = 0 - } - case nb == 1: - // Version 1: back-transform each vector with GEMV, Q*x. - if ki-1 > 0 { - bi.Dgemv(blas.NoTrans, n, ki-1, 1, vr, ldvr, b[iv-1:], ldb, - b[(ki-1)*ldb+iv-1], vr[ki-1:], ldvr) - bi.Dgemv(blas.NoTrans, n, ki-1, 1, vr, ldvr, b[iv:], ldb, - b[ki*ldb+iv], vr[ki:], ldvr) - } else { - bi.Dscal(n, b[(ki-1)*ldb+iv-1], vr[ki-1:], ldvr) - bi.Dscal(n, b[ki*ldb+iv], vr[ki:], ldvr) - } - emax := 0.0 - for k := 0; k < n; k++ { - emax = math.Max(emax, math.Abs(vr[k*ldvr+ki-1])+math.Abs(vr[k*ldvr+ki])) - } - remax := 1 / emax - bi.Dscal(n, remax, vr[ki-1:], ldvr) - bi.Dscal(n, remax, vr[ki:], ldvr) - default: - // Version 2: back-transform block of vectors with GEMM. - // Zero out below vector. - for k := ki + 1; k < n; k++ { - b[k*ldb+iv-1] = 0 - b[k*ldb+iv] = 0 - } - iscomplex[iv-1] = -ip - iscomplex[iv] = ip - iv-- - // Back-transform and normalization is done below. - } - } - if nb > 1 { - // Blocked version of back-transform. - - // For complex case, ki2 includes both vectors (ki-1 and ki). - ki2 := ki - if ip != 0 { - ki2-- - } - // Columns iv:nb of b are valid vectors. - // When the number of vectors stored reaches nb-1 or nb, - // or if this was last vector, do the Gemm. - if iv < 2 || ki2 == 0 { - bi.Dgemm(blas.NoTrans, blas.NoTrans, n, nb-iv, ki2+nb-iv, - 1, vr, ldvr, b[iv:], ldb, - 0, b[nb+iv:], ldb) - // Normalize vectors. - var remax float64 - for k := iv; k < nb; k++ { - if iscomplex[k] == 0 { - // Real eigenvector. - ii := bi.Idamax(n, b[nb+k:], ldb) - remax = 1 / math.Abs(b[ii*ldb+nb+k]) - } else if iscomplex[k] == 1 { - // First eigenvector of conjugate pair. - emax := 0.0 - for ii := 0; ii < n; ii++ { - emax = math.Max(emax, math.Abs(b[ii*ldb+nb+k])+math.Abs(b[ii*ldb+nb+k+1])) - } - remax = 1 / emax - // Second eigenvector of conjugate pair - // will reuse this value of remax. - } - bi.Dscal(n, remax, b[nb+k:], ldb) - } - impl.Dlacpy(blas.All, n, nb-iv, b[nb+iv:], ldb, vr[ki2:], ldvr) - iv = nb - 1 - } else { - iv-- - } - } - is-- - if ip != 0 { - is-- - } - } - - if side == lapack.EVRight { - return m - } - -leftev: - // Compute left eigenvectors. - - // For complex left vector, iv is for real part and iv+1 for complex - // part. Non-blocked version always uses iv=0. Blocked version starts - // with iv=0, goes up to nb-2 or nb-1. - iv = 0 - ip = 0 - is = 0 - for ki := 0; ki < n; ki++ { - if ip == 1 { - // Previous iteration ki-1 was first of conjugate pair, - // so this ki is second of conjugate pair. - ip = -1 - continue - } - - if ki == n-1 || t[(ki+1)*ldt+ki] == 0 { - // Last column or zero on sub-diagonal, so this ki must - // be real eigenvalue. - ip = 0 - } else { - // Non-zero on sub-diagonal, so this ki is first of - // conjugate pair. - ip = 1 - } - if howmny == lapack.EVSelected && !selected[ki] { - continue - } - - // Compute the ki-th eigenvalue (wr,wi). - wr := t[ki*ldt+ki] - var wi float64 - if ip != 0 { - wi = math.Sqrt(math.Abs(t[ki*ldt+ki+1])) * math.Sqrt(math.Abs(t[(ki+1)*ldt+ki])) - } - smin := math.Max(ulp*(math.Abs(wr)+math.Abs(wi)), smlnum) - - if ip == 0 { - // Real left eigenvector. - - b[ki*ldb+iv] = 1 - // Form right-hand side. - for k := ki + 1; k < n; k++ { - b[k*ldb+iv] = -t[ki*ldt+k] - } - // Solve transposed quasi-triangular system: - // [ T[ki+1:n,ki+1:n] - wr ]ᵀ * X = scale*b - vmax := 1.0 - vcrit := bignum - for j := ki + 1; j < n; { - if j == n-1 || t[(j+1)*ldt+j] == 0 { - // 1×1 diagonal block. - - // Scale if necessary to avoid overflow - // when forming the right-hand side. - if norms[j] > vcrit { - rec := 1 / vmax - bi.Dscal(n-ki, rec, b[ki*ldb+iv:], ldb) - vmax = 1 - } - b[j*ldb+iv] -= bi.Ddot(j-ki-1, t[(ki+1)*ldt+j:], ldt, b[(ki+1)*ldb+iv:], ldb) - // Solve [ T[j,j] - wr ]ᵀ * X = b. - scale, _, _ := impl.Dlaln2(false, 1, 1, smin, 1, t[j*ldt+j:], ldt, - 1, 1, b[j*ldb+iv:], ldb, wr, 0, x[:1], 2) - // Scale if necessary. - if scale != 1 { - bi.Dscal(n-ki, scale, b[ki*ldb+iv:], ldb) - } - b[j*ldb+iv] = x[0] - vmax = math.Max(math.Abs(b[j*ldb+iv]), vmax) - vcrit = bignum / vmax - j++ - } else { - // 2×2 diagonal block. - - // Scale if necessary to avoid overflow - // when forming the right-hand side. - beta := math.Max(norms[j], norms[j+1]) - if beta > vcrit { - bi.Dscal(n-ki, 1/vmax, b[ki*ldb+iv:], ldb) - vmax = 1 - } - b[j*ldb+iv] -= bi.Ddot(j-ki-1, t[(ki+1)*ldt+j:], ldt, b[(ki+1)*ldb+iv:], ldb) - b[(j+1)*ldb+iv] -= bi.Ddot(j-ki-1, t[(ki+1)*ldt+j+1:], ldt, b[(ki+1)*ldb+iv:], ldb) - // Solve - // [ T[j,j]-wr T[j,j+1] ]ᵀ * X = scale*[ b1 ] - // [ T[j+1,j] T[j+1,j+1]-wr ] [ b2 ] - scale, _, _ := impl.Dlaln2(true, 2, 1, smin, 1, t[j*ldt+j:], ldt, - 1, 1, b[j*ldb+iv:], ldb, wr, 0, x[:3], 2) - // Scale if necessary. - if scale != 1 { - bi.Dscal(n-ki, scale, b[ki*ldb+iv:], ldb) - } - b[j*ldb+iv] = x[0] - b[(j+1)*ldb+iv] = x[2] - vmax = math.Max(vmax, math.Max(math.Abs(b[j*ldb+iv]), math.Abs(b[(j+1)*ldb+iv]))) - vcrit = bignum / vmax - j += 2 - } - } - // Copy the vector x or Q*x to VL and normalize. - switch { - case howmny != lapack.EVAllMulQ: - // No back-transform: copy x to VL and normalize. - bi.Dcopy(n-ki, b[ki*ldb+iv:], ldb, vl[ki*ldvl+is:], ldvl) - ii := bi.Idamax(n-ki, vl[ki*ldvl+is:], ldvl) + ki - remax := 1 / math.Abs(vl[ii*ldvl+is]) - bi.Dscal(n-ki, remax, vl[ki*ldvl+is:], ldvl) - for k := 0; k < ki; k++ { - vl[k*ldvl+is] = 0 - } - case nb == 1: - // Version 1: back-transform each vector with Gemv, Q*x. - if n-ki-1 > 0 { - bi.Dgemv(blas.NoTrans, n, n-ki-1, - 1, vl[ki+1:], ldvl, b[(ki+1)*ldb+iv:], ldb, - b[ki*ldb+iv], vl[ki:], ldvl) - } - ii := bi.Idamax(n, vl[ki:], ldvl) - remax := 1 / math.Abs(vl[ii*ldvl+ki]) - bi.Dscal(n, remax, vl[ki:], ldvl) - default: - // Version 2: back-transform block of vectors with Gemm - // zero out above vector. - for k := 0; k < ki; k++ { - b[k*ldb+iv] = 0 - } - iscomplex[iv] = ip - // Back-transform and normalization is done below. - } - } else { - // Complex left eigenvector. - - // Initial solve: - // [ [ T[ki,ki] T[ki,ki+1] ]ᵀ - (wr - i* wi) ]*X = 0. - // [ [ T[ki+1,ki] T[ki+1,ki+1] ] ] - if math.Abs(t[ki*ldt+ki+1]) >= math.Abs(t[(ki+1)*ldt+ki]) { - b[ki*ldb+iv] = wi / t[ki*ldt+ki+1] - b[(ki+1)*ldb+iv+1] = 1 - } else { - b[ki*ldb+iv] = 1 - b[(ki+1)*ldb+iv+1] = -wi / t[(ki+1)*ldt+ki] - } - b[(ki+1)*ldb+iv] = 0 - b[ki*ldb+iv+1] = 0 - // Form right-hand side. - for k := ki + 2; k < n; k++ { - b[k*ldb+iv] = -b[ki*ldb+iv] * t[ki*ldt+k] - b[k*ldb+iv+1] = -b[(ki+1)*ldb+iv+1] * t[(ki+1)*ldt+k] - } - // Solve transposed quasi-triangular system: - // [ T[ki+2:n,ki+2:n]ᵀ - (wr-i*wi) ]*X = b1+i*b2 - vmax := 1.0 - vcrit := bignum - for j := ki + 2; j < n; { - if j == n-1 || t[(j+1)*ldt+j] == 0 { - // 1×1 diagonal block. - - // Scale if necessary to avoid overflow - // when forming the right-hand side elements. - if norms[j] > vcrit { - rec := 1 / vmax - bi.Dscal(n-ki, rec, b[ki*ldb+iv:], ldb) - bi.Dscal(n-ki, rec, b[ki*ldb+iv+1:], ldb) - vmax = 1 - } - b[j*ldb+iv] -= bi.Ddot(j-ki-2, t[(ki+2)*ldt+j:], ldt, b[(ki+2)*ldb+iv:], ldb) - b[j*ldb+iv+1] -= bi.Ddot(j-ki-2, t[(ki+2)*ldt+j:], ldt, b[(ki+2)*ldb+iv+1:], ldb) - // Solve [ T[j,j]-(wr-i*wi) ]*(X11+i*X12) = b1+i*b2. - scale, _, _ := impl.Dlaln2(false, 1, 2, smin, 1, t[j*ldt+j:], ldt, - 1, 1, b[j*ldb+iv:], ldb, wr, -wi, x[:2], 2) - // Scale if necessary. - if scale != 1 { - bi.Dscal(n-ki, scale, b[ki*ldb+iv:], ldb) - bi.Dscal(n-ki, scale, b[ki*ldb+iv+1:], ldb) - } - b[j*ldb+iv] = x[0] - b[j*ldb+iv+1] = x[1] - vmax = math.Max(vmax, math.Max(math.Abs(b[j*ldb+iv]), math.Abs(b[j*ldb+iv+1]))) - vcrit = bignum / vmax - j++ - } else { - // 2×2 diagonal block. - - // Scale if necessary to avoid overflow - // when forming the right-hand side elements. - if math.Max(norms[j], norms[j+1]) > vcrit { - rec := 1 / vmax - bi.Dscal(n-ki, rec, b[ki*ldb+iv:], ldb) - bi.Dscal(n-ki, rec, b[ki*ldb+iv+1:], ldb) - vmax = 1 - } - b[j*ldb+iv] -= bi.Ddot(j-ki-2, t[(ki+2)*ldt+j:], ldt, b[(ki+2)*ldb+iv:], ldb) - b[j*ldb+iv+1] -= bi.Ddot(j-ki-2, t[(ki+2)*ldt+j:], ldt, b[(ki+2)*ldb+iv+1:], ldb) - b[(j+1)*ldb+iv] -= bi.Ddot(j-ki-2, t[(ki+2)*ldt+j+1:], ldt, b[(ki+2)*ldb+iv:], ldb) - b[(j+1)*ldb+iv+1] -= bi.Ddot(j-ki-2, t[(ki+2)*ldt+j+1:], ldt, b[(ki+2)*ldb+iv+1:], ldb) - // Solve 2×2 complex linear equation - // [ [T[j,j] T[j,j+1] ]ᵀ - (wr-i*wi)*I ]*X = scale*b - // [ [T[j+1,j] T[j+1,j+1]] ] - scale, _, _ := impl.Dlaln2(true, 2, 2, smin, 1, t[j*ldt+j:], ldt, - 1, 1, b[j*ldb+iv:], ldb, wr, -wi, x[:], 2) - // Scale if necessary. - if scale != 1 { - bi.Dscal(n-ki, scale, b[ki*ldb+iv:], ldb) - bi.Dscal(n-ki, scale, b[ki*ldb+iv+1:], ldb) - } - b[j*ldb+iv] = x[0] - b[j*ldb+iv+1] = x[1] - b[(j+1)*ldb+iv] = x[2] - b[(j+1)*ldb+iv+1] = x[3] - vmax01 := math.Max(math.Abs(x[0]), math.Abs(x[1])) - vmax23 := math.Max(math.Abs(x[2]), math.Abs(x[3])) - vmax = math.Max(vmax, math.Max(vmax01, vmax23)) - vcrit = bignum / vmax - j += 2 - } - } - // Copy the vector x or Q*x to VL and normalize. - switch { - case howmny != lapack.EVAllMulQ: - // No back-transform: copy x to VL and normalize. - bi.Dcopy(n-ki, b[ki*ldb+iv:], ldb, vl[ki*ldvl+is:], ldvl) - bi.Dcopy(n-ki, b[ki*ldb+iv+1:], ldb, vl[ki*ldvl+is+1:], ldvl) - emax := 0.0 - for k := ki; k < n; k++ { - emax = math.Max(emax, math.Abs(vl[k*ldvl+is])+math.Abs(vl[k*ldvl+is+1])) - } - remax := 1 / emax - bi.Dscal(n-ki, remax, vl[ki*ldvl+is:], ldvl) - bi.Dscal(n-ki, remax, vl[ki*ldvl+is+1:], ldvl) - for k := 0; k < ki; k++ { - vl[k*ldvl+is] = 0 - vl[k*ldvl+is+1] = 0 - } - case nb == 1: - // Version 1: back-transform each vector with GEMV, Q*x. - if n-ki-2 > 0 { - bi.Dgemv(blas.NoTrans, n, n-ki-2, - 1, vl[ki+2:], ldvl, b[(ki+2)*ldb+iv:], ldb, - b[ki*ldb+iv], vl[ki:], ldvl) - bi.Dgemv(blas.NoTrans, n, n-ki-2, - 1, vl[ki+2:], ldvl, b[(ki+2)*ldb+iv+1:], ldb, - b[(ki+1)*ldb+iv+1], vl[ki+1:], ldvl) - } else { - bi.Dscal(n, b[ki*ldb+iv], vl[ki:], ldvl) - bi.Dscal(n, b[(ki+1)*ldb+iv+1], vl[ki+1:], ldvl) - } - emax := 0.0 - for k := 0; k < n; k++ { - emax = math.Max(emax, math.Abs(vl[k*ldvl+ki])+math.Abs(vl[k*ldvl+ki+1])) - } - remax := 1 / emax - bi.Dscal(n, remax, vl[ki:], ldvl) - bi.Dscal(n, remax, vl[ki+1:], ldvl) - default: - // Version 2: back-transform block of vectors with GEMM. - // Zero out above vector. - // Could go from ki-nv+1 to ki-1. - for k := 0; k < ki; k++ { - b[k*ldb+iv] = 0 - b[k*ldb+iv+1] = 0 - } - iscomplex[iv] = ip - iscomplex[iv+1] = -ip - iv++ - // Back-transform and normalization is done below. - } - } - if nb > 1 { - // Blocked version of back-transform. - // For complex case, ki2 includes both vectors ki and ki+1. - ki2 := ki - if ip != 0 { - ki2++ - } - // Columns [0:iv] of work are valid vectors. When the - // number of vectors stored reaches nb-1 or nb, or if - // this was last vector, do the Gemm. - if iv >= nb-2 || ki2 == n-1 { - bi.Dgemm(blas.NoTrans, blas.NoTrans, n, iv+1, n-ki2+iv, - 1, vl[ki2-iv:], ldvl, b[(ki2-iv)*ldb:], ldb, - 0, b[nb:], ldb) - // Normalize vectors. - var remax float64 - for k := 0; k <= iv; k++ { - if iscomplex[k] == 0 { - // Real eigenvector. - ii := bi.Idamax(n, b[nb+k:], ldb) - remax = 1 / math.Abs(b[ii*ldb+nb+k]) - } else if iscomplex[k] == 1 { - // First eigenvector of conjugate pair. - emax := 0.0 - for ii := 0; ii < n; ii++ { - emax = math.Max(emax, math.Abs(b[ii*ldb+nb+k])+math.Abs(b[ii*ldb+nb+k+1])) - } - remax = 1 / emax - // Second eigenvector of conjugate pair - // will reuse this value of remax. - } - bi.Dscal(n, remax, b[nb+k:], ldb) - } - impl.Dlacpy(blas.All, n, iv+1, b[nb:], ldb, vl[ki2-iv:], ldvl) - iv = 0 - } else { - iv++ - } - } - is++ - if ip != 0 { - is++ - } - } - - return m -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrexc.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dtrexc.go deleted file mode 100644 index d063872..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrexc.go +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import "gonum.org/v1/gonum/lapack" - -// Dtrexc reorders the real Schur factorization of a n×n real matrix -// A = Q*T*Qᵀ -// so that the diagonal block of T with row index ifst is moved to row ilst. -// -// On entry, T must be in Schur canonical form, that is, block upper triangular -// with 1×1 and 2×2 diagonal blocks; each 2×2 diagonal block has its diagonal -// elements equal and its off-diagonal elements of opposite sign. -// -// On return, T will be reordered by an orthogonal similarity transformation Z -// as Zᵀ*T*Z, and will be again in Schur canonical form. -// -// If compq is lapack.UpdateSchur, on return the matrix Q of Schur vectors will be -// updated by post-multiplying it with Z. -// If compq is lapack.UpdateSchurNone, the matrix Q is not referenced and will not be -// updated. -// For other values of compq Dtrexc will panic. -// -// ifst and ilst specify the reordering of the diagonal blocks of T. The block -// with row index ifst is moved to row ilst, by a sequence of transpositions -// between adjacent blocks. -// -// If ifst points to the second row of a 2×2 block, ifstOut will point to the -// first row, otherwise it will be equal to ifst. -// -// ilstOut will point to the first row of the block in its final position. If ok -// is true, ilstOut may differ from ilst by +1 or -1. -// -// It must hold that -// 0 <= ifst < n, and 0 <= ilst < n, -// otherwise Dtrexc will panic. -// -// If ok is false, two adjacent blocks were too close to swap because the -// problem is very ill-conditioned. T may have been partially reordered, and -// ilstOut will point to the first row of the block at the position to which it -// has been moved. -// -// work must have length at least n, otherwise Dtrexc will panic. -// -// Dtrexc is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dtrexc(compq lapack.UpdateSchurComp, n int, t []float64, ldt int, q []float64, ldq int, ifst, ilst int, work []float64) (ifstOut, ilstOut int, ok bool) { - switch { - case compq != lapack.UpdateSchur && compq != lapack.UpdateSchurNone: - panic(badUpdateSchurComp) - case n < 0: - panic(nLT0) - case ldt < max(1, n): - panic(badLdT) - case ldq < 1, compq == lapack.UpdateSchur && ldq < n: - panic(badLdQ) - case (ifst < 0 || n <= ifst) && n > 0: - panic(badIfst) - case (ilst < 0 || n <= ilst) && n > 0: - panic(badIlst) - } - - // Quick return if possible. - if n == 0 { - return ifst, ilst, true - } - - switch { - case len(t) < (n-1)*ldt+n: - panic(shortT) - case compq == lapack.UpdateSchur && len(q) < (n-1)*ldq+n: - panic(shortQ) - case len(work) < n: - panic(shortWork) - } - - // Quick return if possible. - if n == 1 { - return ifst, ilst, true - } - - // Determine the first row of specified block - // and find out it is 1×1 or 2×2. - if ifst > 0 && t[ifst*ldt+ifst-1] != 0 { - ifst-- - } - nbf := 1 // Size of the first block. - if ifst+1 < n && t[(ifst+1)*ldt+ifst] != 0 { - nbf = 2 - } - // Determine the first row of the final block - // and find out it is 1×1 or 2×2. - if ilst > 0 && t[ilst*ldt+ilst-1] != 0 { - ilst-- - } - nbl := 1 // Size of the last block. - if ilst+1 < n && t[(ilst+1)*ldt+ilst] != 0 { - nbl = 2 - } - - ok = true - wantq := compq == lapack.UpdateSchur - - switch { - case ifst == ilst: - return ifst, ilst, true - - case ifst < ilst: - // Update ilst. - switch { - case nbf == 2 && nbl == 1: - ilst-- - case nbf == 1 && nbl == 2: - ilst++ - } - here := ifst - for here < ilst { - // Swap block with next one below. - if nbf == 1 || nbf == 2 { - // Current block either 1×1 or 2×2. - nbnext := 1 // Size of the next block. - if here+nbf+1 < n && t[(here+nbf+1)*ldt+here+nbf] != 0 { - nbnext = 2 - } - ok = impl.Dlaexc(wantq, n, t, ldt, q, ldq, here, nbf, nbnext, work) - if !ok { - return ifst, here, false - } - here += nbnext - // Test if 2×2 block breaks into two 1×1 blocks. - if nbf == 2 && t[(here+1)*ldt+here] == 0 { - nbf = 3 - } - continue - } - - // Current block consists of two 1×1 blocks each of - // which must be swapped individually. - nbnext := 1 // Size of the next block. - if here+3 < n && t[(here+3)*ldt+here+2] != 0 { - nbnext = 2 - } - ok = impl.Dlaexc(wantq, n, t, ldt, q, ldq, here+1, 1, nbnext, work) - if !ok { - return ifst, here, false - } - if nbnext == 1 { - // Swap two 1×1 blocks, no problems possible. - impl.Dlaexc(wantq, n, t, ldt, q, ldq, here, 1, nbnext, work) - here++ - continue - } - // Recompute nbnext in case 2×2 split. - if t[(here+2)*ldt+here+1] == 0 { - nbnext = 1 - } - if nbnext == 2 { - // 2×2 block did not split. - ok = impl.Dlaexc(wantq, n, t, ldt, q, ldq, here, 1, nbnext, work) - if !ok { - return ifst, here, false - } - } else { - // 2×2 block did split. - impl.Dlaexc(wantq, n, t, ldt, q, ldq, here, 1, 1, work) - impl.Dlaexc(wantq, n, t, ldt, q, ldq, here+1, 1, 1, work) - } - here += 2 - } - return ifst, here, true - - default: // ifst > ilst - here := ifst - for here > ilst { - // Swap block with next one above. - if nbf == 1 || nbf == 2 { - // Current block either 1×1 or 2×2. - nbnext := 1 - if here-2 >= 0 && t[(here-1)*ldt+here-2] != 0 { - nbnext = 2 - } - ok = impl.Dlaexc(wantq, n, t, ldt, q, ldq, here-nbnext, nbnext, nbf, work) - if !ok { - return ifst, here, false - } - here -= nbnext - // Test if 2×2 block breaks into two 1×1 blocks. - if nbf == 2 && t[(here+1)*ldt+here] == 0 { - nbf = 3 - } - continue - } - - // Current block consists of two 1×1 blocks each of - // which must be swapped individually. - nbnext := 1 - if here-2 >= 0 && t[(here-1)*ldt+here-2] != 0 { - nbnext = 2 - } - ok = impl.Dlaexc(wantq, n, t, ldt, q, ldq, here-nbnext, nbnext, 1, work) - if !ok { - return ifst, here, false - } - if nbnext == 1 { - // Swap two 1×1 blocks, no problems possible. - impl.Dlaexc(wantq, n, t, ldt, q, ldq, here, nbnext, 1, work) - here-- - continue - } - // Recompute nbnext in case 2×2 split. - if t[here*ldt+here-1] == 0 { - nbnext = 1 - } - if nbnext == 2 { - // 2×2 block did not split. - ok = impl.Dlaexc(wantq, n, t, ldt, q, ldq, here-1, 2, 1, work) - if !ok { - return ifst, here, false - } - } else { - // 2×2 block did split. - impl.Dlaexc(wantq, n, t, ldt, q, ldq, here, 1, 1, work) - impl.Dlaexc(wantq, n, t, ldt, q, ldq, here-1, 1, 1, work) - } - here -= 2 - } - return ifst, here, true - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrti2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dtrti2.go deleted file mode 100644 index efc24b6..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrti2.go +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dtrti2 computes the inverse of a triangular matrix, storing the result in place -// into a. This is the BLAS level 2 version of the algorithm. -// -// Dtrti2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dtrti2(uplo blas.Uplo, diag blas.Diag, n int, a []float64, lda int) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case diag != blas.NonUnit && diag != blas.Unit: - panic(badDiag) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - if n == 0 { - return - } - - if len(a) < (n-1)*lda+n { - panic(shortA) - } - - bi := blas64.Implementation() - - nonUnit := diag == blas.NonUnit - // TODO(btracey): Replace this with a row-major ordering. - if uplo == blas.Upper { - for j := 0; j < n; j++ { - var ajj float64 - if nonUnit { - ajj = 1 / a[j*lda+j] - a[j*lda+j] = ajj - ajj *= -1 - } else { - ajj = -1 - } - bi.Dtrmv(blas.Upper, blas.NoTrans, diag, j, a, lda, a[j:], lda) - bi.Dscal(j, ajj, a[j:], lda) - } - return - } - for j := n - 1; j >= 0; j-- { - var ajj float64 - if nonUnit { - ajj = 1 / a[j*lda+j] - a[j*lda+j] = ajj - ajj *= -1 - } else { - ajj = -1 - } - if j < n-1 { - bi.Dtrmv(blas.Lower, blas.NoTrans, diag, n-j-1, a[(j+1)*lda+j+1:], lda, a[(j+1)*lda+j:], lda) - bi.Dscal(n-j-1, ajj, a[(j+1)*lda+j:], lda) - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrtri.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dtrtri.go deleted file mode 100644 index 6ec3663..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrtri.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dtrtri computes the inverse of a triangular matrix, storing the result in place -// into a. This is the BLAS level 3 version of the algorithm which builds upon -// Dtrti2 to operate on matrix blocks instead of only individual columns. -// -// Dtrtri will not perform the inversion if the matrix is singular, and returns -// a boolean indicating whether the inversion was successful. -func (impl Implementation) Dtrtri(uplo blas.Uplo, diag blas.Diag, n int, a []float64, lda int) (ok bool) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case diag != blas.NonUnit && diag != blas.Unit: - panic(badDiag) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - if n == 0 { - return true - } - - if len(a) < (n-1)*lda+n { - panic(shortA) - } - - if diag == blas.NonUnit { - for i := 0; i < n; i++ { - if a[i*lda+i] == 0 { - return false - } - } - } - - bi := blas64.Implementation() - - nb := impl.Ilaenv(1, "DTRTRI", "UD", n, -1, -1, -1) - if nb <= 1 || nb > n { - impl.Dtrti2(uplo, diag, n, a, lda) - return true - } - if uplo == blas.Upper { - for j := 0; j < n; j += nb { - jb := min(nb, n-j) - bi.Dtrmm(blas.Left, blas.Upper, blas.NoTrans, diag, j, jb, 1, a, lda, a[j:], lda) - bi.Dtrsm(blas.Right, blas.Upper, blas.NoTrans, diag, j, jb, -1, a[j*lda+j:], lda, a[j:], lda) - impl.Dtrti2(blas.Upper, diag, jb, a[j*lda+j:], lda) - } - return true - } - nn := ((n - 1) / nb) * nb - for j := nn; j >= 0; j -= nb { - jb := min(nb, n-j) - if j+jb <= n-1 { - bi.Dtrmm(blas.Left, blas.Lower, blas.NoTrans, diag, n-j-jb, jb, 1, a[(j+jb)*lda+j+jb:], lda, a[(j+jb)*lda+j:], lda) - bi.Dtrsm(blas.Right, blas.Lower, blas.NoTrans, diag, n-j-jb, jb, -1, a[j*lda+j:], lda, a[(j+jb)*lda+j:], lda) - } - impl.Dtrti2(blas.Lower, diag, jb, a[j*lda+j:], lda) - } - return true -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrtrs.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dtrtrs.go deleted file mode 100644 index 2145fbd..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrtrs.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dtrtrs solves a triangular system of the form A * X = B or Aᵀ * X = B. Dtrtrs -// returns whether the solve completed successfully. If A is singular, no solve is performed. -func (impl Implementation) Dtrtrs(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n, nrhs int, a []float64, lda int, b []float64, ldb int) (ok bool) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case trans != blas.NoTrans && trans != blas.Trans && trans != blas.ConjTrans: - panic(badTrans) - case diag != blas.NonUnit && diag != blas.Unit: - panic(badDiag) - case n < 0: - panic(nLT0) - case nrhs < 0: - panic(nrhsLT0) - case lda < max(1, n): - panic(badLdA) - case ldb < max(1, nrhs): - panic(badLdB) - } - - if n == 0 { - return true - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(b) < (n-1)*ldb+nrhs: - panic(shortB) - } - - // Check for singularity. - nounit := diag == blas.NonUnit - if nounit { - for i := 0; i < n; i++ { - if a[i*lda+i] == 0 { - return false - } - } - } - bi := blas64.Implementation() - bi.Dtrsm(blas.Left, uplo, trans, diag, n, nrhs, 1, a, lda, b, ldb) - return true -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/errors.go b/vendor/gonum.org/v1/gonum/lapack/gonum/errors.go deleted file mode 100644 index 3c0cb68..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/errors.go +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -// This list is duplicated in netlib/lapack/netlib. Keep in sync. -const ( - // Panic strings for bad enumeration values. - badApplyOrtho = "lapack: bad ApplyOrtho" - badBalanceJob = "lapack: bad BalanceJob" - badDiag = "lapack: bad Diag" - badDirect = "lapack: bad Direct" - badEVComp = "lapack: bad EVComp" - badEVHowMany = "lapack: bad EVHowMany" - badEVJob = "lapack: bad EVJob" - badEVSide = "lapack: bad EVSide" - badGSVDJob = "lapack: bad GSVDJob" - badGenOrtho = "lapack: bad GenOrtho" - badLeftEVJob = "lapack: bad LeftEVJob" - badMatrixType = "lapack: bad MatrixType" - badNorm = "lapack: bad Norm" - badPivot = "lapack: bad Pivot" - badRightEVJob = "lapack: bad RightEVJob" - badSVDJob = "lapack: bad SVDJob" - badSchurComp = "lapack: bad SchurComp" - badSchurJob = "lapack: bad SchurJob" - badSide = "lapack: bad Side" - badSort = "lapack: bad Sort" - badStoreV = "lapack: bad StoreV" - badTrans = "lapack: bad Trans" - badUpdateSchurComp = "lapack: bad UpdateSchurComp" - badUplo = "lapack: bad Uplo" - bothSVDOver = "lapack: both jobU and jobVT are lapack.SVDOverwrite" - - // Panic strings for bad numerical and string values. - badIfst = "lapack: ifst out of range" - badIhi = "lapack: ihi out of range" - badIhiz = "lapack: ihiz out of range" - badIlo = "lapack: ilo out of range" - badIloz = "lapack: iloz out of range" - badIlst = "lapack: ilst out of range" - badIsave = "lapack: bad isave value" - badIspec = "lapack: bad ispec value" - badJ1 = "lapack: j1 out of range" - badJpvt = "lapack: bad element of jpvt" - badK1 = "lapack: k1 out of range" - badK2 = "lapack: k2 out of range" - badKacc22 = "lapack: invalid value of kacc22" - badKbot = "lapack: kbot out of range" - badKtop = "lapack: ktop out of range" - badLWork = "lapack: insufficient declared workspace length" - badMm = "lapack: mm out of range" - badN1 = "lapack: bad value of n1" - badN2 = "lapack: bad value of n2" - badNa = "lapack: bad value of na" - badName = "lapack: bad name" - badNh = "lapack: bad value of nh" - badNw = "lapack: bad value of nw" - badPp = "lapack: bad value of pp" - badShifts = "lapack: bad shifts" - i0LT0 = "lapack: i0 < 0" - kGTM = "lapack: k > m" - kGTN = "lapack: k > n" - kLT0 = "lapack: k < 0" - kLT1 = "lapack: k < 1" - kdLT0 = "lapack: kd < 0" - mGTN = "lapack: m > n" - mLT0 = "lapack: m < 0" - mmLT0 = "lapack: mm < 0" - n0LT0 = "lapack: n0 < 0" - nGTM = "lapack: n > m" - nLT0 = "lapack: n < 0" - nLT1 = "lapack: n < 1" - nLTM = "lapack: n < m" - nanCFrom = "lapack: cfrom is NaN" - nanCTo = "lapack: cto is NaN" - nbGTM = "lapack: nb > m" - nbGTN = "lapack: nb > n" - nbLT0 = "lapack: nb < 0" - nccLT0 = "lapack: ncc < 0" - ncvtLT0 = "lapack: ncvt < 0" - negANorm = "lapack: anorm < 0" - negZ = "lapack: negative z value" - nhLT0 = "lapack: nh < 0" - notIsolated = "lapack: block is not isolated" - nrhsLT0 = "lapack: nrhs < 0" - nruLT0 = "lapack: nru < 0" - nshftsLT0 = "lapack: nshfts < 0" - nshftsOdd = "lapack: nshfts must be even" - nvLT0 = "lapack: nv < 0" - offsetGTM = "lapack: offset > m" - offsetLT0 = "lapack: offset < 0" - pLT0 = "lapack: p < 0" - recurLT0 = "lapack: recur < 0" - zeroCFrom = "lapack: zero cfrom" - - // Panic strings for bad slice lengths. - badLenAlpha = "lapack: bad length of alpha" - badLenBeta = "lapack: bad length of beta" - badLenIpiv = "lapack: bad length of ipiv" - badLenJpvt = "lapack: bad length of jpvt" - badLenK = "lapack: bad length of k" - badLenSelected = "lapack: bad length of selected" - badLenSi = "lapack: bad length of si" - badLenSr = "lapack: bad length of sr" - badLenTau = "lapack: bad length of tau" - badLenWi = "lapack: bad length of wi" - badLenWr = "lapack: bad length of wr" - - // Panic strings for insufficient slice lengths. - shortA = "lapack: insufficient length of a" - shortAB = "lapack: insufficient length of ab" - shortAuxv = "lapack: insufficient length of auxv" - shortB = "lapack: insufficient length of b" - shortC = "lapack: insufficient length of c" - shortCNorm = "lapack: insufficient length of cnorm" - shortD = "lapack: insufficient length of d" - shortE = "lapack: insufficient length of e" - shortF = "lapack: insufficient length of f" - shortH = "lapack: insufficient length of h" - shortIWork = "lapack: insufficient length of iwork" - shortIsgn = "lapack: insufficient length of isgn" - shortQ = "lapack: insufficient length of q" - shortS = "lapack: insufficient length of s" - shortScale = "lapack: insufficient length of scale" - shortT = "lapack: insufficient length of t" - shortTau = "lapack: insufficient length of tau" - shortTauP = "lapack: insufficient length of tauP" - shortTauQ = "lapack: insufficient length of tauQ" - shortU = "lapack: insufficient length of u" - shortV = "lapack: insufficient length of v" - shortVL = "lapack: insufficient length of vl" - shortVR = "lapack: insufficient length of vr" - shortVT = "lapack: insufficient length of vt" - shortVn1 = "lapack: insufficient length of vn1" - shortVn2 = "lapack: insufficient length of vn2" - shortW = "lapack: insufficient length of w" - shortWH = "lapack: insufficient length of wh" - shortWV = "lapack: insufficient length of wv" - shortWi = "lapack: insufficient length of wi" - shortWork = "lapack: insufficient length of work" - shortWr = "lapack: insufficient length of wr" - shortX = "lapack: insufficient length of x" - shortY = "lapack: insufficient length of y" - shortZ = "lapack: insufficient length of z" - - // Panic strings for bad leading dimensions of matrices. - badLdA = "lapack: bad leading dimension of A" - badLdB = "lapack: bad leading dimension of B" - badLdC = "lapack: bad leading dimension of C" - badLdF = "lapack: bad leading dimension of F" - badLdH = "lapack: bad leading dimension of H" - badLdQ = "lapack: bad leading dimension of Q" - badLdT = "lapack: bad leading dimension of T" - badLdU = "lapack: bad leading dimension of U" - badLdV = "lapack: bad leading dimension of V" - badLdVL = "lapack: bad leading dimension of VL" - badLdVR = "lapack: bad leading dimension of VR" - badLdVT = "lapack: bad leading dimension of VT" - badLdW = "lapack: bad leading dimension of W" - badLdWH = "lapack: bad leading dimension of WH" - badLdWV = "lapack: bad leading dimension of WV" - badLdWork = "lapack: bad leading dimension of Work" - badLdX = "lapack: bad leading dimension of X" - badLdY = "lapack: bad leading dimension of Y" - badLdZ = "lapack: bad leading dimension of Z" - - // Panic strings for bad vector increments. - absIncNotOne = "lapack: increment not one or negative one" - badIncX = "lapack: incX <= 0" - badIncY = "lapack: incY <= 0" - zeroIncV = "lapack: incv == 0" -) diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/iladlc.go b/vendor/gonum.org/v1/gonum/lapack/gonum/iladlc.go deleted file mode 100644 index b251d72..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/iladlc.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -// Iladlc scans a matrix for its last non-zero column. Returns -1 if the matrix -// is all zeros. -// -// Iladlc is an internal routine. It is exported for testing purposes. -func (Implementation) Iladlc(m, n int, a []float64, lda int) int { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - if n == 0 || m == 0 { - return -1 - } - - if len(a) < (m-1)*lda+n { - panic(shortA) - } - - // Test common case where corner is non-zero. - if a[n-1] != 0 || a[(m-1)*lda+(n-1)] != 0 { - return n - 1 - } - - // Scan each row tracking the highest column seen. - highest := -1 - for i := 0; i < m; i++ { - for j := n - 1; j >= 0; j-- { - if a[i*lda+j] != 0 { - highest = max(highest, j) - break - } - } - } - return highest -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/iladlr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/iladlr.go deleted file mode 100644 index b73fe18..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/iladlr.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -// Iladlr scans a matrix for its last non-zero row. Returns -1 if the matrix -// is all zeros. -// -// Iladlr is an internal routine. It is exported for testing purposes. -func (Implementation) Iladlr(m, n int, a []float64, lda int) int { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - if n == 0 || m == 0 { - return -1 - } - - if len(a) < (m-1)*lda+n { - panic(shortA) - } - - // Check the common case where the corner is non-zero - if a[(m-1)*lda] != 0 || a[(m-1)*lda+n-1] != 0 { - return m - 1 - } - for i := m - 1; i >= 0; i-- { - for j := 0; j < n; j++ { - if a[i*lda+j] != 0 { - return i - } - } - } - return -1 -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/ilaenv.go b/vendor/gonum.org/v1/gonum/lapack/gonum/ilaenv.go deleted file mode 100644 index b401104..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/ilaenv.go +++ /dev/null @@ -1,387 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -// Ilaenv returns algorithm tuning parameters for the algorithm given by the -// input string. ispec specifies the parameter to return: -// 1: The optimal block size for a blocked algorithm. -// 2: The minimum block size for a blocked algorithm. -// 3: The block size of unprocessed data at which a blocked algorithm should -// crossover to an unblocked version. -// 4: The number of shifts. -// 5: The minimum column dimension for blocking to be used. -// 6: The crossover point for SVD (to use QR factorization or not). -// 7: The number of processors. -// 8: The crossover point for multi-shift in QR and QZ methods for non-symmetric eigenvalue problems. -// 9: Maximum size of the subproblems in divide-and-conquer algorithms. -// 10: ieee NaN arithmetic can be trusted not to trap. -// 11: infinity arithmetic can be trusted not to trap. -// 12...16: parameters for Dhseqr and related functions. See Iparmq for more -// information. -// -// Ilaenv is an internal routine. It is exported for testing purposes. -func (impl Implementation) Ilaenv(ispec int, name string, opts string, n1, n2, n3, n4 int) int { - // TODO(btracey): Replace this with a constant lookup? A list of constants? - sname := name[0] == 'S' || name[0] == 'D' - cname := name[0] == 'C' || name[0] == 'Z' - if !sname && !cname { - panic(badName) - } - c2 := name[1:3] - c3 := name[3:6] - c4 := c3[1:3] - - switch ispec { - default: - panic(badIspec) - case 1: - switch c2 { - default: - panic(badName) - case "GE": - switch c3 { - default: - panic(badName) - case "TRF": - if sname { - return 64 - } - return 64 - case "QRF", "RQF", "LQF", "QLF": - if sname { - return 32 - } - return 32 - case "HRD": - if sname { - return 32 - } - return 32 - case "BRD": - if sname { - return 32 - } - return 32 - case "TRI": - if sname { - return 64 - } - return 64 - } - case "PO": - switch c3 { - default: - panic(badName) - case "TRF": - if sname { - return 64 - } - return 64 - } - case "SY": - switch c3 { - default: - panic(badName) - case "TRF": - if sname { - return 64 - } - return 64 - case "TRD": - return 32 - case "GST": - return 64 - } - case "HE": - switch c3 { - default: - panic(badName) - case "TRF": - return 64 - case "TRD": - return 32 - case "GST": - return 64 - } - case "OR": - switch c3[0] { - default: - panic(badName) - case 'G': - switch c3[1:] { - default: - panic(badName) - case "QR", "RQ", "LQ", "QL", "HR", "TR", "BR": - return 32 - } - case 'M': - switch c3[1:] { - default: - panic(badName) - case "QR", "RQ", "LQ", "QL", "HR", "TR", "BR": - return 32 - } - } - case "UN": - switch c3[0] { - default: - panic(badName) - case 'G': - switch c3[1:] { - default: - panic(badName) - case "QR", "RQ", "LQ", "QL", "HR", "TR", "BR": - return 32 - } - case 'M': - switch c3[1:] { - default: - panic(badName) - case "QR", "RQ", "LQ", "QL", "HR", "TR", "BR": - return 32 - } - } - case "GB": - switch c3 { - default: - panic(badName) - case "TRF": - if sname { - if n4 <= 64 { - return 1 - } - return 32 - } - if n4 <= 64 { - return 1 - } - return 32 - } - case "PB": - switch c3 { - default: - panic(badName) - case "TRF": - if sname { - if n2 <= 64 { - return 1 - } - return 32 - } - if n2 <= 64 { - return 1 - } - return 32 - } - case "TR": - switch c3 { - default: - panic(badName) - case "TRI": - if sname { - return 64 - } - return 64 - case "EVC": - if sname { - return 64 - } - return 64 - } - case "LA": - switch c3 { - default: - panic(badName) - case "UUM": - if sname { - return 64 - } - return 64 - } - case "ST": - if sname && c3 == "EBZ" { - return 1 - } - panic(badName) - } - case 2: - switch c2 { - default: - panic(badName) - case "GE": - switch c3 { - default: - panic(badName) - case "QRF", "RQF", "LQF", "QLF": - if sname { - return 2 - } - return 2 - case "HRD": - if sname { - return 2 - } - return 2 - case "BRD": - if sname { - return 2 - } - return 2 - case "TRI": - if sname { - return 2 - } - return 2 - } - case "SY": - switch c3 { - default: - panic(badName) - case "TRF": - if sname { - return 8 - } - return 8 - case "TRD": - if sname { - return 2 - } - panic(badName) - } - case "HE": - if c3 == "TRD" { - return 2 - } - panic(badName) - case "OR": - if !sname { - panic(badName) - } - switch c3[0] { - default: - panic(badName) - case 'G': - switch c4 { - default: - panic(badName) - case "QR", "RQ", "LQ", "QL", "HR", "TR", "BR": - return 2 - } - case 'M': - switch c4 { - default: - panic(badName) - case "QR", "RQ", "LQ", "QL", "HR", "TR", "BR": - return 2 - } - } - case "UN": - switch c3[0] { - default: - panic(badName) - case 'G': - switch c4 { - default: - panic(badName) - case "QR", "RQ", "LQ", "QL", "HR", "TR", "BR": - return 2 - } - case 'M': - switch c4 { - default: - panic(badName) - case "QR", "RQ", "LQ", "QL", "HR", "TR", "BR": - return 2 - } - } - } - case 3: - switch c2 { - default: - panic(badName) - case "GE": - switch c3 { - default: - panic(badName) - case "QRF", "RQF", "LQF", "QLF": - if sname { - return 128 - } - return 128 - case "HRD": - if sname { - return 128 - } - return 128 - case "BRD": - if sname { - return 128 - } - return 128 - } - case "SY": - if sname && c3 == "TRD" { - return 32 - } - panic(badName) - case "HE": - if c3 == "TRD" { - return 32 - } - panic(badName) - case "OR": - switch c3[0] { - default: - panic(badName) - case 'G': - switch c4 { - default: - panic(badName) - case "QR", "RQ", "LQ", "QL", "HR", "TR", "BR": - return 128 - } - } - case "UN": - switch c3[0] { - default: - panic(badName) - case 'G': - switch c4 { - default: - panic(badName) - case "QR", "RQ", "LQ", "QL", "HR", "TR", "BR": - return 128 - } - } - } - case 4: - // Used by xHSEQR - return 6 - case 5: - // Not used - return 2 - case 6: - // Used by xGELSS and xGESVD - return int(float64(min(n1, n2)) * 1.6) - case 7: - // Not used - return 1 - case 8: - // Used by xHSEQR - return 50 - case 9: - // used by xGELSD and xGESDD - return 25 - case 10: - // Go guarantees ieee - return 1 - case 11: - // Go guarantees ieee - return 1 - case 12, 13, 14, 15, 16: - // Dhseqr and related functions for eigenvalue problems. - return impl.Iparmq(ispec, name, opts, n1, n2, n3, n4) - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/iparmq.go b/vendor/gonum.org/v1/gonum/lapack/gonum/iparmq.go deleted file mode 100644 index 3800f11..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/iparmq.go +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright ©2016 The Gonum 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 gonum - -import "math" - -// Iparmq returns problem and machine dependent parameters useful for Dhseqr and -// related subroutines for eigenvalue problems. -// -// ispec specifies the parameter to return: -// 12: Crossover point between Dlahqr and Dlaqr0. Will be at least 11. -// 13: Deflation window size. -// 14: Nibble crossover point. Determines when to skip a multi-shift QR sweep. -// 15: Number of simultaneous shifts in a multishift QR iteration. -// 16: Select structured matrix multiply. -// For other values of ispec Iparmq will panic. -// -// name is the name of the calling function. name must be in uppercase but this -// is not checked. -// -// opts is not used and exists for future use. -// -// n is the order of the Hessenberg matrix H. -// -// ilo and ihi specify the block [ilo:ihi+1,ilo:ihi+1] that is being processed. -// -// lwork is the amount of workspace available. -// -// Except for ispec input parameters are not checked. -// -// Iparmq is an internal routine. It is exported for testing purposes. -func (Implementation) Iparmq(ispec int, name, opts string, n, ilo, ihi, lwork int) int { - nh := ihi - ilo + 1 - ns := 2 - switch { - case nh >= 30: - ns = 4 - case nh >= 60: - ns = 10 - case nh >= 150: - ns = max(10, nh/int(math.Log(float64(nh))/math.Ln2)) - case nh >= 590: - ns = 64 - case nh >= 3000: - ns = 128 - case nh >= 6000: - ns = 256 - } - ns = max(2, ns-(ns%2)) - - switch ispec { - default: - panic(badIspec) - - case 12: - // Matrices of order smaller than nmin get sent to Dlahqr, the - // classic double shift algorithm. This must be at least 11. - const nmin = 75 - return nmin - - case 13: - const knwswp = 500 - if nh <= knwswp { - return ns - } - return 3 * ns / 2 - - case 14: - // Skip a computationally expensive multi-shift QR sweep with - // Dlaqr5 whenever aggressive early deflation finds at least - // nibble*(window size)/100 deflations. The default, small, - // value reflects the expectation that the cost of looking - // through the deflation window with Dlaqr3 will be - // substantially smaller. - const nibble = 14 - return nibble - - case 15: - return ns - - case 16: - if len(name) != 6 { - panic(badName) - } - const ( - k22min = 14 - kacmin = 14 - ) - var acc22 int - switch { - case name[1:] == "GGHRD" || name[1:] == "GGHD3": - acc22 = 1 - if nh >= k22min { - acc22 = 2 - } - case name[3:] == "EXC": - if nh >= kacmin { - acc22 = 1 - } - if nh >= k22min { - acc22 = 2 - } - case name[1:] == "HSEQR" || name[1:5] == "LAQR": - if ns >= kacmin { - acc22 = 1 - } - if ns >= k22min { - acc22 = 2 - } - } - return acc22 - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/lapack.go b/vendor/gonum.org/v1/gonum/lapack/gonum/lapack.go deleted file mode 100644 index 9195a70..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/lapack.go +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright ©2015 The Gonum 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 gonum - -import "gonum.org/v1/gonum/lapack" - -// Implementation is the native Go implementation of LAPACK routines. It -// is built on top of calls to the return of blas64.Implementation(), so while -// this code is in pure Go, the underlying BLAS implementation may not be. -type Implementation struct{} - -var _ lapack.Float64 = Implementation{} - -func min(a, b int) int { - if a < b { - return a - } - return b -} - -func max(a, b int) int { - if a > b { - return a - } - return b -} - -func abs(a int) int { - if a < 0 { - return -a - } - return a -} - -const ( - // dlamchE is the machine epsilon. For IEEE this is 2^{-53}. - dlamchE = 0x1p-53 - - // dlamchB is the radix of the machine (the base of the number system). - dlamchB = 2 - - // dlamchP is base * eps. - dlamchP = dlamchB * dlamchE - - // dlamchS is the "safe minimum", that is, the lowest number such that - // 1/dlamchS does not overflow, or also the smallest normal number. - // For IEEE this is 2^{-1022}. - dlamchS = 0x1p-1022 -) diff --git a/vendor/gonum.org/v1/gonum/lapack/lapack.go b/vendor/gonum.org/v1/gonum/lapack/lapack.go deleted file mode 100644 index da55fd9..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/lapack.go +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright ©2015 The Gonum 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 lapack - -import "gonum.org/v1/gonum/blas" - -// Complex128 defines the public complex128 LAPACK API supported by gonum/lapack. -type Complex128 interface{} - -// Float64 defines the public float64 LAPACK API supported by gonum/lapack. -type Float64 interface { - Dgecon(norm MatrixNorm, n int, a []float64, lda int, anorm float64, work []float64, iwork []int) float64 - Dgeev(jobvl LeftEVJob, jobvr RightEVJob, n int, a []float64, lda int, wr, wi []float64, vl []float64, ldvl int, vr []float64, ldvr int, work []float64, lwork int) (first int) - Dgels(trans blas.Transpose, m, n, nrhs int, a []float64, lda int, b []float64, ldb int, work []float64, lwork int) bool - Dgelqf(m, n int, a []float64, lda int, tau, work []float64, lwork int) - Dgeqrf(m, n int, a []float64, lda int, tau, work []float64, lwork int) - Dgesvd(jobU, jobVT SVDJob, m, n int, a []float64, lda int, s, u []float64, ldu int, vt []float64, ldvt int, work []float64, lwork int) (ok bool) - Dgetrf(m, n int, a []float64, lda int, ipiv []int) (ok bool) - Dgetri(n int, a []float64, lda int, ipiv []int, work []float64, lwork int) (ok bool) - Dgetrs(trans blas.Transpose, n, nrhs int, a []float64, lda int, ipiv []int, b []float64, ldb int) - Dggsvd3(jobU, jobV, jobQ GSVDJob, m, n, p int, a []float64, lda int, b []float64, ldb int, alpha, beta, u []float64, ldu int, v []float64, ldv int, q []float64, ldq int, work []float64, lwork int, iwork []int) (k, l int, ok bool) - Dlantr(norm MatrixNorm, uplo blas.Uplo, diag blas.Diag, m, n int, a []float64, lda int, work []float64) float64 - Dlange(norm MatrixNorm, m, n int, a []float64, lda int, work []float64) float64 - Dlansy(norm MatrixNorm, uplo blas.Uplo, n int, a []float64, lda int, work []float64) float64 - Dlapmt(forward bool, m, n int, x []float64, ldx int, k []int) - Dormqr(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) - Dormlq(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) - Dpocon(uplo blas.Uplo, n int, a []float64, lda int, anorm float64, work []float64, iwork []int) float64 - Dpotrf(ul blas.Uplo, n int, a []float64, lda int) (ok bool) - Dpotri(ul blas.Uplo, n int, a []float64, lda int) (ok bool) - Dpotrs(ul blas.Uplo, n, nrhs int, a []float64, lda int, b []float64, ldb int) - Dsyev(jobz EVJob, uplo blas.Uplo, n int, a []float64, lda int, w, work []float64, lwork int) (ok bool) - Dtrcon(norm MatrixNorm, uplo blas.Uplo, diag blas.Diag, n int, a []float64, lda int, work []float64, iwork []int) float64 - Dtrtri(uplo blas.Uplo, diag blas.Diag, n int, a []float64, lda int) (ok bool) - Dtrtrs(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n, nrhs int, a []float64, lda int, b []float64, ldb int) (ok bool) -} - -// Direct specifies the direction of the multiplication for the Householder matrix. -type Direct byte - -const ( - Forward Direct = 'F' // Reflectors are right-multiplied, H_0 * H_1 * ... * H_{k-1}. - Backward Direct = 'B' // Reflectors are left-multiplied, H_{k-1} * ... * H_1 * H_0. -) - -// Sort is the sorting order. -type Sort byte - -const ( - SortIncreasing Sort = 'I' - SortDecreasing Sort = 'D' -) - -// StoreV indicates the storage direction of elementary reflectors. -type StoreV byte - -const ( - ColumnWise StoreV = 'C' // Reflector stored in a column of the matrix. - RowWise StoreV = 'R' // Reflector stored in a row of the matrix. -) - -// MatrixNorm represents the kind of matrix norm to compute. -type MatrixNorm byte - -const ( - MaxAbs MatrixNorm = 'M' // max(abs(A(i,j))) - MaxColumnSum MatrixNorm = 'O' // Maximum absolute column sum (one norm) - MaxRowSum MatrixNorm = 'I' // Maximum absolute row sum (infinity norm) - Frobenius MatrixNorm = 'F' // Frobenius norm (sqrt of sum of squares) -) - -// MatrixType represents the kind of matrix represented in the data. -type MatrixType byte - -const ( - General MatrixType = 'G' // A general dense matrix. - UpperTri MatrixType = 'U' // An upper triangular matrix. - LowerTri MatrixType = 'L' // A lower triangular matrix. -) - -// Pivot specifies the pivot type for plane rotations. -type Pivot byte - -const ( - Variable Pivot = 'V' - Top Pivot = 'T' - Bottom Pivot = 'B' -) - -// ApplyOrtho specifies which orthogonal matrix is applied in Dormbr. -type ApplyOrtho byte - -const ( - ApplyP ApplyOrtho = 'P' // Apply P or Pᵀ. - ApplyQ ApplyOrtho = 'Q' // Apply Q or Qᵀ. -) - -// GenOrtho specifies which orthogonal matrix is generated in Dorgbr. -type GenOrtho byte - -const ( - GeneratePT GenOrtho = 'P' // Generate Pᵀ. - GenerateQ GenOrtho = 'Q' // Generate Q. -) - -// SVDJob specifies the singular vector computation type for SVD. -type SVDJob byte - -const ( - SVDAll SVDJob = 'A' // Compute all columns of the orthogonal matrix U or V. - SVDStore SVDJob = 'S' // Compute the singular vectors and store them in the orthogonal matrix U or V. - SVDOverwrite SVDJob = 'O' // Compute the singular vectors and overwrite them on the input matrix A. - SVDNone SVDJob = 'N' // Do not compute singular vectors. -) - -// GSVDJob specifies the singular vector computation type for Generalized SVD. -type GSVDJob byte - -const ( - GSVDU GSVDJob = 'U' // Compute orthogonal matrix U. - GSVDV GSVDJob = 'V' // Compute orthogonal matrix V. - GSVDQ GSVDJob = 'Q' // Compute orthogonal matrix Q. - GSVDUnit GSVDJob = 'I' // Use unit-initialized matrix. - GSVDNone GSVDJob = 'N' // Do not compute orthogonal matrix. -) - -// EVComp specifies how eigenvectors are computed in Dsteqr. -type EVComp byte - -const ( - EVOrig EVComp = 'V' // Compute eigenvectors of the original symmetric matrix. - EVTridiag EVComp = 'I' // Compute eigenvectors of the tridiagonal matrix. - EVCompNone EVComp = 'N' // Do not compute eigenvectors. -) - -// EVJob specifies whether eigenvectors are computed in Dsyev. -type EVJob byte - -const ( - EVCompute EVJob = 'V' // Compute eigenvectors. - EVNone EVJob = 'N' // Do not compute eigenvectors. -) - -// LeftEVJob specifies whether left eigenvectors are computed in Dgeev. -type LeftEVJob byte - -const ( - LeftEVCompute LeftEVJob = 'V' // Compute left eigenvectors. - LeftEVNone LeftEVJob = 'N' // Do not compute left eigenvectors. -) - -// RightEVJob specifies whether right eigenvectors are computed in Dgeev. -type RightEVJob byte - -const ( - RightEVCompute RightEVJob = 'V' // Compute right eigenvectors. - RightEVNone RightEVJob = 'N' // Do not compute right eigenvectors. -) - -// BalanceJob specifies matrix balancing operation. -type BalanceJob byte - -const ( - Permute BalanceJob = 'P' - Scale BalanceJob = 'S' - PermuteScale BalanceJob = 'B' - BalanceNone BalanceJob = 'N' -) - -// SchurJob specifies whether the Schur form is computed in Dhseqr. -type SchurJob byte - -const ( - EigenvaluesOnly SchurJob = 'E' - EigenvaluesAndSchur SchurJob = 'S' -) - -// SchurComp specifies whether and how the Schur vectors are computed in Dhseqr. -type SchurComp byte - -const ( - SchurOrig SchurComp = 'V' // Compute Schur vectors of the original matrix. - SchurHess SchurComp = 'I' // Compute Schur vectors of the upper Hessenberg matrix. - SchurNone SchurComp = 'N' // Do not compute Schur vectors. -) - -// UpdateSchurComp specifies whether the matrix of Schur vectors is updated in Dtrexc. -type UpdateSchurComp byte - -const ( - UpdateSchur UpdateSchurComp = 'V' // Update the matrix of Schur vectors. - UpdateSchurNone UpdateSchurComp = 'N' // Do not update the matrix of Schur vectors. -) - -// EVSide specifies what eigenvectors are computed in Dtrevc3. -type EVSide byte - -const ( - EVRight EVSide = 'R' // Compute only right eigenvectors. - EVLeft EVSide = 'L' // Compute only left eigenvectors. - EVBoth EVSide = 'B' // Compute both right and left eigenvectors. -) - -// EVHowMany specifies which eigenvectors are computed in Dtrevc3 and how. -type EVHowMany byte - -const ( - EVAll EVHowMany = 'A' // Compute all right and/or left eigenvectors. - EVAllMulQ EVHowMany = 'B' // Compute all right and/or left eigenvectors multiplied by an input matrix. - EVSelected EVHowMany = 'S' // Compute selected right and/or left eigenvectors. -) diff --git a/vendor/gonum.org/v1/gonum/lapack/lapack64/doc.go b/vendor/gonum.org/v1/gonum/lapack/lapack64/doc.go deleted file mode 100644 index da19e3e..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/lapack64/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright ©2017 The Gonum 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 lapack64 provides a set of convenient wrapper functions for LAPACK -// calls, as specified in the netlib standard (www.netlib.org). -// -// The native Go routines are used by default, and the Use function can be used -// to set an alternative implementation. -// -// If the type of matrix (General, Symmetric, etc.) is known and fixed, it is -// used in the wrapper signature. In many cases, however, the type of the matrix -// changes during the call to the routine, for example the matrix is symmetric on -// entry and is triangular on exit. In these cases the correct types should be checked -// in the documentation. -// -// The full set of Lapack functions is very large, and it is not clear that a -// full implementation is desirable, let alone feasible. Please open up an issue -// if there is a specific function you need and/or are willing to implement. -package lapack64 // import "gonum.org/v1/gonum/lapack/lapack64" diff --git a/vendor/gonum.org/v1/gonum/lapack/lapack64/lapack64.go b/vendor/gonum.org/v1/gonum/lapack/lapack64/lapack64.go deleted file mode 100644 index 0aa76b6..0000000 --- a/vendor/gonum.org/v1/gonum/lapack/lapack64/lapack64.go +++ /dev/null @@ -1,581 +0,0 @@ -// Copyright ©2015 The Gonum 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 lapack64 - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" - "gonum.org/v1/gonum/lapack/gonum" -) - -var lapack64 lapack.Float64 = gonum.Implementation{} - -// Use sets the LAPACK float64 implementation to be used by subsequent BLAS calls. -// The default implementation is native.Implementation. -func Use(l lapack.Float64) { - lapack64 = l -} - -func max(a, b int) int { - if a > b { - return a - } - return b -} - -// Potrf computes the Cholesky factorization of a. -// The factorization has the form -// A = Uᵀ * U if a.Uplo == blas.Upper, or -// A = L * Lᵀ if a.Uplo == blas.Lower, -// where U is an upper triangular matrix and L is lower triangular. -// The triangular matrix is returned in t, and the underlying data between -// a and t is shared. The returned bool indicates whether a is positive -// definite and the factorization could be finished. -func Potrf(a blas64.Symmetric) (t blas64.Triangular, ok bool) { - ok = lapack64.Dpotrf(a.Uplo, a.N, a.Data, max(1, a.Stride)) - t.Uplo = a.Uplo - t.N = a.N - t.Data = a.Data - t.Stride = a.Stride - t.Diag = blas.NonUnit - return -} - -// Potri computes the inverse of a real symmetric positive definite matrix A -// using its Cholesky factorization. -// -// On entry, t contains the triangular factor U or L from the Cholesky -// factorization A = Uᵀ*U or A = L*Lᵀ, as computed by Potrf. -// -// On return, the upper or lower triangle of the (symmetric) inverse of A is -// stored in t, overwriting the input factor U or L, and also returned in a. The -// underlying data between a and t is shared. -// -// The returned bool indicates whether the inverse was computed successfully. -func Potri(t blas64.Triangular) (a blas64.Symmetric, ok bool) { - ok = lapack64.Dpotri(t.Uplo, t.N, t.Data, max(1, t.Stride)) - a.Uplo = t.Uplo - a.N = t.N - a.Data = t.Data - a.Stride = t.Stride - return -} - -// Potrs solves a system of n linear equations A*X = B where A is an n×n -// symmetric positive definite matrix and B is an n×nrhs matrix, using the -// Cholesky factorization A = Uᵀ*U or A = L*Lᵀ. t contains the corresponding -// triangular factor as returned by Potrf. On entry, B contains the right-hand -// side matrix B, on return it contains the solution matrix X. -func Potrs(t blas64.Triangular, b blas64.General) { - lapack64.Dpotrs(t.Uplo, t.N, b.Cols, t.Data, max(1, t.Stride), b.Data, max(1, b.Stride)) -} - -// Gecon estimates the reciprocal of the condition number of the n×n matrix A -// given the LU decomposition of the matrix. The condition number computed may -// be based on the 1-norm or the ∞-norm. -// -// a contains the result of the LU decomposition of A as computed by Getrf. -// -// anorm is the corresponding 1-norm or ∞-norm of the original matrix A. -// -// work is a temporary data slice of length at least 4*n and Gecon will panic otherwise. -// -// iwork is a temporary data slice of length at least n and Gecon will panic otherwise. -func Gecon(norm lapack.MatrixNorm, a blas64.General, anorm float64, work []float64, iwork []int) float64 { - return lapack64.Dgecon(norm, a.Cols, a.Data, max(1, a.Stride), anorm, work, iwork) -} - -// Gels finds a minimum-norm solution based on the matrices A and B using the -// QR or LQ factorization. Gels returns false if the matrix -// A is singular, and true if this solution was successfully found. -// -// The minimization problem solved depends on the input parameters. -// -// 1. If m >= n and trans == blas.NoTrans, Gels finds X such that || A*X - B||_2 -// is minimized. -// 2. If m < n and trans == blas.NoTrans, Gels finds the minimum norm solution of -// A * X = B. -// 3. If m >= n and trans == blas.Trans, Gels finds the minimum norm solution of -// Aᵀ * X = B. -// 4. If m < n and trans == blas.Trans, Gels finds X such that || A*X - B||_2 -// is minimized. -// Note that the least-squares solutions (cases 1 and 3) perform the minimization -// per column of B. This is not the same as finding the minimum-norm matrix. -// -// The matrix A is a general matrix of size m×n and is modified during this call. -// The input matrix B is of size max(m,n)×nrhs, and serves two purposes. On entry, -// the elements of b specify the input matrix B. B has size m×nrhs if -// trans == blas.NoTrans, and n×nrhs if trans == blas.Trans. On exit, the -// leading submatrix of b contains the solution vectors X. If trans == blas.NoTrans, -// this submatrix is of size n×nrhs, and of size m×nrhs otherwise. -// -// Work is temporary storage, and lwork specifies the usable memory length. -// At minimum, lwork >= max(m,n) + max(m,n,nrhs), and this function will panic -// otherwise. A longer work will enable blocked algorithms to be called. -// In the special case that lwork == -1, work[0] will be set to the optimal working -// length. -func Gels(trans blas.Transpose, a blas64.General, b blas64.General, work []float64, lwork int) bool { - return lapack64.Dgels(trans, a.Rows, a.Cols, b.Cols, a.Data, max(1, a.Stride), b.Data, max(1, b.Stride), work, lwork) -} - -// Geqrf computes the QR factorization of the m×n matrix A using a blocked -// algorithm. A is modified to contain the information to construct Q and R. -// The upper triangle of a contains the matrix R. The lower triangular elements -// (not including the diagonal) contain the elementary reflectors. tau is modified -// to contain the reflector scales. tau must have length at least min(m,n), and -// this function will panic otherwise. -// -// The ith elementary reflector can be explicitly constructed by first extracting -// the -// v[j] = 0 j < i -// v[j] = 1 j == i -// v[j] = a[j*lda+i] j > i -// and computing H_i = I - tau[i] * v * vᵀ. -// -// The orthonormal matrix Q can be constucted from a product of these elementary -// reflectors, Q = H_0 * H_1 * ... * H_{k-1}, where k = min(m,n). -// -// Work is temporary storage, and lwork specifies the usable memory length. -// At minimum, lwork >= m and this function will panic otherwise. -// Geqrf is a blocked QR factorization, but the block size is limited -// by the temporary space available. If lwork == -1, instead of performing Geqrf, -// the optimal work length will be stored into work[0]. -func Geqrf(a blas64.General, tau, work []float64, lwork int) { - lapack64.Dgeqrf(a.Rows, a.Cols, a.Data, max(1, a.Stride), tau, work, lwork) -} - -// Gelqf computes the LQ factorization of the m×n matrix A using a blocked -// algorithm. A is modified to contain the information to construct L and Q. The -// lower triangle of a contains the matrix L. The elements above the diagonal -// and the slice tau represent the matrix Q. tau is modified to contain the -// reflector scales. tau must have length at least min(m,n), and this function -// will panic otherwise. -// -// See Geqrf for a description of the elementary reflectors and orthonormal -// matrix Q. Q is constructed as a product of these elementary reflectors, -// Q = H_{k-1} * ... * H_1 * H_0. -// -// Work is temporary storage, and lwork specifies the usable memory length. -// At minimum, lwork >= m and this function will panic otherwise. -// Gelqf is a blocked LQ factorization, but the block size is limited -// by the temporary space available. If lwork == -1, instead of performing Gelqf, -// the optimal work length will be stored into work[0]. -func Gelqf(a blas64.General, tau, work []float64, lwork int) { - lapack64.Dgelqf(a.Rows, a.Cols, a.Data, max(1, a.Stride), tau, work, lwork) -} - -// Gesvd computes the singular value decomposition of the input matrix A. -// -// The singular value decomposition is -// A = U * Sigma * Vᵀ -// where Sigma is an m×n diagonal matrix containing the singular values of A, -// U is an m×m orthogonal matrix and V is an n×n orthogonal matrix. The first -// min(m,n) columns of U and V are the left and right singular vectors of A -// respectively. -// -// jobU and jobVT are options for computing the singular vectors. The behavior -// is as follows -// jobU == lapack.SVDAll All m columns of U are returned in u -// jobU == lapack.SVDStore The first min(m,n) columns are returned in u -// jobU == lapack.SVDOverwrite The first min(m,n) columns of U are written into a -// jobU == lapack.SVDNone The columns of U are not computed. -// The behavior is the same for jobVT and the rows of Vᵀ. At most one of jobU -// and jobVT can equal lapack.SVDOverwrite, and Gesvd will panic otherwise. -// -// On entry, a contains the data for the m×n matrix A. During the call to Gesvd -// the data is overwritten. On exit, A contains the appropriate singular vectors -// if either job is lapack.SVDOverwrite. -// -// s is a slice of length at least min(m,n) and on exit contains the singular -// values in decreasing order. -// -// u contains the left singular vectors on exit, stored columnwise. If -// jobU == lapack.SVDAll, u is of size m×m. If jobU == lapack.SVDStore u is -// of size m×min(m,n). If jobU == lapack.SVDOverwrite or lapack.SVDNone, u is -// not used. -// -// vt contains the left singular vectors on exit, stored rowwise. If -// jobV == lapack.SVDAll, vt is of size n×m. If jobVT == lapack.SVDStore vt is -// of size min(m,n)×n. If jobVT == lapack.SVDOverwrite or lapack.SVDNone, vt is -// not used. -// -// work is a slice for storing temporary memory, and lwork is the usable size of -// the slice. lwork must be at least max(5*min(m,n), 3*min(m,n)+max(m,n)). -// If lwork == -1, instead of performing Gesvd, the optimal work length will be -// stored into work[0]. Gesvd will panic if the working memory has insufficient -// storage. -// -// Gesvd returns whether the decomposition successfully completed. -func Gesvd(jobU, jobVT lapack.SVDJob, a, u, vt blas64.General, s, work []float64, lwork int) (ok bool) { - return lapack64.Dgesvd(jobU, jobVT, a.Rows, a.Cols, a.Data, max(1, a.Stride), s, u.Data, max(1, u.Stride), vt.Data, max(1, vt.Stride), work, lwork) -} - -// Getrf computes the LU decomposition of the m×n matrix A. -// The LU decomposition is a factorization of A into -// A = P * L * U -// where P is a permutation matrix, L is a unit lower triangular matrix, and -// U is a (usually) non-unit upper triangular matrix. On exit, L and U are stored -// in place into a. -// -// ipiv is a permutation vector. It indicates that row i of the matrix was -// changed with ipiv[i]. ipiv must have length at least min(m,n), and will panic -// otherwise. ipiv is zero-indexed. -// -// Getrf is the blocked version of the algorithm. -// -// Getrf returns whether the matrix A is singular. The LU decomposition will -// be computed regardless of the singularity of A, but division by zero -// will occur if the false is returned and the result is used to solve a -// system of equations. -func Getrf(a blas64.General, ipiv []int) bool { - return lapack64.Dgetrf(a.Rows, a.Cols, a.Data, max(1, a.Stride), ipiv) -} - -// Getri computes the inverse of the matrix A using the LU factorization computed -// by Getrf. On entry, a contains the PLU decomposition of A as computed by -// Getrf and on exit contains the reciprocal of the original matrix. -// -// Getri will not perform the inversion if the matrix is singular, and returns -// a boolean indicating whether the inversion was successful. -// -// Work is temporary storage, and lwork specifies the usable memory length. -// At minimum, lwork >= n and this function will panic otherwise. -// Getri is a blocked inversion, but the block size is limited -// by the temporary space available. If lwork == -1, instead of performing Getri, -// the optimal work length will be stored into work[0]. -func Getri(a blas64.General, ipiv []int, work []float64, lwork int) (ok bool) { - return lapack64.Dgetri(a.Cols, a.Data, max(1, a.Stride), ipiv, work, lwork) -} - -// Getrs solves a system of equations using an LU factorization. -// The system of equations solved is -// A * X = B if trans == blas.Trans -// Aᵀ * X = B if trans == blas.NoTrans -// A is a general n×n matrix with stride lda. B is a general matrix of size n×nrhs. -// -// On entry b contains the elements of the matrix B. On exit, b contains the -// elements of X, the solution to the system of equations. -// -// a and ipiv contain the LU factorization of A and the permutation indices as -// computed by Getrf. ipiv is zero-indexed. -func Getrs(trans blas.Transpose, a blas64.General, b blas64.General, ipiv []int) { - lapack64.Dgetrs(trans, a.Cols, b.Cols, a.Data, max(1, a.Stride), ipiv, b.Data, max(1, b.Stride)) -} - -// Ggsvd3 computes the generalized singular value decomposition (GSVD) -// of an m×n matrix A and p×n matrix B: -// Uᵀ*A*Q = D1*[ 0 R ] -// -// Vᵀ*B*Q = D2*[ 0 R ] -// where U, V and Q are orthogonal matrices. -// -// Ggsvd3 returns k and l, the dimensions of the sub-blocks. k+l -// is the effective numerical rank of the (m+p)×n matrix [ Aᵀ Bᵀ ]ᵀ. -// R is a (k+l)×(k+l) nonsingular upper triangular matrix, D1 and -// D2 are m×(k+l) and p×(k+l) diagonal matrices and of the following -// structures, respectively: -// -// If m-k-l >= 0, -// -// k l -// D1 = k [ I 0 ] -// l [ 0 C ] -// m-k-l [ 0 0 ] -// -// k l -// D2 = l [ 0 S ] -// p-l [ 0 0 ] -// -// n-k-l k l -// [ 0 R ] = k [ 0 R11 R12 ] k -// l [ 0 0 R22 ] l -// -// where -// -// C = diag( alpha_k, ... , alpha_{k+l} ), -// S = diag( beta_k, ... , beta_{k+l} ), -// C^2 + S^2 = I. -// -// R is stored in -// A[0:k+l, n-k-l:n] -// on exit. -// -// If m-k-l < 0, -// -// k m-k k+l-m -// D1 = k [ I 0 0 ] -// m-k [ 0 C 0 ] -// -// k m-k k+l-m -// D2 = m-k [ 0 S 0 ] -// k+l-m [ 0 0 I ] -// p-l [ 0 0 0 ] -// -// n-k-l k m-k k+l-m -// [ 0 R ] = k [ 0 R11 R12 R13 ] -// m-k [ 0 0 R22 R23 ] -// k+l-m [ 0 0 0 R33 ] -// -// where -// C = diag( alpha_k, ... , alpha_m ), -// S = diag( beta_k, ... , beta_m ), -// C^2 + S^2 = I. -// -// R = [ R11 R12 R13 ] is stored in A[1:m, n-k-l+1:n] -// [ 0 R22 R23 ] -// and R33 is stored in -// B[m-k:l, n+m-k-l:n] on exit. -// -// Ggsvd3 computes C, S, R, and optionally the orthogonal transformation -// matrices U, V and Q. -// -// jobU, jobV and jobQ are options for computing the orthogonal matrices. The behavior -// is as follows -// jobU == lapack.GSVDU Compute orthogonal matrix U -// jobU == lapack.GSVDNone Do not compute orthogonal matrix. -// The behavior is the same for jobV and jobQ with the exception that instead of -// lapack.GSVDU these accept lapack.GSVDV and lapack.GSVDQ respectively. -// The matrices U, V and Q must be m×m, p×p and n×n respectively unless the -// relevant job parameter is lapack.GSVDNone. -// -// alpha and beta must have length n or Ggsvd3 will panic. On exit, alpha and -// beta contain the generalized singular value pairs of A and B -// alpha[0:k] = 1, -// beta[0:k] = 0, -// if m-k-l >= 0, -// alpha[k:k+l] = diag(C), -// beta[k:k+l] = diag(S), -// if m-k-l < 0, -// alpha[k:m]= C, alpha[m:k+l]= 0 -// beta[k:m] = S, beta[m:k+l] = 1. -// if k+l < n, -// alpha[k+l:n] = 0 and -// beta[k+l:n] = 0. -// -// On exit, iwork contains the permutation required to sort alpha descending. -// -// iwork must have length n, work must have length at least max(1, lwork), and -// lwork must be -1 or greater than n, otherwise Ggsvd3 will panic. If -// lwork is -1, work[0] holds the optimal lwork on return, but Ggsvd3 does -// not perform the GSVD. -func Ggsvd3(jobU, jobV, jobQ lapack.GSVDJob, a, b blas64.General, alpha, beta []float64, u, v, q blas64.General, work []float64, lwork int, iwork []int) (k, l int, ok bool) { - return lapack64.Dggsvd3(jobU, jobV, jobQ, a.Rows, a.Cols, b.Rows, a.Data, max(1, a.Stride), b.Data, max(1, b.Stride), alpha, beta, u.Data, max(1, u.Stride), v.Data, max(1, v.Stride), q.Data, max(1, q.Stride), work, lwork, iwork) -} - -// Lange computes the matrix norm of the general m×n matrix A. The input norm -// specifies the norm computed. -// lapack.MaxAbs: the maximum absolute value of an element. -// lapack.MaxColumnSum: the maximum column sum of the absolute values of the entries. -// lapack.MaxRowSum: the maximum row sum of the absolute values of the entries. -// lapack.Frobenius: the square root of the sum of the squares of the entries. -// If norm == lapack.MaxColumnSum, work must be of length n, and this function will panic otherwise. -// There are no restrictions on work for the other matrix norms. -func Lange(norm lapack.MatrixNorm, a blas64.General, work []float64) float64 { - return lapack64.Dlange(norm, a.Rows, a.Cols, a.Data, max(1, a.Stride), work) -} - -// Lansy computes the specified norm of an n×n symmetric matrix. If -// norm == lapack.MaxColumnSum or norm == lapackMaxRowSum work must have length -// at least n and this function will panic otherwise. -// There are no restrictions on work for the other matrix norms. -func Lansy(norm lapack.MatrixNorm, a blas64.Symmetric, work []float64) float64 { - return lapack64.Dlansy(norm, a.Uplo, a.N, a.Data, max(1, a.Stride), work) -} - -// Lantr computes the specified norm of an m×n trapezoidal matrix A. If -// norm == lapack.MaxColumnSum work must have length at least n and this function -// will panic otherwise. There are no restrictions on work for the other matrix norms. -func Lantr(norm lapack.MatrixNorm, a blas64.Triangular, work []float64) float64 { - return lapack64.Dlantr(norm, a.Uplo, a.Diag, a.N, a.N, a.Data, max(1, a.Stride), work) -} - -// Lapmt rearranges the columns of the m×n matrix X as specified by the -// permutation k_0, k_1, ..., k_{n-1} of the integers 0, ..., n-1. -// -// If forward is true a forward permutation is performed: -// -// X[0:m, k[j]] is moved to X[0:m, j] for j = 0, 1, ..., n-1. -// -// otherwise a backward permutation is performed: -// -// X[0:m, j] is moved to X[0:m, k[j]] for j = 0, 1, ..., n-1. -// -// k must have length n, otherwise Lapmt will panic. k is zero-indexed. -func Lapmt(forward bool, x blas64.General, k []int) { - lapack64.Dlapmt(forward, x.Rows, x.Cols, x.Data, max(1, x.Stride), k) -} - -// Ormlq multiplies the matrix C by the othogonal matrix Q defined by -// A and tau. A and tau are as returned from Gelqf. -// C = Q * C if side == blas.Left and trans == blas.NoTrans -// C = Qᵀ * C if side == blas.Left and trans == blas.Trans -// C = C * Q if side == blas.Right and trans == blas.NoTrans -// C = C * Qᵀ if side == blas.Right and trans == blas.Trans -// If side == blas.Left, A is a matrix of side k×m, and if side == blas.Right -// A is of size k×n. This uses a blocked algorithm. -// -// Work is temporary storage, and lwork specifies the usable memory length. -// At minimum, lwork >= m if side == blas.Left and lwork >= n if side == blas.Right, -// and this function will panic otherwise. -// Ormlq uses a block algorithm, but the block size is limited -// by the temporary space available. If lwork == -1, instead of performing Ormlq, -// the optimal work length will be stored into work[0]. -// -// Tau contains the Householder scales and must have length at least k, and -// this function will panic otherwise. -func Ormlq(side blas.Side, trans blas.Transpose, a blas64.General, tau []float64, c blas64.General, work []float64, lwork int) { - lapack64.Dormlq(side, trans, c.Rows, c.Cols, a.Rows, a.Data, max(1, a.Stride), tau, c.Data, max(1, c.Stride), work, lwork) -} - -// Ormqr multiplies an m×n matrix C by an orthogonal matrix Q as -// C = Q * C if side == blas.Left and trans == blas.NoTrans, -// C = Qᵀ * C if side == blas.Left and trans == blas.Trans, -// C = C * Q if side == blas.Right and trans == blas.NoTrans, -// C = C * Qᵀ if side == blas.Right and trans == blas.Trans, -// where Q is defined as the product of k elementary reflectors -// Q = H_0 * H_1 * ... * H_{k-1}. -// -// If side == blas.Left, A is an m×k matrix and 0 <= k <= m. -// If side == blas.Right, A is an n×k matrix and 0 <= k <= n. -// The ith column of A contains the vector which defines the elementary -// reflector H_i and tau[i] contains its scalar factor. tau must have length k -// and Ormqr will panic otherwise. Geqrf returns A and tau in the required -// form. -// -// work must have length at least max(1,lwork), and lwork must be at least n if -// side == blas.Left and at least m if side == blas.Right, otherwise Ormqr will -// panic. -// -// work is temporary storage, and lwork specifies the usable memory length. At -// minimum, lwork >= m if side == blas.Left and lwork >= n if side == -// blas.Right, and this function will panic otherwise. Larger values of lwork -// will generally give better performance. On return, work[0] will contain the -// optimal value of lwork. -// -// If lwork is -1, instead of performing Ormqr, the optimal workspace size will -// be stored into work[0]. -func Ormqr(side blas.Side, trans blas.Transpose, a blas64.General, tau []float64, c blas64.General, work []float64, lwork int) { - lapack64.Dormqr(side, trans, c.Rows, c.Cols, a.Cols, a.Data, max(1, a.Stride), tau, c.Data, max(1, c.Stride), work, lwork) -} - -// Pocon estimates the reciprocal of the condition number of a positive-definite -// matrix A given the Cholesky decmposition of A. The condition number computed -// is based on the 1-norm and the ∞-norm. -// -// anorm is the 1-norm and the ∞-norm of the original matrix A. -// -// work is a temporary data slice of length at least 3*n and Pocon will panic otherwise. -// -// iwork is a temporary data slice of length at least n and Pocon will panic otherwise. -func Pocon(a blas64.Symmetric, anorm float64, work []float64, iwork []int) float64 { - return lapack64.Dpocon(a.Uplo, a.N, a.Data, max(1, a.Stride), anorm, work, iwork) -} - -// Syev computes all eigenvalues and, optionally, the eigenvectors of a real -// symmetric matrix A. -// -// w contains the eigenvalues in ascending order upon return. w must have length -// at least n, and Syev will panic otherwise. -// -// On entry, a contains the elements of the symmetric matrix A in the triangular -// portion specified by uplo. If jobz == lapack.EVCompute, a contains the -// orthonormal eigenvectors of A on exit, otherwise jobz must be lapack.EVNone -// and on exit the specified triangular region is overwritten. -// -// Work is temporary storage, and lwork specifies the usable memory length. At minimum, -// lwork >= 3*n-1, and Syev will panic otherwise. The amount of blocking is -// limited by the usable length. If lwork == -1, instead of computing Syev the -// optimal work length is stored into work[0]. -func Syev(jobz lapack.EVJob, a blas64.Symmetric, w, work []float64, lwork int) (ok bool) { - return lapack64.Dsyev(jobz, a.Uplo, a.N, a.Data, max(1, a.Stride), w, work, lwork) -} - -// Trcon estimates the reciprocal of the condition number of a triangular matrix A. -// The condition number computed may be based on the 1-norm or the ∞-norm. -// -// work is a temporary data slice of length at least 3*n and Trcon will panic otherwise. -// -// iwork is a temporary data slice of length at least n and Trcon will panic otherwise. -func Trcon(norm lapack.MatrixNorm, a blas64.Triangular, work []float64, iwork []int) float64 { - return lapack64.Dtrcon(norm, a.Uplo, a.Diag, a.N, a.Data, max(1, a.Stride), work, iwork) -} - -// Trtri computes the inverse of a triangular matrix, storing the result in place -// into a. -// -// Trtri will not perform the inversion if the matrix is singular, and returns -// a boolean indicating whether the inversion was successful. -func Trtri(a blas64.Triangular) (ok bool) { - return lapack64.Dtrtri(a.Uplo, a.Diag, a.N, a.Data, max(1, a.Stride)) -} - -// Trtrs solves a triangular system of the form A * X = B or Aᵀ * X = B. Trtrs -// returns whether the solve completed successfully. If A is singular, no solve is performed. -func Trtrs(trans blas.Transpose, a blas64.Triangular, b blas64.General) (ok bool) { - return lapack64.Dtrtrs(a.Uplo, trans, a.Diag, a.N, b.Cols, a.Data, max(1, a.Stride), b.Data, max(1, b.Stride)) -} - -// Geev computes the eigenvalues and, optionally, the left and/or right -// eigenvectors for an n×n real nonsymmetric matrix A. -// -// The right eigenvector v_j of A corresponding to an eigenvalue λ_j -// is defined by -// A v_j = λ_j v_j, -// and the left eigenvector u_j corresponding to an eigenvalue λ_j is defined by -// u_jᴴ A = λ_j u_jᴴ, -// where u_jᴴ is the conjugate transpose of u_j. -// -// On return, A will be overwritten and the left and right eigenvectors will be -// stored, respectively, in the columns of the n×n matrices VL and VR in the -// same order as their eigenvalues. If the j-th eigenvalue is real, then -// u_j = VL[:,j], -// v_j = VR[:,j], -// and if it is not real, then j and j+1 form a complex conjugate pair and the -// eigenvectors can be recovered as -// u_j = VL[:,j] + i*VL[:,j+1], -// u_{j+1} = VL[:,j] - i*VL[:,j+1], -// v_j = VR[:,j] + i*VR[:,j+1], -// v_{j+1} = VR[:,j] - i*VR[:,j+1], -// where i is the imaginary unit. The computed eigenvectors are normalized to -// have Euclidean norm equal to 1 and largest component real. -// -// Left eigenvectors will be computed only if jobvl == lapack.LeftEVCompute, -// otherwise jobvl must be lapack.LeftEVNone. -// Right eigenvectors will be computed only if jobvr == lapack.RightEVCompute, -// otherwise jobvr must be lapack.RightEVNone. -// For other values of jobvl and jobvr Geev will panic. -// -// On return, wr and wi will contain the real and imaginary parts, respectively, -// of the computed eigenvalues. Complex conjugate pairs of eigenvalues appear -// consecutively with the eigenvalue having the positive imaginary part first. -// wr and wi must have length n, and Geev will panic otherwise. -// -// work must have length at least lwork and lwork must be at least max(1,4*n) if -// the left or right eigenvectors are computed, and at least max(1,3*n) if no -// eigenvectors are computed. For good performance, lwork must generally be -// larger. On return, optimal value of lwork will be stored in work[0]. -// -// If lwork == -1, instead of performing Geev, the function only calculates the -// optimal vaule of lwork and stores it into work[0]. -// -// On return, first will be the index of the first valid eigenvalue. -// If first == 0, all eigenvalues and eigenvectors have been computed. -// If first is positive, Geev failed to compute all the eigenvalues, no -// eigenvectors have been computed and wr[first:] and wi[first:] contain those -// eigenvalues which have converged. -func Geev(jobvl lapack.LeftEVJob, jobvr lapack.RightEVJob, a blas64.General, wr, wi []float64, vl, vr blas64.General, work []float64, lwork int) (first int) { - n := a.Rows - if a.Cols != n { - panic("lapack64: matrix not square") - } - if jobvl == lapack.LeftEVCompute && (vl.Rows != n || vl.Cols != n) { - panic("lapack64: bad size of VL") - } - if jobvr == lapack.RightEVCompute && (vr.Rows != n || vr.Cols != n) { - panic("lapack64: bad size of VR") - } - return lapack64.Dgeev(jobvl, jobvr, n, a.Data, max(1, a.Stride), wr, wi, vl.Data, max(1, vl.Stride), vr.Data, max(1, vr.Stride), work, lwork) -} diff --git a/vendor/gonum.org/v1/gonum/mat/README.md b/vendor/gonum.org/v1/gonum/mat/README.md deleted file mode 100644 index 0f77e47..0000000 --- a/vendor/gonum.org/v1/gonum/mat/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Gonum matrix [![GoDoc](https://godoc.org/gonum.org/v1/gonum/mat?status.svg)](https://godoc.org/gonum.org/v1/gonum/mat) - -Package mat is a matrix package for the Go language. diff --git a/vendor/gonum.org/v1/gonum/mat/band.go b/vendor/gonum.org/v1/gonum/mat/band.go deleted file mode 100644 index b8994b4..0000000 --- a/vendor/gonum.org/v1/gonum/mat/band.go +++ /dev/null @@ -1,335 +0,0 @@ -// Copyright ©2017 The Gonum 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 mat - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -var ( - bandDense *BandDense - _ Matrix = bandDense - _ allMatrix = bandDense - _ denseMatrix = bandDense - _ Banded = bandDense - _ RawBander = bandDense - - _ NonZeroDoer = bandDense - _ RowNonZeroDoer = bandDense - _ ColNonZeroDoer = bandDense -) - -// BandDense represents a band matrix in dense storage format. -type BandDense struct { - mat blas64.Band -} - -// Banded is a band matrix representation. -type Banded interface { - Matrix - // Bandwidth returns the lower and upper bandwidth values for - // the matrix. The total bandwidth of the matrix is kl+ku+1. - Bandwidth() (kl, ku int) - - // TBand is the equivalent of the T() method in the Matrix - // interface but guarantees the transpose is of banded type. - TBand() Banded -} - -// A RawBander can return a blas64.Band representation of the receiver. -// Changes to the blas64.Band.Data slice will be reflected in the original -// matrix, changes to the Rows, Cols, KL, KU and Stride fields will not. -type RawBander interface { - RawBand() blas64.Band -} - -// A MutableBanded can set elements of a band matrix. -type MutableBanded interface { - Banded - SetBand(i, j int, v float64) -} - -var ( - _ Matrix = TransposeBand{} - _ Banded = TransposeBand{} - _ UntransposeBander = TransposeBand{} -) - -// TransposeBand is a type for performing an implicit transpose of a band -// matrix. It implements the Banded interface, returning values from the -// transpose of the matrix within. -type TransposeBand struct { - Banded Banded -} - -// At returns the value of the element at row i and column j of the transposed -// matrix, that is, row j and column i of the Banded field. -func (t TransposeBand) At(i, j int) float64 { - return t.Banded.At(j, i) -} - -// Dims returns the dimensions of the transposed matrix. -func (t TransposeBand) Dims() (r, c int) { - c, r = t.Banded.Dims() - return r, c -} - -// T performs an implicit transpose by returning the Banded field. -func (t TransposeBand) T() Matrix { - return t.Banded -} - -// Bandwidth returns the lower and upper bandwidth values for -// the transposed matrix. -func (t TransposeBand) Bandwidth() (kl, ku int) { - kl, ku = t.Banded.Bandwidth() - return ku, kl -} - -// TBand performs an implicit transpose by returning the Banded field. -func (t TransposeBand) TBand() Banded { - return t.Banded -} - -// Untranspose returns the Banded field. -func (t TransposeBand) Untranspose() Matrix { - return t.Banded -} - -// UntransposeBand returns the Banded field. -func (t TransposeBand) UntransposeBand() Banded { - return t.Banded -} - -// NewBandDense creates a new Band matrix with r rows and c columns. If data == nil, -// a new slice is allocated for the backing slice. If len(data) == min(r, c+kl)*(kl+ku+1), -// data is used as the backing slice, and changes to the elements of the returned -// BandDense will be reflected in data. If neither of these is true, NewBandDense -// will panic. kl must be at least zero and less r, and ku must be at least zero and -// less than c, otherwise NewBandDense will panic. -// NewBandDense will panic if either r or c is zero. -// -// The data must be arranged in row-major order constructed by removing the zeros -// from the rows outside the band and aligning the diagonals. For example, the matrix -// 1 2 3 0 0 0 -// 4 5 6 7 0 0 -// 0 8 9 10 11 0 -// 0 0 12 13 14 15 -// 0 0 0 16 17 18 -// 0 0 0 0 19 20 -// becomes (* entries are never accessed) -// * 1 2 3 -// 4 5 6 7 -// 8 9 10 11 -// 12 13 14 15 -// 16 17 18 * -// 19 20 * * -// which is passed to NewBandDense as []float64{*, 1, 2, 3, 4, ...} with kl=1 and ku=2. -// Only the values in the band portion of the matrix are used. -func NewBandDense(r, c, kl, ku int, data []float64) *BandDense { - if r <= 0 || c <= 0 || kl < 0 || ku < 0 { - if r == 0 || c == 0 { - panic(ErrZeroLength) - } - panic("mat: negative dimension") - } - if kl+1 > r || ku+1 > c { - panic("mat: band out of range") - } - bc := kl + ku + 1 - if data != nil && len(data) != min(r, c+kl)*bc { - panic(ErrShape) - } - if data == nil { - data = make([]float64, min(r, c+kl)*bc) - } - return &BandDense{ - mat: blas64.Band{ - Rows: r, - Cols: c, - KL: kl, - KU: ku, - Stride: bc, - Data: data, - }, - } -} - -// NewDiagonalRect is a convenience function that returns a diagonal matrix represented by a -// BandDense. The length of data must be min(r, c) otherwise NewDiagonalRect will panic. -func NewDiagonalRect(r, c int, data []float64) *BandDense { - return NewBandDense(r, c, 0, 0, data) -} - -// Dims returns the number of rows and columns in the matrix. -func (b *BandDense) Dims() (r, c int) { - return b.mat.Rows, b.mat.Cols -} - -// Bandwidth returns the upper and lower bandwidths of the matrix. -func (b *BandDense) Bandwidth() (kl, ku int) { - return b.mat.KL, b.mat.KU -} - -// T performs an implicit transpose by returning the receiver inside a Transpose. -func (b *BandDense) T() Matrix { - return Transpose{b} -} - -// TBand performs an implicit transpose by returning the receiver inside a TransposeBand. -func (b *BandDense) TBand() Banded { - return TransposeBand{b} -} - -// RawBand returns the underlying blas64.Band used by the receiver. -// Changes to elements in the receiver following the call will be reflected -// in returned blas64.Band. -func (b *BandDense) RawBand() blas64.Band { - return b.mat -} - -// SetRawBand sets the underlying blas64.Band used by the receiver. -// Changes to elements in the receiver following the call will be reflected -// in the input. -func (b *BandDense) SetRawBand(mat blas64.Band) { - b.mat = mat -} - -// IsEmpty returns whether the receiver is empty. Empty matrices can be the -// receiver for size-restricted operations. The receiver can be zeroed using Reset. -func (b *BandDense) IsEmpty() bool { - return b.mat.Stride == 0 -} - -// Reset empties the matrix so that it can be reused as the -// receiver of a dimensionally restricted operation. -// -// Reset should not be used when the matrix shares backing data. -// See the Reseter interface for more information. -func (b *BandDense) Reset() { - b.mat.Rows = 0 - b.mat.Cols = 0 - b.mat.KL = 0 - b.mat.KU = 0 - b.mat.Stride = 0 - b.mat.Data = b.mat.Data[:0:0] -} - -// DiagView returns the diagonal as a matrix backed by the original data. -func (b *BandDense) DiagView() Diagonal { - n := min(b.mat.Rows, b.mat.Cols) - return &DiagDense{ - mat: blas64.Vector{ - N: n, - Inc: b.mat.Stride, - Data: b.mat.Data[b.mat.KL : (n-1)*b.mat.Stride+b.mat.KL+1], - }, - } -} - -// DoNonZero calls the function fn for each of the non-zero elements of b. The function fn -// takes a row/column index and the element value of b at (i, j). -func (b *BandDense) DoNonZero(fn func(i, j int, v float64)) { - for i := 0; i < min(b.mat.Rows, b.mat.Cols+b.mat.KL); i++ { - for j := max(0, i-b.mat.KL); j < min(b.mat.Cols, i+b.mat.KU+1); j++ { - v := b.at(i, j) - if v != 0 { - fn(i, j, v) - } - } - } -} - -// DoRowNonZero calls the function fn for each of the non-zero elements of row i of b. The function fn -// takes a row/column index and the element value of b at (i, j). -func (b *BandDense) DoRowNonZero(i int, fn func(i, j int, v float64)) { - if i < 0 || b.mat.Rows <= i { - panic(ErrRowAccess) - } - for j := max(0, i-b.mat.KL); j < min(b.mat.Cols, i+b.mat.KU+1); j++ { - v := b.at(i, j) - if v != 0 { - fn(i, j, v) - } - } -} - -// DoColNonZero calls the function fn for each of the non-zero elements of column j of b. The function fn -// takes a row/column index and the element value of b at (i, j). -func (b *BandDense) DoColNonZero(j int, fn func(i, j int, v float64)) { - if j < 0 || b.mat.Cols <= j { - panic(ErrColAccess) - } - for i := 0; i < min(b.mat.Rows, b.mat.Cols+b.mat.KL); i++ { - if i-b.mat.KL <= j && j < i+b.mat.KU+1 { - v := b.at(i, j) - if v != 0 { - fn(i, j, v) - } - } - } -} - -// Zero sets all of the matrix elements to zero. -func (b *BandDense) Zero() { - m := b.mat.Rows - kL := b.mat.KL - nCol := b.mat.KU + 1 + kL - for i := 0; i < m; i++ { - l := max(0, kL-i) - u := min(nCol, m+kL-i) - zero(b.mat.Data[i*b.mat.Stride+l : i*b.mat.Stride+u]) - } -} - -// Trace computes the trace of the matrix. -func (b *BandDense) Trace() float64 { - r, c := b.Dims() - if r != c { - panic(ErrShape) - } - rb := b.RawBand() - var tr float64 - for i := 0; i < r; i++ { - tr += rb.Data[rb.KL+i*rb.Stride] - } - return tr -} - -// MulVecTo computes B⋅x or Bᵀ⋅x storing the result into dst. -func (b *BandDense) MulVecTo(dst *VecDense, trans bool, x Vector) { - m, n := b.Dims() - if trans { - m, n = n, m - } - if x.Len() != n { - panic(ErrShape) - } - dst.reuseAsNonZeroed(m) - - t := blas.NoTrans - if trans { - t = blas.Trans - } - - xMat, _ := untransposeExtract(x) - if xVec, ok := xMat.(*VecDense); ok { - if dst != xVec { - dst.checkOverlap(xVec.mat) - blas64.Gbmv(t, 1, b.mat, xVec.mat, 0, dst.mat) - } else { - xCopy := getWorkspaceVec(n, false) - xCopy.CloneVec(xVec) - blas64.Gbmv(t, 1, b.mat, xCopy.mat, 0, dst.mat) - putWorkspaceVec(xCopy) - } - } else { - xCopy := getWorkspaceVec(n, false) - xCopy.CloneVec(x) - blas64.Gbmv(t, 1, b.mat, xCopy.mat, 0, dst.mat) - putWorkspaceVec(xCopy) - } -} diff --git a/vendor/gonum.org/v1/gonum/mat/cdense.go b/vendor/gonum.org/v1/gonum/mat/cdense.go deleted file mode 100644 index 4a1b453..0000000 --- a/vendor/gonum.org/v1/gonum/mat/cdense.go +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright ©2019 The Gonum 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 mat - -import "gonum.org/v1/gonum/blas/cblas128" - -var ( - cDense *CDense - - _ CMatrix = cDense - _ allMatrix = cDense -) - -// CDense is a dense matrix representation with complex data. -type CDense struct { - mat cblas128.General - - capRows, capCols int -} - -// Dims returns the number of rows and columns in the matrix. -func (m *CDense) Dims() (r, c int) { - return m.mat.Rows, m.mat.Cols -} - -// H performs an implicit conjugate transpose by returning the receiver inside a -// Conjugate. -func (m *CDense) H() CMatrix { - return Conjugate{m} -} - -// NewCDense creates a new complex Dense matrix with r rows and c columns. -// If data == nil, a new slice is allocated for the backing slice. -// If len(data) == r*c, data is used as the backing slice, and changes to the -// elements of the returned CDense will be reflected in data. -// If neither of these is true, NewCDense will panic. -// NewCDense will panic if either r or c is zero. -// -// The data must be arranged in row-major order, i.e. the (i*c + j)-th -// element in the data slice is the {i, j}-th element in the matrix. -func NewCDense(r, c int, data []complex128) *CDense { - if r <= 0 || c <= 0 { - if r == 0 || c == 0 { - panic(ErrZeroLength) - } - panic("mat: negative dimension") - } - if data != nil && r*c != len(data) { - panic(ErrShape) - } - if data == nil { - data = make([]complex128, r*c) - } - return &CDense{ - mat: cblas128.General{ - Rows: r, - Cols: c, - Stride: c, - Data: data, - }, - capRows: r, - capCols: c, - } -} - -// ReuseAs changes the receiver if it IsEmpty() to be of size r×c. -// -// ReuseAs re-uses the backing data slice if it has sufficient capacity, -// otherwise a new slice is allocated. The backing data is zero on return. -// -// ReuseAs panics if the receiver is not empty, and panics if -// the input sizes are less than one. To empty the receiver for re-use, -// Reset should be used. -func (m *CDense) ReuseAs(r, c int) { - if r <= 0 || c <= 0 { - if r == 0 || c == 0 { - panic(ErrZeroLength) - } - panic(ErrNegativeDimension) - } - if !m.IsEmpty() { - panic(ErrReuseNonEmpty) - } - m.reuseAsZeroed(r, c) -} - -// reuseAs resizes an empty matrix to a r×c matrix, -// or checks that a non-empty matrix is r×c. -// -// reuseAs must be kept in sync with reuseAsZeroed. -func (m *CDense) reuseAsNonZeroed(r, c int) { - if m.mat.Rows > m.capRows || m.mat.Cols > m.capCols { - // Panic as a string, not a mat.Error. - panic("mat: caps not correctly set") - } - if r == 0 || c == 0 { - panic(ErrZeroLength) - } - if m.IsEmpty() { - m.mat = cblas128.General{ - Rows: r, - Cols: c, - Stride: c, - Data: useC(m.mat.Data, r*c), - } - m.capRows = r - m.capCols = c - return - } - if r != m.mat.Rows || c != m.mat.Cols { - panic(ErrShape) - } -} - -func (m *CDense) reuseAsZeroed(r, c int) { - // This must be kept in-sync with reuseAs. - if m.mat.Rows > m.capRows || m.mat.Cols > m.capCols { - // Panic as a string, not a mat.Error. - panic("mat: caps not correctly set") - } - if r == 0 || c == 0 { - panic(ErrZeroLength) - } - if m.IsEmpty() { - m.mat = cblas128.General{ - Rows: r, - Cols: c, - Stride: c, - Data: useZeroedC(m.mat.Data, r*c), - } - m.capRows = r - m.capCols = c - return - } - if r != m.mat.Rows || c != m.mat.Cols { - panic(ErrShape) - } - m.Zero() -} - -// Reset zeros the dimensions of the matrix so that it can be reused as the -// receiver of a dimensionally restricted operation. -// -// Reset should not be used when the matrix shares backing data. -// See the Reseter interface for more information. -func (m *CDense) Reset() { - // Row, Cols and Stride must be zeroed in unison. - m.mat.Rows, m.mat.Cols, m.mat.Stride = 0, 0, 0 - m.capRows, m.capCols = 0, 0 - m.mat.Data = m.mat.Data[:0] -} - -// IsEmpty returns whether the receiver is empty. Empty matrices can be the -// receiver for size-restricted operations. The receiver can be zeroed using Reset. -func (m *CDense) IsEmpty() bool { - // It must be the case that m.Dims() returns - // zeros in this case. See comment in Reset(). - return m.mat.Stride == 0 -} - -// Zero sets all of the matrix elements to zero. -func (m *CDense) Zero() { - r := m.mat.Rows - c := m.mat.Cols - for i := 0; i < r; i++ { - zeroC(m.mat.Data[i*m.mat.Stride : i*m.mat.Stride+c]) - } -} - -// Copy makes a copy of elements of a into the receiver. It is similar to the -// built-in copy; it copies as much as the overlap between the two matrices and -// returns the number of rows and columns it copied. If a aliases the receiver -// and is a transposed Dense or VecDense, with a non-unitary increment, Copy will -// panic. -// -// See the Copier interface for more information. -func (m *CDense) Copy(a CMatrix) (r, c int) { - r, c = a.Dims() - if a == m { - return r, c - } - r = min(r, m.mat.Rows) - c = min(c, m.mat.Cols) - if r == 0 || c == 0 { - return 0, 0 - } - // TODO(btracey): Check for overlap when complex version exists. - // TODO(btracey): Add fast-paths. - for i := 0; i < r; i++ { - for j := 0; j < c; j++ { - m.set(i, j, a.At(i, j)) - } - } - return r, c -} - -// RawCMatrix returns the underlying cblas128.General used by the receiver. -// Changes to elements in the receiver following the call will be reflected -// in returned cblas128.General. -func (m *CDense) RawCMatrix() cblas128.General { return m.mat } diff --git a/vendor/gonum.org/v1/gonum/mat/cholesky.go b/vendor/gonum.org/v1/gonum/mat/cholesky.go deleted file mode 100644 index 9082c21..0000000 --- a/vendor/gonum.org/v1/gonum/mat/cholesky.go +++ /dev/null @@ -1,700 +0,0 @@ -// Copyright ©2013 The Gonum 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 mat - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack/lapack64" -) - -const ( - badTriangle = "mat: invalid triangle" - badCholesky = "mat: invalid Cholesky factorization" -) - -var ( - _ Matrix = (*Cholesky)(nil) - _ Symmetric = (*Cholesky)(nil) -) - -// Cholesky is a symmetric positive definite matrix represented by its -// Cholesky decomposition. -// -// The decomposition can be constructed using the Factorize method. The -// factorization itself can be extracted using the UTo or LTo methods, and the -// original symmetric matrix can be recovered with ToSym. -// -// Note that this matrix representation is useful for certain operations, in -// particular finding solutions to linear equations. It is very inefficient -// at other operations, in particular At is slow. -// -// Cholesky methods may only be called on a value that has been successfully -// initialized by a call to Factorize that has returned true. Calls to methods -// of an unsuccessful Cholesky factorization will panic. -type Cholesky struct { - // The chol pointer must never be retained as a pointer outside the Cholesky - // struct, either by returning chol outside the struct or by setting it to - // a pointer coming from outside. The same prohibition applies to the data - // slice within chol. - chol *TriDense - cond float64 -} - -// updateCond updates the condition number of the Cholesky decomposition. If -// norm > 0, then that norm is used as the norm of the original matrix A, otherwise -// the norm is estimated from the decomposition. -func (c *Cholesky) updateCond(norm float64) { - n := c.chol.mat.N - work := getFloats(3*n, false) - defer putFloats(work) - if norm < 0 { - // This is an approximation. By the definition of a norm, - // |AB| <= |A| |B|. - // Since A = Uᵀ*U, we get for the condition number κ that - // κ(A) := |A| |A^-1| = |Uᵀ*U| |A^-1| <= |Uᵀ| |U| |A^-1|, - // so this will overestimate the condition number somewhat. - // The norm of the original factorized matrix cannot be stored - // because of update possibilities. - unorm := lapack64.Lantr(CondNorm, c.chol.mat, work) - lnorm := lapack64.Lantr(CondNormTrans, c.chol.mat, work) - norm = unorm * lnorm - } - sym := c.chol.asSymBlas() - iwork := getInts(n, false) - v := lapack64.Pocon(sym, norm, work, iwork) - putInts(iwork) - c.cond = 1 / v -} - -// Dims returns the dimensions of the matrix. -func (ch *Cholesky) Dims() (r, c int) { - if !ch.valid() { - panic(badCholesky) - } - r, c = ch.chol.Dims() - return r, c -} - -// At returns the element at row i, column j. -func (c *Cholesky) At(i, j int) float64 { - if !c.valid() { - panic(badCholesky) - } - n := c.Symmetric() - if uint(i) >= uint(n) { - panic(ErrRowAccess) - } - if uint(j) >= uint(n) { - panic(ErrColAccess) - } - - var val float64 - for k := 0; k <= min(i, j); k++ { - val += c.chol.at(k, i) * c.chol.at(k, j) - } - return val -} - -// T returns the the receiver, the transpose of a symmetric matrix. -func (c *Cholesky) T() Matrix { - return c -} - -// Symmetric implements the Symmetric interface and returns the number of rows -// in the matrix (this is also the number of columns). -func (c *Cholesky) Symmetric() int { - r, _ := c.chol.Dims() - return r -} - -// Cond returns the condition number of the factorized matrix. -func (c *Cholesky) Cond() float64 { - if !c.valid() { - panic(badCholesky) - } - return c.cond -} - -// Factorize calculates the Cholesky decomposition of the matrix A and returns -// whether the matrix is positive definite. If Factorize returns false, the -// factorization must not be used. -func (c *Cholesky) Factorize(a Symmetric) (ok bool) { - n := a.Symmetric() - if c.chol == nil { - c.chol = NewTriDense(n, Upper, nil) - } else { - c.chol = NewTriDense(n, Upper, use(c.chol.mat.Data, n*n)) - } - copySymIntoTriangle(c.chol, a) - - sym := c.chol.asSymBlas() - work := getFloats(c.chol.mat.N, false) - norm := lapack64.Lansy(CondNorm, sym, work) - putFloats(work) - _, ok = lapack64.Potrf(sym) - if ok { - c.updateCond(norm) - } else { - c.Reset() - } - return ok -} - -// Reset resets the factorization so that it can be reused as the receiver of a -// dimensionally restricted operation. -func (c *Cholesky) Reset() { - if c.chol != nil { - c.chol.Reset() - } - c.cond = math.Inf(1) -} - -// IsEmpty returns whether the receiver is empty. Empty matrices can be the -// receiver for size-restricted operations. The receiver can be emptied using -// Reset. -func (c *Cholesky) IsEmpty() bool { - return c.chol == nil || c.chol.IsEmpty() -} - -// SetFromU sets the Cholesky decomposition from the given triangular matrix. -// SetFromU panics if t is not upper triangular. If the receiver is empty it -// is resized to be n×n, the size of t. If dst is non-empty, SetFromU panics -// if c is not of size n×n. Note that t is copied into, not stored inside, the -// receiver. -func (c *Cholesky) SetFromU(t Triangular) { - n, kind := t.Triangle() - if kind != Upper { - panic("cholesky: matrix must be upper triangular") - } - if c.chol == nil { - c.chol = NewTriDense(n, Upper, nil) - } else { - c.chol.reuseAsNonZeroed(n, Upper) - } - c.chol.Copy(t) - c.updateCond(-1) -} - -// Clone makes a copy of the input Cholesky into the receiver, overwriting the -// previous value of the receiver. Clone does not place any restrictions on receiver -// shape. Clone panics if the input Cholesky is not the result of a valid decomposition. -func (c *Cholesky) Clone(chol *Cholesky) { - if !chol.valid() { - panic(badCholesky) - } - n := chol.Symmetric() - if c.chol == nil { - c.chol = NewTriDense(n, Upper, nil) - } else { - c.chol = NewTriDense(n, Upper, use(c.chol.mat.Data, n*n)) - } - c.chol.Copy(chol.chol) - c.cond = chol.cond -} - -// Det returns the determinant of the matrix that has been factorized. -func (c *Cholesky) Det() float64 { - if !c.valid() { - panic(badCholesky) - } - return math.Exp(c.LogDet()) -} - -// LogDet returns the log of the determinant of the matrix that has been factorized. -func (c *Cholesky) LogDet() float64 { - if !c.valid() { - panic(badCholesky) - } - var det float64 - for i := 0; i < c.chol.mat.N; i++ { - det += 2 * math.Log(c.chol.mat.Data[i*c.chol.mat.Stride+i]) - } - return det -} - -// SolveTo finds the matrix X that solves A * X = B where A is represented -// by the Cholesky decomposition. The result is stored in-place into dst. -func (c *Cholesky) SolveTo(dst *Dense, b Matrix) error { - if !c.valid() { - panic(badCholesky) - } - n := c.chol.mat.N - bm, bn := b.Dims() - if n != bm { - panic(ErrShape) - } - - dst.reuseAsNonZeroed(bm, bn) - if b != dst { - dst.Copy(b) - } - lapack64.Potrs(c.chol.mat, dst.mat) - if c.cond > ConditionTolerance { - return Condition(c.cond) - } - return nil -} - -// SolveCholTo finds the matrix X that solves A * X = B where A and B are represented -// by their Cholesky decompositions a and b. The result is stored in-place into -// dst. -func (a *Cholesky) SolveCholTo(dst *Dense, b *Cholesky) error { - if !a.valid() || !b.valid() { - panic(badCholesky) - } - bn := b.chol.mat.N - if a.chol.mat.N != bn { - panic(ErrShape) - } - - dst.reuseAsZeroed(bn, bn) - dst.Copy(b.chol.T()) - blas64.Trsm(blas.Left, blas.Trans, 1, a.chol.mat, dst.mat) - blas64.Trsm(blas.Left, blas.NoTrans, 1, a.chol.mat, dst.mat) - blas64.Trmm(blas.Right, blas.NoTrans, 1, b.chol.mat, dst.mat) - if a.cond > ConditionTolerance { - return Condition(a.cond) - } - return nil -} - -// SolveVecTo finds the vector X that solves A * x = b where A is represented -// by the Cholesky decomposition. The result is stored in-place into -// dst. -func (c *Cholesky) SolveVecTo(dst *VecDense, b Vector) error { - if !c.valid() { - panic(badCholesky) - } - n := c.chol.mat.N - if br, bc := b.Dims(); br != n || bc != 1 { - panic(ErrShape) - } - switch rv := b.(type) { - default: - dst.reuseAsNonZeroed(n) - return c.SolveTo(dst.asDense(), b) - case RawVectorer: - bmat := rv.RawVector() - if dst != b { - dst.checkOverlap(bmat) - } - dst.reuseAsNonZeroed(n) - if dst != b { - dst.CopyVec(b) - } - lapack64.Potrs(c.chol.mat, dst.asGeneral()) - if c.cond > ConditionTolerance { - return Condition(c.cond) - } - return nil - } -} - -// RawU returns the Triangular matrix used to store the Cholesky decomposition of -// the original matrix A. The returned matrix should not be modified. If it is -// modified, the decomposition is invalid and should not be used. -func (c *Cholesky) RawU() Triangular { - return c.chol -} - -// UTo stores into dst the n×n upper triangular matrix U from a Cholesky -// decomposition -// A = Uᵀ * U. -// If dst is empty, it is resized to be an n×n upper triangular matrix. When dst -// is non-empty, UTo panics if dst is not n×n or not Upper. UTo will also panic -// if the receiver does not contain a successful factorization. -func (c *Cholesky) UTo(dst *TriDense) { - if !c.valid() { - panic(badCholesky) - } - n := c.chol.mat.N - if dst.IsEmpty() { - dst.ReuseAsTri(n, Upper) - } else { - n2, kind := dst.Triangle() - if n != n2 { - panic(ErrShape) - } - if kind != Upper { - panic(ErrTriangle) - } - } - dst.Copy(c.chol) -} - -// LTo stores into dst the n×n lower triangular matrix L from a Cholesky -// decomposition -// A = L * Lᵀ. -// If dst is empty, it is resized to be an n×n lower triangular matrix. When dst -// is non-empty, LTo panics if dst is not n×n or not Lower. LTo will also panic -// if the receiver does not contain a successful factorization. -func (c *Cholesky) LTo(dst *TriDense) { - if !c.valid() { - panic(badCholesky) - } - n := c.chol.mat.N - if dst.IsEmpty() { - dst.ReuseAsTri(n, Lower) - } else { - n2, kind := dst.Triangle() - if n != n2 { - panic(ErrShape) - } - if kind != Lower { - panic(ErrTriangle) - } - } - dst.Copy(c.chol.TTri()) -} - -// ToSym reconstructs the original positive definite matrix from its -// Cholesky decomposition, storing the result into dst. If dst is -// empty it is resized to be n×n. If dst is non-empty, ToSym panics -// if dst is not of size n×n. ToSym will also panic if the receiver -// does not contain a successful factorization. -func (c *Cholesky) ToSym(dst *SymDense) { - if !c.valid() { - panic(badCholesky) - } - n := c.chol.mat.N - if dst.IsEmpty() { - dst.ReuseAsSym(n) - } else { - n2 := dst.Symmetric() - if n != n2 { - panic(ErrShape) - } - } - // Create a TriDense representing the Cholesky factor U with dst's - // backing slice. - // Operations on u are reflected in s. - u := &TriDense{ - mat: blas64.Triangular{ - Uplo: blas.Upper, - Diag: blas.NonUnit, - N: n, - Data: dst.mat.Data, - Stride: dst.mat.Stride, - }, - cap: n, - } - u.Copy(c.chol) - // Compute the product Uᵀ*U using the algorithm from LAPACK/TESTING/LIN/dpot01.f - a := u.mat.Data - lda := u.mat.Stride - bi := blas64.Implementation() - for k := n - 1; k >= 0; k-- { - a[k*lda+k] = bi.Ddot(k+1, a[k:], lda, a[k:], lda) - if k > 0 { - bi.Dtrmv(blas.Upper, blas.Trans, blas.NonUnit, k, a, lda, a[k:], lda) - } - } -} - -// InverseTo computes the inverse of the matrix represented by its Cholesky -// factorization and stores the result into s. If the factorized -// matrix is ill-conditioned, a Condition error will be returned. -// Note that matrix inversion is numerically unstable, and should generally be -// avoided where possible, for example by using the Solve routines. -func (c *Cholesky) InverseTo(s *SymDense) error { - if !c.valid() { - panic(badCholesky) - } - s.reuseAsNonZeroed(c.chol.mat.N) - // Create a TriDense representing the Cholesky factor U with the backing - // slice from s. - // Operations on u are reflected in s. - u := &TriDense{ - mat: blas64.Triangular{ - Uplo: blas.Upper, - Diag: blas.NonUnit, - N: s.mat.N, - Data: s.mat.Data, - Stride: s.mat.Stride, - }, - cap: s.mat.N, - } - u.Copy(c.chol) - - _, ok := lapack64.Potri(u.mat) - if !ok { - return Condition(math.Inf(1)) - } - if c.cond > ConditionTolerance { - return Condition(c.cond) - } - return nil -} - -// Scale multiplies the original matrix A by a positive constant using -// its Cholesky decomposition, storing the result in-place into the receiver. -// That is, if the original Cholesky factorization is -// Uᵀ * U = A -// the updated factorization is -// U'ᵀ * U' = f A = A' -// Scale panics if the constant is non-positive, or if the receiver is non-empty -// and is of a different size from the input. -func (c *Cholesky) Scale(f float64, orig *Cholesky) { - if !orig.valid() { - panic(badCholesky) - } - if f <= 0 { - panic("cholesky: scaling by a non-positive constant") - } - n := orig.Symmetric() - if c.chol == nil { - c.chol = NewTriDense(n, Upper, nil) - } else if c.chol.mat.N != n { - panic(ErrShape) - } - c.chol.ScaleTri(math.Sqrt(f), orig.chol) - c.cond = orig.cond // Scaling by a positive constant does not change the condition number. -} - -// ExtendVecSym computes the Cholesky decomposition of the original matrix A, -// whose Cholesky decomposition is in a, extended by a the n×1 vector v according to -// [A w] -// [w' k] -// where k = v[n-1] and w = v[:n-1]. The result is stored into the receiver. -// In order for the updated matrix to be positive definite, it must be the case -// that k > w' A^-1 w. If this condition does not hold then ExtendVecSym will -// return false and the receiver will not be updated. -// -// ExtendVecSym will panic if v.Len() != a.Symmetric()+1 or if a does not contain -// a valid decomposition. -func (c *Cholesky) ExtendVecSym(a *Cholesky, v Vector) (ok bool) { - n := a.Symmetric() - - if v.Len() != n+1 { - panic(badSliceLength) - } - if !a.valid() { - panic(badCholesky) - } - - // The algorithm is commented here, but see also - // https://math.stackexchange.com/questions/955874/cholesky-factor-when-adding-a-row-and-column-to-already-factorized-matrix - // We have A and want to compute the Cholesky of - // [A w] - // [w' k] - // We want - // [U c] - // [0 d] - // to be the updated Cholesky, and so it must be that - // [A w] = [U' 0] [U c] - // [w' k] [c' d] [0 d] - // Thus, we need - // 1) A = U'U (true by the original decomposition being valid), - // 2) U' * c = w => c = U'^-1 w - // 3) c'*c + d'*d = k => d = sqrt(k-c'*c) - - // First, compute c = U'^-1 a - // TODO(btracey): Replace this with CopyVec when issue 167 is fixed. - w := NewVecDense(n, nil) - for i := 0; i < n; i++ { - w.SetVec(i, v.At(i, 0)) - } - k := v.At(n, 0) - - var t VecDense - _ = t.SolveVec(a.chol.T(), w) - - dot := Dot(&t, &t) - if dot >= k { - return false - } - d := math.Sqrt(k - dot) - - newU := NewTriDense(n+1, Upper, nil) - newU.Copy(a.chol) - for i := 0; i < n; i++ { - newU.SetTri(i, n, t.At(i, 0)) - } - newU.SetTri(n, n, d) - c.chol = newU - c.updateCond(-1) - return true -} - -// SymRankOne performs a rank-1 update of the original matrix A and refactorizes -// its Cholesky factorization, storing the result into the receiver. That is, if -// in the original Cholesky factorization -// Uᵀ * U = A, -// in the updated factorization -// U'ᵀ * U' = A + alpha * x * xᵀ = A'. -// -// Note that when alpha is negative, the updating problem may be ill-conditioned -// and the results may be inaccurate, or the updated matrix A' may not be -// positive definite and not have a Cholesky factorization. SymRankOne returns -// whether the updated matrix A' is positive definite. -// -// SymRankOne updates a Cholesky factorization in O(n²) time. The Cholesky -// factorization computation from scratch is O(n³). -func (c *Cholesky) SymRankOne(orig *Cholesky, alpha float64, x Vector) (ok bool) { - if !orig.valid() { - panic(badCholesky) - } - n := orig.Symmetric() - if r, c := x.Dims(); r != n || c != 1 { - panic(ErrShape) - } - if orig != c { - if c.chol == nil { - c.chol = NewTriDense(n, Upper, nil) - } else if c.chol.mat.N != n { - panic(ErrShape) - } - c.chol.Copy(orig.chol) - } - - if alpha == 0 { - return true - } - - // Algorithms for updating and downdating the Cholesky factorization are - // described, for example, in - // - J. J. Dongarra, J. R. Bunch, C. B. Moler, G. W. Stewart: LINPACK - // Users' Guide. SIAM (1979), pages 10.10--10.14 - // or - // - P. E. Gill, G. H. Golub, W. Murray, and M. A. Saunders: Methods for - // modifying matrix factorizations. Mathematics of Computation 28(126) - // (1974), Method C3 on page 521 - // - // The implementation is based on LINPACK code - // http://www.netlib.org/linpack/dchud.f - // http://www.netlib.org/linpack/dchdd.f - // and - // https://icl.cs.utk.edu/lapack-forum/viewtopic.php?f=2&t=2646 - // - // According to http://icl.cs.utk.edu/lapack-forum/archives/lapack/msg00301.html - // LINPACK is released under BSD license. - // - // See also: - // - M. A. Saunders: Large-scale Linear Programming Using the Cholesky - // Factorization. Technical Report Stanford University (1972) - // http://i.stanford.edu/pub/cstr/reports/cs/tr/72/252/CS-TR-72-252.pdf - // - Matthias Seeger: Low rank updates for the Cholesky decomposition. - // EPFL Technical Report 161468 (2004) - // http://infoscience.epfl.ch/record/161468 - - work := getFloats(n, false) - defer putFloats(work) - var xmat blas64.Vector - if rv, ok := x.(RawVectorer); ok { - xmat = rv.RawVector() - } else { - var tmp *VecDense - tmp.CopyVec(x) - xmat = tmp.RawVector() - } - blas64.Copy(xmat, blas64.Vector{N: n, Data: work, Inc: 1}) - - if alpha > 0 { - // Compute rank-1 update. - if alpha != 1 { - blas64.Scal(math.Sqrt(alpha), blas64.Vector{N: n, Data: work, Inc: 1}) - } - umat := c.chol.mat - stride := umat.Stride - for i := 0; i < n; i++ { - // Compute parameters of the Givens matrix that zeroes - // the i-th element of x. - c, s, r, _ := blas64.Rotg(umat.Data[i*stride+i], work[i]) - if r < 0 { - // Multiply by -1 to have positive diagonal - // elemnts. - r *= -1 - c *= -1 - s *= -1 - } - umat.Data[i*stride+i] = r - if i < n-1 { - // Multiply the extended factorization matrix by - // the Givens matrix from the left. Only - // the i-th row and x are modified. - blas64.Rot( - blas64.Vector{N: n - i - 1, Data: umat.Data[i*stride+i+1 : i*stride+n], Inc: 1}, - blas64.Vector{N: n - i - 1, Data: work[i+1 : n], Inc: 1}, - c, s) - } - } - c.updateCond(-1) - return true - } - - // Compute rank-1 downdate. - alpha = math.Sqrt(-alpha) - if alpha != 1 { - blas64.Scal(alpha, blas64.Vector{N: n, Data: work, Inc: 1}) - } - // Solve Uᵀ * p = x storing the result into work. - ok = lapack64.Trtrs(blas.Trans, c.chol.RawTriangular(), blas64.General{ - Rows: n, - Cols: 1, - Stride: 1, - Data: work, - }) - if !ok { - // The original matrix is singular. Should not happen, because - // the factorization is valid. - panic(badCholesky) - } - norm := blas64.Nrm2(blas64.Vector{N: n, Data: work, Inc: 1}) - if norm >= 1 { - // The updated matrix is not positive definite. - return false - } - norm = math.Sqrt((1 + norm) * (1 - norm)) - cos := getFloats(n, false) - defer putFloats(cos) - sin := getFloats(n, false) - defer putFloats(sin) - for i := n - 1; i >= 0; i-- { - // Compute parameters of Givens matrices that zero elements of p - // backwards. - cos[i], sin[i], norm, _ = blas64.Rotg(norm, work[i]) - if norm < 0 { - norm *= -1 - cos[i] *= -1 - sin[i] *= -1 - } - } - umat := c.chol.mat - stride := umat.Stride - for i := n - 1; i >= 0; i-- { - work[i] = 0 - // Apply Givens matrices to U. - // TODO(vladimir-ch): Use workspace to avoid modifying the - // receiver in case an invalid factorization is created. - blas64.Rot( - blas64.Vector{N: n - i, Data: work[i:n], Inc: 1}, - blas64.Vector{N: n - i, Data: umat.Data[i*stride+i : i*stride+n], Inc: 1}, - cos[i], sin[i]) - if umat.Data[i*stride+i] == 0 { - // The matrix is singular (may rarely happen due to - // floating-point effects?). - ok = false - } else if umat.Data[i*stride+i] < 0 { - // Diagonal elements should be positive. If it happens - // that on the i-th row the diagonal is negative, - // multiply U from the left by an identity matrix that - // has -1 on the i-th row. - blas64.Scal(-1, blas64.Vector{N: n - i, Data: umat.Data[i*stride+i : i*stride+n], Inc: 1}) - } - } - if ok { - c.updateCond(-1) - } else { - c.Reset() - } - return ok -} - -func (c *Cholesky) valid() bool { - return c.chol != nil && !c.chol.IsEmpty() -} diff --git a/vendor/gonum.org/v1/gonum/mat/cmatrix.go b/vendor/gonum.org/v1/gonum/mat/cmatrix.go deleted file mode 100644 index 3a7b3da..0000000 --- a/vendor/gonum.org/v1/gonum/mat/cmatrix.go +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright ©2013 The Gonum 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 mat - -import ( - "math" - "math/cmplx" - - "gonum.org/v1/gonum/blas/cblas128" - "gonum.org/v1/gonum/floats" -) - -// CMatrix is the basic matrix interface type for complex matrices. -type CMatrix interface { - // Dims returns the dimensions of a Matrix. - Dims() (r, c int) - - // At returns the value of a matrix element at row i, column j. - // It will panic if i or j are out of bounds for the matrix. - At(i, j int) complex128 - - // H returns the conjugate transpose of the Matrix. Whether H - // returns a copy of the underlying data is implementation dependent. - // This method may be implemented using the Conjugate type, which - // provides an implicit matrix conjugate transpose. - H() CMatrix -} - -// A RawCMatrixer can return a cblas128.General representation of the receiver. Changes to the cblas128.General.Data -// slice will be reflected in the original matrix, changes to the Rows, Cols and Stride fields will not. -type RawCMatrixer interface { - RawCMatrix() cblas128.General -} - -var ( - _ CMatrix = Conjugate{} - _ Unconjugator = Conjugate{} -) - -// Conjugate is a type for performing an implicit matrix conjugate transpose. -// It implements the Matrix interface, returning values from the conjugate -// transpose of the matrix within. -type Conjugate struct { - CMatrix CMatrix -} - -// At returns the value of the element at row i and column j of the conjugate -// transposed matrix, that is, row j and column i of the Matrix field. -func (t Conjugate) At(i, j int) complex128 { - z := t.CMatrix.At(j, i) - return cmplx.Conj(z) -} - -// Dims returns the dimensions of the transposed matrix. The number of rows returned -// is the number of columns in the Matrix field, and the number of columns is -// the number of rows in the Matrix field. -func (t Conjugate) Dims() (r, c int) { - c, r = t.CMatrix.Dims() - return r, c -} - -// H performs an implicit conjugate transpose by returning the Matrix field. -func (t Conjugate) H() CMatrix { - return t.CMatrix -} - -// Unconjugate returns the Matrix field. -func (t Conjugate) Unconjugate() CMatrix { - return t.CMatrix -} - -// Unconjugator is a type that can undo an implicit conjugate transpose. -type Unconjugator interface { - // Note: This interface is needed to unify all of the Conjugate types. In - // the cmat128 methods, we need to test if the Matrix has been implicitly - // transposed. If this is checked by testing for the specific Conjugate type - // then the behavior will be different if the user uses H() or HTri() for a - // triangular matrix. - - // Unconjugate returns the underlying Matrix stored for the implicit - // conjugate transpose. - Unconjugate() CMatrix -} - -// useC returns a complex128 slice with l elements, using c if it -// has the necessary capacity, otherwise creating a new slice. -func useC(c []complex128, l int) []complex128 { - if l <= cap(c) { - return c[:l] - } - return make([]complex128, l) -} - -// useZeroedC returns a complex128 slice with l elements, using c if it -// has the necessary capacity, otherwise creating a new slice. The -// elements of the returned slice are guaranteed to be zero. -func useZeroedC(c []complex128, l int) []complex128 { - if l <= cap(c) { - c = c[:l] - zeroC(c) - return c - } - return make([]complex128, l) -} - -// zeroC zeros the given slice's elements. -func zeroC(c []complex128) { - for i := range c { - c[i] = 0 - } -} - -// unconjugate unconjugates a matrix if applicable. If a is an Unconjugator, then -// unconjugate returns the underlying matrix and true. If it is not, then it returns -// the input matrix and false. -func unconjugate(a CMatrix) (CMatrix, bool) { - if ut, ok := a.(Unconjugator); ok { - return ut.Unconjugate(), true - } - return a, false -} - -// CEqual returns whether the matrices a and b have the same size -// and are element-wise equal. -func CEqual(a, b CMatrix) bool { - ar, ac := a.Dims() - br, bc := b.Dims() - if ar != br || ac != bc { - return false - } - // TODO(btracey): Add in fast-paths. - for i := 0; i < ar; i++ { - for j := 0; j < ac; j++ { - if a.At(i, j) != b.At(i, j) { - return false - } - } - } - return true -} - -// CEqualApprox returns whether the matrices a and b have the same size and contain all equal -// elements with tolerance for element-wise equality specified by epsilon. Matrices -// with non-equal shapes are not equal. -func CEqualApprox(a, b CMatrix, epsilon float64) bool { - // TODO(btracey): - ar, ac := a.Dims() - br, bc := b.Dims() - if ar != br || ac != bc { - return false - } - for i := 0; i < ar; i++ { - for j := 0; j < ac; j++ { - if !cEqualWithinAbsOrRel(a.At(i, j), b.At(i, j), epsilon, epsilon) { - return false - } - } - } - return true -} - -// TODO(btracey): Move these into a cmplxs if/when we have one. - -func cEqualWithinAbsOrRel(a, b complex128, absTol, relTol float64) bool { - if cEqualWithinAbs(a, b, absTol) { - return true - } - return cEqualWithinRel(a, b, relTol) -} - -// cEqualWithinAbs returns true if a and b have an absolute -// difference of less than tol. -func cEqualWithinAbs(a, b complex128, tol float64) bool { - return a == b || cmplx.Abs(a-b) <= tol -} - -const minNormalFloat64 = 2.2250738585072014e-308 - -// cEqualWithinRel returns true if the difference between a and b -// is not greater than tol times the greater value. -func cEqualWithinRel(a, b complex128, tol float64) bool { - if a == b { - return true - } - if cmplx.IsNaN(a) || cmplx.IsNaN(b) { - return false - } - // Cannot play the same trick as in floats because there are multiple - // possible infinities. - if cmplx.IsInf(a) { - if !cmplx.IsInf(b) { - return false - } - ra := real(a) - if math.IsInf(ra, 0) { - if ra == real(b) { - return floats.EqualWithinRel(imag(a), imag(b), tol) - } - return false - } - if imag(a) == imag(b) { - return floats.EqualWithinRel(ra, real(b), tol) - } - return false - } - if cmplx.IsInf(b) { - return false - } - - delta := cmplx.Abs(a - b) - if delta <= minNormalFloat64 { - return delta <= tol*minNormalFloat64 - } - return delta/math.Max(cmplx.Abs(a), cmplx.Abs(b)) <= tol -} diff --git a/vendor/gonum.org/v1/gonum/mat/consts.go b/vendor/gonum.org/v1/gonum/mat/consts.go deleted file mode 100644 index 3de3f5b..0000000 --- a/vendor/gonum.org/v1/gonum/mat/consts.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright ©2016 The Gonum 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 mat - -// TriKind represents the triangularity of the matrix. -type TriKind bool - -const ( - // Upper specifies an upper triangular matrix. - Upper TriKind = true - // Lower specifies a lower triangular matrix. - Lower TriKind = false -) diff --git a/vendor/gonum.org/v1/gonum/mat/dense.go b/vendor/gonum.org/v1/gonum/mat/dense.go deleted file mode 100644 index 3194d35..0000000 --- a/vendor/gonum.org/v1/gonum/mat/dense.go +++ /dev/null @@ -1,586 +0,0 @@ -// Copyright ©2013 The Gonum 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 mat - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -var ( - dense *Dense - - _ Matrix = dense - _ allMatrix = dense - _ denseMatrix = dense - _ Mutable = dense - - _ ClonerFrom = dense - _ RowViewer = dense - _ ColViewer = dense - _ RawRowViewer = dense - _ Grower = dense - - _ RawMatrixSetter = dense - _ RawMatrixer = dense - - _ Reseter = dense -) - -// Dense is a dense matrix representation. -type Dense struct { - mat blas64.General - - capRows, capCols int -} - -// NewDense creates a new Dense matrix with r rows and c columns. If data == nil, -// a new slice is allocated for the backing slice. If len(data) == r*c, data is -// used as the backing slice, and changes to the elements of the returned Dense -// will be reflected in data. If neither of these is true, NewDense will panic. -// NewDense will panic if either r or c is zero. -// -// The data must be arranged in row-major order, i.e. the (i*c + j)-th -// element in the data slice is the {i, j}-th element in the matrix. -func NewDense(r, c int, data []float64) *Dense { - if r <= 0 || c <= 0 { - if r == 0 || c == 0 { - panic(ErrZeroLength) - } - panic(ErrNegativeDimension) - } - if data != nil && r*c != len(data) { - panic(ErrShape) - } - if data == nil { - data = make([]float64, r*c) - } - return &Dense{ - mat: blas64.General{ - Rows: r, - Cols: c, - Stride: c, - Data: data, - }, - capRows: r, - capCols: c, - } -} - -// ReuseAs changes the receiver if it IsEmpty() to be of size r×c. -// -// ReuseAs re-uses the backing data slice if it has sufficient capacity, -// otherwise a new slice is allocated. The backing data is zero on return. -// -// ReuseAs panics if the receiver is not empty, and panics if -// the input sizes are less than one. To empty the receiver for re-use, -// Reset should be used. -func (m *Dense) ReuseAs(r, c int) { - if r <= 0 || c <= 0 { - if r == 0 || c == 0 { - panic(ErrZeroLength) - } - panic(ErrNegativeDimension) - } - if !m.IsEmpty() { - panic(ErrReuseNonEmpty) - } - m.reuseAsZeroed(r, c) -} - -// reuseAsNonZeroed resizes an empty matrix to a r×c matrix, -// or checks that a non-empty matrix is r×c. It does not zero -// the data in the receiver. -func (m *Dense) reuseAsNonZeroed(r, c int) { - // reuseAs must be kept in sync with reuseAsZeroed. - if m.mat.Rows > m.capRows || m.mat.Cols > m.capCols { - // Panic as a string, not a mat.Error. - panic("mat: caps not correctly set") - } - if r == 0 || c == 0 { - panic(ErrZeroLength) - } - if m.IsEmpty() { - m.mat = blas64.General{ - Rows: r, - Cols: c, - Stride: c, - Data: use(m.mat.Data, r*c), - } - m.capRows = r - m.capCols = c - return - } - if r != m.mat.Rows || c != m.mat.Cols { - panic(ErrShape) - } -} - -// reuseAsZeroed resizes an empty matrix to a r×c matrix, -// or checks that a non-empty matrix is r×c. It zeroes -// all the elements of the matrix. -func (m *Dense) reuseAsZeroed(r, c int) { - // reuseAsZeroed must be kept in sync with reuseAsNonZeroed. - if m.mat.Rows > m.capRows || m.mat.Cols > m.capCols { - // Panic as a string, not a mat.Error. - panic("mat: caps not correctly set") - } - if r == 0 || c == 0 { - panic(ErrZeroLength) - } - if m.IsEmpty() { - m.mat = blas64.General{ - Rows: r, - Cols: c, - Stride: c, - Data: useZeroed(m.mat.Data, r*c), - } - m.capRows = r - m.capCols = c - return - } - if r != m.mat.Rows || c != m.mat.Cols { - panic(ErrShape) - } - m.Zero() -} - -// Zero sets all of the matrix elements to zero. -func (m *Dense) Zero() { - r := m.mat.Rows - c := m.mat.Cols - for i := 0; i < r; i++ { - zero(m.mat.Data[i*m.mat.Stride : i*m.mat.Stride+c]) - } -} - -// isolatedWorkspace returns a new dense matrix w with the size of a and -// returns a callback to defer which performs cleanup at the return of the call. -// This should be used when a method receiver is the same pointer as an input argument. -func (m *Dense) isolatedWorkspace(a Matrix) (w *Dense, restore func()) { - r, c := a.Dims() - if r == 0 || c == 0 { - panic(ErrZeroLength) - } - w = getWorkspace(r, c, false) - return w, func() { - m.Copy(w) - putWorkspace(w) - } -} - -// Reset empties the matrix so that it can be reused as the -// receiver of a dimensionally restricted operation. -// -// Reset should not be used when the matrix shares backing data. -// See the Reseter interface for more information. -func (m *Dense) Reset() { - // Row, Cols and Stride must be zeroed in unison. - m.mat.Rows, m.mat.Cols, m.mat.Stride = 0, 0, 0 - m.capRows, m.capCols = 0, 0 - m.mat.Data = m.mat.Data[:0] -} - -// IsEmpty returns whether the receiver is empty. Empty matrices can be the -// receiver for size-restricted operations. The receiver can be emptied using -// Reset. -func (m *Dense) IsEmpty() bool { - // It must be the case that m.Dims() returns - // zeros in this case. See comment in Reset(). - return m.mat.Stride == 0 -} - -// asTriDense returns a TriDense with the given size and side. The backing data -// of the TriDense is the same as the receiver. -func (m *Dense) asTriDense(n int, diag blas.Diag, uplo blas.Uplo) *TriDense { - return &TriDense{ - mat: blas64.Triangular{ - N: n, - Stride: m.mat.Stride, - Data: m.mat.Data, - Uplo: uplo, - Diag: diag, - }, - cap: n, - } -} - -// DenseCopyOf returns a newly allocated copy of the elements of a. -func DenseCopyOf(a Matrix) *Dense { - d := &Dense{} - d.CloneFrom(a) - return d -} - -// SetRawMatrix sets the underlying blas64.General used by the receiver. -// Changes to elements in the receiver following the call will be reflected -// in b. -func (m *Dense) SetRawMatrix(b blas64.General) { - m.capRows, m.capCols = b.Rows, b.Cols - m.mat = b -} - -// RawMatrix returns the underlying blas64.General used by the receiver. -// Changes to elements in the receiver following the call will be reflected -// in returned blas64.General. -func (m *Dense) RawMatrix() blas64.General { return m.mat } - -// Dims returns the number of rows and columns in the matrix. -func (m *Dense) Dims() (r, c int) { return m.mat.Rows, m.mat.Cols } - -// Caps returns the number of rows and columns in the backing matrix. -func (m *Dense) Caps() (r, c int) { return m.capRows, m.capCols } - -// T performs an implicit transpose by returning the receiver inside a Transpose. -func (m *Dense) T() Matrix { - return Transpose{m} -} - -// ColView returns a Vector reflecting the column j, backed by the matrix data. -// -// See ColViewer for more information. -func (m *Dense) ColView(j int) Vector { - var v VecDense - v.ColViewOf(m, j) - return &v -} - -// SetCol sets the values in the specified column of the matrix to the values -// in src. len(src) must equal the number of rows in the receiver. -func (m *Dense) SetCol(j int, src []float64) { - if j >= m.mat.Cols || j < 0 { - panic(ErrColAccess) - } - if len(src) != m.mat.Rows { - panic(ErrColLength) - } - - blas64.Copy( - blas64.Vector{N: m.mat.Rows, Inc: 1, Data: src}, - blas64.Vector{N: m.mat.Rows, Inc: m.mat.Stride, Data: m.mat.Data[j:]}, - ) -} - -// SetRow sets the values in the specified rows of the matrix to the values -// in src. len(src) must equal the number of columns in the receiver. -func (m *Dense) SetRow(i int, src []float64) { - if i >= m.mat.Rows || i < 0 { - panic(ErrRowAccess) - } - if len(src) != m.mat.Cols { - panic(ErrRowLength) - } - - copy(m.rawRowView(i), src) -} - -// RowView returns row i of the matrix data represented as a column vector, -// backed by the matrix data. -// -// See RowViewer for more information. -func (m *Dense) RowView(i int) Vector { - var v VecDense - v.RowViewOf(m, i) - return &v -} - -// RawRowView returns a slice backed by the same array as backing the -// receiver. -func (m *Dense) RawRowView(i int) []float64 { - if i >= m.mat.Rows || i < 0 { - panic(ErrRowAccess) - } - return m.rawRowView(i) -} - -func (m *Dense) rawRowView(i int) []float64 { - return m.mat.Data[i*m.mat.Stride : i*m.mat.Stride+m.mat.Cols] -} - -// DiagView returns the diagonal as a matrix backed by the original data. -func (m *Dense) DiagView() Diagonal { - n := min(m.mat.Rows, m.mat.Cols) - return &DiagDense{ - mat: blas64.Vector{ - N: n, - Inc: m.mat.Stride + 1, - Data: m.mat.Data[:(n-1)*m.mat.Stride+n], - }, - } -} - -// Slice returns a new Matrix that shares backing data with the receiver. -// The returned matrix starts at {i,j} of the receiver and extends k-i rows -// and l-j columns. The final row in the resulting matrix is k-1 and the -// final column is l-1. -// Slice panics with ErrIndexOutOfRange if the slice is outside the capacity -// of the receiver. -func (m *Dense) Slice(i, k, j, l int) Matrix { - return m.slice(i, k, j, l) -} - -func (m *Dense) slice(i, k, j, l int) *Dense { - mr, mc := m.Caps() - if i < 0 || mr <= i || j < 0 || mc <= j || k < i || mr < k || l < j || mc < l { - if i == k || j == l { - panic(ErrZeroLength) - } - panic(ErrIndexOutOfRange) - } - t := *m - t.mat.Data = t.mat.Data[i*t.mat.Stride+j : (k-1)*t.mat.Stride+l] - t.mat.Rows = k - i - t.mat.Cols = l - j - t.capRows -= i - t.capCols -= j - return &t -} - -// Grow returns the receiver expanded by r rows and c columns. If the dimensions -// of the expanded matrix are outside the capacities of the receiver a new -// allocation is made, otherwise not. Note the receiver itself is not modified -// during the call to Grow. -func (m *Dense) Grow(r, c int) Matrix { - if r < 0 || c < 0 { - panic(ErrIndexOutOfRange) - } - if r == 0 && c == 0 { - return m - } - - r += m.mat.Rows - c += m.mat.Cols - - var t Dense - switch { - case m.mat.Rows == 0 || m.mat.Cols == 0: - t.mat = blas64.General{ - Rows: r, - Cols: c, - Stride: c, - // We zero because we don't know how the matrix will be used. - // In other places, the mat is immediately filled with a result; - // this is not the case here. - Data: useZeroed(m.mat.Data, r*c), - } - case r > m.capRows || c > m.capCols: - cr := max(r, m.capRows) - cc := max(c, m.capCols) - t.mat = blas64.General{ - Rows: r, - Cols: c, - Stride: cc, - Data: make([]float64, cr*cc), - } - t.capRows = cr - t.capCols = cc - // Copy the complete matrix over to the new matrix. - // Including elements not currently visible. Use a temporary structure - // to avoid modifying the receiver. - var tmp Dense - tmp.mat = blas64.General{ - Rows: m.mat.Rows, - Cols: m.mat.Cols, - Stride: m.mat.Stride, - Data: m.mat.Data, - } - tmp.capRows = m.capRows - tmp.capCols = m.capCols - t.Copy(&tmp) - return &t - default: - t.mat = blas64.General{ - Data: m.mat.Data[:(r-1)*m.mat.Stride+c], - Rows: r, - Cols: c, - Stride: m.mat.Stride, - } - } - t.capRows = r - t.capCols = c - return &t -} - -// CloneFrom makes a copy of a into the receiver, overwriting the previous value of -// the receiver. The clone from operation does not make any restriction on shape and -// will not cause shadowing. -// -// See the ClonerFrom interface for more information. -func (m *Dense) CloneFrom(a Matrix) { - r, c := a.Dims() - mat := blas64.General{ - Rows: r, - Cols: c, - Stride: c, - } - m.capRows, m.capCols = r, c - - aU, trans := untransposeExtract(a) - switch aU := aU.(type) { - case *Dense: - amat := aU.mat - mat.Data = make([]float64, r*c) - if trans { - for i := 0; i < r; i++ { - blas64.Copy(blas64.Vector{N: c, Inc: amat.Stride, Data: amat.Data[i : i+(c-1)*amat.Stride+1]}, - blas64.Vector{N: c, Inc: 1, Data: mat.Data[i*c : (i+1)*c]}) - } - } else { - for i := 0; i < r; i++ { - copy(mat.Data[i*c:(i+1)*c], amat.Data[i*amat.Stride:i*amat.Stride+c]) - } - } - case *VecDense: - amat := aU.mat - mat.Data = make([]float64, aU.mat.N) - blas64.Copy(blas64.Vector{N: aU.mat.N, Inc: amat.Inc, Data: amat.Data}, - blas64.Vector{N: aU.mat.N, Inc: 1, Data: mat.Data}) - default: - mat.Data = make([]float64, r*c) - w := *m - w.mat = mat - for i := 0; i < r; i++ { - for j := 0; j < c; j++ { - w.set(i, j, a.At(i, j)) - } - } - *m = w - return - } - m.mat = mat -} - -// Copy makes a copy of elements of a into the receiver. It is similar to the -// built-in copy; it copies as much as the overlap between the two matrices and -// returns the number of rows and columns it copied. If a aliases the receiver -// and is a transposed Dense or VecDense, with a non-unitary increment, Copy will -// panic. -// -// See the Copier interface for more information. -func (m *Dense) Copy(a Matrix) (r, c int) { - r, c = a.Dims() - if a == m { - return r, c - } - r = min(r, m.mat.Rows) - c = min(c, m.mat.Cols) - if r == 0 || c == 0 { - return 0, 0 - } - - aU, trans := untransposeExtract(a) - switch aU := aU.(type) { - case *Dense: - amat := aU.mat - if trans { - if amat.Stride != 1 { - m.checkOverlap(amat) - } - for i := 0; i < r; i++ { - blas64.Copy(blas64.Vector{N: c, Inc: amat.Stride, Data: amat.Data[i : i+(c-1)*amat.Stride+1]}, - blas64.Vector{N: c, Inc: 1, Data: m.mat.Data[i*m.mat.Stride : i*m.mat.Stride+c]}) - } - } else { - switch o := offset(m.mat.Data, amat.Data); { - case o < 0: - for i := r - 1; i >= 0; i-- { - copy(m.mat.Data[i*m.mat.Stride:i*m.mat.Stride+c], amat.Data[i*amat.Stride:i*amat.Stride+c]) - } - case o > 0: - for i := 0; i < r; i++ { - copy(m.mat.Data[i*m.mat.Stride:i*m.mat.Stride+c], amat.Data[i*amat.Stride:i*amat.Stride+c]) - } - default: - // Nothing to do. - } - } - case *VecDense: - var n, stride int - amat := aU.mat - if trans { - if amat.Inc != 1 { - m.checkOverlap(aU.asGeneral()) - } - n = c - stride = 1 - } else { - n = r - stride = m.mat.Stride - } - if amat.Inc == 1 && stride == 1 { - copy(m.mat.Data, amat.Data[:n]) - break - } - switch o := offset(m.mat.Data, amat.Data); { - case o < 0: - blas64.Copy(blas64.Vector{N: n, Inc: -amat.Inc, Data: amat.Data}, - blas64.Vector{N: n, Inc: -stride, Data: m.mat.Data}) - case o > 0: - blas64.Copy(blas64.Vector{N: n, Inc: amat.Inc, Data: amat.Data}, - blas64.Vector{N: n, Inc: stride, Data: m.mat.Data}) - default: - // Nothing to do. - } - default: - m.checkOverlapMatrix(aU) - for i := 0; i < r; i++ { - for j := 0; j < c; j++ { - m.set(i, j, a.At(i, j)) - } - } - } - - return r, c -} - -// Stack appends the rows of b onto the rows of a, placing the result into the -// receiver with b placed in the greater indexed rows. Stack will panic if the -// two input matrices do not have the same number of columns or the constructed -// stacked matrix is not the same shape as the receiver. -func (m *Dense) Stack(a, b Matrix) { - ar, ac := a.Dims() - br, bc := b.Dims() - if ac != bc || m == a || m == b { - panic(ErrShape) - } - - m.reuseAsNonZeroed(ar+br, ac) - - m.Copy(a) - w := m.slice(ar, ar+br, 0, bc) - w.Copy(b) -} - -// Augment creates the augmented matrix of a and b, where b is placed in the -// greater indexed columns. Augment will panic if the two input matrices do -// not have the same number of rows or the constructed augmented matrix is -// not the same shape as the receiver. -func (m *Dense) Augment(a, b Matrix) { - ar, ac := a.Dims() - br, bc := b.Dims() - if ar != br || m == a || m == b { - panic(ErrShape) - } - - m.reuseAsNonZeroed(ar, ac+bc) - - m.Copy(a) - w := m.slice(0, br, ac, ac+bc) - w.Copy(b) -} - -// Trace returns the trace of the matrix. The matrix must be square or Trace -// will panic. -func (m *Dense) Trace() float64 { - if m.mat.Rows != m.mat.Cols { - panic(ErrSquare) - } - // TODO(btracey): could use internal asm sum routine. - var v float64 - for i := 0; i < m.mat.Rows; i++ { - v += m.mat.Data[i*m.mat.Stride+i] - } - return v -} diff --git a/vendor/gonum.org/v1/gonum/mat/dense_arithmetic.go b/vendor/gonum.org/v1/gonum/mat/dense_arithmetic.go deleted file mode 100644 index e007b60..0000000 --- a/vendor/gonum.org/v1/gonum/mat/dense_arithmetic.go +++ /dev/null @@ -1,867 +0,0 @@ -// Copyright ©2013 The Gonum 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 mat - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack/lapack64" -) - -// Add adds a and b element-wise, placing the result in the receiver. Add -// will panic if the two matrices do not have the same shape. -func (m *Dense) Add(a, b Matrix) { - ar, ac := a.Dims() - br, bc := b.Dims() - if ar != br || ac != bc { - panic(ErrShape) - } - - aU, _ := untransposeExtract(a) - bU, _ := untransposeExtract(b) - m.reuseAsNonZeroed(ar, ac) - - if arm, ok := a.(*Dense); ok { - if brm, ok := b.(*Dense); ok { - amat, bmat := arm.mat, brm.mat - if m != aU { - m.checkOverlap(amat) - } - if m != bU { - m.checkOverlap(bmat) - } - for ja, jb, jm := 0, 0, 0; ja < ar*amat.Stride; ja, jb, jm = ja+amat.Stride, jb+bmat.Stride, jm+m.mat.Stride { - for i, v := range amat.Data[ja : ja+ac] { - m.mat.Data[i+jm] = v + bmat.Data[i+jb] - } - } - return - } - } - - m.checkOverlapMatrix(aU) - m.checkOverlapMatrix(bU) - var restore func() - if m == aU { - m, restore = m.isolatedWorkspace(aU) - defer restore() - } else if m == bU { - m, restore = m.isolatedWorkspace(bU) - defer restore() - } - - for r := 0; r < ar; r++ { - for c := 0; c < ac; c++ { - m.set(r, c, a.At(r, c)+b.At(r, c)) - } - } -} - -// Sub subtracts the matrix b from a, placing the result in the receiver. Sub -// will panic if the two matrices do not have the same shape. -func (m *Dense) Sub(a, b Matrix) { - ar, ac := a.Dims() - br, bc := b.Dims() - if ar != br || ac != bc { - panic(ErrShape) - } - - aU, _ := untransposeExtract(a) - bU, _ := untransposeExtract(b) - m.reuseAsNonZeroed(ar, ac) - - if arm, ok := a.(*Dense); ok { - if brm, ok := b.(*Dense); ok { - amat, bmat := arm.mat, brm.mat - if m != aU { - m.checkOverlap(amat) - } - if m != bU { - m.checkOverlap(bmat) - } - for ja, jb, jm := 0, 0, 0; ja < ar*amat.Stride; ja, jb, jm = ja+amat.Stride, jb+bmat.Stride, jm+m.mat.Stride { - for i, v := range amat.Data[ja : ja+ac] { - m.mat.Data[i+jm] = v - bmat.Data[i+jb] - } - } - return - } - } - - m.checkOverlapMatrix(aU) - m.checkOverlapMatrix(bU) - var restore func() - if m == aU { - m, restore = m.isolatedWorkspace(aU) - defer restore() - } else if m == bU { - m, restore = m.isolatedWorkspace(bU) - defer restore() - } - - for r := 0; r < ar; r++ { - for c := 0; c < ac; c++ { - m.set(r, c, a.At(r, c)-b.At(r, c)) - } - } -} - -// MulElem performs element-wise multiplication of a and b, placing the result -// in the receiver. MulElem will panic if the two matrices do not have the same -// shape. -func (m *Dense) MulElem(a, b Matrix) { - ar, ac := a.Dims() - br, bc := b.Dims() - if ar != br || ac != bc { - panic(ErrShape) - } - - aU, _ := untransposeExtract(a) - bU, _ := untransposeExtract(b) - m.reuseAsNonZeroed(ar, ac) - - if arm, ok := a.(*Dense); ok { - if brm, ok := b.(*Dense); ok { - amat, bmat := arm.mat, brm.mat - if m != aU { - m.checkOverlap(amat) - } - if m != bU { - m.checkOverlap(bmat) - } - for ja, jb, jm := 0, 0, 0; ja < ar*amat.Stride; ja, jb, jm = ja+amat.Stride, jb+bmat.Stride, jm+m.mat.Stride { - for i, v := range amat.Data[ja : ja+ac] { - m.mat.Data[i+jm] = v * bmat.Data[i+jb] - } - } - return - } - } - - m.checkOverlapMatrix(aU) - m.checkOverlapMatrix(bU) - var restore func() - if m == aU { - m, restore = m.isolatedWorkspace(aU) - defer restore() - } else if m == bU { - m, restore = m.isolatedWorkspace(bU) - defer restore() - } - - for r := 0; r < ar; r++ { - for c := 0; c < ac; c++ { - m.set(r, c, a.At(r, c)*b.At(r, c)) - } - } -} - -// DivElem performs element-wise division of a by b, placing the result -// in the receiver. DivElem will panic if the two matrices do not have the same -// shape. -func (m *Dense) DivElem(a, b Matrix) { - ar, ac := a.Dims() - br, bc := b.Dims() - if ar != br || ac != bc { - panic(ErrShape) - } - - aU, _ := untransposeExtract(a) - bU, _ := untransposeExtract(b) - m.reuseAsNonZeroed(ar, ac) - - if arm, ok := a.(*Dense); ok { - if brm, ok := b.(*Dense); ok { - amat, bmat := arm.mat, brm.mat - if m != aU { - m.checkOverlap(amat) - } - if m != bU { - m.checkOverlap(bmat) - } - for ja, jb, jm := 0, 0, 0; ja < ar*amat.Stride; ja, jb, jm = ja+amat.Stride, jb+bmat.Stride, jm+m.mat.Stride { - for i, v := range amat.Data[ja : ja+ac] { - m.mat.Data[i+jm] = v / bmat.Data[i+jb] - } - } - return - } - } - - m.checkOverlapMatrix(aU) - m.checkOverlapMatrix(bU) - var restore func() - if m == aU { - m, restore = m.isolatedWorkspace(aU) - defer restore() - } else if m == bU { - m, restore = m.isolatedWorkspace(bU) - defer restore() - } - - for r := 0; r < ar; r++ { - for c := 0; c < ac; c++ { - m.set(r, c, a.At(r, c)/b.At(r, c)) - } - } -} - -// Inverse computes the inverse of the matrix a, storing the result into the -// receiver. If a is ill-conditioned, a Condition error will be returned. -// Note that matrix inversion is numerically unstable, and should generally -// be avoided where possible, for example by using the Solve routines. -func (m *Dense) Inverse(a Matrix) error { - // TODO(btracey): Special case for RawTriangular, etc. - r, c := a.Dims() - if r != c { - panic(ErrSquare) - } - m.reuseAsNonZeroed(a.Dims()) - aU, aTrans := untransposeExtract(a) - switch rm := aU.(type) { - case *Dense: - if m != aU || aTrans { - if m == aU || m.checkOverlap(rm.mat) { - tmp := getWorkspace(r, c, false) - tmp.Copy(a) - m.Copy(tmp) - putWorkspace(tmp) - break - } - m.Copy(a) - } - default: - m.Copy(a) - } - ipiv := getInts(r, false) - defer putInts(ipiv) - ok := lapack64.Getrf(m.mat, ipiv) - if !ok { - return Condition(math.Inf(1)) - } - work := getFloats(4*r, false) // must be at least 4*r for cond. - lapack64.Getri(m.mat, ipiv, work, -1) - if int(work[0]) > 4*r { - l := int(work[0]) - putFloats(work) - work = getFloats(l, false) - } else { - work = work[:4*r] - } - defer putFloats(work) - lapack64.Getri(m.mat, ipiv, work, len(work)) - norm := lapack64.Lange(CondNorm, m.mat, work) - rcond := lapack64.Gecon(CondNorm, m.mat, norm, work, ipiv) // reuse ipiv - if rcond == 0 { - return Condition(math.Inf(1)) - } - cond := 1 / rcond - if cond > ConditionTolerance { - return Condition(cond) - } - return nil -} - -// Mul takes the matrix product of a and b, placing the result in the receiver. -// If the number of columns in a does not equal the number of rows in b, Mul will panic. -func (m *Dense) Mul(a, b Matrix) { - ar, ac := a.Dims() - br, bc := b.Dims() - - if ac != br { - panic(ErrShape) - } - - aU, aTrans := untransposeExtract(a) - bU, bTrans := untransposeExtract(b) - m.reuseAsNonZeroed(ar, bc) - var restore func() - if m == aU { - m, restore = m.isolatedWorkspace(aU) - defer restore() - } else if m == bU { - m, restore = m.isolatedWorkspace(bU) - defer restore() - } - aT := blas.NoTrans - if aTrans { - aT = blas.Trans - } - bT := blas.NoTrans - if bTrans { - bT = blas.Trans - } - - // Some of the cases do not have a transpose option, so create - // temporary memory. - // C = Aᵀ * B = (Bᵀ * A)ᵀ - // Cᵀ = Bᵀ * A. - if aU, ok := aU.(*Dense); ok { - if restore == nil { - m.checkOverlap(aU.mat) - } - switch bU := bU.(type) { - case *Dense: - if restore == nil { - m.checkOverlap(bU.mat) - } - blas64.Gemm(aT, bT, 1, aU.mat, bU.mat, 0, m.mat) - return - - case *SymDense: - if aTrans { - c := getWorkspace(ac, ar, false) - blas64.Symm(blas.Left, 1, bU.mat, aU.mat, 0, c.mat) - strictCopy(m, c.T()) - putWorkspace(c) - return - } - blas64.Symm(blas.Right, 1, bU.mat, aU.mat, 0, m.mat) - return - - case *TriDense: - // Trmm updates in place, so copy aU first. - if aTrans { - c := getWorkspace(ac, ar, false) - var tmp Dense - tmp.SetRawMatrix(aU.mat) - c.Copy(&tmp) - bT := blas.Trans - if bTrans { - bT = blas.NoTrans - } - blas64.Trmm(blas.Left, bT, 1, bU.mat, c.mat) - strictCopy(m, c.T()) - putWorkspace(c) - return - } - m.Copy(a) - blas64.Trmm(blas.Right, bT, 1, bU.mat, m.mat) - return - - case *VecDense: - m.checkOverlap(bU.asGeneral()) - bvec := bU.RawVector() - if bTrans { - // {ar,1} x {1,bc}, which is not a vector. - // Instead, construct B as a General. - bmat := blas64.General{ - Rows: bc, - Cols: 1, - Stride: bvec.Inc, - Data: bvec.Data, - } - blas64.Gemm(aT, bT, 1, aU.mat, bmat, 0, m.mat) - return - } - cvec := blas64.Vector{ - Inc: m.mat.Stride, - Data: m.mat.Data, - } - blas64.Gemv(aT, 1, aU.mat, bvec, 0, cvec) - return - } - } - if bU, ok := bU.(*Dense); ok { - if restore == nil { - m.checkOverlap(bU.mat) - } - switch aU := aU.(type) { - case *SymDense: - if bTrans { - c := getWorkspace(bc, br, false) - blas64.Symm(blas.Right, 1, aU.mat, bU.mat, 0, c.mat) - strictCopy(m, c.T()) - putWorkspace(c) - return - } - blas64.Symm(blas.Left, 1, aU.mat, bU.mat, 0, m.mat) - return - - case *TriDense: - // Trmm updates in place, so copy bU first. - if bTrans { - c := getWorkspace(bc, br, false) - var tmp Dense - tmp.SetRawMatrix(bU.mat) - c.Copy(&tmp) - aT := blas.Trans - if aTrans { - aT = blas.NoTrans - } - blas64.Trmm(blas.Right, aT, 1, aU.mat, c.mat) - strictCopy(m, c.T()) - putWorkspace(c) - return - } - m.Copy(b) - blas64.Trmm(blas.Left, aT, 1, aU.mat, m.mat) - return - - case *VecDense: - m.checkOverlap(aU.asGeneral()) - avec := aU.RawVector() - if aTrans { - // {1,ac} x {ac, bc} - // Transpose B so that the vector is on the right. - cvec := blas64.Vector{ - Inc: 1, - Data: m.mat.Data, - } - bT := blas.Trans - if bTrans { - bT = blas.NoTrans - } - blas64.Gemv(bT, 1, bU.mat, avec, 0, cvec) - return - } - // {ar,1} x {1,bc} which is not a vector result. - // Instead, construct A as a General. - amat := blas64.General{ - Rows: ar, - Cols: 1, - Stride: avec.Inc, - Data: avec.Data, - } - blas64.Gemm(aT, bT, 1, amat, bU.mat, 0, m.mat) - return - } - } - - m.checkOverlapMatrix(aU) - m.checkOverlapMatrix(bU) - row := getFloats(ac, false) - defer putFloats(row) - for r := 0; r < ar; r++ { - for i := range row { - row[i] = a.At(r, i) - } - for c := 0; c < bc; c++ { - var v float64 - for i, e := range row { - v += e * b.At(i, c) - } - m.mat.Data[r*m.mat.Stride+c] = v - } - } -} - -// strictCopy copies a into m panicking if the shape of a and m differ. -func strictCopy(m *Dense, a Matrix) { - r, c := m.Copy(a) - if r != m.mat.Rows || c != m.mat.Cols { - // Panic with a string since this - // is not a user-facing panic. - panic(ErrShape.Error()) - } -} - -// Exp calculates the exponential of the matrix a, e^a, placing the result -// in the receiver. Exp will panic with matrix.ErrShape if a is not square. -func (m *Dense) Exp(a Matrix) { - // The implementation used here is from Functions of Matrices: Theory and Computation - // Chapter 10, Algorithm 10.20. https://doi.org/10.1137/1.9780898717778.ch10 - - r, c := a.Dims() - if r != c { - panic(ErrShape) - } - - m.reuseAsNonZeroed(r, r) - if r == 1 { - m.mat.Data[0] = math.Exp(a.At(0, 0)) - return - } - - pade := []struct { - theta float64 - b []float64 - }{ - {theta: 0.015, b: []float64{ - 120, 60, 12, 1, - }}, - {theta: 0.25, b: []float64{ - 30240, 15120, 3360, 420, 30, 1, - }}, - {theta: 0.95, b: []float64{ - 17297280, 8648640, 1995840, 277200, 25200, 1512, 56, 1, - }}, - {theta: 2.1, b: []float64{ - 17643225600, 8821612800, 2075673600, 302702400, 30270240, 2162160, 110880, 3960, 90, 1, - }}, - } - - a1 := m - a1.Copy(a) - v := getWorkspace(r, r, true) - vraw := v.RawMatrix() - n := r * r - vvec := blas64.Vector{N: n, Inc: 1, Data: vraw.Data} - defer putWorkspace(v) - - u := getWorkspace(r, r, true) - uraw := u.RawMatrix() - uvec := blas64.Vector{N: n, Inc: 1, Data: uraw.Data} - defer putWorkspace(u) - - a2 := getWorkspace(r, r, false) - defer putWorkspace(a2) - - n1 := Norm(a, 1) - for i, t := range pade { - if n1 > t.theta { - continue - } - - // This loop only executes once, so - // this is not as horrible as it looks. - p := getWorkspace(r, r, true) - praw := p.RawMatrix() - pvec := blas64.Vector{N: n, Inc: 1, Data: praw.Data} - defer putWorkspace(p) - - for k := 0; k < r; k++ { - p.set(k, k, 1) - v.set(k, k, t.b[0]) - u.set(k, k, t.b[1]) - } - - a2.Mul(a1, a1) - for j := 0; j <= i; j++ { - p.Mul(p, a2) - blas64.Axpy(t.b[2*j+2], pvec, vvec) - blas64.Axpy(t.b[2*j+3], pvec, uvec) - } - u.Mul(a1, u) - - // Use p as a workspace here and - // rename u for the second call's - // receiver. - vmu, vpu := u, p - vpu.Add(v, u) - vmu.Sub(v, u) - - _ = m.Solve(vmu, vpu) - return - } - - // Remaining Padé table line. - const theta13 = 5.4 - b := [...]float64{ - 64764752532480000, 32382376266240000, 7771770303897600, 1187353796428800, - 129060195264000, 10559470521600, 670442572800, 33522128640, - 1323241920, 40840800, 960960, 16380, 182, 1, - } - - s := math.Log2(n1 / theta13) - if s >= 0 { - s = math.Ceil(s) - a1.Scale(1/math.Pow(2, s), a1) - } - a2.Mul(a1, a1) - - i := getWorkspace(r, r, true) - for j := 0; j < r; j++ { - i.set(j, j, 1) - } - iraw := i.RawMatrix() - ivec := blas64.Vector{N: n, Inc: 1, Data: iraw.Data} - defer putWorkspace(i) - - a2raw := a2.RawMatrix() - a2vec := blas64.Vector{N: n, Inc: 1, Data: a2raw.Data} - - a4 := getWorkspace(r, r, false) - a4raw := a4.RawMatrix() - a4vec := blas64.Vector{N: n, Inc: 1, Data: a4raw.Data} - defer putWorkspace(a4) - a4.Mul(a2, a2) - - a6 := getWorkspace(r, r, false) - a6raw := a6.RawMatrix() - a6vec := blas64.Vector{N: n, Inc: 1, Data: a6raw.Data} - defer putWorkspace(a6) - a6.Mul(a2, a4) - - // V = A_6(b_12*A_6 + b_10*A_4 + b_8*A_2) + b_6*A_6 + b_4*A_4 + b_2*A_2 +b_0*I - blas64.Axpy(b[12], a6vec, vvec) - blas64.Axpy(b[10], a4vec, vvec) - blas64.Axpy(b[8], a2vec, vvec) - v.Mul(v, a6) - blas64.Axpy(b[6], a6vec, vvec) - blas64.Axpy(b[4], a4vec, vvec) - blas64.Axpy(b[2], a2vec, vvec) - blas64.Axpy(b[0], ivec, vvec) - - // U = A(A_6(b_13*A_6 + b_11*A_4 + b_9*A_2) + b_7*A_6 + b_5*A_4 + b_2*A_3 +b_1*I) - blas64.Axpy(b[13], a6vec, uvec) - blas64.Axpy(b[11], a4vec, uvec) - blas64.Axpy(b[9], a2vec, uvec) - u.Mul(u, a6) - blas64.Axpy(b[7], a6vec, uvec) - blas64.Axpy(b[5], a4vec, uvec) - blas64.Axpy(b[3], a2vec, uvec) - blas64.Axpy(b[1], ivec, uvec) - u.Mul(u, a1) - - // Use i as a workspace here and - // rename u for the second call's - // receiver. - vmu, vpu := u, i - vpu.Add(v, u) - vmu.Sub(v, u) - - _ = m.Solve(vmu, vpu) - - for ; s > 0; s-- { - m.Mul(m, m) - } -} - -// Pow calculates the integral power of the matrix a to n, placing the result -// in the receiver. Pow will panic if n is negative or if a is not square. -func (m *Dense) Pow(a Matrix, n int) { - if n < 0 { - panic("mat: illegal power") - } - r, c := a.Dims() - if r != c { - panic(ErrShape) - } - - m.reuseAsNonZeroed(r, c) - - // Take possible fast paths. - switch n { - case 0: - for i := 0; i < r; i++ { - zero(m.mat.Data[i*m.mat.Stride : i*m.mat.Stride+c]) - m.mat.Data[i*m.mat.Stride+i] = 1 - } - return - case 1: - m.Copy(a) - return - case 2: - m.Mul(a, a) - return - } - - // Perform iterative exponentiation by squaring in work space. - w := getWorkspace(r, r, false) - w.Copy(a) - s := getWorkspace(r, r, false) - s.Copy(a) - x := getWorkspace(r, r, false) - for n--; n > 0; n >>= 1 { - if n&1 != 0 { - x.Mul(w, s) - w, x = x, w - } - if n != 1 { - x.Mul(s, s) - s, x = x, s - } - } - m.Copy(w) - putWorkspace(w) - putWorkspace(s) - putWorkspace(x) -} - -// Kronecker calculates the Kronecker product of a and b, placing the result in -// the receiver. -func (m *Dense) Kronecker(a, b Matrix) { - ra, ca := a.Dims() - rb, cb := b.Dims() - - m.reuseAsNonZeroed(ra*rb, ca*cb) - for i := 0; i < ra; i++ { - for j := 0; j < ca; j++ { - m.slice(i*rb, (i+1)*rb, j*cb, (j+1)*cb).Scale(a.At(i, j), b) - } - } -} - -// Scale multiplies the elements of a by f, placing the result in the receiver. -// -// See the Scaler interface for more information. -func (m *Dense) Scale(f float64, a Matrix) { - ar, ac := a.Dims() - - m.reuseAsNonZeroed(ar, ac) - - aU, aTrans := untransposeExtract(a) - if rm, ok := aU.(*Dense); ok { - amat := rm.mat - if m == aU || m.checkOverlap(amat) { - var restore func() - m, restore = m.isolatedWorkspace(a) - defer restore() - } - if !aTrans { - for ja, jm := 0, 0; ja < ar*amat.Stride; ja, jm = ja+amat.Stride, jm+m.mat.Stride { - for i, v := range amat.Data[ja : ja+ac] { - m.mat.Data[i+jm] = v * f - } - } - } else { - for ja, jm := 0, 0; ja < ac*amat.Stride; ja, jm = ja+amat.Stride, jm+1 { - for i, v := range amat.Data[ja : ja+ar] { - m.mat.Data[i*m.mat.Stride+jm] = v * f - } - } - } - return - } - - m.checkOverlapMatrix(a) - for r := 0; r < ar; r++ { - for c := 0; c < ac; c++ { - m.set(r, c, f*a.At(r, c)) - } - } -} - -// Apply applies the function fn to each of the elements of a, placing the -// resulting matrix in the receiver. The function fn takes a row/column -// index and element value and returns some function of that tuple. -func (m *Dense) Apply(fn func(i, j int, v float64) float64, a Matrix) { - ar, ac := a.Dims() - - m.reuseAsNonZeroed(ar, ac) - - aU, aTrans := untransposeExtract(a) - if rm, ok := aU.(*Dense); ok { - amat := rm.mat - if m == aU || m.checkOverlap(amat) { - var restore func() - m, restore = m.isolatedWorkspace(a) - defer restore() - } - if !aTrans { - for j, ja, jm := 0, 0, 0; ja < ar*amat.Stride; j, ja, jm = j+1, ja+amat.Stride, jm+m.mat.Stride { - for i, v := range amat.Data[ja : ja+ac] { - m.mat.Data[i+jm] = fn(j, i, v) - } - } - } else { - for j, ja, jm := 0, 0, 0; ja < ac*amat.Stride; j, ja, jm = j+1, ja+amat.Stride, jm+1 { - for i, v := range amat.Data[ja : ja+ar] { - m.mat.Data[i*m.mat.Stride+jm] = fn(i, j, v) - } - } - } - return - } - - m.checkOverlapMatrix(a) - for r := 0; r < ar; r++ { - for c := 0; c < ac; c++ { - m.set(r, c, fn(r, c, a.At(r, c))) - } - } -} - -// RankOne performs a rank-one update to the matrix a with the vectors x and -// y, where x and y are treated as column vectors. The result is stored in the -// receiver. The Outer method can be used instead of RankOne if a is not needed. -// m = a + alpha * x * yᵀ -func (m *Dense) RankOne(a Matrix, alpha float64, x, y Vector) { - ar, ac := a.Dims() - if x.Len() != ar { - panic(ErrShape) - } - if y.Len() != ac { - panic(ErrShape) - } - - if a != m { - aU, _ := untransposeExtract(a) - if rm, ok := aU.(*Dense); ok { - m.checkOverlap(rm.RawMatrix()) - } - } - - var xmat, ymat blas64.Vector - fast := true - xU, _ := untransposeExtract(x) - if rv, ok := xU.(*VecDense); ok { - r, c := xU.Dims() - xmat = rv.mat - m.checkOverlap(generalFromVector(xmat, r, c)) - } else { - fast = false - } - yU, _ := untransposeExtract(y) - if rv, ok := yU.(*VecDense); ok { - r, c := yU.Dims() - ymat = rv.mat - m.checkOverlap(generalFromVector(ymat, r, c)) - } else { - fast = false - } - - if fast { - if m != a { - m.reuseAsNonZeroed(ar, ac) - m.Copy(a) - } - blas64.Ger(alpha, xmat, ymat, m.mat) - return - } - - m.reuseAsNonZeroed(ar, ac) - for i := 0; i < ar; i++ { - for j := 0; j < ac; j++ { - m.set(i, j, a.At(i, j)+alpha*x.AtVec(i)*y.AtVec(j)) - } - } -} - -// Outer calculates the outer product of the vectors x and y, where x and y -// are treated as column vectors, and stores the result in the receiver. -// m = alpha * x * yᵀ -// In order to update an existing matrix, see RankOne. -func (m *Dense) Outer(alpha float64, x, y Vector) { - r, c := x.Len(), y.Len() - - m.reuseAsZeroed(r, c) - - var xmat, ymat blas64.Vector - fast := true - xU, _ := untransposeExtract(x) - if rv, ok := xU.(*VecDense); ok { - r, c := xU.Dims() - xmat = rv.mat - m.checkOverlap(generalFromVector(xmat, r, c)) - } else { - fast = false - } - yU, _ := untransposeExtract(y) - if rv, ok := yU.(*VecDense); ok { - r, c := yU.Dims() - ymat = rv.mat - m.checkOverlap(generalFromVector(ymat, r, c)) - } else { - fast = false - } - - if fast { - for i := 0; i < r; i++ { - zero(m.mat.Data[i*m.mat.Stride : i*m.mat.Stride+c]) - } - blas64.Ger(alpha, xmat, ymat, m.mat) - return - } - - for i := 0; i < r; i++ { - for j := 0; j < c; j++ { - m.set(i, j, alpha*x.AtVec(i)*y.AtVec(j)) - } - } -} diff --git a/vendor/gonum.org/v1/gonum/mat/diagonal.go b/vendor/gonum.org/v1/gonum/mat/diagonal.go deleted file mode 100644 index f3357d6..0000000 --- a/vendor/gonum.org/v1/gonum/mat/diagonal.go +++ /dev/null @@ -1,326 +0,0 @@ -// Copyright ©2018 The Gonum 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 mat - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -var ( - diagDense *DiagDense - _ Matrix = diagDense - _ allMatrix = diagDense - _ denseMatrix = diagDense - _ Diagonal = diagDense - _ MutableDiagonal = diagDense - _ Triangular = diagDense - _ TriBanded = diagDense - _ Symmetric = diagDense - _ SymBanded = diagDense - _ Banded = diagDense - _ RawBander = diagDense - _ RawSymBander = diagDense - - diag Diagonal - _ Matrix = diag - _ Diagonal = diag - _ Triangular = diag - _ TriBanded = diag - _ Symmetric = diag - _ SymBanded = diag - _ Banded = diag -) - -// Diagonal represents a diagonal matrix, that is a square matrix that only -// has non-zero terms on the diagonal. -type Diagonal interface { - Matrix - // Diag returns the number of rows/columns in the matrix. - Diag() int - - // Bandwidth and TBand are included in the Diagonal interface - // to allow the use of Diagonal types in banded functions. - // Bandwidth will always return (0, 0). - Bandwidth() (kl, ku int) - TBand() Banded - - // Triangle and TTri are included in the Diagonal interface - // to allow the use of Diagonal types in triangular functions. - Triangle() (int, TriKind) - TTri() Triangular - - // Symmetric and SymBand are included in the Diagonal interface - // to allow the use of Diagonal types in symmetric and banded symmetric - // functions respectively. - Symmetric() int - SymBand() (n, k int) - - // TriBand and TTriBand are included in the Diagonal interface - // to allow the use of Diagonal types in triangular banded functions. - TriBand() (n, k int, kind TriKind) - TTriBand() TriBanded -} - -// MutableDiagonal is a Diagonal matrix whose elements can be set. -type MutableDiagonal interface { - Diagonal - SetDiag(i int, v float64) -} - -// DiagDense represents a diagonal matrix in dense storage format. -type DiagDense struct { - mat blas64.Vector -} - -// NewDiagDense creates a new Diagonal matrix with n rows and n columns. -// The length of data must be n or data must be nil, otherwise NewDiagDense -// will panic. NewDiagDense will panic if n is zero. -func NewDiagDense(n int, data []float64) *DiagDense { - if n <= 0 { - if n == 0 { - panic(ErrZeroLength) - } - panic("mat: negative dimension") - } - if data == nil { - data = make([]float64, n) - } - if len(data) != n { - panic(ErrShape) - } - return &DiagDense{ - mat: blas64.Vector{N: n, Data: data, Inc: 1}, - } -} - -// Diag returns the dimension of the receiver. -func (d *DiagDense) Diag() int { - return d.mat.N -} - -// Dims returns the dimensions of the matrix. -func (d *DiagDense) Dims() (r, c int) { - return d.mat.N, d.mat.N -} - -// T returns the transpose of the matrix. -func (d *DiagDense) T() Matrix { - return d -} - -// TTri returns the transpose of the matrix. Note that Diagonal matrices are -// Upper by default. -func (d *DiagDense) TTri() Triangular { - return TransposeTri{d} -} - -// TBand performs an implicit transpose by returning the receiver inside a -// TransposeBand. -func (d *DiagDense) TBand() Banded { - return TransposeBand{d} -} - -// TTriBand performs an implicit transpose by returning the receiver inside a -// TransposeTriBand. Note that Diagonal matrices are Upper by default. -func (d *DiagDense) TTriBand() TriBanded { - return TransposeTriBand{d} -} - -// Bandwidth returns the upper and lower bandwidths of the matrix. -// These values are always zero for diagonal matrices. -func (d *DiagDense) Bandwidth() (kl, ku int) { - return 0, 0 -} - -// Symmetric implements the Symmetric interface. -func (d *DiagDense) Symmetric() int { - return d.mat.N -} - -// SymBand returns the number of rows/columns in the matrix, and the size of -// the bandwidth. -func (d *DiagDense) SymBand() (n, k int) { - return d.mat.N, 0 -} - -// Triangle implements the Triangular interface. -func (d *DiagDense) Triangle() (int, TriKind) { - return d.mat.N, Upper -} - -// TriBand returns the number of rows/columns in the matrix, the -// size of the bandwidth, and the orientation. Note that Diagonal matrices are -// Upper by default. -func (d *DiagDense) TriBand() (n, k int, kind TriKind) { - return d.mat.N, 0, Upper -} - -// Reset empties the matrix so that it can be reused as the -// receiver of a dimensionally restricted operation. -// -// Reset should not be used when the matrix shares backing data. -// See the Reseter interface for more information. -func (d *DiagDense) Reset() { - // No change of Inc or n to 0 may be - // made unless both are set to 0. - d.mat.Inc = 0 - d.mat.N = 0 - d.mat.Data = d.mat.Data[:0] -} - -// Zero sets all of the matrix elements to zero. -func (d *DiagDense) Zero() { - for i := 0; i < d.mat.N; i++ { - d.mat.Data[d.mat.Inc*i] = 0 - } -} - -// DiagView returns the diagonal as a matrix backed by the original data. -func (d *DiagDense) DiagView() Diagonal { - return d -} - -// DiagFrom copies the diagonal of m into the receiver. The receiver must -// be min(r, c) long or empty, otherwise DiagFrom will panic. -func (d *DiagDense) DiagFrom(m Matrix) { - n := min(m.Dims()) - d.reuseAsNonZeroed(n) - - var vec blas64.Vector - switch r := m.(type) { - case *DiagDense: - vec = r.mat - case RawBander: - mat := r.RawBand() - vec = blas64.Vector{ - N: n, - Inc: mat.Stride, - Data: mat.Data[mat.KL : (n-1)*mat.Stride+mat.KL+1], - } - case RawMatrixer: - mat := r.RawMatrix() - vec = blas64.Vector{ - N: n, - Inc: mat.Stride + 1, - Data: mat.Data[:(n-1)*mat.Stride+n], - } - case RawSymBander: - mat := r.RawSymBand() - vec = blas64.Vector{ - N: n, - Inc: mat.Stride, - Data: mat.Data[:(n-1)*mat.Stride+1], - } - case RawSymmetricer: - mat := r.RawSymmetric() - vec = blas64.Vector{ - N: n, - Inc: mat.Stride + 1, - Data: mat.Data[:(n-1)*mat.Stride+n], - } - case RawTriBander: - mat := r.RawTriBand() - data := mat.Data - if mat.Uplo == blas.Lower { - data = data[mat.K:] - } - vec = blas64.Vector{ - N: n, - Inc: mat.Stride, - Data: data[:(n-1)*mat.Stride+1], - } - case RawTriangular: - mat := r.RawTriangular() - if mat.Diag == blas.Unit { - for i := 0; i < n; i += d.mat.Inc { - d.mat.Data[i] = 1 - } - return - } - vec = blas64.Vector{ - N: n, - Inc: mat.Stride + 1, - Data: mat.Data[:(n-1)*mat.Stride+n], - } - case RawVectorer: - d.mat.Data[0] = r.RawVector().Data[0] - return - default: - for i := 0; i < n; i++ { - d.setDiag(i, m.At(i, i)) - } - return - } - blas64.Copy(vec, d.mat) -} - -// RawBand returns the underlying data used by the receiver represented -// as a blas64.Band. -// Changes to elements in the receiver following the call will be reflected -// in returned blas64.Band. -func (d *DiagDense) RawBand() blas64.Band { - return blas64.Band{ - Rows: d.mat.N, - Cols: d.mat.N, - KL: 0, - KU: 0, - Stride: d.mat.Inc, - Data: d.mat.Data, - } -} - -// RawSymBand returns the underlying data used by the receiver represented -// as a blas64.SymmetricBand. -// Changes to elements in the receiver following the call will be reflected -// in returned blas64.Band. -func (d *DiagDense) RawSymBand() blas64.SymmetricBand { - return blas64.SymmetricBand{ - N: d.mat.N, - K: 0, - Stride: d.mat.Inc, - Uplo: blas.Upper, - Data: d.mat.Data, - } -} - -// reuseAsNonZeroed resizes an empty diagonal to a r×r diagonal, -// or checks that a non-empty matrix is r×r. -func (d *DiagDense) reuseAsNonZeroed(r int) { - if r == 0 { - panic(ErrZeroLength) - } - if d.IsEmpty() { - d.mat = blas64.Vector{ - Inc: 1, - Data: use(d.mat.Data, r), - } - d.mat.N = r - return - } - if r != d.mat.N { - panic(ErrShape) - } -} - -// IsEmpty returns whether the receiver is empty. Empty matrices can be the -// receiver for size-restricted operations. The receiver can be emptied using -// Reset. -func (d *DiagDense) IsEmpty() bool { - // It must be the case that d.Dims() returns - // zeros in this case. See comment in Reset(). - return d.mat.Inc == 0 -} - -// Trace returns the trace. -func (d *DiagDense) Trace() float64 { - rb := d.RawBand() - var tr float64 - for i := 0; i < rb.Rows; i++ { - tr += rb.Data[rb.KL+i*rb.Stride] - } - return tr - -} diff --git a/vendor/gonum.org/v1/gonum/mat/doc.go b/vendor/gonum.org/v1/gonum/mat/doc.go deleted file mode 100644 index 6d8e873..0000000 --- a/vendor/gonum.org/v1/gonum/mat/doc.go +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright ©2015 The Gonum 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 mat provides implementations of float64 and complex128 matrix -// structures and linear algebra operations on them. -// -// Overview -// -// This section provides a quick overview of the mat package. The following -// sections provide more in depth commentary. -// -// mat provides: -// - Interfaces for Matrix classes (Matrix, Symmetric, Triangular) -// - Concrete implementations (Dense, SymDense, TriDense) -// - Methods and functions for using matrix data (Add, Trace, SymRankOne) -// - Types for constructing and using matrix factorizations (QR, LU) -// - The complementary types for complex matrices, CMatrix, CSymDense, etc. -// In the documentation below, we use "matrix" as a short-hand for all of -// the FooDense types implemented in this package. We use "Matrix" to -// refer to the Matrix interface. -// -// A matrix may be constructed through the corresponding New function. If no -// backing array is provided the matrix will be initialized to all zeros. -// // Allocate a zeroed real matrix of size 3×5 -// zero := mat.NewDense(3, 5, nil) -// If a backing data slice is provided, the matrix will have those elements. -// All matrices are all stored in row-major format. -// // Generate a 6×6 matrix of random values. -// data := make([]float64, 36) -// for i := range data { -// data[i] = rand.NormFloat64() -// } -// a := mat.NewDense(6, 6, data) -// Operations involving matrix data are implemented as functions when the values -// of the matrix remain unchanged -// tr := mat.Trace(a) -// and are implemented as methods when the operation modifies the receiver. -// zero.Copy(a) -// Note that the input arguments to most functions and methods are interfaces -// rather than concrete types `func Trace(Matrix)` rather than -// `func Trace(*Dense)` allowing flexible use of internal and external -// Matrix types. -// -// When a matrix is the destination or receiver for a function or method, -// the operation will panic if the matrix is not the correct size. -// An exception is if that destination is empty (see below). -// -// Empty matrix -// -// An empty matrix is one that has zero size. Empty matrices are used to allow -// the destination of a matrix operation to assume the correct size automatically. -// This operation will re-use the backing data, if available, or will allocate -// new data if necessary. The IsEmpty method returns whether the given matrix -// is empty. The zero-value of a matrix is empty, and is useful for easily -// getting the result of matrix operations. -// var c mat.Dense // construct a new zero-value matrix -// c.Mul(a, a) // c is automatically adjusted to be the right size -// The Reset method can be used to revert a matrix to an empty matrix. -// Reset should not be used when multiple different matrices share the same backing -// data slice. This can cause unexpected data modifications after being resized. -// An empty matrix can not be sliced even if it does have an adequately sized -// backing data slice, but can be expanded using its Grow method if it exists. -// -// The Matrix Interfaces -// -// The Matrix interface is the common link between the concrete types of real -// matrices, The Matrix interface is defined by three functions: Dims, which -// returns the dimensions of the Matrix, At, which returns the element in the -// specified location, and T for returning a Transpose (discussed later). All of -// the matrix types can perform these behaviors and so implement the interface. -// Methods and functions are designed to use this interface, so in particular the method -// func (m *Dense) Mul(a, b Matrix) -// constructs a *Dense from the result of a multiplication with any Matrix types, -// not just *Dense. Where more restrictive requirements must be met, there are also -// additional interfaces like Symmetric and Triangular. For example, in -// func (s *SymDense) AddSym(a, b Symmetric) -// the Symmetric interface guarantees a symmetric result. -// -// The CMatrix interface plays the same role for complex matrices. The difference -// is that the CMatrix type has the H method instead T, for returning the conjugate -// transpose. -// -// (Conjugate) Transposes -// -// The T method is used for transposition on real matrices, and H is used for -// conjugate transposition on complex matrices. For example, c.Mul(a.T(), b) computes -// c = aᵀ * b. The mat types implement this method implicitly — -// see the Transpose and Conjugate types for more details. Note that some -// operations have a transpose as part of their definition, as in *SymDense.SymOuterK. -// -// Matrix Factorization -// -// Matrix factorizations, such as the LU decomposition, typically have their own -// specific data storage, and so are each implemented as a specific type. The -// factorization can be computed through a call to Factorize -// var lu mat.LU -// lu.Factorize(a) -// The elements of the factorization can be extracted through methods on the -// factorized type, i.e. *LU.UTo. The factorization types can also be used directly, -// as in *Dense.SolveCholesky. Some factorizations can be updated directly, -// without needing to update the original matrix and refactorize, -// as in *LU.RankOne. -// -// BLAS and LAPACK -// -// BLAS and LAPACK are the standard APIs for linear algebra routines. Many -// operations in mat are implemented using calls to the wrapper functions -// in gonum/blas/blas64 and gonum/lapack/lapack64 and their complex equivalents. -// By default, blas64 and lapack64 call the native Go implementations of the -// routines. Alternatively, it is possible to use C-based implementations of the -// APIs through the respective cgo packages and "Use" functions. The Go -// implementation of LAPACK (used by default) makes calls -// through blas64, so if a cgo BLAS implementation is registered, the lapack64 -// calls will be partially executed in Go and partially executed in C. -// -// Type Switching -// -// The Matrix abstraction enables efficiency as well as interoperability. Go's -// type reflection capabilities are used to choose the most efficient routine -// given the specific concrete types. For example, in -// c.Mul(a, b) -// if a and b both implement RawMatrixer, that is, they can be represented as a -// blas64.General, blas64.Gemm (general matrix multiplication) is called, while -// instead if b is a RawSymmetricer blas64.Symm is used (general-symmetric -// multiplication), and if b is a *VecDense blas64.Gemv is used. -// -// There are many possible type combinations and special cases. No specific guarantees -// are made about the performance of any method, and in particular, note that an -// abstract matrix type may be copied into a concrete type of the corresponding -// value. If there are specific special cases that are needed, please submit a -// pull-request or file an issue. -// -// Invariants -// -// Matrix input arguments to functions are never directly modified. If an operation -// changes Matrix data, the mutated matrix will be the receiver of a method, or -// will be the first argument to a method or function. -// -// For convenience, a matrix may be used as both a receiver and as an input, e.g. -// a.Pow(a, 6) -// v.SolveVec(a.T(), v) -// though in many cases this will cause an allocation (see Element Aliasing). -// An exception to this rule is Copy, which does not allow a.Copy(a.T()). -// -// Element Aliasing -// -// Most methods in mat modify receiver data. It is forbidden for the modified -// data region of the receiver to overlap the used data area of the input -// arguments. The exception to this rule is when the method receiver is equal to one -// of the input arguments, as in the a.Pow(a, 6) call above, or its implicit transpose. -// -// This prohibition is to help avoid subtle mistakes when the method needs to read -// from and write to the same data region. There are ways to make mistakes using the -// mat API, and mat functions will detect and complain about those. -// There are many ways to make mistakes by excursion from the mat API via -// interaction with raw matrix values. -// -// If you need to read the rest of this section to understand the behavior of -// your program, you are being clever. Don't be clever. If you must be clever, -// blas64 and lapack64 may be used to call the behavior directly. -// -// mat will use the following rules to detect overlap between the receiver and one -// of the inputs: -// - the input implements one of the Raw methods, and -// - the address ranges of the backing data slices overlap, and -// - the strides differ or there is an overlap in the used data elements. -// If such an overlap is detected, the method will panic. -// -// The following cases will not panic: -// - the data slices do not overlap, -// - there is pointer identity between the receiver and input values after -// the value has been untransposed if necessary. -// -// mat will not attempt to detect element overlap if the input does not implement a -// Raw method. Method behavior is undefined if there is undetected overlap. -// -package mat // import "gonum.org/v1/gonum/mat" diff --git a/vendor/gonum.org/v1/gonum/mat/eigen.go b/vendor/gonum.org/v1/gonum/mat/eigen.go deleted file mode 100644 index 4bed406..0000000 --- a/vendor/gonum.org/v1/gonum/mat/eigen.go +++ /dev/null @@ -1,360 +0,0 @@ -// Copyright ©2013 The Gonum 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 mat - -import ( - "gonum.org/v1/gonum/lapack" - "gonum.org/v1/gonum/lapack/lapack64" -) - -const ( - badFact = "mat: use without successful factorization" - noVectors = "mat: eigenvectors not computed" -) - -// EigenSym is a type for creating and manipulating the Eigen decomposition of -// symmetric matrices. -type EigenSym struct { - vectorsComputed bool - - values []float64 - vectors *Dense -} - -// Factorize computes the eigenvalue decomposition of the symmetric matrix a. -// The Eigen decomposition is defined as -// A = P * D * P^-1 -// where D is a diagonal matrix containing the eigenvalues of the matrix, and -// P is a matrix of the eigenvectors of A. Factorize computes the eigenvalues -// in ascending order. If the vectors input argument is false, the eigenvectors -// are not computed. -// -// Factorize returns whether the decomposition succeeded. If the decomposition -// failed, methods that require a successful factorization will panic. -func (e *EigenSym) Factorize(a Symmetric, vectors bool) (ok bool) { - // kill previous decomposition - e.vectorsComputed = false - e.values = e.values[:] - - n := a.Symmetric() - sd := NewSymDense(n, nil) - sd.CopySym(a) - - jobz := lapack.EVNone - if vectors { - jobz = lapack.EVCompute - } - w := make([]float64, n) - work := []float64{0} - lapack64.Syev(jobz, sd.mat, w, work, -1) - - work = getFloats(int(work[0]), false) - ok = lapack64.Syev(jobz, sd.mat, w, work, len(work)) - putFloats(work) - if !ok { - e.vectorsComputed = false - e.values = nil - e.vectors = nil - return false - } - e.vectorsComputed = vectors - e.values = w - e.vectors = NewDense(n, n, sd.mat.Data) - return true -} - -// succFact returns whether the receiver contains a successful factorization. -func (e *EigenSym) succFact() bool { - return len(e.values) != 0 -} - -// Values extracts the eigenvalues of the factorized matrix. If dst is -// non-nil, the values are stored in-place into dst. In this case -// dst must have length n, otherwise Values will panic. If dst is -// nil, then a new slice will be allocated of the proper length and filled -// with the eigenvalues. -// -// Values panics if the Eigen decomposition was not successful. -func (e *EigenSym) Values(dst []float64) []float64 { - if !e.succFact() { - panic(badFact) - } - if dst == nil { - dst = make([]float64, len(e.values)) - } - if len(dst) != len(e.values) { - panic(ErrSliceLengthMismatch) - } - copy(dst, e.values) - return dst -} - -// VectorsTo stores the eigenvectors of the decomposition into the columns of -// dst. -// -// If dst is empty, VectorsTo will resize dst to be n×n. When dst is -// non-empty, VectorsTo will panic if dst is not n×n. VectorsTo will also -// panic if the eigenvectors were not computed during the factorization, -// or if the receiver does not contain a successful factorization. -func (e *EigenSym) VectorsTo(dst *Dense) { - if !e.succFact() { - panic(badFact) - } - if !e.vectorsComputed { - panic(noVectors) - } - r, c := e.vectors.Dims() - if dst.IsEmpty() { - dst.ReuseAs(r, c) - } else { - r2, c2 := dst.Dims() - if r != r2 || c != c2 { - panic(ErrShape) - } - } - dst.Copy(e.vectors) -} - -// EigenKind specifies the computation of eigenvectors during factorization. -type EigenKind int - -const ( - // EigenNone specifies to not compute any eigenvectors. - EigenNone EigenKind = 0 - // EigenLeft specifies to compute the left eigenvectors. - EigenLeft EigenKind = 1 << iota - // EigenRight specifies to compute the right eigenvectors. - EigenRight - // EigenBoth is a convenience value for computing both eigenvectors. - EigenBoth EigenKind = EigenLeft | EigenRight -) - -// Eigen is a type for creating and using the eigenvalue decomposition of a dense matrix. -type Eigen struct { - n int // The size of the factorized matrix. - - kind EigenKind - - values []complex128 - rVectors *CDense - lVectors *CDense -} - -// succFact returns whether the receiver contains a successful factorization. -func (e *Eigen) succFact() bool { - return e.n != 0 -} - -// Factorize computes the eigenvalues of the square matrix a, and optionally -// the eigenvectors. -// -// A right eigenvalue/eigenvector combination is defined by -// A * x_r = λ * x_r -// where x_r is the column vector called an eigenvector, and λ is the corresponding -// eigenvalue. -// -// Similarly, a left eigenvalue/eigenvector combination is defined by -// x_l * A = λ * x_l -// The eigenvalues, but not the eigenvectors, are the same for both decompositions. -// -// Typically eigenvectors refer to right eigenvectors. -// -// In all cases, Factorize computes the eigenvalues of the matrix. kind -// specifies which of the eigenvectors, if any, to compute. See the EigenKind -// documentation for more information. -// Eigen panics if the input matrix is not square. -// -// Factorize returns whether the decomposition succeeded. If the decomposition -// failed, methods that require a successful factorization will panic. -func (e *Eigen) Factorize(a Matrix, kind EigenKind) (ok bool) { - // kill previous factorization. - e.n = 0 - e.kind = 0 - // Copy a because it is modified during the Lapack call. - r, c := a.Dims() - if r != c { - panic(ErrShape) - } - var sd Dense - sd.CloneFrom(a) - - left := kind&EigenLeft != 0 - right := kind&EigenRight != 0 - - var vl, vr Dense - jobvl := lapack.LeftEVNone - jobvr := lapack.RightEVNone - if left { - vl = *NewDense(r, r, nil) - jobvl = lapack.LeftEVCompute - } - if right { - vr = *NewDense(c, c, nil) - jobvr = lapack.RightEVCompute - } - - wr := getFloats(c, false) - defer putFloats(wr) - wi := getFloats(c, false) - defer putFloats(wi) - - work := []float64{0} - lapack64.Geev(jobvl, jobvr, sd.mat, wr, wi, vl.mat, vr.mat, work, -1) - work = getFloats(int(work[0]), false) - first := lapack64.Geev(jobvl, jobvr, sd.mat, wr, wi, vl.mat, vr.mat, work, len(work)) - putFloats(work) - - if first != 0 { - e.values = nil - return false - } - e.n = r - e.kind = kind - - // Construct complex eigenvalues from float64 data. - values := make([]complex128, r) - for i, v := range wr { - values[i] = complex(v, wi[i]) - } - e.values = values - - // Construct complex eigenvectors from float64 data. - var cvl, cvr CDense - if left { - cvl = *NewCDense(r, r, nil) - e.complexEigenTo(&cvl, &vl) - e.lVectors = &cvl - } else { - e.lVectors = nil - } - if right { - cvr = *NewCDense(c, c, nil) - e.complexEigenTo(&cvr, &vr) - e.rVectors = &cvr - } else { - e.rVectors = nil - } - return true -} - -// Kind returns the EigenKind of the decomposition. If no decomposition has been -// computed, Kind returns -1. -func (e *Eigen) Kind() EigenKind { - if !e.succFact() { - return -1 - } - return e.kind -} - -// Values extracts the eigenvalues of the factorized matrix. If dst is -// non-nil, the values are stored in-place into dst. In this case -// dst must have length n, otherwise Values will panic. If dst is -// nil, then a new slice will be allocated of the proper length and -// filed with the eigenvalues. -// -// Values panics if the Eigen decomposition was not successful. -func (e *Eigen) Values(dst []complex128) []complex128 { - if !e.succFact() { - panic(badFact) - } - if dst == nil { - dst = make([]complex128, e.n) - } - if len(dst) != e.n { - panic(ErrSliceLengthMismatch) - } - copy(dst, e.values) - return dst -} - -// complexEigenTo extracts the complex eigenvectors from the real matrix d -// and stores them into the complex matrix dst. -// -// The columns of the returned n×n dense matrix contain the eigenvectors of the -// decomposition in the same order as the eigenvalues. -// If the j-th eigenvalue is real, then -// dst[:,j] = d[:,j], -// and if it is not real, then the elements of the j-th and (j+1)-th columns of d -// form complex conjugate pairs and the eigenvectors are recovered as -// dst[:,j] = d[:,j] + i*d[:,j+1], -// dst[:,j+1] = d[:,j] - i*d[:,j+1], -// where i is the imaginary unit. -func (e *Eigen) complexEigenTo(dst *CDense, d *Dense) { - r, c := d.Dims() - cr, cc := dst.Dims() - if r != cr { - panic("size mismatch") - } - if c != cc { - panic("size mismatch") - } - for j := 0; j < c; j++ { - if imag(e.values[j]) == 0 { - for i := 0; i < r; i++ { - dst.set(i, j, complex(d.at(i, j), 0)) - } - continue - } - for i := 0; i < r; i++ { - real := d.at(i, j) - imag := d.at(i, j+1) - dst.set(i, j, complex(real, imag)) - dst.set(i, j+1, complex(real, -imag)) - } - j++ - } -} - -// VectorsTo stores the right eigenvectors of the decomposition into the columns -// of dst. The computed eigenvectors are normalized to have Euclidean norm equal -// to 1 and largest component real. -// -// If dst is empty, VectorsTo will resize dst to be n×n. When dst is -// non-empty, VectorsTo will panic if dst is not n×n. VectorsTo will also -// panic if the eigenvectors were not computed during the factorization, -// or if the receiver does not contain a successful factorization. -func (e *Eigen) VectorsTo(dst *CDense) { - if !e.succFact() { - panic(badFact) - } - if e.kind&EigenRight == 0 { - panic(noVectors) - } - if dst.IsEmpty() { - dst.ReuseAs(e.n, e.n) - } else { - r, c := dst.Dims() - if r != e.n || c != e.n { - panic(ErrShape) - } - } - dst.Copy(e.rVectors) -} - -// LeftVectorsTo stores the left eigenvectors of the decomposition into the -// columns of dst. The computed eigenvectors are normalized to have Euclidean -// norm equal to 1 and largest component real. -// -// If dst is empty, LeftVectorsTo will resize dst to be n×n. When dst is -// non-empty, LeftVectorsTo will panic if dst is not n×n. LeftVectorsTo will also -// panic if the left eigenvectors were not computed during the factorization, -// or if the receiver does not contain a successful factorization -func (e *Eigen) LeftVectorsTo(dst *CDense) { - if !e.succFact() { - panic(badFact) - } - if e.kind&EigenLeft == 0 { - panic(noVectors) - } - if dst.IsEmpty() { - dst.ReuseAs(e.n, e.n) - } else { - r, c := dst.Dims() - if r != e.n || c != e.n { - panic(ErrShape) - } - } - dst.Copy(e.lVectors) -} diff --git a/vendor/gonum.org/v1/gonum/mat/errors.go b/vendor/gonum.org/v1/gonum/mat/errors.go deleted file mode 100644 index 8609f7c..0000000 --- a/vendor/gonum.org/v1/gonum/mat/errors.go +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright ©2013 The Gonum 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 mat - -import ( - "fmt" - "runtime" - - "gonum.org/v1/gonum/lapack" -) - -// Condition is the condition number of a matrix. The condition -// number is defined as |A| * |A^-1|. -// -// One important use of Condition is during linear solve routines (finding x such -// that A * x = b). The condition number of A indicates the accuracy of -// the computed solution. A Condition error will be returned if the condition -// number of A is sufficiently large. If A is exactly singular to working precision, -// Condition == ∞, and the solve algorithm may have completed early. If Condition -// is large and finite the solve algorithm will be performed, but the computed -// solution may be innacurate. Due to the nature of finite precision arithmetic, -// the value of Condition is only an approximate test of singularity. -type Condition float64 - -func (c Condition) Error() string { - return fmt.Sprintf("matrix singular or near-singular with condition number %.4e", c) -} - -// ConditionTolerance is the tolerance limit of the condition number. If the -// condition number is above this value, the matrix is considered singular. -const ConditionTolerance = 1e16 - -const ( - // CondNorm is the matrix norm used for computing the condition number by routines - // in the matrix packages. - CondNorm = lapack.MaxRowSum - - // CondNormTrans is the norm used to compute on Aᵀ to get the same result as - // computing CondNorm on A. - CondNormTrans = lapack.MaxColumnSum -) - -const stackTraceBufferSize = 1 << 20 - -// Maybe will recover a panic with a type mat.Error from fn, and return this error -// as the Err field of an ErrorStack. The stack trace for the panicking function will be -// recovered and placed in the StackTrace field. Any other error is re-panicked. -func Maybe(fn func()) (err error) { - defer func() { - if r := recover(); r != nil { - if e, ok := r.(Error); ok { - if e.string == "" { - panic("mat: invalid error") - } - buf := make([]byte, stackTraceBufferSize) - n := runtime.Stack(buf, false) - err = ErrorStack{Err: e, StackTrace: string(buf[:n])} - return - } - panic(r) - } - }() - fn() - return -} - -// MaybeFloat will recover a panic with a type mat.Error from fn, and return this error -// as the Err field of an ErrorStack. The stack trace for the panicking function will be -// recovered and placed in the StackTrace field. Any other error is re-panicked. -func MaybeFloat(fn func() float64) (f float64, err error) { - defer func() { - if r := recover(); r != nil { - if e, ok := r.(Error); ok { - if e.string == "" { - panic("mat: invalid error") - } - buf := make([]byte, stackTraceBufferSize) - n := runtime.Stack(buf, false) - err = ErrorStack{Err: e, StackTrace: string(buf[:n])} - return - } - panic(r) - } - }() - return fn(), nil -} - -// MaybeComplex will recover a panic with a type mat.Error from fn, and return this error -// as the Err field of an ErrorStack. The stack trace for the panicking function will be -// recovered and placed in the StackTrace field. Any other error is re-panicked. -func MaybeComplex(fn func() complex128) (f complex128, err error) { - defer func() { - if r := recover(); r != nil { - if e, ok := r.(Error); ok { - if e.string == "" { - panic("mat: invalid error") - } - buf := make([]byte, stackTraceBufferSize) - n := runtime.Stack(buf, false) - err = ErrorStack{Err: e, StackTrace: string(buf[:n])} - return - } - panic(r) - } - }() - return fn(), nil -} - -// Error represents matrix handling errors. These errors can be recovered by Maybe wrappers. -type Error struct{ string } - -func (err Error) Error() string { return err.string } - -var ( - ErrNegativeDimension = Error{"mat: negative dimension"} - ErrIndexOutOfRange = Error{"mat: index out of range"} - ErrReuseNonEmpty = Error{"mat: reuse of non-empty matrix"} - ErrRowAccess = Error{"mat: row index out of range"} - ErrColAccess = Error{"mat: column index out of range"} - ErrVectorAccess = Error{"mat: vector index out of range"} - ErrZeroLength = Error{"mat: zero length in matrix dimension"} - ErrRowLength = Error{"mat: row length mismatch"} - ErrColLength = Error{"mat: col length mismatch"} - ErrSquare = Error{"mat: expect square matrix"} - ErrNormOrder = Error{"mat: invalid norm order for matrix"} - ErrSingular = Error{"mat: matrix is singular"} - ErrShape = Error{"mat: dimension mismatch"} - ErrIllegalStride = Error{"mat: illegal stride"} - ErrPivot = Error{"mat: malformed pivot list"} - ErrTriangle = Error{"mat: triangular storage mismatch"} - ErrTriangleSet = Error{"mat: triangular set out of bounds"} - ErrBandSet = Error{"mat: band set out of bounds"} - ErrDiagSet = Error{"mat: diagonal set out of bounds"} - ErrSliceLengthMismatch = Error{"mat: input slice length mismatch"} - ErrNotPSD = Error{"mat: input not positive symmetric definite"} - ErrFailedEigen = Error{"mat: eigendecomposition not successful"} -) - -// ErrorStack represents matrix handling errors that have been recovered by Maybe wrappers. -type ErrorStack struct { - Err error - - // StackTrace is the stack trace - // recovered by Maybe, MaybeFloat - // or MaybeComplex. - StackTrace string -} - -func (err ErrorStack) Error() string { return err.Err.Error() } diff --git a/vendor/gonum.org/v1/gonum/mat/format.go b/vendor/gonum.org/v1/gonum/mat/format.go deleted file mode 100644 index 9b60cb3..0000000 --- a/vendor/gonum.org/v1/gonum/mat/format.go +++ /dev/null @@ -1,238 +0,0 @@ -// Copyright ©2013 The Gonum 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 mat - -import ( - "fmt" - "strconv" -) - -// Formatted returns a fmt.Formatter for the matrix m using the given options. -func Formatted(m Matrix, options ...FormatOption) fmt.Formatter { - f := formatter{ - matrix: m, - dot: '.', - } - for _, o := range options { - o(&f) - } - return f -} - -type formatter struct { - matrix Matrix - prefix string - margin int - dot byte - squeeze bool -} - -// FormatOption is a functional option for matrix formatting. -type FormatOption func(*formatter) - -// Prefix sets the formatted prefix to the string p. Prefix is a string that is prepended to -// each line of output. -func Prefix(p string) FormatOption { - return func(f *formatter) { f.prefix = p } -} - -// Excerpt sets the maximum number of rows and columns to print at the margins of the matrix -// to m. If m is zero or less all elements are printed. -func Excerpt(m int) FormatOption { - return func(f *formatter) { f.margin = m } -} - -// DotByte sets the dot character to b. The dot character is used to replace zero elements -// if the result is printed with the fmt ' ' verb flag. Without a DotByte option, the default -// dot character is '.'. -func DotByte(b byte) FormatOption { - return func(f *formatter) { f.dot = b } -} - -// Squeeze sets the printing behaviour to minimise column width for each individual column. -func Squeeze() FormatOption { - return func(f *formatter) { f.squeeze = true } -} - -// Format satisfies the fmt.Formatter interface. -func (f formatter) Format(fs fmt.State, c rune) { - if c == 'v' && fs.Flag('#') { - fmt.Fprintf(fs, "%#v", f.matrix) - return - } - format(f.matrix, f.prefix, f.margin, f.dot, f.squeeze, fs, c) -} - -// format prints a pretty representation of m to the fs io.Writer. The format character c -// specifies the numerical representation of elements; valid values are those for float64 -// specified in the fmt package, with their associated flags. In addition to this, a space -// preceding a verb indicates that zero values should be represented by the dot character. -// The printed range of the matrix can be limited by specifying a positive value for margin; -// If margin is greater than zero, only the first and last margin rows/columns of the matrix -// are output. If squeeze is true, column widths are determined on a per-column basis. -// -// format will not provide Go syntax output. -func format(m Matrix, prefix string, margin int, dot byte, squeeze bool, fs fmt.State, c rune) { - rows, cols := m.Dims() - - var printed int - if margin <= 0 { - printed = rows - if cols > printed { - printed = cols - } - } else { - printed = margin - } - - prec, pOk := fs.Precision() - if !pOk { - prec = -1 - } - - var ( - maxWidth int - widths widther - buf, pad []byte - ) - if squeeze { - widths = make(columnWidth, cols) - } else { - widths = new(uniformWidth) - } - switch c { - case 'v', 'e', 'E', 'f', 'F', 'g', 'G': - if c == 'v' { - buf, maxWidth = maxCellWidth(m, 'g', printed, prec, widths) - } else { - buf, maxWidth = maxCellWidth(m, c, printed, prec, widths) - } - default: - fmt.Fprintf(fs, "%%!%c(%T=Dims(%d, %d))", c, m, rows, cols) - return - } - width, _ := fs.Width() - width = max(width, maxWidth) - pad = make([]byte, max(width, 2)) - for i := range pad { - pad[i] = ' ' - } - - first := true - if rows > 2*printed || cols > 2*printed { - first = false - fmt.Fprintf(fs, "Dims(%d, %d)\n", rows, cols) - } - - skipZero := fs.Flag(' ') - for i := 0; i < rows; i++ { - if !first { - fmt.Fprint(fs, prefix) - } - first = false - var el string - switch { - case rows == 1: - fmt.Fprint(fs, "[") - el = "]" - case i == 0: - fmt.Fprint(fs, "⎡") - el = "⎤\n" - case i < rows-1: - fmt.Fprint(fs, "⎢") - el = "⎥\n" - default: - fmt.Fprint(fs, "⎣") - el = "⎦" - } - - for j := 0; j < cols; j++ { - if j >= printed && j < cols-printed { - j = cols - printed - 1 - if i == 0 || i == rows-1 { - fmt.Fprint(fs, "... ... ") - } else { - fmt.Fprint(fs, " ") - } - continue - } - - v := m.At(i, j) - if v == 0 && skipZero { - buf = buf[:1] - buf[0] = dot - } else { - if c == 'v' { - buf = strconv.AppendFloat(buf[:0], v, 'g', prec, 64) - } else { - buf = strconv.AppendFloat(buf[:0], v, byte(c), prec, 64) - } - } - if fs.Flag('-') { - fs.Write(buf) - fs.Write(pad[:widths.width(j)-len(buf)]) - } else { - fs.Write(pad[:widths.width(j)-len(buf)]) - fs.Write(buf) - } - - if j < cols-1 { - fs.Write(pad[:2]) - } - } - - fmt.Fprint(fs, el) - - if i >= printed-1 && i < rows-printed && 2*printed < rows { - i = rows - printed - 1 - fmt.Fprintf(fs, "%s .\n%[1]s .\n%[1]s .\n", prefix) - continue - } - } -} - -func maxCellWidth(m Matrix, c rune, printed, prec int, w widther) ([]byte, int) { - var ( - buf = make([]byte, 0, 64) - rows, cols = m.Dims() - max int - ) - for i := 0; i < rows; i++ { - if i >= printed-1 && i < rows-printed && 2*printed < rows { - i = rows - printed - 1 - continue - } - for j := 0; j < cols; j++ { - if j >= printed && j < cols-printed { - continue - } - - buf = strconv.AppendFloat(buf, m.At(i, j), byte(c), prec, 64) - if len(buf) > max { - max = len(buf) - } - if len(buf) > w.width(j) { - w.setWidth(j, len(buf)) - } - buf = buf[:0] - } - } - return buf, max -} - -type widther interface { - width(i int) int - setWidth(i, w int) -} - -type uniformWidth int - -func (u *uniformWidth) width(_ int) int { return int(*u) } -func (u *uniformWidth) setWidth(_, w int) { *u = uniformWidth(w) } - -type columnWidth []int - -func (c columnWidth) width(i int) int { return c[i] } -func (c columnWidth) setWidth(i, w int) { c[i] = w } diff --git a/vendor/gonum.org/v1/gonum/mat/gsvd.go b/vendor/gonum.org/v1/gonum/mat/gsvd.go deleted file mode 100644 index 031a822..0000000 --- a/vendor/gonum.org/v1/gonum/mat/gsvd.go +++ /dev/null @@ -1,434 +0,0 @@ -// Copyright ©2017 The Gonum 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 mat - -import ( - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/floats" - "gonum.org/v1/gonum/lapack" - "gonum.org/v1/gonum/lapack/lapack64" -) - -// GSVDKind specifies the treatment of singular vectors during a GSVD -// factorization. -type GSVDKind int - -const ( - // GSVDNone specifies that no singular vectors should be computed during - // the decomposition. - GSVDNone GSVDKind = 0 - - // GSVDU specifies that the U singular vectors should be computed during - // the decomposition. - GSVDU GSVDKind = 1 << iota - // GSVDV specifies that the V singular vectors should be computed during - // the decomposition. - GSVDV - // GSVDQ specifies that the Q singular vectors should be computed during - // the decomposition. - GSVDQ - - // GSVDAll is a convenience value for computing all of the singular vectors. - GSVDAll = GSVDU | GSVDV | GSVDQ -) - -// GSVD is a type for creating and using the Generalized Singular Value Decomposition -// (GSVD) of a matrix. -// -// The factorization is a linear transformation of the data sets from the given -// variable×sample spaces to reduced and diagonalized "eigenvariable"×"eigensample" -// spaces. -type GSVD struct { - kind GSVDKind - - r, p, c, k, l int - s1, s2 []float64 - a, b, u, v, q blas64.General - - work []float64 - iwork []int -} - -// succFact returns whether the receiver contains a successful factorization. -func (gsvd *GSVD) succFact() bool { - return gsvd.r != 0 -} - -// Factorize computes the generalized singular value decomposition (GSVD) of the input -// the r×c matrix A and the p×c matrix B. The singular values of A and B are computed -// in all cases, while the singular vectors are optionally computed depending on the -// input kind. -// -// The full singular value decomposition (kind == GSVDAll) deconstructs A and B as -// A = U * Σ₁ * [ 0 R ] * Qᵀ -// -// B = V * Σ₂ * [ 0 R ] * Qᵀ -// where Σ₁ and Σ₂ are r×(k+l) and p×(k+l) diagonal matrices of singular values, and -// U, V and Q are r×r, p×p and c×c orthogonal matrices of singular vectors. k+l is the -// effective numerical rank of the matrix [ Aᵀ Bᵀ ]ᵀ. -// -// It is frequently not necessary to compute the full GSVD. Computation time and -// storage costs can be reduced using the appropriate kind. Either only the singular -// values can be computed (kind == SVDNone), or in conjunction with specific singular -// vectors (kind bit set according to matrix.GSVDU, matrix.GSVDV and matrix.GSVDQ). -// -// Factorize returns whether the decomposition succeeded. If the decomposition -// failed, routines that require a successful factorization will panic. -func (gsvd *GSVD) Factorize(a, b Matrix, kind GSVDKind) (ok bool) { - // kill the previous decomposition - gsvd.r = 0 - gsvd.kind = 0 - - r, c := a.Dims() - gsvd.r, gsvd.c = r, c - p, c := b.Dims() - gsvd.p = p - if gsvd.c != c { - panic(ErrShape) - } - var jobU, jobV, jobQ lapack.GSVDJob - switch { - default: - panic("gsvd: bad input kind") - case kind == GSVDNone: - jobU = lapack.GSVDNone - jobV = lapack.GSVDNone - jobQ = lapack.GSVDNone - case GSVDAll&kind != 0: - if GSVDU&kind != 0 { - jobU = lapack.GSVDU - gsvd.u = blas64.General{ - Rows: r, - Cols: r, - Stride: r, - Data: use(gsvd.u.Data, r*r), - } - } - if GSVDV&kind != 0 { - jobV = lapack.GSVDV - gsvd.v = blas64.General{ - Rows: p, - Cols: p, - Stride: p, - Data: use(gsvd.v.Data, p*p), - } - } - if GSVDQ&kind != 0 { - jobQ = lapack.GSVDQ - gsvd.q = blas64.General{ - Rows: c, - Cols: c, - Stride: c, - Data: use(gsvd.q.Data, c*c), - } - } - } - - // A and B are destroyed on call, so copy the matrices. - aCopy := DenseCopyOf(a) - bCopy := DenseCopyOf(b) - - gsvd.s1 = use(gsvd.s1, c) - gsvd.s2 = use(gsvd.s2, c) - - gsvd.iwork = useInt(gsvd.iwork, c) - - gsvd.work = use(gsvd.work, 1) - lapack64.Ggsvd3(jobU, jobV, jobQ, aCopy.mat, bCopy.mat, gsvd.s1, gsvd.s2, gsvd.u, gsvd.v, gsvd.q, gsvd.work, -1, gsvd.iwork) - gsvd.work = use(gsvd.work, int(gsvd.work[0])) - gsvd.k, gsvd.l, ok = lapack64.Ggsvd3(jobU, jobV, jobQ, aCopy.mat, bCopy.mat, gsvd.s1, gsvd.s2, gsvd.u, gsvd.v, gsvd.q, gsvd.work, len(gsvd.work), gsvd.iwork) - if ok { - gsvd.a = aCopy.mat - gsvd.b = bCopy.mat - gsvd.kind = kind - } - return ok -} - -// Kind returns the GSVDKind of the decomposition. If no decomposition has been -// computed, Kind returns -1. -func (gsvd *GSVD) Kind() GSVDKind { - if !gsvd.succFact() { - return -1 - } - return gsvd.kind -} - -// Rank returns the k and l terms of the rank of [ Aᵀ Bᵀ ]ᵀ. -func (gsvd *GSVD) Rank() (k, l int) { - return gsvd.k, gsvd.l -} - -// GeneralizedValues returns the generalized singular values of the factorized matrices. -// If the input slice is non-nil, the values will be stored in-place into the slice. -// In this case, the slice must have length min(r,c)-k, and GeneralizedValues will -// panic with matrix.ErrSliceLengthMismatch otherwise. If the input slice is nil, -// a new slice of the appropriate length will be allocated and returned. -// -// GeneralizedValues will panic if the receiver does not contain a successful factorization. -func (gsvd *GSVD) GeneralizedValues(v []float64) []float64 { - if !gsvd.succFact() { - panic(badFact) - } - r := gsvd.r - c := gsvd.c - k := gsvd.k - d := min(r, c) - if v == nil { - v = make([]float64, d-k) - } - if len(v) != d-k { - panic(ErrSliceLengthMismatch) - } - floats.DivTo(v, gsvd.s1[k:d], gsvd.s2[k:d]) - return v -} - -// ValuesA returns the singular values of the factorized A matrix. -// If the input slice is non-nil, the values will be stored in-place into the slice. -// In this case, the slice must have length min(r,c)-k, and ValuesA will panic with -// matrix.ErrSliceLengthMismatch otherwise. If the input slice is nil, -// a new slice of the appropriate length will be allocated and returned. -// -// ValuesA will panic if the receiver does not contain a successful factorization. -func (gsvd *GSVD) ValuesA(s []float64) []float64 { - if !gsvd.succFact() { - panic(badFact) - } - r := gsvd.r - c := gsvd.c - k := gsvd.k - d := min(r, c) - if s == nil { - s = make([]float64, d-k) - } - if len(s) != d-k { - panic(ErrSliceLengthMismatch) - } - copy(s, gsvd.s1[k:min(r, c)]) - return s -} - -// ValuesB returns the singular values of the factorized B matrix. -// If the input slice is non-nil, the values will be stored in-place into the slice. -// In this case, the slice must have length min(r,c)-k, and ValuesB will panic with -// matrix.ErrSliceLengthMismatch otherwise. If the input slice is nil, -// a new slice of the appropriate length will be allocated and returned. -// -// ValuesB will panic if the receiver does not contain a successful factorization. -func (gsvd *GSVD) ValuesB(s []float64) []float64 { - if !gsvd.succFact() { - panic(badFact) - } - r := gsvd.r - c := gsvd.c - k := gsvd.k - d := min(r, c) - if s == nil { - s = make([]float64, d-k) - } - if len(s) != d-k { - panic(ErrSliceLengthMismatch) - } - copy(s, gsvd.s2[k:d]) - return s -} - -// ZeroRTo extracts the matrix [ 0 R ] from the singular value decomposition, -// storing the result into dst. [ 0 R ] is of size (k+l)×c. -// -// If dst is empty, ZeroRTo will resize dst to be (k+l)×c. When dst is -// non-empty, ZeroRTo will panic if dst is not (k+l)×c. ZeroRTo will also panic -// if the receiver does not contain a successful factorization. -func (gsvd *GSVD) ZeroRTo(dst *Dense) { - if !gsvd.succFact() { - panic(badFact) - } - r := gsvd.r - c := gsvd.c - k := gsvd.k - l := gsvd.l - h := min(k+l, r) - if dst.IsEmpty() { - dst.ReuseAs(k+l, c) - } else { - r2, c2 := dst.Dims() - if r2 != k+l || c != c2 { - panic(ErrShape) - } - dst.Zero() - } - a := Dense{ - mat: gsvd.a, - capRows: r, - capCols: c, - } - dst.slice(0, h, c-k-l, c).Copy(a.Slice(0, h, c-k-l, c)) - if r < k+l { - b := Dense{ - mat: gsvd.b, - capRows: gsvd.p, - capCols: c, - } - dst.slice(r, k+l, c+r-k-l, c).Copy(b.Slice(r-k, l, c+r-k-l, c)) - } -} - -// SigmaATo extracts the matrix Σ₁ from the singular value decomposition, storing -// the result into dst. Σ₁ is size r×(k+l). -// -// If dst is empty, SigmaATo will resize dst to be r×(k+l). When dst is -// non-empty, SigmATo will panic if dst is not r×(k+l). SigmaATo will also -// panic if the receiver does not contain a successful factorization. -func (gsvd *GSVD) SigmaATo(dst *Dense) { - if !gsvd.succFact() { - panic(badFact) - } - r := gsvd.r - k := gsvd.k - l := gsvd.l - if dst.IsEmpty() { - dst.ReuseAs(r, k+l) - } else { - r2, c := dst.Dims() - if r2 != r || c != k+l { - panic(ErrShape) - } - dst.Zero() - } - for i := 0; i < k; i++ { - dst.set(i, i, 1) - } - for i := k; i < min(r, k+l); i++ { - dst.set(i, i, gsvd.s1[i]) - } -} - -// SigmaBTo extracts the matrix Σ₂ from the singular value decomposition, storing -// the result into dst. Σ₂ is size p×(k+l). -// -// If dst is empty, SigmaBTo will resize dst to be p×(k+l). When dst is -// non-empty, SigmBTo will panic if dst is not p×(k+l). SigmaBTo will also -// panic if the receiver does not contain a successful factorization. -func (gsvd *GSVD) SigmaBTo(dst *Dense) { - if !gsvd.succFact() { - panic(badFact) - } - r := gsvd.r - p := gsvd.p - k := gsvd.k - l := gsvd.l - if dst.IsEmpty() { - dst.ReuseAs(p, k+l) - } else { - r, c := dst.Dims() - if r != p || c != k+l { - panic(ErrShape) - } - dst.Zero() - } - for i := 0; i < min(l, r-k); i++ { - dst.set(i, i+k, gsvd.s2[k+i]) - } - for i := r - k; i < l; i++ { - dst.set(i, i+k, 1) - } -} - -// UTo extracts the matrix U from the singular value decomposition, storing -// the result into dst. U is size r×r. -// -// If dst is empty, UTo will resize dst to be r×r. When dst is -// non-empty, UTo will panic if dst is not r×r. UTo will also -// panic if the receiver does not contain a successful factorization. -func (gsvd *GSVD) UTo(dst *Dense) { - if !gsvd.succFact() { - panic(badFact) - } - if gsvd.kind&GSVDU == 0 { - panic("mat: improper GSVD kind") - } - r := gsvd.u.Rows - c := gsvd.u.Cols - if dst.IsEmpty() { - dst.ReuseAs(r, c) - } else { - r2, c2 := dst.Dims() - if r != r2 || c != c2 { - panic(ErrShape) - } - } - - tmp := &Dense{ - mat: gsvd.u, - capRows: r, - capCols: c, - } - dst.Copy(tmp) -} - -// VTo extracts the matrix V from the singular value decomposition, storing -// the result into dst. V is size p×p. -// -// If dst is empty, VTo will resize dst to be p×p. When dst is -// non-empty, VTo will panic if dst is not p×p. VTo will also -// panic if the receiver does not contain a successful factorization. -func (gsvd *GSVD) VTo(dst *Dense) { - if !gsvd.succFact() { - panic(badFact) - } - if gsvd.kind&GSVDV == 0 { - panic("mat: improper GSVD kind") - } - r := gsvd.v.Rows - c := gsvd.v.Cols - if dst.IsEmpty() { - dst.ReuseAs(r, c) - } else { - r2, c2 := dst.Dims() - if r != r2 || c != c2 { - panic(ErrShape) - } - } - - tmp := &Dense{ - mat: gsvd.v, - capRows: r, - capCols: c, - } - dst.Copy(tmp) -} - -// QTo extracts the matrix Q from the singular value decomposition, storing -// the result into dst. Q is size c×c. -// -// If dst is empty, QTo will resize dst to be c×c. When dst is -// non-empty, QTo will panic if dst is not c×c. QTo will also -// panic if the receiver does not contain a successful factorization. -func (gsvd *GSVD) QTo(dst *Dense) { - if !gsvd.succFact() { - panic(badFact) - } - if gsvd.kind&GSVDQ == 0 { - panic("mat: improper GSVD kind") - } - r := gsvd.q.Rows - c := gsvd.q.Cols - if dst.IsEmpty() { - dst.ReuseAs(r, c) - } else { - r2, c2 := dst.Dims() - if r != r2 || c != c2 { - panic(ErrShape) - } - } - - tmp := &Dense{ - mat: gsvd.q, - capRows: r, - capCols: c, - } - dst.Copy(tmp) -} diff --git a/vendor/gonum.org/v1/gonum/mat/hogsvd.go b/vendor/gonum.org/v1/gonum/mat/hogsvd.go deleted file mode 100644 index 23777b9..0000000 --- a/vendor/gonum.org/v1/gonum/mat/hogsvd.go +++ /dev/null @@ -1,239 +0,0 @@ -// Copyright ©2017 The Gonum 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 mat - -import ( - "errors" - - "gonum.org/v1/gonum/blas/blas64" -) - -// HOGSVD is a type for creating and using the Higher Order Generalized Singular Value -// Decomposition (HOGSVD) of a set of matrices. -// -// The factorization is a linear transformation of the data sets from the given -// variable×sample spaces to reduced and diagonalized "eigenvariable"×"eigensample" -// spaces. -type HOGSVD struct { - n int - v *Dense - b []Dense - - err error -} - -// succFact returns whether the receiver contains a successful factorization. -func (gsvd *HOGSVD) succFact() bool { - return gsvd.n != 0 -} - -// Factorize computes the higher order generalized singular value decomposition (HOGSVD) -// of the n input r_i×c column tall matrices in m. HOGSV extends the GSVD case from 2 to n -// input matrices. -// -// M_0 = U_0 * Σ_0 * Vᵀ -// M_1 = U_1 * Σ_1 * Vᵀ -// . -// . -// . -// M_{n-1} = U_{n-1} * Σ_{n-1} * Vᵀ -// -// where U_i are r_i×c matrices of singular vectors, Σ are c×c matrices singular values, and V -// is a c×c matrix of singular vectors. -// -// Factorize returns whether the decomposition succeeded. If the decomposition -// failed, routines that require a successful factorization will panic. -func (gsvd *HOGSVD) Factorize(m ...Matrix) (ok bool) { - // Factorize performs the HOGSVD factorisation - // essentially as described by Ponnapalli et al. - // https://doi.org/10.1371/journal.pone.0028072 - - if len(m) < 2 { - panic("hogsvd: too few matrices") - } - gsvd.n = 0 - - r, c := m[0].Dims() - a := make([]Cholesky, len(m)) - var ts SymDense - for i, d := range m { - rd, cd := d.Dims() - if rd < cd { - gsvd.err = ErrShape - return false - } - if rd > r { - r = rd - } - if cd != c { - panic(ErrShape) - } - ts.Reset() - ts.SymOuterK(1, d.T()) - ok = a[i].Factorize(&ts) - if !ok { - gsvd.err = errors.New("hogsvd: cholesky decomposition failed") - return false - } - } - - s := getWorkspace(c, c, true) - defer putWorkspace(s) - sij := getWorkspace(c, c, false) - defer putWorkspace(sij) - for i, ai := range a { - for _, aj := range a[i+1:] { - gsvd.err = ai.SolveCholTo(sij, &aj) - if gsvd.err != nil { - return false - } - s.Add(s, sij) - - gsvd.err = aj.SolveCholTo(sij, &ai) - if gsvd.err != nil { - return false - } - s.Add(s, sij) - } - } - s.Scale(1/float64(len(m)*(len(m)-1)), s) - - var eig Eigen - ok = eig.Factorize(s.T(), EigenRight) - if !ok { - gsvd.err = errors.New("hogsvd: eigen decomposition failed") - return false - } - var vc CDense - eig.VectorsTo(&vc) - // vc is guaranteed to have real eigenvalues. - rc, cc := vc.Dims() - v := NewDense(rc, cc, nil) - for i := 0; i < rc; i++ { - for j := 0; j < cc; j++ { - a := vc.At(i, j) - v.set(i, j, real(a)) - } - } - // Rescale the columns of v by their Frobenius norms. - // Work done in cv is reflected in v. - var cv VecDense - for j := 0; j < c; j++ { - cv.ColViewOf(v, j) - cv.ScaleVec(1/blas64.Nrm2(cv.mat), &cv) - } - - b := make([]Dense, len(m)) - biT := getWorkspace(c, r, false) - defer putWorkspace(biT) - for i, d := range m { - // All calls to reset will leave an emptied - // matrix with capacity to store the result - // without additional allocation. - biT.Reset() - gsvd.err = biT.Solve(v, d.T()) - if gsvd.err != nil { - return false - } - b[i].CloneFrom(biT.T()) - } - - gsvd.n = len(m) - gsvd.v = v - gsvd.b = b - return true -} - -// Err returns the reason for a factorization failure. -func (gsvd *HOGSVD) Err() error { - return gsvd.err -} - -// Len returns the number of matrices that have been factorized. If Len returns -// zero, the factorization was not successful. -func (gsvd *HOGSVD) Len() int { - return gsvd.n -} - -// UTo extracts the matrix U_n from the singular value decomposition, storing -// the result in-place into dst. U_n is size r×c. -// -// If dst is empty, UTo will resize dst to be r×c. When dst is -// non-empty, UTo will panic if dst is not r×c. UTo will also -// panic if the receiver does not contain a successful factorization. -func (gsvd *HOGSVD) UTo(dst *Dense, n int) { - if !gsvd.succFact() { - panic(badFact) - } - if n < 0 || gsvd.n <= n { - panic("hogsvd: invalid index") - } - r, c := gsvd.b[n].Dims() - if dst.IsEmpty() { - dst.ReuseAs(r, c) - } else { - r2, c2 := dst.Dims() - if r != r2 || c != c2 { - panic(ErrShape) - } - } - dst.Copy(&gsvd.b[n]) - var v VecDense - for j, f := range gsvd.Values(nil, n) { - v.ColViewOf(dst, j) - v.ScaleVec(1/f, &v) - } -} - -// Values returns the nth set of singular values of the factorized system. -// If the input slice is non-nil, the values will be stored in-place into the slice. -// In this case, the slice must have length c, and Values will panic with -// matrix.ErrSliceLengthMismatch otherwise. If the input slice is nil, -// a new slice of the appropriate length will be allocated and returned. -// -// Values will panic if the receiver does not contain a successful factorization. -func (gsvd *HOGSVD) Values(s []float64, n int) []float64 { - if !gsvd.succFact() { - panic(badFact) - } - if n < 0 || gsvd.n <= n { - panic("hogsvd: invalid index") - } - - _, c := gsvd.b[n].Dims() - if s == nil { - s = make([]float64, c) - } else if len(s) != c { - panic(ErrSliceLengthMismatch) - } - var v VecDense - for j := 0; j < c; j++ { - v.ColViewOf(&gsvd.b[n], j) - s[j] = blas64.Nrm2(v.mat) - } - return s -} - -// VTo extracts the matrix V from the singular value decomposition, storing -// the result in-place into dst. V is size c×c. -// -// If dst is empty, VTo will resize dst to be c×c. When dst is -// non-empty, VTo will panic if dst is not c×c. VTo will also -// panic if the receiver does not contain a successful factorization. -func (gsvd *HOGSVD) VTo(dst *Dense) { - if !gsvd.succFact() { - panic(badFact) - } - r, c := gsvd.v.Dims() - if dst.IsEmpty() { - dst.ReuseAs(r, c) - } else { - r2, c2 := dst.Dims() - if r != r2 || c != c2 { - panic(ErrShape) - } - } - dst.Copy(gsvd.v) -} diff --git a/vendor/gonum.org/v1/gonum/mat/index_bound_checks.go b/vendor/gonum.org/v1/gonum/mat/index_bound_checks.go deleted file mode 100644 index 59815a6..0000000 --- a/vendor/gonum.org/v1/gonum/mat/index_bound_checks.go +++ /dev/null @@ -1,348 +0,0 @@ -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file must be kept in sync with index_no_bound_checks.go. - -// +build bounds - -package mat - -// At returns the element at row i, column j. -func (m *Dense) At(i, j int) float64 { - return m.at(i, j) -} - -func (m *Dense) at(i, j int) float64 { - if uint(i) >= uint(m.mat.Rows) { - panic(ErrRowAccess) - } - if uint(j) >= uint(m.mat.Cols) { - panic(ErrColAccess) - } - return m.mat.Data[i*m.mat.Stride+j] -} - -// Set sets the element at row i, column j to the value v. -func (m *Dense) Set(i, j int, v float64) { - m.set(i, j, v) -} - -func (m *Dense) set(i, j int, v float64) { - if uint(i) >= uint(m.mat.Rows) { - panic(ErrRowAccess) - } - if uint(j) >= uint(m.mat.Cols) { - panic(ErrColAccess) - } - m.mat.Data[i*m.mat.Stride+j] = v -} - -// At returns the element at row i, column j. -func (m *CDense) At(i, j int) complex128 { - return m.at(i, j) -} - -func (m *CDense) at(i, j int) complex128 { - if uint(i) >= uint(m.mat.Rows) { - panic(ErrRowAccess) - } - if uint(j) >= uint(m.mat.Cols) { - panic(ErrColAccess) - } - return m.mat.Data[i*m.mat.Stride+j] -} - -// Set sets the element at row i, column j to the value v. -func (m *CDense) Set(i, j int, v complex128) { - m.set(i, j, v) -} - -func (m *CDense) set(i, j int, v complex128) { - if uint(i) >= uint(m.mat.Rows) { - panic(ErrRowAccess) - } - if uint(j) >= uint(m.mat.Cols) { - panic(ErrColAccess) - } - m.mat.Data[i*m.mat.Stride+j] = v -} - -// At returns the element at row i. -// It panics if i is out of bounds or if j is not zero. -func (v *VecDense) At(i, j int) float64 { - if j != 0 { - panic(ErrColAccess) - } - return v.at(i) -} - -// AtVec returns the element at row i. -// It panics if i is out of bounds. -func (v *VecDense) AtVec(i int) float64 { - return v.at(i) -} - -func (v *VecDense) at(i int) float64 { - if uint(i) >= uint(v.mat.N) { - panic(ErrRowAccess) - } - return v.mat.Data[i*v.mat.Inc] -} - -// SetVec sets the element at row i to the value val. -// It panics if i is out of bounds. -func (v *VecDense) SetVec(i int, val float64) { - v.setVec(i, val) -} - -func (v *VecDense) setVec(i int, val float64) { - if uint(i) >= uint(v.mat.N) { - panic(ErrVectorAccess) - } - v.mat.Data[i*v.mat.Inc] = val -} - -// At returns the element at row i and column j. -func (t *SymDense) At(i, j int) float64 { - return t.at(i, j) -} - -func (t *SymDense) at(i, j int) float64 { - if uint(i) >= uint(t.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(t.mat.N) { - panic(ErrColAccess) - } - if i > j { - i, j = j, i - } - return t.mat.Data[i*t.mat.Stride+j] -} - -// SetSym sets the elements at (i,j) and (j,i) to the value v. -func (t *SymDense) SetSym(i, j int, v float64) { - t.set(i, j, v) -} - -func (t *SymDense) set(i, j int, v float64) { - if uint(i) >= uint(t.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(t.mat.N) { - panic(ErrColAccess) - } - if i > j { - i, j = j, i - } - t.mat.Data[i*t.mat.Stride+j] = v -} - -// At returns the element at row i, column j. -func (t *TriDense) At(i, j int) float64 { - return t.at(i, j) -} - -func (t *TriDense) at(i, j int) float64 { - if uint(i) >= uint(t.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(t.mat.N) { - panic(ErrColAccess) - } - isUpper := t.isUpper() - if (isUpper && i > j) || (!isUpper && i < j) { - return 0 - } - return t.mat.Data[i*t.mat.Stride+j] -} - -// SetTri sets the element of the triangular matrix at row i, column j to the value v. -// It panics if the location is outside the appropriate half of the matrix. -func (t *TriDense) SetTri(i, j int, v float64) { - t.set(i, j, v) -} - -func (t *TriDense) set(i, j int, v float64) { - if uint(i) >= uint(t.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(t.mat.N) { - panic(ErrColAccess) - } - isUpper := t.isUpper() - if (isUpper && i > j) || (!isUpper && i < j) { - panic(ErrTriangleSet) - } - t.mat.Data[i*t.mat.Stride+j] = v -} - -// At returns the element at row i, column j. -func (b *BandDense) At(i, j int) float64 { - return b.at(i, j) -} - -func (b *BandDense) at(i, j int) float64 { - if uint(i) >= uint(b.mat.Rows) { - panic(ErrRowAccess) - } - if uint(j) >= uint(b.mat.Cols) { - panic(ErrColAccess) - } - pj := j + b.mat.KL - i - if pj < 0 || b.mat.KL+b.mat.KU+1 <= pj { - return 0 - } - return b.mat.Data[i*b.mat.Stride+pj] -} - -// SetBand sets the element at row i, column j to the value v. -// It panics if the location is outside the appropriate region of the matrix. -func (b *BandDense) SetBand(i, j int, v float64) { - b.set(i, j, v) -} - -func (b *BandDense) set(i, j int, v float64) { - if uint(i) >= uint(b.mat.Rows) { - panic(ErrRowAccess) - } - if uint(j) >= uint(b.mat.Cols) { - panic(ErrColAccess) - } - pj := j + b.mat.KL - i - if pj < 0 || b.mat.KL+b.mat.KU+1 <= pj { - panic(ErrBandSet) - } - b.mat.Data[i*b.mat.Stride+pj] = v -} - -// At returns the element at row i, column j. -func (s *SymBandDense) At(i, j int) float64 { - return s.at(i, j) -} - -func (s *SymBandDense) at(i, j int) float64 { - if uint(i) >= uint(s.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(s.mat.N) { - panic(ErrColAccess) - } - if i > j { - i, j = j, i - } - pj := j - i - if s.mat.K+1 <= pj { - return 0 - } - return s.mat.Data[i*s.mat.Stride+pj] -} - -// SetSymBand sets the element at row i, column j to the value v. -// It panics if the location is outside the appropriate region of the matrix. -func (s *SymBandDense) SetSymBand(i, j int, v float64) { - s.set(i, j, v) -} - -func (s *SymBandDense) set(i, j int, v float64) { - if uint(i) >= uint(s.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(s.mat.N) { - panic(ErrColAccess) - } - if i > j { - i, j = j, i - } - pj := j - i - if s.mat.K+1 <= pj { - panic(ErrBandSet) - } - s.mat.Data[i*s.mat.Stride+pj] = v -} - -func (t *TriBandDense) At(i, j int) float64 { - return t.at(i, j) -} - -func (t *TriBandDense) at(i, j int) float64 { - // TODO(btracey): Support Diag field, see #692. - if uint(i) >= uint(t.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(t.mat.N) { - panic(ErrColAccess) - } - isUpper := t.isUpper() - if (isUpper && i > j) || (!isUpper && i < j) { - return 0 - } - kl, ku := t.mat.K, 0 - if isUpper { - kl, ku = 0, t.mat.K - } - pj := j + kl - i - if pj < 0 || kl+ku+1 <= pj { - return 0 - } - return t.mat.Data[i*t.mat.Stride+pj] -} - -func (t *TriBandDense) SetTriBand(i, j int, v float64) { - t.setTriBand(i, j, v) -} - -func (t *TriBandDense) setTriBand(i, j int, v float64) { - if uint(i) >= uint(t.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(t.mat.N) { - panic(ErrColAccess) - } - isUpper := t.isUpper() - if (isUpper && i > j) || (!isUpper && i < j) { - panic(ErrTriangleSet) - } - kl, ku := t.mat.K, 0 - if isUpper { - kl, ku = 0, t.mat.K - } - pj := j + kl - i - if pj < 0 || kl+ku+1 <= pj { - panic(ErrBandSet) - } - // TODO(btracey): Support Diag field, see #692. - t.mat.Data[i*t.mat.Stride+pj] = v -} - -// At returns the element at row i, column j. -func (d *DiagDense) At(i, j int) float64 { - return d.at(i, j) -} - -func (d *DiagDense) at(i, j int) float64 { - if uint(i) >= uint(d.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(d.mat.N) { - panic(ErrColAccess) - } - if i != j { - return 0 - } - return d.mat.Data[i*d.mat.Inc] -} - -// SetDiag sets the element at row i, column i to the value v. -// It panics if the location is outside the appropriate region of the matrix. -func (d *DiagDense) SetDiag(i int, v float64) { - d.setDiag(i, v) -} - -func (d *DiagDense) setDiag(i int, v float64) { - if uint(i) >= uint(d.mat.N) { - panic(ErrRowAccess) - } - d.mat.Data[i*d.mat.Inc] = v -} diff --git a/vendor/gonum.org/v1/gonum/mat/index_no_bound_checks.go b/vendor/gonum.org/v1/gonum/mat/index_no_bound_checks.go deleted file mode 100644 index 051f843..0000000 --- a/vendor/gonum.org/v1/gonum/mat/index_no_bound_checks.go +++ /dev/null @@ -1,359 +0,0 @@ -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file must be kept in sync with index_bound_checks.go. - -// +build !bounds - -package mat - -// At returns the element at row i, column j. -func (m *Dense) At(i, j int) float64 { - if uint(i) >= uint(m.mat.Rows) { - panic(ErrRowAccess) - } - if uint(j) >= uint(m.mat.Cols) { - panic(ErrColAccess) - } - return m.at(i, j) -} - -func (m *Dense) at(i, j int) float64 { - return m.mat.Data[i*m.mat.Stride+j] -} - -// Set sets the element at row i, column j to the value v. -func (m *Dense) Set(i, j int, v float64) { - if uint(i) >= uint(m.mat.Rows) { - panic(ErrRowAccess) - } - if uint(j) >= uint(m.mat.Cols) { - panic(ErrColAccess) - } - m.set(i, j, v) -} - -func (m *Dense) set(i, j int, v float64) { - m.mat.Data[i*m.mat.Stride+j] = v -} - -// At returns the element at row i, column j. -func (m *CDense) At(i, j int) complex128 { - if uint(i) >= uint(m.mat.Rows) { - panic(ErrRowAccess) - } - if uint(j) >= uint(m.mat.Cols) { - panic(ErrColAccess) - } - return m.at(i, j) -} - -func (m *CDense) at(i, j int) complex128 { - return m.mat.Data[i*m.mat.Stride+j] -} - -// Set sets the element at row i, column j to the value v. -func (m *CDense) Set(i, j int, v complex128) { - if uint(i) >= uint(m.mat.Rows) { - panic(ErrRowAccess) - } - if uint(j) >= uint(m.mat.Cols) { - panic(ErrColAccess) - } - m.set(i, j, v) -} - -func (m *CDense) set(i, j int, v complex128) { - m.mat.Data[i*m.mat.Stride+j] = v -} - -// At returns the element at row i. -// It panics if i is out of bounds or if j is not zero. -func (v *VecDense) At(i, j int) float64 { - if uint(i) >= uint(v.mat.N) { - panic(ErrRowAccess) - } - if j != 0 { - panic(ErrColAccess) - } - return v.at(i) -} - -// AtVec returns the element at row i. -// It panics if i is out of bounds. -func (v *VecDense) AtVec(i int) float64 { - if uint(i) >= uint(v.mat.N) { - panic(ErrRowAccess) - } - return v.at(i) -} - -func (v *VecDense) at(i int) float64 { - return v.mat.Data[i*v.mat.Inc] -} - -// SetVec sets the element at row i to the value val. -// It panics if i is out of bounds. -func (v *VecDense) SetVec(i int, val float64) { - if uint(i) >= uint(v.mat.N) { - panic(ErrVectorAccess) - } - v.setVec(i, val) -} - -func (v *VecDense) setVec(i int, val float64) { - v.mat.Data[i*v.mat.Inc] = val -} - -// At returns the element at row i and column j. -func (s *SymDense) At(i, j int) float64 { - if uint(i) >= uint(s.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(s.mat.N) { - panic(ErrColAccess) - } - return s.at(i, j) -} - -func (s *SymDense) at(i, j int) float64 { - if i > j { - i, j = j, i - } - return s.mat.Data[i*s.mat.Stride+j] -} - -// SetSym sets the elements at (i,j) and (j,i) to the value v. -func (s *SymDense) SetSym(i, j int, v float64) { - if uint(i) >= uint(s.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(s.mat.N) { - panic(ErrColAccess) - } - s.set(i, j, v) -} - -func (s *SymDense) set(i, j int, v float64) { - if i > j { - i, j = j, i - } - s.mat.Data[i*s.mat.Stride+j] = v -} - -// At returns the element at row i, column j. -func (t *TriDense) At(i, j int) float64 { - if uint(i) >= uint(t.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(t.mat.N) { - panic(ErrColAccess) - } - return t.at(i, j) -} - -func (t *TriDense) at(i, j int) float64 { - isUpper := t.triKind() - if (isUpper && i > j) || (!isUpper && i < j) { - return 0 - } - return t.mat.Data[i*t.mat.Stride+j] -} - -// SetTri sets the element at row i, column j to the value v. -// It panics if the location is outside the appropriate half of the matrix. -func (t *TriDense) SetTri(i, j int, v float64) { - if uint(i) >= uint(t.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(t.mat.N) { - panic(ErrColAccess) - } - isUpper := t.isUpper() - if (isUpper && i > j) || (!isUpper && i < j) { - panic(ErrTriangleSet) - } - t.set(i, j, v) -} - -func (t *TriDense) set(i, j int, v float64) { - t.mat.Data[i*t.mat.Stride+j] = v -} - -// At returns the element at row i, column j. -func (b *BandDense) At(i, j int) float64 { - if uint(i) >= uint(b.mat.Rows) { - panic(ErrRowAccess) - } - if uint(j) >= uint(b.mat.Cols) { - panic(ErrColAccess) - } - return b.at(i, j) -} - -func (b *BandDense) at(i, j int) float64 { - pj := j + b.mat.KL - i - if pj < 0 || b.mat.KL+b.mat.KU+1 <= pj { - return 0 - } - return b.mat.Data[i*b.mat.Stride+pj] -} - -// SetBand sets the element at row i, column j to the value v. -// It panics if the location is outside the appropriate region of the matrix. -func (b *BandDense) SetBand(i, j int, v float64) { - if uint(i) >= uint(b.mat.Rows) { - panic(ErrRowAccess) - } - if uint(j) >= uint(b.mat.Cols) { - panic(ErrColAccess) - } - pj := j + b.mat.KL - i - if pj < 0 || b.mat.KL+b.mat.KU+1 <= pj { - panic(ErrBandSet) - } - b.set(i, j, v) -} - -func (b *BandDense) set(i, j int, v float64) { - pj := j + b.mat.KL - i - b.mat.Data[i*b.mat.Stride+pj] = v -} - -// At returns the element at row i, column j. -func (s *SymBandDense) At(i, j int) float64 { - if uint(i) >= uint(s.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(s.mat.N) { - panic(ErrColAccess) - } - return s.at(i, j) -} - -func (s *SymBandDense) at(i, j int) float64 { - if i > j { - i, j = j, i - } - pj := j - i - if s.mat.K+1 <= pj { - return 0 - } - return s.mat.Data[i*s.mat.Stride+pj] -} - -// SetSymBand sets the element at row i, column j to the value v. -// It panics if the location is outside the appropriate region of the matrix. -func (s *SymBandDense) SetSymBand(i, j int, v float64) { - if uint(i) >= uint(s.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(s.mat.N) { - panic(ErrColAccess) - } - s.set(i, j, v) -} - -func (s *SymBandDense) set(i, j int, v float64) { - if i > j { - i, j = j, i - } - pj := j - i - if s.mat.K+1 <= pj { - panic(ErrBandSet) - } - s.mat.Data[i*s.mat.Stride+pj] = v -} - -func (t *TriBandDense) At(i, j int) float64 { - if uint(i) >= uint(t.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(t.mat.N) { - panic(ErrColAccess) - } - return t.at(i, j) -} - -func (t *TriBandDense) at(i, j int) float64 { - // TODO(btracey): Support Diag field, see #692. - isUpper := t.isUpper() - if (isUpper && i > j) || (!isUpper && i < j) { - return 0 - } - kl := t.mat.K - ku := 0 - if isUpper { - ku = t.mat.K - kl = 0 - } - pj := j + kl - i - if pj < 0 || kl+ku+1 <= pj { - return 0 - } - return t.mat.Data[i*t.mat.Stride+pj] -} - -func (t *TriBandDense) SetTriBand(i, j int, v float64) { - if uint(i) >= uint(t.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(t.mat.N) { - panic(ErrColAccess) - } - isUpper := t.isUpper() - if (isUpper && i > j) || (!isUpper && i < j) { - panic(ErrTriangleSet) - } - kl, ku := t.mat.K, 0 - if isUpper { - kl, ku = 0, t.mat.K - } - pj := j + kl - i - if pj < 0 || kl+ku+1 <= pj { - panic(ErrBandSet) - } - // TODO(btracey): Support Diag field, see #692. - t.mat.Data[i*t.mat.Stride+pj] = v -} - -func (t *TriBandDense) setTriBand(i, j int, v float64) { - var kl int - if !t.isUpper() { - kl = t.mat.K - } - pj := j + kl - i - t.mat.Data[i*t.mat.Stride+pj] = v -} - -// At returns the element at row i, column j. -func (d *DiagDense) At(i, j int) float64 { - if uint(i) >= uint(d.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(d.mat.N) { - panic(ErrColAccess) - } - return d.at(i, j) -} - -func (d *DiagDense) at(i, j int) float64 { - if i != j { - return 0 - } - return d.mat.Data[i*d.mat.Inc] -} - -// SetDiag sets the element at row i, column i to the value v. -// It panics if the location is outside the appropriate region of the matrix. -func (d *DiagDense) SetDiag(i int, v float64) { - if uint(i) >= uint(d.mat.N) { - panic(ErrRowAccess) - } - d.setDiag(i, v) -} - -func (d *DiagDense) setDiag(i int, v float64) { - d.mat.Data[i*d.mat.Inc] = v -} diff --git a/vendor/gonum.org/v1/gonum/mat/inner.go b/vendor/gonum.org/v1/gonum/mat/inner.go deleted file mode 100644 index 7607cf9..0000000 --- a/vendor/gonum.org/v1/gonum/mat/inner.go +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright ©2014 The Gonum 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 mat - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/internal/asm/f64" -) - -// Inner computes the generalized inner product -// xᵀ A y -// between the vectors x and y with matrix A, where x and y are treated as -// column vectors. -// -// This is only a true inner product if A is symmetric positive definite, though -// the operation works for any matrix A. -// -// Inner panics if x.Len != m or y.Len != n when A is an m x n matrix. -func Inner(x Vector, a Matrix, y Vector) float64 { - m, n := a.Dims() - if x.Len() != m { - panic(ErrShape) - } - if y.Len() != n { - panic(ErrShape) - } - if m == 0 || n == 0 { - return 0 - } - - var sum float64 - - switch a := a.(type) { - case RawSymmetricer: - amat := a.RawSymmetric() - if amat.Uplo != blas.Upper { - // Panic as a string not a mat.Error. - panic(badSymTriangle) - } - var xmat, ymat blas64.Vector - if xrv, ok := x.(RawVectorer); ok { - xmat = xrv.RawVector() - } else { - break - } - if yrv, ok := y.(RawVectorer); ok { - ymat = yrv.RawVector() - } else { - break - } - for i := 0; i < x.Len(); i++ { - xi := x.AtVec(i) - if xi != 0 { - if ymat.Inc == 1 { - sum += xi * f64.DotUnitary( - amat.Data[i*amat.Stride+i:i*amat.Stride+n], - ymat.Data[i:], - ) - } else { - sum += xi * f64.DotInc( - amat.Data[i*amat.Stride+i:i*amat.Stride+n], - ymat.Data[i*ymat.Inc:], uintptr(n-i), - 1, uintptr(ymat.Inc), - 0, 0, - ) - } - } - yi := y.AtVec(i) - if i != n-1 && yi != 0 { - if xmat.Inc == 1 { - sum += yi * f64.DotUnitary( - amat.Data[i*amat.Stride+i+1:i*amat.Stride+n], - xmat.Data[i+1:], - ) - } else { - sum += yi * f64.DotInc( - amat.Data[i*amat.Stride+i+1:i*amat.Stride+n], - xmat.Data[(i+1)*xmat.Inc:], uintptr(n-i-1), - 1, uintptr(xmat.Inc), - 0, 0, - ) - } - } - } - return sum - case RawMatrixer: - amat := a.RawMatrix() - var ymat blas64.Vector - if yrv, ok := y.(RawVectorer); ok { - ymat = yrv.RawVector() - } else { - break - } - for i := 0; i < x.Len(); i++ { - xi := x.AtVec(i) - if xi != 0 { - if ymat.Inc == 1 { - sum += xi * f64.DotUnitary( - amat.Data[i*amat.Stride:i*amat.Stride+n], - ymat.Data, - ) - } else { - sum += xi * f64.DotInc( - amat.Data[i*amat.Stride:i*amat.Stride+n], - ymat.Data, uintptr(n), - 1, uintptr(ymat.Inc), - 0, 0, - ) - } - } - } - return sum - } - for i := 0; i < x.Len(); i++ { - xi := x.AtVec(i) - for j := 0; j < y.Len(); j++ { - sum += xi * a.At(i, j) * y.AtVec(j) - } - } - return sum -} diff --git a/vendor/gonum.org/v1/gonum/mat/io.go b/vendor/gonum.org/v1/gonum/mat/io.go deleted file mode 100644 index 7e9b72a..0000000 --- a/vendor/gonum.org/v1/gonum/mat/io.go +++ /dev/null @@ -1,491 +0,0 @@ -// Copyright ©2015 The Gonum 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 mat - -import ( - "bytes" - "encoding/binary" - "errors" - "fmt" - "io" - "math" -) - -// version is the current on-disk codec version. -const version uint32 = 0x1 - -// maxLen is the biggest slice/array len one can create on a 32/64b platform. -const maxLen = int64(int(^uint(0) >> 1)) - -var ( - headerSize = binary.Size(storage{}) - sizeFloat64 = binary.Size(float64(0)) - - errWrongType = errors.New("mat: wrong data type") - - errTooBig = errors.New("mat: resulting data slice too big") - errTooSmall = errors.New("mat: input slice too small") - errBadBuffer = errors.New("mat: data buffer size mismatch") - errBadSize = errors.New("mat: invalid dimension") -) - -// Type encoding scheme: -// -// Type Form Packing Uplo Unit Rows Columns kU kL -// uint8 [GST] uint8 [BPF] uint8 [AUL] bool int64 int64 int64 int64 -// General 'G' 'F' 'A' false r c 0 0 -// Band 'G' 'B' 'A' false r c kU kL -// Symmetric 'S' 'F' ul false n n 0 0 -// SymmetricBand 'S' 'B' ul false n n k k -// SymmetricPacked 'S' 'P' ul false n n 0 0 -// Triangular 'T' 'F' ul Diag==Unit n n 0 0 -// TriangularBand 'T' 'B' ul Diag==Unit n n k k -// TriangularPacked 'T' 'P' ul Diag==Unit n n 0 0 -// -// G - general, S - symmetric, T - triangular -// F - full, B - band, P - packed -// A - all, U - upper, L - lower - -// MarshalBinary encodes the receiver into a binary form and returns the result. -// -// Dense is little-endian encoded as follows: -// 0 - 3 Version = 1 (uint32) -// 4 'G' (byte) -// 5 'F' (byte) -// 6 'A' (byte) -// 7 0 (byte) -// 8 - 15 number of rows (int64) -// 16 - 23 number of columns (int64) -// 24 - 31 0 (int64) -// 32 - 39 0 (int64) -// 40 - .. matrix data elements (float64) -// [0,0] [0,1] ... [0,ncols-1] -// [1,0] [1,1] ... [1,ncols-1] -// ... -// [nrows-1,0] ... [nrows-1,ncols-1] -func (m Dense) MarshalBinary() ([]byte, error) { - bufLen := int64(headerSize) + int64(m.mat.Rows)*int64(m.mat.Cols)*int64(sizeFloat64) - if bufLen <= 0 { - // bufLen is too big and has wrapped around. - return nil, errTooBig - } - - header := storage{ - Form: 'G', Packing: 'F', Uplo: 'A', - Rows: int64(m.mat.Rows), Cols: int64(m.mat.Cols), - Version: version, - } - buf := make([]byte, bufLen) - n, err := header.marshalBinaryTo(bytes.NewBuffer(buf[:0])) - if err != nil { - return buf[:n], err - } - - p := headerSize - r, c := m.Dims() - for i := 0; i < r; i++ { - for j := 0; j < c; j++ { - binary.LittleEndian.PutUint64(buf[p:p+sizeFloat64], math.Float64bits(m.at(i, j))) - p += sizeFloat64 - } - } - - return buf, nil -} - -// MarshalBinaryTo encodes the receiver into a binary form and writes it into w. -// MarshalBinaryTo returns the number of bytes written into w and an error, if any. -// -// See MarshalBinary for the on-disk layout. -func (m Dense) MarshalBinaryTo(w io.Writer) (int, error) { - header := storage{ - Form: 'G', Packing: 'F', Uplo: 'A', - Rows: int64(m.mat.Rows), Cols: int64(m.mat.Cols), - Version: version, - } - n, err := header.marshalBinaryTo(w) - if err != nil { - return n, err - } - - r, c := m.Dims() - var b [8]byte - for i := 0; i < r; i++ { - for j := 0; j < c; j++ { - binary.LittleEndian.PutUint64(b[:], math.Float64bits(m.at(i, j))) - nn, err := w.Write(b[:]) - n += nn - if err != nil { - return n, err - } - } - } - - return n, nil -} - -// UnmarshalBinary decodes the binary form into the receiver. -// It panics if the receiver is a non-empty Dense matrix. -// -// See MarshalBinary for the on-disk layout. -// -// Limited checks on the validity of the binary input are performed: -// - matrix.ErrShape is returned if the number of rows or columns is negative, -// - an error is returned if the resulting Dense matrix is too -// big for the current architecture (e.g. a 16GB matrix written by a -// 64b application and read back from a 32b application.) -// UnmarshalBinary does not limit the size of the unmarshaled matrix, and so -// it should not be used on untrusted data. -func (m *Dense) UnmarshalBinary(data []byte) error { - if !m.IsEmpty() { - panic("mat: unmarshal into non-empty matrix") - } - - if len(data) < headerSize { - return errTooSmall - } - - var header storage - err := header.unmarshalBinary(data[:headerSize]) - if err != nil { - return err - } - rows := header.Rows - cols := header.Cols - header.Version = 0 - header.Rows = 0 - header.Cols = 0 - if (header != storage{Form: 'G', Packing: 'F', Uplo: 'A'}) { - return errWrongType - } - if rows < 0 || cols < 0 { - return errBadSize - } - size := rows * cols - if size == 0 { - return ErrZeroLength - } - if int(size) < 0 || size > maxLen { - return errTooBig - } - if len(data) != headerSize+int(rows*cols)*sizeFloat64 { - return errBadBuffer - } - - p := headerSize - m.reuseAsNonZeroed(int(rows), int(cols)) - for i := range m.mat.Data { - m.mat.Data[i] = math.Float64frombits(binary.LittleEndian.Uint64(data[p : p+sizeFloat64])) - p += sizeFloat64 - } - - return nil -} - -// UnmarshalBinaryFrom decodes the binary form into the receiver and returns -// the number of bytes read and an error if any. -// It panics if the receiver is a non-empty Dense matrix. -// -// See MarshalBinary for the on-disk layout. -// -// Limited checks on the validity of the binary input are performed: -// - matrix.ErrShape is returned if the number of rows or columns is negative, -// - an error is returned if the resulting Dense matrix is too -// big for the current architecture (e.g. a 16GB matrix written by a -// 64b application and read back from a 32b application.) -// UnmarshalBinary does not limit the size of the unmarshaled matrix, and so -// it should not be used on untrusted data. -func (m *Dense) UnmarshalBinaryFrom(r io.Reader) (int, error) { - if !m.IsEmpty() { - panic("mat: unmarshal into non-empty matrix") - } - - var header storage - n, err := header.unmarshalBinaryFrom(r) - if err != nil { - return n, err - } - rows := header.Rows - cols := header.Cols - header.Version = 0 - header.Rows = 0 - header.Cols = 0 - if (header != storage{Form: 'G', Packing: 'F', Uplo: 'A'}) { - return n, errWrongType - } - if rows < 0 || cols < 0 { - return n, errBadSize - } - size := rows * cols - if size == 0 { - return n, ErrZeroLength - } - if int(size) < 0 || size > maxLen { - return n, errTooBig - } - - m.reuseAsNonZeroed(int(rows), int(cols)) - var b [8]byte - for i := range m.mat.Data { - nn, err := readFull(r, b[:]) - n += nn - if err != nil { - if err == io.EOF { - return n, io.ErrUnexpectedEOF - } - return n, err - } - m.mat.Data[i] = math.Float64frombits(binary.LittleEndian.Uint64(b[:])) - } - - return n, nil -} - -// MarshalBinary encodes the receiver into a binary form and returns the result. -// -// VecDense is little-endian encoded as follows: -// -// 0 - 3 Version = 1 (uint32) -// 4 'G' (byte) -// 5 'F' (byte) -// 6 'A' (byte) -// 7 0 (byte) -// 8 - 15 number of elements (int64) -// 16 - 23 1 (int64) -// 24 - 31 0 (int64) -// 32 - 39 0 (int64) -// 40 - .. vector's data elements (float64) -func (v VecDense) MarshalBinary() ([]byte, error) { - bufLen := int64(headerSize) + int64(v.mat.N)*int64(sizeFloat64) - if bufLen <= 0 { - // bufLen is too big and has wrapped around. - return nil, errTooBig - } - - header := storage{ - Form: 'G', Packing: 'F', Uplo: 'A', - Rows: int64(v.mat.N), Cols: 1, - Version: version, - } - buf := make([]byte, bufLen) - n, err := header.marshalBinaryTo(bytes.NewBuffer(buf[:0])) - if err != nil { - return buf[:n], err - } - - p := headerSize - for i := 0; i < v.mat.N; i++ { - binary.LittleEndian.PutUint64(buf[p:p+sizeFloat64], math.Float64bits(v.at(i))) - p += sizeFloat64 - } - - return buf, nil -} - -// MarshalBinaryTo encodes the receiver into a binary form, writes it to w and -// returns the number of bytes written and an error if any. -// -// See MarshalBainry for the on-disk format. -func (v VecDense) MarshalBinaryTo(w io.Writer) (int, error) { - header := storage{ - Form: 'G', Packing: 'F', Uplo: 'A', - Rows: int64(v.mat.N), Cols: 1, - Version: version, - } - n, err := header.marshalBinaryTo(w) - if err != nil { - return n, err - } - - var buf [8]byte - for i := 0; i < v.mat.N; i++ { - binary.LittleEndian.PutUint64(buf[:], math.Float64bits(v.at(i))) - nn, err := w.Write(buf[:]) - n += nn - if err != nil { - return n, err - } - } - - return n, nil -} - -// UnmarshalBinary decodes the binary form into the receiver. -// It panics if the receiver is a non-empty VecDense. -// -// See MarshalBinary for the on-disk layout. -// -// Limited checks on the validity of the binary input are performed: -// - matrix.ErrShape is returned if the number of rows is negative, -// - an error is returned if the resulting VecDense is too -// big for the current architecture (e.g. a 16GB vector written by a -// 64b application and read back from a 32b application.) -// UnmarshalBinary does not limit the size of the unmarshaled vector, and so -// it should not be used on untrusted data. -func (v *VecDense) UnmarshalBinary(data []byte) error { - if !v.IsEmpty() { - panic("mat: unmarshal into non-empty vector") - } - - if len(data) < headerSize { - return errTooSmall - } - - var header storage - err := header.unmarshalBinary(data[:headerSize]) - if err != nil { - return err - } - if header.Cols != 1 { - return ErrShape - } - n := header.Rows - header.Version = 0 - header.Rows = 0 - header.Cols = 0 - if (header != storage{Form: 'G', Packing: 'F', Uplo: 'A'}) { - return errWrongType - } - if n == 0 { - return ErrZeroLength - } - if n < 0 { - return errBadSize - } - if int64(maxLen) < n { - return errTooBig - } - if len(data) != headerSize+int(n)*sizeFloat64 { - return errBadBuffer - } - - p := headerSize - v.reuseAsNonZeroed(int(n)) - for i := range v.mat.Data { - v.mat.Data[i] = math.Float64frombits(binary.LittleEndian.Uint64(data[p : p+sizeFloat64])) - p += sizeFloat64 - } - - return nil -} - -// UnmarshalBinaryFrom decodes the binary form into the receiver, from the -// io.Reader and returns the number of bytes read and an error if any. -// It panics if the receiver is a non-empty VecDense. -// -// See MarshalBinary for the on-disk layout. -// See UnmarshalBinary for the list of sanity checks performed on the input. -func (v *VecDense) UnmarshalBinaryFrom(r io.Reader) (int, error) { - if !v.IsEmpty() { - panic("mat: unmarshal into non-empty vector") - } - - var header storage - n, err := header.unmarshalBinaryFrom(r) - if err != nil { - return n, err - } - if header.Cols != 1 { - return n, ErrShape - } - l := header.Rows - header.Version = 0 - header.Rows = 0 - header.Cols = 0 - if (header != storage{Form: 'G', Packing: 'F', Uplo: 'A'}) { - return n, errWrongType - } - if l == 0 { - return n, ErrZeroLength - } - if l < 0 { - return n, errBadSize - } - if int64(maxLen) < l { - return n, errTooBig - } - - v.reuseAsNonZeroed(int(l)) - var b [8]byte - for i := range v.mat.Data { - nn, err := readFull(r, b[:]) - n += nn - if err != nil { - if err == io.EOF { - return n, io.ErrUnexpectedEOF - } - return n, err - } - v.mat.Data[i] = math.Float64frombits(binary.LittleEndian.Uint64(b[:])) - } - - return n, nil -} - -// storage is the internal representation of the storage format of a -// serialised matrix. -type storage struct { - Version uint32 // Keep this first. - Form byte // [GST] - Packing byte // [BPF] - Uplo byte // [AUL] - Unit bool - Rows int64 - Cols int64 - KU int64 - KL int64 -} - -// TODO(kortschak): Consider replacing these with calls to direct -// encoding/decoding of fields rather than to binary.Write/binary.Read. - -func (s storage) marshalBinaryTo(w io.Writer) (int, error) { - buf := bytes.NewBuffer(make([]byte, 0, headerSize)) - err := binary.Write(buf, binary.LittleEndian, s) - if err != nil { - return 0, err - } - return w.Write(buf.Bytes()) -} - -func (s *storage) unmarshalBinary(buf []byte) error { - err := binary.Read(bytes.NewReader(buf), binary.LittleEndian, s) - if err != nil { - return err - } - if s.Version != version { - return fmt.Errorf("mat: incorrect version: %d", s.Version) - } - return nil -} - -func (s *storage) unmarshalBinaryFrom(r io.Reader) (int, error) { - buf := make([]byte, headerSize) - n, err := readFull(r, buf) - if err != nil { - return n, err - } - return n, s.unmarshalBinary(buf[:n]) -} - -// readFull reads from r into buf until it has read len(buf). -// It returns the number of bytes copied and an error if fewer bytes were read. -// If an EOF happens after reading fewer than len(buf) bytes, io.ErrUnexpectedEOF is returned. -func readFull(r io.Reader, buf []byte) (int, error) { - var n int - var err error - for n < len(buf) && err == nil { - var nn int - nn, err = r.Read(buf[n:]) - n += nn - } - if n == len(buf) { - return n, nil - } - if err == io.EOF { - return n, io.ErrUnexpectedEOF - } - return n, err -} diff --git a/vendor/gonum.org/v1/gonum/mat/lq.go b/vendor/gonum.org/v1/gonum/mat/lq.go deleted file mode 100644 index dfff65d..0000000 --- a/vendor/gonum.org/v1/gonum/mat/lq.go +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright ©2013 The Gonum 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 mat - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" - "gonum.org/v1/gonum/lapack/lapack64" -) - -const badLQ = "mat: invalid LQ factorization" - -// LQ is a type for creating and using the LQ factorization of a matrix. -type LQ struct { - lq *Dense - tau []float64 - cond float64 -} - -func (lq *LQ) updateCond(norm lapack.MatrixNorm) { - // Since A = L*Q, and Q is orthogonal, we get for the condition number κ - // κ(A) := |A| |A^-1| = |L*Q| |(L*Q)^-1| = |L| |Qᵀ * L^-1| - // = |L| |L^-1| = κ(L), - // where we used that fact that Q^-1 = Qᵀ. However, this assumes that - // the matrix norm is invariant under orthogonal transformations which - // is not the case for CondNorm. Hopefully the error is negligible: κ - // is only a qualitative measure anyway. - m := lq.lq.mat.Rows - work := getFloats(3*m, false) - iwork := getInts(m, false) - l := lq.lq.asTriDense(m, blas.NonUnit, blas.Lower) - v := lapack64.Trcon(norm, l.mat, work, iwork) - lq.cond = 1 / v - putFloats(work) - putInts(iwork) -} - -// Factorize computes the LQ factorization of an m×n matrix a where m <= n. The LQ -// factorization always exists even if A is singular. -// -// The LQ decomposition is a factorization of the matrix A such that A = L * Q. -// The matrix Q is an orthonormal n×n matrix, and L is an m×n lower triangular matrix. -// L and Q can be extracted using the LTo and QTo methods. -func (lq *LQ) Factorize(a Matrix) { - lq.factorize(a, CondNorm) -} - -func (lq *LQ) factorize(a Matrix, norm lapack.MatrixNorm) { - m, n := a.Dims() - if m > n { - panic(ErrShape) - } - k := min(m, n) - if lq.lq == nil { - lq.lq = &Dense{} - } - lq.lq.CloneFrom(a) - work := []float64{0} - lq.tau = make([]float64, k) - lapack64.Gelqf(lq.lq.mat, lq.tau, work, -1) - work = getFloats(int(work[0]), false) - lapack64.Gelqf(lq.lq.mat, lq.tau, work, len(work)) - putFloats(work) - lq.updateCond(norm) -} - -// isValid returns whether the receiver contains a factorization. -func (lq *LQ) isValid() bool { - return lq.lq != nil && !lq.lq.IsEmpty() -} - -// Cond returns the condition number for the factorized matrix. -// Cond will panic if the receiver does not contain a factorization. -func (lq *LQ) Cond() float64 { - if !lq.isValid() { - panic(badLQ) - } - return lq.cond -} - -// TODO(btracey): Add in the "Reduced" forms for extracting the m×m orthogonal -// and upper triangular matrices. - -// LTo extracts the m×n lower trapezoidal matrix from a LQ decomposition. -// -// If dst is empty, LTo will resize dst to be r×c. When dst is -// non-empty, LTo will panic if dst is not r×c. LTo will also panic -// if the receiver does not contain a successful factorization. -func (lq *LQ) LTo(dst *Dense) { - if !lq.isValid() { - panic(badLQ) - } - - r, c := lq.lq.Dims() - if dst.IsEmpty() { - dst.ReuseAs(r, c) - } else { - r2, c2 := dst.Dims() - if r != r2 || c != c2 { - panic(ErrShape) - } - } - - // Disguise the LQ as a lower triangular. - t := &TriDense{ - mat: blas64.Triangular{ - N: r, - Stride: lq.lq.mat.Stride, - Data: lq.lq.mat.Data, - Uplo: blas.Lower, - Diag: blas.NonUnit, - }, - cap: lq.lq.capCols, - } - dst.Copy(t) - - if r == c { - return - } - // Zero right of the triangular. - for i := 0; i < r; i++ { - zero(dst.mat.Data[i*dst.mat.Stride+r : i*dst.mat.Stride+c]) - } -} - -// QTo extracts the n×n orthonormal matrix Q from an LQ decomposition. -// -// If dst is empty, QTo will resize dst to be c×c. When dst is -// non-empty, QTo will panic if dst is not c×c. QTo will also panic -// if the receiver does not contain a successful factorization. -func (lq *LQ) QTo(dst *Dense) { - if !lq.isValid() { - panic(badLQ) - } - - _, c := lq.lq.Dims() - if dst.IsEmpty() { - dst.ReuseAs(c, c) - } else { - r2, c2 := dst.Dims() - if c != r2 || c != c2 { - panic(ErrShape) - } - dst.Zero() - } - q := dst.mat - - // Set Q = I. - ldq := q.Stride - for i := 0; i < c; i++ { - q.Data[i*ldq+i] = 1 - } - - // Construct Q from the elementary reflectors. - work := []float64{0} - lapack64.Ormlq(blas.Left, blas.NoTrans, lq.lq.mat, lq.tau, q, work, -1) - work = getFloats(int(work[0]), false) - lapack64.Ormlq(blas.Left, blas.NoTrans, lq.lq.mat, lq.tau, q, work, len(work)) - putFloats(work) -} - -// SolveTo finds a minimum-norm solution to a system of linear equations defined -// by the matrices A and b, where A is an m×n matrix represented in its LQ factorized -// form. If A is singular or near-singular a Condition error is returned. -// See the documentation for Condition for more information. -// -// The minimization problem solved depends on the input parameters. -// If trans == false, find the minimum norm solution of A * X = B. -// If trans == true, find X such that ||A*X - B||_2 is minimized. -// The solution matrix, X, is stored in place into dst. -// SolveTo will panic if the receiver does not contain a factorization. -func (lq *LQ) SolveTo(dst *Dense, trans bool, b Matrix) error { - if !lq.isValid() { - panic(badLQ) - } - - r, c := lq.lq.Dims() - br, bc := b.Dims() - - // The LQ solve algorithm stores the result in-place into the right hand side. - // The storage for the answer must be large enough to hold both b and x. - // However, this method's receiver must be the size of x. Copy b, and then - // copy the result into x at the end. - if trans { - if c != br { - panic(ErrShape) - } - dst.reuseAsNonZeroed(r, bc) - } else { - if r != br { - panic(ErrShape) - } - dst.reuseAsNonZeroed(c, bc) - } - // Do not need to worry about overlap between x and b because w has its own - // independent storage. - w := getWorkspace(max(r, c), bc, false) - w.Copy(b) - t := lq.lq.asTriDense(lq.lq.mat.Rows, blas.NonUnit, blas.Lower).mat - if trans { - work := []float64{0} - lapack64.Ormlq(blas.Left, blas.NoTrans, lq.lq.mat, lq.tau, w.mat, work, -1) - work = getFloats(int(work[0]), false) - lapack64.Ormlq(blas.Left, blas.NoTrans, lq.lq.mat, lq.tau, w.mat, work, len(work)) - putFloats(work) - - ok := lapack64.Trtrs(blas.Trans, t, w.mat) - if !ok { - return Condition(math.Inf(1)) - } - } else { - ok := lapack64.Trtrs(blas.NoTrans, t, w.mat) - if !ok { - return Condition(math.Inf(1)) - } - for i := r; i < c; i++ { - zero(w.mat.Data[i*w.mat.Stride : i*w.mat.Stride+bc]) - } - work := []float64{0} - lapack64.Ormlq(blas.Left, blas.Trans, lq.lq.mat, lq.tau, w.mat, work, -1) - work = getFloats(int(work[0]), false) - lapack64.Ormlq(blas.Left, blas.Trans, lq.lq.mat, lq.tau, w.mat, work, len(work)) - putFloats(work) - } - // x was set above to be the correct size for the result. - dst.Copy(w) - putWorkspace(w) - if lq.cond > ConditionTolerance { - return Condition(lq.cond) - } - return nil -} - -// SolveVecTo finds a minimum-norm solution to a system of linear equations. -// See LQ.SolveTo for the full documentation. -// SolveToVec will panic if the receiver does not contain a factorization. -func (lq *LQ) SolveVecTo(dst *VecDense, trans bool, b Vector) error { - if !lq.isValid() { - panic(badLQ) - } - - r, c := lq.lq.Dims() - if _, bc := b.Dims(); bc != 1 { - panic(ErrShape) - } - - // The Solve implementation is non-trivial, so rather than duplicate the code, - // instead recast the VecDenses as Dense and call the matrix code. - bm := Matrix(b) - if rv, ok := b.(RawVectorer); ok { - bmat := rv.RawVector() - if dst != b { - dst.checkOverlap(bmat) - } - b := VecDense{mat: bmat} - bm = b.asDense() - } - if trans { - dst.reuseAsNonZeroed(r) - } else { - dst.reuseAsNonZeroed(c) - } - return lq.SolveTo(dst.asDense(), trans, bm) -} diff --git a/vendor/gonum.org/v1/gonum/mat/lu.go b/vendor/gonum.org/v1/gonum/mat/lu.go deleted file mode 100644 index 073a452..0000000 --- a/vendor/gonum.org/v1/gonum/mat/lu.go +++ /dev/null @@ -1,439 +0,0 @@ -// Copyright ©2013 The Gonum 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 mat - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/floats" - "gonum.org/v1/gonum/lapack" - "gonum.org/v1/gonum/lapack/lapack64" -) - -const ( - badSliceLength = "mat: improper slice length" - badLU = "mat: invalid LU factorization" -) - -// LU is a type for creating and using the LU factorization of a matrix. -type LU struct { - lu *Dense - pivot []int - cond float64 -} - -// updateCond updates the stored condition number of the matrix. anorm is the -// norm of the original matrix. If anorm is negative it will be estimated. -func (lu *LU) updateCond(anorm float64, norm lapack.MatrixNorm) { - n := lu.lu.mat.Cols - work := getFloats(4*n, false) - defer putFloats(work) - iwork := getInts(n, false) - defer putInts(iwork) - if anorm < 0 { - // This is an approximation. By the definition of a norm, - // |AB| <= |A| |B|. - // Since A = L*U, we get for the condition number κ that - // κ(A) := |A| |A^-1| = |L*U| |A^-1| <= |L| |U| |A^-1|, - // so this will overestimate the condition number somewhat. - // The norm of the original factorized matrix cannot be stored - // because of update possibilities. - u := lu.lu.asTriDense(n, blas.NonUnit, blas.Upper) - l := lu.lu.asTriDense(n, blas.Unit, blas.Lower) - unorm := lapack64.Lantr(norm, u.mat, work) - lnorm := lapack64.Lantr(norm, l.mat, work) - anorm = unorm * lnorm - } - v := lapack64.Gecon(norm, lu.lu.mat, anorm, work, iwork) - lu.cond = 1 / v -} - -// Factorize computes the LU factorization of the square matrix a and stores the -// result. The LU decomposition will complete regardless of the singularity of a. -// -// The LU factorization is computed with pivoting, and so really the decomposition -// is a PLU decomposition where P is a permutation matrix. The individual matrix -// factors can be extracted from the factorization using the Permutation method -// on Dense, and the LU.LTo and LU.UTo methods. -func (lu *LU) Factorize(a Matrix) { - lu.factorize(a, CondNorm) -} - -func (lu *LU) factorize(a Matrix, norm lapack.MatrixNorm) { - r, c := a.Dims() - if r != c { - panic(ErrSquare) - } - if lu.lu == nil { - lu.lu = NewDense(r, r, nil) - } else { - lu.lu.Reset() - lu.lu.reuseAsNonZeroed(r, r) - } - lu.lu.Copy(a) - if cap(lu.pivot) < r { - lu.pivot = make([]int, r) - } - lu.pivot = lu.pivot[:r] - work := getFloats(r, false) - anorm := lapack64.Lange(norm, lu.lu.mat, work) - putFloats(work) - lapack64.Getrf(lu.lu.mat, lu.pivot) - lu.updateCond(anorm, norm) -} - -// isValid returns whether the receiver contains a factorization. -func (lu *LU) isValid() bool { - return lu.lu != nil && !lu.lu.IsEmpty() -} - -// Cond returns the condition number for the factorized matrix. -// Cond will panic if the receiver does not contain a factorization. -func (lu *LU) Cond() float64 { - if !lu.isValid() { - panic(badLU) - } - return lu.cond -} - -// Reset resets the factorization so that it can be reused as the receiver of a -// dimensionally restricted operation. -func (lu *LU) Reset() { - if lu.lu != nil { - lu.lu.Reset() - } - lu.pivot = lu.pivot[:0] -} - -func (lu *LU) isZero() bool { - return len(lu.pivot) == 0 -} - -// Det returns the determinant of the matrix that has been factorized. In many -// expressions, using LogDet will be more numerically stable. -// Det will panic if the receiver does not contain a factorization. -func (lu *LU) Det() float64 { - det, sign := lu.LogDet() - return math.Exp(det) * sign -} - -// LogDet returns the log of the determinant and the sign of the determinant -// for the matrix that has been factorized. Numerical stability in product and -// division expressions is generally improved by working in log space. -// LogDet will panic if the receiver does not contain a factorization. -func (lu *LU) LogDet() (det float64, sign float64) { - if !lu.isValid() { - panic(badLU) - } - - _, n := lu.lu.Dims() - logDiag := getFloats(n, false) - defer putFloats(logDiag) - sign = 1.0 - for i := 0; i < n; i++ { - v := lu.lu.at(i, i) - if v < 0 { - sign *= -1 - } - if lu.pivot[i] != i { - sign *= -1 - } - logDiag[i] = math.Log(math.Abs(v)) - } - return floats.Sum(logDiag), sign -} - -// Pivot returns pivot indices that enable the construction of the permutation -// matrix P (see Dense.Permutation). If swaps == nil, then new memory will be -// allocated, otherwise the length of the input must be equal to the size of the -// factorized matrix. -// Pivot will panic if the receiver does not contain a factorization. -func (lu *LU) Pivot(swaps []int) []int { - if !lu.isValid() { - panic(badLU) - } - - _, n := lu.lu.Dims() - if swaps == nil { - swaps = make([]int, n) - } - if len(swaps) != n { - panic(badSliceLength) - } - // Perform the inverse of the row swaps in order to find the final - // row swap position. - for i := range swaps { - swaps[i] = i - } - for i := n - 1; i >= 0; i-- { - v := lu.pivot[i] - swaps[i], swaps[v] = swaps[v], swaps[i] - } - return swaps -} - -// RankOne updates an LU factorization as if a rank-one update had been applied to -// the original matrix A, storing the result into the receiver. That is, if in -// the original LU decomposition P * L * U = A, in the updated decomposition -// P * L * U = A + alpha * x * yᵀ. -// RankOne will panic if orig does not contain a factorization. -func (lu *LU) RankOne(orig *LU, alpha float64, x, y Vector) { - if !orig.isValid() { - panic(badLU) - } - - // RankOne uses algorithm a1 on page 28 of "Multiple-Rank Updates to Matrix - // Factorizations for Nonlinear Analysis and Circuit Design" by Linzhong Deng. - // http://web.stanford.edu/group/SOL/dissertations/Linzhong-Deng-thesis.pdf - _, n := orig.lu.Dims() - if r, c := x.Dims(); r != n || c != 1 { - panic(ErrShape) - } - if r, c := y.Dims(); r != n || c != 1 { - panic(ErrShape) - } - if orig != lu { - if lu.isZero() { - if cap(lu.pivot) < n { - lu.pivot = make([]int, n) - } - lu.pivot = lu.pivot[:n] - if lu.lu == nil { - lu.lu = NewDense(n, n, nil) - } else { - lu.lu.reuseAsNonZeroed(n, n) - } - } else if len(lu.pivot) != n { - panic(ErrShape) - } - copy(lu.pivot, orig.pivot) - lu.lu.Copy(orig.lu) - } - - xs := getFloats(n, false) - defer putFloats(xs) - ys := getFloats(n, false) - defer putFloats(ys) - for i := 0; i < n; i++ { - xs[i] = x.AtVec(i) - ys[i] = y.AtVec(i) - } - - // Adjust for the pivoting in the LU factorization - for i, v := range lu.pivot { - xs[i], xs[v] = xs[v], xs[i] - } - - lum := lu.lu.mat - omega := alpha - for j := 0; j < n; j++ { - ujj := lum.Data[j*lum.Stride+j] - ys[j] /= ujj - theta := 1 + xs[j]*ys[j]*omega - beta := omega * ys[j] / theta - gamma := omega * xs[j] - omega -= beta * gamma - lum.Data[j*lum.Stride+j] *= theta - for i := j + 1; i < n; i++ { - xs[i] -= lum.Data[i*lum.Stride+j] * xs[j] - tmp := ys[i] - ys[i] -= lum.Data[j*lum.Stride+i] * ys[j] - lum.Data[i*lum.Stride+j] += beta * xs[i] - lum.Data[j*lum.Stride+i] += gamma * tmp - } - } - lu.updateCond(-1, CondNorm) -} - -// LTo extracts the lower triangular matrix from an LU factorization. -// -// If dst is empty, LTo will resize dst to be a lower-triangular n×n matrix. -// When dst is non-empty, LTo will panic if dst is not n×n or not Lower. -// LTo will also panic if the receiver does not contain a successful -// factorization. -func (lu *LU) LTo(dst *TriDense) *TriDense { - if !lu.isValid() { - panic(badLU) - } - - _, n := lu.lu.Dims() - if dst.IsEmpty() { - dst.ReuseAsTri(n, Lower) - } else { - n2, kind := dst.Triangle() - if n != n2 { - panic(ErrShape) - } - if kind != Lower { - panic(ErrTriangle) - } - } - // Extract the lower triangular elements. - for i := 0; i < n; i++ { - for j := 0; j < i; j++ { - dst.mat.Data[i*dst.mat.Stride+j] = lu.lu.mat.Data[i*lu.lu.mat.Stride+j] - } - } - // Set ones on the diagonal. - for i := 0; i < n; i++ { - dst.mat.Data[i*dst.mat.Stride+i] = 1 - } - return dst -} - -// UTo extracts the upper triangular matrix from an LU factorization. -// -// If dst is empty, UTo will resize dst to be an upper-triangular n×n matrix. -// When dst is non-empty, UTo will panic if dst is not n×n or not Upper. -// UTo will also panic if the receiver does not contain a successful -// factorization. -func (lu *LU) UTo(dst *TriDense) { - if !lu.isValid() { - panic(badLU) - } - - _, n := lu.lu.Dims() - if dst.IsEmpty() { - dst.ReuseAsTri(n, Upper) - } else { - n2, kind := dst.Triangle() - if n != n2 { - panic(ErrShape) - } - if kind != Upper { - panic(ErrTriangle) - } - } - // Extract the upper triangular elements. - for i := 0; i < n; i++ { - for j := i; j < n; j++ { - dst.mat.Data[i*dst.mat.Stride+j] = lu.lu.mat.Data[i*lu.lu.mat.Stride+j] - } - } -} - -// Permutation constructs an r×r permutation matrix with the given row swaps. -// A permutation matrix has exactly one element equal to one in each row and column -// and all other elements equal to zero. swaps[i] specifies the row with which -// i will be swapped, which is equivalent to the non-zero column of row i. -func (m *Dense) Permutation(r int, swaps []int) { - m.reuseAsNonZeroed(r, r) - for i := 0; i < r; i++ { - zero(m.mat.Data[i*m.mat.Stride : i*m.mat.Stride+r]) - v := swaps[i] - if v < 0 || v >= r { - panic(ErrRowAccess) - } - m.mat.Data[i*m.mat.Stride+v] = 1 - } -} - -// SolveTo solves a system of linear equations using the LU decomposition of a matrix. -// It computes -// A * X = B if trans == false -// Aᵀ * X = B if trans == true -// In both cases, A is represented in LU factorized form, and the matrix X is -// stored into dst. -// -// If A is singular or near-singular a Condition error is returned. See -// the documentation for Condition for more information. -// SolveTo will panic if the receiver does not contain a factorization. -func (lu *LU) SolveTo(dst *Dense, trans bool, b Matrix) error { - if !lu.isValid() { - panic(badLU) - } - - _, n := lu.lu.Dims() - br, bc := b.Dims() - if br != n { - panic(ErrShape) - } - // TODO(btracey): Should test the condition number instead of testing that - // the determinant is exactly zero. - if lu.Det() == 0 { - return Condition(math.Inf(1)) - } - - dst.reuseAsNonZeroed(n, bc) - bU, _ := untranspose(b) - var restore func() - if dst == bU { - dst, restore = dst.isolatedWorkspace(bU) - defer restore() - } else if rm, ok := bU.(RawMatrixer); ok { - dst.checkOverlap(rm.RawMatrix()) - } - - dst.Copy(b) - t := blas.NoTrans - if trans { - t = blas.Trans - } - lapack64.Getrs(t, lu.lu.mat, dst.mat, lu.pivot) - if lu.cond > ConditionTolerance { - return Condition(lu.cond) - } - return nil -} - -// SolveVecTo solves a system of linear equations using the LU decomposition of a matrix. -// It computes -// A * x = b if trans == false -// Aᵀ * x = b if trans == true -// In both cases, A is represented in LU factorized form, and the vector x is -// stored into dst. -// -// If A is singular or near-singular a Condition error is returned. See -// the documentation for Condition for more information. -// SolveVecTo will panic if the receiver does not contain a factorization. -func (lu *LU) SolveVecTo(dst *VecDense, trans bool, b Vector) error { - if !lu.isValid() { - panic(badLU) - } - - _, n := lu.lu.Dims() - if br, bc := b.Dims(); br != n || bc != 1 { - panic(ErrShape) - } - switch rv := b.(type) { - default: - dst.reuseAsNonZeroed(n) - return lu.SolveTo(dst.asDense(), trans, b) - case RawVectorer: - if dst != b { - dst.checkOverlap(rv.RawVector()) - } - // TODO(btracey): Should test the condition number instead of testing that - // the determinant is exactly zero. - if lu.Det() == 0 { - return Condition(math.Inf(1)) - } - - dst.reuseAsNonZeroed(n) - var restore func() - if dst == b { - dst, restore = dst.isolatedWorkspace(b) - defer restore() - } - dst.CopyVec(b) - vMat := blas64.General{ - Rows: n, - Cols: 1, - Stride: dst.mat.Inc, - Data: dst.mat.Data, - } - t := blas.NoTrans - if trans { - t = blas.Trans - } - lapack64.Getrs(t, lu.lu.mat, vMat, lu.pivot) - if lu.cond > ConditionTolerance { - return Condition(lu.cond) - } - return nil - } -} diff --git a/vendor/gonum.org/v1/gonum/mat/matrix.go b/vendor/gonum.org/v1/gonum/mat/matrix.go deleted file mode 100644 index efcf7da..0000000 --- a/vendor/gonum.org/v1/gonum/mat/matrix.go +++ /dev/null @@ -1,1008 +0,0 @@ -// Copyright ©2013 The Gonum 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 mat - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/floats" - "gonum.org/v1/gonum/lapack" - "gonum.org/v1/gonum/lapack/lapack64" -) - -// Matrix is the basic matrix interface type. -type Matrix interface { - // Dims returns the dimensions of a Matrix. - Dims() (r, c int) - - // At returns the value of a matrix element at row i, column j. - // It will panic if i or j are out of bounds for the matrix. - At(i, j int) float64 - - // T returns the transpose of the Matrix. Whether T returns a copy of the - // underlying data is implementation dependent. - // This method may be implemented using the Transpose type, which - // provides an implicit matrix transpose. - T() Matrix -} - -// allMatrix represents the extra set of methods that all mat Matrix types -// should satisfy. This is used to enforce compile-time consistency between the -// Dense types, especially helpful when adding new features. -type allMatrix interface { - Reseter - IsEmpty() bool - Zero() -} - -// denseMatrix represents the extra set of methods that all Dense Matrix types -// should satisfy. This is used to enforce compile-time consistency between the -// Dense types, especially helpful when adding new features. -type denseMatrix interface { - DiagView() Diagonal - Tracer -} - -var ( - _ Matrix = Transpose{} - _ Untransposer = Transpose{} -) - -// Transpose is a type for performing an implicit matrix transpose. It implements -// the Matrix interface, returning values from the transpose of the matrix within. -type Transpose struct { - Matrix Matrix -} - -// At returns the value of the element at row i and column j of the transposed -// matrix, that is, row j and column i of the Matrix field. -func (t Transpose) At(i, j int) float64 { - return t.Matrix.At(j, i) -} - -// Dims returns the dimensions of the transposed matrix. The number of rows returned -// is the number of columns in the Matrix field, and the number of columns is -// the number of rows in the Matrix field. -func (t Transpose) Dims() (r, c int) { - c, r = t.Matrix.Dims() - return r, c -} - -// T performs an implicit transpose by returning the Matrix field. -func (t Transpose) T() Matrix { - return t.Matrix -} - -// Untranspose returns the Matrix field. -func (t Transpose) Untranspose() Matrix { - return t.Matrix -} - -// Untransposer is a type that can undo an implicit transpose. -type Untransposer interface { - // Note: This interface is needed to unify all of the Transpose types. In - // the mat methods, we need to test if the Matrix has been implicitly - // transposed. If this is checked by testing for the specific Transpose type - // then the behavior will be different if the user uses T() or TTri() for a - // triangular matrix. - - // Untranspose returns the underlying Matrix stored for the implicit transpose. - Untranspose() Matrix -} - -// UntransposeBander is a type that can undo an implicit band transpose. -type UntransposeBander interface { - // Untranspose returns the underlying Banded stored for the implicit transpose. - UntransposeBand() Banded -} - -// UntransposeTrier is a type that can undo an implicit triangular transpose. -type UntransposeTrier interface { - // Untranspose returns the underlying Triangular stored for the implicit transpose. - UntransposeTri() Triangular -} - -// UntransposeTriBander is a type that can undo an implicit triangular banded -// transpose. -type UntransposeTriBander interface { - // Untranspose returns the underlying Triangular stored for the implicit transpose. - UntransposeTriBand() TriBanded -} - -// Mutable is a matrix interface type that allows elements to be altered. -type Mutable interface { - // Set alters the matrix element at row i, column j to v. - // It will panic if i or j are out of bounds for the matrix. - Set(i, j int, v float64) - - Matrix -} - -// A RowViewer can return a Vector reflecting a row that is backed by the matrix -// data. The Vector returned will have length equal to the number of columns. -type RowViewer interface { - RowView(i int) Vector -} - -// A RawRowViewer can return a slice of float64 reflecting a row that is backed by the matrix -// data. -type RawRowViewer interface { - RawRowView(i int) []float64 -} - -// A ColViewer can return a Vector reflecting a column that is backed by the matrix -// data. The Vector returned will have length equal to the number of rows. -type ColViewer interface { - ColView(j int) Vector -} - -// A RawColViewer can return a slice of float64 reflecting a column that is backed by the matrix -// data. -type RawColViewer interface { - RawColView(j int) []float64 -} - -// A ClonerFrom can make a copy of a into the receiver, overwriting the previous value of the -// receiver. The clone operation does not make any restriction on shape and will not cause -// shadowing. -type ClonerFrom interface { - CloneFrom(a Matrix) -} - -// A Reseter can reset the matrix so that it can be reused as the receiver of a dimensionally -// restricted operation. This is commonly used when the matrix is being used as a workspace -// or temporary matrix. -// -// If the matrix is a view, using Reset may result in data corruption in elements outside -// the view. Similarly, if the matrix shares backing data with another variable, using -// Reset may lead to unexpected changes in data values. -type Reseter interface { - Reset() -} - -// A Copier can make a copy of elements of a into the receiver. The submatrix copied -// starts at row and column 0 and has dimensions equal to the minimum dimensions of -// the two matrices. The number of row and columns copied is returned. -// Copy will copy from a source that aliases the receiver unless the source is transposed; -// an aliasing transpose copy will panic with the exception for a special case when -// the source data has a unitary increment or stride. -type Copier interface { - Copy(a Matrix) (r, c int) -} - -// A Grower can grow the size of the represented matrix by the given number of rows and columns. -// Growing beyond the size given by the Caps method will result in the allocation of a new -// matrix and copying of the elements. If Grow is called with negative increments it will -// panic with ErrIndexOutOfRange. -type Grower interface { - Caps() (r, c int) - Grow(r, c int) Matrix -} - -// A BandWidther represents a banded matrix and can return the left and right half-bandwidths, k1 and -// k2. -type BandWidther interface { - BandWidth() (k1, k2 int) -} - -// A RawMatrixSetter can set the underlying blas64.General used by the receiver. There is no restriction -// on the shape of the receiver. Changes to the receiver's elements will be reflected in the blas64.General.Data. -type RawMatrixSetter interface { - SetRawMatrix(a blas64.General) -} - -// A RawMatrixer can return a blas64.General representation of the receiver. Changes to the blas64.General.Data -// slice will be reflected in the original matrix, changes to the Rows, Cols and Stride fields will not. -type RawMatrixer interface { - RawMatrix() blas64.General -} - -// A RawVectorer can return a blas64.Vector representation of the receiver. Changes to the blas64.Vector.Data -// slice will be reflected in the original matrix, changes to the Inc field will not. -type RawVectorer interface { - RawVector() blas64.Vector -} - -// A NonZeroDoer can call a function for each non-zero element of the receiver. -// The parameters of the function are the element indices and its value. -type NonZeroDoer interface { - DoNonZero(func(i, j int, v float64)) -} - -// A RowNonZeroDoer can call a function for each non-zero element of a row of the receiver. -// The parameters of the function are the element indices and its value. -type RowNonZeroDoer interface { - DoRowNonZero(i int, fn func(i, j int, v float64)) -} - -// A ColNonZeroDoer can call a function for each non-zero element of a column of the receiver. -// The parameters of the function are the element indices and its value. -type ColNonZeroDoer interface { - DoColNonZero(j int, fn func(i, j int, v float64)) -} - -// untranspose untransposes a matrix if applicable. If a is an Untransposer, then -// untranspose returns the underlying matrix and true. If it is not, then it returns -// the input matrix and false. -func untranspose(a Matrix) (Matrix, bool) { - if ut, ok := a.(Untransposer); ok { - return ut.Untranspose(), true - } - return a, false -} - -// untransposeExtract returns an untransposed matrix in a built-in matrix type. -// -// The untransposed matrix is returned unaltered if it is a built-in matrix type. -// Otherwise, if it implements a Raw method, an appropriate built-in type value -// is returned holding the raw matrix value of the input. If neither of these -// is possible, the untransposed matrix is returned. -func untransposeExtract(a Matrix) (Matrix, bool) { - ut, trans := untranspose(a) - switch m := ut.(type) { - case *DiagDense, *SymBandDense, *TriBandDense, *BandDense, *TriDense, *SymDense, *Dense, *VecDense: - return m, trans - // TODO(btracey): Add here if we ever have an equivalent of RawDiagDense. - case RawSymBander: - rsb := m.RawSymBand() - if rsb.Uplo != blas.Upper { - return ut, trans - } - var sb SymBandDense - sb.SetRawSymBand(rsb) - return &sb, trans - case RawTriBander: - rtb := m.RawTriBand() - if rtb.Diag == blas.Unit { - return ut, trans - } - var tb TriBandDense - tb.SetRawTriBand(rtb) - return &tb, trans - case RawBander: - var b BandDense - b.SetRawBand(m.RawBand()) - return &b, trans - case RawTriangular: - rt := m.RawTriangular() - if rt.Diag == blas.Unit { - return ut, trans - } - var t TriDense - t.SetRawTriangular(rt) - return &t, trans - case RawSymmetricer: - rs := m.RawSymmetric() - if rs.Uplo != blas.Upper { - return ut, trans - } - var s SymDense - s.SetRawSymmetric(rs) - return &s, trans - case RawMatrixer: - var d Dense - d.SetRawMatrix(m.RawMatrix()) - return &d, trans - case RawVectorer: - var v VecDense - v.SetRawVector(m.RawVector()) - return &v, trans - default: - return ut, trans - } -} - -// TODO(btracey): Consider adding CopyCol/CopyRow if the behavior seems useful. -// TODO(btracey): Add in fast paths to Row/Col for the other concrete types -// (TriDense, etc.) as well as relevant interfaces (RowColer, RawRowViewer, etc.) - -// Col copies the elements in the jth column of the matrix into the slice dst. -// The length of the provided slice must equal the number of rows, unless the -// slice is nil in which case a new slice is first allocated. -func Col(dst []float64, j int, a Matrix) []float64 { - r, c := a.Dims() - if j < 0 || j >= c { - panic(ErrColAccess) - } - if dst == nil { - dst = make([]float64, r) - } else { - if len(dst) != r { - panic(ErrColLength) - } - } - aU, aTrans := untranspose(a) - if rm, ok := aU.(RawMatrixer); ok { - m := rm.RawMatrix() - if aTrans { - copy(dst, m.Data[j*m.Stride:j*m.Stride+m.Cols]) - return dst - } - blas64.Copy(blas64.Vector{N: r, Inc: m.Stride, Data: m.Data[j:]}, - blas64.Vector{N: r, Inc: 1, Data: dst}, - ) - return dst - } - for i := 0; i < r; i++ { - dst[i] = a.At(i, j) - } - return dst -} - -// Row copies the elements in the ith row of the matrix into the slice dst. -// The length of the provided slice must equal the number of columns, unless the -// slice is nil in which case a new slice is first allocated. -func Row(dst []float64, i int, a Matrix) []float64 { - r, c := a.Dims() - if i < 0 || i >= r { - panic(ErrColAccess) - } - if dst == nil { - dst = make([]float64, c) - } else { - if len(dst) != c { - panic(ErrRowLength) - } - } - aU, aTrans := untranspose(a) - if rm, ok := aU.(RawMatrixer); ok { - m := rm.RawMatrix() - if aTrans { - blas64.Copy(blas64.Vector{N: c, Inc: m.Stride, Data: m.Data[i:]}, - blas64.Vector{N: c, Inc: 1, Data: dst}, - ) - return dst - } - copy(dst, m.Data[i*m.Stride:i*m.Stride+m.Cols]) - return dst - } - for j := 0; j < c; j++ { - dst[j] = a.At(i, j) - } - return dst -} - -// Cond returns the condition number of the given matrix under the given norm. -// The condition number must be based on the 1-norm, 2-norm or ∞-norm. -// Cond will panic with matrix.ErrShape if the matrix has zero size. -// -// BUG(btracey): The computation of the 1-norm and ∞-norm for non-square matrices -// is innacurate, although is typically the right order of magnitude. See -// https://github.com/xianyi/OpenBLAS/issues/636. While the value returned will -// change with the resolution of this bug, the result from Cond will match the -// condition number used internally. -func Cond(a Matrix, norm float64) float64 { - m, n := a.Dims() - if m == 0 || n == 0 { - panic(ErrShape) - } - var lnorm lapack.MatrixNorm - switch norm { - default: - panic("mat: bad norm value") - case 1: - lnorm = lapack.MaxColumnSum - case 2: - var svd SVD - ok := svd.Factorize(a, SVDNone) - if !ok { - return math.Inf(1) - } - return svd.Cond() - case math.Inf(1): - lnorm = lapack.MaxRowSum - } - - if m == n { - // Use the LU decomposition to compute the condition number. - var lu LU - lu.factorize(a, lnorm) - return lu.Cond() - } - if m > n { - // Use the QR factorization to compute the condition number. - var qr QR - qr.factorize(a, lnorm) - return qr.Cond() - } - // Use the LQ factorization to compute the condition number. - var lq LQ - lq.factorize(a, lnorm) - return lq.Cond() -} - -// Det returns the determinant of the matrix a. In many expressions using LogDet -// will be more numerically stable. -func Det(a Matrix) float64 { - det, sign := LogDet(a) - return math.Exp(det) * sign -} - -// Dot returns the sum of the element-wise product of a and b. -// Dot panics if the matrix sizes are unequal. -func Dot(a, b Vector) float64 { - la := a.Len() - lb := b.Len() - if la != lb { - panic(ErrShape) - } - if arv, ok := a.(RawVectorer); ok { - if brv, ok := b.(RawVectorer); ok { - return blas64.Dot(arv.RawVector(), brv.RawVector()) - } - } - var sum float64 - for i := 0; i < la; i++ { - sum += a.At(i, 0) * b.At(i, 0) - } - return sum -} - -// Equal returns whether the matrices a and b have the same size -// and are element-wise equal. -func Equal(a, b Matrix) bool { - ar, ac := a.Dims() - br, bc := b.Dims() - if ar != br || ac != bc { - return false - } - aU, aTrans := untranspose(a) - bU, bTrans := untranspose(b) - if rma, ok := aU.(RawMatrixer); ok { - if rmb, ok := bU.(RawMatrixer); ok { - ra := rma.RawMatrix() - rb := rmb.RawMatrix() - if aTrans == bTrans { - for i := 0; i < ra.Rows; i++ { - for j := 0; j < ra.Cols; j++ { - if ra.Data[i*ra.Stride+j] != rb.Data[i*rb.Stride+j] { - return false - } - } - } - return true - } - for i := 0; i < ra.Rows; i++ { - for j := 0; j < ra.Cols; j++ { - if ra.Data[i*ra.Stride+j] != rb.Data[j*rb.Stride+i] { - return false - } - } - } - return true - } - } - if rma, ok := aU.(RawSymmetricer); ok { - if rmb, ok := bU.(RawSymmetricer); ok { - ra := rma.RawSymmetric() - rb := rmb.RawSymmetric() - // Symmetric matrices are always upper and equal to their transpose. - for i := 0; i < ra.N; i++ { - for j := i; j < ra.N; j++ { - if ra.Data[i*ra.Stride+j] != rb.Data[i*rb.Stride+j] { - return false - } - } - } - return true - } - } - if ra, ok := aU.(*VecDense); ok { - if rb, ok := bU.(*VecDense); ok { - // If the raw vectors are the same length they must either both be - // transposed or both not transposed (or have length 1). - for i := 0; i < ra.mat.N; i++ { - if ra.mat.Data[i*ra.mat.Inc] != rb.mat.Data[i*rb.mat.Inc] { - return false - } - } - return true - } - } - for i := 0; i < ar; i++ { - for j := 0; j < ac; j++ { - if a.At(i, j) != b.At(i, j) { - return false - } - } - } - return true -} - -// EqualApprox returns whether the matrices a and b have the same size and contain all equal -// elements with tolerance for element-wise equality specified by epsilon. Matrices -// with non-equal shapes are not equal. -func EqualApprox(a, b Matrix, epsilon float64) bool { - ar, ac := a.Dims() - br, bc := b.Dims() - if ar != br || ac != bc { - return false - } - aU, aTrans := untranspose(a) - bU, bTrans := untranspose(b) - if rma, ok := aU.(RawMatrixer); ok { - if rmb, ok := bU.(RawMatrixer); ok { - ra := rma.RawMatrix() - rb := rmb.RawMatrix() - if aTrans == bTrans { - for i := 0; i < ra.Rows; i++ { - for j := 0; j < ra.Cols; j++ { - if !floats.EqualWithinAbsOrRel(ra.Data[i*ra.Stride+j], rb.Data[i*rb.Stride+j], epsilon, epsilon) { - return false - } - } - } - return true - } - for i := 0; i < ra.Rows; i++ { - for j := 0; j < ra.Cols; j++ { - if !floats.EqualWithinAbsOrRel(ra.Data[i*ra.Stride+j], rb.Data[j*rb.Stride+i], epsilon, epsilon) { - return false - } - } - } - return true - } - } - if rma, ok := aU.(RawSymmetricer); ok { - if rmb, ok := bU.(RawSymmetricer); ok { - ra := rma.RawSymmetric() - rb := rmb.RawSymmetric() - // Symmetric matrices are always upper and equal to their transpose. - for i := 0; i < ra.N; i++ { - for j := i; j < ra.N; j++ { - if !floats.EqualWithinAbsOrRel(ra.Data[i*ra.Stride+j], rb.Data[i*rb.Stride+j], epsilon, epsilon) { - return false - } - } - } - return true - } - } - if ra, ok := aU.(*VecDense); ok { - if rb, ok := bU.(*VecDense); ok { - // If the raw vectors are the same length they must either both be - // transposed or both not transposed (or have length 1). - for i := 0; i < ra.mat.N; i++ { - if !floats.EqualWithinAbsOrRel(ra.mat.Data[i*ra.mat.Inc], rb.mat.Data[i*rb.mat.Inc], epsilon, epsilon) { - return false - } - } - return true - } - } - for i := 0; i < ar; i++ { - for j := 0; j < ac; j++ { - if !floats.EqualWithinAbsOrRel(a.At(i, j), b.At(i, j), epsilon, epsilon) { - return false - } - } - } - return true -} - -// LogDet returns the log of the determinant and the sign of the determinant -// for the matrix that has been factorized. Numerical stability in product and -// division expressions is generally improved by working in log space. -func LogDet(a Matrix) (det float64, sign float64) { - // TODO(btracey): Add specialized routines for TriDense, etc. - var lu LU - lu.Factorize(a) - return lu.LogDet() -} - -// Max returns the largest element value of the matrix A. -// Max will panic with matrix.ErrShape if the matrix has zero size. -func Max(a Matrix) float64 { - r, c := a.Dims() - if r == 0 || c == 0 { - panic(ErrShape) - } - // Max(A) = Max(Aᵀ) - aU, _ := untranspose(a) - switch m := aU.(type) { - case RawMatrixer: - rm := m.RawMatrix() - max := math.Inf(-1) - for i := 0; i < rm.Rows; i++ { - for _, v := range rm.Data[i*rm.Stride : i*rm.Stride+rm.Cols] { - if v > max { - max = v - } - } - } - return max - case RawTriangular: - rm := m.RawTriangular() - // The max of a triangular is at least 0 unless the size is 1. - if rm.N == 1 { - return rm.Data[0] - } - max := 0.0 - if rm.Uplo == blas.Upper { - for i := 0; i < rm.N; i++ { - for _, v := range rm.Data[i*rm.Stride+i : i*rm.Stride+rm.N] { - if v > max { - max = v - } - } - } - return max - } - for i := 0; i < rm.N; i++ { - for _, v := range rm.Data[i*rm.Stride : i*rm.Stride+i+1] { - if v > max { - max = v - } - } - } - return max - case RawSymmetricer: - rm := m.RawSymmetric() - if rm.Uplo != blas.Upper { - panic(badSymTriangle) - } - max := math.Inf(-1) - for i := 0; i < rm.N; i++ { - for _, v := range rm.Data[i*rm.Stride+i : i*rm.Stride+rm.N] { - if v > max { - max = v - } - } - } - return max - default: - r, c := aU.Dims() - max := math.Inf(-1) - for i := 0; i < r; i++ { - for j := 0; j < c; j++ { - v := aU.At(i, j) - if v > max { - max = v - } - } - } - return max - } -} - -// Min returns the smallest element value of the matrix A. -// Min will panic with matrix.ErrShape if the matrix has zero size. -func Min(a Matrix) float64 { - r, c := a.Dims() - if r == 0 || c == 0 { - panic(ErrShape) - } - // Min(A) = Min(Aᵀ) - aU, _ := untranspose(a) - switch m := aU.(type) { - case RawMatrixer: - rm := m.RawMatrix() - min := math.Inf(1) - for i := 0; i < rm.Rows; i++ { - for _, v := range rm.Data[i*rm.Stride : i*rm.Stride+rm.Cols] { - if v < min { - min = v - } - } - } - return min - case RawTriangular: - rm := m.RawTriangular() - // The min of a triangular is at most 0 unless the size is 1. - if rm.N == 1 { - return rm.Data[0] - } - min := 0.0 - if rm.Uplo == blas.Upper { - for i := 0; i < rm.N; i++ { - for _, v := range rm.Data[i*rm.Stride+i : i*rm.Stride+rm.N] { - if v < min { - min = v - } - } - } - return min - } - for i := 0; i < rm.N; i++ { - for _, v := range rm.Data[i*rm.Stride : i*rm.Stride+i+1] { - if v < min { - min = v - } - } - } - return min - case RawSymmetricer: - rm := m.RawSymmetric() - if rm.Uplo != blas.Upper { - panic(badSymTriangle) - } - min := math.Inf(1) - for i := 0; i < rm.N; i++ { - for _, v := range rm.Data[i*rm.Stride+i : i*rm.Stride+rm.N] { - if v < min { - min = v - } - } - } - return min - default: - r, c := aU.Dims() - min := math.Inf(1) - for i := 0; i < r; i++ { - for j := 0; j < c; j++ { - v := aU.At(i, j) - if v < min { - min = v - } - } - } - return min - } -} - -// Norm returns the specified (induced) norm of the matrix a. See -// https://en.wikipedia.org/wiki/Matrix_norm for the definition of an induced norm. -// -// Valid norms are: -// 1 - The maximum absolute column sum -// 2 - Frobenius norm, the square root of the sum of the squares of the elements. -// Inf - The maximum absolute row sum. -// Norm will panic with ErrNormOrder if an illegal norm order is specified and -// with matrix.ErrShape if the matrix has zero size. -func Norm(a Matrix, norm float64) float64 { - r, c := a.Dims() - if r == 0 || c == 0 { - panic(ErrShape) - } - aU, aTrans := untranspose(a) - var work []float64 - switch rma := aU.(type) { - case RawMatrixer: - rm := rma.RawMatrix() - n := normLapack(norm, aTrans) - if n == lapack.MaxColumnSum { - work = getFloats(rm.Cols, false) - defer putFloats(work) - } - return lapack64.Lange(n, rm, work) - case RawTriangular: - rm := rma.RawTriangular() - n := normLapack(norm, aTrans) - if n == lapack.MaxRowSum || n == lapack.MaxColumnSum { - work = getFloats(rm.N, false) - defer putFloats(work) - } - return lapack64.Lantr(n, rm, work) - case RawSymmetricer: - rm := rma.RawSymmetric() - n := normLapack(norm, aTrans) - if n == lapack.MaxRowSum || n == lapack.MaxColumnSum { - work = getFloats(rm.N, false) - defer putFloats(work) - } - return lapack64.Lansy(n, rm, work) - case *VecDense: - rv := rma.RawVector() - switch norm { - default: - panic(ErrNormOrder) - case 1: - if aTrans { - imax := blas64.Iamax(rv) - return math.Abs(rma.At(imax, 0)) - } - return blas64.Asum(rv) - case 2: - return blas64.Nrm2(rv) - case math.Inf(1): - if aTrans { - return blas64.Asum(rv) - } - imax := blas64.Iamax(rv) - return math.Abs(rma.At(imax, 0)) - } - } - switch norm { - default: - panic(ErrNormOrder) - case 1: - var max float64 - for j := 0; j < c; j++ { - var sum float64 - for i := 0; i < r; i++ { - sum += math.Abs(a.At(i, j)) - } - if sum > max { - max = sum - } - } - return max - case 2: - var sum float64 - for i := 0; i < r; i++ { - for j := 0; j < c; j++ { - v := a.At(i, j) - sum += v * v - } - } - return math.Sqrt(sum) - case math.Inf(1): - var max float64 - for i := 0; i < r; i++ { - var sum float64 - for j := 0; j < c; j++ { - sum += math.Abs(a.At(i, j)) - } - if sum > max { - max = sum - } - } - return max - } -} - -// normLapack converts the float64 norm input in Norm to a lapack.MatrixNorm. -func normLapack(norm float64, aTrans bool) lapack.MatrixNorm { - switch norm { - case 1: - n := lapack.MaxColumnSum - if aTrans { - n = lapack.MaxRowSum - } - return n - case 2: - return lapack.Frobenius - case math.Inf(1): - n := lapack.MaxRowSum - if aTrans { - n = lapack.MaxColumnSum - } - return n - default: - panic(ErrNormOrder) - } -} - -// Sum returns the sum of the elements of the matrix. -func Sum(a Matrix) float64 { - - var sum float64 - aU, _ := untranspose(a) - switch rma := aU.(type) { - case RawSymmetricer: - rm := rma.RawSymmetric() - for i := 0; i < rm.N; i++ { - // Diagonals count once while off-diagonals count twice. - sum += rm.Data[i*rm.Stride+i] - var s float64 - for _, v := range rm.Data[i*rm.Stride+i+1 : i*rm.Stride+rm.N] { - s += v - } - sum += 2 * s - } - return sum - case RawTriangular: - rm := rma.RawTriangular() - var startIdx, endIdx int - for i := 0; i < rm.N; i++ { - // Start and end index for this triangle-row. - switch rm.Uplo { - case blas.Upper: - startIdx = i - endIdx = rm.N - case blas.Lower: - startIdx = 0 - endIdx = i + 1 - default: - panic(badTriangle) - } - for _, v := range rm.Data[i*rm.Stride+startIdx : i*rm.Stride+endIdx] { - sum += v - } - } - return sum - case RawMatrixer: - rm := rma.RawMatrix() - for i := 0; i < rm.Rows; i++ { - for _, v := range rm.Data[i*rm.Stride : i*rm.Stride+rm.Cols] { - sum += v - } - } - return sum - case *VecDense: - rm := rma.RawVector() - for i := 0; i < rm.N; i++ { - sum += rm.Data[i*rm.Inc] - } - return sum - default: - r, c := a.Dims() - for i := 0; i < r; i++ { - for j := 0; j < c; j++ { - sum += a.At(i, j) - } - } - return sum - } -} - -// A Tracer can compute the trace of the matrix. Trace must panic if the -// matrix is not square. -type Tracer interface { - Trace() float64 -} - -// Trace returns the trace of the matrix. Trace will panic if the -// matrix is not square. If a is a Tracer, its Trace method will be -// used to calculate the matrix trace. -func Trace(a Matrix) float64 { - m, _ := untransposeExtract(a) - if t, ok := m.(Tracer); ok { - return t.Trace() - } - r, c := a.Dims() - if r != c { - panic(ErrSquare) - } - var v float64 - for i := 0; i < r; i++ { - v += a.At(i, i) - } - return v -} - -func min(a, b int) int { - if a < b { - return a - } - return b -} - -func max(a, b int) int { - if a > b { - return a - } - return b -} - -// use returns a float64 slice with l elements, using f if it -// has the necessary capacity, otherwise creating a new slice. -func use(f []float64, l int) []float64 { - if l <= cap(f) { - return f[:l] - } - return make([]float64, l) -} - -// useZeroed returns a float64 slice with l elements, using f if it -// has the necessary capacity, otherwise creating a new slice. The -// elements of the returned slice are guaranteed to be zero. -func useZeroed(f []float64, l int) []float64 { - if l <= cap(f) { - f = f[:l] - zero(f) - return f - } - return make([]float64, l) -} - -// zero zeros the given slice's elements. -func zero(f []float64) { - for i := range f { - f[i] = 0 - } -} - -// useInt returns an int slice with l elements, using i if it -// has the necessary capacity, otherwise creating a new slice. -func useInt(i []int, l int) []int { - if l <= cap(i) { - return i[:l] - } - return make([]int, l) -} diff --git a/vendor/gonum.org/v1/gonum/mat/offset.go b/vendor/gonum.org/v1/gonum/mat/offset.go deleted file mode 100644 index 830589d..0000000 --- a/vendor/gonum.org/v1/gonum/mat/offset.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !appengine,!safe - -package mat - -import "unsafe" - -// offset returns the number of float64 values b[0] is after a[0]. -func offset(a, b []float64) int { - if &a[0] == &b[0] { - return 0 - } - // This expression must be atomic with respect to GC moves. - // At this stage this is true, because the GC does not - // move. See https://golang.org/issue/12445. - return int(uintptr(unsafe.Pointer(&b[0]))-uintptr(unsafe.Pointer(&a[0]))) / int(unsafe.Sizeof(float64(0))) -} - -// offsetComplex returns the number of complex128 values b[0] is after a[0]. -func offsetComplex(a, b []complex128) int { - if &a[0] == &b[0] { - return 0 - } - // This expression must be atomic with respect to GC moves. - // At this stage this is true, because the GC does not - // move. See https://golang.org/issue/12445. - return int(uintptr(unsafe.Pointer(&b[0]))-uintptr(unsafe.Pointer(&a[0]))) / int(unsafe.Sizeof(complex128(0))) -} diff --git a/vendor/gonum.org/v1/gonum/mat/offset_appengine.go b/vendor/gonum.org/v1/gonum/mat/offset_appengine.go deleted file mode 100644 index 3204d18..0000000 --- a/vendor/gonum.org/v1/gonum/mat/offset_appengine.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build appengine safe - -package mat - -import "reflect" - -var sizeOfFloat64 = int(reflect.TypeOf(float64(0)).Size()) - -// offset returns the number of float64 values b[0] is after a[0]. -func offset(a, b []float64) int { - va0 := reflect.ValueOf(a).Index(0) - vb0 := reflect.ValueOf(b).Index(0) - if va0.Addr() == vb0.Addr() { - return 0 - } - // This expression must be atomic with respect to GC moves. - // At this stage this is true, because the GC does not - // move. See https://golang.org/issue/12445. - return int(vb0.UnsafeAddr()-va0.UnsafeAddr()) / sizeOfFloat64 -} - -var sizeOfComplex128 = int(reflect.TypeOf(complex128(0)).Size()) - -// offsetComplex returns the number of complex128 values b[0] is after a[0]. -func offsetComplex(a, b []complex128) int { - va0 := reflect.ValueOf(a).Index(0) - vb0 := reflect.ValueOf(b).Index(0) - if va0.Addr() == vb0.Addr() { - return 0 - } - // This expression must be atomic with respect to GC moves. - // At this stage this is true, because the GC does not - // move. See https://golang.org/issue/12445. - return int(vb0.UnsafeAddr()-va0.UnsafeAddr()) / sizeOfComplex128 -} diff --git a/vendor/gonum.org/v1/gonum/mat/pool.go b/vendor/gonum.org/v1/gonum/mat/pool.go deleted file mode 100644 index f51215c..0000000 --- a/vendor/gonum.org/v1/gonum/mat/pool.go +++ /dev/null @@ -1,238 +0,0 @@ -// Copyright ©2014 The Gonum 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 mat - -import ( - "sync" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -var tab64 = [64]byte{ - 0x3f, 0x00, 0x3a, 0x01, 0x3b, 0x2f, 0x35, 0x02, - 0x3c, 0x27, 0x30, 0x1b, 0x36, 0x21, 0x2a, 0x03, - 0x3d, 0x33, 0x25, 0x28, 0x31, 0x12, 0x1c, 0x14, - 0x37, 0x1e, 0x22, 0x0b, 0x2b, 0x0e, 0x16, 0x04, - 0x3e, 0x39, 0x2e, 0x34, 0x26, 0x1a, 0x20, 0x29, - 0x32, 0x24, 0x11, 0x13, 0x1d, 0x0a, 0x0d, 0x15, - 0x38, 0x2d, 0x19, 0x1f, 0x23, 0x10, 0x09, 0x0c, - 0x2c, 0x18, 0x0f, 0x08, 0x17, 0x07, 0x06, 0x05, -} - -// bits returns the ceiling of base 2 log of v. -// Approach based on http://stackoverflow.com/a/11398748. -func bits(v uint64) byte { - if v == 0 { - return 0 - } - v <<= 2 - v-- - v |= v >> 1 - v |= v >> 2 - v |= v >> 4 - v |= v >> 8 - v |= v >> 16 - v |= v >> 32 - return tab64[((v-(v>>1))*0x07EDD5E59A4E28C2)>>58] - 1 -} - -var ( - // pool contains size stratified workspace Dense pools. - // Each pool element i returns sized matrices with a data - // slice capped at 1< 2. - if !m.IsEmpty() { - if fr != r { - panic(ErrShape) - } - if _, lc := factors[len(factors)-1].Dims(); lc != c { - panic(ErrShape) - } - } - - dims := make([]int, len(factors)+1) - dims[0] = r - dims[len(dims)-1] = c - pc := fc - for i, f := range factors[1:] { - cr, cc := f.Dims() - dims[i+1] = cr - if pc != cr { - panic(ErrShape) - } - pc = cc - } - - return &multiplier{ - factors: factors, - dims: dims, - table: newTable(len(factors)), - } -} - -// optimize determines an optimal matrix multiply operation order. -func (p *multiplier) optimize() { - if debugProductWalk { - fmt.Printf("chain dims: %v\n", p.dims) - } - const maxInt = int(^uint(0) >> 1) - for f := 1; f < len(p.factors); f++ { - for i := 0; i < len(p.factors)-f; i++ { - j := i + f - p.table.set(i, j, entry{cost: maxInt}) - for k := i; k < j; k++ { - cost := p.table.at(i, k).cost + p.table.at(k+1, j).cost + p.dims[i]*p.dims[k+1]*p.dims[j+1] - if cost < p.table.at(i, j).cost { - p.table.set(i, j, entry{cost: cost, k: k}) - } - } - } - } -} - -// multiply walks the optimal operation tree found by optimize, -// leaving the final result in the stack. It returns the -// product, which may be copied but should be returned to -// the workspace pool. -func (p *multiplier) multiply() *Dense { - result, _ := p.multiplySubchain(0, len(p.factors)-1) - if debugProductWalk { - r, c := result.Dims() - fmt.Printf("\tpop result (%d×%d) cost=%d\n", r, c, p.table.at(0, len(p.factors)-1).cost) - } - return result.(*Dense) -} - -func (p *multiplier) multiplySubchain(i, j int) (m Matrix, intermediate bool) { - if i == j { - return p.factors[i], false - } - - a, aTmp := p.multiplySubchain(i, p.table.at(i, j).k) - b, bTmp := p.multiplySubchain(p.table.at(i, j).k+1, j) - - ar, ac := a.Dims() - br, bc := b.Dims() - if ac != br { - // Panic with a string since this - // is not a user-facing panic. - panic(ErrShape.Error()) - } - - if debugProductWalk { - fmt.Printf("\tpush f[%d] (%d×%d)%s * f[%d] (%d×%d)%s\n", - i, ar, ac, result(aTmp), j, br, bc, result(bTmp)) - } - - r := getWorkspace(ar, bc, false) - r.Mul(a, b) - if aTmp { - putWorkspace(a.(*Dense)) - } - if bTmp { - putWorkspace(b.(*Dense)) - } - return r, true -} - -type entry struct { - k int // is the chain subdivision index. - cost int // cost is the cost of the operation. -} - -// table is a row major n×n dynamic programming table. -type table struct { - n int - entries []entry -} - -func newTable(n int) table { - return table{n: n, entries: make([]entry, n*n)} -} - -func (t table) at(i, j int) entry { return t.entries[i*t.n+j] } -func (t table) set(i, j int, e entry) { t.entries[i*t.n+j] = e } - -type result bool - -func (r result) String() string { - if r { - return " (popped result)" - } - return "" -} diff --git a/vendor/gonum.org/v1/gonum/mat/qr.go b/vendor/gonum.org/v1/gonum/mat/qr.go deleted file mode 100644 index 78e9f3e..0000000 --- a/vendor/gonum.org/v1/gonum/mat/qr.go +++ /dev/null @@ -1,266 +0,0 @@ -// Copyright ©2013 The Gonum 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 mat - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" - "gonum.org/v1/gonum/lapack/lapack64" -) - -const badQR = "mat: invalid QR factorization" - -// QR is a type for creating and using the QR factorization of a matrix. -type QR struct { - qr *Dense - tau []float64 - cond float64 -} - -func (qr *QR) updateCond(norm lapack.MatrixNorm) { - // Since A = Q*R, and Q is orthogonal, we get for the condition number κ - // κ(A) := |A| |A^-1| = |Q*R| |(Q*R)^-1| = |R| |R^-1 * Qᵀ| - // = |R| |R^-1| = κ(R), - // where we used that fact that Q^-1 = Qᵀ. However, this assumes that - // the matrix norm is invariant under orthogonal transformations which - // is not the case for CondNorm. Hopefully the error is negligible: κ - // is only a qualitative measure anyway. - n := qr.qr.mat.Cols - work := getFloats(3*n, false) - iwork := getInts(n, false) - r := qr.qr.asTriDense(n, blas.NonUnit, blas.Upper) - v := lapack64.Trcon(norm, r.mat, work, iwork) - putFloats(work) - putInts(iwork) - qr.cond = 1 / v -} - -// Factorize computes the QR factorization of an m×n matrix a where m >= n. The QR -// factorization always exists even if A is singular. -// -// The QR decomposition is a factorization of the matrix A such that A = Q * R. -// The matrix Q is an orthonormal m×m matrix, and R is an m×n upper triangular matrix. -// Q and R can be extracted using the QTo and RTo methods. -func (qr *QR) Factorize(a Matrix) { - qr.factorize(a, CondNorm) -} - -func (qr *QR) factorize(a Matrix, norm lapack.MatrixNorm) { - m, n := a.Dims() - if m < n { - panic(ErrShape) - } - k := min(m, n) - if qr.qr == nil { - qr.qr = &Dense{} - } - qr.qr.CloneFrom(a) - work := []float64{0} - qr.tau = make([]float64, k) - lapack64.Geqrf(qr.qr.mat, qr.tau, work, -1) - work = getFloats(int(work[0]), false) - lapack64.Geqrf(qr.qr.mat, qr.tau, work, len(work)) - putFloats(work) - qr.updateCond(norm) -} - -// isValid returns whether the receiver contains a factorization. -func (qr *QR) isValid() bool { - return qr.qr != nil && !qr.qr.IsEmpty() -} - -// Cond returns the condition number for the factorized matrix. -// Cond will panic if the receiver does not contain a factorization. -func (qr *QR) Cond() float64 { - if !qr.isValid() { - panic(badQR) - } - return qr.cond -} - -// TODO(btracey): Add in the "Reduced" forms for extracting the n×n orthogonal -// and upper triangular matrices. - -// RTo extracts the m×n upper trapezoidal matrix from a QR decomposition. -// -// If dst is empty, RTo will resize dst to be r×c. When dst is non-empty, -// RTo will panic if dst is not r×c. RTo will also panic if the receiver -// does not contain a successful factorization. -func (qr *QR) RTo(dst *Dense) { - if !qr.isValid() { - panic(badQR) - } - - r, c := qr.qr.Dims() - if dst.IsEmpty() { - dst.ReuseAs(r, c) - } else { - r2, c2 := dst.Dims() - if c != r2 || c != c2 { - panic(ErrShape) - } - } - - // Disguise the QR as an upper triangular - t := &TriDense{ - mat: blas64.Triangular{ - N: c, - Stride: qr.qr.mat.Stride, - Data: qr.qr.mat.Data, - Uplo: blas.Upper, - Diag: blas.NonUnit, - }, - cap: qr.qr.capCols, - } - dst.Copy(t) - - // Zero below the triangular. - for i := r; i < c; i++ { - zero(dst.mat.Data[i*dst.mat.Stride : i*dst.mat.Stride+c]) - } -} - -// QTo extracts the r×r orthonormal matrix Q from a QR decomposition. -// -// If dst is empty, QTo will resize dst to be r×r. When dst is non-empty, -// QTo will panic if dst is not r×r. QTo will also panic if the receiver -// does not contain a successful factorization. -func (qr *QR) QTo(dst *Dense) { - if !qr.isValid() { - panic(badQR) - } - - r, _ := qr.qr.Dims() - if dst.IsEmpty() { - dst.ReuseAs(r, r) - } else { - r2, c2 := dst.Dims() - if r != r2 || r != c2 { - panic(ErrShape) - } - dst.Zero() - } - - // Set Q = I. - for i := 0; i < r*r; i += r + 1 { - dst.mat.Data[i] = 1 - } - - // Construct Q from the elementary reflectors. - work := []float64{0} - lapack64.Ormqr(blas.Left, blas.NoTrans, qr.qr.mat, qr.tau, dst.mat, work, -1) - work = getFloats(int(work[0]), false) - lapack64.Ormqr(blas.Left, blas.NoTrans, qr.qr.mat, qr.tau, dst.mat, work, len(work)) - putFloats(work) -} - -// SolveTo finds a minimum-norm solution to a system of linear equations defined -// by the matrices A and b, where A is an m×n matrix represented in its QR factorized -// form. If A is singular or near-singular a Condition error is returned. -// See the documentation for Condition for more information. -// -// The minimization problem solved depends on the input parameters. -// If trans == false, find X such that ||A*X - B||_2 is minimized. -// If trans == true, find the minimum norm solution of Aᵀ * X = B. -// The solution matrix, X, is stored in place into dst. -// SolveTo will panic if the receiver does not contain a factorization. -func (qr *QR) SolveTo(dst *Dense, trans bool, b Matrix) error { - if !qr.isValid() { - panic(badQR) - } - - r, c := qr.qr.Dims() - br, bc := b.Dims() - - // The QR solve algorithm stores the result in-place into the right hand side. - // The storage for the answer must be large enough to hold both b and x. - // However, this method's receiver must be the size of x. Copy b, and then - // copy the result into m at the end. - if trans { - if c != br { - panic(ErrShape) - } - dst.reuseAsNonZeroed(r, bc) - } else { - if r != br { - panic(ErrShape) - } - dst.reuseAsNonZeroed(c, bc) - } - // Do not need to worry about overlap between m and b because x has its own - // independent storage. - w := getWorkspace(max(r, c), bc, false) - w.Copy(b) - t := qr.qr.asTriDense(qr.qr.mat.Cols, blas.NonUnit, blas.Upper).mat - if trans { - ok := lapack64.Trtrs(blas.Trans, t, w.mat) - if !ok { - return Condition(math.Inf(1)) - } - for i := c; i < r; i++ { - zero(w.mat.Data[i*w.mat.Stride : i*w.mat.Stride+bc]) - } - work := []float64{0} - lapack64.Ormqr(blas.Left, blas.NoTrans, qr.qr.mat, qr.tau, w.mat, work, -1) - work = getFloats(int(work[0]), false) - lapack64.Ormqr(blas.Left, blas.NoTrans, qr.qr.mat, qr.tau, w.mat, work, len(work)) - putFloats(work) - } else { - work := []float64{0} - lapack64.Ormqr(blas.Left, blas.Trans, qr.qr.mat, qr.tau, w.mat, work, -1) - work = getFloats(int(work[0]), false) - lapack64.Ormqr(blas.Left, blas.Trans, qr.qr.mat, qr.tau, w.mat, work, len(work)) - putFloats(work) - - ok := lapack64.Trtrs(blas.NoTrans, t, w.mat) - if !ok { - return Condition(math.Inf(1)) - } - } - // X was set above to be the correct size for the result. - dst.Copy(w) - putWorkspace(w) - if qr.cond > ConditionTolerance { - return Condition(qr.cond) - } - return nil -} - -// SolveVecTo finds a minimum-norm solution to a system of linear equations, -// Ax = b. -// See QR.SolveTo for the full documentation. -// SolveVecTo will panic if the receiver does not contain a factorization. -func (qr *QR) SolveVecTo(dst *VecDense, trans bool, b Vector) error { - if !qr.isValid() { - panic(badQR) - } - - r, c := qr.qr.Dims() - if _, bc := b.Dims(); bc != 1 { - panic(ErrShape) - } - - // The Solve implementation is non-trivial, so rather than duplicate the code, - // instead recast the VecDenses as Dense and call the matrix code. - bm := Matrix(b) - if rv, ok := b.(RawVectorer); ok { - bmat := rv.RawVector() - if dst != b { - dst.checkOverlap(bmat) - } - b := VecDense{mat: bmat} - bm = b.asDense() - } - if trans { - dst.reuseAsNonZeroed(r) - } else { - dst.reuseAsNonZeroed(c) - } - return qr.SolveTo(dst.asDense(), trans, bm) - -} diff --git a/vendor/gonum.org/v1/gonum/mat/shadow.go b/vendor/gonum.org/v1/gonum/mat/shadow.go deleted file mode 100644 index 8a941c7..0000000 --- a/vendor/gonum.org/v1/gonum/mat/shadow.go +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright ©2015 The Gonum 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 mat - -import "gonum.org/v1/gonum/blas/blas64" - -// checkOverlap returns false if the receiver does not overlap data elements -// referenced by the parameter and panics otherwise. -// -// checkOverlap methods return a boolean to allow the check call to be added to a -// boolean expression, making use of short-circuit operators. -func checkOverlap(a, b blas64.General) bool { - if cap(a.Data) == 0 || cap(b.Data) == 0 { - return false - } - - off := offset(a.Data[:1], b.Data[:1]) - - if off == 0 { - // At least one element overlaps. - if a.Cols == b.Cols && a.Rows == b.Rows && a.Stride == b.Stride { - panic(regionIdentity) - } - panic(regionOverlap) - } - - if off > 0 && len(a.Data) <= off { - // We know a is completely before b. - return false - } - if off < 0 && len(b.Data) <= -off { - // We know a is completely after b. - return false - } - - if a.Stride != b.Stride && a.Stride != 1 && b.Stride != 1 { - // Too hard, so assume the worst; if either stride - // is one it will be caught in rectanglesOverlap. - panic(mismatchedStrides) - } - - if off < 0 { - off = -off - a.Cols, b.Cols = b.Cols, a.Cols - } - if rectanglesOverlap(off, a.Cols, b.Cols, min(a.Stride, b.Stride)) { - panic(regionOverlap) - } - return false -} - -func (m *Dense) checkOverlap(a blas64.General) bool { - return checkOverlap(m.RawMatrix(), a) -} - -func (m *Dense) checkOverlapMatrix(a Matrix) bool { - if m == a { - return false - } - var amat blas64.General - switch ar := a.(type) { - default: - return false - case RawMatrixer: - amat = ar.RawMatrix() - case RawSymmetricer: - amat = generalFromSymmetric(ar.RawSymmetric()) - case RawSymBander: - amat = generalFromSymmetricBand(ar.RawSymBand()) - case RawTriangular: - amat = generalFromTriangular(ar.RawTriangular()) - case RawVectorer: - r, c := a.Dims() - amat = generalFromVector(ar.RawVector(), r, c) - } - return m.checkOverlap(amat) -} - -func (s *SymDense) checkOverlap(a blas64.General) bool { - return checkOverlap(generalFromSymmetric(s.RawSymmetric()), a) -} - -func (s *SymDense) checkOverlapMatrix(a Matrix) bool { - if s == a { - return false - } - var amat blas64.General - switch ar := a.(type) { - default: - return false - case RawMatrixer: - amat = ar.RawMatrix() - case RawSymmetricer: - amat = generalFromSymmetric(ar.RawSymmetric()) - case RawSymBander: - amat = generalFromSymmetricBand(ar.RawSymBand()) - case RawTriangular: - amat = generalFromTriangular(ar.RawTriangular()) - case RawVectorer: - r, c := a.Dims() - amat = generalFromVector(ar.RawVector(), r, c) - } - return s.checkOverlap(amat) -} - -// generalFromSymmetric returns a blas64.General with the backing -// data and dimensions of a. -func generalFromSymmetric(a blas64.Symmetric) blas64.General { - return blas64.General{ - Rows: a.N, - Cols: a.N, - Stride: a.Stride, - Data: a.Data, - } -} - -func (t *TriDense) checkOverlap(a blas64.General) bool { - return checkOverlap(generalFromTriangular(t.RawTriangular()), a) -} - -func (t *TriDense) checkOverlapMatrix(a Matrix) bool { - if t == a { - return false - } - var amat blas64.General - switch ar := a.(type) { - default: - return false - case RawMatrixer: - amat = ar.RawMatrix() - case RawSymmetricer: - amat = generalFromSymmetric(ar.RawSymmetric()) - case RawSymBander: - amat = generalFromSymmetricBand(ar.RawSymBand()) - case RawTriangular: - amat = generalFromTriangular(ar.RawTriangular()) - case RawVectorer: - r, c := a.Dims() - amat = generalFromVector(ar.RawVector(), r, c) - } - return t.checkOverlap(amat) -} - -// generalFromTriangular returns a blas64.General with the backing -// data and dimensions of a. -func generalFromTriangular(a blas64.Triangular) blas64.General { - return blas64.General{ - Rows: a.N, - Cols: a.N, - Stride: a.Stride, - Data: a.Data, - } -} - -func (v *VecDense) checkOverlap(a blas64.Vector) bool { - mat := v.mat - if cap(mat.Data) == 0 || cap(a.Data) == 0 { - return false - } - - off := offset(mat.Data[:1], a.Data[:1]) - - if off == 0 { - // At least one element overlaps. - if mat.Inc == a.Inc && len(mat.Data) == len(a.Data) { - panic(regionIdentity) - } - panic(regionOverlap) - } - - if off > 0 && len(mat.Data) <= off { - // We know v is completely before a. - return false - } - if off < 0 && len(a.Data) <= -off { - // We know v is completely after a. - return false - } - - if mat.Inc != a.Inc && mat.Inc != 1 && a.Inc != 1 { - // Too hard, so assume the worst; if either - // increment is one it will be caught below. - panic(mismatchedStrides) - } - inc := min(mat.Inc, a.Inc) - - if inc == 1 || off&inc == 0 { - panic(regionOverlap) - } - return false -} - -// generalFromVector returns a blas64.General with the backing -// data and dimensions of a. -func generalFromVector(a blas64.Vector, r, c int) blas64.General { - return blas64.General{ - Rows: r, - Cols: c, - Stride: a.Inc, - Data: a.Data, - } -} - -func (s *SymBandDense) checkOverlap(a blas64.General) bool { - return checkOverlap(generalFromSymmetricBand(s.RawSymBand()), a) -} - -func (s *SymBandDense) checkOverlapMatrix(a Matrix) bool { - if s == a { - return false - } - var amat blas64.General - switch ar := a.(type) { - default: - return false - case RawMatrixer: - amat = ar.RawMatrix() - case RawSymmetricer: - amat = generalFromSymmetric(ar.RawSymmetric()) - case RawSymBander: - amat = generalFromSymmetricBand(ar.RawSymBand()) - case RawTriangular: - amat = generalFromTriangular(ar.RawTriangular()) - case RawVectorer: - r, c := a.Dims() - amat = generalFromVector(ar.RawVector(), r, c) - } - return s.checkOverlap(amat) -} - -// generalFromSymmetricBand returns a blas64.General with the backing -// data and dimensions of a. -func generalFromSymmetricBand(a blas64.SymmetricBand) blas64.General { - return blas64.General{ - Rows: a.N, - Cols: a.K + 1, - Data: a.Data, - Stride: a.Stride, - } -} diff --git a/vendor/gonum.org/v1/gonum/mat/shadow_common.go b/vendor/gonum.org/v1/gonum/mat/shadow_common.go deleted file mode 100644 index e4cdf4d..0000000 --- a/vendor/gonum.org/v1/gonum/mat/shadow_common.go +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright ©2015 The Gonum 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 mat - -const ( - // regionOverlap is the panic string used for the general case - // of a matrix region overlap between a source and destination. - regionOverlap = "mat: bad region: overlap" - - // regionIdentity is the panic string used for the specific - // case of complete agreement between a source and a destination. - regionIdentity = "mat: bad region: identical" - - // mismatchedStrides is the panic string used for overlapping - // data slices with differing strides. - mismatchedStrides = "mat: bad region: different strides" -) - -// rectanglesOverlap returns whether the strided rectangles a and b overlap -// when b is offset by off elements after a but has at least one element before -// the end of a. off must be positive. a and b have aCols and bCols respectively. -// -// rectanglesOverlap works by shifting both matrices left such that the left -// column of a is at 0. The column indexes are flattened by obtaining the shifted -// relative left and right column positions modulo the common stride. This allows -// direct comparison of the column offsets when the matrix backing data slices -// are known to overlap. -func rectanglesOverlap(off, aCols, bCols, stride int) bool { - if stride == 1 { - // Unit stride means overlapping data - // slices must overlap as matrices. - return true - } - - // Flatten the shifted matrix column positions - // so a starts at 0, modulo the common stride. - aTo := aCols - // The mod stride operations here make the from - // and to indexes comparable between a and b when - // the data slices of a and b overlap. - bFrom := off % stride - bTo := (bFrom + bCols) % stride - - if bTo == 0 || bFrom < bTo { - // b matrix is not wrapped: compare for - // simple overlap. - return bFrom < aTo - } - - // b strictly wraps and so must overlap with a. - return true -} diff --git a/vendor/gonum.org/v1/gonum/mat/shadow_complex.go b/vendor/gonum.org/v1/gonum/mat/shadow_complex.go deleted file mode 100644 index 7bf1cef..0000000 --- a/vendor/gonum.org/v1/gonum/mat/shadow_complex.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// TODO(kortschak): Generate this file from shadow.go when all complex type are available. - -package mat - -import "gonum.org/v1/gonum/blas/cblas128" - -// checkOverlapComplex returns false if the receiver does not overlap data elements -// referenced by the parameter and panics otherwise. -// -// checkOverlapComplex methods return a boolean to allow the check call to be added to a -// boolean expression, making use of short-circuit operators. -func checkOverlapComplex(a, b cblas128.General) bool { - if cap(a.Data) == 0 || cap(b.Data) == 0 { - return false - } - - off := offsetComplex(a.Data[:1], b.Data[:1]) - - if off == 0 { - // At least one element overlaps. - if a.Cols == b.Cols && a.Rows == b.Rows && a.Stride == b.Stride { - panic(regionIdentity) - } - panic(regionOverlap) - } - - if off > 0 && len(a.Data) <= off { - // We know a is completely before b. - return false - } - if off < 0 && len(b.Data) <= -off { - // We know a is completely after b. - return false - } - - if a.Stride != b.Stride && a.Stride != 1 && b.Stride != 1 { - // Too hard, so assume the worst; if either stride - // is one it will be caught in rectanglesOverlap. - panic(mismatchedStrides) - } - - if off < 0 { - off = -off - a.Cols, b.Cols = b.Cols, a.Cols - } - if rectanglesOverlap(off, a.Cols, b.Cols, min(a.Stride, b.Stride)) { - panic(regionOverlap) - } - return false -} - -func (m *CDense) checkOverlapComplex(a cblas128.General) bool { - return checkOverlapComplex(m.RawCMatrix(), a) -} - -func (m *CDense) checkOverlapMatrix(a CMatrix) bool { - if m == a { - return false - } - var amat cblas128.General - switch ar := a.(type) { - default: - return false - case RawCMatrixer: - amat = ar.RawCMatrix() - } - return m.checkOverlapComplex(amat) -} diff --git a/vendor/gonum.org/v1/gonum/mat/solve.go b/vendor/gonum.org/v1/gonum/mat/solve.go deleted file mode 100644 index df62ced..0000000 --- a/vendor/gonum.org/v1/gonum/mat/solve.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright ©2015 The Gonum 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 mat - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack/lapack64" -) - -// Solve finds a minimum-norm solution to a system of linear equations defined -// by the matrices A and B. If A is singular or near-singular, a Condition error -// is returned. See the documentation for Condition for more information. -// -// The minimization problem solved depends on the input parameters: -// - if m >= n, find X such that ||A*X - B||_2 is minimized, -// - if m < n, find the minimum norm solution of A * X = B. -// The solution matrix, X, is stored in-place into the receiver. -func (m *Dense) Solve(a, b Matrix) error { - ar, ac := a.Dims() - br, bc := b.Dims() - if ar != br { - panic(ErrShape) - } - m.reuseAsNonZeroed(ac, bc) - - // TODO(btracey): Add special cases for SymDense, etc. - aU, aTrans := untranspose(a) - bU, bTrans := untranspose(b) - switch rma := aU.(type) { - case RawTriangular: - side := blas.Left - tA := blas.NoTrans - if aTrans { - tA = blas.Trans - } - - switch rm := bU.(type) { - case RawMatrixer: - if m != bU || bTrans { - if m == bU || m.checkOverlap(rm.RawMatrix()) { - tmp := getWorkspace(br, bc, false) - tmp.Copy(b) - m.Copy(tmp) - putWorkspace(tmp) - break - } - m.Copy(b) - } - default: - if m != bU { - m.Copy(b) - } else if bTrans { - // m and b share data so Copy cannot be used directly. - tmp := getWorkspace(br, bc, false) - tmp.Copy(b) - m.Copy(tmp) - putWorkspace(tmp) - } - } - - rm := rma.RawTriangular() - blas64.Trsm(side, tA, 1, rm, m.mat) - work := getFloats(3*rm.N, false) - iwork := getInts(rm.N, false) - cond := lapack64.Trcon(CondNorm, rm, work, iwork) - putFloats(work) - putInts(iwork) - if cond > ConditionTolerance { - return Condition(cond) - } - return nil - } - - switch { - case ar == ac: - if a == b { - // x = I. - if ar == 1 { - m.mat.Data[0] = 1 - return nil - } - for i := 0; i < ar; i++ { - v := m.mat.Data[i*m.mat.Stride : i*m.mat.Stride+ac] - zero(v) - v[i] = 1 - } - return nil - } - var lu LU - lu.Factorize(a) - return lu.SolveTo(m, false, b) - case ar > ac: - var qr QR - qr.Factorize(a) - return qr.SolveTo(m, false, b) - default: - var lq LQ - lq.Factorize(a) - return lq.SolveTo(m, false, b) - } -} - -// SolveVec finds a minimum-norm solution to a system of linear equations defined -// by the matrix a and the right-hand side column vector b. If A is singular or -// near-singular, a Condition error is returned. See the documentation for -// Dense.Solve for more information. -func (v *VecDense) SolveVec(a Matrix, b Vector) error { - if _, bc := b.Dims(); bc != 1 { - panic(ErrShape) - } - _, c := a.Dims() - - // The Solve implementation is non-trivial, so rather than duplicate the code, - // instead recast the VecDenses as Dense and call the matrix code. - - if rv, ok := b.(RawVectorer); ok { - bmat := rv.RawVector() - if v != b { - v.checkOverlap(bmat) - } - v.reuseAsNonZeroed(c) - m := v.asDense() - // We conditionally create bm as m when b and v are identical - // to prevent the overlap detection code from identifying m - // and bm as overlapping but not identical. - bm := m - if v != b { - b := VecDense{mat: bmat} - bm = b.asDense() - } - return m.Solve(a, bm) - } - - v.reuseAsNonZeroed(c) - m := v.asDense() - return m.Solve(a, b) -} diff --git a/vendor/gonum.org/v1/gonum/mat/svd.go b/vendor/gonum.org/v1/gonum/mat/svd.go deleted file mode 100644 index 77fd042..0000000 --- a/vendor/gonum.org/v1/gonum/mat/svd.go +++ /dev/null @@ -1,251 +0,0 @@ -// Copyright ©2013 The Gonum 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 mat - -import ( - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" - "gonum.org/v1/gonum/lapack/lapack64" -) - -// SVD is a type for creating and using the Singular Value Decomposition (SVD) -// of a matrix. -type SVD struct { - kind SVDKind - - s []float64 - u blas64.General - vt blas64.General -} - -// SVDKind specifies the treatment of singular vectors during an SVD -// factorization. -type SVDKind int - -const ( - // SVDNone specifies that no singular vectors should be computed during - // the decomposition. - SVDNone SVDKind = 0 - - // SVDThinU specifies the thin decomposition for U should be computed. - SVDThinU SVDKind = 1 << (iota - 1) - // SVDFullU specifies the full decomposition for U should be computed. - SVDFullU - // SVDThinV specifies the thin decomposition for V should be computed. - SVDThinV - // SVDFullV specifies the full decomposition for V should be computed. - SVDFullV - - // SVDThin is a convenience value for computing both thin vectors. - SVDThin SVDKind = SVDThinU | SVDThinV - // SVDFull is a convenience value for computing both full vectors. - SVDFull SVDKind = SVDFullU | SVDFullV -) - -// succFact returns whether the receiver contains a successful factorization. -func (svd *SVD) succFact() bool { - return len(svd.s) != 0 -} - -// Factorize computes the singular value decomposition (SVD) of the input matrix A. -// The singular values of A are computed in all cases, while the singular -// vectors are optionally computed depending on the input kind. -// -// The full singular value decomposition (kind == SVDFull) is a factorization -// of an m×n matrix A of the form -// A = U * Σ * Vᵀ -// where Σ is an m×n diagonal matrix, U is an m×m orthogonal matrix, and V is an -// n×n orthogonal matrix. The diagonal elements of Σ are the singular values of A. -// The first min(m,n) columns of U and V are, respectively, the left and right -// singular vectors of A. -// -// Significant storage space can be saved by using the thin representation of -// the SVD (kind == SVDThin) instead of the full SVD, especially if -// m >> n or m << n. The thin SVD finds -// A = U~ * Σ * V~ᵀ -// where U~ is of size m×min(m,n), Σ is a diagonal matrix of size min(m,n)×min(m,n) -// and V~ is of size n×min(m,n). -// -// Factorize returns whether the decomposition succeeded. If the decomposition -// failed, routines that require a successful factorization will panic. -func (svd *SVD) Factorize(a Matrix, kind SVDKind) (ok bool) { - // kill previous factorization - svd.s = svd.s[:0] - svd.kind = kind - - m, n := a.Dims() - var jobU, jobVT lapack.SVDJob - - // TODO(btracey): This code should be modified to have the smaller - // matrix written in-place into aCopy when the lapack/native/dgesvd - // implementation is complete. - switch { - case kind&SVDFullU != 0: - jobU = lapack.SVDAll - svd.u = blas64.General{ - Rows: m, - Cols: m, - Stride: m, - Data: use(svd.u.Data, m*m), - } - case kind&SVDThinU != 0: - jobU = lapack.SVDStore - svd.u = blas64.General{ - Rows: m, - Cols: min(m, n), - Stride: min(m, n), - Data: use(svd.u.Data, m*min(m, n)), - } - default: - jobU = lapack.SVDNone - } - switch { - case kind&SVDFullV != 0: - svd.vt = blas64.General{ - Rows: n, - Cols: n, - Stride: n, - Data: use(svd.vt.Data, n*n), - } - jobVT = lapack.SVDAll - case kind&SVDThinV != 0: - svd.vt = blas64.General{ - Rows: min(m, n), - Cols: n, - Stride: n, - Data: use(svd.vt.Data, min(m, n)*n), - } - jobVT = lapack.SVDStore - default: - jobVT = lapack.SVDNone - } - - // A is destroyed on call, so copy the matrix. - aCopy := DenseCopyOf(a) - svd.kind = kind - svd.s = use(svd.s, min(m, n)) - - work := []float64{0} - lapack64.Gesvd(jobU, jobVT, aCopy.mat, svd.u, svd.vt, svd.s, work, -1) - work = getFloats(int(work[0]), false) - ok = lapack64.Gesvd(jobU, jobVT, aCopy.mat, svd.u, svd.vt, svd.s, work, len(work)) - putFloats(work) - if !ok { - svd.kind = 0 - } - return ok -} - -// Kind returns the SVDKind of the decomposition. If no decomposition has been -// computed, Kind returns -1. -func (svd *SVD) Kind() SVDKind { - if !svd.succFact() { - return -1 - } - return svd.kind -} - -// Cond returns the 2-norm condition number for the factorized matrix. Cond will -// panic if the receiver does not contain a successful factorization. -func (svd *SVD) Cond() float64 { - if !svd.succFact() { - panic(badFact) - } - return svd.s[0] / svd.s[len(svd.s)-1] -} - -// Values returns the singular values of the factorized matrix in descending order. -// -// If the input slice is non-nil, the values will be stored in-place into -// the slice. In this case, the slice must have length min(m,n), and Values will -// panic with ErrSliceLengthMismatch otherwise. If the input slice is nil, a new -// slice of the appropriate length will be allocated and returned. -// -// Values will panic if the receiver does not contain a successful factorization. -func (svd *SVD) Values(s []float64) []float64 { - if !svd.succFact() { - panic(badFact) - } - if s == nil { - s = make([]float64, len(svd.s)) - } - if len(s) != len(svd.s) { - panic(ErrSliceLengthMismatch) - } - copy(s, svd.s) - return s -} - -// UTo extracts the matrix U from the singular value decomposition. The first -// min(m,n) columns are the left singular vectors and correspond to the singular -// values as returned from SVD.Values. -// -// If dst is empty, UTo will resize dst to be m×m if the full U was computed -// and size m×min(m,n) if the thin U was computed. When dst is non-empty, then -// UTo will panic if dst is not the appropriate size. UTo will also panic if -// the receiver does not contain a successful factorization, or if U was -// not computed during factorization. -func (svd *SVD) UTo(dst *Dense) { - if !svd.succFact() { - panic(badFact) - } - kind := svd.kind - if kind&SVDThinU == 0 && kind&SVDFullU == 0 { - panic("svd: u not computed during factorization") - } - r := svd.u.Rows - c := svd.u.Cols - if dst.IsEmpty() { - dst.ReuseAs(r, c) - } else { - r2, c2 := dst.Dims() - if r != r2 || c != c2 { - panic(ErrShape) - } - } - - tmp := &Dense{ - mat: svd.u, - capRows: r, - capCols: c, - } - dst.Copy(tmp) -} - -// VTo extracts the matrix V from the singular value decomposition. The first -// min(m,n) columns are the right singular vectors and correspond to the singular -// values as returned from SVD.Values. -// -// If dst is empty, VTo will resize dst to be n×n if the full V was computed -// and size n×min(m,n) if the thin V was computed. When dst is non-empty, then -// VTo will panic if dst is not the appropriate size. VTo will also panic if -// the receiver does not contain a successful factorization, or if V was -// not computed during factorization. -func (svd *SVD) VTo(dst *Dense) { - if !svd.succFact() { - panic(badFact) - } - kind := svd.kind - if kind&SVDThinU == 0 && kind&SVDFullV == 0 { - panic("svd: v not computed during factorization") - } - r := svd.vt.Rows - c := svd.vt.Cols - if dst.IsEmpty() { - dst.ReuseAs(c, r) - } else { - r2, c2 := dst.Dims() - if c != r2 || r != c2 { - panic(ErrShape) - } - } - - tmp := &Dense{ - mat: svd.vt, - capRows: r, - capCols: c, - } - dst.Copy(tmp.T()) -} diff --git a/vendor/gonum.org/v1/gonum/mat/symband.go b/vendor/gonum.org/v1/gonum/mat/symband.go deleted file mode 100644 index ceefb09..0000000 --- a/vendor/gonum.org/v1/gonum/mat/symband.go +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright ©2017 The Gonum 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 mat - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -var ( - symBandDense *SymBandDense - _ Matrix = symBandDense - _ allMatrix = symBandDense - _ denseMatrix = symBandDense - _ Symmetric = symBandDense - _ Banded = symBandDense - _ SymBanded = symBandDense - _ RawSymBander = symBandDense - _ MutableSymBanded = symBandDense - - _ NonZeroDoer = symBandDense - _ RowNonZeroDoer = symBandDense - _ ColNonZeroDoer = symBandDense -) - -// SymBandDense represents a symmetric band matrix in dense storage format. -type SymBandDense struct { - mat blas64.SymmetricBand -} - -// SymBanded is a symmetric band matrix interface type. -type SymBanded interface { - Banded - - // Symmetric returns the number of rows/columns in the matrix. - Symmetric() int - - // SymBand returns the number of rows/columns in the matrix, and the size of - // the bandwidth. - SymBand() (n, k int) -} - -// MutableSymBanded is a symmetric band matrix interface type that allows elements -// to be altered. -type MutableSymBanded interface { - SymBanded - SetSymBand(i, j int, v float64) -} - -// A RawSymBander can return a blas64.SymmetricBand representation of the receiver. -// Changes to the blas64.SymmetricBand.Data slice will be reflected in the original -// matrix, changes to the N, K, Stride and Uplo fields will not. -type RawSymBander interface { - RawSymBand() blas64.SymmetricBand -} - -// NewSymBandDense creates a new SymBand matrix with n rows and columns. If data == nil, -// a new slice is allocated for the backing slice. If len(data) == n*(k+1), -// data is used as the backing slice, and changes to the elements of the returned -// SymBandDense will be reflected in data. If neither of these is true, NewSymBandDense -// will panic. k must be at least zero and less than n, otherwise NewSymBandDense will panic. -// -// The data must be arranged in row-major order constructed by removing the zeros -// from the rows outside the band and aligning the diagonals. SymBandDense matrices -// are stored in the upper triangle. For example, the matrix -// 1 2 3 0 0 0 -// 2 4 5 6 0 0 -// 3 5 7 8 9 0 -// 0 6 8 10 11 12 -// 0 0 9 11 13 14 -// 0 0 0 12 14 15 -// becomes (* entries are never accessed) -// 1 2 3 -// 4 5 6 -// 7 8 9 -// 10 11 12 -// 13 14 * -// 15 * * -// which is passed to NewSymBandDense as []float64{1, 2, ..., 15, *, *, *} with k=2. -// Only the values in the band portion of the matrix are used. -func NewSymBandDense(n, k int, data []float64) *SymBandDense { - if n <= 0 || k < 0 { - if n == 0 { - panic(ErrZeroLength) - } - panic("mat: negative dimension") - } - if k+1 > n { - panic("mat: band out of range") - } - bc := k + 1 - if data != nil && len(data) != n*bc { - panic(ErrShape) - } - if data == nil { - data = make([]float64, n*bc) - } - return &SymBandDense{ - mat: blas64.SymmetricBand{ - N: n, - K: k, - Stride: bc, - Uplo: blas.Upper, - Data: data, - }, - } -} - -// Dims returns the number of rows and columns in the matrix. -func (s *SymBandDense) Dims() (r, c int) { - return s.mat.N, s.mat.N -} - -// Symmetric returns the size of the receiver. -func (s *SymBandDense) Symmetric() int { - return s.mat.N -} - -// Bandwidth returns the bandwidths of the matrix. -func (s *SymBandDense) Bandwidth() (kl, ku int) { - return s.mat.K, s.mat.K -} - -// SymBand returns the number of rows/columns in the matrix, and the size of -// the bandwidth. -func (s *SymBandDense) SymBand() (n, k int) { - return s.mat.N, s.mat.K -} - -// T implements the Matrix interface. Symmetric matrices, by definition, are -// equal to their transpose, and this is a no-op. -func (s *SymBandDense) T() Matrix { - return s -} - -// TBand implements the Banded interface. -func (s *SymBandDense) TBand() Banded { - return s -} - -// RawSymBand returns the underlying blas64.SymBand used by the receiver. -// Changes to elements in the receiver following the call will be reflected -// in returned blas64.SymBand. -func (s *SymBandDense) RawSymBand() blas64.SymmetricBand { - return s.mat -} - -// SetRawSymBand sets the underlying blas64.SymmetricBand used by the receiver. -// Changes to elements in the receiver following the call will be reflected -// in the input. -// -// The supplied SymmetricBand must use blas.Upper storage format. -func (s *SymBandDense) SetRawSymBand(mat blas64.SymmetricBand) { - if mat.Uplo != blas.Upper { - panic("mat: blas64.SymmetricBand does not have blas.Upper storage") - } - s.mat = mat -} - -// IsEmpty returns whether the receiver is empty. Empty matrices can be the -// receiver for size-restricted operations. The receiver can be emptied using -// Reset. -func (s *SymBandDense) IsEmpty() bool { - return s.mat.Stride == 0 -} - -// Reset empties the matrix so that it can be reused as the -// receiver of a dimensionally restricted operation. -// -// Reset should not be used when the matrix shares backing data. -// See the Reseter interface for more information. -func (s *SymBandDense) Reset() { - s.mat.N = 0 - s.mat.K = 0 - s.mat.Stride = 0 - s.mat.Uplo = 0 - s.mat.Data = s.mat.Data[:0:0] -} - -// Zero sets all of the matrix elements to zero. -func (s *SymBandDense) Zero() { - for i := 0; i < s.mat.N; i++ { - u := min(1+s.mat.K, s.mat.N-i) - zero(s.mat.Data[i*s.mat.Stride : i*s.mat.Stride+u]) - } -} - -// DiagView returns the diagonal as a matrix backed by the original data. -func (s *SymBandDense) DiagView() Diagonal { - n := s.mat.N - return &DiagDense{ - mat: blas64.Vector{ - N: n, - Inc: s.mat.Stride, - Data: s.mat.Data[:(n-1)*s.mat.Stride+1], - }, - } -} - -// DoNonZero calls the function fn for each of the non-zero elements of s. The function fn -// takes a row/column index and the element value of s at (i, j). -func (s *SymBandDense) DoNonZero(fn func(i, j int, v float64)) { - for i := 0; i < s.mat.N; i++ { - for j := max(0, i-s.mat.K); j < min(s.mat.N, i+s.mat.K+1); j++ { - v := s.at(i, j) - if v != 0 { - fn(i, j, v) - } - } - } -} - -// DoRowNonZero calls the function fn for each of the non-zero elements of row i of s. The function fn -// takes a row/column index and the element value of s at (i, j). -func (s *SymBandDense) DoRowNonZero(i int, fn func(i, j int, v float64)) { - if i < 0 || s.mat.N <= i { - panic(ErrRowAccess) - } - for j := max(0, i-s.mat.K); j < min(s.mat.N, i+s.mat.K+1); j++ { - v := s.at(i, j) - if v != 0 { - fn(i, j, v) - } - } -} - -// DoColNonZero calls the function fn for each of the non-zero elements of column j of s. The function fn -// takes a row/column index and the element value of s at (i, j). -func (s *SymBandDense) DoColNonZero(j int, fn func(i, j int, v float64)) { - if j < 0 || s.mat.N <= j { - panic(ErrColAccess) - } - for i := 0; i < s.mat.N; i++ { - if i-s.mat.K <= j && j < i+s.mat.K+1 { - v := s.at(i, j) - if v != 0 { - fn(i, j, v) - } - } - } -} - -// Trace returns the trace. -func (s *SymBandDense) Trace() float64 { - rb := s.RawSymBand() - var tr float64 - for i := 0; i < rb.N; i++ { - tr += rb.Data[i*rb.Stride] - } - return tr -} - -// MulVecTo computes S⋅x storing the result into dst. -func (s *SymBandDense) MulVecTo(dst *VecDense, _ bool, x Vector) { - n := s.mat.N - if x.Len() != n { - panic(ErrShape) - } - dst.reuseAsNonZeroed(n) - - xMat, _ := untransposeExtract(x) - if xVec, ok := xMat.(*VecDense); ok { - if dst != xVec { - dst.checkOverlap(xVec.mat) - blas64.Sbmv(1, s.mat, xVec.mat, 0, dst.mat) - } else { - xCopy := getWorkspaceVec(n, false) - xCopy.CloneVec(xVec) - blas64.Sbmv(1, s.mat, xCopy.mat, 0, dst.mat) - putWorkspaceVec(xCopy) - } - } else { - xCopy := getWorkspaceVec(n, false) - xCopy.CloneVec(x) - blas64.Sbmv(1, s.mat, xCopy.mat, 0, dst.mat) - putWorkspaceVec(xCopy) - } -} diff --git a/vendor/gonum.org/v1/gonum/mat/symmetric.go b/vendor/gonum.org/v1/gonum/mat/symmetric.go deleted file mode 100644 index 6707fd5..0000000 --- a/vendor/gonum.org/v1/gonum/mat/symmetric.go +++ /dev/null @@ -1,666 +0,0 @@ -// Copyright ©2015 The Gonum 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 mat - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -var ( - symDense *SymDense - - _ Matrix = symDense - _ allMatrix = symDense - _ denseMatrix = symDense - _ Symmetric = symDense - _ RawSymmetricer = symDense - _ MutableSymmetric = symDense -) - -const ( - badSymTriangle = "mat: blas64.Symmetric not upper" - badSymCap = "mat: bad capacity for SymDense" -) - -// SymDense is a symmetric matrix that uses dense storage. SymDense -// matrices are stored in the upper triangle. -type SymDense struct { - mat blas64.Symmetric - cap int -} - -// Symmetric represents a symmetric matrix (where the element at {i, j} equals -// the element at {j, i}). Symmetric matrices are always square. -type Symmetric interface { - Matrix - // Symmetric returns the number of rows/columns in the matrix. - Symmetric() int -} - -// A RawSymmetricer can return a view of itself as a BLAS Symmetric matrix. -type RawSymmetricer interface { - RawSymmetric() blas64.Symmetric -} - -// A MutableSymmetric can set elements of a symmetric matrix. -type MutableSymmetric interface { - Symmetric - SetSym(i, j int, v float64) -} - -// NewSymDense creates a new Symmetric matrix with n rows and columns. If data == nil, -// a new slice is allocated for the backing slice. If len(data) == n*n, data is -// used as the backing slice, and changes to the elements of the returned SymDense -// will be reflected in data. If neither of these is true, NewSymDense will panic. -// NewSymDense will panic if n is zero. -// -// The data must be arranged in row-major order, i.e. the (i*c + j)-th -// element in the data slice is the {i, j}-th element in the matrix. -// Only the values in the upper triangular portion of the matrix are used. -func NewSymDense(n int, data []float64) *SymDense { - if n <= 0 { - if n == 0 { - panic(ErrZeroLength) - } - panic("mat: negative dimension") - } - if data != nil && n*n != len(data) { - panic(ErrShape) - } - if data == nil { - data = make([]float64, n*n) - } - return &SymDense{ - mat: blas64.Symmetric{ - N: n, - Stride: n, - Data: data, - Uplo: blas.Upper, - }, - cap: n, - } -} - -// Dims returns the number of rows and columns in the matrix. -func (s *SymDense) Dims() (r, c int) { - return s.mat.N, s.mat.N -} - -// Caps returns the number of rows and columns in the backing matrix. -func (s *SymDense) Caps() (r, c int) { - return s.cap, s.cap -} - -// T returns the receiver, the transpose of a symmetric matrix. -func (s *SymDense) T() Matrix { - return s -} - -// Symmetric implements the Symmetric interface and returns the number of rows -// and columns in the matrix. -func (s *SymDense) Symmetric() int { - return s.mat.N -} - -// RawSymmetric returns the matrix as a blas64.Symmetric. The returned -// value must be stored in upper triangular format. -func (s *SymDense) RawSymmetric() blas64.Symmetric { - return s.mat -} - -// SetRawSymmetric sets the underlying blas64.Symmetric used by the receiver. -// Changes to elements in the receiver following the call will be reflected -// in the input. -// -// The supplied Symmetric must use blas.Upper storage format. -func (s *SymDense) SetRawSymmetric(mat blas64.Symmetric) { - if mat.Uplo != blas.Upper { - panic(badSymTriangle) - } - s.cap = mat.N - s.mat = mat -} - -// Reset empties the matrix so that it can be reused as the -// receiver of a dimensionally restricted operation. -// -// Reset should not be used when the matrix shares backing data. -// See the Reseter interface for more information. -func (s *SymDense) Reset() { - // N and Stride must be zeroed in unison. - s.mat.N, s.mat.Stride = 0, 0 - s.mat.Data = s.mat.Data[:0] -} - -// ReuseAsSym changes the receiver if it IsEmpty() to be of size n×n. -// -// ReuseAsSym re-uses the backing data slice if it has sufficient capacity, -// otherwise a new slice is allocated. The backing data is zero on return. -// -// ReuseAsSym panics if the receiver is not empty, and panics if -// the input size is less than one. To empty the receiver for re-use, -// Reset should be used. -func (s *SymDense) ReuseAsSym(n int) { - if n <= 0 { - if n == 0 { - panic(ErrZeroLength) - } - panic(ErrNegativeDimension) - } - if !s.IsEmpty() { - panic(ErrReuseNonEmpty) - } - s.reuseAsZeroed(n) -} - -// Zero sets all of the matrix elements to zero. -func (s *SymDense) Zero() { - for i := 0; i < s.mat.N; i++ { - zero(s.mat.Data[i*s.mat.Stride+i : i*s.mat.Stride+s.mat.N]) - } -} - -// IsEmpty returns whether the receiver is empty. Empty matrices can be the -// receiver for size-restricted operations. The receiver can be emptied using -// Reset. -func (s *SymDense) IsEmpty() bool { - // It must be the case that m.Dims() returns - // zeros in this case. See comment in Reset(). - return s.mat.N == 0 -} - -// reuseAsNonZeroed resizes an empty matrix to a n×n matrix, -// or checks that a non-empty matrix is n×n. -func (s *SymDense) reuseAsNonZeroed(n int) { - // reuseAsNonZeroed must be kept in sync with reuseAsZeroed. - if n == 0 { - panic(ErrZeroLength) - } - if s.mat.N > s.cap { - panic(badSymCap) - } - if s.IsEmpty() { - s.mat = blas64.Symmetric{ - N: n, - Stride: n, - Data: use(s.mat.Data, n*n), - Uplo: blas.Upper, - } - s.cap = n - return - } - if s.mat.Uplo != blas.Upper { - panic(badSymTriangle) - } - if s.mat.N != n { - panic(ErrShape) - } -} - -// reuseAsNonZeroed resizes an empty matrix to a n×n matrix, -// or checks that a non-empty matrix is n×n. It then zeros the -// elements of the matrix. -func (s *SymDense) reuseAsZeroed(n int) { - // reuseAsZeroed must be kept in sync with reuseAsNonZeroed. - if n == 0 { - panic(ErrZeroLength) - } - if s.mat.N > s.cap { - panic(badSymCap) - } - if s.IsEmpty() { - s.mat = blas64.Symmetric{ - N: n, - Stride: n, - Data: useZeroed(s.mat.Data, n*n), - Uplo: blas.Upper, - } - s.cap = n - return - } - if s.mat.Uplo != blas.Upper { - panic(badSymTriangle) - } - if s.mat.N != n { - panic(ErrShape) - } - s.Zero() -} - -func (s *SymDense) isolatedWorkspace(a Symmetric) (w *SymDense, restore func()) { - n := a.Symmetric() - if n == 0 { - panic(ErrZeroLength) - } - w = getWorkspaceSym(n, false) - return w, func() { - s.CopySym(w) - putWorkspaceSym(w) - } -} - -// DiagView returns the diagonal as a matrix backed by the original data. -func (s *SymDense) DiagView() Diagonal { - n := s.mat.N - return &DiagDense{ - mat: blas64.Vector{ - N: n, - Inc: s.mat.Stride + 1, - Data: s.mat.Data[:(n-1)*s.mat.Stride+n], - }, - } -} - -func (s *SymDense) AddSym(a, b Symmetric) { - n := a.Symmetric() - if n != b.Symmetric() { - panic(ErrShape) - } - s.reuseAsNonZeroed(n) - - if a, ok := a.(RawSymmetricer); ok { - if b, ok := b.(RawSymmetricer); ok { - amat, bmat := a.RawSymmetric(), b.RawSymmetric() - if s != a { - s.checkOverlap(generalFromSymmetric(amat)) - } - if s != b { - s.checkOverlap(generalFromSymmetric(bmat)) - } - for i := 0; i < n; i++ { - btmp := bmat.Data[i*bmat.Stride+i : i*bmat.Stride+n] - stmp := s.mat.Data[i*s.mat.Stride+i : i*s.mat.Stride+n] - for j, v := range amat.Data[i*amat.Stride+i : i*amat.Stride+n] { - stmp[j] = v + btmp[j] - } - } - return - } - } - - s.checkOverlapMatrix(a) - s.checkOverlapMatrix(b) - for i := 0; i < n; i++ { - stmp := s.mat.Data[i*s.mat.Stride : i*s.mat.Stride+n] - for j := i; j < n; j++ { - stmp[j] = a.At(i, j) + b.At(i, j) - } - } -} - -func (s *SymDense) CopySym(a Symmetric) int { - n := a.Symmetric() - n = min(n, s.mat.N) - if n == 0 { - return 0 - } - switch a := a.(type) { - case RawSymmetricer: - amat := a.RawSymmetric() - if amat.Uplo != blas.Upper { - panic(badSymTriangle) - } - for i := 0; i < n; i++ { - copy(s.mat.Data[i*s.mat.Stride+i:i*s.mat.Stride+n], amat.Data[i*amat.Stride+i:i*amat.Stride+n]) - } - default: - for i := 0; i < n; i++ { - stmp := s.mat.Data[i*s.mat.Stride : i*s.mat.Stride+n] - for j := i; j < n; j++ { - stmp[j] = a.At(i, j) - } - } - } - return n -} - -// SymRankOne performs a symmetric rank-one update to the matrix a with x, -// which is treated as a column vector, and stores the result in the receiver -// s = a + alpha * x * xᵀ -func (s *SymDense) SymRankOne(a Symmetric, alpha float64, x Vector) { - n := x.Len() - if a.Symmetric() != n { - panic(ErrShape) - } - s.reuseAsNonZeroed(n) - - if s != a { - if rs, ok := a.(RawSymmetricer); ok { - s.checkOverlap(generalFromSymmetric(rs.RawSymmetric())) - } - s.CopySym(a) - } - - xU, _ := untransposeExtract(x) - if rv, ok := xU.(*VecDense); ok { - r, c := xU.Dims() - xmat := rv.mat - s.checkOverlap(generalFromVector(xmat, r, c)) - blas64.Syr(alpha, xmat, s.mat) - return - } - - for i := 0; i < n; i++ { - for j := i; j < n; j++ { - s.set(i, j, s.at(i, j)+alpha*x.AtVec(i)*x.AtVec(j)) - } - } -} - -// SymRankK performs a symmetric rank-k update to the matrix a and stores the -// result into the receiver. If a is zero, see SymOuterK. -// s = a + alpha * x * x' -func (s *SymDense) SymRankK(a Symmetric, alpha float64, x Matrix) { - n := a.Symmetric() - r, _ := x.Dims() - if r != n { - panic(ErrShape) - } - xMat, aTrans := untransposeExtract(x) - var g blas64.General - if rm, ok := xMat.(*Dense); ok { - g = rm.mat - } else { - g = DenseCopyOf(x).mat - aTrans = false - } - if a != s { - if rs, ok := a.(RawSymmetricer); ok { - s.checkOverlap(generalFromSymmetric(rs.RawSymmetric())) - } - s.reuseAsNonZeroed(n) - s.CopySym(a) - } - t := blas.NoTrans - if aTrans { - t = blas.Trans - } - blas64.Syrk(t, alpha, g, 1, s.mat) -} - -// SymOuterK calculates the outer product of x with itself and stores -// the result into the receiver. It is equivalent to the matrix -// multiplication -// s = alpha * x * x'. -// In order to update an existing matrix, see SymRankOne. -func (s *SymDense) SymOuterK(alpha float64, x Matrix) { - n, _ := x.Dims() - switch { - case s.IsEmpty(): - s.mat = blas64.Symmetric{ - N: n, - Stride: n, - Data: useZeroed(s.mat.Data, n*n), - Uplo: blas.Upper, - } - s.cap = n - s.SymRankK(s, alpha, x) - case s.mat.Uplo != blas.Upper: - panic(badSymTriangle) - case s.mat.N == n: - if s == x { - w := getWorkspaceSym(n, true) - w.SymRankK(w, alpha, x) - s.CopySym(w) - putWorkspaceSym(w) - } else { - switch r := x.(type) { - case RawMatrixer: - s.checkOverlap(r.RawMatrix()) - case RawSymmetricer: - s.checkOverlap(generalFromSymmetric(r.RawSymmetric())) - case RawTriangular: - s.checkOverlap(generalFromTriangular(r.RawTriangular())) - } - // Only zero the upper triangle. - for i := 0; i < n; i++ { - ri := i * s.mat.Stride - zero(s.mat.Data[ri+i : ri+n]) - } - s.SymRankK(s, alpha, x) - } - default: - panic(ErrShape) - } -} - -// RankTwo performs a symmetric rank-two update to the matrix a with the -// vectors x and y, which are treated as column vectors, and stores the -// result in the receiver -// m = a + alpha * (x * yᵀ + y * xᵀ) -func (s *SymDense) RankTwo(a Symmetric, alpha float64, x, y Vector) { - n := s.mat.N - if x.Len() != n { - panic(ErrShape) - } - if y.Len() != n { - panic(ErrShape) - } - - if s != a { - if rs, ok := a.(RawSymmetricer); ok { - s.checkOverlap(generalFromSymmetric(rs.RawSymmetric())) - } - } - - var xmat, ymat blas64.Vector - fast := true - xU, _ := untransposeExtract(x) - if rv, ok := xU.(*VecDense); ok { - r, c := xU.Dims() - xmat = rv.mat - s.checkOverlap(generalFromVector(xmat, r, c)) - } else { - fast = false - } - yU, _ := untransposeExtract(y) - if rv, ok := yU.(*VecDense); ok { - r, c := yU.Dims() - ymat = rv.mat - s.checkOverlap(generalFromVector(ymat, r, c)) - } else { - fast = false - } - - if s != a { - if rs, ok := a.(RawSymmetricer); ok { - s.checkOverlap(generalFromSymmetric(rs.RawSymmetric())) - } - s.reuseAsNonZeroed(n) - s.CopySym(a) - } - - if fast { - if s != a { - s.reuseAsNonZeroed(n) - s.CopySym(a) - } - blas64.Syr2(alpha, xmat, ymat, s.mat) - return - } - - for i := 0; i < n; i++ { - s.reuseAsNonZeroed(n) - for j := i; j < n; j++ { - s.set(i, j, a.At(i, j)+alpha*(x.AtVec(i)*y.AtVec(j)+y.AtVec(i)*x.AtVec(j))) - } - } -} - -// ScaleSym multiplies the elements of a by f, placing the result in the receiver. -func (s *SymDense) ScaleSym(f float64, a Symmetric) { - n := a.Symmetric() - s.reuseAsNonZeroed(n) - if a, ok := a.(RawSymmetricer); ok { - amat := a.RawSymmetric() - if s != a { - s.checkOverlap(generalFromSymmetric(amat)) - } - for i := 0; i < n; i++ { - for j := i; j < n; j++ { - s.mat.Data[i*s.mat.Stride+j] = f * amat.Data[i*amat.Stride+j] - } - } - return - } - for i := 0; i < n; i++ { - for j := i; j < n; j++ { - s.mat.Data[i*s.mat.Stride+j] = f * a.At(i, j) - } - } -} - -// SubsetSym extracts a subset of the rows and columns of the matrix a and stores -// the result in-place into the receiver. The resulting matrix size is -// len(set)×len(set). Specifically, at the conclusion of SubsetSym, -// s.At(i, j) equals a.At(set[i], set[j]). Note that the supplied set does not -// have to be a strict subset, dimension repeats are allowed. -func (s *SymDense) SubsetSym(a Symmetric, set []int) { - n := len(set) - na := a.Symmetric() - s.reuseAsNonZeroed(n) - var restore func() - if a == s { - s, restore = s.isolatedWorkspace(a) - defer restore() - } - - if a, ok := a.(RawSymmetricer); ok { - raw := a.RawSymmetric() - if s != a { - s.checkOverlap(generalFromSymmetric(raw)) - } - for i := 0; i < n; i++ { - ssub := s.mat.Data[i*s.mat.Stride : i*s.mat.Stride+n] - r := set[i] - rsub := raw.Data[r*raw.Stride : r*raw.Stride+na] - for j := i; j < n; j++ { - c := set[j] - if r <= c { - ssub[j] = rsub[c] - } else { - ssub[j] = raw.Data[c*raw.Stride+r] - } - } - } - return - } - for i := 0; i < n; i++ { - for j := i; j < n; j++ { - s.mat.Data[i*s.mat.Stride+j] = a.At(set[i], set[j]) - } - } -} - -// SliceSym returns a new Matrix that shares backing data with the receiver. -// The returned matrix starts at {i,i} of the receiver and extends k-i rows -// and columns. The final row and column in the resulting matrix is k-1. -// SliceSym panics with ErrIndexOutOfRange if the slice is outside the -// capacity of the receiver. -func (s *SymDense) SliceSym(i, k int) Symmetric { - return s.sliceSym(i, k) -} - -func (s *SymDense) sliceSym(i, k int) *SymDense { - sz := s.cap - if i < 0 || sz < i || k < i || sz < k { - panic(ErrIndexOutOfRange) - } - v := *s - v.mat.Data = s.mat.Data[i*s.mat.Stride+i : (k-1)*s.mat.Stride+k] - v.mat.N = k - i - v.cap = s.cap - i - return &v -} - -// Trace returns the trace of the matrix. -func (s *SymDense) Trace() float64 { - // TODO(btracey): could use internal asm sum routine. - var v float64 - for i := 0; i < s.mat.N; i++ { - v += s.mat.Data[i*s.mat.Stride+i] - } - return v -} - -// GrowSym returns the receiver expanded by n rows and n columns. If the -// dimensions of the expanded matrix are outside the capacity of the receiver -// a new allocation is made, otherwise not. Note that the receiver itself is -// not modified during the call to GrowSquare. -func (s *SymDense) GrowSym(n int) Symmetric { - if n < 0 { - panic(ErrIndexOutOfRange) - } - if n == 0 { - return s - } - var v SymDense - n += s.mat.N - if n > s.cap { - v.mat = blas64.Symmetric{ - N: n, - Stride: n, - Uplo: blas.Upper, - Data: make([]float64, n*n), - } - v.cap = n - // Copy elements, including those not currently visible. Use a temporary - // structure to avoid modifying the receiver. - var tmp SymDense - tmp.mat = blas64.Symmetric{ - N: s.cap, - Stride: s.mat.Stride, - Data: s.mat.Data, - Uplo: s.mat.Uplo, - } - tmp.cap = s.cap - v.CopySym(&tmp) - return &v - } - v.mat = blas64.Symmetric{ - N: n, - Stride: s.mat.Stride, - Uplo: blas.Upper, - Data: s.mat.Data[:(n-1)*s.mat.Stride+n], - } - v.cap = s.cap - return &v -} - -// PowPSD computes a^pow where a is a positive symmetric definite matrix. -// -// PowPSD returns an error if the matrix is not not positive symmetric definite -// or the Eigen decomposition is not successful. -func (s *SymDense) PowPSD(a Symmetric, pow float64) error { - dim := a.Symmetric() - s.reuseAsNonZeroed(dim) - - var eigen EigenSym - ok := eigen.Factorize(a, true) - if !ok { - return ErrFailedEigen - } - values := eigen.Values(nil) - for i, v := range values { - if v <= 0 { - return ErrNotPSD - } - values[i] = math.Pow(v, pow) - } - var u Dense - eigen.VectorsTo(&u) - - s.SymOuterK(values[0], u.ColView(0)) - - var v VecDense - for i := 1; i < dim; i++ { - v.ColViewOf(&u, i) - s.SymRankOne(s, values[i], &v) - } - return nil -} diff --git a/vendor/gonum.org/v1/gonum/mat/triangular.go b/vendor/gonum.org/v1/gonum/mat/triangular.go deleted file mode 100644 index 89c4e9d..0000000 --- a/vendor/gonum.org/v1/gonum/mat/triangular.go +++ /dev/null @@ -1,734 +0,0 @@ -// Copyright ©2015 The Gonum 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 mat - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack/lapack64" -) - -var ( - triDense *TriDense - _ Matrix = triDense - _ allMatrix = triDense - _ denseMatrix = triDense - _ Triangular = triDense - _ RawTriangular = triDense - _ MutableTriangular = triDense - - _ NonZeroDoer = triDense - _ RowNonZeroDoer = triDense - _ ColNonZeroDoer = triDense -) - -const badTriCap = "mat: bad capacity for TriDense" - -// TriDense represents an upper or lower triangular matrix in dense storage -// format. -type TriDense struct { - mat blas64.Triangular - cap int -} - -// Triangular represents a triangular matrix. Triangular matrices are always square. -type Triangular interface { - Matrix - // Triangle returns the number of rows/columns in the matrix and its - // orientation. - Triangle() (n int, kind TriKind) - - // TTri is the equivalent of the T() method in the Matrix interface but - // guarantees the transpose is of triangular type. - TTri() Triangular -} - -// A RawTriangular can return a blas64.Triangular representation of the receiver. -// Changes to the blas64.Triangular.Data slice will be reflected in the original -// matrix, changes to the N, Stride, Uplo and Diag fields will not. -type RawTriangular interface { - RawTriangular() blas64.Triangular -} - -// A MutableTriangular can set elements of a triangular matrix. -type MutableTriangular interface { - Triangular - SetTri(i, j int, v float64) -} - -var ( - _ Matrix = TransposeTri{} - _ Triangular = TransposeTri{} - _ UntransposeTrier = TransposeTri{} -) - -// TransposeTri is a type for performing an implicit transpose of a Triangular -// matrix. It implements the Triangular interface, returning values from the -// transpose of the matrix within. -type TransposeTri struct { - Triangular Triangular -} - -// At returns the value of the element at row i and column j of the transposed -// matrix, that is, row j and column i of the Triangular field. -func (t TransposeTri) At(i, j int) float64 { - return t.Triangular.At(j, i) -} - -// Dims returns the dimensions of the transposed matrix. Triangular matrices are -// square and thus this is the same size as the original Triangular. -func (t TransposeTri) Dims() (r, c int) { - c, r = t.Triangular.Dims() - return r, c -} - -// T performs an implicit transpose by returning the Triangular field. -func (t TransposeTri) T() Matrix { - return t.Triangular -} - -// Triangle returns the number of rows/columns in the matrix and its orientation. -func (t TransposeTri) Triangle() (int, TriKind) { - n, upper := t.Triangular.Triangle() - return n, !upper -} - -// TTri performs an implicit transpose by returning the Triangular field. -func (t TransposeTri) TTri() Triangular { - return t.Triangular -} - -// Untranspose returns the Triangular field. -func (t TransposeTri) Untranspose() Matrix { - return t.Triangular -} - -func (t TransposeTri) UntransposeTri() Triangular { - return t.Triangular -} - -// NewTriDense creates a new Triangular matrix with n rows and columns. If data == nil, -// a new slice is allocated for the backing slice. If len(data) == n*n, data is -// used as the backing slice, and changes to the elements of the returned TriDense -// will be reflected in data. If neither of these is true, NewTriDense will panic. -// NewTriDense will panic if n is zero. -// -// The data must be arranged in row-major order, i.e. the (i*c + j)-th -// element in the data slice is the {i, j}-th element in the matrix. -// Only the values in the triangular portion corresponding to kind are used. -func NewTriDense(n int, kind TriKind, data []float64) *TriDense { - if n <= 0 { - if n == 0 { - panic(ErrZeroLength) - } - panic("mat: negative dimension") - } - if data != nil && len(data) != n*n { - panic(ErrShape) - } - if data == nil { - data = make([]float64, n*n) - } - uplo := blas.Lower - if kind == Upper { - uplo = blas.Upper - } - return &TriDense{ - mat: blas64.Triangular{ - N: n, - Stride: n, - Data: data, - Uplo: uplo, - Diag: blas.NonUnit, - }, - cap: n, - } -} - -func (t *TriDense) Dims() (r, c int) { - return t.mat.N, t.mat.N -} - -// Triangle returns the dimension of t and its orientation. The returned -// orientation is only valid when n is not empty. -func (t *TriDense) Triangle() (n int, kind TriKind) { - return t.mat.N, t.triKind() -} - -func (t *TriDense) isUpper() bool { - return isUpperUplo(t.mat.Uplo) -} - -func (t *TriDense) triKind() TriKind { - return TriKind(isUpperUplo(t.mat.Uplo)) -} - -func isUpperUplo(u blas.Uplo) bool { - switch u { - case blas.Upper: - return true - case blas.Lower: - return false - default: - panic(badTriangle) - } -} - -// asSymBlas returns the receiver restructured as a blas64.Symmetric with the -// same backing memory. Panics if the receiver is unit. -// This returns a blas64.Symmetric and not a *SymDense because SymDense can only -// be upper triangular. -func (t *TriDense) asSymBlas() blas64.Symmetric { - if t.mat.Diag == blas.Unit { - panic("mat: cannot convert unit TriDense into blas64.Symmetric") - } - return blas64.Symmetric{ - N: t.mat.N, - Stride: t.mat.Stride, - Data: t.mat.Data, - Uplo: t.mat.Uplo, - } -} - -// T performs an implicit transpose by returning the receiver inside a Transpose. -func (t *TriDense) T() Matrix { - return Transpose{t} -} - -// TTri performs an implicit transpose by returning the receiver inside a TransposeTri. -func (t *TriDense) TTri() Triangular { - return TransposeTri{t} -} - -func (t *TriDense) RawTriangular() blas64.Triangular { - return t.mat -} - -// SetRawTriangular sets the underlying blas64.Triangular used by the receiver. -// Changes to elements in the receiver following the call will be reflected -// in the input. -// -// The supplied Triangular must not use blas.Unit storage format. -func (t *TriDense) SetRawTriangular(mat blas64.Triangular) { - if mat.Diag == blas.Unit { - panic("mat: cannot set TriDense with Unit storage format") - } - t.cap = mat.N - t.mat = mat -} - -// Reset empties the matrix so that it can be reused as the -// receiver of a dimensionally restricted operation. -// -// Reset should not be used when the matrix shares backing data. -// See the Reseter interface for more information. -func (t *TriDense) Reset() { - // N and Stride must be zeroed in unison. - t.mat.N, t.mat.Stride = 0, 0 - // Defensively zero Uplo to ensure - // it is set correctly later. - t.mat.Uplo = 0 - t.mat.Data = t.mat.Data[:0] -} - -// Zero sets all of the matrix elements to zero. -func (t *TriDense) Zero() { - if t.isUpper() { - for i := 0; i < t.mat.N; i++ { - zero(t.mat.Data[i*t.mat.Stride+i : i*t.mat.Stride+t.mat.N]) - } - return - } - for i := 0; i < t.mat.N; i++ { - zero(t.mat.Data[i*t.mat.Stride : i*t.mat.Stride+i+1]) - } -} - -// IsEmpty returns whether the receiver is empty. Empty matrices can be the -// receiver for size-restricted operations. The receiver can be emptied using -// Reset. -func (t *TriDense) IsEmpty() bool { - // It must be the case that t.Dims() returns - // zeros in this case. See comment in Reset(). - return t.mat.Stride == 0 -} - -// untranspose untransposes a matrix if applicable. If a is an Untransposer, then -// untranspose returns the underlying matrix and true. If it is not, then it returns -// the input matrix and false. -func untransposeTri(a Triangular) (Triangular, bool) { - if ut, ok := a.(UntransposeTrier); ok { - return ut.UntransposeTri(), true - } - return a, false -} - -// ReuseAsTri changes the receiver if it IsEmpty() to be of size n×n. -// -// ReuseAsTri re-uses the backing data slice if it has sufficient capacity, -// otherwise a new slice is allocated. The backing data is zero on return. -// -// ReuseAsTri panics if the receiver is not empty, and panics if -// the input size is less than one. To empty the receiver for re-use, -// Reset should be used. -func (t *TriDense) ReuseAsTri(n int, kind TriKind) { - if n <= 0 { - if n == 0 { - panic(ErrZeroLength) - } - panic(ErrNegativeDimension) - } - if !t.IsEmpty() { - panic(ErrReuseNonEmpty) - } - t.reuseAsZeroed(n, kind) -} - -// reuseAsNonZeroed resizes a zero receiver to an n×n triangular matrix with the given -// orientation. If the receiver is non-zero, reuseAsNonZeroed checks that the receiver -// is the correct size and orientation. -func (t *TriDense) reuseAsNonZeroed(n int, kind TriKind) { - // reuseAsNonZeroed must be kept in sync with reuseAsZeroed. - if n == 0 { - panic(ErrZeroLength) - } - ul := blas.Lower - if kind == Upper { - ul = blas.Upper - } - if t.mat.N > t.cap { - panic(badTriCap) - } - if t.IsEmpty() { - t.mat = blas64.Triangular{ - N: n, - Stride: n, - Diag: blas.NonUnit, - Data: use(t.mat.Data, n*n), - Uplo: ul, - } - t.cap = n - return - } - if t.mat.N != n { - panic(ErrShape) - } - if t.mat.Uplo != ul { - panic(ErrTriangle) - } -} - -// reuseAsZeroed resizes a zero receiver to an n×n triangular matrix with the given -// orientation. If the receiver is non-zero, reuseAsZeroed checks that the receiver -// is the correct size and orientation. It then zeros out the matrix data. -func (t *TriDense) reuseAsZeroed(n int, kind TriKind) { - // reuseAsZeroed must be kept in sync with reuseAsNonZeroed. - if n == 0 { - panic(ErrZeroLength) - } - ul := blas.Lower - if kind == Upper { - ul = blas.Upper - } - if t.mat.N > t.cap { - panic(badTriCap) - } - if t.IsEmpty() { - t.mat = blas64.Triangular{ - N: n, - Stride: n, - Diag: blas.NonUnit, - Data: useZeroed(t.mat.Data, n*n), - Uplo: ul, - } - t.cap = n - return - } - if t.mat.N != n { - panic(ErrShape) - } - if t.mat.Uplo != ul { - panic(ErrTriangle) - } - t.Zero() -} - -// isolatedWorkspace returns a new TriDense matrix w with the size of a and -// returns a callback to defer which performs cleanup at the return of the call. -// This should be used when a method receiver is the same pointer as an input argument. -func (t *TriDense) isolatedWorkspace(a Triangular) (w *TriDense, restore func()) { - n, kind := a.Triangle() - if n == 0 { - panic(ErrZeroLength) - } - w = getWorkspaceTri(n, kind, false) - return w, func() { - t.Copy(w) - putWorkspaceTri(w) - } -} - -// DiagView returns the diagonal as a matrix backed by the original data. -func (t *TriDense) DiagView() Diagonal { - if t.mat.Diag == blas.Unit { - panic("mat: cannot take view of Unit diagonal") - } - n := t.mat.N - return &DiagDense{ - mat: blas64.Vector{ - N: n, - Inc: t.mat.Stride + 1, - Data: t.mat.Data[:(n-1)*t.mat.Stride+n], - }, - } -} - -// Copy makes a copy of elements of a into the receiver. It is similar to the -// built-in copy; it copies as much as the overlap between the two matrices and -// returns the number of rows and columns it copied. Only elements within the -// receiver's non-zero triangle are set. -// -// See the Copier interface for more information. -func (t *TriDense) Copy(a Matrix) (r, c int) { - r, c = a.Dims() - r = min(r, t.mat.N) - c = min(c, t.mat.N) - if r == 0 || c == 0 { - return 0, 0 - } - - switch a := a.(type) { - case RawMatrixer: - amat := a.RawMatrix() - if t.isUpper() { - for i := 0; i < r; i++ { - copy(t.mat.Data[i*t.mat.Stride+i:i*t.mat.Stride+c], amat.Data[i*amat.Stride+i:i*amat.Stride+c]) - } - } else { - for i := 0; i < r; i++ { - copy(t.mat.Data[i*t.mat.Stride:i*t.mat.Stride+i+1], amat.Data[i*amat.Stride:i*amat.Stride+i+1]) - } - } - case RawTriangular: - amat := a.RawTriangular() - aIsUpper := isUpperUplo(amat.Uplo) - tIsUpper := t.isUpper() - switch { - case tIsUpper && aIsUpper: - for i := 0; i < r; i++ { - copy(t.mat.Data[i*t.mat.Stride+i:i*t.mat.Stride+c], amat.Data[i*amat.Stride+i:i*amat.Stride+c]) - } - case !tIsUpper && !aIsUpper: - for i := 0; i < r; i++ { - copy(t.mat.Data[i*t.mat.Stride:i*t.mat.Stride+i+1], amat.Data[i*amat.Stride:i*amat.Stride+i+1]) - } - default: - for i := 0; i < r; i++ { - t.set(i, i, amat.Data[i*amat.Stride+i]) - } - } - default: - isUpper := t.isUpper() - for i := 0; i < r; i++ { - if isUpper { - for j := i; j < c; j++ { - t.set(i, j, a.At(i, j)) - } - } else { - for j := 0; j <= i; j++ { - t.set(i, j, a.At(i, j)) - } - } - } - } - - return r, c -} - -// InverseTri computes the inverse of the triangular matrix a, storing the result -// into the receiver. If a is ill-conditioned, a Condition error will be returned. -// Note that matrix inversion is numerically unstable, and should generally be -// avoided where possible, for example by using the Solve routines. -func (t *TriDense) InverseTri(a Triangular) error { - t.checkOverlapMatrix(a) - n, _ := a.Triangle() - t.reuseAsNonZeroed(a.Triangle()) - t.Copy(a) - work := getFloats(3*n, false) - iwork := getInts(n, false) - cond := lapack64.Trcon(CondNorm, t.mat, work, iwork) - putFloats(work) - putInts(iwork) - if math.IsInf(cond, 1) { - return Condition(cond) - } - ok := lapack64.Trtri(t.mat) - if !ok { - return Condition(math.Inf(1)) - } - if cond > ConditionTolerance { - return Condition(cond) - } - return nil -} - -// MulTri takes the product of triangular matrices a and b and places the result -// in the receiver. The size of a and b must match, and they both must have the -// same TriKind, or Mul will panic. -func (t *TriDense) MulTri(a, b Triangular) { - n, kind := a.Triangle() - nb, kindb := b.Triangle() - if n != nb { - panic(ErrShape) - } - if kind != kindb { - panic(ErrTriangle) - } - - aU, _ := untransposeTri(a) - bU, _ := untransposeTri(b) - t.checkOverlapMatrix(bU) - t.checkOverlapMatrix(aU) - t.reuseAsNonZeroed(n, kind) - var restore func() - if t == aU { - t, restore = t.isolatedWorkspace(aU) - defer restore() - } else if t == bU { - t, restore = t.isolatedWorkspace(bU) - defer restore() - } - - // Inspect types here, helps keep the loops later clean(er). - _, aDiag := aU.(Diagonal) - _, bDiag := bU.(Diagonal) - // If they are both diagonal only need 1 loop. - // All diagonal matrices are Upper. - // TODO: Add fast paths for DiagDense. - if aDiag && bDiag { - t.Zero() - for i := 0; i < n; i++ { - t.SetTri(i, i, a.At(i, i)*b.At(i, i)) - } - return - } - - // Now we know at least one matrix is non-diagonal. - // And all diagonal matrices are all Upper. - // The both-diagonal case is handled above. - // TODO: Add fast paths for Dense variants. - if kind == Upper { - for i := 0; i < n; i++ { - for j := i; j < n; j++ { - switch { - case aDiag: - t.SetTri(i, j, a.At(i, i)*b.At(i, j)) - case bDiag: - t.SetTri(i, j, a.At(i, j)*b.At(j, j)) - default: - var v float64 - for k := i; k <= j; k++ { - v += a.At(i, k) * b.At(k, j) - } - t.SetTri(i, j, v) - } - } - } - return - } - for i := 0; i < n; i++ { - for j := 0; j <= i; j++ { - var v float64 - for k := j; k <= i; k++ { - v += a.At(i, k) * b.At(k, j) - } - t.SetTri(i, j, v) - } - } -} - -// ScaleTri multiplies the elements of a by f, placing the result in the receiver. -// If the receiver is non-zero, the size and kind of the receiver must match -// the input, or ScaleTri will panic. -func (t *TriDense) ScaleTri(f float64, a Triangular) { - n, kind := a.Triangle() - t.reuseAsNonZeroed(n, kind) - - // TODO(btracey): Improve the set of fast-paths. - switch a := a.(type) { - case RawTriangular: - amat := a.RawTriangular() - if t != a { - t.checkOverlap(generalFromTriangular(amat)) - } - if kind == Upper { - for i := 0; i < n; i++ { - ts := t.mat.Data[i*t.mat.Stride+i : i*t.mat.Stride+n] - as := amat.Data[i*amat.Stride+i : i*amat.Stride+n] - for i, v := range as { - ts[i] = v * f - } - } - return - } - for i := 0; i < n; i++ { - ts := t.mat.Data[i*t.mat.Stride : i*t.mat.Stride+i+1] - as := amat.Data[i*amat.Stride : i*amat.Stride+i+1] - for i, v := range as { - ts[i] = v * f - } - } - return - default: - t.checkOverlapMatrix(a) - isUpper := kind == Upper - for i := 0; i < n; i++ { - if isUpper { - for j := i; j < n; j++ { - t.set(i, j, f*a.At(i, j)) - } - } else { - for j := 0; j <= i; j++ { - t.set(i, j, f*a.At(i, j)) - } - } - } - } -} - -// Trace returns the trace of the matrix. -func (t *TriDense) Trace() float64 { - // TODO(btracey): could use internal asm sum routine. - var v float64 - for i := 0; i < t.mat.N; i++ { - v += t.mat.Data[i*t.mat.Stride+i] - } - return v -} - -// copySymIntoTriangle copies a symmetric matrix into a TriDense -func copySymIntoTriangle(t *TriDense, s Symmetric) { - n, upper := t.Triangle() - ns := s.Symmetric() - if n != ns { - panic("mat: triangle size mismatch") - } - ts := t.mat.Stride - if rs, ok := s.(RawSymmetricer); ok { - sd := rs.RawSymmetric() - ss := sd.Stride - if upper { - if sd.Uplo == blas.Upper { - for i := 0; i < n; i++ { - copy(t.mat.Data[i*ts+i:i*ts+n], sd.Data[i*ss+i:i*ss+n]) - } - return - } - for i := 0; i < n; i++ { - for j := i; j < n; j++ { - t.mat.Data[i*ts+j] = sd.Data[j*ss+i] - } - } - return - } - if sd.Uplo == blas.Upper { - for i := 0; i < n; i++ { - for j := 0; j <= i; j++ { - t.mat.Data[i*ts+j] = sd.Data[j*ss+i] - } - } - return - } - for i := 0; i < n; i++ { - copy(t.mat.Data[i*ts:i*ts+i+1], sd.Data[i*ss:i*ss+i+1]) - } - return - } - if upper { - for i := 0; i < n; i++ { - for j := i; j < n; j++ { - t.mat.Data[i*ts+j] = s.At(i, j) - } - } - return - } - for i := 0; i < n; i++ { - for j := 0; j <= i; j++ { - t.mat.Data[i*ts+j] = s.At(i, j) - } - } -} - -// DoNonZero calls the function fn for each of the non-zero elements of t. The function fn -// takes a row/column index and the element value of t at (i, j). -func (t *TriDense) DoNonZero(fn func(i, j int, v float64)) { - if t.isUpper() { - for i := 0; i < t.mat.N; i++ { - for j := i; j < t.mat.N; j++ { - v := t.at(i, j) - if v != 0 { - fn(i, j, v) - } - } - } - return - } - for i := 0; i < t.mat.N; i++ { - for j := 0; j <= i; j++ { - v := t.at(i, j) - if v != 0 { - fn(i, j, v) - } - } - } -} - -// DoRowNonZero calls the function fn for each of the non-zero elements of row i of t. The function fn -// takes a row/column index and the element value of t at (i, j). -func (t *TriDense) DoRowNonZero(i int, fn func(i, j int, v float64)) { - if i < 0 || t.mat.N <= i { - panic(ErrRowAccess) - } - if t.isUpper() { - for j := i; j < t.mat.N; j++ { - v := t.at(i, j) - if v != 0 { - fn(i, j, v) - } - } - return - } - for j := 0; j <= i; j++ { - v := t.at(i, j) - if v != 0 { - fn(i, j, v) - } - } -} - -// DoColNonZero calls the function fn for each of the non-zero elements of column j of t. The function fn -// takes a row/column index and the element value of t at (i, j). -func (t *TriDense) DoColNonZero(j int, fn func(i, j int, v float64)) { - if j < 0 || t.mat.N <= j { - panic(ErrColAccess) - } - if t.isUpper() { - for i := 0; i <= j; i++ { - v := t.at(i, j) - if v != 0 { - fn(i, j, v) - } - } - return - } - for i := j; i < t.mat.N; i++ { - v := t.at(i, j) - if v != 0 { - fn(i, j, v) - } - } -} diff --git a/vendor/gonum.org/v1/gonum/mat/triband.go b/vendor/gonum.org/v1/gonum/mat/triband.go deleted file mode 100644 index 9c26f19..0000000 --- a/vendor/gonum.org/v1/gonum/mat/triband.go +++ /dev/null @@ -1,371 +0,0 @@ -// Copyright ©2018 The Gonum 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 mat - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -var ( - triBand TriBanded - _ Banded = triBand - _ Triangular = triBand - - triBandDense *TriBandDense - _ Matrix = triBandDense - _ allMatrix = triBandDense - _ denseMatrix = triBandDense - _ Triangular = triBandDense - _ Banded = triBandDense - _ TriBanded = triBandDense - _ RawTriBander = triBandDense - _ MutableTriBanded = triBandDense -) - -// TriBanded is a triangular band matrix interface type. -type TriBanded interface { - Banded - - // Triangle returns the number of rows/columns in the matrix and its - // orientation. - Triangle() (n int, kind TriKind) - - // TTri is the equivalent of the T() method in the Matrix interface but - // guarantees the transpose is of triangular type. - TTri() Triangular - - // TriBand returns the number of rows/columns in the matrix, the - // size of the bandwidth, and the orientation. - TriBand() (n, k int, kind TriKind) - - // TTriBand is the equivalent of the T() method in the Matrix interface but - // guarantees the transpose is of banded triangular type. - TTriBand() TriBanded -} - -// A RawTriBander can return a blas64.TriangularBand representation of the receiver. -// Changes to the blas64.TriangularBand.Data slice will be reflected in the original -// matrix, changes to the N, K, Stride, Uplo and Diag fields will not. -type RawTriBander interface { - RawTriBand() blas64.TriangularBand -} - -// MutableTriBanded is a triangular band matrix interface type that allows -// elements to be altered. -type MutableTriBanded interface { - TriBanded - SetTriBand(i, j int, v float64) -} - -var ( - tTriBand TransposeTriBand - _ Matrix = tTriBand - _ TriBanded = tTriBand - _ Untransposer = tTriBand - _ UntransposeTrier = tTriBand - _ UntransposeBander = tTriBand - _ UntransposeTriBander = tTriBand -) - -// TransposeTriBand is a type for performing an implicit transpose of a TriBanded -// matrix. It implements the TriBanded interface, returning values from the -// transpose of the matrix within. -type TransposeTriBand struct { - TriBanded TriBanded -} - -// At returns the value of the element at row i and column j of the transposed -// matrix, that is, row j and column i of the TriBanded field. -func (t TransposeTriBand) At(i, j int) float64 { - return t.TriBanded.At(j, i) -} - -// Dims returns the dimensions of the transposed matrix. TriBanded matrices are -// square and thus this is the same size as the original TriBanded. -func (t TransposeTriBand) Dims() (r, c int) { - c, r = t.TriBanded.Dims() - return r, c -} - -// T performs an implicit transpose by returning the TriBand field. -func (t TransposeTriBand) T() Matrix { - return t.TriBanded -} - -// Triangle returns the number of rows/columns in the matrix and its orientation. -func (t TransposeTriBand) Triangle() (int, TriKind) { - n, upper := t.TriBanded.Triangle() - return n, !upper -} - -// TTri performs an implicit transpose by returning the TriBand field. -func (t TransposeTriBand) TTri() Triangular { - return t.TriBanded -} - -// Bandwidth returns the upper and lower bandwidths of the matrix. -func (t TransposeTriBand) Bandwidth() (kl, ku int) { - kl, ku = t.TriBanded.Bandwidth() - return ku, kl -} - -// TBand performs an implicit transpose by returning the TriBand field. -func (t TransposeTriBand) TBand() Banded { - return t.TriBanded -} - -// TriBand returns the number of rows/columns in the matrix, the -// size of the bandwidth, and the orientation. -func (t TransposeTriBand) TriBand() (n, k int, kind TriKind) { - n, k, kind = t.TriBanded.TriBand() - return n, k, !kind -} - -// TTriBand performs an implicit transpose by returning the TriBand field. -func (t TransposeTriBand) TTriBand() TriBanded { - return t.TriBanded -} - -// Untranspose returns the Triangular field. -func (t TransposeTriBand) Untranspose() Matrix { - return t.TriBanded -} - -// UntransposeTri returns the underlying Triangular matrix. -func (t TransposeTriBand) UntransposeTri() Triangular { - return t.TriBanded -} - -// UntransposeBand returns the underlying Banded matrix. -func (t TransposeTriBand) UntransposeBand() Banded { - return t.TriBanded -} - -// UntransposeTriBand returns the underlying TriBanded matrix. -func (t TransposeTriBand) UntransposeTriBand() TriBanded { - return t.TriBanded -} - -// TriBandDense represents a triangular band matrix in dense storage format. -type TriBandDense struct { - mat blas64.TriangularBand -} - -// NewTriBandDense creates a new triangular banded matrix with n rows and columns, -// k bands in the direction of the specified kind. If data == nil, -// a new slice is allocated for the backing slice. If len(data) == n*(k+1), -// data is used as the backing slice, and changes to the elements of the returned -// TriBandDense will be reflected in data. If neither of these is true, NewTriBandDense -// will panic. k must be at least zero and less than n, otherwise NewTriBandDense will panic. -// -// The data must be arranged in row-major order constructed by removing the zeros -// from the rows outside the band and aligning the diagonals. For example, if -// the upper-triangular banded matrix -// 1 2 3 0 0 0 -// 0 4 5 6 0 0 -// 0 0 7 8 9 0 -// 0 0 0 10 11 12 -// 0 0 0 0 13 14 -// 0 0 0 0 0 15 -// becomes (* entries are never accessed) -// 1 2 3 -// 4 5 6 -// 7 8 9 -// 10 11 12 -// 13 14 * -// 15 * * -// which is passed to NewTriBandDense as []float64{1, 2, ..., 15, *, *, *} -// with k=2 and kind = mat.Upper. -// The lower triangular banded matrix -// 1 0 0 0 0 0 -// 2 3 0 0 0 0 -// 4 5 6 0 0 0 -// 0 7 8 9 0 0 -// 0 0 10 11 12 0 -// 0 0 0 13 14 15 -// becomes (* entries are never accessed) -// * * 1 -// * 2 3 -// 4 5 6 -// 7 8 9 -// 10 11 12 -// 13 14 15 -// which is passed to NewTriBandDense as []float64{*, *, *, 1, 2, ..., 15} -// with k=2 and kind = mat.Lower. -// Only the values in the band portion of the matrix are used. -func NewTriBandDense(n, k int, kind TriKind, data []float64) *TriBandDense { - if n <= 0 || k < 0 { - if n == 0 { - panic(ErrZeroLength) - } - panic("mat: negative dimension") - } - if k+1 > n { - panic("mat: band out of range") - } - bc := k + 1 - if data != nil && len(data) != n*bc { - panic(ErrShape) - } - if data == nil { - data = make([]float64, n*bc) - } - uplo := blas.Lower - if kind { - uplo = blas.Upper - } - return &TriBandDense{ - mat: blas64.TriangularBand{ - Uplo: uplo, - Diag: blas.NonUnit, - N: n, - K: k, - Data: data, - Stride: bc, - }, - } -} - -// Dims returns the number of rows and columns in the matrix. -func (t *TriBandDense) Dims() (r, c int) { - return t.mat.N, t.mat.N -} - -// T performs an implicit transpose by returning the receiver inside a Transpose. -func (t *TriBandDense) T() Matrix { - return Transpose{t} -} - -// IsEmpty returns whether the receiver is empty. Empty matrices can be the -// receiver for size-restricted operations. The receiver can be emptied using -// Reset. -func (t *TriBandDense) IsEmpty() bool { - // It must be the case that t.Dims() returns - // zeros in this case. See comment in Reset(). - return t.mat.Stride == 0 -} - -// Reset empties the matrix so that it can be reused as the -// receiver of a dimensionally restricted operation. -// -// Reset should not be used when the matrix shares backing data. -// See the Reseter interface for more information. -func (t *TriBandDense) Reset() { - t.mat.N = 0 - t.mat.Stride = 0 - t.mat.K = 0 - t.mat.Data = t.mat.Data[:0] -} - -// Zero sets all of the matrix elements to zero. -func (t *TriBandDense) Zero() { - if t.isUpper() { - for i := 0; i < t.mat.N; i++ { - u := min(1+t.mat.K, t.mat.N-i) - zero(t.mat.Data[i*t.mat.Stride : i*t.mat.Stride+u]) - } - return - } - for i := 0; i < t.mat.N; i++ { - l := max(0, t.mat.K-i) - zero(t.mat.Data[i*t.mat.Stride+l : i*t.mat.Stride+t.mat.K+1]) - } -} - -func (t *TriBandDense) isUpper() bool { - return isUpperUplo(t.mat.Uplo) -} - -func (t *TriBandDense) triKind() TriKind { - return TriKind(isUpperUplo(t.mat.Uplo)) -} - -// Triangle returns the dimension of t and its orientation. The returned -// orientation is only valid when n is not zero. -func (t *TriBandDense) Triangle() (n int, kind TriKind) { - return t.mat.N, t.triKind() -} - -// TTri performs an implicit transpose by returning the receiver inside a TransposeTri. -func (t *TriBandDense) TTri() Triangular { - return TransposeTri{t} -} - -// Bandwidth returns the upper and lower bandwidths of the matrix. -func (t *TriBandDense) Bandwidth() (kl, ku int) { - if t.isUpper() { - return 0, t.mat.K - } - return t.mat.K, 0 -} - -// TBand performs an implicit transpose by returning the receiver inside a TransposeBand. -func (t *TriBandDense) TBand() Banded { - return TransposeBand{t} -} - -// TriBand returns the number of rows/columns in the matrix, the -// size of the bandwidth, and the orientation. -func (t *TriBandDense) TriBand() (n, k int, kind TriKind) { - return t.mat.N, t.mat.K, TriKind(!t.IsEmpty()) && t.triKind() -} - -// TTriBand performs an implicit transpose by returning the receiver inside a TransposeTriBand. -func (t *TriBandDense) TTriBand() TriBanded { - return TransposeTriBand{t} -} - -// RawTriBand returns the underlying blas64.TriangularBand used by the receiver. -// Changes to the blas64.TriangularBand.Data slice will be reflected in the original -// matrix, changes to the N, K, Stride, Uplo and Diag fields will not. -func (t *TriBandDense) RawTriBand() blas64.TriangularBand { - return t.mat -} - -// SetRawTriBand sets the underlying blas64.TriangularBand used by the receiver. -// Changes to elements in the receiver following the call will be reflected -// in the input. -// -// The supplied TriangularBand must not use blas.Unit storage format. -func (t *TriBandDense) SetRawTriBand(mat blas64.TriangularBand) { - if mat.Diag == blas.Unit { - panic("mat: cannot set TriBand with Unit storage") - } - t.mat = mat -} - -// DiagView returns the diagonal as a matrix backed by the original data. -func (t *TriBandDense) DiagView() Diagonal { - if t.mat.Diag == blas.Unit { - panic("mat: cannot take view of Unit diagonal") - } - n := t.mat.N - data := t.mat.Data - if !t.isUpper() { - data = data[t.mat.K:] - } - return &DiagDense{ - mat: blas64.Vector{ - N: n, - Inc: t.mat.Stride, - Data: data[:(n-1)*t.mat.Stride+1], - }, - } -} - -// Trace returns the trace. -func (t *TriBandDense) Trace() float64 { - rb := t.RawTriBand() - var tr float64 - var offsetIndex int - if rb.Uplo == blas.Lower { - offsetIndex = rb.K - } - for i := 0; i < rb.N; i++ { - tr += rb.Data[offsetIndex+i*rb.Stride] - } - return tr -} diff --git a/vendor/gonum.org/v1/gonum/mat/vector.go b/vendor/gonum.org/v1/gonum/mat/vector.go deleted file mode 100644 index 884e565..0000000 --- a/vendor/gonum.org/v1/gonum/mat/vector.go +++ /dev/null @@ -1,798 +0,0 @@ -// Copyright ©2013 The Gonum 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 mat - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/internal/asm/f64" -) - -var ( - vector *VecDense - - _ Matrix = vector - _ allMatrix = vector - _ Vector = vector - _ Reseter = vector -) - -// Vector is a vector. -type Vector interface { - Matrix - AtVec(int) float64 - Len() int -} - -// TransposeVec is a type for performing an implicit transpose of a Vector. -// It implements the Vector interface, returning values from the transpose -// of the vector within. -type TransposeVec struct { - Vector Vector -} - -// At returns the value of the element at row i and column j of the transposed -// matrix, that is, row j and column i of the Vector field. -func (t TransposeVec) At(i, j int) float64 { - return t.Vector.At(j, i) -} - -// AtVec returns the element at position i. It panics if i is out of bounds. -func (t TransposeVec) AtVec(i int) float64 { - return t.Vector.AtVec(i) -} - -// Dims returns the dimensions of the transposed vector. -func (t TransposeVec) Dims() (r, c int) { - c, r = t.Vector.Dims() - return r, c -} - -// T performs an implicit transpose by returning the Vector field. -func (t TransposeVec) T() Matrix { - return t.Vector -} - -// Len returns the number of columns in the vector. -func (t TransposeVec) Len() int { - return t.Vector.Len() -} - -// TVec performs an implicit transpose by returning the Vector field. -func (t TransposeVec) TVec() Vector { - return t.Vector -} - -// Untranspose returns the Vector field. -func (t TransposeVec) Untranspose() Matrix { - return t.Vector -} - -func (t TransposeVec) UntransposeVec() Vector { - return t.Vector -} - -// VecDense represents a column vector. -type VecDense struct { - mat blas64.Vector - // A BLAS vector can have a negative increment, but allowing this - // in the mat type complicates a lot of code, and doesn't gain anything. - // VecDense must have positive increment in this package. -} - -// NewVecDense creates a new VecDense of length n. If data == nil, -// a new slice is allocated for the backing slice. If len(data) == n, data is -// used as the backing slice, and changes to the elements of the returned VecDense -// will be reflected in data. If neither of these is true, NewVecDense will panic. -// NewVecDense will panic if n is zero. -func NewVecDense(n int, data []float64) *VecDense { - if n <= 0 { - if n == 0 { - panic(ErrZeroLength) - } - panic("mat: negative dimension") - } - if len(data) != n && data != nil { - panic(ErrShape) - } - if data == nil { - data = make([]float64, n) - } - return &VecDense{ - mat: blas64.Vector{ - N: n, - Inc: 1, - Data: data, - }, - } -} - -// SliceVec returns a new Vector that shares backing data with the receiver. -// The returned matrix starts at i of the receiver and extends k-i elements. -// SliceVec panics with ErrIndexOutOfRange if the slice is outside the capacity -// of the receiver. -func (v *VecDense) SliceVec(i, k int) Vector { - if i < 0 || k <= i || v.Cap() < k { - panic(ErrIndexOutOfRange) - } - return &VecDense{ - mat: blas64.Vector{ - N: k - i, - Inc: v.mat.Inc, - Data: v.mat.Data[i*v.mat.Inc : (k-1)*v.mat.Inc+1], - }, - } -} - -// Dims returns the number of rows and columns in the matrix. Columns is always 1 -// for a non-Reset vector. -func (v *VecDense) Dims() (r, c int) { - if v.IsEmpty() { - return 0, 0 - } - return v.mat.N, 1 -} - -// Caps returns the number of rows and columns in the backing matrix. Columns is always 1 -// for a non-Reset vector. -func (v *VecDense) Caps() (r, c int) { - if v.IsEmpty() { - return 0, 0 - } - return v.Cap(), 1 -} - -// Len returns the length of the vector. -func (v *VecDense) Len() int { - return v.mat.N -} - -// Cap returns the capacity of the vector. -func (v *VecDense) Cap() int { - if v.IsEmpty() { - return 0 - } - return (cap(v.mat.Data)-1)/v.mat.Inc + 1 -} - -// T performs an implicit transpose by returning the receiver inside a Transpose. -func (v *VecDense) T() Matrix { - return Transpose{v} -} - -// TVec performs an implicit transpose by returning the receiver inside a TransposeVec. -func (v *VecDense) TVec() Vector { - return TransposeVec{v} -} - -// Reset empties the matrix so that it can be reused as the -// receiver of a dimensionally restricted operation. -// -// Reset should not be used when the matrix shares backing data. -// See the Reseter interface for more information. -func (v *VecDense) Reset() { - // No change of Inc or N to 0 may be - // made unless both are set to 0. - v.mat.Inc = 0 - v.mat.N = 0 - v.mat.Data = v.mat.Data[:0] -} - -// Zero sets all of the matrix elements to zero. -func (v *VecDense) Zero() { - for i := 0; i < v.mat.N; i++ { - v.mat.Data[v.mat.Inc*i] = 0 - } -} - -// CloneVec makes a copy of a into the receiver, overwriting the previous value -// of the receiver. -func (v *VecDense) CloneVec(a Vector) { - if v == a { - return - } - n := a.Len() - v.mat = blas64.Vector{ - N: n, - Inc: 1, - Data: use(v.mat.Data, n), - } - if r, ok := a.(RawVectorer); ok { - blas64.Copy(r.RawVector(), v.mat) - return - } - for i := 0; i < a.Len(); i++ { - v.SetVec(i, a.AtVec(i)) - } -} - -// VecDenseCopyOf returns a newly allocated copy of the elements of a. -func VecDenseCopyOf(a Vector) *VecDense { - v := &VecDense{} - v.CloneVec(a) - return v -} - -// RawVector returns the underlying blas64.Vector used by the receiver. -// Changes to elements in the receiver following the call will be reflected -// in returned blas64.Vector. -func (v *VecDense) RawVector() blas64.Vector { - return v.mat -} - -// SetRawVector sets the underlying blas64.Vector used by the receiver. -// Changes to elements in the receiver following the call will be reflected -// in the input. -func (v *VecDense) SetRawVector(a blas64.Vector) { - v.mat = a -} - -// CopyVec makes a copy of elements of a into the receiver. It is similar to the -// built-in copy; it copies as much as the overlap between the two vectors and -// returns the number of elements it copied. -func (v *VecDense) CopyVec(a Vector) int { - n := min(v.Len(), a.Len()) - if v == a { - return n - } - if r, ok := a.(RawVectorer); ok { - src := r.RawVector() - src.N = n - dst := v.mat - dst.N = n - blas64.Copy(src, dst) - return n - } - for i := 0; i < n; i++ { - v.setVec(i, a.AtVec(i)) - } - return n -} - -// ScaleVec scales the vector a by alpha, placing the result in the receiver. -func (v *VecDense) ScaleVec(alpha float64, a Vector) { - n := a.Len() - - if v == a { - if v.mat.Inc == 1 { - f64.ScalUnitary(alpha, v.mat.Data) - return - } - f64.ScalInc(alpha, v.mat.Data, uintptr(n), uintptr(v.mat.Inc)) - return - } - - v.reuseAsNonZeroed(n) - - if rv, ok := a.(RawVectorer); ok { - mat := rv.RawVector() - v.checkOverlap(mat) - if v.mat.Inc == 1 && mat.Inc == 1 { - f64.ScalUnitaryTo(v.mat.Data, alpha, mat.Data) - return - } - f64.ScalIncTo(v.mat.Data, uintptr(v.mat.Inc), - alpha, mat.Data, uintptr(n), uintptr(mat.Inc)) - return - } - - for i := 0; i < n; i++ { - v.setVec(i, alpha*a.AtVec(i)) - } -} - -// AddScaledVec adds the vectors a and alpha*b, placing the result in the receiver. -func (v *VecDense) AddScaledVec(a Vector, alpha float64, b Vector) { - if alpha == 1 { - v.AddVec(a, b) - return - } - if alpha == -1 { - v.SubVec(a, b) - return - } - - ar := a.Len() - br := b.Len() - - if ar != br { - panic(ErrShape) - } - - var amat, bmat blas64.Vector - fast := true - aU, _ := untransposeExtract(a) - if rv, ok := aU.(*VecDense); ok { - amat = rv.mat - if v != a { - v.checkOverlap(amat) - } - } else { - fast = false - } - bU, _ := untransposeExtract(b) - if rv, ok := bU.(*VecDense); ok { - bmat = rv.mat - if v != b { - v.checkOverlap(bmat) - } - } else { - fast = false - } - - v.reuseAsNonZeroed(ar) - - switch { - case alpha == 0: // v <- a - if v == a { - return - } - v.CopyVec(a) - case v == a && v == b: // v <- v + alpha * v = (alpha + 1) * v - blas64.Scal(alpha+1, v.mat) - case !fast: // v <- a + alpha * b without blas64 support. - for i := 0; i < ar; i++ { - v.setVec(i, a.AtVec(i)+alpha*b.AtVec(i)) - } - case v == a && v != b: // v <- v + alpha * b - if v.mat.Inc == 1 && bmat.Inc == 1 { - // Fast path for a common case. - f64.AxpyUnitaryTo(v.mat.Data, alpha, bmat.Data, amat.Data) - } else { - f64.AxpyInc(alpha, bmat.Data, v.mat.Data, - uintptr(ar), uintptr(bmat.Inc), uintptr(v.mat.Inc), 0, 0) - } - default: // v <- a + alpha * b or v <- a + alpha * v - if v.mat.Inc == 1 && amat.Inc == 1 && bmat.Inc == 1 { - // Fast path for a common case. - f64.AxpyUnitaryTo(v.mat.Data, alpha, bmat.Data, amat.Data) - } else { - f64.AxpyIncTo(v.mat.Data, uintptr(v.mat.Inc), 0, - alpha, bmat.Data, amat.Data, - uintptr(ar), uintptr(bmat.Inc), uintptr(amat.Inc), 0, 0) - } - } -} - -// AddVec adds the vectors a and b, placing the result in the receiver. -func (v *VecDense) AddVec(a, b Vector) { - ar := a.Len() - br := b.Len() - - if ar != br { - panic(ErrShape) - } - - v.reuseAsNonZeroed(ar) - - aU, _ := untransposeExtract(a) - bU, _ := untransposeExtract(b) - - if arv, ok := aU.(*VecDense); ok { - if brv, ok := bU.(*VecDense); ok { - amat := arv.mat - bmat := brv.mat - - if v != a { - v.checkOverlap(amat) - } - if v != b { - v.checkOverlap(bmat) - } - - if v.mat.Inc == 1 && amat.Inc == 1 && bmat.Inc == 1 { - // Fast path for a common case. - f64.AxpyUnitaryTo(v.mat.Data, 1, bmat.Data, amat.Data) - return - } - f64.AxpyIncTo(v.mat.Data, uintptr(v.mat.Inc), 0, - 1, bmat.Data, amat.Data, - uintptr(ar), uintptr(bmat.Inc), uintptr(amat.Inc), 0, 0) - return - } - } - - for i := 0; i < ar; i++ { - v.setVec(i, a.AtVec(i)+b.AtVec(i)) - } -} - -// SubVec subtracts the vector b from a, placing the result in the receiver. -func (v *VecDense) SubVec(a, b Vector) { - ar := a.Len() - br := b.Len() - - if ar != br { - panic(ErrShape) - } - - v.reuseAsNonZeroed(ar) - - aU, _ := untransposeExtract(a) - bU, _ := untransposeExtract(b) - - if arv, ok := aU.(*VecDense); ok { - if brv, ok := bU.(*VecDense); ok { - amat := arv.mat - bmat := brv.mat - - if v != a { - v.checkOverlap(amat) - } - if v != b { - v.checkOverlap(bmat) - } - - if v.mat.Inc == 1 && amat.Inc == 1 && bmat.Inc == 1 { - // Fast path for a common case. - f64.AxpyUnitaryTo(v.mat.Data, -1, bmat.Data, amat.Data) - return - } - f64.AxpyIncTo(v.mat.Data, uintptr(v.mat.Inc), 0, - -1, bmat.Data, amat.Data, - uintptr(ar), uintptr(bmat.Inc), uintptr(amat.Inc), 0, 0) - return - } - } - - for i := 0; i < ar; i++ { - v.setVec(i, a.AtVec(i)-b.AtVec(i)) - } -} - -// MulElemVec performs element-wise multiplication of a and b, placing the result -// in the receiver. -func (v *VecDense) MulElemVec(a, b Vector) { - ar := a.Len() - br := b.Len() - - if ar != br { - panic(ErrShape) - } - - v.reuseAsNonZeroed(ar) - - aU, _ := untransposeExtract(a) - bU, _ := untransposeExtract(b) - - if arv, ok := aU.(*VecDense); ok { - if brv, ok := bU.(*VecDense); ok { - amat := arv.mat - bmat := brv.mat - - if v != a { - v.checkOverlap(amat) - } - if v != b { - v.checkOverlap(bmat) - } - - if v.mat.Inc == 1 && amat.Inc == 1 && bmat.Inc == 1 { - // Fast path for a common case. - for i, a := range amat.Data { - v.mat.Data[i] = a * bmat.Data[i] - } - return - } - var ia, ib int - for i := 0; i < ar; i++ { - v.setVec(i, amat.Data[ia]*bmat.Data[ib]) - ia += amat.Inc - ib += bmat.Inc - } - return - } - } - - for i := 0; i < ar; i++ { - v.setVec(i, a.AtVec(i)*b.AtVec(i)) - } -} - -// DivElemVec performs element-wise division of a by b, placing the result -// in the receiver. -func (v *VecDense) DivElemVec(a, b Vector) { - ar := a.Len() - br := b.Len() - - if ar != br { - panic(ErrShape) - } - - v.reuseAsNonZeroed(ar) - - aU, _ := untransposeExtract(a) - bU, _ := untransposeExtract(b) - - if arv, ok := aU.(*VecDense); ok { - if brv, ok := bU.(*VecDense); ok { - amat := arv.mat - bmat := brv.mat - - if v != a { - v.checkOverlap(amat) - } - if v != b { - v.checkOverlap(bmat) - } - - if v.mat.Inc == 1 && amat.Inc == 1 && bmat.Inc == 1 { - // Fast path for a common case. - for i, a := range amat.Data { - v.setVec(i, a/bmat.Data[i]) - } - return - } - var ia, ib int - for i := 0; i < ar; i++ { - v.setVec(i, amat.Data[ia]/bmat.Data[ib]) - ia += amat.Inc - ib += bmat.Inc - } - } - } - - for i := 0; i < ar; i++ { - v.setVec(i, a.AtVec(i)/b.AtVec(i)) - } -} - -// MulVec computes a * b. The result is stored into the receiver. -// MulVec panics if the number of columns in a does not equal the number of rows in b -// or if the number of columns in b does not equal 1. -func (v *VecDense) MulVec(a Matrix, b Vector) { - r, c := a.Dims() - br, bc := b.Dims() - if c != br || bc != 1 { - panic(ErrShape) - } - - aU, trans := untransposeExtract(a) - var bmat blas64.Vector - fast := true - bU, _ := untransposeExtract(b) - if rv, ok := bU.(*VecDense); ok { - bmat = rv.mat - if v != b { - v.checkOverlap(bmat) - } - } else { - fast = false - } - - v.reuseAsNonZeroed(r) - var restore func() - if v == aU { - v, restore = v.isolatedWorkspace(aU.(*VecDense)) - defer restore() - } else if v == b { - v, restore = v.isolatedWorkspace(b) - defer restore() - } - - // TODO(kortschak): Improve the non-fast paths. - switch aU := aU.(type) { - case Vector: - if b.Len() == 1 { - // {n,1} x {1,1} - v.ScaleVec(b.AtVec(0), aU) - return - } - - // {1,n} x {n,1} - if fast { - if rv, ok := aU.(*VecDense); ok { - amat := rv.mat - if v != aU { - v.checkOverlap(amat) - } - - if amat.Inc == 1 && bmat.Inc == 1 { - // Fast path for a common case. - v.setVec(0, f64.DotUnitary(amat.Data, bmat.Data)) - return - } - v.setVec(0, f64.DotInc(amat.Data, bmat.Data, - uintptr(c), uintptr(amat.Inc), uintptr(bmat.Inc), 0, 0)) - return - } - } - var sum float64 - for i := 0; i < c; i++ { - sum += aU.AtVec(i) * b.AtVec(i) - } - v.setVec(0, sum) - return - case *SymBandDense: - if fast { - aU.checkOverlap(v.asGeneral()) - blas64.Sbmv(1, aU.mat, bmat, 0, v.mat) - return - } - case *SymDense: - if fast { - aU.checkOverlap(v.asGeneral()) - blas64.Symv(1, aU.mat, bmat, 0, v.mat) - return - } - case *TriDense: - v.CopyVec(b) - aU.checkOverlap(v.asGeneral()) - ta := blas.NoTrans - if trans { - ta = blas.Trans - } - blas64.Trmv(ta, aU.mat, v.mat) - case *Dense: - if fast { - aU.checkOverlap(v.asGeneral()) - t := blas.NoTrans - if trans { - t = blas.Trans - } - blas64.Gemv(t, 1, aU.mat, bmat, 0, v.mat) - return - } - default: - if fast { - for i := 0; i < r; i++ { - var f float64 - for j := 0; j < c; j++ { - f += a.At(i, j) * bmat.Data[j*bmat.Inc] - } - v.setVec(i, f) - } - return - } - } - - for i := 0; i < r; i++ { - var f float64 - for j := 0; j < c; j++ { - f += a.At(i, j) * b.AtVec(j) - } - v.setVec(i, f) - } -} - -// ReuseAsVec changes the receiver if it IsEmpty() to be of size n×1. -// -// ReuseAsVec re-uses the backing data slice if it has sufficient capacity, -// otherwise a new slice is allocated. The backing data is zero on return. -// -// ReuseAsVec panics if the receiver is not empty, and panics if -// the input size is less than one. To empty the receiver for re-use, -// Reset should be used. -func (v *VecDense) ReuseAsVec(n int) { - if n <= 0 { - if n == 0 { - panic(ErrZeroLength) - } - panic(ErrNegativeDimension) - } - if !v.IsEmpty() { - panic(ErrReuseNonEmpty) - } - v.reuseAsZeroed(n) -} - -// reuseAsNonZeroed resizes an empty vector to a r×1 vector, -// or checks that a non-empty matrix is r×1. -func (v *VecDense) reuseAsNonZeroed(r int) { - // reuseAsNonZeroed must be kept in sync with reuseAsZeroed. - if r == 0 { - panic(ErrZeroLength) - } - if v.IsEmpty() { - v.mat = blas64.Vector{ - N: r, - Inc: 1, - Data: use(v.mat.Data, r), - } - return - } - if r != v.mat.N { - panic(ErrShape) - } -} - -// reuseAsZeroed resizes an empty vector to a r×1 vector, -// or checks that a non-empty matrix is r×1. -func (v *VecDense) reuseAsZeroed(r int) { - // reuseAsZeroed must be kept in sync with reuseAsNonZeroed. - if r == 0 { - panic(ErrZeroLength) - } - if v.IsEmpty() { - v.mat = blas64.Vector{ - N: r, - Inc: 1, - Data: useZeroed(v.mat.Data, r), - } - return - } - if r != v.mat.N { - panic(ErrShape) - } - v.Zero() -} - -// IsEmpty returns whether the receiver is empty. Empty matrices can be the -// receiver for size-restricted operations. The receiver can be emptied using -// Reset. -func (v *VecDense) IsEmpty() bool { - // It must be the case that v.Dims() returns - // zeros in this case. See comment in Reset(). - return v.mat.Inc == 0 -} - -func (v *VecDense) isolatedWorkspace(a Vector) (n *VecDense, restore func()) { - l := a.Len() - if l == 0 { - panic(ErrZeroLength) - } - n = getWorkspaceVec(l, false) - return n, func() { - v.CopyVec(n) - putWorkspaceVec(n) - } -} - -// asDense returns a Dense representation of the receiver with the same -// underlying data. -func (v *VecDense) asDense() *Dense { - return &Dense{ - mat: v.asGeneral(), - capRows: v.mat.N, - capCols: 1, - } -} - -// asGeneral returns a blas64.General representation of the receiver with the -// same underlying data. -func (v *VecDense) asGeneral() blas64.General { - return blas64.General{ - Rows: v.mat.N, - Cols: 1, - Stride: v.mat.Inc, - Data: v.mat.Data, - } -} - -// ColViewOf reflects the column j of the RawMatrixer m, into the receiver -// backed by the same underlying data. The receiver must either be empty -// have length equal to the number of rows of m. -func (v *VecDense) ColViewOf(m RawMatrixer, j int) { - rm := m.RawMatrix() - - if j >= rm.Cols || j < 0 { - panic(ErrColAccess) - } - if !v.IsEmpty() && v.mat.N != rm.Rows { - panic(ErrShape) - } - - v.mat.Inc = rm.Stride - v.mat.Data = rm.Data[j : (rm.Rows-1)*rm.Stride+j+1] - v.mat.N = rm.Rows -} - -// RowViewOf reflects the row i of the RawMatrixer m, into the receiver -// backed by the same underlying data. The receiver must either be -// empty or have length equal to the number of columns of m. -func (v *VecDense) RowViewOf(m RawMatrixer, i int) { - rm := m.RawMatrix() - - if i >= rm.Rows || i < 0 { - panic(ErrRowAccess) - } - if !v.IsEmpty() && v.mat.N != rm.Cols { - panic(ErrShape) - } - - v.mat.Inc = 1 - v.mat.Data = rm.Data[i*rm.Stride : i*rm.Stride+rm.Cols] - v.mat.N = rm.Cols -} diff --git a/vendor/google.golang.org/appengine/.travis.yml b/vendor/google.golang.org/appengine/.travis.yml deleted file mode 100644 index 70ffe89..0000000 --- a/vendor/google.golang.org/appengine/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -language: go - -go_import_path: google.golang.org/appengine - -install: - - ./travis_install.sh - -script: - - ./travis_test.sh - -matrix: - include: - - go: 1.8.x - env: GOAPP=true - - go: 1.9.x - env: GOAPP=true - - go: 1.10.x - env: GOAPP=false - - go: 1.11.x - env: GO111MODULE=on diff --git a/vendor/google.golang.org/appengine/CONTRIBUTING.md b/vendor/google.golang.org/appengine/CONTRIBUTING.md deleted file mode 100644 index ffc2985..0000000 --- a/vendor/google.golang.org/appengine/CONTRIBUTING.md +++ /dev/null @@ -1,90 +0,0 @@ -# Contributing - -1. Sign one of the contributor license agreements below. -1. Get the package: - - `go get -d google.golang.org/appengine` -1. Change into the checked out source: - - `cd $GOPATH/src/google.golang.org/appengine` -1. Fork the repo. -1. Set your fork as a remote: - - `git remote add fork git@github.com:GITHUB_USERNAME/appengine.git` -1. Make changes, commit to your fork. -1. Send a pull request with your changes. - The first line of your commit message is conventionally a one-line summary of the change, prefixed by the primary affected package, and is used as the title of your pull request. - -# Testing - -## Running system tests - -Download and install the [Go App Engine SDK](https://cloud.google.com/appengine/docs/go/download). Make sure the `go_appengine` dir is in your `PATH`. - -Set the `APPENGINE_DEV_APPSERVER` environment variable to `/path/to/go_appengine/dev_appserver.py`. - -Run tests with `goapp test`: - -``` -goapp test -v google.golang.org/appengine/... -``` - -## Contributor License Agreements - -Before we can accept your pull requests you'll need to sign a Contributor -License Agreement (CLA): - -- **If you are an individual writing original source code** and **you own the -intellectual property**, then you'll need to sign an [individual CLA][indvcla]. -- **If you work for a company that wants to allow you to contribute your work**, -then you'll need to sign a [corporate CLA][corpcla]. - -You can sign these electronically (just scroll to the bottom). After that, -we'll be able to accept your pull requests. - -## Contributor Code of Conduct - -As contributors and maintainers of this project, -and in the interest of fostering an open and welcoming community, -we pledge to respect all people who contribute through reporting issues, -posting feature requests, updating documentation, -submitting pull requests or patches, and other activities. - -We are committed to making participation in this project -a harassment-free experience for everyone, -regardless of level of experience, gender, gender identity and expression, -sexual orientation, disability, personal appearance, -body size, race, ethnicity, age, religion, or nationality. - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery -* Personal attacks -* Trolling or insulting/derogatory comments -* Public or private harassment -* Publishing other's private information, -such as physical or electronic -addresses, without explicit permission -* Other unethical or unprofessional conduct. - -Project maintainers have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct. -By adopting this Code of Conduct, -project maintainers commit themselves to fairly and consistently -applying these principles to every aspect of managing this project. -Project maintainers who do not follow or enforce the Code of Conduct -may be permanently removed from the project team. - -This code of conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. - -Instances of abusive, harassing, or otherwise unacceptable behavior -may be reported by opening an issue -or contacting one or more of the project maintainers. - -This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, -available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) - -[indvcla]: https://developers.google.com/open-source/cla/individual -[corpcla]: https://developers.google.com/open-source/cla/corporate diff --git a/vendor/google.golang.org/appengine/README.md b/vendor/google.golang.org/appengine/README.md deleted file mode 100644 index 9fdbacd..0000000 --- a/vendor/google.golang.org/appengine/README.md +++ /dev/null @@ -1,100 +0,0 @@ -# Go App Engine packages - -[![Build Status](https://travis-ci.org/golang/appengine.svg)](https://travis-ci.org/golang/appengine) - -This repository supports the Go runtime on *App Engine standard*. -It provides APIs for interacting with App Engine services. -Its canonical import path is `google.golang.org/appengine`. - -See https://cloud.google.com/appengine/docs/go/ -for more information. - -File issue reports and feature requests on the [GitHub's issue -tracker](https://github.com/golang/appengine/issues). - -## Upgrading an App Engine app to the flexible environment - -This package does not work on *App Engine flexible*. - -There are many differences between the App Engine standard environment and -the flexible environment. - -See the [documentation on upgrading to the flexible environment](https://cloud.google.com/appengine/docs/flexible/go/upgrading). - -## Directory structure - -The top level directory of this repository is the `appengine` package. It -contains the -basic APIs (e.g. `appengine.NewContext`) that apply across APIs. Specific API -packages are in subdirectories (e.g. `datastore`). - -There is an `internal` subdirectory that contains service protocol buffers, -plus packages required for connectivity to make API calls. App Engine apps -should not directly import any package under `internal`. - -## Updating from legacy (`import "appengine"`) packages - -If you're currently using the bare `appengine` packages -(that is, not these ones, imported via `google.golang.org/appengine`), -then you can use the `aefix` tool to help automate an upgrade to these packages. - -Run `go get google.golang.org/appengine/cmd/aefix` to install it. - -### 1. Update import paths - -The import paths for App Engine packages are now fully qualified, based at `google.golang.org/appengine`. -You will need to update your code to use import paths starting with that; for instance, -code importing `appengine/datastore` will now need to import `google.golang.org/appengine/datastore`. - -### 2. Update code using deprecated, removed or modified APIs - -Most App Engine services are available with exactly the same API. -A few APIs were cleaned up, and there are some differences: - -* `appengine.Context` has been replaced with the `Context` type from `golang.org/x/net/context`. -* Logging methods that were on `appengine.Context` are now functions in `google.golang.org/appengine/log`. -* `appengine.Timeout` has been removed. Use `context.WithTimeout` instead. -* `appengine.Datacenter` now takes a `context.Context` argument. -* `datastore.PropertyLoadSaver` has been simplified to use slices in place of channels. -* `delay.Call` now returns an error. -* `search.FieldLoadSaver` now handles document metadata. -* `urlfetch.Transport` no longer has a Deadline field; set a deadline on the - `context.Context` instead. -* `aetest` no longer declares its own Context type, and uses the standard one instead. -* `taskqueue.QueueStats` no longer takes a maxTasks argument. That argument has been - deprecated and unused for a long time. -* `appengine.BackendHostname` and `appengine.BackendInstance` were for the deprecated backends feature. - Use `appengine.ModuleHostname`and `appengine.ModuleName` instead. -* Most of `appengine/file` and parts of `appengine/blobstore` are deprecated. - Use [Google Cloud Storage](https://godoc.org/cloud.google.com/go/storage) if the - feature you require is not present in the new - [blobstore package](https://google.golang.org/appengine/blobstore). -* `appengine/socket` is not required on App Engine flexible environment / Managed VMs. - Use the standard `net` package instead. - -## Key Encode/Decode compatibiltiy to help with datastore library migrations - -Key compatibility updates have been added to help customers transition from google.golang.org/appengine/datastore to cloud.google.com/go/datastore. -The `EnableKeyConversion` enables automatic conversion from a key encoded with cloud.google.com/go/datastore to google.golang.org/appengine/datastore key type. - -### Enabling key conversion - -Enable key conversion by calling `EnableKeyConversion(ctx)` in the `/_ah/start` handler for basic and manual scaling or any handler in automatic scaling. - -#### 1. Basic or manual scaling - -This start handler will enable key conversion for all handlers in the service. - -``` -http.HandleFunc("/_ah/start", func(w http.ResponseWriter, r *http.Request) { - datastore.EnableKeyConversion(appengine.NewContext(r)) -}) -``` - -#### 2. Automatic scaling - -`/_ah/start` is not supported for automatic scaling and `/_ah/warmup` is not guaranteed to run, so you must call `datastore.EnableKeyConversion(appengine.NewContext(r))` -before you use code that needs key conversion. - -You may want to add this to each of your handlers, or introduce middleware where it's called. -`EnableKeyConversion` is safe for concurrent use. Any call to it after the first is ignored. \ No newline at end of file diff --git a/vendor/google.golang.org/appengine/go.mod b/vendor/google.golang.org/appengine/go.mod deleted file mode 100644 index 635c34f..0000000 --- a/vendor/google.golang.org/appengine/go.mod +++ /dev/null @@ -1,9 +0,0 @@ -module google.golang.org/appengine - -go 1.11 - -require ( - github.com/golang/protobuf v1.3.1 - golang.org/x/net v0.0.0-20190603091049-60506f45cf65 - golang.org/x/text v0.3.2 -) diff --git a/vendor/google.golang.org/appengine/go.sum b/vendor/google.golang.org/appengine/go.sum deleted file mode 100644 index ce22f68..0000000 --- a/vendor/google.golang.org/appengine/go.sum +++ /dev/null @@ -1,11 +0,0 @@ -github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65 h1:+rhAzEzT3f4JtomfC371qB+0Ola2caSKcY69NUBZrRQ= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/vendor/google.golang.org/appengine/internal/app_identity/app_identity_service.proto b/vendor/google.golang.org/appengine/internal/app_identity/app_identity_service.proto deleted file mode 100644 index 19610ca..0000000 --- a/vendor/google.golang.org/appengine/internal/app_identity/app_identity_service.proto +++ /dev/null @@ -1,64 +0,0 @@ -syntax = "proto2"; -option go_package = "app_identity"; - -package appengine; - -message AppIdentityServiceError { - enum ErrorCode { - SUCCESS = 0; - UNKNOWN_SCOPE = 9; - BLOB_TOO_LARGE = 1000; - DEADLINE_EXCEEDED = 1001; - NOT_A_VALID_APP = 1002; - UNKNOWN_ERROR = 1003; - NOT_ALLOWED = 1005; - NOT_IMPLEMENTED = 1006; - } -} - -message SignForAppRequest { - optional bytes bytes_to_sign = 1; -} - -message SignForAppResponse { - optional string key_name = 1; - optional bytes signature_bytes = 2; -} - -message GetPublicCertificateForAppRequest { -} - -message PublicCertificate { - optional string key_name = 1; - optional string x509_certificate_pem = 2; -} - -message GetPublicCertificateForAppResponse { - repeated PublicCertificate public_certificate_list = 1; - optional int64 max_client_cache_time_in_second = 2; -} - -message GetServiceAccountNameRequest { -} - -message GetServiceAccountNameResponse { - optional string service_account_name = 1; -} - -message GetAccessTokenRequest { - repeated string scope = 1; - optional int64 service_account_id = 2; - optional string service_account_name = 3; -} - -message GetAccessTokenResponse { - optional string access_token = 1; - optional int64 expiration_time = 2; -} - -message GetDefaultGcsBucketNameRequest { -} - -message GetDefaultGcsBucketNameResponse { - optional string default_gcs_bucket_name = 1; -} diff --git a/vendor/google.golang.org/appengine/internal/base/api_base.proto b/vendor/google.golang.org/appengine/internal/base/api_base.proto deleted file mode 100644 index 56cd7a3..0000000 --- a/vendor/google.golang.org/appengine/internal/base/api_base.proto +++ /dev/null @@ -1,33 +0,0 @@ -// Built-in base types for API calls. Primarily useful as return types. - -syntax = "proto2"; -option go_package = "base"; - -package appengine.base; - -message StringProto { - required string value = 1; -} - -message Integer32Proto { - required int32 value = 1; -} - -message Integer64Proto { - required int64 value = 1; -} - -message BoolProto { - required bool value = 1; -} - -message DoubleProto { - required double value = 1; -} - -message BytesProto { - required bytes value = 1 [ctype=CORD]; -} - -message VoidProto { -} diff --git a/vendor/google.golang.org/appengine/internal/datastore/datastore_v3.proto b/vendor/google.golang.org/appengine/internal/datastore/datastore_v3.proto deleted file mode 100755 index 497b4d9..0000000 --- a/vendor/google.golang.org/appengine/internal/datastore/datastore_v3.proto +++ /dev/null @@ -1,551 +0,0 @@ -syntax = "proto2"; -option go_package = "datastore"; - -package appengine; - -message Action{} - -message PropertyValue { - optional int64 int64Value = 1; - optional bool booleanValue = 2; - optional string stringValue = 3; - optional double doubleValue = 4; - - optional group PointValue = 5 { - required double x = 6; - required double y = 7; - } - - optional group UserValue = 8 { - required string email = 9; - required string auth_domain = 10; - optional string nickname = 11; - optional string federated_identity = 21; - optional string federated_provider = 22; - } - - optional group ReferenceValue = 12 { - required string app = 13; - optional string name_space = 20; - repeated group PathElement = 14 { - required string type = 15; - optional int64 id = 16; - optional string name = 17; - } - } -} - -message Property { - enum Meaning { - NO_MEANING = 0; - BLOB = 14; - TEXT = 15; - BYTESTRING = 16; - - ATOM_CATEGORY = 1; - ATOM_LINK = 2; - ATOM_TITLE = 3; - ATOM_CONTENT = 4; - ATOM_SUMMARY = 5; - ATOM_AUTHOR = 6; - - GD_WHEN = 7; - GD_EMAIL = 8; - GEORSS_POINT = 9; - GD_IM = 10; - - GD_PHONENUMBER = 11; - GD_POSTALADDRESS = 12; - - GD_RATING = 13; - - BLOBKEY = 17; - ENTITY_PROTO = 19; - - INDEX_VALUE = 18; - }; - - optional Meaning meaning = 1 [default = NO_MEANING]; - optional string meaning_uri = 2; - - required string name = 3; - - required PropertyValue value = 5; - - required bool multiple = 4; - - optional bool searchable = 6 [default=false]; - - enum FtsTokenizationOption { - HTML = 1; - ATOM = 2; - } - - optional FtsTokenizationOption fts_tokenization_option = 8; - - optional string locale = 9 [default = "en"]; -} - -message Path { - repeated group Element = 1 { - required string type = 2; - optional int64 id = 3; - optional string name = 4; - } -} - -message Reference { - required string app = 13; - optional string name_space = 20; - required Path path = 14; -} - -message User { - required string email = 1; - required string auth_domain = 2; - optional string nickname = 3; - optional string federated_identity = 6; - optional string federated_provider = 7; -} - -message EntityProto { - required Reference key = 13; - required Path entity_group = 16; - optional User owner = 17; - - enum Kind { - GD_CONTACT = 1; - GD_EVENT = 2; - GD_MESSAGE = 3; - } - optional Kind kind = 4; - optional string kind_uri = 5; - - repeated Property property = 14; - repeated Property raw_property = 15; - - optional int32 rank = 18; -} - -message CompositeProperty { - required int64 index_id = 1; - repeated string value = 2; -} - -message Index { - required string entity_type = 1; - required bool ancestor = 5; - repeated group Property = 2 { - required string name = 3; - enum Direction { - ASCENDING = 1; - DESCENDING = 2; - } - optional Direction direction = 4 [default = ASCENDING]; - } -} - -message CompositeIndex { - required string app_id = 1; - required int64 id = 2; - required Index definition = 3; - - enum State { - WRITE_ONLY = 1; - READ_WRITE = 2; - DELETED = 3; - ERROR = 4; - } - required State state = 4; - - optional bool only_use_if_required = 6 [default = false]; -} - -message IndexPostfix { - message IndexValue { - required string property_name = 1; - required PropertyValue value = 2; - } - - repeated IndexValue index_value = 1; - - optional Reference key = 2; - - optional bool before = 3 [default=true]; -} - -message IndexPosition { - optional string key = 1; - - optional bool before = 2 [default=true]; -} - -message Snapshot { - enum Status { - INACTIVE = 0; - ACTIVE = 1; - } - - required int64 ts = 1; -} - -message InternalHeader { - optional string qos = 1; -} - -message Transaction { - optional InternalHeader header = 4; - required fixed64 handle = 1; - required string app = 2; - optional bool mark_changes = 3 [default = false]; -} - -message Query { - optional InternalHeader header = 39; - - required string app = 1; - optional string name_space = 29; - - optional string kind = 3; - optional Reference ancestor = 17; - - repeated group Filter = 4 { - enum Operator { - LESS_THAN = 1; - LESS_THAN_OR_EQUAL = 2; - GREATER_THAN = 3; - GREATER_THAN_OR_EQUAL = 4; - EQUAL = 5; - IN = 6; - EXISTS = 7; - } - - required Operator op = 6; - repeated Property property = 14; - } - - optional string search_query = 8; - - repeated group Order = 9 { - enum Direction { - ASCENDING = 1; - DESCENDING = 2; - } - - required string property = 10; - optional Direction direction = 11 [default = ASCENDING]; - } - - enum Hint { - ORDER_FIRST = 1; - ANCESTOR_FIRST = 2; - FILTER_FIRST = 3; - } - optional Hint hint = 18; - - optional int32 count = 23; - - optional int32 offset = 12 [default = 0]; - - optional int32 limit = 16; - - optional CompiledCursor compiled_cursor = 30; - optional CompiledCursor end_compiled_cursor = 31; - - repeated CompositeIndex composite_index = 19; - - optional bool require_perfect_plan = 20 [default = false]; - - optional bool keys_only = 21 [default = false]; - - optional Transaction transaction = 22; - - optional bool compile = 25 [default = false]; - - optional int64 failover_ms = 26; - - optional bool strong = 32; - - repeated string property_name = 33; - - repeated string group_by_property_name = 34; - - optional bool distinct = 24; - - optional int64 min_safe_time_seconds = 35; - - repeated string safe_replica_name = 36; - - optional bool persist_offset = 37 [default=false]; -} - -message CompiledQuery { - required group PrimaryScan = 1 { - optional string index_name = 2; - - optional string start_key = 3; - optional bool start_inclusive = 4; - optional string end_key = 5; - optional bool end_inclusive = 6; - - repeated string start_postfix_value = 22; - repeated string end_postfix_value = 23; - - optional int64 end_unapplied_log_timestamp_us = 19; - } - - repeated group MergeJoinScan = 7 { - required string index_name = 8; - - repeated string prefix_value = 9; - - optional bool value_prefix = 20 [default=false]; - } - - optional Index index_def = 21; - - optional int32 offset = 10 [default = 0]; - - optional int32 limit = 11; - - required bool keys_only = 12; - - repeated string property_name = 24; - - optional int32 distinct_infix_size = 25; - - optional group EntityFilter = 13 { - optional bool distinct = 14 [default=false]; - - optional string kind = 17; - optional Reference ancestor = 18; - } -} - -message CompiledCursor { - optional group Position = 2 { - optional string start_key = 27; - - repeated group IndexValue = 29 { - optional string property = 30; - required PropertyValue value = 31; - } - - optional Reference key = 32; - - optional bool start_inclusive = 28 [default=true]; - } -} - -message Cursor { - required fixed64 cursor = 1; - - optional string app = 2; -} - -message Error { - enum ErrorCode { - BAD_REQUEST = 1; - CONCURRENT_TRANSACTION = 2; - INTERNAL_ERROR = 3; - NEED_INDEX = 4; - TIMEOUT = 5; - PERMISSION_DENIED = 6; - BIGTABLE_ERROR = 7; - COMMITTED_BUT_STILL_APPLYING = 8; - CAPABILITY_DISABLED = 9; - TRY_ALTERNATE_BACKEND = 10; - SAFE_TIME_TOO_OLD = 11; - } -} - -message Cost { - optional int32 index_writes = 1; - optional int32 index_write_bytes = 2; - optional int32 entity_writes = 3; - optional int32 entity_write_bytes = 4; - optional group CommitCost = 5 { - optional int32 requested_entity_puts = 6; - optional int32 requested_entity_deletes = 7; - }; - optional int32 approximate_storage_delta = 8; - optional int32 id_sequence_updates = 9; -} - -message GetRequest { - optional InternalHeader header = 6; - - repeated Reference key = 1; - optional Transaction transaction = 2; - - optional int64 failover_ms = 3; - - optional bool strong = 4; - - optional bool allow_deferred = 5 [default=false]; -} - -message GetResponse { - repeated group Entity = 1 { - optional EntityProto entity = 2; - optional Reference key = 4; - - optional int64 version = 3; - } - - repeated Reference deferred = 5; - - optional bool in_order = 6 [default=true]; -} - -message PutRequest { - optional InternalHeader header = 11; - - repeated EntityProto entity = 1; - optional Transaction transaction = 2; - repeated CompositeIndex composite_index = 3; - - optional bool trusted = 4 [default = false]; - - optional bool force = 7 [default = false]; - - optional bool mark_changes = 8 [default = false]; - repeated Snapshot snapshot = 9; - - enum AutoIdPolicy { - CURRENT = 0; - SEQUENTIAL = 1; - } - optional AutoIdPolicy auto_id_policy = 10 [default = CURRENT]; -} - -message PutResponse { - repeated Reference key = 1; - optional Cost cost = 2; - repeated int64 version = 3; -} - -message TouchRequest { - optional InternalHeader header = 10; - - repeated Reference key = 1; - repeated CompositeIndex composite_index = 2; - optional bool force = 3 [default = false]; - repeated Snapshot snapshot = 9; -} - -message TouchResponse { - optional Cost cost = 1; -} - -message DeleteRequest { - optional InternalHeader header = 10; - - repeated Reference key = 6; - optional Transaction transaction = 5; - - optional bool trusted = 4 [default = false]; - - optional bool force = 7 [default = false]; - - optional bool mark_changes = 8 [default = false]; - repeated Snapshot snapshot = 9; -} - -message DeleteResponse { - optional Cost cost = 1; - repeated int64 version = 3; -} - -message NextRequest { - optional InternalHeader header = 5; - - required Cursor cursor = 1; - optional int32 count = 2; - - optional int32 offset = 4 [default = 0]; - - optional bool compile = 3 [default = false]; -} - -message QueryResult { - optional Cursor cursor = 1; - - repeated EntityProto result = 2; - - optional int32 skipped_results = 7; - - required bool more_results = 3; - - optional bool keys_only = 4; - - optional bool index_only = 9; - - optional bool small_ops = 10; - - optional CompiledQuery compiled_query = 5; - - optional CompiledCursor compiled_cursor = 6; - - repeated CompositeIndex index = 8; - - repeated int64 version = 11; -} - -message AllocateIdsRequest { - optional InternalHeader header = 4; - - optional Reference model_key = 1; - - optional int64 size = 2; - - optional int64 max = 3; - - repeated Reference reserve = 5; -} - -message AllocateIdsResponse { - required int64 start = 1; - required int64 end = 2; - optional Cost cost = 3; -} - -message CompositeIndices { - repeated CompositeIndex index = 1; -} - -message AddActionsRequest { - optional InternalHeader header = 3; - - required Transaction transaction = 1; - repeated Action action = 2; -} - -message AddActionsResponse { -} - -message BeginTransactionRequest { - optional InternalHeader header = 3; - - required string app = 1; - optional bool allow_multiple_eg = 2 [default = false]; - optional string database_id = 4; - - enum TransactionMode { - UNKNOWN = 0; - READ_ONLY = 1; - READ_WRITE = 2; - } - optional TransactionMode mode = 5 [default = UNKNOWN]; - - optional Transaction previous_transaction = 7; -} - -message CommitResponse { - optional Cost cost = 1; - - repeated group Version = 3 { - required Reference root_entity_key = 4; - required int64 version = 5; - } -} diff --git a/vendor/google.golang.org/appengine/internal/log/log_service.proto b/vendor/google.golang.org/appengine/internal/log/log_service.proto deleted file mode 100644 index 8981dc4..0000000 --- a/vendor/google.golang.org/appengine/internal/log/log_service.proto +++ /dev/null @@ -1,150 +0,0 @@ -syntax = "proto2"; -option go_package = "log"; - -package appengine; - -message LogServiceError { - enum ErrorCode { - OK = 0; - INVALID_REQUEST = 1; - STORAGE_ERROR = 2; - } -} - -message UserAppLogLine { - required int64 timestamp_usec = 1; - required int64 level = 2; - required string message = 3; -} - -message UserAppLogGroup { - repeated UserAppLogLine log_line = 2; -} - -message FlushRequest { - optional bytes logs = 1; -} - -message SetStatusRequest { - required string status = 1; -} - - -message LogOffset { - optional bytes request_id = 1; -} - -message LogLine { - required int64 time = 1; - required int32 level = 2; - required string log_message = 3; -} - -message RequestLog { - required string app_id = 1; - optional string module_id = 37 [default="default"]; - required string version_id = 2; - required bytes request_id = 3; - optional LogOffset offset = 35; - required string ip = 4; - optional string nickname = 5; - required int64 start_time = 6; - required int64 end_time = 7; - required int64 latency = 8; - required int64 mcycles = 9; - required string method = 10; - required string resource = 11; - required string http_version = 12; - required int32 status = 13; - required int64 response_size = 14; - optional string referrer = 15; - optional string user_agent = 16; - required string url_map_entry = 17; - required string combined = 18; - optional int64 api_mcycles = 19; - optional string host = 20; - optional double cost = 21; - - optional string task_queue_name = 22; - optional string task_name = 23; - - optional bool was_loading_request = 24; - optional int64 pending_time = 25; - optional int32 replica_index = 26 [default = -1]; - optional bool finished = 27 [default = true]; - optional bytes clone_key = 28; - - repeated LogLine line = 29; - - optional bool lines_incomplete = 36; - optional bytes app_engine_release = 38; - - optional int32 exit_reason = 30; - optional bool was_throttled_for_time = 31; - optional bool was_throttled_for_requests = 32; - optional int64 throttled_time = 33; - - optional bytes server_name = 34; -} - -message LogModuleVersion { - optional string module_id = 1 [default="default"]; - optional string version_id = 2; -} - -message LogReadRequest { - required string app_id = 1; - repeated string version_id = 2; - repeated LogModuleVersion module_version = 19; - - optional int64 start_time = 3; - optional int64 end_time = 4; - optional LogOffset offset = 5; - repeated bytes request_id = 6; - - optional int32 minimum_log_level = 7; - optional bool include_incomplete = 8; - optional int64 count = 9; - - optional string combined_log_regex = 14; - optional string host_regex = 15; - optional int32 replica_index = 16; - - optional bool include_app_logs = 10; - optional int32 app_logs_per_request = 17; - optional bool include_host = 11; - optional bool include_all = 12; - optional bool cache_iterator = 13; - optional int32 num_shards = 18; -} - -message LogReadResponse { - repeated RequestLog log = 1; - optional LogOffset offset = 2; - optional int64 last_end_time = 3; -} - -message LogUsageRecord { - optional string version_id = 1; - optional int32 start_time = 2; - optional int32 end_time = 3; - optional int64 count = 4; - optional int64 total_size = 5; - optional int32 records = 6; -} - -message LogUsageRequest { - required string app_id = 1; - repeated string version_id = 2; - optional int32 start_time = 3; - optional int32 end_time = 4; - optional uint32 resolution_hours = 5 [default = 1]; - optional bool combine_versions = 6; - optional int32 usage_version = 7; - optional bool versions_only = 8; -} - -message LogUsageResponse { - repeated LogUsageRecord usage = 1; - optional LogUsageRecord summary = 2; -} diff --git a/vendor/google.golang.org/appengine/internal/modules/modules_service.proto b/vendor/google.golang.org/appengine/internal/modules/modules_service.proto deleted file mode 100644 index d29f006..0000000 --- a/vendor/google.golang.org/appengine/internal/modules/modules_service.proto +++ /dev/null @@ -1,80 +0,0 @@ -syntax = "proto2"; -option go_package = "modules"; - -package appengine; - -message ModulesServiceError { - enum ErrorCode { - OK = 0; - INVALID_MODULE = 1; - INVALID_VERSION = 2; - INVALID_INSTANCES = 3; - TRANSIENT_ERROR = 4; - UNEXPECTED_STATE = 5; - } -} - -message GetModulesRequest { -} - -message GetModulesResponse { - repeated string module = 1; -} - -message GetVersionsRequest { - optional string module = 1; -} - -message GetVersionsResponse { - repeated string version = 1; -} - -message GetDefaultVersionRequest { - optional string module = 1; -} - -message GetDefaultVersionResponse { - required string version = 1; -} - -message GetNumInstancesRequest { - optional string module = 1; - optional string version = 2; -} - -message GetNumInstancesResponse { - required int64 instances = 1; -} - -message SetNumInstancesRequest { - optional string module = 1; - optional string version = 2; - required int64 instances = 3; -} - -message SetNumInstancesResponse {} - -message StartModuleRequest { - required string module = 1; - required string version = 2; -} - -message StartModuleResponse {} - -message StopModuleRequest { - optional string module = 1; - optional string version = 2; -} - -message StopModuleResponse {} - -message GetHostnameRequest { - optional string module = 1; - optional string version = 2; - optional string instance = 3; -} - -message GetHostnameResponse { - required string hostname = 1; -} - diff --git a/vendor/google.golang.org/appengine/internal/regen.sh b/vendor/google.golang.org/appengine/internal/regen.sh deleted file mode 100755 index 2fdb546..0000000 --- a/vendor/google.golang.org/appengine/internal/regen.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -e -# -# This script rebuilds the generated code for the protocol buffers. -# To run this you will need protoc and goprotobuf installed; -# see https://github.com/golang/protobuf for instructions. - -PKG=google.golang.org/appengine - -function die() { - echo 1>&2 $* - exit 1 -} - -# Sanity check that the right tools are accessible. -for tool in go protoc protoc-gen-go; do - q=$(which $tool) || die "didn't find $tool" - echo 1>&2 "$tool: $q" -done - -echo -n 1>&2 "finding package dir... " -pkgdir=$(go list -f '{{.Dir}}' $PKG) -echo 1>&2 $pkgdir -base=$(echo $pkgdir | sed "s,/$PKG\$,,") -echo 1>&2 "base: $base" -cd $base - -# Run protoc once per package. -for dir in $(find $PKG/internal -name '*.proto' | xargs dirname | sort | uniq); do - echo 1>&2 "* $dir" - protoc --go_out=. $dir/*.proto -done - -for f in $(find $PKG/internal -name '*.pb.go'); do - # Remove proto.RegisterEnum calls. - # These cause duplicate registration panics when these packages - # are used on classic App Engine. proto.RegisterEnum only affects - # parsing the text format; we don't care about that. - # https://code.google.com/p/googleappengine/issues/detail?id=11670#c17 - sed -i '/proto.RegisterEnum/d' $f -done diff --git a/vendor/google.golang.org/appengine/internal/remote_api/remote_api.proto b/vendor/google.golang.org/appengine/internal/remote_api/remote_api.proto deleted file mode 100644 index f21763a..0000000 --- a/vendor/google.golang.org/appengine/internal/remote_api/remote_api.proto +++ /dev/null @@ -1,44 +0,0 @@ -syntax = "proto2"; -option go_package = "remote_api"; - -package remote_api; - -message Request { - required string service_name = 2; - required string method = 3; - required bytes request = 4; - optional string request_id = 5; -} - -message ApplicationError { - required int32 code = 1; - required string detail = 2; -} - -message RpcError { - enum ErrorCode { - UNKNOWN = 0; - CALL_NOT_FOUND = 1; - PARSE_ERROR = 2; - SECURITY_VIOLATION = 3; - OVER_QUOTA = 4; - REQUEST_TOO_LARGE = 5; - CAPABILITY_DISABLED = 6; - FEATURE_DISABLED = 7; - BAD_REQUEST = 8; - RESPONSE_TOO_LARGE = 9; - CANCELLED = 10; - REPLAY_ERROR = 11; - DEADLINE_EXCEEDED = 12; - } - required int32 code = 1; - optional string detail = 2; -} - -message Response { - optional bytes response = 1; - optional bytes exception = 2; - optional ApplicationError application_error = 3; - optional bytes java_exception = 4; - optional RpcError rpc_error = 5; -} diff --git a/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto b/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto deleted file mode 100644 index f695edf..0000000 --- a/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto +++ /dev/null @@ -1,64 +0,0 @@ -syntax = "proto2"; -option go_package = "urlfetch"; - -package appengine; - -message URLFetchServiceError { - enum ErrorCode { - OK = 0; - INVALID_URL = 1; - FETCH_ERROR = 2; - UNSPECIFIED_ERROR = 3; - RESPONSE_TOO_LARGE = 4; - DEADLINE_EXCEEDED = 5; - SSL_CERTIFICATE_ERROR = 6; - DNS_ERROR = 7; - CLOSED = 8; - INTERNAL_TRANSIENT_ERROR = 9; - TOO_MANY_REDIRECTS = 10; - MALFORMED_REPLY = 11; - CONNECTION_ERROR = 12; - } -} - -message URLFetchRequest { - enum RequestMethod { - GET = 1; - POST = 2; - HEAD = 3; - PUT = 4; - DELETE = 5; - PATCH = 6; - } - required RequestMethod Method = 1; - required string Url = 2; - repeated group Header = 3 { - required string Key = 4; - required string Value = 5; - } - optional bytes Payload = 6 [ctype=CORD]; - - optional bool FollowRedirects = 7 [default=true]; - - optional double Deadline = 8; - - optional bool MustValidateServerCertificate = 9 [default=true]; -} - -message URLFetchResponse { - optional bytes Content = 1; - required int32 StatusCode = 2; - repeated group Header = 3 { - required string Key = 4; - required string Value = 5; - } - optional bool ContentWasTruncated = 6 [default=false]; - optional int64 ExternalBytesSent = 7; - optional int64 ExternalBytesReceived = 8; - - optional string FinalUrl = 9; - - optional int64 ApiCpuMilliseconds = 10 [default=0]; - optional int64 ApiBytesSent = 11 [default=0]; - optional int64 ApiBytesReceived = 12 [default=0]; -} diff --git a/vendor/google.golang.org/appengine/travis_install.sh b/vendor/google.golang.org/appengine/travis_install.sh deleted file mode 100755 index 785b62f..0000000 --- a/vendor/google.golang.org/appengine/travis_install.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -set -e - -if [[ $GO111MODULE == "on" ]]; then - go get . -else - go get -u -v $(go list -f '{{join .Imports "\n"}}{{"\n"}}{{join .TestImports "\n"}}' ./... | sort | uniq | grep -v appengine) -fi - -if [[ $GOAPP == "true" ]]; then - mkdir /tmp/sdk - curl -o /tmp/sdk.zip "https://storage.googleapis.com/appengine-sdks/featured/go_appengine_sdk_linux_amd64-1.9.68.zip" - unzip -q /tmp/sdk.zip -d /tmp/sdk - # NOTE: Set the following env vars in the test script: - # export PATH="$PATH:/tmp/sdk/go_appengine" - # export APPENGINE_DEV_APPSERVER=/tmp/sdk/go_appengine/dev_appserver.py -fi - diff --git a/vendor/google.golang.org/appengine/travis_test.sh b/vendor/google.golang.org/appengine/travis_test.sh deleted file mode 100755 index d4390f0..0000000 --- a/vendor/google.golang.org/appengine/travis_test.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -e - -go version -go test -v google.golang.org/appengine/... -go test -v -race google.golang.org/appengine/... -if [[ $GOAPP == "true" ]]; then - export PATH="$PATH:/tmp/sdk/go_appengine" - export APPENGINE_DEV_APPSERVER=/tmp/sdk/go_appengine/dev_appserver.py - goapp version - goapp test -v google.golang.org/appengine/... -fi diff --git a/vendor/gopkg.in/yaml.v2/.travis.yml b/vendor/gopkg.in/yaml.v2/.travis.yml deleted file mode 100644 index 055480b..0000000 --- a/vendor/gopkg.in/yaml.v2/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: go - -go: - - "1.4.x" - - "1.5.x" - - "1.6.x" - - "1.7.x" - - "1.8.x" - - "1.9.x" - - "1.10.x" - - "1.11.x" - - "1.12.x" - - "1.13.x" - - "tip" - -go_import_path: gopkg.in/yaml.v2 diff --git a/vendor/gopkg.in/yaml.v2/README.md b/vendor/gopkg.in/yaml.v2/README.md deleted file mode 100644 index b50c6e8..0000000 --- a/vendor/gopkg.in/yaml.v2/README.md +++ /dev/null @@ -1,133 +0,0 @@ -# YAML support for the Go language - -Introduction ------------- - -The yaml package enables Go programs to comfortably encode and decode YAML -values. It was developed within [Canonical](https://www.canonical.com) as -part of the [juju](https://juju.ubuntu.com) project, and is based on a -pure Go port of the well-known [libyaml](http://pyyaml.org/wiki/LibYAML) -C library to parse and generate YAML data quickly and reliably. - -Compatibility -------------- - -The yaml package supports most of YAML 1.1 and 1.2, including support for -anchors, tags, map merging, etc. Multi-document unmarshalling is not yet -implemented, and base-60 floats from YAML 1.1 are purposefully not -supported since they're a poor design and are gone in YAML 1.2. - -Installation and usage ----------------------- - -The import path for the package is *gopkg.in/yaml.v2*. - -To install it, run: - - go get gopkg.in/yaml.v2 - -API documentation ------------------ - -If opened in a browser, the import path itself leads to the API documentation: - - * [https://gopkg.in/yaml.v2](https://gopkg.in/yaml.v2) - -API stability -------------- - -The package API for yaml v2 will remain stable as described in [gopkg.in](https://gopkg.in). - - -License -------- - -The yaml package is licensed under the Apache License 2.0. Please see the LICENSE file for details. - - -Example -------- - -```Go -package main - -import ( - "fmt" - "log" - - "gopkg.in/yaml.v2" -) - -var data = ` -a: Easy! -b: - c: 2 - d: [3, 4] -` - -// Note: struct fields must be public in order for unmarshal to -// correctly populate the data. -type T struct { - A string - B struct { - RenamedC int `yaml:"c"` - D []int `yaml:",flow"` - } -} - -func main() { - t := T{} - - err := yaml.Unmarshal([]byte(data), &t) - if err != nil { - log.Fatalf("error: %v", err) - } - fmt.Printf("--- t:\n%v\n\n", t) - - d, err := yaml.Marshal(&t) - if err != nil { - log.Fatalf("error: %v", err) - } - fmt.Printf("--- t dump:\n%s\n\n", string(d)) - - m := make(map[interface{}]interface{}) - - err = yaml.Unmarshal([]byte(data), &m) - if err != nil { - log.Fatalf("error: %v", err) - } - fmt.Printf("--- m:\n%v\n\n", m) - - d, err = yaml.Marshal(&m) - if err != nil { - log.Fatalf("error: %v", err) - } - fmt.Printf("--- m dump:\n%s\n\n", string(d)) -} -``` - -This example will generate the following output: - -``` ---- t: -{Easy! {2 [3 4]}} - ---- t dump: -a: Easy! -b: - c: 2 - d: [3, 4] - - ---- m: -map[a:Easy! b:map[c:2 d:[3 4]]] - ---- m dump: -a: Easy! -b: - c: 2 - d: - - 3 - - 4 -``` - diff --git a/vendor/gopkg.in/yaml.v2/go.mod b/vendor/gopkg.in/yaml.v2/go.mod deleted file mode 100644 index 1934e87..0000000 --- a/vendor/gopkg.in/yaml.v2/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module "gopkg.in/yaml.v2" - -require ( - "gopkg.in/check.v1" v0.0.0-20161208181325-20d25e280405 -) diff --git a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/tags.go b/vendor/k8s.io/api/admissionregistration/v1/doc.go similarity index 51% rename from vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/tags.go rename to vendor/k8s.io/api/admissionregistration/v1/doc.go index 8e2a191..c3940f0 100644 --- a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/tags.go +++ b/vendor/k8s.io/api/admissionregistration/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,20 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -package protobuf +// +k8s:deepcopy-gen=package +// +k8s:protobuf-gen=package +// +k8s:openapi-gen=true +// +groupName=admissionregistration.k8s.io -import ( - "k8s.io/gengo/types" - "k8s.io/klog" -) - -// extractBoolTagOrDie gets the comment-tags for the key and asserts that, if -// it exists, the value is boolean. If the tag did not exist, it returns -// false. -func extractBoolTagOrDie(key string, lines []string) bool { - val, err := types.ExtractSingleBoolCommentTag("+", key, false, lines) - if err != nil { - klog.Fatal(err) - } - return val -} +// Package v1 is the v1 version of the API. +// AdmissionConfiguration and AdmissionPluginConfiguration are legacy static admission plugin configuration +// MutatingWebhookConfiguration and ValidatingWebhookConfiguration are for the +// new dynamic admission controller configuration. +package v1 // import "k8s.io/api/admissionregistration/v1" diff --git a/vendor/k8s.io/api/admissionregistration/v1/generated.pb.go b/vendor/k8s.io/api/admissionregistration/v1/generated.pb.go new file mode 100644 index 0000000..1acb634 --- /dev/null +++ b/vendor/k8s.io/api/admissionregistration/v1/generated.pb.go @@ -0,0 +1,3469 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: k8s.io/kubernetes/vendor/k8s.io/api/admissionregistration/v1/generated.proto + +package v1 + +import ( + fmt "fmt" + + io "io" + + proto "github.com/gogo/protobuf/proto" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package + +func (m *MutatingWebhook) Reset() { *m = MutatingWebhook{} } +func (*MutatingWebhook) ProtoMessage() {} +func (*MutatingWebhook) Descriptor() ([]byte, []int) { + return fileDescriptor_aaac5994f79683e8, []int{0} +} +func (m *MutatingWebhook) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MutatingWebhook) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MutatingWebhook) XXX_Merge(src proto.Message) { + xxx_messageInfo_MutatingWebhook.Merge(m, src) +} +func (m *MutatingWebhook) XXX_Size() int { + return m.Size() +} +func (m *MutatingWebhook) XXX_DiscardUnknown() { + xxx_messageInfo_MutatingWebhook.DiscardUnknown(m) +} + +var xxx_messageInfo_MutatingWebhook proto.InternalMessageInfo + +func (m *MutatingWebhookConfiguration) Reset() { *m = MutatingWebhookConfiguration{} } +func (*MutatingWebhookConfiguration) ProtoMessage() {} +func (*MutatingWebhookConfiguration) Descriptor() ([]byte, []int) { + return fileDescriptor_aaac5994f79683e8, []int{1} +} +func (m *MutatingWebhookConfiguration) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MutatingWebhookConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MutatingWebhookConfiguration) XXX_Merge(src proto.Message) { + xxx_messageInfo_MutatingWebhookConfiguration.Merge(m, src) +} +func (m *MutatingWebhookConfiguration) XXX_Size() int { + return m.Size() +} +func (m *MutatingWebhookConfiguration) XXX_DiscardUnknown() { + xxx_messageInfo_MutatingWebhookConfiguration.DiscardUnknown(m) +} + +var xxx_messageInfo_MutatingWebhookConfiguration proto.InternalMessageInfo + +func (m *MutatingWebhookConfigurationList) Reset() { *m = MutatingWebhookConfigurationList{} } +func (*MutatingWebhookConfigurationList) ProtoMessage() {} +func (*MutatingWebhookConfigurationList) Descriptor() ([]byte, []int) { + return fileDescriptor_aaac5994f79683e8, []int{2} +} +func (m *MutatingWebhookConfigurationList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MutatingWebhookConfigurationList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MutatingWebhookConfigurationList) XXX_Merge(src proto.Message) { + xxx_messageInfo_MutatingWebhookConfigurationList.Merge(m, src) +} +func (m *MutatingWebhookConfigurationList) XXX_Size() int { + return m.Size() +} +func (m *MutatingWebhookConfigurationList) XXX_DiscardUnknown() { + xxx_messageInfo_MutatingWebhookConfigurationList.DiscardUnknown(m) +} + +var xxx_messageInfo_MutatingWebhookConfigurationList proto.InternalMessageInfo + +func (m *Rule) Reset() { *m = Rule{} } +func (*Rule) ProtoMessage() {} +func (*Rule) Descriptor() ([]byte, []int) { + return fileDescriptor_aaac5994f79683e8, []int{3} +} +func (m *Rule) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Rule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Rule) XXX_Merge(src proto.Message) { + xxx_messageInfo_Rule.Merge(m, src) +} +func (m *Rule) XXX_Size() int { + return m.Size() +} +func (m *Rule) XXX_DiscardUnknown() { + xxx_messageInfo_Rule.DiscardUnknown(m) +} + +var xxx_messageInfo_Rule proto.InternalMessageInfo + +func (m *RuleWithOperations) Reset() { *m = RuleWithOperations{} } +func (*RuleWithOperations) ProtoMessage() {} +func (*RuleWithOperations) Descriptor() ([]byte, []int) { + return fileDescriptor_aaac5994f79683e8, []int{4} +} +func (m *RuleWithOperations) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RuleWithOperations) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *RuleWithOperations) XXX_Merge(src proto.Message) { + xxx_messageInfo_RuleWithOperations.Merge(m, src) +} +func (m *RuleWithOperations) XXX_Size() int { + return m.Size() +} +func (m *RuleWithOperations) XXX_DiscardUnknown() { + xxx_messageInfo_RuleWithOperations.DiscardUnknown(m) +} + +var xxx_messageInfo_RuleWithOperations proto.InternalMessageInfo + +func (m *ServiceReference) Reset() { *m = ServiceReference{} } +func (*ServiceReference) ProtoMessage() {} +func (*ServiceReference) Descriptor() ([]byte, []int) { + return fileDescriptor_aaac5994f79683e8, []int{5} +} +func (m *ServiceReference) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ServiceReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ServiceReference) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceReference.Merge(m, src) +} +func (m *ServiceReference) XXX_Size() int { + return m.Size() +} +func (m *ServiceReference) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceReference.DiscardUnknown(m) +} + +var xxx_messageInfo_ServiceReference proto.InternalMessageInfo + +func (m *ValidatingWebhook) Reset() { *m = ValidatingWebhook{} } +func (*ValidatingWebhook) ProtoMessage() {} +func (*ValidatingWebhook) Descriptor() ([]byte, []int) { + return fileDescriptor_aaac5994f79683e8, []int{6} +} +func (m *ValidatingWebhook) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatingWebhook) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ValidatingWebhook) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatingWebhook.Merge(m, src) +} +func (m *ValidatingWebhook) XXX_Size() int { + return m.Size() +} +func (m *ValidatingWebhook) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatingWebhook.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatingWebhook proto.InternalMessageInfo + +func (m *ValidatingWebhookConfiguration) Reset() { *m = ValidatingWebhookConfiguration{} } +func (*ValidatingWebhookConfiguration) ProtoMessage() {} +func (*ValidatingWebhookConfiguration) Descriptor() ([]byte, []int) { + return fileDescriptor_aaac5994f79683e8, []int{7} +} +func (m *ValidatingWebhookConfiguration) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatingWebhookConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ValidatingWebhookConfiguration) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatingWebhookConfiguration.Merge(m, src) +} +func (m *ValidatingWebhookConfiguration) XXX_Size() int { + return m.Size() +} +func (m *ValidatingWebhookConfiguration) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatingWebhookConfiguration.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatingWebhookConfiguration proto.InternalMessageInfo + +func (m *ValidatingWebhookConfigurationList) Reset() { *m = ValidatingWebhookConfigurationList{} } +func (*ValidatingWebhookConfigurationList) ProtoMessage() {} +func (*ValidatingWebhookConfigurationList) Descriptor() ([]byte, []int) { + return fileDescriptor_aaac5994f79683e8, []int{8} +} +func (m *ValidatingWebhookConfigurationList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatingWebhookConfigurationList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ValidatingWebhookConfigurationList) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatingWebhookConfigurationList.Merge(m, src) +} +func (m *ValidatingWebhookConfigurationList) XXX_Size() int { + return m.Size() +} +func (m *ValidatingWebhookConfigurationList) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatingWebhookConfigurationList.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatingWebhookConfigurationList proto.InternalMessageInfo + +func (m *WebhookClientConfig) Reset() { *m = WebhookClientConfig{} } +func (*WebhookClientConfig) ProtoMessage() {} +func (*WebhookClientConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_aaac5994f79683e8, []int{9} +} +func (m *WebhookClientConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WebhookClientConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *WebhookClientConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_WebhookClientConfig.Merge(m, src) +} +func (m *WebhookClientConfig) XXX_Size() int { + return m.Size() +} +func (m *WebhookClientConfig) XXX_DiscardUnknown() { + xxx_messageInfo_WebhookClientConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_WebhookClientConfig proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MutatingWebhook)(nil), "k8s.io.api.admissionregistration.v1.MutatingWebhook") + proto.RegisterType((*MutatingWebhookConfiguration)(nil), "k8s.io.api.admissionregistration.v1.MutatingWebhookConfiguration") + proto.RegisterType((*MutatingWebhookConfigurationList)(nil), "k8s.io.api.admissionregistration.v1.MutatingWebhookConfigurationList") + proto.RegisterType((*Rule)(nil), "k8s.io.api.admissionregistration.v1.Rule") + proto.RegisterType((*RuleWithOperations)(nil), "k8s.io.api.admissionregistration.v1.RuleWithOperations") + proto.RegisterType((*ServiceReference)(nil), "k8s.io.api.admissionregistration.v1.ServiceReference") + proto.RegisterType((*ValidatingWebhook)(nil), "k8s.io.api.admissionregistration.v1.ValidatingWebhook") + proto.RegisterType((*ValidatingWebhookConfiguration)(nil), "k8s.io.api.admissionregistration.v1.ValidatingWebhookConfiguration") + proto.RegisterType((*ValidatingWebhookConfigurationList)(nil), "k8s.io.api.admissionregistration.v1.ValidatingWebhookConfigurationList") + proto.RegisterType((*WebhookClientConfig)(nil), "k8s.io.api.admissionregistration.v1.WebhookClientConfig") +} + +func init() { + proto.RegisterFile("k8s.io/kubernetes/vendor/k8s.io/api/admissionregistration/v1/generated.proto", fileDescriptor_aaac5994f79683e8) +} + +var fileDescriptor_aaac5994f79683e8 = []byte{ + // 1104 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x55, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0xc6, 0x76, 0x63, 0x8f, 0xf3, 0xa7, 0x19, 0xa0, 0x35, 0xa1, 0xf2, 0x5a, 0x46, 0x42, + 0x46, 0xc0, 0x6e, 0x13, 0x4a, 0xa9, 0xb8, 0xa0, 0x6c, 0xf8, 0xa3, 0x88, 0xa4, 0x8d, 0x26, 0x6d, + 0x8a, 0x50, 0x0e, 0x1d, 0xaf, 0xc7, 0xf6, 0x10, 0x7b, 0x67, 0x35, 0x33, 0xeb, 0x92, 0x1b, 0x1f, + 0x81, 0xaf, 0x00, 0x9f, 0x82, 0x1b, 0xe2, 0x96, 0x63, 0x8f, 0x39, 0xa0, 0x85, 0x2c, 0x17, 0x0e, + 0x7c, 0x82, 0x9c, 0xd0, 0xcc, 0xae, 0x77, 0xfd, 0x27, 0x09, 0x56, 0x0e, 0x3d, 0xe5, 0xb6, 0xf3, + 0x7b, 0xf3, 0x7e, 0x6f, 0xde, 0xdb, 0xf7, 0xde, 0x0f, 0xec, 0x1c, 0x3d, 0x12, 0x16, 0x65, 0xf6, + 0x51, 0xd0, 0x24, 0xdc, 0x23, 0x92, 0x08, 0x7b, 0x40, 0xbc, 0x16, 0xe3, 0x76, 0x62, 0xc0, 0x3e, + 0xb5, 0x71, 0xab, 0x4f, 0x85, 0xa0, 0xcc, 0xe3, 0xa4, 0x43, 0x85, 0xe4, 0x58, 0x52, 0xe6, 0xd9, + 0x83, 0x75, 0xbb, 0x43, 0x3c, 0xc2, 0xb1, 0x24, 0x2d, 0xcb, 0xe7, 0x4c, 0x32, 0xf8, 0x6e, 0xec, + 0x64, 0x61, 0x9f, 0x5a, 0x17, 0x3a, 0x59, 0x83, 0xf5, 0xb5, 0x8f, 0x3a, 0x54, 0x76, 0x83, 0xa6, + 0xe5, 0xb2, 0xbe, 0xdd, 0x61, 0x1d, 0x66, 0x6b, 0xdf, 0x66, 0xd0, 0xd6, 0x27, 0x7d, 0xd0, 0x5f, + 0x31, 0xe7, 0xda, 0x83, 0xec, 0x21, 0x7d, 0xec, 0x76, 0xa9, 0x47, 0xf8, 0xb1, 0xed, 0x1f, 0x75, + 0x14, 0x20, 0xec, 0x3e, 0x91, 0xf8, 0x82, 0x97, 0xac, 0xd9, 0x97, 0x79, 0xf1, 0xc0, 0x93, 0xb4, + 0x4f, 0xa6, 0x1c, 0x1e, 0xfe, 0x9f, 0x83, 0x70, 0xbb, 0xa4, 0x8f, 0x27, 0xfd, 0xea, 0xbf, 0x2d, + 0x80, 0x95, 0xdd, 0x40, 0x62, 0x49, 0xbd, 0xce, 0x73, 0xd2, 0xec, 0x32, 0x76, 0x04, 0x6b, 0x20, + 0xef, 0xe1, 0x3e, 0xa9, 0x18, 0x35, 0xa3, 0x51, 0x72, 0x16, 0x4f, 0x42, 0x73, 0x2e, 0x0a, 0xcd, + 0xfc, 0x63, 0xdc, 0x27, 0x48, 0x5b, 0x20, 0x07, 0x8b, 0x6e, 0x8f, 0x12, 0x4f, 0x6e, 0x31, 0xaf, + 0x4d, 0x3b, 0x95, 0xf9, 0x9a, 0xd1, 0x28, 0x6f, 0x3c, 0xb2, 0x66, 0xa8, 0x9f, 0x95, 0x44, 0xd9, + 0x1a, 0xf1, 0x77, 0xde, 0x4c, 0x62, 0x2c, 0x8e, 0xa2, 0x68, 0x2c, 0x06, 0x3c, 0x04, 0x05, 0x1e, + 0xf4, 0x88, 0xa8, 0xe4, 0x6a, 0xb9, 0x46, 0x79, 0xe3, 0xd3, 0x99, 0x82, 0xa1, 0xa0, 0x47, 0x9e, + 0x53, 0xd9, 0x7d, 0xe2, 0x93, 0x18, 0x14, 0xce, 0x52, 0x12, 0xab, 0xa0, 0x6c, 0x02, 0xc5, 0xa4, + 0x70, 0x07, 0x2c, 0xb5, 0x31, 0xed, 0x05, 0x9c, 0xec, 0xb1, 0x1e, 0x75, 0x8f, 0x2b, 0x79, 0x9d, + 0xfc, 0x7b, 0x51, 0x68, 0x2e, 0x7d, 0x35, 0x6a, 0x38, 0x0f, 0xcd, 0xd5, 0x31, 0xe0, 0xe9, 0xb1, + 0x4f, 0xd0, 0xb8, 0x33, 0xfc, 0x02, 0x94, 0xfb, 0x58, 0xba, 0xdd, 0x84, 0xab, 0xa4, 0xb9, 0xea, + 0x51, 0x68, 0x96, 0x77, 0x33, 0xf8, 0x3c, 0x34, 0x57, 0x46, 0x8e, 0x9a, 0x67, 0xd4, 0x0d, 0xfe, + 0x00, 0x56, 0x55, 0xb5, 0x85, 0x8f, 0x5d, 0xb2, 0x4f, 0x7a, 0xc4, 0x95, 0x8c, 0x57, 0x0a, 0xba, + 0xd4, 0x1f, 0x8f, 0x64, 0x9f, 0xfe, 0x6f, 0xcb, 0x3f, 0xea, 0x28, 0x40, 0x58, 0xaa, 0xad, 0x54, + 0xfa, 0x3b, 0xb8, 0x49, 0x7a, 0x43, 0x57, 0xe7, 0xad, 0x28, 0x34, 0x57, 0x1f, 0x4f, 0x32, 0xa2, + 0xe9, 0x20, 0x90, 0x81, 0x65, 0xd6, 0xfc, 0x9e, 0xb8, 0x32, 0x0d, 0x5b, 0xbe, 0x7e, 0x58, 0x18, + 0x85, 0xe6, 0xf2, 0x93, 0x31, 0x3a, 0x34, 0x41, 0xaf, 0x0a, 0x26, 0x68, 0x8b, 0x7c, 0xd9, 0x6e, + 0x13, 0x57, 0x8a, 0xca, 0xad, 0xac, 0x60, 0xfb, 0x19, 0xac, 0x0a, 0x96, 0x1d, 0xb7, 0x7a, 0x58, + 0x08, 0x34, 0xea, 0x06, 0x3f, 0x03, 0xcb, 0xaa, 0xd7, 0x59, 0x20, 0xf7, 0x89, 0xcb, 0xbc, 0x96, + 0xa8, 0x2c, 0xd4, 0x8c, 0x46, 0x21, 0x7e, 0xc1, 0xd3, 0x31, 0x0b, 0x9a, 0xb8, 0x09, 0x9f, 0x81, + 0xbb, 0x69, 0x17, 0x21, 0x32, 0xa0, 0xe4, 0xe5, 0x01, 0xe1, 0xea, 0x20, 0x2a, 0xc5, 0x5a, 0xae, + 0x51, 0x72, 0xde, 0x89, 0x42, 0xf3, 0xee, 0xe6, 0xc5, 0x57, 0xd0, 0x65, 0xbe, 0xf0, 0x05, 0x80, + 0x9c, 0x50, 0x6f, 0xc0, 0x5c, 0xdd, 0x7e, 0x49, 0x43, 0x00, 0x9d, 0xdf, 0xfd, 0x28, 0x34, 0x21, + 0x9a, 0xb2, 0x9e, 0x87, 0xe6, 0x9d, 0x69, 0x54, 0xb7, 0xc7, 0x05, 0x5c, 0xf5, 0x53, 0x03, 0xdc, + 0x9b, 0x98, 0xe0, 0x78, 0x62, 0x82, 0xb8, 0xe3, 0xe1, 0x0b, 0x50, 0x54, 0x3f, 0xa6, 0x85, 0x25, + 0xd6, 0x23, 0x5d, 0xde, 0xb8, 0x3f, 0xdb, 0x6f, 0x8c, 0xff, 0xd9, 0x2e, 0x91, 0xd8, 0x81, 0xc9, + 0xd0, 0x80, 0x0c, 0x43, 0x29, 0x2b, 0x3c, 0x00, 0xc5, 0x24, 0xb2, 0xa8, 0xcc, 0xeb, 0xe9, 0x7c, + 0x30, 0xd3, 0x74, 0x4e, 0x3c, 0xdb, 0xc9, 0xab, 0x28, 0xa8, 0xf8, 0x32, 0xe1, 0xaa, 0xff, 0x63, + 0x80, 0xda, 0x55, 0xa9, 0xed, 0x50, 0x21, 0xe1, 0xe1, 0x54, 0x7a, 0xd6, 0x8c, 0x5d, 0x4a, 0x45, + 0x9c, 0xdc, 0xed, 0x24, 0xb9, 0xe2, 0x10, 0x19, 0x49, 0xad, 0x0d, 0x0a, 0x54, 0x92, 0xfe, 0x30, + 0xaf, 0xcd, 0xeb, 0xe4, 0x35, 0xf6, 0xe6, 0x6c, 0xff, 0x6c, 0x2b, 0x5e, 0x14, 0xd3, 0xd7, 0x7f, + 0x37, 0x40, 0x5e, 0x2d, 0x24, 0xf8, 0x01, 0x28, 0x61, 0x9f, 0x7e, 0xcd, 0x59, 0xe0, 0x8b, 0x8a, + 0xa1, 0x3b, 0x6f, 0x29, 0x0a, 0xcd, 0xd2, 0xe6, 0xde, 0x76, 0x0c, 0xa2, 0xcc, 0x0e, 0xd7, 0x41, + 0x19, 0xfb, 0x34, 0x6d, 0xd4, 0x79, 0x7d, 0x7d, 0x45, 0x8d, 0xcd, 0xe6, 0xde, 0x76, 0xda, 0x9c, + 0xa3, 0x77, 0x14, 0x3f, 0x27, 0x82, 0x05, 0xdc, 0x4d, 0x56, 0x69, 0xc2, 0x8f, 0x86, 0x20, 0xca, + 0xec, 0xf0, 0x43, 0x50, 0x10, 0x2e, 0xf3, 0x49, 0xb2, 0x0d, 0xef, 0xa8, 0x67, 0xef, 0x2b, 0xe0, + 0x3c, 0x34, 0x4b, 0xfa, 0x43, 0xb7, 0x65, 0x7c, 0xa9, 0xfe, 0x8b, 0x01, 0xe0, 0xf4, 0xc2, 0x85, + 0x9f, 0x03, 0xc0, 0xd2, 0x53, 0x92, 0x92, 0xa9, 0x7b, 0x29, 0x45, 0xcf, 0x43, 0x73, 0x29, 0x3d, + 0x69, 0xca, 0x11, 0x17, 0xf8, 0x0d, 0xc8, 0xab, 0x25, 0x9d, 0xa8, 0xcc, 0xfb, 0x33, 0x2f, 0xfe, + 0x4c, 0xba, 0xd4, 0x09, 0x69, 0x92, 0xfa, 0xcf, 0x06, 0xb8, 0xbd, 0x4f, 0xf8, 0x80, 0xba, 0x04, + 0x91, 0x36, 0xe1, 0xc4, 0x73, 0x09, 0xb4, 0x41, 0x29, 0x5d, 0x82, 0x89, 0xec, 0xad, 0x26, 0xbe, + 0xa5, 0x74, 0x61, 0xa2, 0xec, 0x4e, 0x2a, 0x91, 0xf3, 0x97, 0x4a, 0xe4, 0x3d, 0x90, 0xf7, 0xb1, + 0xec, 0x56, 0x72, 0xfa, 0x46, 0x51, 0x59, 0xf7, 0xb0, 0xec, 0x22, 0x8d, 0x6a, 0x2b, 0xe3, 0x52, + 0xd7, 0xb5, 0x90, 0x58, 0x19, 0x97, 0x48, 0xa3, 0xf5, 0x3f, 0x6f, 0x81, 0xd5, 0x03, 0xdc, 0xa3, + 0xad, 0x1b, 0x59, 0xbe, 0x91, 0xe5, 0x2b, 0x65, 0x19, 0xdc, 0xc8, 0xf2, 0x75, 0x64, 0xb9, 0xfe, + 0x87, 0x01, 0xaa, 0x53, 0x13, 0xf6, 0xba, 0x65, 0xf3, 0xdb, 0x29, 0xd9, 0x7c, 0x38, 0xd3, 0xf4, + 0x4c, 0x3d, 0x7c, 0x4a, 0x38, 0xff, 0x35, 0x40, 0xfd, 0xea, 0xf4, 0x5e, 0x83, 0x74, 0x76, 0xc7, + 0xa5, 0x73, 0xeb, 0x7a, 0xb9, 0xcd, 0x22, 0x9e, 0xbf, 0x1a, 0xe0, 0x8d, 0x0b, 0xf6, 0x17, 0x7c, + 0x1b, 0xe4, 0x02, 0xde, 0x4b, 0x56, 0xf0, 0x42, 0x14, 0x9a, 0xb9, 0x67, 0x68, 0x07, 0x29, 0x0c, + 0x1e, 0x82, 0x05, 0x11, 0xab, 0x40, 0x92, 0xf9, 0x27, 0x33, 0x3d, 0x6f, 0x52, 0x39, 0x9c, 0x72, + 0x14, 0x9a, 0x0b, 0x43, 0x74, 0x48, 0x09, 0x1b, 0xa0, 0xe8, 0x62, 0x27, 0xf0, 0x5a, 0x89, 0x6a, + 0x2d, 0x3a, 0x8b, 0xaa, 0x48, 0x5b, 0x9b, 0x31, 0x86, 0x52, 0xab, 0xd3, 0x38, 0x39, 0xab, 0xce, + 0xbd, 0x3a, 0xab, 0xce, 0x9d, 0x9e, 0x55, 0xe7, 0x7e, 0x8c, 0xaa, 0xc6, 0x49, 0x54, 0x35, 0x5e, + 0x45, 0x55, 0xe3, 0x34, 0xaa, 0x1a, 0x7f, 0x45, 0x55, 0xe3, 0xa7, 0xbf, 0xab, 0x73, 0xdf, 0xcd, + 0x0f, 0xd6, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x57, 0x91, 0x2c, 0x7b, 0xeb, 0x0e, 0x00, 0x00, +} + +func (m *MutatingWebhook) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MutatingWebhook) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MutatingWebhook) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ObjectSelector != nil { + { + size, err := m.ObjectSelector.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + if m.ReinvocationPolicy != nil { + i -= len(*m.ReinvocationPolicy) + copy(dAtA[i:], *m.ReinvocationPolicy) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ReinvocationPolicy))) + i-- + dAtA[i] = 0x52 + } + if m.MatchPolicy != nil { + i -= len(*m.MatchPolicy) + copy(dAtA[i:], *m.MatchPolicy) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.MatchPolicy))) + i-- + dAtA[i] = 0x4a + } + if len(m.AdmissionReviewVersions) > 0 { + for iNdEx := len(m.AdmissionReviewVersions) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AdmissionReviewVersions[iNdEx]) + copy(dAtA[i:], m.AdmissionReviewVersions[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.AdmissionReviewVersions[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } + if m.TimeoutSeconds != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.TimeoutSeconds)) + i-- + dAtA[i] = 0x38 + } + if m.SideEffects != nil { + i -= len(*m.SideEffects) + copy(dAtA[i:], *m.SideEffects) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.SideEffects))) + i-- + dAtA[i] = 0x32 + } + if m.NamespaceSelector != nil { + { + size, err := m.NamespaceSelector.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.FailurePolicy != nil { + i -= len(*m.FailurePolicy) + copy(dAtA[i:], *m.FailurePolicy) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.FailurePolicy))) + i-- + dAtA[i] = 0x22 + } + if len(m.Rules) > 0 { + for iNdEx := len(m.Rules) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Rules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + { + size, err := m.ClientConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *MutatingWebhookConfiguration) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MutatingWebhookConfiguration) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MutatingWebhookConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Webhooks) > 0 { + for iNdEx := len(m.Webhooks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Webhooks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *MutatingWebhookConfigurationList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MutatingWebhookConfigurationList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MutatingWebhookConfigurationList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Rule) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Rule) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Rule) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Scope != nil { + i -= len(*m.Scope) + copy(dAtA[i:], *m.Scope) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Scope))) + i-- + dAtA[i] = 0x22 + } + if len(m.Resources) > 0 { + for iNdEx := len(m.Resources) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Resources[iNdEx]) + copy(dAtA[i:], m.Resources[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Resources[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.APIVersions) > 0 { + for iNdEx := len(m.APIVersions) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.APIVersions[iNdEx]) + copy(dAtA[i:], m.APIVersions[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.APIVersions[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.APIGroups) > 0 { + for iNdEx := len(m.APIGroups) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.APIGroups[iNdEx]) + copy(dAtA[i:], m.APIGroups[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.APIGroups[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *RuleWithOperations) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RuleWithOperations) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RuleWithOperations) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Rule.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Operations) > 0 { + for iNdEx := len(m.Operations) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Operations[iNdEx]) + copy(dAtA[i:], m.Operations[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Operations[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ServiceReference) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ServiceReference) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Port != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Port)) + i-- + dAtA[i] = 0x20 + } + if m.Path != nil { + i -= len(*m.Path) + copy(dAtA[i:], *m.Path) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Path))) + i-- + dAtA[i] = 0x1a + } + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + i -= len(m.Namespace) + copy(dAtA[i:], m.Namespace) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Namespace))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ValidatingWebhook) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ValidatingWebhook) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatingWebhook) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ObjectSelector != nil { + { + size, err := m.ObjectSelector.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if m.MatchPolicy != nil { + i -= len(*m.MatchPolicy) + copy(dAtA[i:], *m.MatchPolicy) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.MatchPolicy))) + i-- + dAtA[i] = 0x4a + } + if len(m.AdmissionReviewVersions) > 0 { + for iNdEx := len(m.AdmissionReviewVersions) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AdmissionReviewVersions[iNdEx]) + copy(dAtA[i:], m.AdmissionReviewVersions[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.AdmissionReviewVersions[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } + if m.TimeoutSeconds != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.TimeoutSeconds)) + i-- + dAtA[i] = 0x38 + } + if m.SideEffects != nil { + i -= len(*m.SideEffects) + copy(dAtA[i:], *m.SideEffects) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.SideEffects))) + i-- + dAtA[i] = 0x32 + } + if m.NamespaceSelector != nil { + { + size, err := m.NamespaceSelector.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.FailurePolicy != nil { + i -= len(*m.FailurePolicy) + copy(dAtA[i:], *m.FailurePolicy) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.FailurePolicy))) + i-- + dAtA[i] = 0x22 + } + if len(m.Rules) > 0 { + for iNdEx := len(m.Rules) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Rules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + { + size, err := m.ClientConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ValidatingWebhookConfiguration) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ValidatingWebhookConfiguration) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatingWebhookConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Webhooks) > 0 { + for iNdEx := len(m.Webhooks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Webhooks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ValidatingWebhookConfigurationList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ValidatingWebhookConfigurationList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatingWebhookConfigurationList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *WebhookClientConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WebhookClientConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WebhookClientConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.URL != nil { + i -= len(*m.URL) + copy(dAtA[i:], *m.URL) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.URL))) + i-- + dAtA[i] = 0x1a + } + if m.CABundle != nil { + i -= len(m.CABundle) + copy(dAtA[i:], m.CABundle) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.CABundle))) + i-- + dAtA[i] = 0x12 + } + if m.Service != nil { + { + size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { + offset -= sovGenerated(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MutatingWebhook) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + l = m.ClientConfig.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Rules) > 0 { + for _, e := range m.Rules { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.FailurePolicy != nil { + l = len(*m.FailurePolicy) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.NamespaceSelector != nil { + l = m.NamespaceSelector.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.SideEffects != nil { + l = len(*m.SideEffects) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.TimeoutSeconds != nil { + n += 1 + sovGenerated(uint64(*m.TimeoutSeconds)) + } + if len(m.AdmissionReviewVersions) > 0 { + for _, s := range m.AdmissionReviewVersions { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.MatchPolicy != nil { + l = len(*m.MatchPolicy) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ReinvocationPolicy != nil { + l = len(*m.ReinvocationPolicy) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ObjectSelector != nil { + l = m.ObjectSelector.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *MutatingWebhookConfiguration) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Webhooks) > 0 { + for _, e := range m.Webhooks { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *MutatingWebhookConfigurationList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *Rule) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.APIGroups) > 0 { + for _, s := range m.APIGroups { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.APIVersions) > 0 { + for _, s := range m.APIVersions { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Resources) > 0 { + for _, s := range m.Resources { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.Scope != nil { + l = len(*m.Scope) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *RuleWithOperations) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Operations) > 0 { + for _, s := range m.Operations { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = m.Rule.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *ServiceReference) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Namespace) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + if m.Path != nil { + l = len(*m.Path) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Port != nil { + n += 1 + sovGenerated(uint64(*m.Port)) + } + return n +} + +func (m *ValidatingWebhook) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + l = m.ClientConfig.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Rules) > 0 { + for _, e := range m.Rules { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.FailurePolicy != nil { + l = len(*m.FailurePolicy) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.NamespaceSelector != nil { + l = m.NamespaceSelector.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.SideEffects != nil { + l = len(*m.SideEffects) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.TimeoutSeconds != nil { + n += 1 + sovGenerated(uint64(*m.TimeoutSeconds)) + } + if len(m.AdmissionReviewVersions) > 0 { + for _, s := range m.AdmissionReviewVersions { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.MatchPolicy != nil { + l = len(*m.MatchPolicy) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ObjectSelector != nil { + l = m.ObjectSelector.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *ValidatingWebhookConfiguration) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Webhooks) > 0 { + for _, e := range m.Webhooks { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *ValidatingWebhookConfigurationList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *WebhookClientConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Service != nil { + l = m.Service.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.CABundle != nil { + l = len(m.CABundle) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.URL != nil { + l = len(*m.URL) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func sovGenerated(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenerated(x uint64) (n int) { + return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *MutatingWebhook) String() string { + if this == nil { + return "nil" + } + repeatedStringForRules := "[]RuleWithOperations{" + for _, f := range this.Rules { + repeatedStringForRules += strings.Replace(strings.Replace(f.String(), "RuleWithOperations", "RuleWithOperations", 1), `&`, ``, 1) + "," + } + repeatedStringForRules += "}" + s := strings.Join([]string{`&MutatingWebhook{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `ClientConfig:` + strings.Replace(strings.Replace(this.ClientConfig.String(), "WebhookClientConfig", "WebhookClientConfig", 1), `&`, ``, 1) + `,`, + `Rules:` + repeatedStringForRules + `,`, + `FailurePolicy:` + valueToStringGenerated(this.FailurePolicy) + `,`, + `NamespaceSelector:` + strings.Replace(fmt.Sprintf("%v", this.NamespaceSelector), "LabelSelector", "v1.LabelSelector", 1) + `,`, + `SideEffects:` + valueToStringGenerated(this.SideEffects) + `,`, + `TimeoutSeconds:` + valueToStringGenerated(this.TimeoutSeconds) + `,`, + `AdmissionReviewVersions:` + fmt.Sprintf("%v", this.AdmissionReviewVersions) + `,`, + `MatchPolicy:` + valueToStringGenerated(this.MatchPolicy) + `,`, + `ReinvocationPolicy:` + valueToStringGenerated(this.ReinvocationPolicy) + `,`, + `ObjectSelector:` + strings.Replace(fmt.Sprintf("%v", this.ObjectSelector), "LabelSelector", "v1.LabelSelector", 1) + `,`, + `}`, + }, "") + return s +} +func (this *MutatingWebhookConfiguration) String() string { + if this == nil { + return "nil" + } + repeatedStringForWebhooks := "[]MutatingWebhook{" + for _, f := range this.Webhooks { + repeatedStringForWebhooks += strings.Replace(strings.Replace(f.String(), "MutatingWebhook", "MutatingWebhook", 1), `&`, ``, 1) + "," + } + repeatedStringForWebhooks += "}" + s := strings.Join([]string{`&MutatingWebhookConfiguration{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Webhooks:` + repeatedStringForWebhooks + `,`, + `}`, + }, "") + return s +} +func (this *MutatingWebhookConfigurationList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]MutatingWebhookConfiguration{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "MutatingWebhookConfiguration", "MutatingWebhookConfiguration", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&MutatingWebhookConfigurationList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *Rule) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Rule{`, + `APIGroups:` + fmt.Sprintf("%v", this.APIGroups) + `,`, + `APIVersions:` + fmt.Sprintf("%v", this.APIVersions) + `,`, + `Resources:` + fmt.Sprintf("%v", this.Resources) + `,`, + `Scope:` + valueToStringGenerated(this.Scope) + `,`, + `}`, + }, "") + return s +} +func (this *RuleWithOperations) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&RuleWithOperations{`, + `Operations:` + fmt.Sprintf("%v", this.Operations) + `,`, + `Rule:` + strings.Replace(strings.Replace(this.Rule.String(), "Rule", "Rule", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *ServiceReference) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ServiceReference{`, + `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Path:` + valueToStringGenerated(this.Path) + `,`, + `Port:` + valueToStringGenerated(this.Port) + `,`, + `}`, + }, "") + return s +} +func (this *ValidatingWebhook) String() string { + if this == nil { + return "nil" + } + repeatedStringForRules := "[]RuleWithOperations{" + for _, f := range this.Rules { + repeatedStringForRules += strings.Replace(strings.Replace(f.String(), "RuleWithOperations", "RuleWithOperations", 1), `&`, ``, 1) + "," + } + repeatedStringForRules += "}" + s := strings.Join([]string{`&ValidatingWebhook{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `ClientConfig:` + strings.Replace(strings.Replace(this.ClientConfig.String(), "WebhookClientConfig", "WebhookClientConfig", 1), `&`, ``, 1) + `,`, + `Rules:` + repeatedStringForRules + `,`, + `FailurePolicy:` + valueToStringGenerated(this.FailurePolicy) + `,`, + `NamespaceSelector:` + strings.Replace(fmt.Sprintf("%v", this.NamespaceSelector), "LabelSelector", "v1.LabelSelector", 1) + `,`, + `SideEffects:` + valueToStringGenerated(this.SideEffects) + `,`, + `TimeoutSeconds:` + valueToStringGenerated(this.TimeoutSeconds) + `,`, + `AdmissionReviewVersions:` + fmt.Sprintf("%v", this.AdmissionReviewVersions) + `,`, + `MatchPolicy:` + valueToStringGenerated(this.MatchPolicy) + `,`, + `ObjectSelector:` + strings.Replace(fmt.Sprintf("%v", this.ObjectSelector), "LabelSelector", "v1.LabelSelector", 1) + `,`, + `}`, + }, "") + return s +} +func (this *ValidatingWebhookConfiguration) String() string { + if this == nil { + return "nil" + } + repeatedStringForWebhooks := "[]ValidatingWebhook{" + for _, f := range this.Webhooks { + repeatedStringForWebhooks += strings.Replace(strings.Replace(f.String(), "ValidatingWebhook", "ValidatingWebhook", 1), `&`, ``, 1) + "," + } + repeatedStringForWebhooks += "}" + s := strings.Join([]string{`&ValidatingWebhookConfiguration{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Webhooks:` + repeatedStringForWebhooks + `,`, + `}`, + }, "") + return s +} +func (this *ValidatingWebhookConfigurationList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]ValidatingWebhookConfiguration{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "ValidatingWebhookConfiguration", "ValidatingWebhookConfiguration", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&ValidatingWebhookConfigurationList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *WebhookClientConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WebhookClientConfig{`, + `Service:` + strings.Replace(this.Service.String(), "ServiceReference", "ServiceReference", 1) + `,`, + `CABundle:` + valueToStringGenerated(this.CABundle) + `,`, + `URL:` + valueToStringGenerated(this.URL) + `,`, + `}`, + }, "") + return s +} +func valueToStringGenerated(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *MutatingWebhook) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MutatingWebhook: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MutatingWebhook: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientConfig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ClientConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rules", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rules = append(m.Rules, RuleWithOperations{}) + if err := m.Rules[len(m.Rules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FailurePolicy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := FailurePolicyType(dAtA[iNdEx:postIndex]) + m.FailurePolicy = &s + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NamespaceSelector", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NamespaceSelector == nil { + m.NamespaceSelector = &v1.LabelSelector{} + } + if err := m.NamespaceSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SideEffects", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := SideEffectClass(dAtA[iNdEx:postIndex]) + m.SideEffects = &s + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutSeconds", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TimeoutSeconds = &v + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AdmissionReviewVersions", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AdmissionReviewVersions = append(m.AdmissionReviewVersions, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MatchPolicy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := MatchPolicyType(dAtA[iNdEx:postIndex]) + m.MatchPolicy = &s + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReinvocationPolicy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := ReinvocationPolicyType(dAtA[iNdEx:postIndex]) + m.ReinvocationPolicy = &s + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectSelector", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ObjectSelector == nil { + m.ObjectSelector = &v1.LabelSelector{} + } + if err := m.ObjectSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MutatingWebhookConfiguration) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MutatingWebhookConfiguration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MutatingWebhookConfiguration: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Webhooks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Webhooks = append(m.Webhooks, MutatingWebhook{}) + if err := m.Webhooks[len(m.Webhooks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MutatingWebhookConfigurationList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MutatingWebhookConfigurationList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MutatingWebhookConfigurationList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, MutatingWebhookConfiguration{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Rule) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Rule: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Rule: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field APIGroups", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.APIGroups = append(m.APIGroups, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field APIVersions", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.APIVersions = append(m.APIVersions, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resources = append(m.Resources, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Scope", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := ScopeType(dAtA[iNdEx:postIndex]) + m.Scope = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RuleWithOperations) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RuleWithOperations: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RuleWithOperations: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operations", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operations = append(m.Operations, OperationType(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rule", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Rule.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ServiceReference) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ServiceReference: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ServiceReference: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Namespace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Path = &s + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Port = &v + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatingWebhook) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ValidatingWebhook: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatingWebhook: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientConfig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ClientConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rules", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rules = append(m.Rules, RuleWithOperations{}) + if err := m.Rules[len(m.Rules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FailurePolicy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := FailurePolicyType(dAtA[iNdEx:postIndex]) + m.FailurePolicy = &s + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NamespaceSelector", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NamespaceSelector == nil { + m.NamespaceSelector = &v1.LabelSelector{} + } + if err := m.NamespaceSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SideEffects", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := SideEffectClass(dAtA[iNdEx:postIndex]) + m.SideEffects = &s + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutSeconds", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TimeoutSeconds = &v + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AdmissionReviewVersions", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AdmissionReviewVersions = append(m.AdmissionReviewVersions, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MatchPolicy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := MatchPolicyType(dAtA[iNdEx:postIndex]) + m.MatchPolicy = &s + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectSelector", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ObjectSelector == nil { + m.ObjectSelector = &v1.LabelSelector{} + } + if err := m.ObjectSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatingWebhookConfiguration) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ValidatingWebhookConfiguration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatingWebhookConfiguration: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Webhooks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Webhooks = append(m.Webhooks, ValidatingWebhook{}) + if err := m.Webhooks[len(m.Webhooks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatingWebhookConfigurationList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ValidatingWebhookConfigurationList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatingWebhookConfigurationList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, ValidatingWebhookConfiguration{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WebhookClientConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WebhookClientConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WebhookClientConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Service == nil { + m.Service = &ServiceReference{} + } + if err := m.Service.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CABundle", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CABundle = append(m.CABundle[:0], dAtA[iNdEx:postIndex]...) + if m.CABundle == nil { + m.CABundle = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.URL = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenerated(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenerated + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthGenerated + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipGenerated(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthGenerated + } + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") +) diff --git a/vendor/k8s.io/api/admissionregistration/v1/register.go b/vendor/k8s.io/api/admissionregistration/v1/register.go new file mode 100644 index 0000000..716ce7f --- /dev/null +++ b/vendor/k8s.io/api/admissionregistration/v1/register.go @@ -0,0 +1,53 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +const GroupName = "admissionregistration.k8s.io" + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + // TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api. + // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + localSchemeBuilder = &SchemeBuilder + AddToScheme = localSchemeBuilder.AddToScheme +) + +// Adds the list of known types to scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &ValidatingWebhookConfiguration{}, + &ValidatingWebhookConfigurationList{}, + &MutatingWebhookConfiguration{}, + &MutatingWebhookConfigurationList{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/vendor/k8s.io/api/admissionregistration/v1/types.go b/vendor/k8s.io/api/admissionregistration/v1/types.go new file mode 100644 index 0000000..114a4c6 --- /dev/null +++ b/vendor/k8s.io/api/admissionregistration/v1/types.go @@ -0,0 +1,551 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended +// to make sure that all the tuple expansions are valid. +type Rule struct { + // APIGroups is the API groups the resources belong to. '*' is all groups. + // If '*' is present, the length of the slice must be one. + // Required. + APIGroups []string `json:"apiGroups,omitempty" protobuf:"bytes,1,rep,name=apiGroups"` + + // APIVersions is the API versions the resources belong to. '*' is all versions. + // If '*' is present, the length of the slice must be one. + // Required. + APIVersions []string `json:"apiVersions,omitempty" protobuf:"bytes,2,rep,name=apiVersions"` + + // Resources is a list of resources this rule applies to. + // + // For example: + // 'pods' means pods. + // 'pods/log' means the log subresource of pods. + // '*' means all resources, but not subresources. + // 'pods/*' means all subresources of pods. + // '*/scale' means all scale subresources. + // '*/*' means all resources and their subresources. + // + // If wildcard is present, the validation rule will ensure resources do not + // overlap with each other. + // + // Depending on the enclosing object, subresources might not be allowed. + // Required. + Resources []string `json:"resources,omitempty" protobuf:"bytes,3,rep,name=resources"` + + // scope specifies the scope of this rule. + // Valid values are "Cluster", "Namespaced", and "*" + // "Cluster" means that only cluster-scoped resources will match this rule. + // Namespace API objects are cluster-scoped. + // "Namespaced" means that only namespaced resources will match this rule. + // "*" means that there are no scope restrictions. + // Subresources match the scope of their parent resource. + // Default is "*". + // + // +optional + Scope *ScopeType `json:"scope,omitempty" protobuf:"bytes,4,rep,name=scope"` +} + +type ScopeType string + +const ( + // ClusterScope means that scope is limited to cluster-scoped objects. + // Namespace objects are cluster-scoped. + ClusterScope ScopeType = "Cluster" + // NamespacedScope means that scope is limited to namespaced objects. + NamespacedScope ScopeType = "Namespaced" + // AllScopes means that all scopes are included. + AllScopes ScopeType = "*" +) + +type FailurePolicyType string + +const ( + // Ignore means that an error calling the webhook is ignored. + Ignore FailurePolicyType = "Ignore" + // Fail means that an error calling the webhook causes the admission to fail. + Fail FailurePolicyType = "Fail" +) + +// MatchPolicyType specifies the type of match policy +type MatchPolicyType string + +const ( + // Exact means requests should only be sent to the webhook if they exactly match a given rule + Exact MatchPolicyType = "Exact" + // Equivalent means requests should be sent to the webhook if they modify a resource listed in rules via another API group or version. + Equivalent MatchPolicyType = "Equivalent" +) + +type SideEffectClass string + +const ( + // SideEffectClassUnknown means that no information is known about the side effects of calling the webhook. + // If a request with the dry-run attribute would trigger a call to this webhook, the request will instead fail. + SideEffectClassUnknown SideEffectClass = "Unknown" + // SideEffectClassNone means that calling the webhook will have no side effects. + SideEffectClassNone SideEffectClass = "None" + // SideEffectClassSome means that calling the webhook will possibly have side effects. + // If a request with the dry-run attribute would trigger a call to this webhook, the request will instead fail. + SideEffectClassSome SideEffectClass = "Some" + // SideEffectClassNoneOnDryRun means that calling the webhook will possibly have side effects, but if the + // request being reviewed has the dry-run attribute, the side effects will be suppressed. + SideEffectClassNoneOnDryRun SideEffectClass = "NoneOnDryRun" +) + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ValidatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and object without changing it. +type ValidatingWebhookConfiguration struct { + metav1.TypeMeta `json:",inline"` + // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + // Webhooks is a list of webhooks and the affected resources and operations. + // +optional + // +patchMergeKey=name + // +patchStrategy=merge + Webhooks []ValidatingWebhook `json:"webhooks,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,2,rep,name=Webhooks"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ValidatingWebhookConfigurationList is a list of ValidatingWebhookConfiguration. +type ValidatingWebhookConfigurationList struct { + metav1.TypeMeta `json:",inline"` + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + // List of ValidatingWebhookConfiguration. + Items []ValidatingWebhookConfiguration `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// MutatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and may change the object. +type MutatingWebhookConfiguration struct { + metav1.TypeMeta `json:",inline"` + // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + // Webhooks is a list of webhooks and the affected resources and operations. + // +optional + // +patchMergeKey=name + // +patchStrategy=merge + Webhooks []MutatingWebhook `json:"webhooks,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,2,rep,name=Webhooks"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// MutatingWebhookConfigurationList is a list of MutatingWebhookConfiguration. +type MutatingWebhookConfigurationList struct { + metav1.TypeMeta `json:",inline"` + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + // List of MutatingWebhookConfiguration. + Items []MutatingWebhookConfiguration `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// ValidatingWebhook describes an admission webhook and the resources and operations it applies to. +type ValidatingWebhook struct { + // The name of the admission webhook. + // Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where + // "imagepolicy" is the name of the webhook, and kubernetes.io is the name + // of the organization. + // Required. + Name string `json:"name" protobuf:"bytes,1,opt,name=name"` + + // ClientConfig defines how to communicate with the hook. + // Required + ClientConfig WebhookClientConfig `json:"clientConfig" protobuf:"bytes,2,opt,name=clientConfig"` + + // Rules describes what operations on what resources/subresources the webhook cares about. + // The webhook cares about an operation if it matches _any_ Rule. + // However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks + // from putting the cluster in a state which cannot be recovered from without completely + // disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called + // on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects. + Rules []RuleWithOperations `json:"rules,omitempty" protobuf:"bytes,3,rep,name=rules"` + + // FailurePolicy defines how unrecognized errors from the admission endpoint are handled - + // allowed values are Ignore or Fail. Defaults to Fail. + // +optional + FailurePolicy *FailurePolicyType `json:"failurePolicy,omitempty" protobuf:"bytes,4,opt,name=failurePolicy,casttype=FailurePolicyType"` + + // matchPolicy defines how the "rules" list is used to match incoming requests. + // Allowed values are "Exact" or "Equivalent". + // + // - Exact: match a request only if it exactly matches a specified rule. + // For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, + // but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, + // a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook. + // + // - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. + // For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, + // and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, + // a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook. + // + // Defaults to "Equivalent" + // +optional + MatchPolicy *MatchPolicyType `json:"matchPolicy,omitempty" protobuf:"bytes,9,opt,name=matchPolicy,casttype=MatchPolicyType"` + + // NamespaceSelector decides whether to run the webhook on an object based + // on whether the namespace for that object matches the selector. If the + // object itself is a namespace, the matching is performed on + // object.metadata.labels. If the object is another cluster scoped resource, + // it never skips the webhook. + // + // For example, to run the webhook on any objects whose namespace is not + // associated with "runlevel" of "0" or "1"; you will set the selector as + // follows: + // "namespaceSelector": { + // "matchExpressions": [ + // { + // "key": "runlevel", + // "operator": "NotIn", + // "values": [ + // "0", + // "1" + // ] + // } + // ] + // } + // + // If instead you want to only run the webhook on any objects whose + // namespace is associated with the "environment" of "prod" or "staging"; + // you will set the selector as follows: + // "namespaceSelector": { + // "matchExpressions": [ + // { + // "key": "environment", + // "operator": "In", + // "values": [ + // "prod", + // "staging" + // ] + // } + // ] + // } + // + // See + // https://kubernetes.io/docs/concepts/overview/working-with-objects/labels + // for more examples of label selectors. + // + // Default to the empty LabelSelector, which matches everything. + // +optional + NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty" protobuf:"bytes,5,opt,name=namespaceSelector"` + + // ObjectSelector decides whether to run the webhook based on if the + // object has matching labels. objectSelector is evaluated against both + // the oldObject and newObject that would be sent to the webhook, and + // is considered to match if either object matches the selector. A null + // object (oldObject in the case of create, or newObject in the case of + // delete) or an object that cannot have labels (like a + // DeploymentRollback or a PodProxyOptions object) is not considered to + // match. + // Use the object selector only if the webhook is opt-in, because end + // users may skip the admission webhook by setting the labels. + // Default to the empty LabelSelector, which matches everything. + // +optional + ObjectSelector *metav1.LabelSelector `json:"objectSelector,omitempty" protobuf:"bytes,10,opt,name=objectSelector"` + + // SideEffects states whether this webhook has side effects. + // Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown). + // Webhooks with side effects MUST implement a reconciliation system, since a request may be + // rejected by a future step in the admission change and the side effects therefore need to be undone. + // Requests with the dryRun attribute will be auto-rejected if they match a webhook with + // sideEffects == Unknown or Some. + SideEffects *SideEffectClass `json:"sideEffects" protobuf:"bytes,6,opt,name=sideEffects,casttype=SideEffectClass"` + + // TimeoutSeconds specifies the timeout for this webhook. After the timeout passes, + // the webhook call will be ignored or the API call will fail based on the + // failure policy. + // The timeout value must be between 1 and 30 seconds. + // Default to 10 seconds. + // +optional + TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty" protobuf:"varint,7,opt,name=timeoutSeconds"` + + // AdmissionReviewVersions is an ordered list of preferred `AdmissionReview` + // versions the Webhook expects. API server will try to use first version in + // the list which it supports. If none of the versions specified in this list + // supported by API server, validation will fail for this object. + // If a persisted webhook configuration specifies allowed versions and does not + // include any versions known to the API Server, calls to the webhook will fail + // and be subject to the failure policy. + AdmissionReviewVersions []string `json:"admissionReviewVersions" protobuf:"bytes,8,rep,name=admissionReviewVersions"` +} + +// MutatingWebhook describes an admission webhook and the resources and operations it applies to. +type MutatingWebhook struct { + // The name of the admission webhook. + // Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where + // "imagepolicy" is the name of the webhook, and kubernetes.io is the name + // of the organization. + // Required. + Name string `json:"name" protobuf:"bytes,1,opt,name=name"` + + // ClientConfig defines how to communicate with the hook. + // Required + ClientConfig WebhookClientConfig `json:"clientConfig" protobuf:"bytes,2,opt,name=clientConfig"` + + // Rules describes what operations on what resources/subresources the webhook cares about. + // The webhook cares about an operation if it matches _any_ Rule. + // However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks + // from putting the cluster in a state which cannot be recovered from without completely + // disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called + // on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects. + Rules []RuleWithOperations `json:"rules,omitempty" protobuf:"bytes,3,rep,name=rules"` + + // FailurePolicy defines how unrecognized errors from the admission endpoint are handled - + // allowed values are Ignore or Fail. Defaults to Fail. + // +optional + FailurePolicy *FailurePolicyType `json:"failurePolicy,omitempty" protobuf:"bytes,4,opt,name=failurePolicy,casttype=FailurePolicyType"` + + // matchPolicy defines how the "rules" list is used to match incoming requests. + // Allowed values are "Exact" or "Equivalent". + // + // - Exact: match a request only if it exactly matches a specified rule. + // For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, + // but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, + // a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook. + // + // - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. + // For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, + // and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, + // a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook. + // + // Defaults to "Equivalent" + // +optional + MatchPolicy *MatchPolicyType `json:"matchPolicy,omitempty" protobuf:"bytes,9,opt,name=matchPolicy,casttype=MatchPolicyType"` + + // NamespaceSelector decides whether to run the webhook on an object based + // on whether the namespace for that object matches the selector. If the + // object itself is a namespace, the matching is performed on + // object.metadata.labels. If the object is another cluster scoped resource, + // it never skips the webhook. + // + // For example, to run the webhook on any objects whose namespace is not + // associated with "runlevel" of "0" or "1"; you will set the selector as + // follows: + // "namespaceSelector": { + // "matchExpressions": [ + // { + // "key": "runlevel", + // "operator": "NotIn", + // "values": [ + // "0", + // "1" + // ] + // } + // ] + // } + // + // If instead you want to only run the webhook on any objects whose + // namespace is associated with the "environment" of "prod" or "staging"; + // you will set the selector as follows: + // "namespaceSelector": { + // "matchExpressions": [ + // { + // "key": "environment", + // "operator": "In", + // "values": [ + // "prod", + // "staging" + // ] + // } + // ] + // } + // + // See + // https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + // for more examples of label selectors. + // + // Default to the empty LabelSelector, which matches everything. + // +optional + NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty" protobuf:"bytes,5,opt,name=namespaceSelector"` + + // ObjectSelector decides whether to run the webhook based on if the + // object has matching labels. objectSelector is evaluated against both + // the oldObject and newObject that would be sent to the webhook, and + // is considered to match if either object matches the selector. A null + // object (oldObject in the case of create, or newObject in the case of + // delete) or an object that cannot have labels (like a + // DeploymentRollback or a PodProxyOptions object) is not considered to + // match. + // Use the object selector only if the webhook is opt-in, because end + // users may skip the admission webhook by setting the labels. + // Default to the empty LabelSelector, which matches everything. + // +optional + ObjectSelector *metav1.LabelSelector `json:"objectSelector,omitempty" protobuf:"bytes,11,opt,name=objectSelector"` + + // SideEffects states whether this webhook has side effects. + // Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown). + // Webhooks with side effects MUST implement a reconciliation system, since a request may be + // rejected by a future step in the admission change and the side effects therefore need to be undone. + // Requests with the dryRun attribute will be auto-rejected if they match a webhook with + // sideEffects == Unknown or Some. + SideEffects *SideEffectClass `json:"sideEffects" protobuf:"bytes,6,opt,name=sideEffects,casttype=SideEffectClass"` + + // TimeoutSeconds specifies the timeout for this webhook. After the timeout passes, + // the webhook call will be ignored or the API call will fail based on the + // failure policy. + // The timeout value must be between 1 and 30 seconds. + // Default to 10 seconds. + // +optional + TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty" protobuf:"varint,7,opt,name=timeoutSeconds"` + + // AdmissionReviewVersions is an ordered list of preferred `AdmissionReview` + // versions the Webhook expects. API server will try to use first version in + // the list which it supports. If none of the versions specified in this list + // supported by API server, validation will fail for this object. + // If a persisted webhook configuration specifies allowed versions and does not + // include any versions known to the API Server, calls to the webhook will fail + // and be subject to the failure policy. + AdmissionReviewVersions []string `json:"admissionReviewVersions" protobuf:"bytes,8,rep,name=admissionReviewVersions"` + + // reinvocationPolicy indicates whether this webhook should be called multiple times as part of a single admission evaluation. + // Allowed values are "Never" and "IfNeeded". + // + // Never: the webhook will not be called more than once in a single admission evaluation. + // + // IfNeeded: the webhook will be called at least one additional time as part of the admission evaluation + // if the object being admitted is modified by other admission plugins after the initial webhook call. + // Webhooks that specify this option *must* be idempotent, able to process objects they previously admitted. + // Note: + // * the number of additional invocations is not guaranteed to be exactly one. + // * if additional invocations result in further modifications to the object, webhooks are not guaranteed to be invoked again. + // * webhooks that use this option may be reordered to minimize the number of additional invocations. + // * to validate an object after all mutations are guaranteed complete, use a validating admission webhook instead. + // + // Defaults to "Never". + // +optional + ReinvocationPolicy *ReinvocationPolicyType `json:"reinvocationPolicy,omitempty" protobuf:"bytes,10,opt,name=reinvocationPolicy,casttype=ReinvocationPolicyType"` +} + +// ReinvocationPolicyType specifies what type of policy the admission hook uses. +type ReinvocationPolicyType string + +const ( + // NeverReinvocationPolicy indicates that the webhook must not be called more than once in a + // single admission evaluation. + NeverReinvocationPolicy ReinvocationPolicyType = "Never" + // IfNeededReinvocationPolicy indicates that the webhook may be called at least one + // additional time as part of the admission evaluation if the object being admitted is + // modified by other admission plugins after the initial webhook call. + IfNeededReinvocationPolicy ReinvocationPolicyType = "IfNeeded" +) + +// RuleWithOperations is a tuple of Operations and Resources. It is recommended to make +// sure that all the tuple expansions are valid. +type RuleWithOperations struct { + // Operations is the operations the admission hook cares about - CREATE, UPDATE, or * + // for all operations. + // If '*' is present, the length of the slice must be one. + // Required. + Operations []OperationType `json:"operations,omitempty" protobuf:"bytes,1,rep,name=operations,casttype=OperationType"` + // Rule is embedded, it describes other criteria of the rule, like + // APIGroups, APIVersions, Resources, etc. + Rule `json:",inline" protobuf:"bytes,2,opt,name=rule"` +} + +type OperationType string + +// The constants should be kept in sync with those defined in k8s.io/kubernetes/pkg/admission/interface.go. +const ( + OperationAll OperationType = "*" + Create OperationType = "CREATE" + Update OperationType = "UPDATE" + Delete OperationType = "DELETE" + Connect OperationType = "CONNECT" +) + +// WebhookClientConfig contains the information to make a TLS +// connection with the webhook +type WebhookClientConfig struct { + // `url` gives the location of the webhook, in standard URL form + // (`scheme://host:port/path`). Exactly one of `url` or `service` + // must be specified. + // + // The `host` should not refer to a service running in the cluster; use + // the `service` field instead. The host might be resolved via external + // DNS in some apiservers (e.g., `kube-apiserver` cannot resolve + // in-cluster DNS as that would be a layering violation). `host` may + // also be an IP address. + // + // Please note that using `localhost` or `127.0.0.1` as a `host` is + // risky unless you take great care to run this webhook on all hosts + // which run an apiserver which might need to make calls to this + // webhook. Such installs are likely to be non-portable, i.e., not easy + // to turn up in a new cluster. + // + // The scheme must be "https"; the URL must begin with "https://". + // + // A path is optional, and if present may be any string permissible in + // a URL. You may use the path to pass an arbitrary string to the + // webhook, for example, a cluster identifier. + // + // Attempting to use a user or basic auth e.g. "user:password@" is not + // allowed. Fragments ("#...") and query parameters ("?...") are not + // allowed, either. + // + // +optional + URL *string `json:"url,omitempty" protobuf:"bytes,3,opt,name=url"` + + // `service` is a reference to the service for this webhook. Either + // `service` or `url` must be specified. + // + // If the webhook is running within the cluster, then you should use `service`. + // + // +optional + Service *ServiceReference `json:"service,omitempty" protobuf:"bytes,1,opt,name=service"` + + // `caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. + // If unspecified, system trust roots on the apiserver are used. + // +optional + CABundle []byte `json:"caBundle,omitempty" protobuf:"bytes,2,opt,name=caBundle"` +} + +// ServiceReference holds a reference to Service.legacy.k8s.io +type ServiceReference struct { + // `namespace` is the namespace of the service. + // Required + Namespace string `json:"namespace" protobuf:"bytes,1,opt,name=namespace"` + // `name` is the name of the service. + // Required + Name string `json:"name" protobuf:"bytes,2,opt,name=name"` + + // `path` is an optional URL path which will be sent in any request to + // this service. + // +optional + Path *string `json:"path,omitempty" protobuf:"bytes,3,opt,name=path"` + + // If specified, the port on the service that hosting webhook. + // Default to 443 for backward compatibility. + // `port` should be a valid port number (1-65535, inclusive). + // +optional + Port *int32 `json:"port,omitempty" protobuf:"varint,4,opt,name=port"` +} diff --git a/vendor/k8s.io/api/admissionregistration/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/admissionregistration/v1/types_swagger_doc_generated.go new file mode 100644 index 0000000..2fde0ce --- /dev/null +++ b/vendor/k8s.io/api/admissionregistration/v1/types_swagger_doc_generated.go @@ -0,0 +1,151 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +// This file contains a collection of methods that can be used from go-restful to +// generate Swagger API documentation for its models. Please read this PR for more +// information on the implementation: https://github.com/emicklei/go-restful/pull/215 +// +// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if +// they are on one line! For multiple line or blocks that you want to ignore use ---. +// Any context after a --- is ignored. +// +// Those methods can be generated by using hack/update-generated-swagger-docs.sh + +// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. +var map_MutatingWebhook = map[string]string{ + "": "MutatingWebhook describes an admission webhook and the resources and operations it applies to.", + "name": "The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where \"imagepolicy\" is the name of the webhook, and kubernetes.io is the name of the organization. Required.", + "clientConfig": "ClientConfig defines how to communicate with the hook. Required", + "rules": "Rules describes what operations on what resources/subresources the webhook cares about. The webhook cares about an operation if it matches _any_ Rule. However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks from putting the cluster in a state which cannot be recovered from without completely disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects.", + "failurePolicy": "FailurePolicy defines how unrecognized errors from the admission endpoint are handled - allowed values are Ignore or Fail. Defaults to Fail.", + "matchPolicy": "matchPolicy defines how the \"rules\" list is used to match incoming requests. Allowed values are \"Exact\" or \"Equivalent\".\n\n- Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.\n\n- Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.\n\nDefaults to \"Equivalent\"", + "namespaceSelector": "NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the webhook.\n\nFor example, to run the webhook on any objects whose namespace is not associated with \"runlevel\" of \"0\" or \"1\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"runlevel\",\n \"operator\": \"NotIn\",\n \"values\": [\n \"0\",\n \"1\"\n ]\n }\n ]\n}\n\nIf instead you want to only run the webhook on any objects whose namespace is associated with the \"environment\" of \"prod\" or \"staging\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"environment\",\n \"operator\": \"In\",\n \"values\": [\n \"prod\",\n \"staging\"\n ]\n }\n ]\n}\n\nSee https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.\n\nDefault to the empty LabelSelector, which matches everything.", + "objectSelector": "ObjectSelector decides whether to run the webhook based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the webhook, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.", + "sideEffects": "SideEffects states whether this webhook has side effects. Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown). Webhooks with side effects MUST implement a reconciliation system, since a request may be rejected by a future step in the admission change and the side effects therefore need to be undone. Requests with the dryRun attribute will be auto-rejected if they match a webhook with sideEffects == Unknown or Some.", + "timeoutSeconds": "TimeoutSeconds specifies the timeout for this webhook. After the timeout passes, the webhook call will be ignored or the API call will fail based on the failure policy. The timeout value must be between 1 and 30 seconds. Default to 10 seconds.", + "admissionReviewVersions": "AdmissionReviewVersions is an ordered list of preferred `AdmissionReview` versions the Webhook expects. API server will try to use first version in the list which it supports. If none of the versions specified in this list supported by API server, validation will fail for this object. If a persisted webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail and be subject to the failure policy.", + "reinvocationPolicy": "reinvocationPolicy indicates whether this webhook should be called multiple times as part of a single admission evaluation. Allowed values are \"Never\" and \"IfNeeded\".\n\nNever: the webhook will not be called more than once in a single admission evaluation.\n\nIfNeeded: the webhook will be called at least one additional time as part of the admission evaluation if the object being admitted is modified by other admission plugins after the initial webhook call. Webhooks that specify this option *must* be idempotent, able to process objects they previously admitted. Note: * the number of additional invocations is not guaranteed to be exactly one. * if additional invocations result in further modifications to the object, webhooks are not guaranteed to be invoked again. * webhooks that use this option may be reordered to minimize the number of additional invocations. * to validate an object after all mutations are guaranteed complete, use a validating admission webhook instead.\n\nDefaults to \"Never\".", +} + +func (MutatingWebhook) SwaggerDoc() map[string]string { + return map_MutatingWebhook +} + +var map_MutatingWebhookConfiguration = map[string]string{ + "": "MutatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and may change the object.", + "metadata": "Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.", + "webhooks": "Webhooks is a list of webhooks and the affected resources and operations.", +} + +func (MutatingWebhookConfiguration) SwaggerDoc() map[string]string { + return map_MutatingWebhookConfiguration +} + +var map_MutatingWebhookConfigurationList = map[string]string{ + "": "MutatingWebhookConfigurationList is a list of MutatingWebhookConfiguration.", + "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + "items": "List of MutatingWebhookConfiguration.", +} + +func (MutatingWebhookConfigurationList) SwaggerDoc() map[string]string { + return map_MutatingWebhookConfigurationList +} + +var map_Rule = map[string]string{ + "": "Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended to make sure that all the tuple expansions are valid.", + "apiGroups": "APIGroups is the API groups the resources belong to. '*' is all groups. If '*' is present, the length of the slice must be one. Required.", + "apiVersions": "APIVersions is the API versions the resources belong to. '*' is all versions. If '*' is present, the length of the slice must be one. Required.", + "resources": "Resources is a list of resources this rule applies to.\n\nFor example: 'pods' means pods. 'pods/log' means the log subresource of pods. '*' means all resources, but not subresources. 'pods/*' means all subresources of pods. '*/scale' means all scale subresources. '*/*' means all resources and their subresources.\n\nIf wildcard is present, the validation rule will ensure resources do not overlap with each other.\n\nDepending on the enclosing object, subresources might not be allowed. Required.", + "scope": "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".", +} + +func (Rule) SwaggerDoc() map[string]string { + return map_Rule +} + +var map_RuleWithOperations = map[string]string{ + "": "RuleWithOperations is a tuple of Operations and Resources. It is recommended to make sure that all the tuple expansions are valid.", + "operations": "Operations is the operations the admission hook cares about - CREATE, UPDATE, or * for all operations. If '*' is present, the length of the slice must be one. Required.", +} + +func (RuleWithOperations) SwaggerDoc() map[string]string { + return map_RuleWithOperations +} + +var map_ServiceReference = map[string]string{ + "": "ServiceReference holds a reference to Service.legacy.k8s.io", + "namespace": "`namespace` is the namespace of the service. Required", + "name": "`name` is the name of the service. Required", + "path": "`path` is an optional URL path which will be sent in any request to this service.", + "port": "If specified, the port on the service that hosting webhook. Default to 443 for backward compatibility. `port` should be a valid port number (1-65535, inclusive).", +} + +func (ServiceReference) SwaggerDoc() map[string]string { + return map_ServiceReference +} + +var map_ValidatingWebhook = map[string]string{ + "": "ValidatingWebhook describes an admission webhook and the resources and operations it applies to.", + "name": "The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where \"imagepolicy\" is the name of the webhook, and kubernetes.io is the name of the organization. Required.", + "clientConfig": "ClientConfig defines how to communicate with the hook. Required", + "rules": "Rules describes what operations on what resources/subresources the webhook cares about. The webhook cares about an operation if it matches _any_ Rule. However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks from putting the cluster in a state which cannot be recovered from without completely disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects.", + "failurePolicy": "FailurePolicy defines how unrecognized errors from the admission endpoint are handled - allowed values are Ignore or Fail. Defaults to Fail.", + "matchPolicy": "matchPolicy defines how the \"rules\" list is used to match incoming requests. Allowed values are \"Exact\" or \"Equivalent\".\n\n- Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.\n\n- Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.\n\nDefaults to \"Equivalent\"", + "namespaceSelector": "NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the webhook.\n\nFor example, to run the webhook on any objects whose namespace is not associated with \"runlevel\" of \"0\" or \"1\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"runlevel\",\n \"operator\": \"NotIn\",\n \"values\": [\n \"0\",\n \"1\"\n ]\n }\n ]\n}\n\nIf instead you want to only run the webhook on any objects whose namespace is associated with the \"environment\" of \"prod\" or \"staging\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"environment\",\n \"operator\": \"In\",\n \"values\": [\n \"prod\",\n \"staging\"\n ]\n }\n ]\n}\n\nSee https://kubernetes.io/docs/concepts/overview/working-with-objects/labels for more examples of label selectors.\n\nDefault to the empty LabelSelector, which matches everything.", + "objectSelector": "ObjectSelector decides whether to run the webhook based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the webhook, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.", + "sideEffects": "SideEffects states whether this webhook has side effects. Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown). Webhooks with side effects MUST implement a reconciliation system, since a request may be rejected by a future step in the admission change and the side effects therefore need to be undone. Requests with the dryRun attribute will be auto-rejected if they match a webhook with sideEffects == Unknown or Some.", + "timeoutSeconds": "TimeoutSeconds specifies the timeout for this webhook. After the timeout passes, the webhook call will be ignored or the API call will fail based on the failure policy. The timeout value must be between 1 and 30 seconds. Default to 10 seconds.", + "admissionReviewVersions": "AdmissionReviewVersions is an ordered list of preferred `AdmissionReview` versions the Webhook expects. API server will try to use first version in the list which it supports. If none of the versions specified in this list supported by API server, validation will fail for this object. If a persisted webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail and be subject to the failure policy.", +} + +func (ValidatingWebhook) SwaggerDoc() map[string]string { + return map_ValidatingWebhook +} + +var map_ValidatingWebhookConfiguration = map[string]string{ + "": "ValidatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and object without changing it.", + "metadata": "Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.", + "webhooks": "Webhooks is a list of webhooks and the affected resources and operations.", +} + +func (ValidatingWebhookConfiguration) SwaggerDoc() map[string]string { + return map_ValidatingWebhookConfiguration +} + +var map_ValidatingWebhookConfigurationList = map[string]string{ + "": "ValidatingWebhookConfigurationList is a list of ValidatingWebhookConfiguration.", + "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + "items": "List of ValidatingWebhookConfiguration.", +} + +func (ValidatingWebhookConfigurationList) SwaggerDoc() map[string]string { + return map_ValidatingWebhookConfigurationList +} + +var map_WebhookClientConfig = map[string]string{ + "": "WebhookClientConfig contains the information to make a TLS connection with the webhook", + "url": "`url` gives the location of the webhook, in standard URL form (`scheme://host:port/path`). Exactly one of `url` or `service` must be specified.\n\nThe `host` should not refer to a service running in the cluster; use the `service` field instead. The host might be resolved via external DNS in some apiservers (e.g., `kube-apiserver` cannot resolve in-cluster DNS as that would be a layering violation). `host` may also be an IP address.\n\nPlease note that using `localhost` or `127.0.0.1` as a `host` is risky unless you take great care to run this webhook on all hosts which run an apiserver which might need to make calls to this webhook. Such installs are likely to be non-portable, i.e., not easy to turn up in a new cluster.\n\nThe scheme must be \"https\"; the URL must begin with \"https://\".\n\nA path is optional, and if present may be any string permissible in a URL. You may use the path to pass an arbitrary string to the webhook, for example, a cluster identifier.\n\nAttempting to use a user or basic auth e.g. \"user:password@\" is not allowed. Fragments (\"#...\") and query parameters (\"?...\") are not allowed, either.", + "service": "`service` is a reference to the service for this webhook. Either `service` or `url` must be specified.\n\nIf the webhook is running within the cluster, then you should use `service`.", + "caBundle": "`caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. If unspecified, system trust roots on the apiserver are used.", +} + +func (WebhookClientConfig) SwaggerDoc() map[string]string { + return map_WebhookClientConfig +} + +// AUTO-GENERATED FUNCTIONS END HERE diff --git a/vendor/k8s.io/api/admissionregistration/v1/zz_generated.deepcopy.go b/vendor/k8s.io/api/admissionregistration/v1/zz_generated.deepcopy.go new file mode 100644 index 0000000..3afb746 --- /dev/null +++ b/vendor/k8s.io/api/admissionregistration/v1/zz_generated.deepcopy.go @@ -0,0 +1,396 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MutatingWebhook) DeepCopyInto(out *MutatingWebhook) { + *out = *in + in.ClientConfig.DeepCopyInto(&out.ClientConfig) + if in.Rules != nil { + in, out := &in.Rules, &out.Rules + *out = make([]RuleWithOperations, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.FailurePolicy != nil { + in, out := &in.FailurePolicy, &out.FailurePolicy + *out = new(FailurePolicyType) + **out = **in + } + if in.MatchPolicy != nil { + in, out := &in.MatchPolicy, &out.MatchPolicy + *out = new(MatchPolicyType) + **out = **in + } + if in.NamespaceSelector != nil { + in, out := &in.NamespaceSelector, &out.NamespaceSelector + *out = new(metav1.LabelSelector) + (*in).DeepCopyInto(*out) + } + if in.ObjectSelector != nil { + in, out := &in.ObjectSelector, &out.ObjectSelector + *out = new(metav1.LabelSelector) + (*in).DeepCopyInto(*out) + } + if in.SideEffects != nil { + in, out := &in.SideEffects, &out.SideEffects + *out = new(SideEffectClass) + **out = **in + } + if in.TimeoutSeconds != nil { + in, out := &in.TimeoutSeconds, &out.TimeoutSeconds + *out = new(int32) + **out = **in + } + if in.AdmissionReviewVersions != nil { + in, out := &in.AdmissionReviewVersions, &out.AdmissionReviewVersions + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ReinvocationPolicy != nil { + in, out := &in.ReinvocationPolicy, &out.ReinvocationPolicy + *out = new(ReinvocationPolicyType) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MutatingWebhook. +func (in *MutatingWebhook) DeepCopy() *MutatingWebhook { + if in == nil { + return nil + } + out := new(MutatingWebhook) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MutatingWebhookConfiguration) DeepCopyInto(out *MutatingWebhookConfiguration) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + if in.Webhooks != nil { + in, out := &in.Webhooks, &out.Webhooks + *out = make([]MutatingWebhook, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MutatingWebhookConfiguration. +func (in *MutatingWebhookConfiguration) DeepCopy() *MutatingWebhookConfiguration { + if in == nil { + return nil + } + out := new(MutatingWebhookConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MutatingWebhookConfiguration) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MutatingWebhookConfigurationList) DeepCopyInto(out *MutatingWebhookConfigurationList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]MutatingWebhookConfiguration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MutatingWebhookConfigurationList. +func (in *MutatingWebhookConfigurationList) DeepCopy() *MutatingWebhookConfigurationList { + if in == nil { + return nil + } + out := new(MutatingWebhookConfigurationList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MutatingWebhookConfigurationList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Rule) DeepCopyInto(out *Rule) { + *out = *in + if in.APIGroups != nil { + in, out := &in.APIGroups, &out.APIGroups + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.APIVersions != nil { + in, out := &in.APIVersions, &out.APIVersions + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Scope != nil { + in, out := &in.Scope, &out.Scope + *out = new(ScopeType) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Rule. +func (in *Rule) DeepCopy() *Rule { + if in == nil { + return nil + } + out := new(Rule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RuleWithOperations) DeepCopyInto(out *RuleWithOperations) { + *out = *in + if in.Operations != nil { + in, out := &in.Operations, &out.Operations + *out = make([]OperationType, len(*in)) + copy(*out, *in) + } + in.Rule.DeepCopyInto(&out.Rule) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleWithOperations. +func (in *RuleWithOperations) DeepCopy() *RuleWithOperations { + if in == nil { + return nil + } + out := new(RuleWithOperations) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceReference) DeepCopyInto(out *ServiceReference) { + *out = *in + if in.Path != nil { + in, out := &in.Path, &out.Path + *out = new(string) + **out = **in + } + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(int32) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceReference. +func (in *ServiceReference) DeepCopy() *ServiceReference { + if in == nil { + return nil + } + out := new(ServiceReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ValidatingWebhook) DeepCopyInto(out *ValidatingWebhook) { + *out = *in + in.ClientConfig.DeepCopyInto(&out.ClientConfig) + if in.Rules != nil { + in, out := &in.Rules, &out.Rules + *out = make([]RuleWithOperations, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.FailurePolicy != nil { + in, out := &in.FailurePolicy, &out.FailurePolicy + *out = new(FailurePolicyType) + **out = **in + } + if in.MatchPolicy != nil { + in, out := &in.MatchPolicy, &out.MatchPolicy + *out = new(MatchPolicyType) + **out = **in + } + if in.NamespaceSelector != nil { + in, out := &in.NamespaceSelector, &out.NamespaceSelector + *out = new(metav1.LabelSelector) + (*in).DeepCopyInto(*out) + } + if in.ObjectSelector != nil { + in, out := &in.ObjectSelector, &out.ObjectSelector + *out = new(metav1.LabelSelector) + (*in).DeepCopyInto(*out) + } + if in.SideEffects != nil { + in, out := &in.SideEffects, &out.SideEffects + *out = new(SideEffectClass) + **out = **in + } + if in.TimeoutSeconds != nil { + in, out := &in.TimeoutSeconds, &out.TimeoutSeconds + *out = new(int32) + **out = **in + } + if in.AdmissionReviewVersions != nil { + in, out := &in.AdmissionReviewVersions, &out.AdmissionReviewVersions + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValidatingWebhook. +func (in *ValidatingWebhook) DeepCopy() *ValidatingWebhook { + if in == nil { + return nil + } + out := new(ValidatingWebhook) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ValidatingWebhookConfiguration) DeepCopyInto(out *ValidatingWebhookConfiguration) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + if in.Webhooks != nil { + in, out := &in.Webhooks, &out.Webhooks + *out = make([]ValidatingWebhook, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValidatingWebhookConfiguration. +func (in *ValidatingWebhookConfiguration) DeepCopy() *ValidatingWebhookConfiguration { + if in == nil { + return nil + } + out := new(ValidatingWebhookConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ValidatingWebhookConfiguration) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ValidatingWebhookConfigurationList) DeepCopyInto(out *ValidatingWebhookConfigurationList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ValidatingWebhookConfiguration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValidatingWebhookConfigurationList. +func (in *ValidatingWebhookConfigurationList) DeepCopy() *ValidatingWebhookConfigurationList { + if in == nil { + return nil + } + out := new(ValidatingWebhookConfigurationList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ValidatingWebhookConfigurationList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WebhookClientConfig) DeepCopyInto(out *WebhookClientConfig) { + *out = *in + if in.URL != nil { + in, out := &in.URL, &out.URL + *out = new(string) + **out = **in + } + if in.Service != nil { + in, out := &in.Service, &out.Service + *out = new(ServiceReference) + (*in).DeepCopyInto(*out) + } + if in.CABundle != nil { + in, out := &in.CABundle, &out.CABundle + *out = make([]byte, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookClientConfig. +func (in *WebhookClientConfig) DeepCopy() *WebhookClientConfig { + if in == nil { + return nil + } + out := new(WebhookClientConfig) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/k8s.io/api/admissionregistration/v1beta1/generated.proto b/vendor/k8s.io/api/admissionregistration/v1beta1/generated.proto deleted file mode 100644 index 086cbcc..0000000 --- a/vendor/k8s.io/api/admissionregistration/v1beta1/generated.proto +++ /dev/null @@ -1,487 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.admissionregistration.v1beta1; - -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1beta1"; - -// MutatingWebhook describes an admission webhook and the resources and operations it applies to. -message MutatingWebhook { - // The name of the admission webhook. - // Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where - // "imagepolicy" is the name of the webhook, and kubernetes.io is the name - // of the organization. - // Required. - optional string name = 1; - - // ClientConfig defines how to communicate with the hook. - // Required - optional WebhookClientConfig clientConfig = 2; - - // Rules describes what operations on what resources/subresources the webhook cares about. - // The webhook cares about an operation if it matches _any_ Rule. - // However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks - // from putting the cluster in a state which cannot be recovered from without completely - // disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called - // on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects. - repeated RuleWithOperations rules = 3; - - // FailurePolicy defines how unrecognized errors from the admission endpoint are handled - - // allowed values are Ignore or Fail. Defaults to Ignore. - // +optional - optional string failurePolicy = 4; - - // matchPolicy defines how the "rules" list is used to match incoming requests. - // Allowed values are "Exact" or "Equivalent". - // - // - Exact: match a request only if it exactly matches a specified rule. - // For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, - // but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, - // a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook. - // - // - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. - // For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, - // and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, - // a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook. - // - // Defaults to "Exact" - // +optional - optional string matchPolicy = 9; - - // NamespaceSelector decides whether to run the webhook on an object based - // on whether the namespace for that object matches the selector. If the - // object itself is a namespace, the matching is performed on - // object.metadata.labels. If the object is another cluster scoped resource, - // it never skips the webhook. - // - // For example, to run the webhook on any objects whose namespace is not - // associated with "runlevel" of "0" or "1"; you will set the selector as - // follows: - // "namespaceSelector": { - // "matchExpressions": [ - // { - // "key": "runlevel", - // "operator": "NotIn", - // "values": [ - // "0", - // "1" - // ] - // } - // ] - // } - // - // If instead you want to only run the webhook on any objects whose - // namespace is associated with the "environment" of "prod" or "staging"; - // you will set the selector as follows: - // "namespaceSelector": { - // "matchExpressions": [ - // { - // "key": "environment", - // "operator": "In", - // "values": [ - // "prod", - // "staging" - // ] - // } - // ] - // } - // - // See - // https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ - // for more examples of label selectors. - // - // Default to the empty LabelSelector, which matches everything. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 5; - - // ObjectSelector decides whether to run the webhook based on if the - // object has matching labels. objectSelector is evaluated against both - // the oldObject and newObject that would be sent to the webhook, and - // is considered to match if either object matches the selector. A null - // object (oldObject in the case of create, or newObject in the case of - // delete) or an object that cannot have labels (like a - // DeploymentRollback or a PodProxyOptions object) is not considered to - // match. - // Use the object selector only if the webhook is opt-in, because end - // users may skip the admission webhook by setting the labels. - // Default to the empty LabelSelector, which matches everything. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector objectSelector = 11; - - // SideEffects states whether this webhook has side effects. - // Acceptable values are: Unknown, None, Some, NoneOnDryRun - // Webhooks with side effects MUST implement a reconciliation system, since a request may be - // rejected by a future step in the admission change and the side effects therefore need to be undone. - // Requests with the dryRun attribute will be auto-rejected if they match a webhook with - // sideEffects == Unknown or Some. Defaults to Unknown. - // +optional - optional string sideEffects = 6; - - // TimeoutSeconds specifies the timeout for this webhook. After the timeout passes, - // the webhook call will be ignored or the API call will fail based on the - // failure policy. - // The timeout value must be between 1 and 30 seconds. - // Default to 30 seconds. - // +optional - optional int32 timeoutSeconds = 7; - - // AdmissionReviewVersions is an ordered list of preferred `AdmissionReview` - // versions the Webhook expects. API server will try to use first version in - // the list which it supports. If none of the versions specified in this list - // supported by API server, validation will fail for this object. - // If a persisted webhook configuration specifies allowed versions and does not - // include any versions known to the API Server, calls to the webhook will fail - // and be subject to the failure policy. - // Default to `['v1beta1']`. - // +optional - repeated string admissionReviewVersions = 8; - - // reinvocationPolicy indicates whether this webhook should be called multiple times as part of a single admission evaluation. - // Allowed values are "Never" and "IfNeeded". - // - // Never: the webhook will not be called more than once in a single admission evaluation. - // - // IfNeeded: the webhook will be called at least one additional time as part of the admission evaluation - // if the object being admitted is modified by other admission plugins after the initial webhook call. - // Webhooks that specify this option *must* be idempotent, able to process objects they previously admitted. - // Note: - // * the number of additional invocations is not guaranteed to be exactly one. - // * if additional invocations result in further modifications to the object, webhooks are not guaranteed to be invoked again. - // * webhooks that use this option may be reordered to minimize the number of additional invocations. - // * to validate an object after all mutations are guaranteed complete, use a validating admission webhook instead. - // - // Defaults to "Never". - // +optional - optional string reinvocationPolicy = 10; -} - -// MutatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and may change the object. -// Deprecated in v1.16, planned for removal in v1.19. Use admissionregistration.k8s.io/v1 MutatingWebhookConfiguration instead. -message MutatingWebhookConfiguration { - // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Webhooks is a list of webhooks and the affected resources and operations. - // +optional - // +patchMergeKey=name - // +patchStrategy=merge - repeated MutatingWebhook Webhooks = 2; -} - -// MutatingWebhookConfigurationList is a list of MutatingWebhookConfiguration. -message MutatingWebhookConfigurationList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // List of MutatingWebhookConfiguration. - repeated MutatingWebhookConfiguration items = 2; -} - -// Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended -// to make sure that all the tuple expansions are valid. -message Rule { - // APIGroups is the API groups the resources belong to. '*' is all groups. - // If '*' is present, the length of the slice must be one. - // Required. - repeated string apiGroups = 1; - - // APIVersions is the API versions the resources belong to. '*' is all versions. - // If '*' is present, the length of the slice must be one. - // Required. - repeated string apiVersions = 2; - - // Resources is a list of resources this rule applies to. - // - // For example: - // 'pods' means pods. - // 'pods/log' means the log subresource of pods. - // '*' means all resources, but not subresources. - // 'pods/*' means all subresources of pods. - // '*/scale' means all scale subresources. - // '*/*' means all resources and their subresources. - // - // If wildcard is present, the validation rule will ensure resources do not - // overlap with each other. - // - // Depending on the enclosing object, subresources might not be allowed. - // Required. - repeated string resources = 3; - - // scope specifies the scope of this rule. - // Valid values are "Cluster", "Namespaced", and "*" - // "Cluster" means that only cluster-scoped resources will match this rule. - // Namespace API objects are cluster-scoped. - // "Namespaced" means that only namespaced resources will match this rule. - // "*" means that there are no scope restrictions. - // Subresources match the scope of their parent resource. - // Default is "*". - // - // +optional - optional string scope = 4; -} - -// RuleWithOperations is a tuple of Operations and Resources. It is recommended to make -// sure that all the tuple expansions are valid. -message RuleWithOperations { - // Operations is the operations the admission hook cares about - CREATE, UPDATE, or * - // for all operations. - // If '*' is present, the length of the slice must be one. - // Required. - repeated string operations = 1; - - // Rule is embedded, it describes other criteria of the rule, like - // APIGroups, APIVersions, Resources, etc. - optional Rule rule = 2; -} - -// ServiceReference holds a reference to Service.legacy.k8s.io -message ServiceReference { - // `namespace` is the namespace of the service. - // Required - optional string namespace = 1; - - // `name` is the name of the service. - // Required - optional string name = 2; - - // `path` is an optional URL path which will be sent in any request to - // this service. - // +optional - optional string path = 3; - - // If specified, the port on the service that hosting webhook. - // Default to 443 for backward compatibility. - // `port` should be a valid port number (1-65535, inclusive). - // +optional - optional int32 port = 4; -} - -// ValidatingWebhook describes an admission webhook and the resources and operations it applies to. -message ValidatingWebhook { - // The name of the admission webhook. - // Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where - // "imagepolicy" is the name of the webhook, and kubernetes.io is the name - // of the organization. - // Required. - optional string name = 1; - - // ClientConfig defines how to communicate with the hook. - // Required - optional WebhookClientConfig clientConfig = 2; - - // Rules describes what operations on what resources/subresources the webhook cares about. - // The webhook cares about an operation if it matches _any_ Rule. - // However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks - // from putting the cluster in a state which cannot be recovered from without completely - // disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called - // on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects. - repeated RuleWithOperations rules = 3; - - // FailurePolicy defines how unrecognized errors from the admission endpoint are handled - - // allowed values are Ignore or Fail. Defaults to Ignore. - // +optional - optional string failurePolicy = 4; - - // matchPolicy defines how the "rules" list is used to match incoming requests. - // Allowed values are "Exact" or "Equivalent". - // - // - Exact: match a request only if it exactly matches a specified rule. - // For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, - // but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, - // a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook. - // - // - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. - // For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, - // and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, - // a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook. - // - // Defaults to "Exact" - // +optional - optional string matchPolicy = 9; - - // NamespaceSelector decides whether to run the webhook on an object based - // on whether the namespace for that object matches the selector. If the - // object itself is a namespace, the matching is performed on - // object.metadata.labels. If the object is another cluster scoped resource, - // it never skips the webhook. - // - // For example, to run the webhook on any objects whose namespace is not - // associated with "runlevel" of "0" or "1"; you will set the selector as - // follows: - // "namespaceSelector": { - // "matchExpressions": [ - // { - // "key": "runlevel", - // "operator": "NotIn", - // "values": [ - // "0", - // "1" - // ] - // } - // ] - // } - // - // If instead you want to only run the webhook on any objects whose - // namespace is associated with the "environment" of "prod" or "staging"; - // you will set the selector as follows: - // "namespaceSelector": { - // "matchExpressions": [ - // { - // "key": "environment", - // "operator": "In", - // "values": [ - // "prod", - // "staging" - // ] - // } - // ] - // } - // - // See - // https://kubernetes.io/docs/concepts/overview/working-with-objects/labels - // for more examples of label selectors. - // - // Default to the empty LabelSelector, which matches everything. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 5; - - // ObjectSelector decides whether to run the webhook based on if the - // object has matching labels. objectSelector is evaluated against both - // the oldObject and newObject that would be sent to the webhook, and - // is considered to match if either object matches the selector. A null - // object (oldObject in the case of create, or newObject in the case of - // delete) or an object that cannot have labels (like a - // DeploymentRollback or a PodProxyOptions object) is not considered to - // match. - // Use the object selector only if the webhook is opt-in, because end - // users may skip the admission webhook by setting the labels. - // Default to the empty LabelSelector, which matches everything. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector objectSelector = 10; - - // SideEffects states whether this webhook has side effects. - // Acceptable values are: Unknown, None, Some, NoneOnDryRun - // Webhooks with side effects MUST implement a reconciliation system, since a request may be - // rejected by a future step in the admission change and the side effects therefore need to be undone. - // Requests with the dryRun attribute will be auto-rejected if they match a webhook with - // sideEffects == Unknown or Some. Defaults to Unknown. - // +optional - optional string sideEffects = 6; - - // TimeoutSeconds specifies the timeout for this webhook. After the timeout passes, - // the webhook call will be ignored or the API call will fail based on the - // failure policy. - // The timeout value must be between 1 and 30 seconds. - // Default to 30 seconds. - // +optional - optional int32 timeoutSeconds = 7; - - // AdmissionReviewVersions is an ordered list of preferred `AdmissionReview` - // versions the Webhook expects. API server will try to use first version in - // the list which it supports. If none of the versions specified in this list - // supported by API server, validation will fail for this object. - // If a persisted webhook configuration specifies allowed versions and does not - // include any versions known to the API Server, calls to the webhook will fail - // and be subject to the failure policy. - // Default to `['v1beta1']`. - // +optional - repeated string admissionReviewVersions = 8; -} - -// ValidatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and object without changing it. -// Deprecated in v1.16, planned for removal in v1.19. Use admissionregistration.k8s.io/v1 ValidatingWebhookConfiguration instead. -message ValidatingWebhookConfiguration { - // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Webhooks is a list of webhooks and the affected resources and operations. - // +optional - // +patchMergeKey=name - // +patchStrategy=merge - repeated ValidatingWebhook Webhooks = 2; -} - -// ValidatingWebhookConfigurationList is a list of ValidatingWebhookConfiguration. -message ValidatingWebhookConfigurationList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // List of ValidatingWebhookConfiguration. - repeated ValidatingWebhookConfiguration items = 2; -} - -// WebhookClientConfig contains the information to make a TLS -// connection with the webhook -message WebhookClientConfig { - // `url` gives the location of the webhook, in standard URL form - // (`scheme://host:port/path`). Exactly one of `url` or `service` - // must be specified. - // - // The `host` should not refer to a service running in the cluster; use - // the `service` field instead. The host might be resolved via external - // DNS in some apiservers (e.g., `kube-apiserver` cannot resolve - // in-cluster DNS as that would be a layering violation). `host` may - // also be an IP address. - // - // Please note that using `localhost` or `127.0.0.1` as a `host` is - // risky unless you take great care to run this webhook on all hosts - // which run an apiserver which might need to make calls to this - // webhook. Such installs are likely to be non-portable, i.e., not easy - // to turn up in a new cluster. - // - // The scheme must be "https"; the URL must begin with "https://". - // - // A path is optional, and if present may be any string permissible in - // a URL. You may use the path to pass an arbitrary string to the - // webhook, for example, a cluster identifier. - // - // Attempting to use a user or basic auth e.g. "user:password@" is not - // allowed. Fragments ("#...") and query parameters ("?...") are not - // allowed, either. - // - // +optional - optional string url = 3; - - // `service` is a reference to the service for this webhook. Either - // `service` or `url` must be specified. - // - // If the webhook is running within the cluster, then you should use `service`. - // - // +optional - optional ServiceReference service = 1; - - // `caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. - // If unspecified, system trust roots on the apiserver are used. - // +optional - optional bytes caBundle = 2; -} - diff --git a/vendor/k8s.io/api/apps/v1/generated.proto b/vendor/k8s.io/api/apps/v1/generated.proto deleted file mode 100644 index 6c55279..0000000 --- a/vendor/k8s.io/api/apps/v1/generated.proto +++ /dev/null @@ -1,701 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.apps.v1; - -import "k8s.io/api/core/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; -import "k8s.io/apimachinery/pkg/util/intstr/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1"; - -// ControllerRevision implements an immutable snapshot of state data. Clients -// are responsible for serializing and deserializing the objects that contain -// their internal state. -// Once a ControllerRevision has been successfully created, it can not be updated. -// The API Server will fail validation of all requests that attempt to mutate -// the Data field. ControllerRevisions may, however, be deleted. Note that, due to its use by both -// the DaemonSet and StatefulSet controllers for update and rollback, this object is beta. However, -// it may be subject to name and representation changes in future releases, and clients should not -// depend on its stability. It is primarily for internal use by controllers. -message ControllerRevision { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Data is the serialized representation of the state. - optional k8s.io.apimachinery.pkg.runtime.RawExtension data = 2; - - // Revision indicates the revision of the state represented by Data. - optional int64 revision = 3; -} - -// ControllerRevisionList is a resource containing a list of ControllerRevision objects. -message ControllerRevisionList { - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is the list of ControllerRevisions - repeated ControllerRevision items = 2; -} - -// DaemonSet represents the configuration of a daemon set. -message DaemonSet { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // The desired behavior of this daemon set. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional DaemonSetSpec spec = 2; - - // The current status of this daemon set. This data may be - // out of date by some window of time. - // Populated by the system. - // Read-only. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional DaemonSetStatus status = 3; -} - -// DaemonSetCondition describes the state of a DaemonSet at a certain point. -message DaemonSetCondition { - // Type of DaemonSet condition. - optional string type = 1; - - // Status of the condition, one of True, False, Unknown. - optional string status = 2; - - // Last time the condition transitioned from one status to another. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; - - // The reason for the condition's last transition. - // +optional - optional string reason = 4; - - // A human readable message indicating details about the transition. - // +optional - optional string message = 5; -} - -// DaemonSetList is a collection of daemon sets. -message DaemonSetList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // A list of daemon sets. - repeated DaemonSet items = 2; -} - -// DaemonSetSpec is the specification of a daemon set. -message DaemonSetSpec { - // A label query over pods that are managed by the daemon set. - // Must match in order to be controlled. - // It must match the pod template's labels. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; - - // An object that describes the pod that will be created. - // The DaemonSet will create exactly one copy of this pod on every node - // that matches the template's node selector (or on every node if no node - // selector is specified). - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template - optional k8s.io.api.core.v1.PodTemplateSpec template = 2; - - // An update strategy to replace existing DaemonSet pods with new pods. - // +optional - optional DaemonSetUpdateStrategy updateStrategy = 3; - - // The minimum number of seconds for which a newly created DaemonSet pod should - // be ready without any of its container crashing, for it to be considered - // available. Defaults to 0 (pod will be considered available as soon as it - // is ready). - // +optional - optional int32 minReadySeconds = 4; - - // The number of old history to retain to allow rollback. - // This is a pointer to distinguish between explicit zero and not specified. - // Defaults to 10. - // +optional - optional int32 revisionHistoryLimit = 6; -} - -// DaemonSetStatus represents the current status of a daemon set. -message DaemonSetStatus { - // The number of nodes that are running at least 1 - // daemon pod and are supposed to run the daemon pod. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ - optional int32 currentNumberScheduled = 1; - - // The number of nodes that are running the daemon pod, but are - // not supposed to run the daemon pod. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ - optional int32 numberMisscheduled = 2; - - // The total number of nodes that should be running the daemon - // pod (including nodes correctly running the daemon pod). - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ - optional int32 desiredNumberScheduled = 3; - - // The number of nodes that should be running the daemon pod and have one - // or more of the daemon pod running and ready. - optional int32 numberReady = 4; - - // The most recent generation observed by the daemon set controller. - // +optional - optional int64 observedGeneration = 5; - - // The total number of nodes that are running updated daemon pod - // +optional - optional int32 updatedNumberScheduled = 6; - - // The number of nodes that should be running the - // daemon pod and have one or more of the daemon pod running and - // available (ready for at least spec.minReadySeconds) - // +optional - optional int32 numberAvailable = 7; - - // The number of nodes that should be running the - // daemon pod and have none of the daemon pod running and available - // (ready for at least spec.minReadySeconds) - // +optional - optional int32 numberUnavailable = 8; - - // Count of hash collisions for the DaemonSet. The DaemonSet controller - // uses this field as a collision avoidance mechanism when it needs to - // create the name for the newest ControllerRevision. - // +optional - optional int32 collisionCount = 9; - - // Represents the latest available observations of a DaemonSet's current state. - // +optional - // +patchMergeKey=type - // +patchStrategy=merge - repeated DaemonSetCondition conditions = 10; -} - -// DaemonSetUpdateStrategy is a struct used to control the update strategy for a DaemonSet. -message DaemonSetUpdateStrategy { - // Type of daemon set update. Can be "RollingUpdate" or "OnDelete". Default is RollingUpdate. - // +optional - optional string type = 1; - - // Rolling update config params. Present only if type = "RollingUpdate". - // --- - // TODO: Update this to follow our convention for oneOf, whatever we decide it - // to be. Same as Deployment `strategy.rollingUpdate`. - // See https://github.com/kubernetes/kubernetes/issues/35345 - // +optional - optional RollingUpdateDaemonSet rollingUpdate = 2; -} - -// Deployment enables declarative updates for Pods and ReplicaSets. -message Deployment { - // Standard object metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Specification of the desired behavior of the Deployment. - // +optional - optional DeploymentSpec spec = 2; - - // Most recently observed status of the Deployment. - // +optional - optional DeploymentStatus status = 3; -} - -// DeploymentCondition describes the state of a deployment at a certain point. -message DeploymentCondition { - // Type of deployment condition. - optional string type = 1; - - // Status of the condition, one of True, False, Unknown. - optional string status = 2; - - // The last time this condition was updated. - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 6; - - // Last time the condition transitioned from one status to another. - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 7; - - // The reason for the condition's last transition. - optional string reason = 4; - - // A human readable message indicating details about the transition. - optional string message = 5; -} - -// DeploymentList is a list of Deployments. -message DeploymentList { - // Standard list metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is the list of Deployments. - repeated Deployment items = 2; -} - -// DeploymentSpec is the specification of the desired behavior of the Deployment. -message DeploymentSpec { - // Number of desired pods. This is a pointer to distinguish between explicit - // zero and not specified. Defaults to 1. - // +optional - optional int32 replicas = 1; - - // Label selector for pods. Existing ReplicaSets whose pods are - // selected by this will be the ones affected by this deployment. - // It must match the pod template's labels. - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2; - - // Template describes the pods that will be created. - optional k8s.io.api.core.v1.PodTemplateSpec template = 3; - - // The deployment strategy to use to replace existing pods with new ones. - // +optional - // +patchStrategy=retainKeys - optional DeploymentStrategy strategy = 4; - - // Minimum number of seconds for which a newly created pod should be ready - // without any of its container crashing, for it to be considered available. - // Defaults to 0 (pod will be considered available as soon as it is ready) - // +optional - optional int32 minReadySeconds = 5; - - // The number of old ReplicaSets to retain to allow rollback. - // This is a pointer to distinguish between explicit zero and not specified. - // Defaults to 10. - // +optional - optional int32 revisionHistoryLimit = 6; - - // Indicates that the deployment is paused. - // +optional - optional bool paused = 7; - - // The maximum time in seconds for a deployment to make progress before it - // is considered to be failed. The deployment controller will continue to - // process failed deployments and a condition with a ProgressDeadlineExceeded - // reason will be surfaced in the deployment status. Note that progress will - // not be estimated during the time a deployment is paused. Defaults to 600s. - optional int32 progressDeadlineSeconds = 9; -} - -// DeploymentStatus is the most recently observed status of the Deployment. -message DeploymentStatus { - // The generation observed by the deployment controller. - // +optional - optional int64 observedGeneration = 1; - - // Total number of non-terminated pods targeted by this deployment (their labels match the selector). - // +optional - optional int32 replicas = 2; - - // Total number of non-terminated pods targeted by this deployment that have the desired template spec. - // +optional - optional int32 updatedReplicas = 3; - - // Total number of ready pods targeted by this deployment. - // +optional - optional int32 readyReplicas = 7; - - // Total number of available pods (ready for at least minReadySeconds) targeted by this deployment. - // +optional - optional int32 availableReplicas = 4; - - // Total number of unavailable pods targeted by this deployment. This is the total number of - // pods that are still required for the deployment to have 100% available capacity. They may - // either be pods that are running but not yet available or pods that still have not been created. - // +optional - optional int32 unavailableReplicas = 5; - - // Represents the latest available observations of a deployment's current state. - // +patchMergeKey=type - // +patchStrategy=merge - repeated DeploymentCondition conditions = 6; - - // Count of hash collisions for the Deployment. The Deployment controller uses this - // field as a collision avoidance mechanism when it needs to create the name for the - // newest ReplicaSet. - // +optional - optional int32 collisionCount = 8; -} - -// DeploymentStrategy describes how to replace existing pods with new ones. -message DeploymentStrategy { - // Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate. - // +optional - optional string type = 1; - - // Rolling update config params. Present only if DeploymentStrategyType = - // RollingUpdate. - // --- - // TODO: Update this to follow our convention for oneOf, whatever we decide it - // to be. - // +optional - optional RollingUpdateDeployment rollingUpdate = 2; -} - -// ReplicaSet ensures that a specified number of pod replicas are running at any given time. -message ReplicaSet { - // If the Labels of a ReplicaSet are empty, they are defaulted to - // be the same as the Pod(s) that the ReplicaSet manages. - // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec defines the specification of the desired behavior of the ReplicaSet. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional ReplicaSetSpec spec = 2; - - // Status is the most recently observed status of the ReplicaSet. - // This data may be out of date by some window of time. - // Populated by the system. - // Read-only. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional ReplicaSetStatus status = 3; -} - -// ReplicaSetCondition describes the state of a replica set at a certain point. -message ReplicaSetCondition { - // Type of replica set condition. - optional string type = 1; - - // Status of the condition, one of True, False, Unknown. - optional string status = 2; - - // The last time the condition transitioned from one status to another. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; - - // The reason for the condition's last transition. - // +optional - optional string reason = 4; - - // A human readable message indicating details about the transition. - // +optional - optional string message = 5; -} - -// ReplicaSetList is a collection of ReplicaSets. -message ReplicaSetList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // List of ReplicaSets. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller - repeated ReplicaSet items = 2; -} - -// ReplicaSetSpec is the specification of a ReplicaSet. -message ReplicaSetSpec { - // Replicas is the number of desired replicas. - // This is a pointer to distinguish between explicit zero and unspecified. - // Defaults to 1. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller - // +optional - optional int32 replicas = 1; - - // Minimum number of seconds for which a newly created pod should be ready - // without any of its container crashing, for it to be considered available. - // Defaults to 0 (pod will be considered available as soon as it is ready) - // +optional - optional int32 minReadySeconds = 4; - - // Selector is a label query over pods that should match the replica count. - // Label keys and values that must match in order to be controlled by this replica set. - // It must match the pod template's labels. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2; - - // Template is the object that describes the pod that will be created if - // insufficient replicas are detected. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template - // +optional - optional k8s.io.api.core.v1.PodTemplateSpec template = 3; -} - -// ReplicaSetStatus represents the current status of a ReplicaSet. -message ReplicaSetStatus { - // Replicas is the most recently oberved number of replicas. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller - optional int32 replicas = 1; - - // The number of pods that have labels matching the labels of the pod template of the replicaset. - // +optional - optional int32 fullyLabeledReplicas = 2; - - // The number of ready replicas for this replica set. - // +optional - optional int32 readyReplicas = 4; - - // The number of available replicas (ready for at least minReadySeconds) for this replica set. - // +optional - optional int32 availableReplicas = 5; - - // ObservedGeneration reflects the generation of the most recently observed ReplicaSet. - // +optional - optional int64 observedGeneration = 3; - - // Represents the latest available observations of a replica set's current state. - // +optional - // +patchMergeKey=type - // +patchStrategy=merge - repeated ReplicaSetCondition conditions = 6; -} - -// Spec to control the desired behavior of daemon set rolling update. -message RollingUpdateDaemonSet { - // The maximum number of DaemonSet pods that can be unavailable during the - // update. Value can be an absolute number (ex: 5) or a percentage of total - // number of DaemonSet pods at the start of the update (ex: 10%). Absolute - // number is calculated from percentage by rounding up. - // This cannot be 0. - // Default value is 1. - // Example: when this is set to 30%, at most 30% of the total number of nodes - // that should be running the daemon pod (i.e. status.desiredNumberScheduled) - // can have their pods stopped for an update at any given - // time. The update starts by stopping at most 30% of those DaemonSet pods - // and then brings up new DaemonSet pods in their place. Once the new pods - // are available, it then proceeds onto other DaemonSet pods, thus ensuring - // that at least 70% of original number of DaemonSet pods are available at - // all times during the update. - // +optional - optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 1; -} - -// Spec to control the desired behavior of rolling update. -message RollingUpdateDeployment { - // The maximum number of pods that can be unavailable during the update. - // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). - // Absolute number is calculated from percentage by rounding down. - // This can not be 0 if MaxSurge is 0. - // Defaults to 25%. - // Example: when this is set to 30%, the old ReplicaSet can be scaled down to 70% of desired pods - // immediately when the rolling update starts. Once new pods are ready, old ReplicaSet - // can be scaled down further, followed by scaling up the new ReplicaSet, ensuring - // that the total number of pods available at all times during the update is at - // least 70% of desired pods. - // +optional - optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 1; - - // The maximum number of pods that can be scheduled above the desired number of - // pods. - // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). - // This can not be 0 if MaxUnavailable is 0. - // Absolute number is calculated from percentage by rounding up. - // Defaults to 25%. - // Example: when this is set to 30%, the new ReplicaSet can be scaled up immediately when - // the rolling update starts, such that the total number of old and new pods do not exceed - // 130% of desired pods. Once old pods have been killed, - // new ReplicaSet can be scaled up further, ensuring that total number of pods running - // at any time during the update is at most 130% of desired pods. - // +optional - optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxSurge = 2; -} - -// RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType. -message RollingUpdateStatefulSetStrategy { - // Partition indicates the ordinal at which the StatefulSet should be - // partitioned. - // Default value is 0. - // +optional - optional int32 partition = 1; -} - -// StatefulSet represents a set of pods with consistent identities. -// Identities are defined as: -// - Network: A single stable DNS and hostname. -// - Storage: As many VolumeClaims as requested. -// The StatefulSet guarantees that a given network identity will always -// map to the same storage identity. -message StatefulSet { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec defines the desired identities of pods in this set. - // +optional - optional StatefulSetSpec spec = 2; - - // Status is the current status of Pods in this StatefulSet. This data - // may be out of date by some window of time. - // +optional - optional StatefulSetStatus status = 3; -} - -// StatefulSetCondition describes the state of a statefulset at a certain point. -message StatefulSetCondition { - // Type of statefulset condition. - optional string type = 1; - - // Status of the condition, one of True, False, Unknown. - optional string status = 2; - - // Last time the condition transitioned from one status to another. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; - - // The reason for the condition's last transition. - // +optional - optional string reason = 4; - - // A human readable message indicating details about the transition. - // +optional - optional string message = 5; -} - -// StatefulSetList is a collection of StatefulSets. -message StatefulSetList { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - repeated StatefulSet items = 2; -} - -// A StatefulSetSpec is the specification of a StatefulSet. -message StatefulSetSpec { - // replicas is the desired number of replicas of the given Template. - // These are replicas in the sense that they are instantiations of the - // same Template, but individual replicas also have a consistent identity. - // If unspecified, defaults to 1. - // TODO: Consider a rename of this field. - // +optional - optional int32 replicas = 1; - - // selector is a label query over pods that should match the replica count. - // It must match the pod template's labels. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2; - - // template is the object that describes the pod that will be created if - // insufficient replicas are detected. Each pod stamped out by the StatefulSet - // will fulfill this Template, but have a unique identity from the rest - // of the StatefulSet. - optional k8s.io.api.core.v1.PodTemplateSpec template = 3; - - // volumeClaimTemplates is a list of claims that pods are allowed to reference. - // The StatefulSet controller is responsible for mapping network identities to - // claims in a way that maintains the identity of a pod. Every claim in - // this list must have at least one matching (by name) volumeMount in one - // container in the template. A claim in this list takes precedence over - // any volumes in the template, with the same name. - // TODO: Define the behavior if a claim already exists with the same name. - // +optional - repeated k8s.io.api.core.v1.PersistentVolumeClaim volumeClaimTemplates = 4; - - // serviceName is the name of the service that governs this StatefulSet. - // This service must exist before the StatefulSet, and is responsible for - // the network identity of the set. Pods get DNS/hostnames that follow the - // pattern: pod-specific-string.serviceName.default.svc.cluster.local - // where "pod-specific-string" is managed by the StatefulSet controller. - optional string serviceName = 5; - - // podManagementPolicy controls how pods are created during initial scale up, - // when replacing pods on nodes, or when scaling down. The default policy is - // `OrderedReady`, where pods are created in increasing order (pod-0, then - // pod-1, etc) and the controller will wait until each pod is ready before - // continuing. When scaling down, the pods are removed in the opposite order. - // The alternative policy is `Parallel` which will create pods in parallel - // to match the desired scale without waiting, and on scale down will delete - // all pods at once. - // +optional - optional string podManagementPolicy = 6; - - // updateStrategy indicates the StatefulSetUpdateStrategy that will be - // employed to update Pods in the StatefulSet when a revision is made to - // Template. - optional StatefulSetUpdateStrategy updateStrategy = 7; - - // revisionHistoryLimit is the maximum number of revisions that will - // be maintained in the StatefulSet's revision history. The revision history - // consists of all revisions not represented by a currently applied - // StatefulSetSpec version. The default value is 10. - optional int32 revisionHistoryLimit = 8; -} - -// StatefulSetStatus represents the current state of a StatefulSet. -message StatefulSetStatus { - // observedGeneration is the most recent generation observed for this StatefulSet. It corresponds to the - // StatefulSet's generation, which is updated on mutation by the API Server. - // +optional - optional int64 observedGeneration = 1; - - // replicas is the number of Pods created by the StatefulSet controller. - optional int32 replicas = 2; - - // readyReplicas is the number of Pods created by the StatefulSet controller that have a Ready Condition. - optional int32 readyReplicas = 3; - - // currentReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version - // indicated by currentRevision. - optional int32 currentReplicas = 4; - - // updatedReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version - // indicated by updateRevision. - optional int32 updatedReplicas = 5; - - // currentRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the - // sequence [0,currentReplicas). - optional string currentRevision = 6; - - // updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence - // [replicas-updatedReplicas,replicas) - optional string updateRevision = 7; - - // collisionCount is the count of hash collisions for the StatefulSet. The StatefulSet controller - // uses this field as a collision avoidance mechanism when it needs to create the name for the - // newest ControllerRevision. - // +optional - optional int32 collisionCount = 9; - - // Represents the latest available observations of a statefulset's current state. - // +optional - // +patchMergeKey=type - // +patchStrategy=merge - repeated StatefulSetCondition conditions = 10; -} - -// StatefulSetUpdateStrategy indicates the strategy that the StatefulSet -// controller will use to perform updates. It includes any additional parameters -// necessary to perform the update for the indicated strategy. -message StatefulSetUpdateStrategy { - // Type indicates the type of the StatefulSetUpdateStrategy. - // Default is RollingUpdate. - // +optional - optional string type = 1; - - // RollingUpdate is used to communicate parameters when Type is RollingUpdateStatefulSetStrategyType. - // +optional - optional RollingUpdateStatefulSetStrategy rollingUpdate = 2; -} - diff --git a/vendor/k8s.io/api/apps/v1beta1/generated.proto b/vendor/k8s.io/api/apps/v1beta1/generated.proto deleted file mode 100644 index 694f657..0000000 --- a/vendor/k8s.io/api/apps/v1beta1/generated.proto +++ /dev/null @@ -1,484 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.apps.v1beta1; - -import "k8s.io/api/core/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; -import "k8s.io/apimachinery/pkg/util/intstr/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1beta1"; - -// DEPRECATED - This group version of ControllerRevision is deprecated by apps/v1beta2/ControllerRevision. See the -// release notes for more information. -// ControllerRevision implements an immutable snapshot of state data. Clients -// are responsible for serializing and deserializing the objects that contain -// their internal state. -// Once a ControllerRevision has been successfully created, it can not be updated. -// The API Server will fail validation of all requests that attempt to mutate -// the Data field. ControllerRevisions may, however, be deleted. Note that, due to its use by both -// the DaemonSet and StatefulSet controllers for update and rollback, this object is beta. However, -// it may be subject to name and representation changes in future releases, and clients should not -// depend on its stability. It is primarily for internal use by controllers. -message ControllerRevision { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Data is the serialized representation of the state. - optional k8s.io.apimachinery.pkg.runtime.RawExtension data = 2; - - // Revision indicates the revision of the state represented by Data. - optional int64 revision = 3; -} - -// ControllerRevisionList is a resource containing a list of ControllerRevision objects. -message ControllerRevisionList { - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is the list of ControllerRevisions - repeated ControllerRevision items = 2; -} - -// DEPRECATED - This group version of Deployment is deprecated by apps/v1beta2/Deployment. See the release notes for -// more information. -// Deployment enables declarative updates for Pods and ReplicaSets. -message Deployment { - // Standard object metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Specification of the desired behavior of the Deployment. - // +optional - optional DeploymentSpec spec = 2; - - // Most recently observed status of the Deployment. - // +optional - optional DeploymentStatus status = 3; -} - -// DeploymentCondition describes the state of a deployment at a certain point. -message DeploymentCondition { - // Type of deployment condition. - optional string type = 1; - - // Status of the condition, one of True, False, Unknown. - optional string status = 2; - - // The last time this condition was updated. - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 6; - - // Last time the condition transitioned from one status to another. - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 7; - - // The reason for the condition's last transition. - optional string reason = 4; - - // A human readable message indicating details about the transition. - optional string message = 5; -} - -// DeploymentList is a list of Deployments. -message DeploymentList { - // Standard list metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is the list of Deployments. - repeated Deployment items = 2; -} - -// DEPRECATED. -// DeploymentRollback stores the information required to rollback a deployment. -message DeploymentRollback { - // Required: This must match the Name of a deployment. - optional string name = 1; - - // The annotations to be updated to a deployment - // +optional - map updatedAnnotations = 2; - - // The config of this deployment rollback. - optional RollbackConfig rollbackTo = 3; -} - -// DeploymentSpec is the specification of the desired behavior of the Deployment. -message DeploymentSpec { - // Number of desired pods. This is a pointer to distinguish between explicit - // zero and not specified. Defaults to 1. - // +optional - optional int32 replicas = 1; - - // Label selector for pods. Existing ReplicaSets whose pods are - // selected by this will be the ones affected by this deployment. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2; - - // Template describes the pods that will be created. - optional k8s.io.api.core.v1.PodTemplateSpec template = 3; - - // The deployment strategy to use to replace existing pods with new ones. - // +optional - // +patchStrategy=retainKeys - optional DeploymentStrategy strategy = 4; - - // Minimum number of seconds for which a newly created pod should be ready - // without any of its container crashing, for it to be considered available. - // Defaults to 0 (pod will be considered available as soon as it is ready) - // +optional - optional int32 minReadySeconds = 5; - - // The number of old ReplicaSets to retain to allow rollback. - // This is a pointer to distinguish between explicit zero and not specified. - // Defaults to 2. - // +optional - optional int32 revisionHistoryLimit = 6; - - // Indicates that the deployment is paused. - // +optional - optional bool paused = 7; - - // DEPRECATED. - // The config this deployment is rolling back to. Will be cleared after rollback is done. - // +optional - optional RollbackConfig rollbackTo = 8; - - // The maximum time in seconds for a deployment to make progress before it - // is considered to be failed. The deployment controller will continue to - // process failed deployments and a condition with a ProgressDeadlineExceeded - // reason will be surfaced in the deployment status. Note that progress will - // not be estimated during the time a deployment is paused. Defaults to 600s. - // +optional - optional int32 progressDeadlineSeconds = 9; -} - -// DeploymentStatus is the most recently observed status of the Deployment. -message DeploymentStatus { - // The generation observed by the deployment controller. - // +optional - optional int64 observedGeneration = 1; - - // Total number of non-terminated pods targeted by this deployment (their labels match the selector). - // +optional - optional int32 replicas = 2; - - // Total number of non-terminated pods targeted by this deployment that have the desired template spec. - // +optional - optional int32 updatedReplicas = 3; - - // Total number of ready pods targeted by this deployment. - // +optional - optional int32 readyReplicas = 7; - - // Total number of available pods (ready for at least minReadySeconds) targeted by this deployment. - // +optional - optional int32 availableReplicas = 4; - - // Total number of unavailable pods targeted by this deployment. This is the total number of - // pods that are still required for the deployment to have 100% available capacity. They may - // either be pods that are running but not yet available or pods that still have not been created. - // +optional - optional int32 unavailableReplicas = 5; - - // Represents the latest available observations of a deployment's current state. - // +patchMergeKey=type - // +patchStrategy=merge - repeated DeploymentCondition conditions = 6; - - // Count of hash collisions for the Deployment. The Deployment controller uses this - // field as a collision avoidance mechanism when it needs to create the name for the - // newest ReplicaSet. - // +optional - optional int32 collisionCount = 8; -} - -// DeploymentStrategy describes how to replace existing pods with new ones. -message DeploymentStrategy { - // Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate. - // +optional - optional string type = 1; - - // Rolling update config params. Present only if DeploymentStrategyType = - // RollingUpdate. - // --- - // TODO: Update this to follow our convention for oneOf, whatever we decide it - // to be. - // +optional - optional RollingUpdateDeployment rollingUpdate = 2; -} - -// DEPRECATED. -message RollbackConfig { - // The revision to rollback to. If set to 0, rollback to the last revision. - // +optional - optional int64 revision = 1; -} - -// Spec to control the desired behavior of rolling update. -message RollingUpdateDeployment { - // The maximum number of pods that can be unavailable during the update. - // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). - // Absolute number is calculated from percentage by rounding down. - // This can not be 0 if MaxSurge is 0. - // Defaults to 25%. - // Example: when this is set to 30%, the old ReplicaSet can be scaled down to 70% of desired pods - // immediately when the rolling update starts. Once new pods are ready, old ReplicaSet - // can be scaled down further, followed by scaling up the new ReplicaSet, ensuring - // that the total number of pods available at all times during the update is at - // least 70% of desired pods. - // +optional - optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 1; - - // The maximum number of pods that can be scheduled above the desired number of - // pods. - // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). - // This can not be 0 if MaxUnavailable is 0. - // Absolute number is calculated from percentage by rounding up. - // Defaults to 25%. - // Example: when this is set to 30%, the new ReplicaSet can be scaled up immediately when - // the rolling update starts, such that the total number of old and new pods do not exceed - // 130% of desired pods. Once old pods have been killed, - // new ReplicaSet can be scaled up further, ensuring that total number of pods running - // at any time during the update is at most 130% of desired pods. - // +optional - optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxSurge = 2; -} - -// RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType. -message RollingUpdateStatefulSetStrategy { - // Partition indicates the ordinal at which the StatefulSet should be - // partitioned. - optional int32 partition = 1; -} - -// Scale represents a scaling request for a resource. -message Scale { - // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. - // +optional - optional ScaleSpec spec = 2; - - // current status of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. Read-only. - // +optional - optional ScaleStatus status = 3; -} - -// ScaleSpec describes the attributes of a scale subresource -message ScaleSpec { - // desired number of instances for the scaled object. - // +optional - optional int32 replicas = 1; -} - -// ScaleStatus represents the current status of a scale subresource. -message ScaleStatus { - // actual number of observed instances of the scaled object. - optional int32 replicas = 1; - - // label query over pods that should match the replicas count. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors - // +optional - map selector = 2; - - // label selector for pods that should match the replicas count. This is a serializated - // version of both map-based and more expressive set-based selectors. This is done to - // avoid introspection in the clients. The string will be in the same format as the - // query-param syntax. If the target type only supports map-based selectors, both this - // field and map-based selector field are populated. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - // +optional - optional string targetSelector = 3; -} - -// DEPRECATED - This group version of StatefulSet is deprecated by apps/v1beta2/StatefulSet. See the release notes for -// more information. -// StatefulSet represents a set of pods with consistent identities. -// Identities are defined as: -// - Network: A single stable DNS and hostname. -// - Storage: As many VolumeClaims as requested. -// The StatefulSet guarantees that a given network identity will always -// map to the same storage identity. -message StatefulSet { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec defines the desired identities of pods in this set. - // +optional - optional StatefulSetSpec spec = 2; - - // Status is the current status of Pods in this StatefulSet. This data - // may be out of date by some window of time. - // +optional - optional StatefulSetStatus status = 3; -} - -// StatefulSetCondition describes the state of a statefulset at a certain point. -message StatefulSetCondition { - // Type of statefulset condition. - optional string type = 1; - - // Status of the condition, one of True, False, Unknown. - optional string status = 2; - - // Last time the condition transitioned from one status to another. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; - - // The reason for the condition's last transition. - // +optional - optional string reason = 4; - - // A human readable message indicating details about the transition. - // +optional - optional string message = 5; -} - -// StatefulSetList is a collection of StatefulSets. -message StatefulSetList { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - repeated StatefulSet items = 2; -} - -// A StatefulSetSpec is the specification of a StatefulSet. -message StatefulSetSpec { - // replicas is the desired number of replicas of the given Template. - // These are replicas in the sense that they are instantiations of the - // same Template, but individual replicas also have a consistent identity. - // If unspecified, defaults to 1. - // TODO: Consider a rename of this field. - // +optional - optional int32 replicas = 1; - - // selector is a label query over pods that should match the replica count. - // If empty, defaulted to labels on the pod template. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2; - - // template is the object that describes the pod that will be created if - // insufficient replicas are detected. Each pod stamped out by the StatefulSet - // will fulfill this Template, but have a unique identity from the rest - // of the StatefulSet. - optional k8s.io.api.core.v1.PodTemplateSpec template = 3; - - // volumeClaimTemplates is a list of claims that pods are allowed to reference. - // The StatefulSet controller is responsible for mapping network identities to - // claims in a way that maintains the identity of a pod. Every claim in - // this list must have at least one matching (by name) volumeMount in one - // container in the template. A claim in this list takes precedence over - // any volumes in the template, with the same name. - // TODO: Define the behavior if a claim already exists with the same name. - // +optional - repeated k8s.io.api.core.v1.PersistentVolumeClaim volumeClaimTemplates = 4; - - // serviceName is the name of the service that governs this StatefulSet. - // This service must exist before the StatefulSet, and is responsible for - // the network identity of the set. Pods get DNS/hostnames that follow the - // pattern: pod-specific-string.serviceName.default.svc.cluster.local - // where "pod-specific-string" is managed by the StatefulSet controller. - optional string serviceName = 5; - - // podManagementPolicy controls how pods are created during initial scale up, - // when replacing pods on nodes, or when scaling down. The default policy is - // `OrderedReady`, where pods are created in increasing order (pod-0, then - // pod-1, etc) and the controller will wait until each pod is ready before - // continuing. When scaling down, the pods are removed in the opposite order. - // The alternative policy is `Parallel` which will create pods in parallel - // to match the desired scale without waiting, and on scale down will delete - // all pods at once. - // +optional - optional string podManagementPolicy = 6; - - // updateStrategy indicates the StatefulSetUpdateStrategy that will be - // employed to update Pods in the StatefulSet when a revision is made to - // Template. - optional StatefulSetUpdateStrategy updateStrategy = 7; - - // revisionHistoryLimit is the maximum number of revisions that will - // be maintained in the StatefulSet's revision history. The revision history - // consists of all revisions not represented by a currently applied - // StatefulSetSpec version. The default value is 10. - optional int32 revisionHistoryLimit = 8; -} - -// StatefulSetStatus represents the current state of a StatefulSet. -message StatefulSetStatus { - // observedGeneration is the most recent generation observed for this StatefulSet. It corresponds to the - // StatefulSet's generation, which is updated on mutation by the API Server. - // +optional - optional int64 observedGeneration = 1; - - // replicas is the number of Pods created by the StatefulSet controller. - optional int32 replicas = 2; - - // readyReplicas is the number of Pods created by the StatefulSet controller that have a Ready Condition. - optional int32 readyReplicas = 3; - - // currentReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version - // indicated by currentRevision. - optional int32 currentReplicas = 4; - - // updatedReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version - // indicated by updateRevision. - optional int32 updatedReplicas = 5; - - // currentRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the - // sequence [0,currentReplicas). - optional string currentRevision = 6; - - // updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence - // [replicas-updatedReplicas,replicas) - optional string updateRevision = 7; - - // collisionCount is the count of hash collisions for the StatefulSet. The StatefulSet controller - // uses this field as a collision avoidance mechanism when it needs to create the name for the - // newest ControllerRevision. - // +optional - optional int32 collisionCount = 9; - - // Represents the latest available observations of a statefulset's current state. - // +optional - // +patchMergeKey=type - // +patchStrategy=merge - repeated StatefulSetCondition conditions = 10; -} - -// StatefulSetUpdateStrategy indicates the strategy that the StatefulSet -// controller will use to perform updates. It includes any additional parameters -// necessary to perform the update for the indicated strategy. -message StatefulSetUpdateStrategy { - // Type indicates the type of the StatefulSetUpdateStrategy. - optional string type = 1; - - // RollingUpdate is used to communicate parameters when Type is RollingUpdateStatefulSetStrategyType. - optional RollingUpdateStatefulSetStrategy rollingUpdate = 2; -} - diff --git a/vendor/k8s.io/api/apps/v1beta2/generated.proto b/vendor/k8s.io/api/apps/v1beta2/generated.proto deleted file mode 100644 index 17e4397..0000000 --- a/vendor/k8s.io/api/apps/v1beta2/generated.proto +++ /dev/null @@ -1,752 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.apps.v1beta2; - -import "k8s.io/api/core/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; -import "k8s.io/apimachinery/pkg/util/intstr/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1beta2"; - -// DEPRECATED - This group version of ControllerRevision is deprecated by apps/v1/ControllerRevision. See the -// release notes for more information. -// ControllerRevision implements an immutable snapshot of state data. Clients -// are responsible for serializing and deserializing the objects that contain -// their internal state. -// Once a ControllerRevision has been successfully created, it can not be updated. -// The API Server will fail validation of all requests that attempt to mutate -// the Data field. ControllerRevisions may, however, be deleted. Note that, due to its use by both -// the DaemonSet and StatefulSet controllers for update and rollback, this object is beta. However, -// it may be subject to name and representation changes in future releases, and clients should not -// depend on its stability. It is primarily for internal use by controllers. -message ControllerRevision { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Data is the serialized representation of the state. - optional k8s.io.apimachinery.pkg.runtime.RawExtension data = 2; - - // Revision indicates the revision of the state represented by Data. - optional int64 revision = 3; -} - -// ControllerRevisionList is a resource containing a list of ControllerRevision objects. -message ControllerRevisionList { - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is the list of ControllerRevisions - repeated ControllerRevision items = 2; -} - -// DEPRECATED - This group version of DaemonSet is deprecated by apps/v1/DaemonSet. See the release notes for -// more information. -// DaemonSet represents the configuration of a daemon set. -message DaemonSet { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // The desired behavior of this daemon set. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional DaemonSetSpec spec = 2; - - // The current status of this daemon set. This data may be - // out of date by some window of time. - // Populated by the system. - // Read-only. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional DaemonSetStatus status = 3; -} - -// DaemonSetCondition describes the state of a DaemonSet at a certain point. -message DaemonSetCondition { - // Type of DaemonSet condition. - optional string type = 1; - - // Status of the condition, one of True, False, Unknown. - optional string status = 2; - - // Last time the condition transitioned from one status to another. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; - - // The reason for the condition's last transition. - // +optional - optional string reason = 4; - - // A human readable message indicating details about the transition. - // +optional - optional string message = 5; -} - -// DaemonSetList is a collection of daemon sets. -message DaemonSetList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // A list of daemon sets. - repeated DaemonSet items = 2; -} - -// DaemonSetSpec is the specification of a daemon set. -message DaemonSetSpec { - // A label query over pods that are managed by the daemon set. - // Must match in order to be controlled. - // It must match the pod template's labels. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; - - // An object that describes the pod that will be created. - // The DaemonSet will create exactly one copy of this pod on every node - // that matches the template's node selector (or on every node if no node - // selector is specified). - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template - optional k8s.io.api.core.v1.PodTemplateSpec template = 2; - - // An update strategy to replace existing DaemonSet pods with new pods. - // +optional - optional DaemonSetUpdateStrategy updateStrategy = 3; - - // The minimum number of seconds for which a newly created DaemonSet pod should - // be ready without any of its container crashing, for it to be considered - // available. Defaults to 0 (pod will be considered available as soon as it - // is ready). - // +optional - optional int32 minReadySeconds = 4; - - // The number of old history to retain to allow rollback. - // This is a pointer to distinguish between explicit zero and not specified. - // Defaults to 10. - // +optional - optional int32 revisionHistoryLimit = 6; -} - -// DaemonSetStatus represents the current status of a daemon set. -message DaemonSetStatus { - // The number of nodes that are running at least 1 - // daemon pod and are supposed to run the daemon pod. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ - optional int32 currentNumberScheduled = 1; - - // The number of nodes that are running the daemon pod, but are - // not supposed to run the daemon pod. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ - optional int32 numberMisscheduled = 2; - - // The total number of nodes that should be running the daemon - // pod (including nodes correctly running the daemon pod). - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ - optional int32 desiredNumberScheduled = 3; - - // The number of nodes that should be running the daemon pod and have one - // or more of the daemon pod running and ready. - optional int32 numberReady = 4; - - // The most recent generation observed by the daemon set controller. - // +optional - optional int64 observedGeneration = 5; - - // The total number of nodes that are running updated daemon pod - // +optional - optional int32 updatedNumberScheduled = 6; - - // The number of nodes that should be running the - // daemon pod and have one or more of the daemon pod running and - // available (ready for at least spec.minReadySeconds) - // +optional - optional int32 numberAvailable = 7; - - // The number of nodes that should be running the - // daemon pod and have none of the daemon pod running and available - // (ready for at least spec.minReadySeconds) - // +optional - optional int32 numberUnavailable = 8; - - // Count of hash collisions for the DaemonSet. The DaemonSet controller - // uses this field as a collision avoidance mechanism when it needs to - // create the name for the newest ControllerRevision. - // +optional - optional int32 collisionCount = 9; - - // Represents the latest available observations of a DaemonSet's current state. - // +optional - // +patchMergeKey=type - // +patchStrategy=merge - repeated DaemonSetCondition conditions = 10; -} - -// DaemonSetUpdateStrategy is a struct used to control the update strategy for a DaemonSet. -message DaemonSetUpdateStrategy { - // Type of daemon set update. Can be "RollingUpdate" or "OnDelete". Default is RollingUpdate. - // +optional - optional string type = 1; - - // Rolling update config params. Present only if type = "RollingUpdate". - // --- - // TODO: Update this to follow our convention for oneOf, whatever we decide it - // to be. Same as Deployment `strategy.rollingUpdate`. - // See https://github.com/kubernetes/kubernetes/issues/35345 - // +optional - optional RollingUpdateDaemonSet rollingUpdate = 2; -} - -// DEPRECATED - This group version of Deployment is deprecated by apps/v1/Deployment. See the release notes for -// more information. -// Deployment enables declarative updates for Pods and ReplicaSets. -message Deployment { - // Standard object metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Specification of the desired behavior of the Deployment. - // +optional - optional DeploymentSpec spec = 2; - - // Most recently observed status of the Deployment. - // +optional - optional DeploymentStatus status = 3; -} - -// DeploymentCondition describes the state of a deployment at a certain point. -message DeploymentCondition { - // Type of deployment condition. - optional string type = 1; - - // Status of the condition, one of True, False, Unknown. - optional string status = 2; - - // The last time this condition was updated. - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 6; - - // Last time the condition transitioned from one status to another. - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 7; - - // The reason for the condition's last transition. - optional string reason = 4; - - // A human readable message indicating details about the transition. - optional string message = 5; -} - -// DeploymentList is a list of Deployments. -message DeploymentList { - // Standard list metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is the list of Deployments. - repeated Deployment items = 2; -} - -// DeploymentSpec is the specification of the desired behavior of the Deployment. -message DeploymentSpec { - // Number of desired pods. This is a pointer to distinguish between explicit - // zero and not specified. Defaults to 1. - // +optional - optional int32 replicas = 1; - - // Label selector for pods. Existing ReplicaSets whose pods are - // selected by this will be the ones affected by this deployment. - // It must match the pod template's labels. - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2; - - // Template describes the pods that will be created. - optional k8s.io.api.core.v1.PodTemplateSpec template = 3; - - // The deployment strategy to use to replace existing pods with new ones. - // +optional - // +patchStrategy=retainKeys - optional DeploymentStrategy strategy = 4; - - // Minimum number of seconds for which a newly created pod should be ready - // without any of its container crashing, for it to be considered available. - // Defaults to 0 (pod will be considered available as soon as it is ready) - // +optional - optional int32 minReadySeconds = 5; - - // The number of old ReplicaSets to retain to allow rollback. - // This is a pointer to distinguish between explicit zero and not specified. - // Defaults to 10. - // +optional - optional int32 revisionHistoryLimit = 6; - - // Indicates that the deployment is paused. - // +optional - optional bool paused = 7; - - // The maximum time in seconds for a deployment to make progress before it - // is considered to be failed. The deployment controller will continue to - // process failed deployments and a condition with a ProgressDeadlineExceeded - // reason will be surfaced in the deployment status. Note that progress will - // not be estimated during the time a deployment is paused. Defaults to 600s. - optional int32 progressDeadlineSeconds = 9; -} - -// DeploymentStatus is the most recently observed status of the Deployment. -message DeploymentStatus { - // The generation observed by the deployment controller. - // +optional - optional int64 observedGeneration = 1; - - // Total number of non-terminated pods targeted by this deployment (their labels match the selector). - // +optional - optional int32 replicas = 2; - - // Total number of non-terminated pods targeted by this deployment that have the desired template spec. - // +optional - optional int32 updatedReplicas = 3; - - // Total number of ready pods targeted by this deployment. - // +optional - optional int32 readyReplicas = 7; - - // Total number of available pods (ready for at least minReadySeconds) targeted by this deployment. - // +optional - optional int32 availableReplicas = 4; - - // Total number of unavailable pods targeted by this deployment. This is the total number of - // pods that are still required for the deployment to have 100% available capacity. They may - // either be pods that are running but not yet available or pods that still have not been created. - // +optional - optional int32 unavailableReplicas = 5; - - // Represents the latest available observations of a deployment's current state. - // +patchMergeKey=type - // +patchStrategy=merge - repeated DeploymentCondition conditions = 6; - - // Count of hash collisions for the Deployment. The Deployment controller uses this - // field as a collision avoidance mechanism when it needs to create the name for the - // newest ReplicaSet. - // +optional - optional int32 collisionCount = 8; -} - -// DeploymentStrategy describes how to replace existing pods with new ones. -message DeploymentStrategy { - // Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate. - // +optional - optional string type = 1; - - // Rolling update config params. Present only if DeploymentStrategyType = - // RollingUpdate. - // --- - // TODO: Update this to follow our convention for oneOf, whatever we decide it - // to be. - // +optional - optional RollingUpdateDeployment rollingUpdate = 2; -} - -// DEPRECATED - This group version of ReplicaSet is deprecated by apps/v1/ReplicaSet. See the release notes for -// more information. -// ReplicaSet ensures that a specified number of pod replicas are running at any given time. -message ReplicaSet { - // If the Labels of a ReplicaSet are empty, they are defaulted to - // be the same as the Pod(s) that the ReplicaSet manages. - // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec defines the specification of the desired behavior of the ReplicaSet. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional ReplicaSetSpec spec = 2; - - // Status is the most recently observed status of the ReplicaSet. - // This data may be out of date by some window of time. - // Populated by the system. - // Read-only. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional ReplicaSetStatus status = 3; -} - -// ReplicaSetCondition describes the state of a replica set at a certain point. -message ReplicaSetCondition { - // Type of replica set condition. - optional string type = 1; - - // Status of the condition, one of True, False, Unknown. - optional string status = 2; - - // The last time the condition transitioned from one status to another. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; - - // The reason for the condition's last transition. - // +optional - optional string reason = 4; - - // A human readable message indicating details about the transition. - // +optional - optional string message = 5; -} - -// ReplicaSetList is a collection of ReplicaSets. -message ReplicaSetList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // List of ReplicaSets. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller - repeated ReplicaSet items = 2; -} - -// ReplicaSetSpec is the specification of a ReplicaSet. -message ReplicaSetSpec { - // Replicas is the number of desired replicas. - // This is a pointer to distinguish between explicit zero and unspecified. - // Defaults to 1. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller - // +optional - optional int32 replicas = 1; - - // Minimum number of seconds for which a newly created pod should be ready - // without any of its container crashing, for it to be considered available. - // Defaults to 0 (pod will be considered available as soon as it is ready) - // +optional - optional int32 minReadySeconds = 4; - - // Selector is a label query over pods that should match the replica count. - // Label keys and values that must match in order to be controlled by this replica set. - // It must match the pod template's labels. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2; - - // Template is the object that describes the pod that will be created if - // insufficient replicas are detected. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template - // +optional - optional k8s.io.api.core.v1.PodTemplateSpec template = 3; -} - -// ReplicaSetStatus represents the current status of a ReplicaSet. -message ReplicaSetStatus { - // Replicas is the most recently oberved number of replicas. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller - optional int32 replicas = 1; - - // The number of pods that have labels matching the labels of the pod template of the replicaset. - // +optional - optional int32 fullyLabeledReplicas = 2; - - // The number of ready replicas for this replica set. - // +optional - optional int32 readyReplicas = 4; - - // The number of available replicas (ready for at least minReadySeconds) for this replica set. - // +optional - optional int32 availableReplicas = 5; - - // ObservedGeneration reflects the generation of the most recently observed ReplicaSet. - // +optional - optional int64 observedGeneration = 3; - - // Represents the latest available observations of a replica set's current state. - // +optional - // +patchMergeKey=type - // +patchStrategy=merge - repeated ReplicaSetCondition conditions = 6; -} - -// Spec to control the desired behavior of daemon set rolling update. -message RollingUpdateDaemonSet { - // The maximum number of DaemonSet pods that can be unavailable during the - // update. Value can be an absolute number (ex: 5) or a percentage of total - // number of DaemonSet pods at the start of the update (ex: 10%). Absolute - // number is calculated from percentage by rounding up. - // This cannot be 0. - // Default value is 1. - // Example: when this is set to 30%, at most 30% of the total number of nodes - // that should be running the daemon pod (i.e. status.desiredNumberScheduled) - // can have their pods stopped for an update at any given - // time. The update starts by stopping at most 30% of those DaemonSet pods - // and then brings up new DaemonSet pods in their place. Once the new pods - // are available, it then proceeds onto other DaemonSet pods, thus ensuring - // that at least 70% of original number of DaemonSet pods are available at - // all times during the update. - // +optional - optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 1; -} - -// Spec to control the desired behavior of rolling update. -message RollingUpdateDeployment { - // The maximum number of pods that can be unavailable during the update. - // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). - // Absolute number is calculated from percentage by rounding down. - // This can not be 0 if MaxSurge is 0. - // Defaults to 25%. - // Example: when this is set to 30%, the old ReplicaSet can be scaled down to 70% of desired pods - // immediately when the rolling update starts. Once new pods are ready, old ReplicaSet - // can be scaled down further, followed by scaling up the new ReplicaSet, ensuring - // that the total number of pods available at all times during the update is at - // least 70% of desired pods. - // +optional - optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 1; - - // The maximum number of pods that can be scheduled above the desired number of - // pods. - // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). - // This can not be 0 if MaxUnavailable is 0. - // Absolute number is calculated from percentage by rounding up. - // Defaults to 25%. - // Example: when this is set to 30%, the new ReplicaSet can be scaled up immediately when - // the rolling update starts, such that the total number of old and new pods do not exceed - // 130% of desired pods. Once old pods have been killed, - // new ReplicaSet can be scaled up further, ensuring that total number of pods running - // at any time during the update is at most 130% of desired pods. - // +optional - optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxSurge = 2; -} - -// RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType. -message RollingUpdateStatefulSetStrategy { - // Partition indicates the ordinal at which the StatefulSet should be - // partitioned. - // Default value is 0. - // +optional - optional int32 partition = 1; -} - -// Scale represents a scaling request for a resource. -message Scale { - // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. - // +optional - optional ScaleSpec spec = 2; - - // current status of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. Read-only. - // +optional - optional ScaleStatus status = 3; -} - -// ScaleSpec describes the attributes of a scale subresource -message ScaleSpec { - // desired number of instances for the scaled object. - // +optional - optional int32 replicas = 1; -} - -// ScaleStatus represents the current status of a scale subresource. -message ScaleStatus { - // actual number of observed instances of the scaled object. - optional int32 replicas = 1; - - // label query over pods that should match the replicas count. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors - // +optional - map selector = 2; - - // label selector for pods that should match the replicas count. This is a serializated - // version of both map-based and more expressive set-based selectors. This is done to - // avoid introspection in the clients. The string will be in the same format as the - // query-param syntax. If the target type only supports map-based selectors, both this - // field and map-based selector field are populated. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - // +optional - optional string targetSelector = 3; -} - -// DEPRECATED - This group version of StatefulSet is deprecated by apps/v1/StatefulSet. See the release notes for -// more information. -// StatefulSet represents a set of pods with consistent identities. -// Identities are defined as: -// - Network: A single stable DNS and hostname. -// - Storage: As many VolumeClaims as requested. -// The StatefulSet guarantees that a given network identity will always -// map to the same storage identity. -message StatefulSet { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec defines the desired identities of pods in this set. - // +optional - optional StatefulSetSpec spec = 2; - - // Status is the current status of Pods in this StatefulSet. This data - // may be out of date by some window of time. - // +optional - optional StatefulSetStatus status = 3; -} - -// StatefulSetCondition describes the state of a statefulset at a certain point. -message StatefulSetCondition { - // Type of statefulset condition. - optional string type = 1; - - // Status of the condition, one of True, False, Unknown. - optional string status = 2; - - // Last time the condition transitioned from one status to another. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; - - // The reason for the condition's last transition. - // +optional - optional string reason = 4; - - // A human readable message indicating details about the transition. - // +optional - optional string message = 5; -} - -// StatefulSetList is a collection of StatefulSets. -message StatefulSetList { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - repeated StatefulSet items = 2; -} - -// A StatefulSetSpec is the specification of a StatefulSet. -message StatefulSetSpec { - // replicas is the desired number of replicas of the given Template. - // These are replicas in the sense that they are instantiations of the - // same Template, but individual replicas also have a consistent identity. - // If unspecified, defaults to 1. - // TODO: Consider a rename of this field. - // +optional - optional int32 replicas = 1; - - // selector is a label query over pods that should match the replica count. - // It must match the pod template's labels. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2; - - // template is the object that describes the pod that will be created if - // insufficient replicas are detected. Each pod stamped out by the StatefulSet - // will fulfill this Template, but have a unique identity from the rest - // of the StatefulSet. - optional k8s.io.api.core.v1.PodTemplateSpec template = 3; - - // volumeClaimTemplates is a list of claims that pods are allowed to reference. - // The StatefulSet controller is responsible for mapping network identities to - // claims in a way that maintains the identity of a pod. Every claim in - // this list must have at least one matching (by name) volumeMount in one - // container in the template. A claim in this list takes precedence over - // any volumes in the template, with the same name. - // TODO: Define the behavior if a claim already exists with the same name. - // +optional - repeated k8s.io.api.core.v1.PersistentVolumeClaim volumeClaimTemplates = 4; - - // serviceName is the name of the service that governs this StatefulSet. - // This service must exist before the StatefulSet, and is responsible for - // the network identity of the set. Pods get DNS/hostnames that follow the - // pattern: pod-specific-string.serviceName.default.svc.cluster.local - // where "pod-specific-string" is managed by the StatefulSet controller. - optional string serviceName = 5; - - // podManagementPolicy controls how pods are created during initial scale up, - // when replacing pods on nodes, or when scaling down. The default policy is - // `OrderedReady`, where pods are created in increasing order (pod-0, then - // pod-1, etc) and the controller will wait until each pod is ready before - // continuing. When scaling down, the pods are removed in the opposite order. - // The alternative policy is `Parallel` which will create pods in parallel - // to match the desired scale without waiting, and on scale down will delete - // all pods at once. - // +optional - optional string podManagementPolicy = 6; - - // updateStrategy indicates the StatefulSetUpdateStrategy that will be - // employed to update Pods in the StatefulSet when a revision is made to - // Template. - optional StatefulSetUpdateStrategy updateStrategy = 7; - - // revisionHistoryLimit is the maximum number of revisions that will - // be maintained in the StatefulSet's revision history. The revision history - // consists of all revisions not represented by a currently applied - // StatefulSetSpec version. The default value is 10. - optional int32 revisionHistoryLimit = 8; -} - -// StatefulSetStatus represents the current state of a StatefulSet. -message StatefulSetStatus { - // observedGeneration is the most recent generation observed for this StatefulSet. It corresponds to the - // StatefulSet's generation, which is updated on mutation by the API Server. - // +optional - optional int64 observedGeneration = 1; - - // replicas is the number of Pods created by the StatefulSet controller. - optional int32 replicas = 2; - - // readyReplicas is the number of Pods created by the StatefulSet controller that have a Ready Condition. - optional int32 readyReplicas = 3; - - // currentReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version - // indicated by currentRevision. - optional int32 currentReplicas = 4; - - // updatedReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version - // indicated by updateRevision. - optional int32 updatedReplicas = 5; - - // currentRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the - // sequence [0,currentReplicas). - optional string currentRevision = 6; - - // updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence - // [replicas-updatedReplicas,replicas) - optional string updateRevision = 7; - - // collisionCount is the count of hash collisions for the StatefulSet. The StatefulSet controller - // uses this field as a collision avoidance mechanism when it needs to create the name for the - // newest ControllerRevision. - // +optional - optional int32 collisionCount = 9; - - // Represents the latest available observations of a statefulset's current state. - // +optional - // +patchMergeKey=type - // +patchStrategy=merge - repeated StatefulSetCondition conditions = 10; -} - -// StatefulSetUpdateStrategy indicates the strategy that the StatefulSet -// controller will use to perform updates. It includes any additional parameters -// necessary to perform the update for the indicated strategy. -message StatefulSetUpdateStrategy { - // Type indicates the type of the StatefulSetUpdateStrategy. - // Default is RollingUpdate. - // +optional - optional string type = 1; - - // RollingUpdate is used to communicate parameters when Type is RollingUpdateStatefulSetStrategyType. - // +optional - optional RollingUpdateStatefulSetStrategy rollingUpdate = 2; -} - diff --git a/vendor/k8s.io/api/auditregistration/v1alpha1/generated.proto b/vendor/k8s.io/api/auditregistration/v1alpha1/generated.proto deleted file mode 100644 index 674debe..0000000 --- a/vendor/k8s.io/api/auditregistration/v1alpha1/generated.proto +++ /dev/null @@ -1,162 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.auditregistration.v1alpha1; - -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1alpha1"; - -// AuditSink represents a cluster level audit sink -message AuditSink { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec defines the audit configuration spec - optional AuditSinkSpec spec = 2; -} - -// AuditSinkList is a list of AuditSink items. -message AuditSinkList { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // List of audit configurations. - repeated AuditSink items = 2; -} - -// AuditSinkSpec holds the spec for the audit sink -message AuditSinkSpec { - // Policy defines the policy for selecting which events should be sent to the webhook - // required - optional Policy policy = 1; - - // Webhook to send events - // required - optional Webhook webhook = 2; -} - -// Policy defines the configuration of how audit events are logged -message Policy { - // The Level that all requests are recorded at. - // available options: None, Metadata, Request, RequestResponse - // required - optional string level = 1; - - // Stages is a list of stages for which events are created. - // +optional - repeated string stages = 2; -} - -// ServiceReference holds a reference to Service.legacy.k8s.io -message ServiceReference { - // `namespace` is the namespace of the service. - // Required - optional string namespace = 1; - - // `name` is the name of the service. - // Required - optional string name = 2; - - // `path` is an optional URL path which will be sent in any request to - // this service. - // +optional - optional string path = 3; - - // If specified, the port on the service that hosting webhook. - // Default to 443 for backward compatibility. - // `port` should be a valid port number (1-65535, inclusive). - // +optional - optional int32 port = 4; -} - -// Webhook holds the configuration of the webhook -message Webhook { - // Throttle holds the options for throttling the webhook - // +optional - optional WebhookThrottleConfig throttle = 1; - - // ClientConfig holds the connection parameters for the webhook - // required - optional WebhookClientConfig clientConfig = 2; -} - -// WebhookClientConfig contains the information to make a connection with the webhook -message WebhookClientConfig { - // `url` gives the location of the webhook, in standard URL form - // (`scheme://host:port/path`). Exactly one of `url` or `service` - // must be specified. - // - // The `host` should not refer to a service running in the cluster; use - // the `service` field instead. The host might be resolved via external - // DNS in some apiservers (e.g., `kube-apiserver` cannot resolve - // in-cluster DNS as that would be a layering violation). `host` may - // also be an IP address. - // - // Please note that using `localhost` or `127.0.0.1` as a `host` is - // risky unless you take great care to run this webhook on all hosts - // which run an apiserver which might need to make calls to this - // webhook. Such installs are likely to be non-portable, i.e., not easy - // to turn up in a new cluster. - // - // The scheme must be "https"; the URL must begin with "https://". - // - // A path is optional, and if present may be any string permissible in - // a URL. You may use the path to pass an arbitrary string to the - // webhook, for example, a cluster identifier. - // - // Attempting to use a user or basic auth e.g. "user:password@" is not - // allowed. Fragments ("#...") and query parameters ("?...") are not - // allowed, either. - // - // +optional - optional string url = 1; - - // `service` is a reference to the service for this webhook. Either - // `service` or `url` must be specified. - // - // If the webhook is running within the cluster, then you should use `service`. - // - // +optional - optional ServiceReference service = 2; - - // `caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. - // If unspecified, system trust roots on the apiserver are used. - // +optional - optional bytes caBundle = 3; -} - -// WebhookThrottleConfig holds the configuration for throttling events -message WebhookThrottleConfig { - // ThrottleQPS maximum number of batches per second - // default 10 QPS - // +optional - optional int64 qps = 1; - - // ThrottleBurst is the maximum number of events sent at the same moment - // default 15 QPS - // +optional - optional int64 burst = 2; -} - diff --git a/vendor/k8s.io/api/authentication/v1/generated.proto b/vendor/k8s.io/api/authentication/v1/generated.proto deleted file mode 100644 index db7be17..0000000 --- a/vendor/k8s.io/api/authentication/v1/generated.proto +++ /dev/null @@ -1,182 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.authentication.v1; - -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1"; - -// BoundObjectReference is a reference to an object that a token is bound to. -message BoundObjectReference { - // Kind of the referent. Valid kinds are 'Pod' and 'Secret'. - // +optional - optional string kind = 1; - - // API version of the referent. - // +optional - optional string aPIVersion = 2; - - // Name of the referent. - // +optional - optional string name = 3; - - // UID of the referent. - // +optional - optional string uID = 4; -} - -// ExtraValue masks the value so protobuf can generate -// +protobuf.nullable=true -// +protobuf.options.(gogoproto.goproto_stringer)=false -message ExtraValue { - // items, if empty, will result in an empty slice - - repeated string items = 1; -} - -// TokenRequest requests a token for a given service account. -message TokenRequest { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - optional TokenRequestSpec spec = 2; - - // +optional - optional TokenRequestStatus status = 3; -} - -// TokenRequestSpec contains client provided parameters of a token request. -message TokenRequestSpec { - // Audiences are the intendend audiences of the token. A recipient of a - // token must identitfy themself with an identifier in the list of - // audiences of the token, and otherwise should reject the token. A - // token issued for multiple audiences may be used to authenticate - // against any of the audiences listed but implies a high degree of - // trust between the target audiences. - repeated string audiences = 1; - - // ExpirationSeconds is the requested duration of validity of the request. The - // token issuer may return a token with a different validity duration so a - // client needs to check the 'expiration' field in a response. - // +optional - optional int64 expirationSeconds = 4; - - // BoundObjectRef is a reference to an object that the token will be bound to. - // The token will only be valid for as long as the bound object exists. - // NOTE: The API server's TokenReview endpoint will validate the - // BoundObjectRef, but other audiences may not. Keep ExpirationSeconds - // small if you want prompt revocation. - // +optional - optional BoundObjectReference boundObjectRef = 3; -} - -// TokenRequestStatus is the result of a token request. -message TokenRequestStatus { - // Token is the opaque bearer token. - optional string token = 1; - - // ExpirationTimestamp is the time of expiration of the returned token. - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time expirationTimestamp = 2; -} - -// TokenReview attempts to authenticate a token to a known user. -// Note: TokenReview requests may be cached by the webhook token authenticator -// plugin in the kube-apiserver. -message TokenReview { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec holds information about the request being evaluated - optional TokenReviewSpec spec = 2; - - // Status is filled in by the server and indicates whether the request can be authenticated. - // +optional - optional TokenReviewStatus status = 3; -} - -// TokenReviewSpec is a description of the token authentication request. -message TokenReviewSpec { - // Token is the opaque bearer token. - // +optional - optional string token = 1; - - // Audiences is a list of the identifiers that the resource server presented - // with the token identifies as. Audience-aware token authenticators will - // verify that the token was intended for at least one of the audiences in - // this list. If no audiences are provided, the audience will default to the - // audience of the Kubernetes apiserver. - // +optional - repeated string audiences = 2; -} - -// TokenReviewStatus is the result of the token authentication request. -message TokenReviewStatus { - // Authenticated indicates that the token was associated with a known user. - // +optional - optional bool authenticated = 1; - - // User is the UserInfo associated with the provided token. - // +optional - optional UserInfo user = 2; - - // Audiences are audience identifiers chosen by the authenticator that are - // compatible with both the TokenReview and token. An identifier is any - // identifier in the intersection of the TokenReviewSpec audiences and the - // token's audiences. A client of the TokenReview API that sets the - // spec.audiences field should validate that a compatible audience identifier - // is returned in the status.audiences field to ensure that the TokenReview - // server is audience aware. If a TokenReview returns an empty - // status.audience field where status.authenticated is "true", the token is - // valid against the audience of the Kubernetes API server. - // +optional - repeated string audiences = 4; - - // Error indicates that the token couldn't be checked - // +optional - optional string error = 3; -} - -// UserInfo holds the information about the user needed to implement the -// user.Info interface. -message UserInfo { - // The name that uniquely identifies this user among all active users. - // +optional - optional string username = 1; - - // A unique value that identifies this user across time. If this user is - // deleted and another user by the same name is added, they will have - // different UIDs. - // +optional - optional string uid = 2; - - // The names of groups this user is a part of. - // +optional - repeated string groups = 3; - - // Any additional information provided by the authenticator. - // +optional - map extra = 4; -} - diff --git a/vendor/k8s.io/api/authentication/v1beta1/generated.proto b/vendor/k8s.io/api/authentication/v1beta1/generated.proto deleted file mode 100644 index caf2a6a..0000000 --- a/vendor/k8s.io/api/authentication/v1beta1/generated.proto +++ /dev/null @@ -1,118 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.authentication.v1beta1; - -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1beta1"; - -// ExtraValue masks the value so protobuf can generate -// +protobuf.nullable=true -// +protobuf.options.(gogoproto.goproto_stringer)=false -message ExtraValue { - // items, if empty, will result in an empty slice - - repeated string items = 1; -} - -// TokenReview attempts to authenticate a token to a known user. -// Note: TokenReview requests may be cached by the webhook token authenticator -// plugin in the kube-apiserver. -message TokenReview { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec holds information about the request being evaluated - optional TokenReviewSpec spec = 2; - - // Status is filled in by the server and indicates whether the request can be authenticated. - // +optional - optional TokenReviewStatus status = 3; -} - -// TokenReviewSpec is a description of the token authentication request. -message TokenReviewSpec { - // Token is the opaque bearer token. - // +optional - optional string token = 1; - - // Audiences is a list of the identifiers that the resource server presented - // with the token identifies as. Audience-aware token authenticators will - // verify that the token was intended for at least one of the audiences in - // this list. If no audiences are provided, the audience will default to the - // audience of the Kubernetes apiserver. - // +optional - repeated string audiences = 2; -} - -// TokenReviewStatus is the result of the token authentication request. -message TokenReviewStatus { - // Authenticated indicates that the token was associated with a known user. - // +optional - optional bool authenticated = 1; - - // User is the UserInfo associated with the provided token. - // +optional - optional UserInfo user = 2; - - // Audiences are audience identifiers chosen by the authenticator that are - // compatible with both the TokenReview and token. An identifier is any - // identifier in the intersection of the TokenReviewSpec audiences and the - // token's audiences. A client of the TokenReview API that sets the - // spec.audiences field should validate that a compatible audience identifier - // is returned in the status.audiences field to ensure that the TokenReview - // server is audience aware. If a TokenReview returns an empty - // status.audience field where status.authenticated is "true", the token is - // valid against the audience of the Kubernetes API server. - // +optional - repeated string audiences = 4; - - // Error indicates that the token couldn't be checked - // +optional - optional string error = 3; -} - -// UserInfo holds the information about the user needed to implement the -// user.Info interface. -message UserInfo { - // The name that uniquely identifies this user among all active users. - // +optional - optional string username = 1; - - // A unique value that identifies this user across time. If this user is - // deleted and another user by the same name is added, they will have - // different UIDs. - // +optional - optional string uid = 2; - - // The names of groups this user is a part of. - // +optional - repeated string groups = 3; - - // Any additional information provided by the authenticator. - // +optional - map extra = 4; -} - diff --git a/vendor/k8s.io/api/authorization/v1/generated.proto b/vendor/k8s.io/api/authorization/v1/generated.proto deleted file mode 100644 index f68a04e..0000000 --- a/vendor/k8s.io/api/authorization/v1/generated.proto +++ /dev/null @@ -1,272 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.authorization.v1; - -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1"; - -// ExtraValue masks the value so protobuf can generate -// +protobuf.nullable=true -// +protobuf.options.(gogoproto.goproto_stringer)=false -message ExtraValue { - // items, if empty, will result in an empty slice - - repeated string items = 1; -} - -// LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. -// Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions -// checking. -message LocalSubjectAccessReview { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec holds information about the request being evaluated. spec.namespace must be equal to the namespace - // you made the request against. If empty, it is defaulted. - optional SubjectAccessReviewSpec spec = 2; - - // Status is filled in by the server and indicates whether the request is allowed or not - // +optional - optional SubjectAccessReviewStatus status = 3; -} - -// NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface -message NonResourceAttributes { - // Path is the URL path of the request - // +optional - optional string path = 1; - - // Verb is the standard HTTP verb - // +optional - optional string verb = 2; -} - -// NonResourceRule holds information that describes a rule for the non-resource -message NonResourceRule { - // Verb is a list of kubernetes non-resource API verbs, like: get, post, put, delete, patch, head, options. "*" means all. - repeated string verbs = 1; - - // NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, - // final step in the path. "*" means all. - // +optional - repeated string nonResourceURLs = 2; -} - -// ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface -message ResourceAttributes { - // Namespace is the namespace of the action being requested. Currently, there is no distinction between no namespace and all namespaces - // "" (empty) is defaulted for LocalSubjectAccessReviews - // "" (empty) is empty for cluster-scoped resources - // "" (empty) means "all" for namespace scoped resources from a SubjectAccessReview or SelfSubjectAccessReview - // +optional - optional string namespace = 1; - - // Verb is a kubernetes resource API verb, like: get, list, watch, create, update, delete, proxy. "*" means all. - // +optional - optional string verb = 2; - - // Group is the API Group of the Resource. "*" means all. - // +optional - optional string group = 3; - - // Version is the API Version of the Resource. "*" means all. - // +optional - optional string version = 4; - - // Resource is one of the existing resource types. "*" means all. - // +optional - optional string resource = 5; - - // Subresource is one of the existing resource types. "" means none. - // +optional - optional string subresource = 6; - - // Name is the name of the resource being requested for a "get" or deleted for a "delete". "" (empty) means all. - // +optional - optional string name = 7; -} - -// ResourceRule is the list of actions the subject is allowed to perform on resources. The list ordering isn't significant, -// may contain duplicates, and possibly be incomplete. -message ResourceRule { - // Verb is a list of kubernetes resource API verbs, like: get, list, watch, create, update, delete, proxy. "*" means all. - repeated string verbs = 1; - - // APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of - // the enumerated resources in any API group will be allowed. "*" means all. - // +optional - repeated string apiGroups = 2; - - // Resources is a list of resources this rule applies to. "*" means all in the specified apiGroups. - // "*/foo" represents the subresource 'foo' for all resources in the specified apiGroups. - // +optional - repeated string resources = 3; - - // ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. "*" means all. - // +optional - repeated string resourceNames = 4; -} - -// SelfSubjectAccessReview checks whether or the current user can perform an action. Not filling in a -// spec.namespace means "in all namespaces". Self is a special case, because users should always be able -// to check whether they can perform an action -message SelfSubjectAccessReview { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec holds information about the request being evaluated. user and groups must be empty - optional SelfSubjectAccessReviewSpec spec = 2; - - // Status is filled in by the server and indicates whether the request is allowed or not - // +optional - optional SubjectAccessReviewStatus status = 3; -} - -// SelfSubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes -// and NonResourceAuthorizationAttributes must be set -message SelfSubjectAccessReviewSpec { - // ResourceAuthorizationAttributes describes information for a resource access request - // +optional - optional ResourceAttributes resourceAttributes = 1; - - // NonResourceAttributes describes information for a non-resource access request - // +optional - optional NonResourceAttributes nonResourceAttributes = 2; -} - -// SelfSubjectRulesReview enumerates the set of actions the current user can perform within a namespace. -// The returned list of actions may be incomplete depending on the server's authorization mode, -// and any errors experienced during the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide actions, -// or to quickly let an end user reason about their permissions. It should NOT Be used by external systems to -// drive authorization decisions as this raises confused deputy, cache lifetime/revocation, and correctness concerns. -// SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server. -message SelfSubjectRulesReview { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec holds information about the request being evaluated. - optional SelfSubjectRulesReviewSpec spec = 2; - - // Status is filled in by the server and indicates the set of actions a user can perform. - // +optional - optional SubjectRulesReviewStatus status = 3; -} - -message SelfSubjectRulesReviewSpec { - // Namespace to evaluate rules for. Required. - optional string namespace = 1; -} - -// SubjectAccessReview checks whether or not a user or group can perform an action. -message SubjectAccessReview { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec holds information about the request being evaluated - optional SubjectAccessReviewSpec spec = 2; - - // Status is filled in by the server and indicates whether the request is allowed or not - // +optional - optional SubjectAccessReviewStatus status = 3; -} - -// SubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes -// and NonResourceAuthorizationAttributes must be set -message SubjectAccessReviewSpec { - // ResourceAuthorizationAttributes describes information for a resource access request - // +optional - optional ResourceAttributes resourceAttributes = 1; - - // NonResourceAttributes describes information for a non-resource access request - // +optional - optional NonResourceAttributes nonResourceAttributes = 2; - - // User is the user you're testing for. - // If you specify "User" but not "Groups", then is it interpreted as "What if User were not a member of any groups - // +optional - optional string user = 3; - - // Groups is the groups you're testing for. - // +optional - repeated string groups = 4; - - // Extra corresponds to the user.Info.GetExtra() method from the authenticator. Since that is input to the authorizer - // it needs a reflection here. - // +optional - map extra = 5; - - // UID information about the requesting user. - // +optional - optional string uid = 6; -} - -// SubjectAccessReviewStatus -message SubjectAccessReviewStatus { - // Allowed is required. True if the action would be allowed, false otherwise. - optional bool allowed = 1; - - // Denied is optional. True if the action would be denied, otherwise - // false. If both allowed is false and denied is false, then the - // authorizer has no opinion on whether to authorize the action. Denied - // may not be true if Allowed is true. - // +optional - optional bool denied = 4; - - // Reason is optional. It indicates why a request was allowed or denied. - // +optional - optional string reason = 2; - - // EvaluationError is an indication that some error occurred during the authorization check. - // It is entirely possible to get an error and be able to continue determine authorization status in spite of it. - // For instance, RBAC can be missing a role, but enough roles are still present and bound to reason about the request. - // +optional - optional string evaluationError = 3; -} - -// SubjectRulesReviewStatus contains the result of a rules check. This check can be incomplete depending on -// the set of authorizers the server is configured with and any errors experienced during evaluation. -// Because authorization rules are additive, if a rule appears in a list it's safe to assume the subject has that permission, -// even if that list is incomplete. -message SubjectRulesReviewStatus { - // ResourceRules is the list of actions the subject is allowed to perform on resources. - // The list ordering isn't significant, may contain duplicates, and possibly be incomplete. - repeated ResourceRule resourceRules = 1; - - // NonResourceRules is the list of actions the subject is allowed to perform on non-resources. - // The list ordering isn't significant, may contain duplicates, and possibly be incomplete. - repeated NonResourceRule nonResourceRules = 2; - - // Incomplete is true when the rules returned by this call are incomplete. This is most commonly - // encountered when an authorizer, such as an external authorizer, doesn't support rules evaluation. - optional bool incomplete = 3; - - // EvaluationError can appear in combination with Rules. It indicates an error occurred during - // rule evaluation, such as an authorizer that doesn't support rule evaluation, and that - // ResourceRules and/or NonResourceRules may be incomplete. - // +optional - optional string evaluationError = 4; -} - diff --git a/vendor/k8s.io/api/authorization/v1beta1/generated.proto b/vendor/k8s.io/api/authorization/v1beta1/generated.proto deleted file mode 100644 index 3876a3e..0000000 --- a/vendor/k8s.io/api/authorization/v1beta1/generated.proto +++ /dev/null @@ -1,272 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.authorization.v1beta1; - -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1beta1"; - -// ExtraValue masks the value so protobuf can generate -// +protobuf.nullable=true -// +protobuf.options.(gogoproto.goproto_stringer)=false -message ExtraValue { - // items, if empty, will result in an empty slice - - repeated string items = 1; -} - -// LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. -// Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions -// checking. -message LocalSubjectAccessReview { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec holds information about the request being evaluated. spec.namespace must be equal to the namespace - // you made the request against. If empty, it is defaulted. - optional SubjectAccessReviewSpec spec = 2; - - // Status is filled in by the server and indicates whether the request is allowed or not - // +optional - optional SubjectAccessReviewStatus status = 3; -} - -// NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface -message NonResourceAttributes { - // Path is the URL path of the request - // +optional - optional string path = 1; - - // Verb is the standard HTTP verb - // +optional - optional string verb = 2; -} - -// NonResourceRule holds information that describes a rule for the non-resource -message NonResourceRule { - // Verb is a list of kubernetes non-resource API verbs, like: get, post, put, delete, patch, head, options. "*" means all. - repeated string verbs = 1; - - // NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, - // final step in the path. "*" means all. - // +optional - repeated string nonResourceURLs = 2; -} - -// ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface -message ResourceAttributes { - // Namespace is the namespace of the action being requested. Currently, there is no distinction between no namespace and all namespaces - // "" (empty) is defaulted for LocalSubjectAccessReviews - // "" (empty) is empty for cluster-scoped resources - // "" (empty) means "all" for namespace scoped resources from a SubjectAccessReview or SelfSubjectAccessReview - // +optional - optional string namespace = 1; - - // Verb is a kubernetes resource API verb, like: get, list, watch, create, update, delete, proxy. "*" means all. - // +optional - optional string verb = 2; - - // Group is the API Group of the Resource. "*" means all. - // +optional - optional string group = 3; - - // Version is the API Version of the Resource. "*" means all. - // +optional - optional string version = 4; - - // Resource is one of the existing resource types. "*" means all. - // +optional - optional string resource = 5; - - // Subresource is one of the existing resource types. "" means none. - // +optional - optional string subresource = 6; - - // Name is the name of the resource being requested for a "get" or deleted for a "delete". "" (empty) means all. - // +optional - optional string name = 7; -} - -// ResourceRule is the list of actions the subject is allowed to perform on resources. The list ordering isn't significant, -// may contain duplicates, and possibly be incomplete. -message ResourceRule { - // Verb is a list of kubernetes resource API verbs, like: get, list, watch, create, update, delete, proxy. "*" means all. - repeated string verbs = 1; - - // APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of - // the enumerated resources in any API group will be allowed. "*" means all. - // +optional - repeated string apiGroups = 2; - - // Resources is a list of resources this rule applies to. "*" means all in the specified apiGroups. - // "*/foo" represents the subresource 'foo' for all resources in the specified apiGroups. - // +optional - repeated string resources = 3; - - // ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. "*" means all. - // +optional - repeated string resourceNames = 4; -} - -// SelfSubjectAccessReview checks whether or the current user can perform an action. Not filling in a -// spec.namespace means "in all namespaces". Self is a special case, because users should always be able -// to check whether they can perform an action -message SelfSubjectAccessReview { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec holds information about the request being evaluated. user and groups must be empty - optional SelfSubjectAccessReviewSpec spec = 2; - - // Status is filled in by the server and indicates whether the request is allowed or not - // +optional - optional SubjectAccessReviewStatus status = 3; -} - -// SelfSubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes -// and NonResourceAuthorizationAttributes must be set -message SelfSubjectAccessReviewSpec { - // ResourceAuthorizationAttributes describes information for a resource access request - // +optional - optional ResourceAttributes resourceAttributes = 1; - - // NonResourceAttributes describes information for a non-resource access request - // +optional - optional NonResourceAttributes nonResourceAttributes = 2; -} - -// SelfSubjectRulesReview enumerates the set of actions the current user can perform within a namespace. -// The returned list of actions may be incomplete depending on the server's authorization mode, -// and any errors experienced during the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide actions, -// or to quickly let an end user reason about their permissions. It should NOT Be used by external systems to -// drive authorization decisions as this raises confused deputy, cache lifetime/revocation, and correctness concerns. -// SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server. -message SelfSubjectRulesReview { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec holds information about the request being evaluated. - optional SelfSubjectRulesReviewSpec spec = 2; - - // Status is filled in by the server and indicates the set of actions a user can perform. - // +optional - optional SubjectRulesReviewStatus status = 3; -} - -message SelfSubjectRulesReviewSpec { - // Namespace to evaluate rules for. Required. - optional string namespace = 1; -} - -// SubjectAccessReview checks whether or not a user or group can perform an action. -message SubjectAccessReview { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec holds information about the request being evaluated - optional SubjectAccessReviewSpec spec = 2; - - // Status is filled in by the server and indicates whether the request is allowed or not - // +optional - optional SubjectAccessReviewStatus status = 3; -} - -// SubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes -// and NonResourceAuthorizationAttributes must be set -message SubjectAccessReviewSpec { - // ResourceAuthorizationAttributes describes information for a resource access request - // +optional - optional ResourceAttributes resourceAttributes = 1; - - // NonResourceAttributes describes information for a non-resource access request - // +optional - optional NonResourceAttributes nonResourceAttributes = 2; - - // User is the user you're testing for. - // If you specify "User" but not "Group", then is it interpreted as "What if User were not a member of any groups - // +optional - optional string user = 3; - - // Groups is the groups you're testing for. - // +optional - repeated string group = 4; - - // Extra corresponds to the user.Info.GetExtra() method from the authenticator. Since that is input to the authorizer - // it needs a reflection here. - // +optional - map extra = 5; - - // UID information about the requesting user. - // +optional - optional string uid = 6; -} - -// SubjectAccessReviewStatus -message SubjectAccessReviewStatus { - // Allowed is required. True if the action would be allowed, false otherwise. - optional bool allowed = 1; - - // Denied is optional. True if the action would be denied, otherwise - // false. If both allowed is false and denied is false, then the - // authorizer has no opinion on whether to authorize the action. Denied - // may not be true if Allowed is true. - // +optional - optional bool denied = 4; - - // Reason is optional. It indicates why a request was allowed or denied. - // +optional - optional string reason = 2; - - // EvaluationError is an indication that some error occurred during the authorization check. - // It is entirely possible to get an error and be able to continue determine authorization status in spite of it. - // For instance, RBAC can be missing a role, but enough roles are still present and bound to reason about the request. - // +optional - optional string evaluationError = 3; -} - -// SubjectRulesReviewStatus contains the result of a rules check. This check can be incomplete depending on -// the set of authorizers the server is configured with and any errors experienced during evaluation. -// Because authorization rules are additive, if a rule appears in a list it's safe to assume the subject has that permission, -// even if that list is incomplete. -message SubjectRulesReviewStatus { - // ResourceRules is the list of actions the subject is allowed to perform on resources. - // The list ordering isn't significant, may contain duplicates, and possibly be incomplete. - repeated ResourceRule resourceRules = 1; - - // NonResourceRules is the list of actions the subject is allowed to perform on non-resources. - // The list ordering isn't significant, may contain duplicates, and possibly be incomplete. - repeated NonResourceRule nonResourceRules = 2; - - // Incomplete is true when the rules returned by this call are incomplete. This is most commonly - // encountered when an authorizer, such as an external authorizer, doesn't support rules evaluation. - optional bool incomplete = 3; - - // EvaluationError can appear in combination with Rules. It indicates an error occurred during - // rule evaluation, such as an authorizer that doesn't support rule evaluation, and that - // ResourceRules and/or NonResourceRules may be incomplete. - // +optional - optional string evaluationError = 4; -} - diff --git a/vendor/k8s.io/api/autoscaling/v1/generated.proto b/vendor/k8s.io/api/autoscaling/v1/generated.proto deleted file mode 100644 index f50ed9d..0000000 --- a/vendor/k8s.io/api/autoscaling/v1/generated.proto +++ /dev/null @@ -1,419 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.autoscaling.v1; - -import "k8s.io/api/core/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/api/resource/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1"; - -// CrossVersionObjectReference contains enough information to let you identify the referred resource. -message CrossVersionObjectReference { - // Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - optional string kind = 1; - - // Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names - optional string name = 2; - - // API version of the referent - // +optional - optional string apiVersion = 3; -} - -// ExternalMetricSource indicates how to scale on a metric not associated with -// any Kubernetes object (for example length of queue in cloud -// messaging service, or QPS from loadbalancer running outside of cluster). -message ExternalMetricSource { - // metricName is the name of the metric in question. - optional string metricName = 1; - - // metricSelector is used to identify a specific time series - // within a given metric. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2; - - // targetValue is the target value of the metric (as a quantity). - // Mutually exclusive with TargetAverageValue. - // +optional - optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3; - - // targetAverageValue is the target per-pod value of global metric (as a quantity). - // Mutually exclusive with TargetValue. - // +optional - optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 4; -} - -// ExternalMetricStatus indicates the current value of a global metric -// not associated with any Kubernetes object. -message ExternalMetricStatus { - // metricName is the name of a metric used for autoscaling in - // metric system. - optional string metricName = 1; - - // metricSelector is used to identify a specific time series - // within a given metric. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2; - - // currentValue is the current value of the metric (as a quantity) - optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3; - - // currentAverageValue is the current value of metric averaged over autoscaled pods. - // +optional - optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 4; -} - -// configuration of a horizontal pod autoscaler. -message HorizontalPodAutoscaler { - // Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // behaviour of autoscaler. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. - // +optional - optional HorizontalPodAutoscalerSpec spec = 2; - - // current information about the autoscaler. - // +optional - optional HorizontalPodAutoscalerStatus status = 3; -} - -// HorizontalPodAutoscalerCondition describes the state of -// a HorizontalPodAutoscaler at a certain point. -message HorizontalPodAutoscalerCondition { - // type describes the current condition - optional string type = 1; - - // status is the status of the condition (True, False, Unknown) - optional string status = 2; - - // lastTransitionTime is the last time the condition transitioned from - // one status to another - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; - - // reason is the reason for the condition's last transition. - // +optional - optional string reason = 4; - - // message is a human-readable explanation containing details about - // the transition - // +optional - optional string message = 5; -} - -// list of horizontal pod autoscaler objects. -message HorizontalPodAutoscalerList { - // Standard list metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // list of horizontal pod autoscaler objects. - repeated HorizontalPodAutoscaler items = 2; -} - -// specification of a horizontal pod autoscaler. -message HorizontalPodAutoscalerSpec { - // reference to scaled resource; horizontal pod autoscaler will learn the current resource consumption - // and will set the desired number of pods by using its Scale subresource. - optional CrossVersionObjectReference scaleTargetRef = 1; - - // minReplicas is the lower limit for the number of replicas to which the autoscaler - // can scale down. It defaults to 1 pod. minReplicas is allowed to be 0 if the - // alpha feature gate HPAScaleToZero is enabled and at least one Object or External - // metric is configured. Scaling is active as long as at least one metric value is - // available. - // +optional - optional int32 minReplicas = 2; - - // upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas. - optional int32 maxReplicas = 3; - - // target average CPU utilization (represented as a percentage of requested CPU) over all the pods; - // if not specified the default autoscaling policy will be used. - // +optional - optional int32 targetCPUUtilizationPercentage = 4; -} - -// current status of a horizontal pod autoscaler -message HorizontalPodAutoscalerStatus { - // most recent generation observed by this autoscaler. - // +optional - optional int64 observedGeneration = 1; - - // last time the HorizontalPodAutoscaler scaled the number of pods; - // used by the autoscaler to control how often the number of pods is changed. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScaleTime = 2; - - // current number of replicas of pods managed by this autoscaler. - optional int32 currentReplicas = 3; - - // desired number of replicas of pods managed by this autoscaler. - optional int32 desiredReplicas = 4; - - // current average CPU utilization over all pods, represented as a percentage of requested CPU, - // e.g. 70 means that an average pod is using now 70% of its requested CPU. - // +optional - optional int32 currentCPUUtilizationPercentage = 5; -} - -// MetricSpec specifies how to scale based on a single metric -// (only `type` and one other matching field should be set at once). -message MetricSpec { - // type is the type of metric source. It should be one of "Object", - // "Pods" or "Resource", each mapping to a matching field in the object. - optional string type = 1; - - // object refers to a metric describing a single kubernetes object - // (for example, hits-per-second on an Ingress object). - // +optional - optional ObjectMetricSource object = 2; - - // pods refers to a metric describing each pod in the current scale target - // (for example, transactions-processed-per-second). The values will be - // averaged together before being compared to the target value. - // +optional - optional PodsMetricSource pods = 3; - - // resource refers to a resource metric (such as those specified in - // requests and limits) known to Kubernetes describing each pod in the - // current scale target (e.g. CPU or memory). Such metrics are built in to - // Kubernetes, and have special scaling options on top of those available - // to normal per-pod metrics using the "pods" source. - // +optional - optional ResourceMetricSource resource = 4; - - // external refers to a global metric that is not associated - // with any Kubernetes object. It allows autoscaling based on information - // coming from components running outside of cluster - // (for example length of queue in cloud messaging service, or - // QPS from loadbalancer running outside of cluster). - // +optional - optional ExternalMetricSource external = 5; -} - -// MetricStatus describes the last-read state of a single metric. -message MetricStatus { - // type is the type of metric source. It will be one of "Object", - // "Pods" or "Resource", each corresponds to a matching field in the object. - optional string type = 1; - - // object refers to a metric describing a single kubernetes object - // (for example, hits-per-second on an Ingress object). - // +optional - optional ObjectMetricStatus object = 2; - - // pods refers to a metric describing each pod in the current scale target - // (for example, transactions-processed-per-second). The values will be - // averaged together before being compared to the target value. - // +optional - optional PodsMetricStatus pods = 3; - - // resource refers to a resource metric (such as those specified in - // requests and limits) known to Kubernetes describing each pod in the - // current scale target (e.g. CPU or memory). Such metrics are built in to - // Kubernetes, and have special scaling options on top of those available - // to normal per-pod metrics using the "pods" source. - // +optional - optional ResourceMetricStatus resource = 4; - - // external refers to a global metric that is not associated - // with any Kubernetes object. It allows autoscaling based on information - // coming from components running outside of cluster - // (for example length of queue in cloud messaging service, or - // QPS from loadbalancer running outside of cluster). - // +optional - optional ExternalMetricStatus external = 5; -} - -// ObjectMetricSource indicates how to scale on a metric describing a -// kubernetes object (for example, hits-per-second on an Ingress object). -message ObjectMetricSource { - // target is the described Kubernetes object. - optional CrossVersionObjectReference target = 1; - - // metricName is the name of the metric in question. - optional string metricName = 2; - - // targetValue is the target value of the metric (as a quantity). - optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3; - - // selector is the string-encoded form of a standard kubernetes label selector for the given metric. - // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping - // When unset, just the metricName will be used to gather metrics. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4; - - // averageValue is the target value of the average of the - // metric across all relevant pods (as a quantity) - // +optional - optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5; -} - -// ObjectMetricStatus indicates the current value of a metric describing a -// kubernetes object (for example, hits-per-second on an Ingress object). -message ObjectMetricStatus { - // target is the described Kubernetes object. - optional CrossVersionObjectReference target = 1; - - // metricName is the name of the metric in question. - optional string metricName = 2; - - // currentValue is the current value of the metric (as a quantity). - optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3; - - // selector is the string-encoded form of a standard kubernetes label selector for the given metric - // When set in the ObjectMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping. - // When unset, just the metricName will be used to gather metrics. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4; - - // averageValue is the current value of the average of the - // metric across all relevant pods (as a quantity) - // +optional - optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5; -} - -// PodsMetricSource indicates how to scale on a metric describing each pod in -// the current scale target (for example, transactions-processed-per-second). -// The values will be averaged together before being compared to the target -// value. -message PodsMetricSource { - // metricName is the name of the metric in question - optional string metricName = 1; - - // targetAverageValue is the target value of the average of the - // metric across all relevant pods (as a quantity) - optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 2; - - // selector is the string-encoded form of a standard kubernetes label selector for the given metric - // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping - // When unset, just the metricName will be used to gather metrics. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3; -} - -// PodsMetricStatus indicates the current value of a metric describing each pod in -// the current scale target (for example, transactions-processed-per-second). -message PodsMetricStatus { - // metricName is the name of the metric in question - optional string metricName = 1; - - // currentAverageValue is the current value of the average of the - // metric across all relevant pods (as a quantity) - optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 2; - - // selector is the string-encoded form of a standard kubernetes label selector for the given metric - // When set in the PodsMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping. - // When unset, just the metricName will be used to gather metrics. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3; -} - -// ResourceMetricSource indicates how to scale on a resource metric known to -// Kubernetes, as specified in requests and limits, describing each pod in the -// current scale target (e.g. CPU or memory). The values will be averaged -// together before being compared to the target. Such metrics are built in to -// Kubernetes, and have special scaling options on top of those available to -// normal per-pod metrics using the "pods" source. Only one "target" type -// should be set. -message ResourceMetricSource { - // name is the name of the resource in question. - optional string name = 1; - - // targetAverageUtilization is the target value of the average of the - // resource metric across all relevant pods, represented as a percentage of - // the requested value of the resource for the pods. - // +optional - optional int32 targetAverageUtilization = 2; - - // targetAverageValue is the target value of the average of the - // resource metric across all relevant pods, as a raw value (instead of as - // a percentage of the request), similar to the "pods" metric source type. - // +optional - optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 3; -} - -// ResourceMetricStatus indicates the current value of a resource metric known to -// Kubernetes, as specified in requests and limits, describing each pod in the -// current scale target (e.g. CPU or memory). Such metrics are built in to -// Kubernetes, and have special scaling options on top of those available to -// normal per-pod metrics using the "pods" source. -message ResourceMetricStatus { - // name is the name of the resource in question. - optional string name = 1; - - // currentAverageUtilization is the current value of the average of the - // resource metric across all relevant pods, represented as a percentage of - // the requested value of the resource for the pods. It will only be - // present if `targetAverageValue` was set in the corresponding metric - // specification. - // +optional - optional int32 currentAverageUtilization = 2; - - // currentAverageValue is the current value of the average of the - // resource metric across all relevant pods, as a raw value (instead of as - // a percentage of the request), similar to the "pods" metric source type. - // It will always be set, regardless of the corresponding metric specification. - optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 3; -} - -// Scale represents a scaling request for a resource. -message Scale { - // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. - // +optional - optional ScaleSpec spec = 2; - - // current status of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. Read-only. - // +optional - optional ScaleStatus status = 3; -} - -// ScaleSpec describes the attributes of a scale subresource. -message ScaleSpec { - // desired number of instances for the scaled object. - // +optional - optional int32 replicas = 1; -} - -// ScaleStatus represents the current status of a scale subresource. -message ScaleStatus { - // actual number of observed instances of the scaled object. - optional int32 replicas = 1; - - // label query over pods that should match the replicas count. This is same - // as the label selector but in the string format to avoid introspection - // by clients. The string will be in the same format as the query-param syntax. - // More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors - // +optional - optional string selector = 2; -} - diff --git a/vendor/k8s.io/api/autoscaling/v2beta1/generated.proto b/vendor/k8s.io/api/autoscaling/v2beta1/generated.proto deleted file mode 100644 index f90f93f..0000000 --- a/vendor/k8s.io/api/autoscaling/v2beta1/generated.proto +++ /dev/null @@ -1,400 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.autoscaling.v2beta1; - -import "k8s.io/api/core/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/api/resource/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v2beta1"; - -// CrossVersionObjectReference contains enough information to let you identify the referred resource. -message CrossVersionObjectReference { - // Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - optional string kind = 1; - - // Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names - optional string name = 2; - - // API version of the referent - // +optional - optional string apiVersion = 3; -} - -// ExternalMetricSource indicates how to scale on a metric not associated with -// any Kubernetes object (for example length of queue in cloud -// messaging service, or QPS from loadbalancer running outside of cluster). -// Exactly one "target" type should be set. -message ExternalMetricSource { - // metricName is the name of the metric in question. - optional string metricName = 1; - - // metricSelector is used to identify a specific time series - // within a given metric. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2; - - // targetValue is the target value of the metric (as a quantity). - // Mutually exclusive with TargetAverageValue. - // +optional - optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3; - - // targetAverageValue is the target per-pod value of global metric (as a quantity). - // Mutually exclusive with TargetValue. - // +optional - optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 4; -} - -// ExternalMetricStatus indicates the current value of a global metric -// not associated with any Kubernetes object. -message ExternalMetricStatus { - // metricName is the name of a metric used for autoscaling in - // metric system. - optional string metricName = 1; - - // metricSelector is used to identify a specific time series - // within a given metric. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2; - - // currentValue is the current value of the metric (as a quantity) - optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3; - - // currentAverageValue is the current value of metric averaged over autoscaled pods. - // +optional - optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 4; -} - -// HorizontalPodAutoscaler is the configuration for a horizontal pod -// autoscaler, which automatically manages the replica count of any resource -// implementing the scale subresource based on the metrics specified. -message HorizontalPodAutoscaler { - // metadata is the standard object metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // spec is the specification for the behaviour of the autoscaler. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. - // +optional - optional HorizontalPodAutoscalerSpec spec = 2; - - // status is the current information about the autoscaler. - // +optional - optional HorizontalPodAutoscalerStatus status = 3; -} - -// HorizontalPodAutoscalerCondition describes the state of -// a HorizontalPodAutoscaler at a certain point. -message HorizontalPodAutoscalerCondition { - // type describes the current condition - optional string type = 1; - - // status is the status of the condition (True, False, Unknown) - optional string status = 2; - - // lastTransitionTime is the last time the condition transitioned from - // one status to another - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; - - // reason is the reason for the condition's last transition. - // +optional - optional string reason = 4; - - // message is a human-readable explanation containing details about - // the transition - // +optional - optional string message = 5; -} - -// HorizontalPodAutoscaler is a list of horizontal pod autoscaler objects. -message HorizontalPodAutoscalerList { - // metadata is the standard list metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // items is the list of horizontal pod autoscaler objects. - repeated HorizontalPodAutoscaler items = 2; -} - -// HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler. -message HorizontalPodAutoscalerSpec { - // scaleTargetRef points to the target resource to scale, and is used to the pods for which metrics - // should be collected, as well as to actually change the replica count. - optional CrossVersionObjectReference scaleTargetRef = 1; - - // minReplicas is the lower limit for the number of replicas to which the autoscaler - // can scale down. It defaults to 1 pod. minReplicas is allowed to be 0 if the - // alpha feature gate HPAScaleToZero is enabled and at least one Object or External - // metric is configured. Scaling is active as long as at least one metric value is - // available. - // +optional - optional int32 minReplicas = 2; - - // maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up. - // It cannot be less that minReplicas. - optional int32 maxReplicas = 3; - - // metrics contains the specifications for which to use to calculate the - // desired replica count (the maximum replica count across all metrics will - // be used). The desired replica count is calculated multiplying the - // ratio between the target value and the current value by the current - // number of pods. Ergo, metrics used must decrease as the pod count is - // increased, and vice-versa. See the individual metric source types for - // more information about how each type of metric must respond. - // +optional - repeated MetricSpec metrics = 4; -} - -// HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler. -message HorizontalPodAutoscalerStatus { - // observedGeneration is the most recent generation observed by this autoscaler. - // +optional - optional int64 observedGeneration = 1; - - // lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods, - // used by the autoscaler to control how often the number of pods is changed. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScaleTime = 2; - - // currentReplicas is current number of replicas of pods managed by this autoscaler, - // as last seen by the autoscaler. - optional int32 currentReplicas = 3; - - // desiredReplicas is the desired number of replicas of pods managed by this autoscaler, - // as last calculated by the autoscaler. - optional int32 desiredReplicas = 4; - - // currentMetrics is the last read state of the metrics used by this autoscaler. - // +optional - repeated MetricStatus currentMetrics = 5; - - // conditions is the set of conditions required for this autoscaler to scale its target, - // and indicates whether or not those conditions are met. - repeated HorizontalPodAutoscalerCondition conditions = 6; -} - -// MetricSpec specifies how to scale based on a single metric -// (only `type` and one other matching field should be set at once). -message MetricSpec { - // type is the type of metric source. It should be one of "Object", - // "Pods" or "Resource", each mapping to a matching field in the object. - optional string type = 1; - - // object refers to a metric describing a single kubernetes object - // (for example, hits-per-second on an Ingress object). - // +optional - optional ObjectMetricSource object = 2; - - // pods refers to a metric describing each pod in the current scale target - // (for example, transactions-processed-per-second). The values will be - // averaged together before being compared to the target value. - // +optional - optional PodsMetricSource pods = 3; - - // resource refers to a resource metric (such as those specified in - // requests and limits) known to Kubernetes describing each pod in the - // current scale target (e.g. CPU or memory). Such metrics are built in to - // Kubernetes, and have special scaling options on top of those available - // to normal per-pod metrics using the "pods" source. - // +optional - optional ResourceMetricSource resource = 4; - - // external refers to a global metric that is not associated - // with any Kubernetes object. It allows autoscaling based on information - // coming from components running outside of cluster - // (for example length of queue in cloud messaging service, or - // QPS from loadbalancer running outside of cluster). - // +optional - optional ExternalMetricSource external = 5; -} - -// MetricStatus describes the last-read state of a single metric. -message MetricStatus { - // type is the type of metric source. It will be one of "Object", - // "Pods" or "Resource", each corresponds to a matching field in the object. - optional string type = 1; - - // object refers to a metric describing a single kubernetes object - // (for example, hits-per-second on an Ingress object). - // +optional - optional ObjectMetricStatus object = 2; - - // pods refers to a metric describing each pod in the current scale target - // (for example, transactions-processed-per-second). The values will be - // averaged together before being compared to the target value. - // +optional - optional PodsMetricStatus pods = 3; - - // resource refers to a resource metric (such as those specified in - // requests and limits) known to Kubernetes describing each pod in the - // current scale target (e.g. CPU or memory). Such metrics are built in to - // Kubernetes, and have special scaling options on top of those available - // to normal per-pod metrics using the "pods" source. - // +optional - optional ResourceMetricStatus resource = 4; - - // external refers to a global metric that is not associated - // with any Kubernetes object. It allows autoscaling based on information - // coming from components running outside of cluster - // (for example length of queue in cloud messaging service, or - // QPS from loadbalancer running outside of cluster). - // +optional - optional ExternalMetricStatus external = 5; -} - -// ObjectMetricSource indicates how to scale on a metric describing a -// kubernetes object (for example, hits-per-second on an Ingress object). -message ObjectMetricSource { - // target is the described Kubernetes object. - optional CrossVersionObjectReference target = 1; - - // metricName is the name of the metric in question. - optional string metricName = 2; - - // targetValue is the target value of the metric (as a quantity). - optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3; - - // selector is the string-encoded form of a standard kubernetes label selector for the given metric - // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping - // When unset, just the metricName will be used to gather metrics. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4; - - // averageValue is the target value of the average of the - // metric across all relevant pods (as a quantity) - // +optional - optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5; -} - -// ObjectMetricStatus indicates the current value of a metric describing a -// kubernetes object (for example, hits-per-second on an Ingress object). -message ObjectMetricStatus { - // target is the described Kubernetes object. - optional CrossVersionObjectReference target = 1; - - // metricName is the name of the metric in question. - optional string metricName = 2; - - // currentValue is the current value of the metric (as a quantity). - optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3; - - // selector is the string-encoded form of a standard kubernetes label selector for the given metric - // When set in the ObjectMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping. - // When unset, just the metricName will be used to gather metrics. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4; - - // averageValue is the current value of the average of the - // metric across all relevant pods (as a quantity) - // +optional - optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5; -} - -// PodsMetricSource indicates how to scale on a metric describing each pod in -// the current scale target (for example, transactions-processed-per-second). -// The values will be averaged together before being compared to the target -// value. -message PodsMetricSource { - // metricName is the name of the metric in question - optional string metricName = 1; - - // targetAverageValue is the target value of the average of the - // metric across all relevant pods (as a quantity) - optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 2; - - // selector is the string-encoded form of a standard kubernetes label selector for the given metric - // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping - // When unset, just the metricName will be used to gather metrics. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3; -} - -// PodsMetricStatus indicates the current value of a metric describing each pod in -// the current scale target (for example, transactions-processed-per-second). -message PodsMetricStatus { - // metricName is the name of the metric in question - optional string metricName = 1; - - // currentAverageValue is the current value of the average of the - // metric across all relevant pods (as a quantity) - optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 2; - - // selector is the string-encoded form of a standard kubernetes label selector for the given metric - // When set in the PodsMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping. - // When unset, just the metricName will be used to gather metrics. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3; -} - -// ResourceMetricSource indicates how to scale on a resource metric known to -// Kubernetes, as specified in requests and limits, describing each pod in the -// current scale target (e.g. CPU or memory). The values will be averaged -// together before being compared to the target. Such metrics are built in to -// Kubernetes, and have special scaling options on top of those available to -// normal per-pod metrics using the "pods" source. Only one "target" type -// should be set. -message ResourceMetricSource { - // name is the name of the resource in question. - optional string name = 1; - - // targetAverageUtilization is the target value of the average of the - // resource metric across all relevant pods, represented as a percentage of - // the requested value of the resource for the pods. - // +optional - optional int32 targetAverageUtilization = 2; - - // targetAverageValue is the target value of the average of the - // resource metric across all relevant pods, as a raw value (instead of as - // a percentage of the request), similar to the "pods" metric source type. - // +optional - optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 3; -} - -// ResourceMetricStatus indicates the current value of a resource metric known to -// Kubernetes, as specified in requests and limits, describing each pod in the -// current scale target (e.g. CPU or memory). Such metrics are built in to -// Kubernetes, and have special scaling options on top of those available to -// normal per-pod metrics using the "pods" source. -message ResourceMetricStatus { - // name is the name of the resource in question. - optional string name = 1; - - // currentAverageUtilization is the current value of the average of the - // resource metric across all relevant pods, represented as a percentage of - // the requested value of the resource for the pods. It will only be - // present if `targetAverageValue` was set in the corresponding metric - // specification. - // +optional - optional int32 currentAverageUtilization = 2; - - // currentAverageValue is the current value of the average of the - // resource metric across all relevant pods, as a raw value (instead of as - // a percentage of the request), similar to the "pods" metric source type. - // It will always be set, regardless of the corresponding metric specification. - optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 3; -} - diff --git a/vendor/k8s.io/api/autoscaling/v2beta2/generated.proto b/vendor/k8s.io/api/autoscaling/v2beta2/generated.proto deleted file mode 100644 index 80f1d34..0000000 --- a/vendor/k8s.io/api/autoscaling/v2beta2/generated.proto +++ /dev/null @@ -1,372 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.autoscaling.v2beta2; - -import "k8s.io/api/core/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/api/resource/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v2beta2"; - -// CrossVersionObjectReference contains enough information to let you identify the referred resource. -message CrossVersionObjectReference { - // Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - optional string kind = 1; - - // Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names - optional string name = 2; - - // API version of the referent - // +optional - optional string apiVersion = 3; -} - -// ExternalMetricSource indicates how to scale on a metric not associated with -// any Kubernetes object (for example length of queue in cloud -// messaging service, or QPS from loadbalancer running outside of cluster). -message ExternalMetricSource { - // metric identifies the target metric by name and selector - optional MetricIdentifier metric = 1; - - // target specifies the target value for the given metric - optional MetricTarget target = 2; -} - -// ExternalMetricStatus indicates the current value of a global metric -// not associated with any Kubernetes object. -message ExternalMetricStatus { - // metric identifies the target metric by name and selector - optional MetricIdentifier metric = 1; - - // current contains the current value for the given metric - optional MetricValueStatus current = 2; -} - -// HorizontalPodAutoscaler is the configuration for a horizontal pod -// autoscaler, which automatically manages the replica count of any resource -// implementing the scale subresource based on the metrics specified. -message HorizontalPodAutoscaler { - // metadata is the standard object metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // spec is the specification for the behaviour of the autoscaler. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. - // +optional - optional HorizontalPodAutoscalerSpec spec = 2; - - // status is the current information about the autoscaler. - // +optional - optional HorizontalPodAutoscalerStatus status = 3; -} - -// HorizontalPodAutoscalerCondition describes the state of -// a HorizontalPodAutoscaler at a certain point. -message HorizontalPodAutoscalerCondition { - // type describes the current condition - optional string type = 1; - - // status is the status of the condition (True, False, Unknown) - optional string status = 2; - - // lastTransitionTime is the last time the condition transitioned from - // one status to another - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; - - // reason is the reason for the condition's last transition. - // +optional - optional string reason = 4; - - // message is a human-readable explanation containing details about - // the transition - // +optional - optional string message = 5; -} - -// HorizontalPodAutoscalerList is a list of horizontal pod autoscaler objects. -message HorizontalPodAutoscalerList { - // metadata is the standard list metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // items is the list of horizontal pod autoscaler objects. - repeated HorizontalPodAutoscaler items = 2; -} - -// HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler. -message HorizontalPodAutoscalerSpec { - // scaleTargetRef points to the target resource to scale, and is used to the pods for which metrics - // should be collected, as well as to actually change the replica count. - optional CrossVersionObjectReference scaleTargetRef = 1; - - // minReplicas is the lower limit for the number of replicas to which the autoscaler - // can scale down. It defaults to 1 pod. minReplicas is allowed to be 0 if the - // alpha feature gate HPAScaleToZero is enabled and at least one Object or External - // metric is configured. Scaling is active as long as at least one metric value is - // available. - // +optional - optional int32 minReplicas = 2; - - // maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up. - // It cannot be less that minReplicas. - optional int32 maxReplicas = 3; - - // metrics contains the specifications for which to use to calculate the - // desired replica count (the maximum replica count across all metrics will - // be used). The desired replica count is calculated multiplying the - // ratio between the target value and the current value by the current - // number of pods. Ergo, metrics used must decrease as the pod count is - // increased, and vice-versa. See the individual metric source types for - // more information about how each type of metric must respond. - // If not set, the default metric will be set to 80% average CPU utilization. - // +optional - repeated MetricSpec metrics = 4; -} - -// HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler. -message HorizontalPodAutoscalerStatus { - // observedGeneration is the most recent generation observed by this autoscaler. - // +optional - optional int64 observedGeneration = 1; - - // lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods, - // used by the autoscaler to control how often the number of pods is changed. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScaleTime = 2; - - // currentReplicas is current number of replicas of pods managed by this autoscaler, - // as last seen by the autoscaler. - optional int32 currentReplicas = 3; - - // desiredReplicas is the desired number of replicas of pods managed by this autoscaler, - // as last calculated by the autoscaler. - optional int32 desiredReplicas = 4; - - // currentMetrics is the last read state of the metrics used by this autoscaler. - // +optional - repeated MetricStatus currentMetrics = 5; - - // conditions is the set of conditions required for this autoscaler to scale its target, - // and indicates whether or not those conditions are met. - repeated HorizontalPodAutoscalerCondition conditions = 6; -} - -// MetricIdentifier defines the name and optionally selector for a metric -message MetricIdentifier { - // name is the name of the given metric - optional string name = 1; - - // selector is the string-encoded form of a standard kubernetes label selector for the given metric - // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping. - // When unset, just the metricName will be used to gather metrics. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2; -} - -// MetricSpec specifies how to scale based on a single metric -// (only `type` and one other matching field should be set at once). -message MetricSpec { - // type is the type of metric source. It should be one of "Object", - // "Pods" or "Resource", each mapping to a matching field in the object. - optional string type = 1; - - // object refers to a metric describing a single kubernetes object - // (for example, hits-per-second on an Ingress object). - // +optional - optional ObjectMetricSource object = 2; - - // pods refers to a metric describing each pod in the current scale target - // (for example, transactions-processed-per-second). The values will be - // averaged together before being compared to the target value. - // +optional - optional PodsMetricSource pods = 3; - - // resource refers to a resource metric (such as those specified in - // requests and limits) known to Kubernetes describing each pod in the - // current scale target (e.g. CPU or memory). Such metrics are built in to - // Kubernetes, and have special scaling options on top of those available - // to normal per-pod metrics using the "pods" source. - // +optional - optional ResourceMetricSource resource = 4; - - // external refers to a global metric that is not associated - // with any Kubernetes object. It allows autoscaling based on information - // coming from components running outside of cluster - // (for example length of queue in cloud messaging service, or - // QPS from loadbalancer running outside of cluster). - // +optional - optional ExternalMetricSource external = 5; -} - -// MetricStatus describes the last-read state of a single metric. -message MetricStatus { - // type is the type of metric source. It will be one of "Object", - // "Pods" or "Resource", each corresponds to a matching field in the object. - optional string type = 1; - - // object refers to a metric describing a single kubernetes object - // (for example, hits-per-second on an Ingress object). - // +optional - optional ObjectMetricStatus object = 2; - - // pods refers to a metric describing each pod in the current scale target - // (for example, transactions-processed-per-second). The values will be - // averaged together before being compared to the target value. - // +optional - optional PodsMetricStatus pods = 3; - - // resource refers to a resource metric (such as those specified in - // requests and limits) known to Kubernetes describing each pod in the - // current scale target (e.g. CPU or memory). Such metrics are built in to - // Kubernetes, and have special scaling options on top of those available - // to normal per-pod metrics using the "pods" source. - // +optional - optional ResourceMetricStatus resource = 4; - - // external refers to a global metric that is not associated - // with any Kubernetes object. It allows autoscaling based on information - // coming from components running outside of cluster - // (for example length of queue in cloud messaging service, or - // QPS from loadbalancer running outside of cluster). - // +optional - optional ExternalMetricStatus external = 5; -} - -// MetricTarget defines the target value, average value, or average utilization of a specific metric -message MetricTarget { - // type represents whether the metric type is Utilization, Value, or AverageValue - optional string type = 1; - - // value is the target value of the metric (as a quantity). - // +optional - optional k8s.io.apimachinery.pkg.api.resource.Quantity value = 2; - - // averageValue is the target value of the average of the - // metric across all relevant pods (as a quantity) - // +optional - optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 3; - - // averageUtilization is the target value of the average of the - // resource metric across all relevant pods, represented as a percentage of - // the requested value of the resource for the pods. - // Currently only valid for Resource metric source type - // +optional - optional int32 averageUtilization = 4; -} - -// MetricValueStatus holds the current value for a metric -message MetricValueStatus { - // value is the current value of the metric (as a quantity). - // +optional - optional k8s.io.apimachinery.pkg.api.resource.Quantity value = 1; - - // averageValue is the current value of the average of the - // metric across all relevant pods (as a quantity) - // +optional - optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 2; - - // currentAverageUtilization is the current value of the average of the - // resource metric across all relevant pods, represented as a percentage of - // the requested value of the resource for the pods. - // +optional - optional int32 averageUtilization = 3; -} - -// ObjectMetricSource indicates how to scale on a metric describing a -// kubernetes object (for example, hits-per-second on an Ingress object). -message ObjectMetricSource { - optional CrossVersionObjectReference describedObject = 1; - - // target specifies the target value for the given metric - optional MetricTarget target = 2; - - // metric identifies the target metric by name and selector - optional MetricIdentifier metric = 3; -} - -// ObjectMetricStatus indicates the current value of a metric describing a -// kubernetes object (for example, hits-per-second on an Ingress object). -message ObjectMetricStatus { - // metric identifies the target metric by name and selector - optional MetricIdentifier metric = 1; - - // current contains the current value for the given metric - optional MetricValueStatus current = 2; - - optional CrossVersionObjectReference describedObject = 3; -} - -// PodsMetricSource indicates how to scale on a metric describing each pod in -// the current scale target (for example, transactions-processed-per-second). -// The values will be averaged together before being compared to the target -// value. -message PodsMetricSource { - // metric identifies the target metric by name and selector - optional MetricIdentifier metric = 1; - - // target specifies the target value for the given metric - optional MetricTarget target = 2; -} - -// PodsMetricStatus indicates the current value of a metric describing each pod in -// the current scale target (for example, transactions-processed-per-second). -message PodsMetricStatus { - // metric identifies the target metric by name and selector - optional MetricIdentifier metric = 1; - - // current contains the current value for the given metric - optional MetricValueStatus current = 2; -} - -// ResourceMetricSource indicates how to scale on a resource metric known to -// Kubernetes, as specified in requests and limits, describing each pod in the -// current scale target (e.g. CPU or memory). The values will be averaged -// together before being compared to the target. Such metrics are built in to -// Kubernetes, and have special scaling options on top of those available to -// normal per-pod metrics using the "pods" source. Only one "target" type -// should be set. -message ResourceMetricSource { - // name is the name of the resource in question. - optional string name = 1; - - // target specifies the target value for the given metric - optional MetricTarget target = 2; -} - -// ResourceMetricStatus indicates the current value of a resource metric known to -// Kubernetes, as specified in requests and limits, describing each pod in the -// current scale target (e.g. CPU or memory). Such metrics are built in to -// Kubernetes, and have special scaling options on top of those available to -// normal per-pod metrics using the "pods" source. -message ResourceMetricStatus { - // Name is the name of the resource in question. - optional string name = 1; - - // current contains the current value for the given metric - optional MetricValueStatus current = 2; -} - diff --git a/vendor/k8s.io/api/batch/v1/generated.proto b/vendor/k8s.io/api/batch/v1/generated.proto deleted file mode 100644 index 75de45f..0000000 --- a/vendor/k8s.io/api/batch/v1/generated.proto +++ /dev/null @@ -1,184 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.batch.v1; - -import "k8s.io/api/core/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1"; - -// Job represents the configuration of a single job. -message Job { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Specification of the desired behavior of a job. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional JobSpec spec = 2; - - // Current status of a job. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional JobStatus status = 3; -} - -// JobCondition describes current state of a job. -message JobCondition { - // Type of job condition, Complete or Failed. - optional string type = 1; - - // Status of the condition, one of True, False, Unknown. - optional string status = 2; - - // Last time the condition was checked. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastProbeTime = 3; - - // Last time the condition transit from one status to another. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 4; - - // (brief) reason for the condition's last transition. - // +optional - optional string reason = 5; - - // Human readable message indicating details about last transition. - // +optional - optional string message = 6; -} - -// JobList is a collection of jobs. -message JobList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // items is the list of Jobs. - repeated Job items = 2; -} - -// JobSpec describes how the job execution will look like. -message JobSpec { - // Specifies the maximum desired number of pods the job should - // run at any given time. The actual number of pods running in steady state will - // be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), - // i.e. when the work left to do is less than max parallelism. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ - // +optional - optional int32 parallelism = 1; - - // Specifies the desired number of successfully finished pods the - // job should be run with. Setting to nil means that the success of any - // pod signals the success of all pods, and allows parallelism to have any positive - // value. Setting to 1 means that parallelism is limited to 1 and the success of that - // pod signals the success of the job. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ - // +optional - optional int32 completions = 2; - - // Specifies the duration in seconds relative to the startTime that the job may be active - // before the system tries to terminate it; value must be positive integer - // +optional - optional int64 activeDeadlineSeconds = 3; - - // Specifies the number of retries before marking this job failed. - // Defaults to 6 - // +optional - optional int32 backoffLimit = 7; - - // A label query over pods that should match the pod count. - // Normally, the system sets this field for you. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4; - - // manualSelector controls generation of pod labels and pod selectors. - // Leave `manualSelector` unset unless you are certain what you are doing. - // When false or unset, the system pick labels unique to this job - // and appends those labels to the pod template. When true, - // the user is responsible for picking unique labels and specifying - // the selector. Failure to pick a unique label may cause this - // and other jobs to not function correctly. However, You may see - // `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` - // API. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector - // +optional - optional bool manualSelector = 5; - - // Describes the pod that will be created when executing a job. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ - optional k8s.io.api.core.v1.PodTemplateSpec template = 6; - - // ttlSecondsAfterFinished limits the lifetime of a Job that has finished - // execution (either Complete or Failed). If this field is set, - // ttlSecondsAfterFinished after the Job finishes, it is eligible to be - // automatically deleted. When the Job is being deleted, its lifecycle - // guarantees (e.g. finalizers) will be honored. If this field is unset, - // the Job won't be automatically deleted. If this field is set to zero, - // the Job becomes eligible to be deleted immediately after it finishes. - // This field is alpha-level and is only honored by servers that enable the - // TTLAfterFinished feature. - // +optional - optional int32 ttlSecondsAfterFinished = 8; -} - -// JobStatus represents the current state of a Job. -message JobStatus { - // The latest available observations of an object's current state. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ - // +optional - // +patchMergeKey=type - // +patchStrategy=merge - repeated JobCondition conditions = 1; - - // Represents time when the job was acknowledged by the job controller. - // It is not guaranteed to be set in happens-before order across separate operations. - // It is represented in RFC3339 form and is in UTC. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time startTime = 2; - - // Represents time when the job was completed. It is not guaranteed to - // be set in happens-before order across separate operations. - // It is represented in RFC3339 form and is in UTC. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time completionTime = 3; - - // The number of actively running pods. - // +optional - optional int32 active = 4; - - // The number of pods which reached phase Succeeded. - // +optional - optional int32 succeeded = 5; - - // The number of pods which reached phase Failed. - // +optional - optional int32 failed = 6; -} - diff --git a/vendor/k8s.io/api/batch/v1beta1/generated.proto b/vendor/k8s.io/api/batch/v1beta1/generated.proto deleted file mode 100644 index 995b4f3..0000000 --- a/vendor/k8s.io/api/batch/v1beta1/generated.proto +++ /dev/null @@ -1,137 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.batch.v1beta1; - -import "k8s.io/api/batch/v1/generated.proto"; -import "k8s.io/api/core/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1beta1"; - -// CronJob represents the configuration of a single cron job. -message CronJob { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Specification of the desired behavior of a cron job, including the schedule. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional CronJobSpec spec = 2; - - // Current status of a cron job. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional CronJobStatus status = 3; -} - -// CronJobList is a collection of cron jobs. -message CronJobList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // items is the list of CronJobs. - repeated CronJob items = 2; -} - -// CronJobSpec describes how the job execution will look like and when it will actually run. -message CronJobSpec { - // The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. - optional string schedule = 1; - - // Optional deadline in seconds for starting the job if it misses scheduled - // time for any reason. Missed jobs executions will be counted as failed ones. - // +optional - optional int64 startingDeadlineSeconds = 2; - - // Specifies how to treat concurrent executions of a Job. - // Valid values are: - // - "Allow" (default): allows CronJobs to run concurrently; - // - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet; - // - "Replace": cancels currently running job and replaces it with a new one - // +optional - optional string concurrencyPolicy = 3; - - // This flag tells the controller to suspend subsequent executions, it does - // not apply to already started executions. Defaults to false. - // +optional - optional bool suspend = 4; - - // Specifies the job that will be created when executing a CronJob. - optional JobTemplateSpec jobTemplate = 5; - - // The number of successful finished jobs to retain. - // This is a pointer to distinguish between explicit zero and not specified. - // Defaults to 3. - // +optional - optional int32 successfulJobsHistoryLimit = 6; - - // The number of failed finished jobs to retain. - // This is a pointer to distinguish between explicit zero and not specified. - // Defaults to 1. - // +optional - optional int32 failedJobsHistoryLimit = 7; -} - -// CronJobStatus represents the current state of a cron job. -message CronJobStatus { - // A list of pointers to currently running jobs. - // +optional - repeated k8s.io.api.core.v1.ObjectReference active = 1; - - // Information when was the last time the job was successfully scheduled. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; -} - -// JobTemplate describes a template for creating copies of a predefined pod. -message JobTemplate { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Defines jobs that will be created from this template. - // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional JobTemplateSpec template = 2; -} - -// JobTemplateSpec describes the data a Job should have when created from a template -message JobTemplateSpec { - // Standard object's metadata of the jobs created from this template. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Specification of the desired behavior of the job. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional k8s.io.api.batch.v1.JobSpec spec = 2; -} - diff --git a/vendor/k8s.io/api/batch/v2alpha1/generated.proto b/vendor/k8s.io/api/batch/v2alpha1/generated.proto deleted file mode 100644 index 0bba13b..0000000 --- a/vendor/k8s.io/api/batch/v2alpha1/generated.proto +++ /dev/null @@ -1,135 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.batch.v2alpha1; - -import "k8s.io/api/batch/v1/generated.proto"; -import "k8s.io/api/core/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v2alpha1"; - -// CronJob represents the configuration of a single cron job. -message CronJob { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Specification of the desired behavior of a cron job, including the schedule. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional CronJobSpec spec = 2; - - // Current status of a cron job. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional CronJobStatus status = 3; -} - -// CronJobList is a collection of cron jobs. -message CronJobList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // items is the list of CronJobs. - repeated CronJob items = 2; -} - -// CronJobSpec describes how the job execution will look like and when it will actually run. -message CronJobSpec { - // The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. - optional string schedule = 1; - - // Optional deadline in seconds for starting the job if it misses scheduled - // time for any reason. Missed jobs executions will be counted as failed ones. - // +optional - optional int64 startingDeadlineSeconds = 2; - - // Specifies how to treat concurrent executions of a Job. - // Valid values are: - // - "Allow" (default): allows CronJobs to run concurrently; - // - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet; - // - "Replace": cancels currently running job and replaces it with a new one - // +optional - optional string concurrencyPolicy = 3; - - // This flag tells the controller to suspend subsequent executions, it does - // not apply to already started executions. Defaults to false. - // +optional - optional bool suspend = 4; - - // Specifies the job that will be created when executing a CronJob. - optional JobTemplateSpec jobTemplate = 5; - - // The number of successful finished jobs to retain. - // This is a pointer to distinguish between explicit zero and not specified. - // +optional - optional int32 successfulJobsHistoryLimit = 6; - - // The number of failed finished jobs to retain. - // This is a pointer to distinguish between explicit zero and not specified. - // +optional - optional int32 failedJobsHistoryLimit = 7; -} - -// CronJobStatus represents the current state of a cron job. -message CronJobStatus { - // A list of pointers to currently running jobs. - // +optional - repeated k8s.io.api.core.v1.ObjectReference active = 1; - - // Information when was the last time the job was successfully scheduled. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4; -} - -// JobTemplate describes a template for creating copies of a predefined pod. -message JobTemplate { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Defines jobs that will be created from this template. - // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional JobTemplateSpec template = 2; -} - -// JobTemplateSpec describes the data a Job should have when created from a template -message JobTemplateSpec { - // Standard object's metadata of the jobs created from this template. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Specification of the desired behavior of the job. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional k8s.io.api.batch.v1.JobSpec spec = 2; -} - diff --git a/vendor/k8s.io/api/certificates/v1beta1/generated.proto b/vendor/k8s.io/api/certificates/v1beta1/generated.proto deleted file mode 100644 index 5200224..0000000 --- a/vendor/k8s.io/api/certificates/v1beta1/generated.proto +++ /dev/null @@ -1,121 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.certificates.v1beta1; - -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1beta1"; - -// Describes a certificate signing request -message CertificateSigningRequest { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // The certificate request itself and any additional information. - // +optional - optional CertificateSigningRequestSpec spec = 2; - - // Derived information about the request. - // +optional - optional CertificateSigningRequestStatus status = 3; -} - -message CertificateSigningRequestCondition { - // request approval state, currently Approved or Denied. - optional string type = 1; - - // brief reason for the request state - // +optional - optional string reason = 2; - - // human readable message with details about the request state - // +optional - optional string message = 3; - - // timestamp for the last update to this condition - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 4; -} - -message CertificateSigningRequestList { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - repeated CertificateSigningRequest items = 2; -} - -// This information is immutable after the request is created. Only the Request -// and Usages fields can be set on creation, other fields are derived by -// Kubernetes and cannot be modified by users. -message CertificateSigningRequestSpec { - // Base64-encoded PKCS#10 CSR data - optional bytes request = 1; - - // allowedUsages specifies a set of usage contexts the key will be - // valid for. - // See: https://tools.ietf.org/html/rfc5280#section-4.2.1.3 - // https://tools.ietf.org/html/rfc5280#section-4.2.1.12 - repeated string usages = 5; - - // Information about the requesting user. - // See user.Info interface for details. - // +optional - optional string username = 2; - - // UID information about the requesting user. - // See user.Info interface for details. - // +optional - optional string uid = 3; - - // Group information about the requesting user. - // See user.Info interface for details. - // +optional - repeated string groups = 4; - - // Extra information about the requesting user. - // See user.Info interface for details. - // +optional - map extra = 6; -} - -message CertificateSigningRequestStatus { - // Conditions applied to the request, such as approval or denial. - // +optional - repeated CertificateSigningRequestCondition conditions = 1; - - // If request was approved, the controller will place the issued certificate here. - // +optional - optional bytes certificate = 2; -} - -// ExtraValue masks the value so protobuf can generate -// +protobuf.nullable=true -// +protobuf.options.(gogoproto.goproto_stringer)=false -message ExtraValue { - // items, if empty, will result in an empty slice - - repeated string items = 1; -} - diff --git a/vendor/k8s.io/api/coordination/v1/generated.proto b/vendor/k8s.io/api/coordination/v1/generated.proto deleted file mode 100644 index 4206746..0000000 --- a/vendor/k8s.io/api/coordination/v1/generated.proto +++ /dev/null @@ -1,80 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.coordination.v1; - -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1"; - -// Lease defines a lease concept. -message Lease { - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Specification of the Lease. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional LeaseSpec spec = 2; -} - -// LeaseList is a list of Lease objects. -message LeaseList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is a list of schema objects. - repeated Lease items = 2; -} - -// LeaseSpec is a specification of a Lease. -message LeaseSpec { - // holderIdentity contains the identity of the holder of a current lease. - // +optional - optional string holderIdentity = 1; - - // leaseDurationSeconds is a duration that candidates for a lease need - // to wait to force acquire it. This is measure against time of last - // observed RenewTime. - // +optional - optional int32 leaseDurationSeconds = 2; - - // acquireTime is a time when the current lease was acquired. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime acquireTime = 3; - - // renewTime is a time when the current holder of a lease has last - // updated the lease. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime renewTime = 4; - - // leaseTransitions is the number of transitions of a lease between - // holders. - // +optional - optional int32 leaseTransitions = 5; -} - diff --git a/vendor/k8s.io/api/coordination/v1beta1/generated.proto b/vendor/k8s.io/api/coordination/v1beta1/generated.proto deleted file mode 100644 index cfc2711..0000000 --- a/vendor/k8s.io/api/coordination/v1beta1/generated.proto +++ /dev/null @@ -1,80 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.coordination.v1beta1; - -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1beta1"; - -// Lease defines a lease concept. -message Lease { - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Specification of the Lease. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional LeaseSpec spec = 2; -} - -// LeaseList is a list of Lease objects. -message LeaseList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is a list of schema objects. - repeated Lease items = 2; -} - -// LeaseSpec is a specification of a Lease. -message LeaseSpec { - // holderIdentity contains the identity of the holder of a current lease. - // +optional - optional string holderIdentity = 1; - - // leaseDurationSeconds is a duration that candidates for a lease need - // to wait to force acquire it. This is measure against time of last - // observed RenewTime. - // +optional - optional int32 leaseDurationSeconds = 2; - - // acquireTime is a time when the current lease was acquired. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime acquireTime = 3; - - // renewTime is a time when the current holder of a lease has last - // updated the lease. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime renewTime = 4; - - // leaseTransitions is the number of transitions of a lease between - // holders. - // +optional - optional int32 leaseTransitions = 5; -} - diff --git a/vendor/k8s.io/api/core/v1/generated.proto b/vendor/k8s.io/api/core/v1/generated.proto deleted file mode 100644 index c05e235..0000000 --- a/vendor/k8s.io/api/core/v1/generated.proto +++ /dev/null @@ -1,5278 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.core.v1; - -import "k8s.io/apimachinery/pkg/api/resource/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; -import "k8s.io/apimachinery/pkg/util/intstr/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1"; - -// Represents a Persistent Disk resource in AWS. -// -// An AWS EBS disk must exist before mounting to a container. The disk -// must also be in the same AWS zone as the kubelet. An AWS EBS disk -// can only be mounted as read/write once. AWS EBS volumes support -// ownership management and SELinux relabeling. -message AWSElasticBlockStoreVolumeSource { - // Unique ID of the persistent disk resource in AWS (Amazon EBS volume). - // More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore - optional string volumeID = 1; - - // Filesystem type of the volume that you want to mount. - // Tip: Ensure that the filesystem type is supported by the host operating system. - // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - // More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore - // TODO: how do we prevent errors in the filesystem from compromising the machine - // +optional - optional string fsType = 2; - - // The partition in the volume that you want to mount. - // If omitted, the default is to mount by volume name. - // Examples: For volume /dev/sda1, you specify the partition as "1". - // Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). - // +optional - optional int32 partition = 3; - - // Specify "true" to force and set the ReadOnly property in VolumeMounts to "true". - // If omitted, the default is "false". - // More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore - // +optional - optional bool readOnly = 4; -} - -// Affinity is a group of affinity scheduling rules. -message Affinity { - // Describes node affinity scheduling rules for the pod. - // +optional - optional NodeAffinity nodeAffinity = 1; - - // Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)). - // +optional - optional PodAffinity podAffinity = 2; - - // Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)). - // +optional - optional PodAntiAffinity podAntiAffinity = 3; -} - -// AttachedVolume describes a volume attached to a node -message AttachedVolume { - // Name of the attached volume - optional string name = 1; - - // DevicePath represents the device path where the volume should be available - optional string devicePath = 2; -} - -// AvoidPods describes pods that should avoid this node. This is the value for a -// Node annotation with key scheduler.alpha.kubernetes.io/preferAvoidPods and -// will eventually become a field of NodeStatus. -message AvoidPods { - // Bounded-sized list of signatures of pods that should avoid this node, sorted - // in timestamp order from oldest to newest. Size of the slice is unspecified. - // +optional - repeated PreferAvoidPodsEntry preferAvoidPods = 1; -} - -// AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. -message AzureDiskVolumeSource { - // The Name of the data disk in the blob storage - optional string diskName = 1; - - // The URI the data disk in the blob storage - optional string diskURI = 2; - - // Host Caching mode: None, Read Only, Read Write. - // +optional - optional string cachingMode = 3; - - // Filesystem type to mount. - // Must be a filesystem type supported by the host operating system. - // Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - // +optional - optional string fsType = 4; - - // Defaults to false (read/write). ReadOnly here will force - // the ReadOnly setting in VolumeMounts. - // +optional - optional bool readOnly = 5; - - // Expected values Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared - optional string kind = 6; -} - -// AzureFile represents an Azure File Service mount on the host and bind mount to the pod. -message AzureFilePersistentVolumeSource { - // the name of secret that contains Azure Storage Account Name and Key - optional string secretName = 1; - - // Share Name - optional string shareName = 2; - - // Defaults to false (read/write). ReadOnly here will force - // the ReadOnly setting in VolumeMounts. - // +optional - optional bool readOnly = 3; - - // the namespace of the secret that contains Azure Storage Account Name and Key - // default is the same as the Pod - // +optional - optional string secretNamespace = 4; -} - -// AzureFile represents an Azure File Service mount on the host and bind mount to the pod. -message AzureFileVolumeSource { - // the name of secret that contains Azure Storage Account Name and Key - optional string secretName = 1; - - // Share Name - optional string shareName = 2; - - // Defaults to false (read/write). ReadOnly here will force - // the ReadOnly setting in VolumeMounts. - // +optional - optional bool readOnly = 3; -} - -// Binding ties one object to another; for example, a pod is bound to a node by a scheduler. -// Deprecated in 1.7, please use the bindings subresource of pods instead. -message Binding { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // The target object that you want to bind to the standard object. - optional ObjectReference target = 2; -} - -// Represents storage that is managed by an external CSI volume driver (Beta feature) -message CSIPersistentVolumeSource { - // Driver is the name of the driver to use for this volume. - // Required. - optional string driver = 1; - - // VolumeHandle is the unique volume name returned by the CSI volume - // plugin’s CreateVolume to refer to the volume on all subsequent calls. - // Required. - optional string volumeHandle = 2; - - // Optional: The value to pass to ControllerPublishVolumeRequest. - // Defaults to false (read/write). - // +optional - optional bool readOnly = 3; - - // Filesystem type to mount. - // Must be a filesystem type supported by the host operating system. - // Ex. "ext4", "xfs", "ntfs". - // +optional - optional string fsType = 4; - - // Attributes of the volume to publish. - // +optional - map volumeAttributes = 5; - - // ControllerPublishSecretRef is a reference to the secret object containing - // sensitive information to pass to the CSI driver to complete the CSI - // ControllerPublishVolume and ControllerUnpublishVolume calls. - // This field is optional, and may be empty if no secret is required. If the - // secret object contains more than one secret, all secrets are passed. - // +optional - optional SecretReference controllerPublishSecretRef = 6; - - // NodeStageSecretRef is a reference to the secret object containing sensitive - // information to pass to the CSI driver to complete the CSI NodeStageVolume - // and NodeStageVolume and NodeUnstageVolume calls. - // This field is optional, and may be empty if no secret is required. If the - // secret object contains more than one secret, all secrets are passed. - // +optional - optional SecretReference nodeStageSecretRef = 7; - - // NodePublishSecretRef is a reference to the secret object containing - // sensitive information to pass to the CSI driver to complete the CSI - // NodePublishVolume and NodeUnpublishVolume calls. - // This field is optional, and may be empty if no secret is required. If the - // secret object contains more than one secret, all secrets are passed. - // +optional - optional SecretReference nodePublishSecretRef = 8; - - // ControllerExpandSecretRef is a reference to the secret object containing - // sensitive information to pass to the CSI driver to complete the CSI - // ControllerExpandVolume call. - // This is an alpha field and requires enabling ExpandCSIVolumes feature gate. - // This field is optional, and may be empty if no secret is required. If the - // secret object contains more than one secret, all secrets are passed. - // +optional - optional SecretReference controllerExpandSecretRef = 9; -} - -// Represents a source location of a volume to mount, managed by an external CSI driver -message CSIVolumeSource { - // Driver is the name of the CSI driver that handles this volume. - // Consult with your admin for the correct name as registered in the cluster. - optional string driver = 1; - - // Specifies a read-only configuration for the volume. - // Defaults to false (read/write). - // +optional - optional bool readOnly = 2; - - // Filesystem type to mount. Ex. "ext4", "xfs", "ntfs". - // If not provided, the empty value is passed to the associated CSI driver - // which will determine the default filesystem to apply. - // +optional - optional string fsType = 3; - - // VolumeAttributes stores driver-specific properties that are passed to the CSI - // driver. Consult your driver's documentation for supported values. - // +optional - map volumeAttributes = 4; - - // NodePublishSecretRef is a reference to the secret object containing - // sensitive information to pass to the CSI driver to complete the CSI - // NodePublishVolume and NodeUnpublishVolume calls. - // This field is optional, and may be empty if no secret is required. If the - // secret object contains more than one secret, all secret references are passed. - // +optional - optional LocalObjectReference nodePublishSecretRef = 5; -} - -// Adds and removes POSIX capabilities from running containers. -message Capabilities { - // Added capabilities - // +optional - repeated string add = 1; - - // Removed capabilities - // +optional - repeated string drop = 2; -} - -// Represents a Ceph Filesystem mount that lasts the lifetime of a pod -// Cephfs volumes do not support ownership management or SELinux relabeling. -message CephFSPersistentVolumeSource { - // Required: Monitors is a collection of Ceph monitors - // More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it - repeated string monitors = 1; - - // Optional: Used as the mounted root, rather than the full Ceph tree, default is / - // +optional - optional string path = 2; - - // Optional: User is the rados user name, default is admin - // More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it - // +optional - optional string user = 3; - - // Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret - // More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it - // +optional - optional string secretFile = 4; - - // Optional: SecretRef is reference to the authentication secret for User, default is empty. - // More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it - // +optional - optional SecretReference secretRef = 5; - - // Optional: Defaults to false (read/write). ReadOnly here will force - // the ReadOnly setting in VolumeMounts. - // More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it - // +optional - optional bool readOnly = 6; -} - -// Represents a Ceph Filesystem mount that lasts the lifetime of a pod -// Cephfs volumes do not support ownership management or SELinux relabeling. -message CephFSVolumeSource { - // Required: Monitors is a collection of Ceph monitors - // More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it - repeated string monitors = 1; - - // Optional: Used as the mounted root, rather than the full Ceph tree, default is / - // +optional - optional string path = 2; - - // Optional: User is the rados user name, default is admin - // More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it - // +optional - optional string user = 3; - - // Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret - // More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it - // +optional - optional string secretFile = 4; - - // Optional: SecretRef is reference to the authentication secret for User, default is empty. - // More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it - // +optional - optional LocalObjectReference secretRef = 5; - - // Optional: Defaults to false (read/write). ReadOnly here will force - // the ReadOnly setting in VolumeMounts. - // More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it - // +optional - optional bool readOnly = 6; -} - -// Represents a cinder volume resource in Openstack. -// A Cinder volume must exist before mounting to a container. -// The volume must also be in the same region as the kubelet. -// Cinder volumes support ownership management and SELinux relabeling. -message CinderPersistentVolumeSource { - // volume id used to identify the volume in cinder. - // More info: https://examples.k8s.io/mysql-cinder-pd/README.md - optional string volumeID = 1; - - // Filesystem type to mount. - // Must be a filesystem type supported by the host operating system. - // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - // More info: https://examples.k8s.io/mysql-cinder-pd/README.md - // +optional - optional string fsType = 2; - - // Optional: Defaults to false (read/write). ReadOnly here will force - // the ReadOnly setting in VolumeMounts. - // More info: https://examples.k8s.io/mysql-cinder-pd/README.md - // +optional - optional bool readOnly = 3; - - // Optional: points to a secret object containing parameters used to connect - // to OpenStack. - // +optional - optional SecretReference secretRef = 4; -} - -// Represents a cinder volume resource in Openstack. -// A Cinder volume must exist before mounting to a container. -// The volume must also be in the same region as the kubelet. -// Cinder volumes support ownership management and SELinux relabeling. -message CinderVolumeSource { - // volume id used to identify the volume in cinder. - // More info: https://examples.k8s.io/mysql-cinder-pd/README.md - optional string volumeID = 1; - - // Filesystem type to mount. - // Must be a filesystem type supported by the host operating system. - // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - // More info: https://examples.k8s.io/mysql-cinder-pd/README.md - // +optional - optional string fsType = 2; - - // Optional: Defaults to false (read/write). ReadOnly here will force - // the ReadOnly setting in VolumeMounts. - // More info: https://examples.k8s.io/mysql-cinder-pd/README.md - // +optional - optional bool readOnly = 3; - - // Optional: points to a secret object containing parameters used to connect - // to OpenStack. - // +optional - optional LocalObjectReference secretRef = 4; -} - -// ClientIPConfig represents the configurations of Client IP based session affinity. -message ClientIPConfig { - // timeoutSeconds specifies the seconds of ClientIP type session sticky time. - // The value must be >0 && <=86400(for 1 day) if ServiceAffinity == "ClientIP". - // Default value is 10800(for 3 hours). - // +optional - optional int32 timeoutSeconds = 1; -} - -// Information about the condition of a component. -message ComponentCondition { - // Type of condition for a component. - // Valid value: "Healthy" - optional string type = 1; - - // Status of the condition for a component. - // Valid values for "Healthy": "True", "False", or "Unknown". - optional string status = 2; - - // Message about the condition for a component. - // For example, information about a health check. - // +optional - optional string message = 3; - - // Condition error code for a component. - // For example, a health check error code. - // +optional - optional string error = 4; -} - -// ComponentStatus (and ComponentStatusList) holds the cluster validation info. -message ComponentStatus { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // List of component conditions observed - // +optional - // +patchMergeKey=type - // +patchStrategy=merge - repeated ComponentCondition conditions = 2; -} - -// Status of all the conditions for the component as a list of ComponentStatus objects. -message ComponentStatusList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // List of ComponentStatus objects. - repeated ComponentStatus items = 2; -} - -// ConfigMap holds configuration data for pods to consume. -message ConfigMap { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Data contains the configuration data. - // Each key must consist of alphanumeric characters, '-', '_' or '.'. - // Values with non-UTF-8 byte sequences must use the BinaryData field. - // The keys stored in Data must not overlap with the keys in - // the BinaryData field, this is enforced during validation process. - // +optional - map data = 2; - - // BinaryData contains the binary data. - // Each key must consist of alphanumeric characters, '-', '_' or '.'. - // BinaryData can contain byte sequences that are not in the UTF-8 range. - // The keys stored in BinaryData must not overlap with the ones in - // the Data field, this is enforced during validation process. - // Using this field will require 1.10+ apiserver and - // kubelet. - // +optional - map binaryData = 3; -} - -// ConfigMapEnvSource selects a ConfigMap to populate the environment -// variables with. -// -// The contents of the target ConfigMap's Data field will represent the -// key-value pairs as environment variables. -message ConfigMapEnvSource { - // The ConfigMap to select from. - optional LocalObjectReference localObjectReference = 1; - - // Specify whether the ConfigMap must be defined - // +optional - optional bool optional = 2; -} - -// Selects a key from a ConfigMap. -message ConfigMapKeySelector { - // The ConfigMap to select from. - optional LocalObjectReference localObjectReference = 1; - - // The key to select. - optional string key = 2; - - // Specify whether the ConfigMap or its key must be defined - // +optional - optional bool optional = 3; -} - -// ConfigMapList is a resource containing a list of ConfigMap objects. -message ConfigMapList { - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is the list of ConfigMaps. - repeated ConfigMap items = 2; -} - -// ConfigMapNodeConfigSource contains the information to reference a ConfigMap as a config source for the Node. -message ConfigMapNodeConfigSource { - // Namespace is the metadata.namespace of the referenced ConfigMap. - // This field is required in all cases. - optional string namespace = 1; - - // Name is the metadata.name of the referenced ConfigMap. - // This field is required in all cases. - optional string name = 2; - - // UID is the metadata.UID of the referenced ConfigMap. - // This field is forbidden in Node.Spec, and required in Node.Status. - // +optional - optional string uid = 3; - - // ResourceVersion is the metadata.ResourceVersion of the referenced ConfigMap. - // This field is forbidden in Node.Spec, and required in Node.Status. - // +optional - optional string resourceVersion = 4; - - // KubeletConfigKey declares which key of the referenced ConfigMap corresponds to the KubeletConfiguration structure - // This field is required in all cases. - optional string kubeletConfigKey = 5; -} - -// Adapts a ConfigMap into a projected volume. -// -// The contents of the target ConfigMap's Data field will be presented in a -// projected volume as files using the keys in the Data field as the file names, -// unless the items element is populated with specific mappings of keys to paths. -// Note that this is identical to a configmap volume source without the default -// mode. -message ConfigMapProjection { - optional LocalObjectReference localObjectReference = 1; - - // If unspecified, each key-value pair in the Data field of the referenced - // ConfigMap will be projected into the volume as a file whose name is the - // key and content is the value. If specified, the listed keys will be - // projected into the specified paths, and unlisted keys will not be - // present. If a key is specified which is not present in the ConfigMap, - // the volume setup will error unless it is marked optional. Paths must be - // relative and may not contain the '..' path or start with '..'. - // +optional - repeated KeyToPath items = 2; - - // Specify whether the ConfigMap or its keys must be defined - // +optional - optional bool optional = 4; -} - -// Adapts a ConfigMap into a volume. -// -// The contents of the target ConfigMap's Data field will be presented in a -// volume as files using the keys in the Data field as the file names, unless -// the items element is populated with specific mappings of keys to paths. -// ConfigMap volumes support ownership management and SELinux relabeling. -message ConfigMapVolumeSource { - optional LocalObjectReference localObjectReference = 1; - - // If unspecified, each key-value pair in the Data field of the referenced - // ConfigMap will be projected into the volume as a file whose name is the - // key and content is the value. If specified, the listed keys will be - // projected into the specified paths, and unlisted keys will not be - // present. If a key is specified which is not present in the ConfigMap, - // the volume setup will error unless it is marked optional. Paths must be - // relative and may not contain the '..' path or start with '..'. - // +optional - repeated KeyToPath items = 2; - - // Optional: mode bits to use on created files by default. Must be a - // value between 0 and 0777. Defaults to 0644. - // Directories within the path are not affected by this setting. - // This might be in conflict with other options that affect the file - // mode, like fsGroup, and the result can be other mode bits set. - // +optional - optional int32 defaultMode = 3; - - // Specify whether the ConfigMap or its keys must be defined - // +optional - optional bool optional = 4; -} - -// A single application container that you want to run within a pod. -message Container { - // Name of the container specified as a DNS_LABEL. - // Each container in a pod must have a unique name (DNS_LABEL). - // Cannot be updated. - optional string name = 1; - - // Docker image name. - // More info: https://kubernetes.io/docs/concepts/containers/images - // This field is optional to allow higher level config management to default or override - // container images in workload controllers like Deployments and StatefulSets. - // +optional - optional string image = 2; - - // Entrypoint array. Not executed within a shell. - // The docker image's ENTRYPOINT is used if this is not provided. - // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable - // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax - // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, - // regardless of whether the variable exists or not. - // Cannot be updated. - // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell - // +optional - repeated string command = 3; - - // Arguments to the entrypoint. - // The docker image's CMD is used if this is not provided. - // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable - // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax - // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, - // regardless of whether the variable exists or not. - // Cannot be updated. - // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell - // +optional - repeated string args = 4; - - // Container's working directory. - // If not specified, the container runtime's default will be used, which - // might be configured in the container image. - // Cannot be updated. - // +optional - optional string workingDir = 5; - - // List of ports to expose from the container. Exposing a port here gives - // the system additional information about the network connections a - // container uses, but is primarily informational. Not specifying a port here - // DOES NOT prevent that port from being exposed. Any port which is - // listening on the default "0.0.0.0" address inside a container will be - // accessible from the network. - // Cannot be updated. - // +optional - // +patchMergeKey=containerPort - // +patchStrategy=merge - // +listType=map - // +listMapKey=containerPort - // +listMapKey=protocol - repeated ContainerPort ports = 6; - - // List of sources to populate environment variables in the container. - // The keys defined within a source must be a C_IDENTIFIER. All invalid keys - // will be reported as an event when the container is starting. When a key exists in multiple - // sources, the value associated with the last source will take precedence. - // Values defined by an Env with a duplicate key will take precedence. - // Cannot be updated. - // +optional - repeated EnvFromSource envFrom = 19; - - // List of environment variables to set in the container. - // Cannot be updated. - // +optional - // +patchMergeKey=name - // +patchStrategy=merge - repeated EnvVar env = 7; - - // Compute Resources required by this container. - // Cannot be updated. - // More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ - // +optional - optional ResourceRequirements resources = 8; - - // Pod volumes to mount into the container's filesystem. - // Cannot be updated. - // +optional - // +patchMergeKey=mountPath - // +patchStrategy=merge - repeated VolumeMount volumeMounts = 9; - - // volumeDevices is the list of block devices to be used by the container. - // This is a beta feature. - // +patchMergeKey=devicePath - // +patchStrategy=merge - // +optional - repeated VolumeDevice volumeDevices = 21; - - // Periodic probe of container liveness. - // Container will be restarted if the probe fails. - // Cannot be updated. - // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes - // +optional - optional Probe livenessProbe = 10; - - // Periodic probe of container service readiness. - // Container will be removed from service endpoints if the probe fails. - // Cannot be updated. - // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes - // +optional - optional Probe readinessProbe = 11; - - // StartupProbe indicates that the Pod has successfully initialized. - // If specified, no other probes are executed until this completes successfully. - // If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. - // This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, - // when it might take a long time to load data or warm a cache, than during steady-state operation. - // This cannot be updated. - // This is an alpha feature enabled by the StartupProbe feature flag. - // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes - // +optional - optional Probe startupProbe = 22; - - // Actions that the management system should take in response to container lifecycle events. - // Cannot be updated. - // +optional - optional Lifecycle lifecycle = 12; - - // Optional: Path at which the file to which the container's termination message - // will be written is mounted into the container's filesystem. - // Message written is intended to be brief final status, such as an assertion failure message. - // Will be truncated by the node if greater than 4096 bytes. The total message length across - // all containers will be limited to 12kb. - // Defaults to /dev/termination-log. - // Cannot be updated. - // +optional - optional string terminationMessagePath = 13; - - // Indicate how the termination message should be populated. File will use the contents of - // terminationMessagePath to populate the container status message on both success and failure. - // FallbackToLogsOnError will use the last chunk of container log output if the termination - // message file is empty and the container exited with an error. - // The log output is limited to 2048 bytes or 80 lines, whichever is smaller. - // Defaults to File. - // Cannot be updated. - // +optional - optional string terminationMessagePolicy = 20; - - // Image pull policy. - // One of Always, Never, IfNotPresent. - // Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. - // Cannot be updated. - // More info: https://kubernetes.io/docs/concepts/containers/images#updating-images - // +optional - optional string imagePullPolicy = 14; - - // Security options the pod should run with. - // More info: https://kubernetes.io/docs/concepts/policy/security-context/ - // More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ - // +optional - optional SecurityContext securityContext = 15; - - // Whether this container should allocate a buffer for stdin in the container runtime. If this - // is not set, reads from stdin in the container will always result in EOF. - // Default is false. - // +optional - optional bool stdin = 16; - - // Whether the container runtime should close the stdin channel after it has been opened by - // a single attach. When stdin is true the stdin stream will remain open across multiple attach - // sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the - // first client attaches to stdin, and then remains open and accepts data until the client disconnects, - // at which time stdin is closed and remains closed until the container is restarted. If this - // flag is false, a container processes that reads from stdin will never receive an EOF. - // Default is false - // +optional - optional bool stdinOnce = 17; - - // Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. - // Default is false. - // +optional - optional bool tty = 18; -} - -// Describe a container image -message ContainerImage { - // Names by which this image is known. - // e.g. ["k8s.gcr.io/hyperkube:v1.0.7", "dockerhub.io/google_containers/hyperkube:v1.0.7"] - repeated string names = 1; - - // The size of the image in bytes. - // +optional - optional int64 sizeBytes = 2; -} - -// ContainerPort represents a network port in a single container. -message ContainerPort { - // If specified, this must be an IANA_SVC_NAME and unique within the pod. Each - // named port in a pod must have a unique name. Name for the port that can be - // referred to by services. - // +optional - optional string name = 1; - - // Number of port to expose on the host. - // If specified, this must be a valid port number, 0 < x < 65536. - // If HostNetwork is specified, this must match ContainerPort. - // Most containers do not need this. - // +optional - optional int32 hostPort = 2; - - // Number of port to expose on the pod's IP address. - // This must be a valid port number, 0 < x < 65536. - optional int32 containerPort = 3; - - // Protocol for port. Must be UDP, TCP, or SCTP. - // Defaults to "TCP". - // +optional - optional string protocol = 4; - - // What host IP to bind the external port to. - // +optional - optional string hostIP = 5; -} - -// ContainerState holds a possible state of container. -// Only one of its members may be specified. -// If none of them is specified, the default one is ContainerStateWaiting. -message ContainerState { - // Details about a waiting container - // +optional - optional ContainerStateWaiting waiting = 1; - - // Details about a running container - // +optional - optional ContainerStateRunning running = 2; - - // Details about a terminated container - // +optional - optional ContainerStateTerminated terminated = 3; -} - -// ContainerStateRunning is a running state of a container. -message ContainerStateRunning { - // Time at which the container was last (re-)started - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time startedAt = 1; -} - -// ContainerStateTerminated is a terminated state of a container. -message ContainerStateTerminated { - // Exit status from the last termination of the container - optional int32 exitCode = 1; - - // Signal from the last termination of the container - // +optional - optional int32 signal = 2; - - // (brief) reason from the last termination of the container - // +optional - optional string reason = 3; - - // Message regarding the last termination of the container - // +optional - optional string message = 4; - - // Time at which previous execution of the container started - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time startedAt = 5; - - // Time at which the container last terminated - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time finishedAt = 6; - - // Container's ID in the format 'docker://' - // +optional - optional string containerID = 7; -} - -// ContainerStateWaiting is a waiting state of a container. -message ContainerStateWaiting { - // (brief) reason the container is not yet running. - // +optional - optional string reason = 1; - - // Message regarding why the container is not yet running. - // +optional - optional string message = 2; -} - -// ContainerStatus contains details for the current status of this container. -message ContainerStatus { - // This must be a DNS_LABEL. Each container in a pod must have a unique name. - // Cannot be updated. - optional string name = 1; - - // Details about the container's current condition. - // +optional - optional ContainerState state = 2; - - // Details about the container's last termination condition. - // +optional - optional ContainerState lastState = 3; - - // Specifies whether the container has passed its readiness probe. - optional bool ready = 4; - - // The number of times the container has been restarted, currently based on - // the number of dead containers that have not yet been removed. - // Note that this is calculated from dead containers. But those containers are subject to - // garbage collection. This value will get capped at 5 by GC. - optional int32 restartCount = 5; - - // The image the container is running. - // More info: https://kubernetes.io/docs/concepts/containers/images - // TODO(dchen1107): Which image the container is running with? - optional string image = 6; - - // ImageID of the container's image. - optional string imageID = 7; - - // Container's ID in the format 'docker://'. - // +optional - optional string containerID = 8; - - // Specifies whether the container has passed its startup probe. - // Initialized as false, becomes true after startupProbe is considered successful. - // Resets to false when the container is restarted, or if kubelet loses state temporarily. - // Is always true when no startupProbe is defined. - // +optional - optional bool started = 9; -} - -// DaemonEndpoint contains information about a single Daemon endpoint. -message DaemonEndpoint { - // Port number of the given endpoint. - optional int32 Port = 1; -} - -// Represents downward API info for projecting into a projected volume. -// Note that this is identical to a downwardAPI volume source without the default -// mode. -message DownwardAPIProjection { - // Items is a list of DownwardAPIVolume file - // +optional - repeated DownwardAPIVolumeFile items = 1; -} - -// DownwardAPIVolumeFile represents information to create the file containing the pod field -message DownwardAPIVolumeFile { - // Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..' - optional string path = 1; - - // Required: Selects a field of the pod: only annotations, labels, name and namespace are supported. - // +optional - optional ObjectFieldSelector fieldRef = 2; - - // Selects a resource of the container: only resources limits and requests - // (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. - // +optional - optional ResourceFieldSelector resourceFieldRef = 3; - - // Optional: mode bits to use on this file, must be a value between 0 - // and 0777. If not specified, the volume defaultMode will be used. - // This might be in conflict with other options that affect the file - // mode, like fsGroup, and the result can be other mode bits set. - // +optional - optional int32 mode = 4; -} - -// DownwardAPIVolumeSource represents a volume containing downward API info. -// Downward API volumes support ownership management and SELinux relabeling. -message DownwardAPIVolumeSource { - // Items is a list of downward API volume file - // +optional - repeated DownwardAPIVolumeFile items = 1; - - // Optional: mode bits to use on created files by default. Must be a - // value between 0 and 0777. Defaults to 0644. - // Directories within the path are not affected by this setting. - // This might be in conflict with other options that affect the file - // mode, like fsGroup, and the result can be other mode bits set. - // +optional - optional int32 defaultMode = 2; -} - -// Represents an empty directory for a pod. -// Empty directory volumes support ownership management and SELinux relabeling. -message EmptyDirVolumeSource { - // What type of storage medium should back this directory. - // The default is "" which means to use the node's default medium. - // Must be an empty string (default) or Memory. - // More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir - // +optional - optional string medium = 1; - - // Total amount of local storage required for this EmptyDir volume. - // The size limit is also applicable for memory medium. - // The maximum usage on memory medium EmptyDir would be the minimum value between - // the SizeLimit specified here and the sum of memory limits of all containers in a pod. - // The default is nil which means that the limit is undefined. - // More info: http://kubernetes.io/docs/user-guide/volumes#emptydir - // +optional - optional k8s.io.apimachinery.pkg.api.resource.Quantity sizeLimit = 2; -} - -// EndpointAddress is a tuple that describes single IP address. -message EndpointAddress { - // The IP of this endpoint. - // May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), - // or link-local multicast ((224.0.0.0/24). - // IPv6 is also accepted but not fully supported on all platforms. Also, certain - // kubernetes components, like kube-proxy, are not IPv6 ready. - // TODO: This should allow hostname or IP, See #4447. - optional string ip = 1; - - // The Hostname of this endpoint - // +optional - optional string hostname = 3; - - // Optional: Node hosting this endpoint. This can be used to determine endpoints local to a node. - // +optional - optional string nodeName = 4; - - // Reference to object providing the endpoint. - // +optional - optional ObjectReference targetRef = 2; -} - -// EndpointPort is a tuple that describes a single port. -message EndpointPort { - // The name of this port. This must match the 'name' field in the - // corresponding ServicePort. - // Must be a DNS_LABEL. - // Optional only if one port is defined. - // +optional - optional string name = 1; - - // The port number of the endpoint. - optional int32 port = 2; - - // The IP protocol for this port. - // Must be UDP, TCP, or SCTP. - // Default is TCP. - // +optional - optional string protocol = 3; -} - -// EndpointSubset is a group of addresses with a common set of ports. The -// expanded set of endpoints is the Cartesian product of Addresses x Ports. -// For example, given: -// { -// Addresses: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}], -// Ports: [{"name": "a", "port": 8675}, {"name": "b", "port": 309}] -// } -// The resulting set of endpoints can be viewed as: -// a: [ 10.10.1.1:8675, 10.10.2.2:8675 ], -// b: [ 10.10.1.1:309, 10.10.2.2:309 ] -message EndpointSubset { - // IP addresses which offer the related ports that are marked as ready. These endpoints - // should be considered safe for load balancers and clients to utilize. - // +optional - repeated EndpointAddress addresses = 1; - - // IP addresses which offer the related ports but are not currently marked as ready - // because they have not yet finished starting, have recently failed a readiness check, - // or have recently failed a liveness check. - // +optional - repeated EndpointAddress notReadyAddresses = 2; - - // Port numbers available on the related IP addresses. - // +optional - repeated EndpointPort ports = 3; -} - -// Endpoints is a collection of endpoints that implement the actual service. Example: -// Name: "mysvc", -// Subsets: [ -// { -// Addresses: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}], -// Ports: [{"name": "a", "port": 8675}, {"name": "b", "port": 309}] -// }, -// { -// Addresses: [{"ip": "10.10.3.3"}], -// Ports: [{"name": "a", "port": 93}, {"name": "b", "port": 76}] -// }, -// ] -message Endpoints { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // The set of all endpoints is the union of all subsets. Addresses are placed into - // subsets according to the IPs they share. A single address with multiple ports, - // some of which are ready and some of which are not (because they come from - // different containers) will result in the address being displayed in different - // subsets for the different ports. No address will appear in both Addresses and - // NotReadyAddresses in the same subset. - // Sets of addresses and ports that comprise a service. - // +optional - repeated EndpointSubset subsets = 2; -} - -// EndpointsList is a list of endpoints. -message EndpointsList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // List of endpoints. - repeated Endpoints items = 2; -} - -// EnvFromSource represents the source of a set of ConfigMaps -message EnvFromSource { - // An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. - // +optional - optional string prefix = 1; - - // The ConfigMap to select from - // +optional - optional ConfigMapEnvSource configMapRef = 2; - - // The Secret to select from - // +optional - optional SecretEnvSource secretRef = 3; -} - -// EnvVar represents an environment variable present in a Container. -message EnvVar { - // Name of the environment variable. Must be a C_IDENTIFIER. - optional string name = 1; - - // Variable references $(VAR_NAME) are expanded - // using the previous defined environment variables in the container and - // any service environment variables. If a variable cannot be resolved, - // the reference in the input string will be unchanged. The $(VAR_NAME) - // syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped - // references will never be expanded, regardless of whether the variable - // exists or not. - // Defaults to "". - // +optional - optional string value = 2; - - // Source for the environment variable's value. Cannot be used if value is not empty. - // +optional - optional EnvVarSource valueFrom = 3; -} - -// EnvVarSource represents a source for the value of an EnvVar. -message EnvVarSource { - // Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, - // spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs. - // +optional - optional ObjectFieldSelector fieldRef = 1; - - // Selects a resource of the container: only resources limits and requests - // (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported. - // +optional - optional ResourceFieldSelector resourceFieldRef = 2; - - // Selects a key of a ConfigMap. - // +optional - optional ConfigMapKeySelector configMapKeyRef = 3; - - // Selects a key of a secret in the pod's namespace - // +optional - optional SecretKeySelector secretKeyRef = 4; -} - -// An EphemeralContainer is a container that may be added temporarily to an existing pod for -// user-initiated activities such as debugging. Ephemeral containers have no resource or -// scheduling guarantees, and they will not be restarted when they exit or when a pod is -// removed or restarted. If an ephemeral container causes a pod to exceed its resource -// allocation, the pod may be evicted. -// Ephemeral containers may not be added by directly updating the pod spec. They must be added -// via the pod's ephemeralcontainers subresource, and they will appear in the pod spec -// once added. -// This is an alpha feature enabled by the EphemeralContainers feature flag. -message EphemeralContainer { - // Ephemeral containers have all of the fields of Container, plus additional fields - // specific to ephemeral containers. Fields in common with Container are in the - // following inlined struct so than an EphemeralContainer may easily be converted - // to a Container. - optional EphemeralContainerCommon ephemeralContainerCommon = 1; - - // If set, the name of the container from PodSpec that this ephemeral container targets. - // The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. - // If not set then the ephemeral container is run in whatever namespaces are shared - // for the pod. Note that the container runtime must support this feature. - // +optional - optional string targetContainerName = 2; -} - -// EphemeralContainerCommon is a copy of all fields in Container to be inlined in -// EphemeralContainer. This separate type allows easy conversion from EphemeralContainer -// to Container and allows separate documentation for the fields of EphemeralContainer. -// When a new field is added to Container it must be added here as well. -message EphemeralContainerCommon { - // Name of the ephemeral container specified as a DNS_LABEL. - // This name must be unique among all containers, init containers and ephemeral containers. - optional string name = 1; - - // Docker image name. - // More info: https://kubernetes.io/docs/concepts/containers/images - optional string image = 2; - - // Entrypoint array. Not executed within a shell. - // The docker image's ENTRYPOINT is used if this is not provided. - // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable - // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax - // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, - // regardless of whether the variable exists or not. - // Cannot be updated. - // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell - // +optional - repeated string command = 3; - - // Arguments to the entrypoint. - // The docker image's CMD is used if this is not provided. - // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable - // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax - // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, - // regardless of whether the variable exists or not. - // Cannot be updated. - // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell - // +optional - repeated string args = 4; - - // Container's working directory. - // If not specified, the container runtime's default will be used, which - // might be configured in the container image. - // Cannot be updated. - // +optional - optional string workingDir = 5; - - // Ports are not allowed for ephemeral containers. - repeated ContainerPort ports = 6; - - // List of sources to populate environment variables in the container. - // The keys defined within a source must be a C_IDENTIFIER. All invalid keys - // will be reported as an event when the container is starting. When a key exists in multiple - // sources, the value associated with the last source will take precedence. - // Values defined by an Env with a duplicate key will take precedence. - // Cannot be updated. - // +optional - repeated EnvFromSource envFrom = 19; - - // List of environment variables to set in the container. - // Cannot be updated. - // +optional - // +patchMergeKey=name - // +patchStrategy=merge - repeated EnvVar env = 7; - - // Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources - // already allocated to the pod. - // +optional - optional ResourceRequirements resources = 8; - - // Pod volumes to mount into the container's filesystem. - // Cannot be updated. - // +optional - // +patchMergeKey=mountPath - // +patchStrategy=merge - repeated VolumeMount volumeMounts = 9; - - // volumeDevices is the list of block devices to be used by the container. - // This is a beta feature. - // +patchMergeKey=devicePath - // +patchStrategy=merge - // +optional - repeated VolumeDevice volumeDevices = 21; - - // Probes are not allowed for ephemeral containers. - // +optional - optional Probe livenessProbe = 10; - - // Probes are not allowed for ephemeral containers. - // +optional - optional Probe readinessProbe = 11; - - // Probes are not allowed for ephemeral containers. - // +optional - optional Probe startupProbe = 22; - - // Lifecycle is not allowed for ephemeral containers. - // +optional - optional Lifecycle lifecycle = 12; - - // Optional: Path at which the file to which the container's termination message - // will be written is mounted into the container's filesystem. - // Message written is intended to be brief final status, such as an assertion failure message. - // Will be truncated by the node if greater than 4096 bytes. The total message length across - // all containers will be limited to 12kb. - // Defaults to /dev/termination-log. - // Cannot be updated. - // +optional - optional string terminationMessagePath = 13; - - // Indicate how the termination message should be populated. File will use the contents of - // terminationMessagePath to populate the container status message on both success and failure. - // FallbackToLogsOnError will use the last chunk of container log output if the termination - // message file is empty and the container exited with an error. - // The log output is limited to 2048 bytes or 80 lines, whichever is smaller. - // Defaults to File. - // Cannot be updated. - // +optional - optional string terminationMessagePolicy = 20; - - // Image pull policy. - // One of Always, Never, IfNotPresent. - // Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. - // Cannot be updated. - // More info: https://kubernetes.io/docs/concepts/containers/images#updating-images - // +optional - optional string imagePullPolicy = 14; - - // SecurityContext is not allowed for ephemeral containers. - // +optional - optional SecurityContext securityContext = 15; - - // Whether this container should allocate a buffer for stdin in the container runtime. If this - // is not set, reads from stdin in the container will always result in EOF. - // Default is false. - // +optional - optional bool stdin = 16; - - // Whether the container runtime should close the stdin channel after it has been opened by - // a single attach. When stdin is true the stdin stream will remain open across multiple attach - // sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the - // first client attaches to stdin, and then remains open and accepts data until the client disconnects, - // at which time stdin is closed and remains closed until the container is restarted. If this - // flag is false, a container processes that reads from stdin will never receive an EOF. - // Default is false - // +optional - optional bool stdinOnce = 17; - - // Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. - // Default is false. - // +optional - optional bool tty = 18; -} - -// A list of ephemeral containers used with the Pod ephemeralcontainers subresource. -message EphemeralContainers { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // A list of ephemeral containers associated with this pod. New ephemeral containers - // may be appended to this list, but existing ephemeral containers may not be removed - // or modified. - // +patchMergeKey=name - // +patchStrategy=merge - repeated EphemeralContainer ephemeralContainers = 2; -} - -// Event is a report of an event somewhere in the cluster. -message Event { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // The object that this event is about. - optional ObjectReference involvedObject = 2; - - // This should be a short, machine understandable string that gives the reason - // for the transition into the object's current status. - // TODO: provide exact specification for format. - // +optional - optional string reason = 3; - - // A human-readable description of the status of this operation. - // TODO: decide on maximum length. - // +optional - optional string message = 4; - - // The component reporting this event. Should be a short machine understandable string. - // +optional - optional EventSource source = 5; - - // The time at which the event was first recorded. (Time of server receipt is in TypeMeta.) - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time firstTimestamp = 6; - - // The time at which the most recent occurrence of this event was recorded. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTimestamp = 7; - - // The number of times this event has occurred. - // +optional - optional int32 count = 8; - - // Type of this event (Normal, Warning), new types could be added in the future - // +optional - optional string type = 9; - - // Time when this Event was first observed. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime eventTime = 10; - - // Data about the Event series this event represents or nil if it's a singleton Event. - // +optional - optional EventSeries series = 11; - - // What action was taken/failed regarding to the Regarding object. - // +optional - optional string action = 12; - - // Optional secondary object for more complex actions. - // +optional - optional ObjectReference related = 13; - - // Name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`. - // +optional - optional string reportingComponent = 14; - - // ID of the controller instance, e.g. `kubelet-xyzf`. - // +optional - optional string reportingInstance = 15; -} - -// EventList is a list of events. -message EventList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // List of events - repeated Event items = 2; -} - -// EventSeries contain information on series of events, i.e. thing that was/is happening -// continuously for some time. -message EventSeries { - // Number of occurrences in this series up to the last heartbeat time - optional int32 count = 1; - - // Time of the last occurrence observed - optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime lastObservedTime = 2; - - // State of this Series: Ongoing or Finished - // Deprecated. Planned removal for 1.18 - optional string state = 3; -} - -// EventSource contains information for an event. -message EventSource { - // Component from which the event is generated. - // +optional - optional string component = 1; - - // Node name on which the event is generated. - // +optional - optional string host = 2; -} - -// ExecAction describes a "run in container" action. -message ExecAction { - // Command is the command line to execute inside the container, the working directory for the - // command is root ('/') in the container's filesystem. The command is simply exec'd, it is - // not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use - // a shell, you need to explicitly call out to that shell. - // Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - // +optional - repeated string command = 1; -} - -// Represents a Fibre Channel volume. -// Fibre Channel volumes can only be mounted as read/write once. -// Fibre Channel volumes support ownership management and SELinux relabeling. -message FCVolumeSource { - // Optional: FC target worldwide names (WWNs) - // +optional - repeated string targetWWNs = 1; - - // Optional: FC target lun number - // +optional - optional int32 lun = 2; - - // Filesystem type to mount. - // Must be a filesystem type supported by the host operating system. - // Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - // TODO: how do we prevent errors in the filesystem from compromising the machine - // +optional - optional string fsType = 3; - - // Optional: Defaults to false (read/write). ReadOnly here will force - // the ReadOnly setting in VolumeMounts. - // +optional - optional bool readOnly = 4; - - // Optional: FC volume world wide identifiers (wwids) - // Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously. - // +optional - repeated string wwids = 5; -} - -// FlexPersistentVolumeSource represents a generic persistent volume resource that is -// provisioned/attached using an exec based plugin. -message FlexPersistentVolumeSource { - // Driver is the name of the driver to use for this volume. - optional string driver = 1; - - // Filesystem type to mount. - // Must be a filesystem type supported by the host operating system. - // Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script. - // +optional - optional string fsType = 2; - - // Optional: SecretRef is reference to the secret object containing - // sensitive information to pass to the plugin scripts. This may be - // empty if no secret object is specified. If the secret object - // contains more than one secret, all secrets are passed to the plugin - // scripts. - // +optional - optional SecretReference secretRef = 3; - - // Optional: Defaults to false (read/write). ReadOnly here will force - // the ReadOnly setting in VolumeMounts. - // +optional - optional bool readOnly = 4; - - // Optional: Extra command options if any. - // +optional - map options = 5; -} - -// FlexVolume represents a generic volume resource that is -// provisioned/attached using an exec based plugin. -message FlexVolumeSource { - // Driver is the name of the driver to use for this volume. - optional string driver = 1; - - // Filesystem type to mount. - // Must be a filesystem type supported by the host operating system. - // Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script. - // +optional - optional string fsType = 2; - - // Optional: SecretRef is reference to the secret object containing - // sensitive information to pass to the plugin scripts. This may be - // empty if no secret object is specified. If the secret object - // contains more than one secret, all secrets are passed to the plugin - // scripts. - // +optional - optional LocalObjectReference secretRef = 3; - - // Optional: Defaults to false (read/write). ReadOnly here will force - // the ReadOnly setting in VolumeMounts. - // +optional - optional bool readOnly = 4; - - // Optional: Extra command options if any. - // +optional - map options = 5; -} - -// Represents a Flocker volume mounted by the Flocker agent. -// One and only one of datasetName and datasetUUID should be set. -// Flocker volumes do not support ownership management or SELinux relabeling. -message FlockerVolumeSource { - // Name of the dataset stored as metadata -> name on the dataset for Flocker - // should be considered as deprecated - // +optional - optional string datasetName = 1; - - // UUID of the dataset. This is unique identifier of a Flocker dataset - // +optional - optional string datasetUUID = 2; -} - -// Represents a Persistent Disk resource in Google Compute Engine. -// -// A GCE PD must exist before mounting to a container. The disk must -// also be in the same GCE project and zone as the kubelet. A GCE PD -// can only be mounted as read/write once or read-only many times. GCE -// PDs support ownership management and SELinux relabeling. -message GCEPersistentDiskVolumeSource { - // Unique name of the PD resource in GCE. Used to identify the disk in GCE. - // More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk - optional string pdName = 1; - - // Filesystem type of the volume that you want to mount. - // Tip: Ensure that the filesystem type is supported by the host operating system. - // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - // More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk - // TODO: how do we prevent errors in the filesystem from compromising the machine - // +optional - optional string fsType = 2; - - // The partition in the volume that you want to mount. - // If omitted, the default is to mount by volume name. - // Examples: For volume /dev/sda1, you specify the partition as "1". - // Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). - // More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk - // +optional - optional int32 partition = 3; - - // ReadOnly here will force the ReadOnly setting in VolumeMounts. - // Defaults to false. - // More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk - // +optional - optional bool readOnly = 4; -} - -// Represents a volume that is populated with the contents of a git repository. -// Git repo volumes do not support ownership management. -// Git repo volumes support SELinux relabeling. -// -// DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an -// EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir -// into the Pod's container. -message GitRepoVolumeSource { - // Repository URL - optional string repository = 1; - - // Commit hash for the specified revision. - // +optional - optional string revision = 2; - - // Target directory name. - // Must not contain or start with '..'. If '.' is supplied, the volume directory will be the - // git repository. Otherwise, if specified, the volume will contain the git repository in - // the subdirectory with the given name. - // +optional - optional string directory = 3; -} - -// Represents a Glusterfs mount that lasts the lifetime of a pod. -// Glusterfs volumes do not support ownership management or SELinux relabeling. -message GlusterfsPersistentVolumeSource { - // EndpointsName is the endpoint name that details Glusterfs topology. - // More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod - optional string endpoints = 1; - - // Path is the Glusterfs volume path. - // More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod - optional string path = 2; - - // ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. - // Defaults to false. - // More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod - // +optional - optional bool readOnly = 3; - - // EndpointsNamespace is the namespace that contains Glusterfs endpoint. - // If this field is empty, the EndpointNamespace defaults to the same namespace as the bound PVC. - // More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod - // +optional - optional string endpointsNamespace = 4; -} - -// Represents a Glusterfs mount that lasts the lifetime of a pod. -// Glusterfs volumes do not support ownership management or SELinux relabeling. -message GlusterfsVolumeSource { - // EndpointsName is the endpoint name that details Glusterfs topology. - // More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod - optional string endpoints = 1; - - // Path is the Glusterfs volume path. - // More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod - optional string path = 2; - - // ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. - // Defaults to false. - // More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod - // +optional - optional bool readOnly = 3; -} - -// HTTPGetAction describes an action based on HTTP Get requests. -message HTTPGetAction { - // Path to access on the HTTP server. - // +optional - optional string path = 1; - - // Name or number of the port to access on the container. - // Number must be in the range 1 to 65535. - // Name must be an IANA_SVC_NAME. - optional k8s.io.apimachinery.pkg.util.intstr.IntOrString port = 2; - - // Host name to connect to, defaults to the pod IP. You probably want to set - // "Host" in httpHeaders instead. - // +optional - optional string host = 3; - - // Scheme to use for connecting to the host. - // Defaults to HTTP. - // +optional - optional string scheme = 4; - - // Custom headers to set in the request. HTTP allows repeated headers. - // +optional - repeated HTTPHeader httpHeaders = 5; -} - -// HTTPHeader describes a custom header to be used in HTTP probes -message HTTPHeader { - // The header field name - optional string name = 1; - - // The header field value - optional string value = 2; -} - -// Handler defines a specific action that should be taken -// TODO: pass structured data to these actions, and document that data here. -message Handler { - // One and only one of the following should be specified. - // Exec specifies the action to take. - // +optional - optional ExecAction exec = 1; - - // HTTPGet specifies the http request to perform. - // +optional - optional HTTPGetAction httpGet = 2; - - // TCPSocket specifies an action involving a TCP port. - // TCP hooks not yet supported - // TODO: implement a realistic TCP lifecycle hook - // +optional - optional TCPSocketAction tcpSocket = 3; -} - -// HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the -// pod's hosts file. -message HostAlias { - // IP address of the host file entry. - optional string ip = 1; - - // Hostnames for the above IP address. - repeated string hostnames = 2; -} - -// Represents a host path mapped into a pod. -// Host path volumes do not support ownership management or SELinux relabeling. -message HostPathVolumeSource { - // Path of the directory on the host. - // If the path is a symlink, it will follow the link to the real path. - // More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath - optional string path = 1; - - // Type for HostPath Volume - // Defaults to "" - // More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath - // +optional - optional string type = 2; -} - -// ISCSIPersistentVolumeSource represents an ISCSI disk. -// ISCSI volumes can only be mounted as read/write once. -// ISCSI volumes support ownership management and SELinux relabeling. -message ISCSIPersistentVolumeSource { - // iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port - // is other than default (typically TCP ports 860 and 3260). - optional string targetPortal = 1; - - // Target iSCSI Qualified Name. - optional string iqn = 2; - - // iSCSI Target Lun number. - optional int32 lun = 3; - - // iSCSI Interface Name that uses an iSCSI transport. - // Defaults to 'default' (tcp). - // +optional - optional string iscsiInterface = 4; - - // Filesystem type of the volume that you want to mount. - // Tip: Ensure that the filesystem type is supported by the host operating system. - // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - // More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi - // TODO: how do we prevent errors in the filesystem from compromising the machine - // +optional - optional string fsType = 5; - - // ReadOnly here will force the ReadOnly setting in VolumeMounts. - // Defaults to false. - // +optional - optional bool readOnly = 6; - - // iSCSI Target Portal List. The Portal is either an IP or ip_addr:port if the port - // is other than default (typically TCP ports 860 and 3260). - // +optional - repeated string portals = 7; - - // whether support iSCSI Discovery CHAP authentication - // +optional - optional bool chapAuthDiscovery = 8; - - // whether support iSCSI Session CHAP authentication - // +optional - optional bool chapAuthSession = 11; - - // CHAP Secret for iSCSI target and initiator authentication - // +optional - optional SecretReference secretRef = 10; - - // Custom iSCSI Initiator Name. - // If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface - // : will be created for the connection. - // +optional - optional string initiatorName = 12; -} - -// Represents an ISCSI disk. -// ISCSI volumes can only be mounted as read/write once. -// ISCSI volumes support ownership management and SELinux relabeling. -message ISCSIVolumeSource { - // iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port - // is other than default (typically TCP ports 860 and 3260). - optional string targetPortal = 1; - - // Target iSCSI Qualified Name. - optional string iqn = 2; - - // iSCSI Target Lun number. - optional int32 lun = 3; - - // iSCSI Interface Name that uses an iSCSI transport. - // Defaults to 'default' (tcp). - // +optional - optional string iscsiInterface = 4; - - // Filesystem type of the volume that you want to mount. - // Tip: Ensure that the filesystem type is supported by the host operating system. - // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - // More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi - // TODO: how do we prevent errors in the filesystem from compromising the machine - // +optional - optional string fsType = 5; - - // ReadOnly here will force the ReadOnly setting in VolumeMounts. - // Defaults to false. - // +optional - optional bool readOnly = 6; - - // iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port - // is other than default (typically TCP ports 860 and 3260). - // +optional - repeated string portals = 7; - - // whether support iSCSI Discovery CHAP authentication - // +optional - optional bool chapAuthDiscovery = 8; - - // whether support iSCSI Session CHAP authentication - // +optional - optional bool chapAuthSession = 11; - - // CHAP Secret for iSCSI target and initiator authentication - // +optional - optional LocalObjectReference secretRef = 10; - - // Custom iSCSI Initiator Name. - // If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface - // : will be created for the connection. - // +optional - optional string initiatorName = 12; -} - -// Maps a string key to a path within a volume. -message KeyToPath { - // The key to project. - optional string key = 1; - - // The relative path of the file to map the key to. - // May not be an absolute path. - // May not contain the path element '..'. - // May not start with the string '..'. - optional string path = 2; - - // Optional: mode bits to use on this file, must be a value between 0 - // and 0777. If not specified, the volume defaultMode will be used. - // This might be in conflict with other options that affect the file - // mode, like fsGroup, and the result can be other mode bits set. - // +optional - optional int32 mode = 3; -} - -// Lifecycle describes actions that the management system should take in response to container lifecycle -// events. For the PostStart and PreStop lifecycle handlers, management of the container blocks -// until the action is complete, unless the container process fails, in which case the handler is aborted. -message Lifecycle { - // PostStart is called immediately after a container is created. If the handler fails, - // the container is terminated and restarted according to its restart policy. - // Other management of the container blocks until the hook completes. - // More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks - // +optional - optional Handler postStart = 1; - - // PreStop is called immediately before a container is terminated due to an - // API request or management event such as liveness/startup probe failure, - // preemption, resource contention, etc. The handler is not called if the - // container crashes or exits. The reason for termination is passed to the - // handler. The Pod's termination grace period countdown begins before the - // PreStop hooked is executed. Regardless of the outcome of the handler, the - // container will eventually terminate within the Pod's termination grace - // period. Other management of the container blocks until the hook completes - // or until the termination grace period is reached. - // More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks - // +optional - optional Handler preStop = 2; -} - -// LimitRange sets resource usage limits for each kind of resource in a Namespace. -message LimitRange { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec defines the limits enforced. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional LimitRangeSpec spec = 2; -} - -// LimitRangeItem defines a min/max usage limit for any resource that matches on kind. -message LimitRangeItem { - // Type of resource that this limit applies to. - // +optional - optional string type = 1; - - // Max usage constraints on this kind by resource name. - // +optional - map max = 2; - - // Min usage constraints on this kind by resource name. - // +optional - map min = 3; - - // Default resource requirement limit value by resource name if resource limit is omitted. - // +optional - map default = 4; - - // DefaultRequest is the default resource requirement request value by resource name if resource request is omitted. - // +optional - map defaultRequest = 5; - - // MaxLimitRequestRatio if specified, the named resource must have a request and limit that are both non-zero where limit divided by request is less than or equal to the enumerated value; this represents the max burst for the named resource. - // +optional - map maxLimitRequestRatio = 6; -} - -// LimitRangeList is a list of LimitRange items. -message LimitRangeList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is a list of LimitRange objects. - // More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ - repeated LimitRange items = 2; -} - -// LimitRangeSpec defines a min/max usage limit for resources that match on kind. -message LimitRangeSpec { - // Limits is the list of LimitRangeItem objects that are enforced. - repeated LimitRangeItem limits = 1; -} - -// List holds a list of objects, which may not be known by the server. -message List { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // List of objects - repeated k8s.io.apimachinery.pkg.runtime.RawExtension items = 2; -} - -// LoadBalancerIngress represents the status of a load-balancer ingress point: -// traffic intended for the service should be sent to an ingress point. -message LoadBalancerIngress { - // IP is set for load-balancer ingress points that are IP based - // (typically GCE or OpenStack load-balancers) - // +optional - optional string ip = 1; - - // Hostname is set for load-balancer ingress points that are DNS based - // (typically AWS load-balancers) - // +optional - optional string hostname = 2; -} - -// LoadBalancerStatus represents the status of a load-balancer. -message LoadBalancerStatus { - // Ingress is a list containing ingress points for the load-balancer. - // Traffic intended for the service should be sent to these ingress points. - // +optional - repeated LoadBalancerIngress ingress = 1; -} - -// LocalObjectReference contains enough information to let you locate the -// referenced object inside the same namespace. -message LocalObjectReference { - // Name of the referent. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - // TODO: Add other useful fields. apiVersion, kind, uid? - // +optional - optional string name = 1; -} - -// Local represents directly-attached storage with node affinity (Beta feature) -message LocalVolumeSource { - // The full path to the volume on the node. - // It can be either a directory or block device (disk, partition, ...). - optional string path = 1; - - // Filesystem type to mount. - // It applies only when the Path is a block device. - // Must be a filesystem type supported by the host operating system. - // Ex. "ext4", "xfs", "ntfs". The default value is to auto-select a fileystem if unspecified. - // +optional - optional string fsType = 2; -} - -// Represents an NFS mount that lasts the lifetime of a pod. -// NFS volumes do not support ownership management or SELinux relabeling. -message NFSVolumeSource { - // Server is the hostname or IP address of the NFS server. - // More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs - optional string server = 1; - - // Path that is exported by the NFS server. - // More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs - optional string path = 2; - - // ReadOnly here will force - // the NFS export to be mounted with read-only permissions. - // Defaults to false. - // More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs - // +optional - optional bool readOnly = 3; -} - -// Namespace provides a scope for Names. -// Use of multiple namespaces is optional. -message Namespace { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec defines the behavior of the Namespace. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional NamespaceSpec spec = 2; - - // Status describes the current status of a Namespace. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional NamespaceStatus status = 3; -} - -// NamespaceCondition contains details about state of namespace. -message NamespaceCondition { - // Type of namespace controller condition. - optional string type = 1; - - // Status of the condition, one of True, False, Unknown. - optional string status = 2; - - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 4; - - // +optional - optional string reason = 5; - - // +optional - optional string message = 6; -} - -// NamespaceList is a list of Namespaces. -message NamespaceList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is the list of Namespace objects in the list. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - repeated Namespace items = 2; -} - -// NamespaceSpec describes the attributes on a Namespace. -message NamespaceSpec { - // Finalizers is an opaque list of values that must be empty to permanently remove object from storage. - // More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/ - // +optional - repeated string finalizers = 1; -} - -// NamespaceStatus is information about the current status of a Namespace. -message NamespaceStatus { - // Phase is the current lifecycle phase of the namespace. - // More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/ - // +optional - optional string phase = 1; - - // Represents the latest available observations of a namespace's current state. - // +optional - // +patchMergeKey=type - // +patchStrategy=merge - repeated NamespaceCondition conditions = 2; -} - -// Node is a worker node in Kubernetes. -// Each node will have a unique identifier in the cache (i.e. in etcd). -message Node { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec defines the behavior of a node. - // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional NodeSpec spec = 2; - - // Most recently observed status of the node. - // Populated by the system. - // Read-only. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional NodeStatus status = 3; -} - -// NodeAddress contains information for the node's address. -message NodeAddress { - // Node address type, one of Hostname, ExternalIP or InternalIP. - optional string type = 1; - - // The node address. - optional string address = 2; -} - -// Node affinity is a group of node affinity scheduling rules. -message NodeAffinity { - // If the affinity requirements specified by this field are not met at - // scheduling time, the pod will not be scheduled onto the node. - // If the affinity requirements specified by this field cease to be met - // at some point during pod execution (e.g. due to an update), the system - // may or may not try to eventually evict the pod from its node. - // +optional - optional NodeSelector requiredDuringSchedulingIgnoredDuringExecution = 1; - - // The scheduler will prefer to schedule pods to nodes that satisfy - // the affinity expressions specified by this field, but it may choose - // a node that violates one or more of the expressions. The node that is - // most preferred is the one with the greatest sum of weights, i.e. - // for each node that meets all of the scheduling requirements (resource - // request, requiredDuringScheduling affinity expressions, etc.), - // compute a sum by iterating through the elements of this field and adding - // "weight" to the sum if the node matches the corresponding matchExpressions; the - // node(s) with the highest sum are the most preferred. - // +optional - repeated PreferredSchedulingTerm preferredDuringSchedulingIgnoredDuringExecution = 2; -} - -// NodeCondition contains condition information for a node. -message NodeCondition { - // Type of node condition. - optional string type = 1; - - // Status of the condition, one of True, False, Unknown. - optional string status = 2; - - // Last time we got an update on a given condition. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastHeartbeatTime = 3; - - // Last time the condition transit from one status to another. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 4; - - // (brief) reason for the condition's last transition. - // +optional - optional string reason = 5; - - // Human readable message indicating details about last transition. - // +optional - optional string message = 6; -} - -// NodeConfigSource specifies a source of node configuration. Exactly one subfield (excluding metadata) must be non-nil. -message NodeConfigSource { - // ConfigMap is a reference to a Node's ConfigMap - optional ConfigMapNodeConfigSource configMap = 2; -} - -// NodeConfigStatus describes the status of the config assigned by Node.Spec.ConfigSource. -message NodeConfigStatus { - // Assigned reports the checkpointed config the node will try to use. - // When Node.Spec.ConfigSource is updated, the node checkpoints the associated - // config payload to local disk, along with a record indicating intended - // config. The node refers to this record to choose its config checkpoint, and - // reports this record in Assigned. Assigned only updates in the status after - // the record has been checkpointed to disk. When the Kubelet is restarted, - // it tries to make the Assigned config the Active config by loading and - // validating the checkpointed payload identified by Assigned. - // +optional - optional NodeConfigSource assigned = 1; - - // Active reports the checkpointed config the node is actively using. - // Active will represent either the current version of the Assigned config, - // or the current LastKnownGood config, depending on whether attempting to use the - // Assigned config results in an error. - // +optional - optional NodeConfigSource active = 2; - - // LastKnownGood reports the checkpointed config the node will fall back to - // when it encounters an error attempting to use the Assigned config. - // The Assigned config becomes the LastKnownGood config when the node determines - // that the Assigned config is stable and correct. - // This is currently implemented as a 10-minute soak period starting when the local - // record of Assigned config is updated. If the Assigned config is Active at the end - // of this period, it becomes the LastKnownGood. Note that if Spec.ConfigSource is - // reset to nil (use local defaults), the LastKnownGood is also immediately reset to nil, - // because the local default config is always assumed good. - // You should not make assumptions about the node's method of determining config stability - // and correctness, as this may change or become configurable in the future. - // +optional - optional NodeConfigSource lastKnownGood = 3; - - // Error describes any problems reconciling the Spec.ConfigSource to the Active config. - // Errors may occur, for example, attempting to checkpoint Spec.ConfigSource to the local Assigned - // record, attempting to checkpoint the payload associated with Spec.ConfigSource, attempting - // to load or validate the Assigned config, etc. - // Errors may occur at different points while syncing config. Earlier errors (e.g. download or - // checkpointing errors) will not result in a rollback to LastKnownGood, and may resolve across - // Kubelet retries. Later errors (e.g. loading or validating a checkpointed config) will result in - // a rollback to LastKnownGood. In the latter case, it is usually possible to resolve the error - // by fixing the config assigned in Spec.ConfigSource. - // You can find additional information for debugging by searching the error message in the Kubelet log. - // Error is a human-readable description of the error state; machines can check whether or not Error - // is empty, but should not rely on the stability of the Error text across Kubelet versions. - // +optional - optional string error = 4; -} - -// NodeDaemonEndpoints lists ports opened by daemons running on the Node. -message NodeDaemonEndpoints { - // Endpoint on which Kubelet is listening. - // +optional - optional DaemonEndpoint kubeletEndpoint = 1; -} - -// NodeList is the whole list of all Nodes which have been registered with master. -message NodeList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // List of nodes - repeated Node items = 2; -} - -// NodeProxyOptions is the query options to a Node's proxy call. -message NodeProxyOptions { - // Path is the URL path to use for the current proxy request to node. - // +optional - optional string path = 1; -} - -// NodeResources is an object for conveying resource information about a node. -// see http://releases.k8s.io/HEAD/docs/design/resources.md for more details. -message NodeResources { - // Capacity represents the available resources of a node - map capacity = 1; -} - -// A node selector represents the union of the results of one or more label queries -// over a set of nodes; that is, it represents the OR of the selectors represented -// by the node selector terms. -message NodeSelector { - // Required. A list of node selector terms. The terms are ORed. - repeated NodeSelectorTerm nodeSelectorTerms = 1; -} - -// A node selector requirement is a selector that contains values, a key, and an operator -// that relates the key and values. -message NodeSelectorRequirement { - // The label key that the selector applies to. - optional string key = 1; - - // Represents a key's relationship to a set of values. - // Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - optional string operator = 2; - - // An array of string values. If the operator is In or NotIn, - // the values array must be non-empty. If the operator is Exists or DoesNotExist, - // the values array must be empty. If the operator is Gt or Lt, the values - // array must have a single element, which will be interpreted as an integer. - // This array is replaced during a strategic merge patch. - // +optional - repeated string values = 3; -} - -// A null or empty node selector term matches no objects. The requirements of -// them are ANDed. -// The TopologySelectorTerm type implements a subset of the NodeSelectorTerm. -message NodeSelectorTerm { - // A list of node selector requirements by node's labels. - // +optional - repeated NodeSelectorRequirement matchExpressions = 1; - - // A list of node selector requirements by node's fields. - // +optional - repeated NodeSelectorRequirement matchFields = 2; -} - -// NodeSpec describes the attributes that a node is created with. -message NodeSpec { - // PodCIDR represents the pod IP range assigned to the node. - // +optional - optional string podCIDR = 1; - - // podCIDRs represents the IP ranges assigned to the node for usage by Pods on that node. If this - // field is specified, the 0th entry must match the podCIDR field. It may contain at most 1 value for - // each of IPv4 and IPv6. - // +optional - // +patchStrategy=merge - repeated string podCIDRs = 7; - - // ID of the node assigned by the cloud provider in the format: :// - // +optional - optional string providerID = 3; - - // Unschedulable controls node schedulability of new pods. By default, node is schedulable. - // More info: https://kubernetes.io/docs/concepts/nodes/node/#manual-node-administration - // +optional - optional bool unschedulable = 4; - - // If specified, the node's taints. - // +optional - repeated Taint taints = 5; - - // If specified, the source to get node configuration from - // The DynamicKubeletConfig feature gate must be enabled for the Kubelet to use this field - // +optional - optional NodeConfigSource configSource = 6; - - // Deprecated. Not all kubelets will set this field. Remove field after 1.13. - // see: https://issues.k8s.io/61966 - // +optional - optional string externalID = 2; -} - -// NodeStatus is information about the current status of a node. -message NodeStatus { - // Capacity represents the total resources of a node. - // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity - // +optional - map capacity = 1; - - // Allocatable represents the resources of a node that are available for scheduling. - // Defaults to Capacity. - // +optional - map allocatable = 2; - - // NodePhase is the recently observed lifecycle phase of the node. - // More info: https://kubernetes.io/docs/concepts/nodes/node/#phase - // The field is never populated, and now is deprecated. - // +optional - optional string phase = 3; - - // Conditions is an array of current observed node conditions. - // More info: https://kubernetes.io/docs/concepts/nodes/node/#condition - // +optional - // +patchMergeKey=type - // +patchStrategy=merge - repeated NodeCondition conditions = 4; - - // List of addresses reachable to the node. - // Queried from cloud provider, if available. - // More info: https://kubernetes.io/docs/concepts/nodes/node/#addresses - // Note: This field is declared as mergeable, but the merge key is not sufficiently - // unique, which can cause data corruption when it is merged. Callers should instead - // use a full-replacement patch. See http://pr.k8s.io/79391 for an example. - // +optional - // +patchMergeKey=type - // +patchStrategy=merge - repeated NodeAddress addresses = 5; - - // Endpoints of daemons running on the Node. - // +optional - optional NodeDaemonEndpoints daemonEndpoints = 6; - - // Set of ids/uuids to uniquely identify the node. - // More info: https://kubernetes.io/docs/concepts/nodes/node/#info - // +optional - optional NodeSystemInfo nodeInfo = 7; - - // List of container images on this node - // +optional - repeated ContainerImage images = 8; - - // List of attachable volumes in use (mounted) by the node. - // +optional - repeated string volumesInUse = 9; - - // List of volumes that are attached to the node. - // +optional - repeated AttachedVolume volumesAttached = 10; - - // Status of the config assigned to the node via the dynamic Kubelet config feature. - // +optional - optional NodeConfigStatus config = 11; -} - -// NodeSystemInfo is a set of ids/uuids to uniquely identify the node. -message NodeSystemInfo { - // MachineID reported by the node. For unique machine identification - // in the cluster this field is preferred. Learn more from man(5) - // machine-id: http://man7.org/linux/man-pages/man5/machine-id.5.html - optional string machineID = 1; - - // SystemUUID reported by the node. For unique machine identification - // MachineID is preferred. This field is specific to Red Hat hosts - // https://access.redhat.com/documentation/en-US/Red_Hat_Subscription_Management/1/html/RHSM/getting-system-uuid.html - optional string systemUUID = 2; - - // Boot ID reported by the node. - optional string bootID = 3; - - // Kernel Version reported by the node from 'uname -r' (e.g. 3.16.0-0.bpo.4-amd64). - optional string kernelVersion = 4; - - // OS Image reported by the node from /etc/os-release (e.g. Debian GNU/Linux 7 (wheezy)). - optional string osImage = 5; - - // ContainerRuntime Version reported by the node through runtime remote API (e.g. docker://1.5.0). - optional string containerRuntimeVersion = 6; - - // Kubelet Version reported by the node. - optional string kubeletVersion = 7; - - // KubeProxy Version reported by the node. - optional string kubeProxyVersion = 8; - - // The Operating System reported by the node - optional string operatingSystem = 9; - - // The Architecture reported by the node - optional string architecture = 10; -} - -// ObjectFieldSelector selects an APIVersioned field of an object. -message ObjectFieldSelector { - // Version of the schema the FieldPath is written in terms of, defaults to "v1". - // +optional - optional string apiVersion = 1; - - // Path of the field to select in the specified API version. - optional string fieldPath = 2; -} - -// ObjectReference contains enough information to let you inspect or modify the referred object. -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -message ObjectReference { - // Kind of the referent. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional string kind = 1; - - // Namespace of the referent. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - // +optional - optional string namespace = 2; - - // Name of the referent. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - // +optional - optional string name = 3; - - // UID of the referent. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - // +optional - optional string uid = 4; - - // API version of the referent. - // +optional - optional string apiVersion = 5; - - // Specific resourceVersion to which this reference is made, if any. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - // +optional - optional string resourceVersion = 6; - - // If referring to a piece of an object instead of an entire object, this string - // should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. - // For example, if the object reference is to a container within a pod, this would take on a value like: - // "spec.containers{name}" (where "name" refers to the name of the container that triggered - // the event) or if no container name is specified "spec.containers[2]" (container with - // index 2 in this pod). This syntax is chosen only to have some well-defined way of - // referencing a part of an object. - // TODO: this design is not final and this field is subject to change in the future. - // +optional - optional string fieldPath = 7; -} - -// PersistentVolume (PV) is a storage resource provisioned by an administrator. -// It is analogous to a node. -// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes -message PersistentVolume { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec defines a specification of a persistent volume owned by the cluster. - // Provisioned by an administrator. - // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistent-volumes - // +optional - optional PersistentVolumeSpec spec = 2; - - // Status represents the current information/status for the persistent volume. - // Populated by the system. - // Read-only. - // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistent-volumes - // +optional - optional PersistentVolumeStatus status = 3; -} - -// PersistentVolumeClaim is a user's request for and claim to a persistent volume -message PersistentVolumeClaim { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec defines the desired characteristics of a volume requested by a pod author. - // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims - // +optional - optional PersistentVolumeClaimSpec spec = 2; - - // Status represents the current information/status of a persistent volume claim. - // Read-only. - // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims - // +optional - optional PersistentVolumeClaimStatus status = 3; -} - -// PersistentVolumeClaimCondition contails details about state of pvc -message PersistentVolumeClaimCondition { - optional string type = 1; - - optional string status = 2; - - // Last time we probed the condition. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastProbeTime = 3; - - // Last time the condition transitioned from one status to another. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 4; - - // Unique, this should be a short, machine understandable string that gives the reason - // for condition's last transition. If it reports "ResizeStarted" that means the underlying - // persistent volume is being resized. - // +optional - optional string reason = 5; - - // Human-readable message indicating details about last transition. - // +optional - optional string message = 6; -} - -// PersistentVolumeClaimList is a list of PersistentVolumeClaim items. -message PersistentVolumeClaimList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // A list of persistent volume claims. - // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims - repeated PersistentVolumeClaim items = 2; -} - -// PersistentVolumeClaimSpec describes the common attributes of storage devices -// and allows a Source for provider-specific attributes -message PersistentVolumeClaimSpec { - // AccessModes contains the desired access modes the volume should have. - // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 - // +optional - repeated string accessModes = 1; - - // A label query over volumes to consider for binding. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4; - - // Resources represents the minimum resources the volume should have. - // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources - // +optional - optional ResourceRequirements resources = 2; - - // VolumeName is the binding reference to the PersistentVolume backing this claim. - // +optional - optional string volumeName = 3; - - // Name of the StorageClass required by the claim. - // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 - // +optional - optional string storageClassName = 5; - - // volumeMode defines what type of volume is required by the claim. - // Value of Filesystem is implied when not included in claim spec. - // This is a beta feature. - // +optional - optional string volumeMode = 6; - - // This field requires the VolumeSnapshotDataSource alpha feature gate to be - // enabled and currently VolumeSnapshot is the only supported data source. - // If the provisioner can support VolumeSnapshot data source, it will create - // a new volume and data will be restored to the volume at the same time. - // If the provisioner does not support VolumeSnapshot data source, volume will - // not be created and the failure will be reported as an event. - // In the future, we plan to support more data source types and the behavior - // of the provisioner may change. - // +optional - optional TypedLocalObjectReference dataSource = 7; -} - -// PersistentVolumeClaimStatus is the current status of a persistent volume claim. -message PersistentVolumeClaimStatus { - // Phase represents the current phase of PersistentVolumeClaim. - // +optional - optional string phase = 1; - - // AccessModes contains the actual access modes the volume backing the PVC has. - // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 - // +optional - repeated string accessModes = 2; - - // Represents the actual resources of the underlying volume. - // +optional - map capacity = 3; - - // Current Condition of persistent volume claim. If underlying persistent volume is being - // resized then the Condition will be set to 'ResizeStarted'. - // +optional - // +patchMergeKey=type - // +patchStrategy=merge - repeated PersistentVolumeClaimCondition conditions = 4; -} - -// PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. -// This volume finds the bound PV and mounts that volume for the pod. A -// PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another -// type of volume that is owned by someone else (the system). -message PersistentVolumeClaimVolumeSource { - // ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. - // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims - optional string claimName = 1; - - // Will force the ReadOnly setting in VolumeMounts. - // Default false. - // +optional - optional bool readOnly = 2; -} - -// PersistentVolumeList is a list of PersistentVolume items. -message PersistentVolumeList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // List of persistent volumes. - // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes - repeated PersistentVolume items = 2; -} - -// PersistentVolumeSource is similar to VolumeSource but meant for the -// administrator who creates PVs. Exactly one of its members must be set. -message PersistentVolumeSource { - // GCEPersistentDisk represents a GCE Disk resource that is attached to a - // kubelet's host machine and then exposed to the pod. Provisioned by an admin. - // More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk - // +optional - optional GCEPersistentDiskVolumeSource gcePersistentDisk = 1; - - // AWSElasticBlockStore represents an AWS Disk resource that is attached to a - // kubelet's host machine and then exposed to the pod. - // More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore - // +optional - optional AWSElasticBlockStoreVolumeSource awsElasticBlockStore = 2; - - // HostPath represents a directory on the host. - // Provisioned by a developer or tester. - // This is useful for single-node development and testing only! - // On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. - // More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath - // +optional - optional HostPathVolumeSource hostPath = 3; - - // Glusterfs represents a Glusterfs volume that is attached to a host and - // exposed to the pod. Provisioned by an admin. - // More info: https://examples.k8s.io/volumes/glusterfs/README.md - // +optional - optional GlusterfsPersistentVolumeSource glusterfs = 4; - - // NFS represents an NFS mount on the host. Provisioned by an admin. - // More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs - // +optional - optional NFSVolumeSource nfs = 5; - - // RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. - // More info: https://examples.k8s.io/volumes/rbd/README.md - // +optional - optional RBDPersistentVolumeSource rbd = 6; - - // ISCSI represents an ISCSI Disk resource that is attached to a - // kubelet's host machine and then exposed to the pod. Provisioned by an admin. - // +optional - optional ISCSIPersistentVolumeSource iscsi = 7; - - // Cinder represents a cinder volume attached and mounted on kubelets host machine. - // More info: https://examples.k8s.io/mysql-cinder-pd/README.md - // +optional - optional CinderPersistentVolumeSource cinder = 8; - - // CephFS represents a Ceph FS mount on the host that shares a pod's lifetime - // +optional - optional CephFSPersistentVolumeSource cephfs = 9; - - // FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. - // +optional - optional FCVolumeSource fc = 10; - - // Flocker represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running - // +optional - optional FlockerVolumeSource flocker = 11; - - // FlexVolume represents a generic volume resource that is - // provisioned/attached using an exec based plugin. - // +optional - optional FlexPersistentVolumeSource flexVolume = 12; - - // AzureFile represents an Azure File Service mount on the host and bind mount to the pod. - // +optional - optional AzureFilePersistentVolumeSource azureFile = 13; - - // VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine - // +optional - optional VsphereVirtualDiskVolumeSource vsphereVolume = 14; - - // Quobyte represents a Quobyte mount on the host that shares a pod's lifetime - // +optional - optional QuobyteVolumeSource quobyte = 15; - - // AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. - // +optional - optional AzureDiskVolumeSource azureDisk = 16; - - // PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine - optional PhotonPersistentDiskVolumeSource photonPersistentDisk = 17; - - // PortworxVolume represents a portworx volume attached and mounted on kubelets host machine - // +optional - optional PortworxVolumeSource portworxVolume = 18; - - // ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. - // +optional - optional ScaleIOPersistentVolumeSource scaleIO = 19; - - // Local represents directly-attached storage with node affinity - // +optional - optional LocalVolumeSource local = 20; - - // StorageOS represents a StorageOS volume that is attached to the kubelet's host machine and mounted into the pod - // More info: https://examples.k8s.io/volumes/storageos/README.md - // +optional - optional StorageOSPersistentVolumeSource storageos = 21; - - // CSI represents storage that is handled by an external CSI driver (Beta feature). - // +optional - optional CSIPersistentVolumeSource csi = 22; -} - -// PersistentVolumeSpec is the specification of a persistent volume. -message PersistentVolumeSpec { - // A description of the persistent volume's resources and capacity. - // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity - // +optional - map capacity = 1; - - // The actual volume backing the persistent volume. - optional PersistentVolumeSource persistentVolumeSource = 2; - - // AccessModes contains all ways the volume can be mounted. - // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes - // +optional - repeated string accessModes = 3; - - // ClaimRef is part of a bi-directional binding between PersistentVolume and PersistentVolumeClaim. - // Expected to be non-nil when bound. - // claim.VolumeName is the authoritative bind between PV and PVC. - // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#binding - // +optional - optional ObjectReference claimRef = 4; - - // What happens to a persistent volume when released from its claim. - // Valid options are Retain (default for manually created PersistentVolumes), Delete (default - // for dynamically provisioned PersistentVolumes), and Recycle (deprecated). - // Recycle must be supported by the volume plugin underlying this PersistentVolume. - // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming - // +optional - optional string persistentVolumeReclaimPolicy = 5; - - // Name of StorageClass to which this persistent volume belongs. Empty value - // means that this volume does not belong to any StorageClass. - // +optional - optional string storageClassName = 6; - - // A list of mount options, e.g. ["ro", "soft"]. Not validated - mount will - // simply fail if one is invalid. - // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#mount-options - // +optional - repeated string mountOptions = 7; - - // volumeMode defines if a volume is intended to be used with a formatted filesystem - // or to remain in raw block state. Value of Filesystem is implied when not included in spec. - // This is a beta feature. - // +optional - optional string volumeMode = 8; - - // NodeAffinity defines constraints that limit what nodes this volume can be accessed from. - // This field influences the scheduling of pods that use this volume. - // +optional - optional VolumeNodeAffinity nodeAffinity = 9; -} - -// PersistentVolumeStatus is the current status of a persistent volume. -message PersistentVolumeStatus { - // Phase indicates if a volume is available, bound to a claim, or released by a claim. - // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#phase - // +optional - optional string phase = 1; - - // A human-readable message indicating details about why the volume is in this state. - // +optional - optional string message = 2; - - // Reason is a brief CamelCase string that describes any failure and is meant - // for machine parsing and tidy display in the CLI. - // +optional - optional string reason = 3; -} - -// Represents a Photon Controller persistent disk resource. -message PhotonPersistentDiskVolumeSource { - // ID that identifies Photon Controller persistent disk - optional string pdID = 1; - - // Filesystem type to mount. - // Must be a filesystem type supported by the host operating system. - // Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - optional string fsType = 2; -} - -// Pod is a collection of containers that can run on a host. This resource is created -// by clients and scheduled onto hosts. -message Pod { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Specification of the desired behavior of the pod. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional PodSpec spec = 2; - - // Most recently observed status of the pod. - // This data may not be up to date. - // Populated by the system. - // Read-only. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional PodStatus status = 3; -} - -// Pod affinity is a group of inter pod affinity scheduling rules. -message PodAffinity { - // If the affinity requirements specified by this field are not met at - // scheduling time, the pod will not be scheduled onto the node. - // If the affinity requirements specified by this field cease to be met - // at some point during pod execution (e.g. due to a pod label update), the - // system may or may not try to eventually evict the pod from its node. - // When there are multiple elements, the lists of nodes corresponding to each - // podAffinityTerm are intersected, i.e. all terms must be satisfied. - // +optional - repeated PodAffinityTerm requiredDuringSchedulingIgnoredDuringExecution = 1; - - // The scheduler will prefer to schedule pods to nodes that satisfy - // the affinity expressions specified by this field, but it may choose - // a node that violates one or more of the expressions. The node that is - // most preferred is the one with the greatest sum of weights, i.e. - // for each node that meets all of the scheduling requirements (resource - // request, requiredDuringScheduling affinity expressions, etc.), - // compute a sum by iterating through the elements of this field and adding - // "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the - // node(s) with the highest sum are the most preferred. - // +optional - repeated WeightedPodAffinityTerm preferredDuringSchedulingIgnoredDuringExecution = 2; -} - -// Defines a set of pods (namely those matching the labelSelector -// relative to the given namespace(s)) that this pod should be -// co-located (affinity) or not co-located (anti-affinity) with, -// where co-located is defined as running on a node whose value of -// the label with key matches that of any node on which -// a pod of the set of pods is running -message PodAffinityTerm { - // A label query over a set of resources, in this case pods. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector labelSelector = 1; - - // namespaces specifies which namespaces the labelSelector applies to (matches against); - // null or empty list means "this pod's namespace" - // +optional - repeated string namespaces = 2; - - // This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching - // the labelSelector in the specified namespaces, where co-located is defined as running on a node - // whose value of the label with key topologyKey matches that of any node on which any of the - // selected pods is running. - // Empty topologyKey is not allowed. - optional string topologyKey = 3; -} - -// Pod anti affinity is a group of inter pod anti affinity scheduling rules. -message PodAntiAffinity { - // If the anti-affinity requirements specified by this field are not met at - // scheduling time, the pod will not be scheduled onto the node. - // If the anti-affinity requirements specified by this field cease to be met - // at some point during pod execution (e.g. due to a pod label update), the - // system may or may not try to eventually evict the pod from its node. - // When there are multiple elements, the lists of nodes corresponding to each - // podAffinityTerm are intersected, i.e. all terms must be satisfied. - // +optional - repeated PodAffinityTerm requiredDuringSchedulingIgnoredDuringExecution = 1; - - // The scheduler will prefer to schedule pods to nodes that satisfy - // the anti-affinity expressions specified by this field, but it may choose - // a node that violates one or more of the expressions. The node that is - // most preferred is the one with the greatest sum of weights, i.e. - // for each node that meets all of the scheduling requirements (resource - // request, requiredDuringScheduling anti-affinity expressions, etc.), - // compute a sum by iterating through the elements of this field and adding - // "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the - // node(s) with the highest sum are the most preferred. - // +optional - repeated WeightedPodAffinityTerm preferredDuringSchedulingIgnoredDuringExecution = 2; -} - -// PodAttachOptions is the query options to a Pod's remote attach call. -// --- -// TODO: merge w/ PodExecOptions below for stdin, stdout, etc -// and also when we cut V2, we should export a "StreamOptions" or somesuch that contains Stdin, Stdout, Stder and TTY -message PodAttachOptions { - // Stdin if true, redirects the standard input stream of the pod for this call. - // Defaults to false. - // +optional - optional bool stdin = 1; - - // Stdout if true indicates that stdout is to be redirected for the attach call. - // Defaults to true. - // +optional - optional bool stdout = 2; - - // Stderr if true indicates that stderr is to be redirected for the attach call. - // Defaults to true. - // +optional - optional bool stderr = 3; - - // TTY if true indicates that a tty will be allocated for the attach call. - // This is passed through the container runtime so the tty - // is allocated on the worker node by the container runtime. - // Defaults to false. - // +optional - optional bool tty = 4; - - // The container in which to execute the command. - // Defaults to only container if there is only one container in the pod. - // +optional - optional string container = 5; -} - -// PodCondition contains details for the current condition of this pod. -message PodCondition { - // Type is the type of the condition. - // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions - optional string type = 1; - - // Status is the status of the condition. - // Can be True, False, Unknown. - // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions - optional string status = 2; - - // Last time we probed the condition. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastProbeTime = 3; - - // Last time the condition transitioned from one status to another. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 4; - - // Unique, one-word, CamelCase reason for the condition's last transition. - // +optional - optional string reason = 5; - - // Human-readable message indicating details about last transition. - // +optional - optional string message = 6; -} - -// PodDNSConfig defines the DNS parameters of a pod in addition to -// those generated from DNSPolicy. -message PodDNSConfig { - // A list of DNS name server IP addresses. - // This will be appended to the base nameservers generated from DNSPolicy. - // Duplicated nameservers will be removed. - // +optional - repeated string nameservers = 1; - - // A list of DNS search domains for host-name lookup. - // This will be appended to the base search paths generated from DNSPolicy. - // Duplicated search paths will be removed. - // +optional - repeated string searches = 2; - - // A list of DNS resolver options. - // This will be merged with the base options generated from DNSPolicy. - // Duplicated entries will be removed. Resolution options given in Options - // will override those that appear in the base DNSPolicy. - // +optional - repeated PodDNSConfigOption options = 3; -} - -// PodDNSConfigOption defines DNS resolver options of a pod. -message PodDNSConfigOption { - // Required. - optional string name = 1; - - // +optional - optional string value = 2; -} - -// PodExecOptions is the query options to a Pod's remote exec call. -// --- -// TODO: This is largely identical to PodAttachOptions above, make sure they stay in sync and see about merging -// and also when we cut V2, we should export a "StreamOptions" or somesuch that contains Stdin, Stdout, Stder and TTY -message PodExecOptions { - // Redirect the standard input stream of the pod for this call. - // Defaults to false. - // +optional - optional bool stdin = 1; - - // Redirect the standard output stream of the pod for this call. - // Defaults to true. - // +optional - optional bool stdout = 2; - - // Redirect the standard error stream of the pod for this call. - // Defaults to true. - // +optional - optional bool stderr = 3; - - // TTY if true indicates that a tty will be allocated for the exec call. - // Defaults to false. - // +optional - optional bool tty = 4; - - // Container in which to execute the command. - // Defaults to only container if there is only one container in the pod. - // +optional - optional string container = 5; - - // Command is the remote command to execute. argv array. Not executed within a shell. - repeated string command = 6; -} - -// IP address information for entries in the (plural) PodIPs field. -// Each entry includes: -// IP: An IP address allocated to the pod. Routable at least within the cluster. -message PodIP { - // ip is an IP address (IPv4 or IPv6) assigned to the pod - optional string ip = 1; -} - -// PodList is a list of Pods. -message PodList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // List of pods. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md - repeated Pod items = 2; -} - -// PodLogOptions is the query options for a Pod's logs REST call. -message PodLogOptions { - // The container for which to stream logs. Defaults to only container if there is one container in the pod. - // +optional - optional string container = 1; - - // Follow the log stream of the pod. Defaults to false. - // +optional - optional bool follow = 2; - - // Return previous terminated container logs. Defaults to false. - // +optional - optional bool previous = 3; - - // A relative time in seconds before the current time from which to show logs. If this value - // precedes the time a pod was started, only logs since the pod start will be returned. - // If this value is in the future, no logs will be returned. - // Only one of sinceSeconds or sinceTime may be specified. - // +optional - optional int64 sinceSeconds = 4; - - // An RFC3339 timestamp from which to show logs. If this value - // precedes the time a pod was started, only logs since the pod start will be returned. - // If this value is in the future, no logs will be returned. - // Only one of sinceSeconds or sinceTime may be specified. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time sinceTime = 5; - - // If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line - // of log output. Defaults to false. - // +optional - optional bool timestamps = 6; - - // If set, the number of lines from the end of the logs to show. If not specified, - // logs are shown from the creation of the container or sinceSeconds or sinceTime - // +optional - optional int64 tailLines = 7; - - // If set, the number of bytes to read from the server before terminating the - // log output. This may not display a complete final line of logging, and may return - // slightly more or slightly less than the specified limit. - // +optional - optional int64 limitBytes = 8; - - // insecureSkipTLSVerifyBackend indicates that the apiserver should not confirm the validity of the - // serving certificate of the backend it is connecting to. This will make the HTTPS connection between the apiserver - // and the backend insecure. This means the apiserver cannot verify the log data it is receiving came from the real - // kubelet. If the kubelet is configured to verify the apiserver's TLS credentials, it does not mean the - // connection to the real kubelet is vulnerable to a man in the middle attack (e.g. an attacker could not intercept - // the actual log data coming from the real kubelet). - // +optional - optional bool insecureSkipTLSVerifyBackend = 9; -} - -// PodPortForwardOptions is the query options to a Pod's port forward call -// when using WebSockets. -// The `port` query parameter must specify the port or -// ports (comma separated) to forward over. -// Port forwarding over SPDY does not use these options. It requires the port -// to be passed in the `port` header as part of request. -message PodPortForwardOptions { - // List of ports to forward - // Required when using WebSockets - // +optional - repeated int32 ports = 1; -} - -// PodProxyOptions is the query options to a Pod's proxy call. -message PodProxyOptions { - // Path is the URL path to use for the current proxy request to pod. - // +optional - optional string path = 1; -} - -// PodReadinessGate contains the reference to a pod condition -message PodReadinessGate { - // ConditionType refers to a condition in the pod's condition list with matching type. - optional string conditionType = 1; -} - -// PodSecurityContext holds pod-level security attributes and common container settings. -// Some fields are also present in container.securityContext. Field values of -// container.securityContext take precedence over field values of PodSecurityContext. -message PodSecurityContext { - // The SELinux context to be applied to all containers. - // If unspecified, the container runtime will allocate a random SELinux context for each - // container. May also be set in SecurityContext. If set in - // both SecurityContext and PodSecurityContext, the value specified in SecurityContext - // takes precedence for that container. - // +optional - optional SELinuxOptions seLinuxOptions = 1; - - // The Windows specific settings applied to all containers. - // If unspecified, the options within a container's SecurityContext will be used. - // If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - // +optional - optional WindowsSecurityContextOptions windowsOptions = 8; - - // The UID to run the entrypoint of the container process. - // Defaults to user specified in image metadata if unspecified. - // May also be set in SecurityContext. If set in both SecurityContext and - // PodSecurityContext, the value specified in SecurityContext takes precedence - // for that container. - // +optional - optional int64 runAsUser = 2; - - // The GID to run the entrypoint of the container process. - // Uses runtime default if unset. - // May also be set in SecurityContext. If set in both SecurityContext and - // PodSecurityContext, the value specified in SecurityContext takes precedence - // for that container. - // +optional - optional int64 runAsGroup = 6; - - // Indicates that the container must run as a non-root user. - // If true, the Kubelet will validate the image at runtime to ensure that it - // does not run as UID 0 (root) and fail to start the container if it does. - // If unset or false, no such validation will be performed. - // May also be set in SecurityContext. If set in both SecurityContext and - // PodSecurityContext, the value specified in SecurityContext takes precedence. - // +optional - optional bool runAsNonRoot = 3; - - // A list of groups applied to the first process run in each container, in addition - // to the container's primary GID. If unspecified, no groups will be added to - // any container. - // +optional - repeated int64 supplementalGroups = 4; - - // A special supplemental group that applies to all containers in a pod. - // Some volume types allow the Kubelet to change the ownership of that volume - // to be owned by the pod: - // - // 1. The owning GID will be the FSGroup - // 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) - // 3. The permission bits are OR'd with rw-rw---- - // - // If unset, the Kubelet will not modify the ownership and permissions of any volume. - // +optional - optional int64 fsGroup = 5; - - // Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported - // sysctls (by the container runtime) might fail to launch. - // +optional - repeated Sysctl sysctls = 7; -} - -// Describes the class of pods that should avoid this node. -// Exactly one field should be set. -message PodSignature { - // Reference to controller whose pods should avoid this node. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.OwnerReference podController = 1; -} - -// PodSpec is a description of a pod. -message PodSpec { - // List of volumes that can be mounted by containers belonging to the pod. - // More info: https://kubernetes.io/docs/concepts/storage/volumes - // +optional - // +patchMergeKey=name - // +patchStrategy=merge,retainKeys - repeated Volume volumes = 1; - - // List of initialization containers belonging to the pod. - // Init containers are executed in order prior to containers being started. If any - // init container fails, the pod is considered to have failed and is handled according - // to its restartPolicy. The name for an init container or normal container must be - // unique among all containers. - // Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. - // The resourceRequirements of an init container are taken into account during scheduling - // by finding the highest request/limit for each resource type, and then using the max of - // of that value or the sum of the normal containers. Limits are applied to init containers - // in a similar fashion. - // Init containers cannot currently be added or removed. - // Cannot be updated. - // More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ - // +patchMergeKey=name - // +patchStrategy=merge - repeated Container initContainers = 20; - - // List of containers belonging to the pod. - // Containers cannot currently be added or removed. - // There must be at least one container in a Pod. - // Cannot be updated. - // +patchMergeKey=name - // +patchStrategy=merge - repeated Container containers = 2; - - // List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing - // pod to perform user-initiated actions such as debugging. This list cannot be specified when - // creating a pod, and it cannot be modified by updating the pod spec. In order to add an - // ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource. - // This field is alpha-level and is only honored by servers that enable the EphemeralContainers feature. - // +optional - // +patchMergeKey=name - // +patchStrategy=merge - repeated EphemeralContainer ephemeralContainers = 34; - - // Restart policy for all containers within the pod. - // One of Always, OnFailure, Never. - // Default to Always. - // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy - // +optional - optional string restartPolicy = 3; - - // Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. - // Value must be non-negative integer. The value zero indicates delete immediately. - // If this value is nil, the default grace period will be used instead. - // The grace period is the duration in seconds after the processes running in the pod are sent - // a termination signal and the time when the processes are forcibly halted with a kill signal. - // Set this value longer than the expected cleanup time for your process. - // Defaults to 30 seconds. - // +optional - optional int64 terminationGracePeriodSeconds = 4; - - // Optional duration in seconds the pod may be active on the node relative to - // StartTime before the system will actively try to mark it failed and kill associated containers. - // Value must be a positive integer. - // +optional - optional int64 activeDeadlineSeconds = 5; - - // Set DNS policy for the pod. - // Defaults to "ClusterFirst". - // Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. - // DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. - // To have DNS options set along with hostNetwork, you have to specify DNS policy - // explicitly to 'ClusterFirstWithHostNet'. - // +optional - optional string dnsPolicy = 6; - - // NodeSelector is a selector which must be true for the pod to fit on a node. - // Selector which must match a node's labels for the pod to be scheduled on that node. - // More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ - // +optional - map nodeSelector = 7; - - // ServiceAccountName is the name of the ServiceAccount to use to run this pod. - // More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ - // +optional - optional string serviceAccountName = 8; - - // DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. - // Deprecated: Use serviceAccountName instead. - // +k8s:conversion-gen=false - // +optional - optional string serviceAccount = 9; - - // AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. - // +optional - optional bool automountServiceAccountToken = 21; - - // NodeName is a request to schedule this pod onto a specific node. If it is non-empty, - // the scheduler simply schedules this pod onto that node, assuming that it fits resource - // requirements. - // +optional - optional string nodeName = 10; - - // Host networking requested for this pod. Use the host's network namespace. - // If this option is set, the ports that will be used must be specified. - // Default to false. - // +k8s:conversion-gen=false - // +optional - optional bool hostNetwork = 11; - - // Use the host's pid namespace. - // Optional: Default to false. - // +k8s:conversion-gen=false - // +optional - optional bool hostPID = 12; - - // Use the host's ipc namespace. - // Optional: Default to false. - // +k8s:conversion-gen=false - // +optional - optional bool hostIPC = 13; - - // Share a single process namespace between all of the containers in a pod. - // When this is set containers will be able to view and signal processes from other containers - // in the same pod, and the first process in each container will not be assigned PID 1. - // HostPID and ShareProcessNamespace cannot both be set. - // Optional: Default to false. - // +k8s:conversion-gen=false - // +optional - optional bool shareProcessNamespace = 27; - - // SecurityContext holds pod-level security attributes and common container settings. - // Optional: Defaults to empty. See type description for default values of each field. - // +optional - optional PodSecurityContext securityContext = 14; - - // ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. - // If specified, these secrets will be passed to individual puller implementations for them to use. For example, - // in the case of docker, only DockerConfig type secrets are honored. - // More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod - // +optional - // +patchMergeKey=name - // +patchStrategy=merge - repeated LocalObjectReference imagePullSecrets = 15; - - // Specifies the hostname of the Pod - // If not specified, the pod's hostname will be set to a system-defined value. - // +optional - optional string hostname = 16; - - // If specified, the fully qualified Pod hostname will be "...svc.". - // If not specified, the pod will not have a domainname at all. - // +optional - optional string subdomain = 17; - - // If specified, the pod's scheduling constraints - // +optional - optional Affinity affinity = 18; - - // If specified, the pod will be dispatched by specified scheduler. - // If not specified, the pod will be dispatched by default scheduler. - // +optional - optional string schedulerName = 19; - - // If specified, the pod's tolerations. - // +optional - repeated Toleration tolerations = 22; - - // HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts - // file if specified. This is only valid for non-hostNetwork pods. - // +optional - // +patchMergeKey=ip - // +patchStrategy=merge - repeated HostAlias hostAliases = 23; - - // If specified, indicates the pod's priority. "system-node-critical" and - // "system-cluster-critical" are two special keywords which indicate the - // highest priorities with the former being the highest priority. Any other - // name must be defined by creating a PriorityClass object with that name. - // If not specified, the pod priority will be default or zero if there is no - // default. - // +optional - optional string priorityClassName = 24; - - // The priority value. Various system components use this field to find the - // priority of the pod. When Priority Admission Controller is enabled, it - // prevents users from setting this field. The admission controller populates - // this field from PriorityClassName. - // The higher the value, the higher the priority. - // +optional - optional int32 priority = 25; - - // Specifies the DNS parameters of a pod. - // Parameters specified here will be merged to the generated DNS - // configuration based on DNSPolicy. - // +optional - optional PodDNSConfig dnsConfig = 26; - - // If specified, all readiness gates will be evaluated for pod readiness. - // A pod is ready when all its containers are ready AND - // all conditions specified in the readiness gates have status equal to "True" - // More info: https://git.k8s.io/enhancements/keps/sig-network/0007-pod-ready%2B%2B.md - // +optional - repeated PodReadinessGate readinessGates = 28; - - // RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used - // to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. - // If unset or empty, the "legacy" RuntimeClass will be used, which is an implicit class with an - // empty definition that uses the default runtime handler. - // More info: https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md - // This is a beta feature as of Kubernetes v1.14. - // +optional - optional string runtimeClassName = 29; - - // EnableServiceLinks indicates whether information about services should be injected into pod's - // environment variables, matching the syntax of Docker links. - // Optional: Defaults to true. - // +optional - optional bool enableServiceLinks = 30; - - // PreemptionPolicy is the Policy for preempting pods with lower priority. - // One of Never, PreemptLowerPriority. - // Defaults to PreemptLowerPriority if unset. - // This field is alpha-level and is only honored by servers that enable the NonPreemptingPriority feature. - // +optional - optional string preemptionPolicy = 31; - - // Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. - // This field will be autopopulated at admission time by the RuntimeClass admission controller. If - // the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. - // The RuntimeClass admission controller will reject Pod create requests which have the overhead already - // set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value - // defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. - // More info: https://git.k8s.io/enhancements/keps/sig-node/20190226-pod-overhead.md - // This field is alpha-level as of Kubernetes v1.16, and is only honored by servers that enable the PodOverhead feature. - // +optional - map overhead = 32; - - // TopologySpreadConstraints describes how a group of pods ought to spread across topology - // domains. Scheduler will schedule pods in a way which abides by the constraints. - // This field is alpha-level and is only honored by clusters that enables the EvenPodsSpread - // feature. - // All topologySpreadConstraints are ANDed. - // +optional - // +patchMergeKey=topologyKey - // +patchStrategy=merge - // +listType=map - // +listMapKey=topologyKey - // +listMapKey=whenUnsatisfiable - repeated TopologySpreadConstraint topologySpreadConstraints = 33; -} - -// PodStatus represents information about the status of a pod. Status may trail the actual -// state of a system, especially if the node that hosts the pod cannot contact the control -// plane. -message PodStatus { - // The phase of a Pod is a simple, high-level summary of where the Pod is in its lifecycle. - // The conditions array, the reason and message fields, and the individual container status - // arrays contain more detail about the pod's status. - // There are five possible phase values: - // - // Pending: The pod has been accepted by the Kubernetes system, but one or more of the - // container images has not been created. This includes time before being scheduled as - // well as time spent downloading images over the network, which could take a while. - // Running: The pod has been bound to a node, and all of the containers have been created. - // At least one container is still running, or is in the process of starting or restarting. - // Succeeded: All containers in the pod have terminated in success, and will not be restarted. - // Failed: All containers in the pod have terminated, and at least one container has - // terminated in failure. The container either exited with non-zero status or was terminated - // by the system. - // Unknown: For some reason the state of the pod could not be obtained, typically due to an - // error in communicating with the host of the pod. - // - // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-phase - // +optional - optional string phase = 1; - - // Current service state of pod. - // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions - // +optional - // +patchMergeKey=type - // +patchStrategy=merge - repeated PodCondition conditions = 2; - - // A human readable message indicating details about why the pod is in this condition. - // +optional - optional string message = 3; - - // A brief CamelCase message indicating details about why the pod is in this state. - // e.g. 'Evicted' - // +optional - optional string reason = 4; - - // nominatedNodeName is set only when this pod preempts other pods on the node, but it cannot be - // scheduled right away as preemption victims receive their graceful termination periods. - // This field does not guarantee that the pod will be scheduled on this node. Scheduler may decide - // to place the pod elsewhere if other nodes become available sooner. Scheduler may also decide to - // give the resources on this node to a higher priority pod that is created after preemption. - // As a result, this field may be different than PodSpec.nodeName when the pod is - // scheduled. - // +optional - optional string nominatedNodeName = 11; - - // IP address of the host to which the pod is assigned. Empty if not yet scheduled. - // +optional - optional string hostIP = 5; - - // IP address allocated to the pod. Routable at least within the cluster. - // Empty if not yet allocated. - // +optional - optional string podIP = 6; - - // podIPs holds the IP addresses allocated to the pod. If this field is specified, the 0th entry must - // match the podIP field. Pods may be allocated at most 1 value for each of IPv4 and IPv6. This list - // is empty if no IPs have been allocated yet. - // +optional - // +patchStrategy=merge - // +patchMergeKey=ip - repeated PodIP podIPs = 12; - - // RFC 3339 date and time at which the object was acknowledged by the Kubelet. - // This is before the Kubelet pulled the container image(s) for the pod. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time startTime = 7; - - // The list has one entry per init container in the manifest. The most recent successful - // init container will have ready = true, the most recently started container will have - // startTime set. - // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status - repeated ContainerStatus initContainerStatuses = 10; - - // The list has one entry per container in the manifest. Each entry is currently the output - // of `docker inspect`. - // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status - // +optional - repeated ContainerStatus containerStatuses = 8; - - // The Quality of Service (QOS) classification assigned to the pod based on resource requirements - // See PodQOSClass type for available QOS classes - // More info: https://git.k8s.io/community/contributors/design-proposals/node/resource-qos.md - // +optional - optional string qosClass = 9; - - // Status for any ephemeral containers that have run in this pod. - // This field is alpha-level and is only populated by servers that enable the EphemeralContainers feature. - // +optional - repeated ContainerStatus ephemeralContainerStatuses = 13; -} - -// PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded -message PodStatusResult { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Most recently observed status of the pod. - // This data may not be up to date. - // Populated by the system. - // Read-only. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional PodStatus status = 2; -} - -// PodTemplate describes a template for creating copies of a predefined pod. -message PodTemplate { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Template defines the pods that will be created from this pod template. - // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional PodTemplateSpec template = 2; -} - -// PodTemplateList is a list of PodTemplates. -message PodTemplateList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // List of pod templates - repeated PodTemplate items = 2; -} - -// PodTemplateSpec describes the data a pod should have when created from a template -message PodTemplateSpec { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Specification of the desired behavior of the pod. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional PodSpec spec = 2; -} - -// PortworxVolumeSource represents a Portworx volume resource. -message PortworxVolumeSource { - // VolumeID uniquely identifies a Portworx volume - optional string volumeID = 1; - - // FSType represents the filesystem type to mount - // Must be a filesystem type supported by the host operating system. - // Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified. - optional string fsType = 2; - - // Defaults to false (read/write). ReadOnly here will force - // the ReadOnly setting in VolumeMounts. - // +optional - optional bool readOnly = 3; -} - -// Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out. -// +k8s:openapi-gen=false -message Preconditions { - // Specifies the target UID. - // +optional - optional string uid = 1; -} - -// Describes a class of pods that should avoid this node. -message PreferAvoidPodsEntry { - // The class of pods. - optional PodSignature podSignature = 1; - - // Time at which this entry was added to the list. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time evictionTime = 2; - - // (brief) reason why this entry was added to the list. - // +optional - optional string reason = 3; - - // Human readable message indicating why this entry was added to the list. - // +optional - optional string message = 4; -} - -// An empty preferred scheduling term matches all objects with implicit weight 0 -// (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op). -message PreferredSchedulingTerm { - // Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100. - optional int32 weight = 1; - - // A node selector term, associated with the corresponding weight. - optional NodeSelectorTerm preference = 2; -} - -// Probe describes a health check to be performed against a container to determine whether it is -// alive or ready to receive traffic. -message Probe { - // The action taken to determine the health of a container - optional Handler handler = 1; - - // Number of seconds after the container has started before liveness probes are initiated. - // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes - // +optional - optional int32 initialDelaySeconds = 2; - - // Number of seconds after which the probe times out. - // Defaults to 1 second. Minimum value is 1. - // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes - // +optional - optional int32 timeoutSeconds = 3; - - // How often (in seconds) to perform the probe. - // Default to 10 seconds. Minimum value is 1. - // +optional - optional int32 periodSeconds = 4; - - // Minimum consecutive successes for the probe to be considered successful after having failed. - // Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - // +optional - optional int32 successThreshold = 5; - - // Minimum consecutive failures for the probe to be considered failed after having succeeded. - // Defaults to 3. Minimum value is 1. - // +optional - optional int32 failureThreshold = 6; -} - -// Represents a projected volume source -message ProjectedVolumeSource { - // list of volume projections - repeated VolumeProjection sources = 1; - - // Mode bits to use on created files by default. Must be a value between - // 0 and 0777. - // Directories within the path are not affected by this setting. - // This might be in conflict with other options that affect the file - // mode, like fsGroup, and the result can be other mode bits set. - // +optional - optional int32 defaultMode = 2; -} - -// Represents a Quobyte mount that lasts the lifetime of a pod. -// Quobyte volumes do not support ownership management or SELinux relabeling. -message QuobyteVolumeSource { - // Registry represents a single or multiple Quobyte Registry services - // specified as a string as host:port pair (multiple entries are separated with commas) - // which acts as the central registry for volumes - optional string registry = 1; - - // Volume is a string that references an already created Quobyte volume by name. - optional string volume = 2; - - // ReadOnly here will force the Quobyte volume to be mounted with read-only permissions. - // Defaults to false. - // +optional - optional bool readOnly = 3; - - // User to map volume access to - // Defaults to serivceaccount user - // +optional - optional string user = 4; - - // Group to map volume access to - // Default is no group - // +optional - optional string group = 5; - - // Tenant owning the given Quobyte volume in the Backend - // Used with dynamically provisioned Quobyte volumes, value is set by the plugin - // +optional - optional string tenant = 6; -} - -// Represents a Rados Block Device mount that lasts the lifetime of a pod. -// RBD volumes support ownership management and SELinux relabeling. -message RBDPersistentVolumeSource { - // A collection of Ceph monitors. - // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - repeated string monitors = 1; - - // The rados image name. - // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - optional string image = 2; - - // Filesystem type of the volume that you want to mount. - // Tip: Ensure that the filesystem type is supported by the host operating system. - // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - // More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd - // TODO: how do we prevent errors in the filesystem from compromising the machine - // +optional - optional string fsType = 3; - - // The rados pool name. - // Default is rbd. - // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - // +optional - optional string pool = 4; - - // The rados user name. - // Default is admin. - // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - // +optional - optional string user = 5; - - // Keyring is the path to key ring for RBDUser. - // Default is /etc/ceph/keyring. - // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - // +optional - optional string keyring = 6; - - // SecretRef is name of the authentication secret for RBDUser. If provided - // overrides keyring. - // Default is nil. - // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - // +optional - optional SecretReference secretRef = 7; - - // ReadOnly here will force the ReadOnly setting in VolumeMounts. - // Defaults to false. - // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - // +optional - optional bool readOnly = 8; -} - -// Represents a Rados Block Device mount that lasts the lifetime of a pod. -// RBD volumes support ownership management and SELinux relabeling. -message RBDVolumeSource { - // A collection of Ceph monitors. - // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - repeated string monitors = 1; - - // The rados image name. - // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - optional string image = 2; - - // Filesystem type of the volume that you want to mount. - // Tip: Ensure that the filesystem type is supported by the host operating system. - // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - // More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd - // TODO: how do we prevent errors in the filesystem from compromising the machine - // +optional - optional string fsType = 3; - - // The rados pool name. - // Default is rbd. - // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - // +optional - optional string pool = 4; - - // The rados user name. - // Default is admin. - // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - // +optional - optional string user = 5; - - // Keyring is the path to key ring for RBDUser. - // Default is /etc/ceph/keyring. - // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - // +optional - optional string keyring = 6; - - // SecretRef is name of the authentication secret for RBDUser. If provided - // overrides keyring. - // Default is nil. - // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - // +optional - optional LocalObjectReference secretRef = 7; - - // ReadOnly here will force the ReadOnly setting in VolumeMounts. - // Defaults to false. - // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it - // +optional - optional bool readOnly = 8; -} - -// RangeAllocation is not a public type. -message RangeAllocation { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Range is string that identifies the range represented by 'data'. - optional string range = 2; - - // Data is a bit array containing all allocated addresses in the previous segment. - optional bytes data = 3; -} - -// ReplicationController represents the configuration of a replication controller. -message ReplicationController { - // If the Labels of a ReplicationController are empty, they are defaulted to - // be the same as the Pod(s) that the replication controller manages. - // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec defines the specification of the desired behavior of the replication controller. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional ReplicationControllerSpec spec = 2; - - // Status is the most recently observed status of the replication controller. - // This data may be out of date by some window of time. - // Populated by the system. - // Read-only. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional ReplicationControllerStatus status = 3; -} - -// ReplicationControllerCondition describes the state of a replication controller at a certain point. -message ReplicationControllerCondition { - // Type of replication controller condition. - optional string type = 1; - - // Status of the condition, one of True, False, Unknown. - optional string status = 2; - - // The last time the condition transitioned from one status to another. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; - - // The reason for the condition's last transition. - // +optional - optional string reason = 4; - - // A human readable message indicating details about the transition. - // +optional - optional string message = 5; -} - -// ReplicationControllerList is a collection of replication controllers. -message ReplicationControllerList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // List of replication controllers. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller - repeated ReplicationController items = 2; -} - -// ReplicationControllerSpec is the specification of a replication controller. -message ReplicationControllerSpec { - // Replicas is the number of desired replicas. - // This is a pointer to distinguish between explicit zero and unspecified. - // Defaults to 1. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller - // +optional - optional int32 replicas = 1; - - // Minimum number of seconds for which a newly created pod should be ready - // without any of its container crashing, for it to be considered available. - // Defaults to 0 (pod will be considered available as soon as it is ready) - // +optional - optional int32 minReadySeconds = 4; - - // Selector is a label query over pods that should match the Replicas count. - // If Selector is empty, it is defaulted to the labels present on the Pod template. - // Label keys and values that must match in order to be controlled by this replication - // controller, if empty defaulted to labels on Pod template. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - // +optional - map selector = 2; - - // Template is the object that describes the pod that will be created if - // insufficient replicas are detected. This takes precedence over a TemplateRef. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template - // +optional - optional PodTemplateSpec template = 3; -} - -// ReplicationControllerStatus represents the current status of a replication -// controller. -message ReplicationControllerStatus { - // Replicas is the most recently oberved number of replicas. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller - optional int32 replicas = 1; - - // The number of pods that have labels matching the labels of the pod template of the replication controller. - // +optional - optional int32 fullyLabeledReplicas = 2; - - // The number of ready replicas for this replication controller. - // +optional - optional int32 readyReplicas = 4; - - // The number of available replicas (ready for at least minReadySeconds) for this replication controller. - // +optional - optional int32 availableReplicas = 5; - - // ObservedGeneration reflects the generation of the most recently observed replication controller. - // +optional - optional int64 observedGeneration = 3; - - // Represents the latest available observations of a replication controller's current state. - // +optional - // +patchMergeKey=type - // +patchStrategy=merge - repeated ReplicationControllerCondition conditions = 6; -} - -// ResourceFieldSelector represents container resources (cpu, memory) and their output format -message ResourceFieldSelector { - // Container name: required for volumes, optional for env vars - // +optional - optional string containerName = 1; - - // Required: resource to select - optional string resource = 2; - - // Specifies the output format of the exposed resources, defaults to "1" - // +optional - optional k8s.io.apimachinery.pkg.api.resource.Quantity divisor = 3; -} - -// ResourceQuota sets aggregate quota restrictions enforced per namespace -message ResourceQuota { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec defines the desired quota. - // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional ResourceQuotaSpec spec = 2; - - // Status defines the actual enforced quota and its current usage. - // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional ResourceQuotaStatus status = 3; -} - -// ResourceQuotaList is a list of ResourceQuota items. -message ResourceQuotaList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is a list of ResourceQuota objects. - // More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/ - repeated ResourceQuota items = 2; -} - -// ResourceQuotaSpec defines the desired hard limits to enforce for Quota. -message ResourceQuotaSpec { - // hard is the set of desired hard limits for each named resource. - // More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/ - // +optional - map hard = 1; - - // A collection of filters that must match each object tracked by a quota. - // If not specified, the quota matches all objects. - // +optional - repeated string scopes = 2; - - // scopeSelector is also a collection of filters like scopes that must match each object tracked by a quota - // but expressed using ScopeSelectorOperator in combination with possible values. - // For a resource to match, both scopes AND scopeSelector (if specified in spec), must be matched. - // +optional - optional ScopeSelector scopeSelector = 3; -} - -// ResourceQuotaStatus defines the enforced hard limits and observed use. -message ResourceQuotaStatus { - // Hard is the set of enforced hard limits for each named resource. - // More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/ - // +optional - map hard = 1; - - // Used is the current observed total usage of the resource in the namespace. - // +optional - map used = 2; -} - -// ResourceRequirements describes the compute resource requirements. -message ResourceRequirements { - // Limits describes the maximum amount of compute resources allowed. - // More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ - // +optional - map limits = 1; - - // Requests describes the minimum amount of compute resources required. - // If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, - // otherwise to an implementation-defined value. - // More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ - // +optional - map requests = 2; -} - -// SELinuxOptions are the labels to be applied to the container -message SELinuxOptions { - // User is a SELinux user label that applies to the container. - // +optional - optional string user = 1; - - // Role is a SELinux role label that applies to the container. - // +optional - optional string role = 2; - - // Type is a SELinux type label that applies to the container. - // +optional - optional string type = 3; - - // Level is SELinux level label that applies to the container. - // +optional - optional string level = 4; -} - -// ScaleIOPersistentVolumeSource represents a persistent ScaleIO volume -message ScaleIOPersistentVolumeSource { - // The host address of the ScaleIO API Gateway. - optional string gateway = 1; - - // The name of the storage system as configured in ScaleIO. - optional string system = 2; - - // SecretRef references to the secret for ScaleIO user and other - // sensitive information. If this is not provided, Login operation will fail. - optional SecretReference secretRef = 3; - - // Flag to enable/disable SSL communication with Gateway, default false - // +optional - optional bool sslEnabled = 4; - - // The name of the ScaleIO Protection Domain for the configured storage. - // +optional - optional string protectionDomain = 5; - - // The ScaleIO Storage Pool associated with the protection domain. - // +optional - optional string storagePool = 6; - - // Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. - // Default is ThinProvisioned. - // +optional - optional string storageMode = 7; - - // The name of a volume already created in the ScaleIO system - // that is associated with this volume source. - optional string volumeName = 8; - - // Filesystem type to mount. - // Must be a filesystem type supported by the host operating system. - // Ex. "ext4", "xfs", "ntfs". - // Default is "xfs" - // +optional - optional string fsType = 9; - - // Defaults to false (read/write). ReadOnly here will force - // the ReadOnly setting in VolumeMounts. - // +optional - optional bool readOnly = 10; -} - -// ScaleIOVolumeSource represents a persistent ScaleIO volume -message ScaleIOVolumeSource { - // The host address of the ScaleIO API Gateway. - optional string gateway = 1; - - // The name of the storage system as configured in ScaleIO. - optional string system = 2; - - // SecretRef references to the secret for ScaleIO user and other - // sensitive information. If this is not provided, Login operation will fail. - optional LocalObjectReference secretRef = 3; - - // Flag to enable/disable SSL communication with Gateway, default false - // +optional - optional bool sslEnabled = 4; - - // The name of the ScaleIO Protection Domain for the configured storage. - // +optional - optional string protectionDomain = 5; - - // The ScaleIO Storage Pool associated with the protection domain. - // +optional - optional string storagePool = 6; - - // Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. - // Default is ThinProvisioned. - // +optional - optional string storageMode = 7; - - // The name of a volume already created in the ScaleIO system - // that is associated with this volume source. - optional string volumeName = 8; - - // Filesystem type to mount. - // Must be a filesystem type supported by the host operating system. - // Ex. "ext4", "xfs", "ntfs". - // Default is "xfs". - // +optional - optional string fsType = 9; - - // Defaults to false (read/write). ReadOnly here will force - // the ReadOnly setting in VolumeMounts. - // +optional - optional bool readOnly = 10; -} - -// A scope selector represents the AND of the selectors represented -// by the scoped-resource selector requirements. -message ScopeSelector { - // A list of scope selector requirements by scope of the resources. - // +optional - repeated ScopedResourceSelectorRequirement matchExpressions = 1; -} - -// A scoped-resource selector requirement is a selector that contains values, a scope name, and an operator -// that relates the scope name and values. -message ScopedResourceSelectorRequirement { - // The name of the scope that the selector applies to. - optional string scopeName = 1; - - // Represents a scope's relationship to a set of values. - // Valid operators are In, NotIn, Exists, DoesNotExist. - optional string operator = 2; - - // An array of string values. If the operator is In or NotIn, - // the values array must be non-empty. If the operator is Exists or DoesNotExist, - // the values array must be empty. - // This array is replaced during a strategic merge patch. - // +optional - repeated string values = 3; -} - -// Secret holds secret data of a certain type. The total bytes of the values in -// the Data field must be less than MaxSecretSize bytes. -message Secret { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Data contains the secret data. Each key must consist of alphanumeric - // characters, '-', '_' or '.'. The serialized form of the secret data is a - // base64 encoded string, representing the arbitrary (possibly non-string) - // data value here. Described in https://tools.ietf.org/html/rfc4648#section-4 - // +optional - map data = 2; - - // stringData allows specifying non-binary secret data in string form. - // It is provided as a write-only convenience method. - // All keys and values are merged into the data field on write, overwriting any existing values. - // It is never output when reading from the API. - // +k8s:conversion-gen=false - // +optional - map stringData = 4; - - // Used to facilitate programmatic handling of secret data. - // +optional - optional string type = 3; -} - -// SecretEnvSource selects a Secret to populate the environment -// variables with. -// -// The contents of the target Secret's Data field will represent the -// key-value pairs as environment variables. -message SecretEnvSource { - // The Secret to select from. - optional LocalObjectReference localObjectReference = 1; - - // Specify whether the Secret must be defined - // +optional - optional bool optional = 2; -} - -// SecretKeySelector selects a key of a Secret. -message SecretKeySelector { - // The name of the secret in the pod's namespace to select from. - optional LocalObjectReference localObjectReference = 1; - - // The key of the secret to select from. Must be a valid secret key. - optional string key = 2; - - // Specify whether the Secret or its key must be defined - // +optional - optional bool optional = 3; -} - -// SecretList is a list of Secret. -message SecretList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is a list of secret objects. - // More info: https://kubernetes.io/docs/concepts/configuration/secret - repeated Secret items = 2; -} - -// Adapts a secret into a projected volume. -// -// The contents of the target Secret's Data field will be presented in a -// projected volume as files using the keys in the Data field as the file names. -// Note that this is identical to a secret volume source without the default -// mode. -message SecretProjection { - optional LocalObjectReference localObjectReference = 1; - - // If unspecified, each key-value pair in the Data field of the referenced - // Secret will be projected into the volume as a file whose name is the - // key and content is the value. If specified, the listed keys will be - // projected into the specified paths, and unlisted keys will not be - // present. If a key is specified which is not present in the Secret, - // the volume setup will error unless it is marked optional. Paths must be - // relative and may not contain the '..' path or start with '..'. - // +optional - repeated KeyToPath items = 2; - - // Specify whether the Secret or its key must be defined - // +optional - optional bool optional = 4; -} - -// SecretReference represents a Secret Reference. It has enough information to retrieve secret -// in any namespace -message SecretReference { - // Name is unique within a namespace to reference a secret resource. - // +optional - optional string name = 1; - - // Namespace defines the space within which the secret name must be unique. - // +optional - optional string namespace = 2; -} - -// Adapts a Secret into a volume. -// -// The contents of the target Secret's Data field will be presented in a volume -// as files using the keys in the Data field as the file names. -// Secret volumes support ownership management and SELinux relabeling. -message SecretVolumeSource { - // Name of the secret in the pod's namespace to use. - // More info: https://kubernetes.io/docs/concepts/storage/volumes#secret - // +optional - optional string secretName = 1; - - // If unspecified, each key-value pair in the Data field of the referenced - // Secret will be projected into the volume as a file whose name is the - // key and content is the value. If specified, the listed keys will be - // projected into the specified paths, and unlisted keys will not be - // present. If a key is specified which is not present in the Secret, - // the volume setup will error unless it is marked optional. Paths must be - // relative and may not contain the '..' path or start with '..'. - // +optional - repeated KeyToPath items = 2; - - // Optional: mode bits to use on created files by default. Must be a - // value between 0 and 0777. Defaults to 0644. - // Directories within the path are not affected by this setting. - // This might be in conflict with other options that affect the file - // mode, like fsGroup, and the result can be other mode bits set. - // +optional - optional int32 defaultMode = 3; - - // Specify whether the Secret or its keys must be defined - // +optional - optional bool optional = 4; -} - -// SecurityContext holds security configuration that will be applied to a container. -// Some fields are present in both SecurityContext and PodSecurityContext. When both -// are set, the values in SecurityContext take precedence. -message SecurityContext { - // The capabilities to add/drop when running containers. - // Defaults to the default set of capabilities granted by the container runtime. - // +optional - optional Capabilities capabilities = 1; - - // Run container in privileged mode. - // Processes in privileged containers are essentially equivalent to root on the host. - // Defaults to false. - // +optional - optional bool privileged = 2; - - // The SELinux context to be applied to the container. - // If unspecified, the container runtime will allocate a random SELinux context for each - // container. May also be set in PodSecurityContext. If set in both SecurityContext and - // PodSecurityContext, the value specified in SecurityContext takes precedence. - // +optional - optional SELinuxOptions seLinuxOptions = 3; - - // The Windows specific settings applied to all containers. - // If unspecified, the options from the PodSecurityContext will be used. - // If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - // +optional - optional WindowsSecurityContextOptions windowsOptions = 10; - - // The UID to run the entrypoint of the container process. - // Defaults to user specified in image metadata if unspecified. - // May also be set in PodSecurityContext. If set in both SecurityContext and - // PodSecurityContext, the value specified in SecurityContext takes precedence. - // +optional - optional int64 runAsUser = 4; - - // The GID to run the entrypoint of the container process. - // Uses runtime default if unset. - // May also be set in PodSecurityContext. If set in both SecurityContext and - // PodSecurityContext, the value specified in SecurityContext takes precedence. - // +optional - optional int64 runAsGroup = 8; - - // Indicates that the container must run as a non-root user. - // If true, the Kubelet will validate the image at runtime to ensure that it - // does not run as UID 0 (root) and fail to start the container if it does. - // If unset or false, no such validation will be performed. - // May also be set in PodSecurityContext. If set in both SecurityContext and - // PodSecurityContext, the value specified in SecurityContext takes precedence. - // +optional - optional bool runAsNonRoot = 5; - - // Whether this container has a read-only root filesystem. - // Default is false. - // +optional - optional bool readOnlyRootFilesystem = 6; - - // AllowPrivilegeEscalation controls whether a process can gain more - // privileges than its parent process. This bool directly controls if - // the no_new_privs flag will be set on the container process. - // AllowPrivilegeEscalation is true always when the container is: - // 1) run as Privileged - // 2) has CAP_SYS_ADMIN - // +optional - optional bool allowPrivilegeEscalation = 7; - - // procMount denotes the type of proc mount to use for the containers. - // The default is DefaultProcMount which uses the container runtime defaults for - // readonly paths and masked paths. - // This requires the ProcMountType feature flag to be enabled. - // +optional - optional string procMount = 9; -} - -// SerializedReference is a reference to serialized object. -message SerializedReference { - // The reference to an object in the system. - // +optional - optional ObjectReference reference = 1; -} - -// Service is a named abstraction of software service (for example, mysql) consisting of local port -// (for example 3306) that the proxy listens on, and the selector that determines which pods -// will answer requests sent through the proxy. -message Service { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec defines the behavior of a service. - // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional ServiceSpec spec = 2; - - // Most recently observed status of the service. - // Populated by the system. - // Read-only. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional ServiceStatus status = 3; -} - -// ServiceAccount binds together: -// * a name, understood by users, and perhaps by peripheral systems, for an identity -// * a principal that can be authenticated and authorized -// * a set of secrets -message ServiceAccount { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Secrets is the list of secrets allowed to be used by pods running using this ServiceAccount. - // More info: https://kubernetes.io/docs/concepts/configuration/secret - // +optional - // +patchMergeKey=name - // +patchStrategy=merge - repeated ObjectReference secrets = 2; - - // ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images - // in pods that reference this ServiceAccount. ImagePullSecrets are distinct from Secrets because Secrets - // can be mounted in the pod, but ImagePullSecrets are only accessed by the kubelet. - // More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod - // +optional - repeated LocalObjectReference imagePullSecrets = 3; - - // AutomountServiceAccountToken indicates whether pods running as this service account should have an API token automatically mounted. - // Can be overridden at the pod level. - // +optional - optional bool automountServiceAccountToken = 4; -} - -// ServiceAccountList is a list of ServiceAccount objects -message ServiceAccountList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // List of ServiceAccounts. - // More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ - repeated ServiceAccount items = 2; -} - -// ServiceAccountTokenProjection represents a projected service account token -// volume. This projection can be used to insert a service account token into -// the pods runtime filesystem for use against APIs (Kubernetes API Server or -// otherwise). -message ServiceAccountTokenProjection { - // Audience is the intended audience of the token. A recipient of a token - // must identify itself with an identifier specified in the audience of the - // token, and otherwise should reject the token. The audience defaults to the - // identifier of the apiserver. - // +optional - optional string audience = 1; - - // ExpirationSeconds is the requested duration of validity of the service - // account token. As the token approaches expiration, the kubelet volume - // plugin will proactively rotate the service account token. The kubelet will - // start trying to rotate the token if the token is older than 80 percent of - // its time to live or if the token is older than 24 hours.Defaults to 1 hour - // and must be at least 10 minutes. - // +optional - optional int64 expirationSeconds = 2; - - // Path is the path relative to the mount point of the file to project the - // token into. - optional string path = 3; -} - -// ServiceList holds a list of services. -message ServiceList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // List of services - repeated Service items = 2; -} - -// ServicePort contains information on service's port. -message ServicePort { - // The name of this port within the service. This must be a DNS_LABEL. - // All ports within a ServiceSpec must have unique names. When considering - // the endpoints for a Service, this must match the 'name' field in the - // EndpointPort. - // Optional if only one ServicePort is defined on this service. - // +optional - optional string name = 1; - - // The IP protocol for this port. Supports "TCP", "UDP", and "SCTP". - // Default is TCP. - // +optional - optional string protocol = 2; - - // The port that will be exposed by this service. - optional int32 port = 3; - - // Number or name of the port to access on the pods targeted by the service. - // Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - // If this is a string, it will be looked up as a named port in the - // target Pod's container ports. If this is not specified, the value - // of the 'port' field is used (an identity map). - // This field is ignored for services with clusterIP=None, and should be - // omitted or set equal to the 'port' field. - // More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service - // +optional - optional k8s.io.apimachinery.pkg.util.intstr.IntOrString targetPort = 4; - - // The port on each node on which this service is exposed when type=NodePort or LoadBalancer. - // Usually assigned by the system. If specified, it will be allocated to the service - // if unused or else creation of the service will fail. - // Default is to auto-allocate a port if the ServiceType of this Service requires one. - // More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport - // +optional - optional int32 nodePort = 5; -} - -// ServiceProxyOptions is the query options to a Service's proxy call. -message ServiceProxyOptions { - // Path is the part of URLs that include service endpoints, suffixes, - // and parameters to use for the current proxy request to service. - // For example, the whole request URL is - // http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. - // Path is _search?q=user:kimchy. - // +optional - optional string path = 1; -} - -// ServiceSpec describes the attributes that a user creates on a service. -message ServiceSpec { - // The list of ports that are exposed by this service. - // More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies - // +patchMergeKey=port - // +patchStrategy=merge - // +listType=map - // +listMapKey=port - // +listMapKey=protocol - repeated ServicePort ports = 1; - - // Route service traffic to pods with label keys and values matching this - // selector. If empty or not present, the service is assumed to have an - // external process managing its endpoints, which Kubernetes will not - // modify. Only applies to types ClusterIP, NodePort, and LoadBalancer. - // Ignored if type is ExternalName. - // More info: https://kubernetes.io/docs/concepts/services-networking/service/ - // +optional - map selector = 2; - - // clusterIP is the IP address of the service and is usually assigned - // randomly by the master. If an address is specified manually and is not in - // use by others, it will be allocated to the service; otherwise, creation - // of the service will fail. This field can not be changed through updates. - // Valid values are "None", empty string (""), or a valid IP address. "None" - // can be specified for headless services when proxying is not required. - // Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if - // type is ExternalName. - // More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies - // +optional - optional string clusterIP = 3; - - // type determines how the Service is exposed. Defaults to ClusterIP. Valid - // options are ExternalName, ClusterIP, NodePort, and LoadBalancer. - // "ExternalName" maps to the specified externalName. - // "ClusterIP" allocates a cluster-internal IP address for load-balancing to - // endpoints. Endpoints are determined by the selector or if that is not - // specified, by manual construction of an Endpoints object. If clusterIP is - // "None", no virtual IP is allocated and the endpoints are published as a - // set of endpoints rather than a stable IP. - // "NodePort" builds on ClusterIP and allocates a port on every node which - // routes to the clusterIP. - // "LoadBalancer" builds on NodePort and creates an - // external load-balancer (if supported in the current cloud) which routes - // to the clusterIP. - // More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types - // +optional - optional string type = 4; - - // externalIPs is a list of IP addresses for which nodes in the cluster - // will also accept traffic for this service. These IPs are not managed by - // Kubernetes. The user is responsible for ensuring that traffic arrives - // at a node with this IP. A common example is external load-balancers - // that are not part of the Kubernetes system. - // +optional - repeated string externalIPs = 5; - - // Supports "ClientIP" and "None". Used to maintain session affinity. - // Enable client IP based session affinity. - // Must be ClientIP or None. - // Defaults to None. - // More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies - // +optional - optional string sessionAffinity = 7; - - // Only applies to Service Type: LoadBalancer - // LoadBalancer will get created with the IP specified in this field. - // This feature depends on whether the underlying cloud-provider supports specifying - // the loadBalancerIP when a load balancer is created. - // This field will be ignored if the cloud-provider does not support the feature. - // +optional - optional string loadBalancerIP = 8; - - // If specified and supported by the platform, this will restrict traffic through the cloud-provider - // load-balancer will be restricted to the specified client IPs. This field will be ignored if the - // cloud-provider does not support the feature." - // More info: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/ - // +optional - repeated string loadBalancerSourceRanges = 9; - - // externalName is the external reference that kubedns or equivalent will - // return as a CNAME record for this service. No proxying will be involved. - // Must be a valid RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) - // and requires Type to be ExternalName. - // +optional - optional string externalName = 10; - - // externalTrafficPolicy denotes if this Service desires to route external - // traffic to node-local or cluster-wide endpoints. "Local" preserves the - // client source IP and avoids a second hop for LoadBalancer and Nodeport - // type services, but risks potentially imbalanced traffic spreading. - // "Cluster" obscures the client source IP and may cause a second hop to - // another node, but should have good overall load-spreading. - // +optional - optional string externalTrafficPolicy = 11; - - // healthCheckNodePort specifies the healthcheck nodePort for the service. - // If not specified, HealthCheckNodePort is created by the service api - // backend with the allocated nodePort. Will use user-specified nodePort value - // if specified by the client. Only effects when Type is set to LoadBalancer - // and ExternalTrafficPolicy is set to Local. - // +optional - optional int32 healthCheckNodePort = 12; - - // publishNotReadyAddresses, when set to true, indicates that DNS implementations - // must publish the notReadyAddresses of subsets for the Endpoints associated with - // the Service. The default value is false. - // The primary use case for setting this field is to use a StatefulSet's Headless Service - // to propagate SRV records for its Pods without respect to their readiness for purpose - // of peer discovery. - // +optional - optional bool publishNotReadyAddresses = 13; - - // sessionAffinityConfig contains the configurations of session affinity. - // +optional - optional SessionAffinityConfig sessionAffinityConfig = 14; - - // ipFamily specifies whether this Service has a preference for a particular IP family (e.g. IPv4 vs. - // IPv6). If a specific IP family is requested, the clusterIP field will be allocated from that family, if it is - // available in the cluster. If no IP family is requested, the cluster's primary IP family will be used. - // Other IP fields (loadBalancerIP, loadBalancerSourceRanges, externalIPs) and controllers which - // allocate external load-balancers should use the same IP family. Endpoints for this Service will be of - // this family. This field is immutable after creation. Assigning a ServiceIPFamily not available in the - // cluster (e.g. IPv6 in IPv4 only cluster) is an error condition and will fail during clusterIP assignment. - // +optional - optional string ipFamily = 15; - - // topologyKeys is a preference-order list of topology keys which - // implementations of services should use to preferentially sort endpoints - // when accessing this Service, it can not be used at the same time as - // externalTrafficPolicy=Local. - // Topology keys must be valid label keys and at most 16 keys may be specified. - // Endpoints are chosen based on the first topology key with available backends. - // If this field is specified and all entries have no backends that match - // the topology of the client, the service has no backends for that client - // and connections should fail. - // The special value "*" may be used to mean "any topology". This catch-all - // value, if used, only makes sense as the last value in the list. - // If this is not specified or empty, no topology constraints will be applied. - // +optional - repeated string topologyKeys = 16; -} - -// ServiceStatus represents the current status of a service. -message ServiceStatus { - // LoadBalancer contains the current status of the load-balancer, - // if one is present. - // +optional - optional LoadBalancerStatus loadBalancer = 1; -} - -// SessionAffinityConfig represents the configurations of session affinity. -message SessionAffinityConfig { - // clientIP contains the configurations of Client IP based session affinity. - // +optional - optional ClientIPConfig clientIP = 1; -} - -// Represents a StorageOS persistent volume resource. -message StorageOSPersistentVolumeSource { - // VolumeName is the human-readable name of the StorageOS volume. Volume - // names are only unique within a namespace. - optional string volumeName = 1; - - // VolumeNamespace specifies the scope of the volume within StorageOS. If no - // namespace is specified then the Pod's namespace will be used. This allows the - // Kubernetes name scoping to be mirrored within StorageOS for tighter integration. - // Set VolumeName to any name to override the default behaviour. - // Set to "default" if you are not using namespaces within StorageOS. - // Namespaces that do not pre-exist within StorageOS will be created. - // +optional - optional string volumeNamespace = 2; - - // Filesystem type to mount. - // Must be a filesystem type supported by the host operating system. - // Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - // +optional - optional string fsType = 3; - - // Defaults to false (read/write). ReadOnly here will force - // the ReadOnly setting in VolumeMounts. - // +optional - optional bool readOnly = 4; - - // SecretRef specifies the secret to use for obtaining the StorageOS API - // credentials. If not specified, default values will be attempted. - // +optional - optional ObjectReference secretRef = 5; -} - -// Represents a StorageOS persistent volume resource. -message StorageOSVolumeSource { - // VolumeName is the human-readable name of the StorageOS volume. Volume - // names are only unique within a namespace. - optional string volumeName = 1; - - // VolumeNamespace specifies the scope of the volume within StorageOS. If no - // namespace is specified then the Pod's namespace will be used. This allows the - // Kubernetes name scoping to be mirrored within StorageOS for tighter integration. - // Set VolumeName to any name to override the default behaviour. - // Set to "default" if you are not using namespaces within StorageOS. - // Namespaces that do not pre-exist within StorageOS will be created. - // +optional - optional string volumeNamespace = 2; - - // Filesystem type to mount. - // Must be a filesystem type supported by the host operating system. - // Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - // +optional - optional string fsType = 3; - - // Defaults to false (read/write). ReadOnly here will force - // the ReadOnly setting in VolumeMounts. - // +optional - optional bool readOnly = 4; - - // SecretRef specifies the secret to use for obtaining the StorageOS API - // credentials. If not specified, default values will be attempted. - // +optional - optional LocalObjectReference secretRef = 5; -} - -// Sysctl defines a kernel parameter to be set -message Sysctl { - // Name of a property to set - optional string name = 1; - - // Value of a property to set - optional string value = 2; -} - -// TCPSocketAction describes an action based on opening a socket -message TCPSocketAction { - // Number or name of the port to access on the container. - // Number must be in the range 1 to 65535. - // Name must be an IANA_SVC_NAME. - optional k8s.io.apimachinery.pkg.util.intstr.IntOrString port = 1; - - // Optional: Host name to connect to, defaults to the pod IP. - // +optional - optional string host = 2; -} - -// The node this Taint is attached to has the "effect" on -// any pod that does not tolerate the Taint. -message Taint { - // Required. The taint key to be applied to a node. - optional string key = 1; - - // Required. The taint value corresponding to the taint key. - // +optional - optional string value = 2; - - // Required. The effect of the taint on pods - // that do not tolerate the taint. - // Valid effects are NoSchedule, PreferNoSchedule and NoExecute. - optional string effect = 3; - - // TimeAdded represents the time at which the taint was added. - // It is only written for NoExecute taints. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time timeAdded = 4; -} - -// The pod this Toleration is attached to tolerates any taint that matches -// the triple using the matching operator . -message Toleration { - // Key is the taint key that the toleration applies to. Empty means match all taint keys. - // If the key is empty, operator must be Exists; this combination means to match all values and all keys. - // +optional - optional string key = 1; - - // Operator represents a key's relationship to the value. - // Valid operators are Exists and Equal. Defaults to Equal. - // Exists is equivalent to wildcard for value, so that a pod can - // tolerate all taints of a particular category. - // +optional - optional string operator = 2; - - // Value is the taint value the toleration matches to. - // If the operator is Exists, the value should be empty, otherwise just a regular string. - // +optional - optional string value = 3; - - // Effect indicates the taint effect to match. Empty means match all taint effects. - // When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. - // +optional - optional string effect = 4; - - // TolerationSeconds represents the period of time the toleration (which must be - // of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, - // it is not set, which means tolerate the taint forever (do not evict). Zero and - // negative values will be treated as 0 (evict immediately) by the system. - // +optional - optional int64 tolerationSeconds = 5; -} - -// A topology selector requirement is a selector that matches given label. -// This is an alpha feature and may change in the future. -message TopologySelectorLabelRequirement { - // The label key that the selector applies to. - optional string key = 1; - - // An array of string values. One value must match the label to be selected. - // Each entry in Values is ORed. - repeated string values = 2; -} - -// A topology selector term represents the result of label queries. -// A null or empty topology selector term matches no objects. -// The requirements of them are ANDed. -// It provides a subset of functionality as NodeSelectorTerm. -// This is an alpha feature and may change in the future. -message TopologySelectorTerm { - // A list of topology selector requirements by labels. - // +optional - repeated TopologySelectorLabelRequirement matchLabelExpressions = 1; -} - -// TopologySpreadConstraint specifies how to spread matching pods among the given topology. -message TopologySpreadConstraint { - // MaxSkew describes the degree to which pods may be unevenly distributed. - // It's the maximum permitted difference between the number of matching pods in - // any two topology domains of a given topology type. - // For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same - // labelSelector spread as 1/1/0: - // +-------+-------+-------+ - // | zone1 | zone2 | zone3 | - // +-------+-------+-------+ - // | P | P | | - // +-------+-------+-------+ - // - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 1/1/1; - // scheduling it onto zone1(zone2) would make the ActualSkew(2-0) on zone1(zone2) - // violate MaxSkew(1). - // - if MaxSkew is 2, incoming pod can be scheduled onto any zone. - // It's a required field. Default value is 1 and 0 is not allowed. - optional int32 maxSkew = 1; - - // TopologyKey is the key of node labels. Nodes that have a label with this key - // and identical values are considered to be in the same topology. - // We consider each as a "bucket", and try to put balanced number - // of pods into each bucket. - // It's a required field. - optional string topologyKey = 2; - - // WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy - // the spread constraint. - // - DoNotSchedule (default) tells the scheduler not to schedule it - // - ScheduleAnyway tells the scheduler to still schedule it - // It's considered as "Unsatisfiable" if and only if placing incoming pod on any - // topology violates "MaxSkew". - // For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same - // labelSelector spread as 3/1/1: - // +-------+-------+-------+ - // | zone1 | zone2 | zone3 | - // +-------+-------+-------+ - // | P P P | P | P | - // +-------+-------+-------+ - // If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled - // to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies - // MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler - // won't make it *more* imbalanced. - // It's a required field. - optional string whenUnsatisfiable = 3; - - // LabelSelector is used to find matching pods. - // Pods that match this label selector are counted to determine the number of pods - // in their corresponding topology domain. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector labelSelector = 4; -} - -// TypedLocalObjectReference contains enough information to let you locate the -// typed referenced object inside the same namespace. -message TypedLocalObjectReference { - // APIGroup is the group for the resource being referenced. - // If APIGroup is not specified, the specified Kind must be in the core API group. - // For any other third-party types, APIGroup is required. - // +optional - optional string apiGroup = 1; - - // Kind is the type of resource being referenced - optional string kind = 2; - - // Name is the name of resource being referenced - optional string name = 3; -} - -// Volume represents a named volume in a pod that may be accessed by any container in the pod. -message Volume { - // Volume's name. - // Must be a DNS_LABEL and unique within the pod. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - optional string name = 1; - - // VolumeSource represents the location and type of the mounted volume. - // If not specified, the Volume is implied to be an EmptyDir. - // This implied behavior is deprecated and will be removed in a future version. - optional VolumeSource volumeSource = 2; -} - -// volumeDevice describes a mapping of a raw block device within a container. -message VolumeDevice { - // name must match the name of a persistentVolumeClaim in the pod - optional string name = 1; - - // devicePath is the path inside of the container that the device will be mapped to. - optional string devicePath = 2; -} - -// VolumeMount describes a mounting of a Volume within a container. -message VolumeMount { - // This must match the Name of a Volume. - optional string name = 1; - - // Mounted read-only if true, read-write otherwise (false or unspecified). - // Defaults to false. - // +optional - optional bool readOnly = 2; - - // Path within the container at which the volume should be mounted. Must - // not contain ':'. - optional string mountPath = 3; - - // Path within the volume from which the container's volume should be mounted. - // Defaults to "" (volume's root). - // +optional - optional string subPath = 4; - - // mountPropagation determines how mounts are propagated from the host - // to container and the other way around. - // When not set, MountPropagationNone is used. - // This field is beta in 1.10. - // +optional - optional string mountPropagation = 5; - - // Expanded path within the volume from which the container's volume should be mounted. - // Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. - // Defaults to "" (volume's root). - // SubPathExpr and SubPath are mutually exclusive. - // +optional - optional string subPathExpr = 6; -} - -// VolumeNodeAffinity defines constraints that limit what nodes this volume can be accessed from. -message VolumeNodeAffinity { - // Required specifies hard node constraints that must be met. - optional NodeSelector required = 1; -} - -// Projection that may be projected along with other supported volume types -message VolumeProjection { - // information about the secret data to project - // +optional - optional SecretProjection secret = 1; - - // information about the downwardAPI data to project - // +optional - optional DownwardAPIProjection downwardAPI = 2; - - // information about the configMap data to project - // +optional - optional ConfigMapProjection configMap = 3; - - // information about the serviceAccountToken data to project - // +optional - optional ServiceAccountTokenProjection serviceAccountToken = 4; -} - -// Represents the source of a volume to mount. -// Only one of its members may be specified. -message VolumeSource { - // HostPath represents a pre-existing file or directory on the host - // machine that is directly exposed to the container. This is generally - // used for system agents or other privileged things that are allowed - // to see the host machine. Most containers will NOT need this. - // More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath - // --- - // TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not - // mount host directories as read/write. - // +optional - optional HostPathVolumeSource hostPath = 1; - - // EmptyDir represents a temporary directory that shares a pod's lifetime. - // More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir - // +optional - optional EmptyDirVolumeSource emptyDir = 2; - - // GCEPersistentDisk represents a GCE Disk resource that is attached to a - // kubelet's host machine and then exposed to the pod. - // More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk - // +optional - optional GCEPersistentDiskVolumeSource gcePersistentDisk = 3; - - // AWSElasticBlockStore represents an AWS Disk resource that is attached to a - // kubelet's host machine and then exposed to the pod. - // More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore - // +optional - optional AWSElasticBlockStoreVolumeSource awsElasticBlockStore = 4; - - // GitRepo represents a git repository at a particular revision. - // DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an - // EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir - // into the Pod's container. - // +optional - optional GitRepoVolumeSource gitRepo = 5; - - // Secret represents a secret that should populate this volume. - // More info: https://kubernetes.io/docs/concepts/storage/volumes#secret - // +optional - optional SecretVolumeSource secret = 6; - - // NFS represents an NFS mount on the host that shares a pod's lifetime - // More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs - // +optional - optional NFSVolumeSource nfs = 7; - - // ISCSI represents an ISCSI Disk resource that is attached to a - // kubelet's host machine and then exposed to the pod. - // More info: https://examples.k8s.io/volumes/iscsi/README.md - // +optional - optional ISCSIVolumeSource iscsi = 8; - - // Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. - // More info: https://examples.k8s.io/volumes/glusterfs/README.md - // +optional - optional GlusterfsVolumeSource glusterfs = 9; - - // PersistentVolumeClaimVolumeSource represents a reference to a - // PersistentVolumeClaim in the same namespace. - // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims - // +optional - optional PersistentVolumeClaimVolumeSource persistentVolumeClaim = 10; - - // RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. - // More info: https://examples.k8s.io/volumes/rbd/README.md - // +optional - optional RBDVolumeSource rbd = 11; - - // FlexVolume represents a generic volume resource that is - // provisioned/attached using an exec based plugin. - // +optional - optional FlexVolumeSource flexVolume = 12; - - // Cinder represents a cinder volume attached and mounted on kubelets host machine. - // More info: https://examples.k8s.io/mysql-cinder-pd/README.md - // +optional - optional CinderVolumeSource cinder = 13; - - // CephFS represents a Ceph FS mount on the host that shares a pod's lifetime - // +optional - optional CephFSVolumeSource cephfs = 14; - - // Flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running - // +optional - optional FlockerVolumeSource flocker = 15; - - // DownwardAPI represents downward API about the pod that should populate this volume - // +optional - optional DownwardAPIVolumeSource downwardAPI = 16; - - // FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. - // +optional - optional FCVolumeSource fc = 17; - - // AzureFile represents an Azure File Service mount on the host and bind mount to the pod. - // +optional - optional AzureFileVolumeSource azureFile = 18; - - // ConfigMap represents a configMap that should populate this volume - // +optional - optional ConfigMapVolumeSource configMap = 19; - - // VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine - // +optional - optional VsphereVirtualDiskVolumeSource vsphereVolume = 20; - - // Quobyte represents a Quobyte mount on the host that shares a pod's lifetime - // +optional - optional QuobyteVolumeSource quobyte = 21; - - // AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. - // +optional - optional AzureDiskVolumeSource azureDisk = 22; - - // PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine - optional PhotonPersistentDiskVolumeSource photonPersistentDisk = 23; - - // Items for all in one resources secrets, configmaps, and downward API - optional ProjectedVolumeSource projected = 26; - - // PortworxVolume represents a portworx volume attached and mounted on kubelets host machine - // +optional - optional PortworxVolumeSource portworxVolume = 24; - - // ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. - // +optional - optional ScaleIOVolumeSource scaleIO = 25; - - // StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes. - // +optional - optional StorageOSVolumeSource storageos = 27; - - // CSI (Container Storage Interface) represents storage that is handled by an external CSI driver (Alpha feature). - // +optional - optional CSIVolumeSource csi = 28; -} - -// Represents a vSphere volume resource. -message VsphereVirtualDiskVolumeSource { - // Path that identifies vSphere volume vmdk - optional string volumePath = 1; - - // Filesystem type to mount. - // Must be a filesystem type supported by the host operating system. - // Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - // +optional - optional string fsType = 2; - - // Storage Policy Based Management (SPBM) profile name. - // +optional - optional string storagePolicyName = 3; - - // Storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName. - // +optional - optional string storagePolicyID = 4; -} - -// The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s) -message WeightedPodAffinityTerm { - // weight associated with matching the corresponding podAffinityTerm, - // in the range 1-100. - optional int32 weight = 1; - - // Required. A pod affinity term, associated with the corresponding weight. - optional PodAffinityTerm podAffinityTerm = 2; -} - -// WindowsSecurityContextOptions contain Windows-specific options and credentials. -message WindowsSecurityContextOptions { - // GMSACredentialSpecName is the name of the GMSA credential spec to use. - // This field is alpha-level and is only honored by servers that enable the WindowsGMSA feature flag. - // +optional - optional string gmsaCredentialSpecName = 1; - - // GMSACredentialSpec is where the GMSA admission webhook - // (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the - // GMSA credential spec named by the GMSACredentialSpecName field. - // This field is alpha-level and is only honored by servers that enable the WindowsGMSA feature flag. - // +optional - optional string gmsaCredentialSpec = 2; - - // The UserName in Windows to run the entrypoint of the container process. - // Defaults to the user specified in image metadata if unspecified. - // May also be set in PodSecurityContext. If set in both SecurityContext and - // PodSecurityContext, the value specified in SecurityContext takes precedence. - // This field is beta-level and may be disabled with the WindowsRunAsUserName feature flag. - // +optional - optional string runAsUserName = 3; -} - diff --git a/vendor/k8s.io/gengo/types/doc.go b/vendor/k8s.io/api/discovery/v1alpha1/doc.go similarity index 69% rename from vendor/k8s.io/gengo/types/doc.go rename to vendor/k8s.io/api/discovery/v1alpha1/doc.go index 74a969a..ffd6b0b 100644 --- a/vendor/k8s.io/gengo/types/doc.go +++ b/vendor/k8s.io/api/discovery/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package types contains go type information, packaged in a way that makes -// auto-generation convenient, whether by template or straight go functions. -package types // import "k8s.io/gengo/types" +// +k8s:deepcopy-gen=package +// +k8s:protobuf-gen=package +// +k8s:openapi-gen=true +// +groupName=discovery.k8s.io + +package v1alpha1 // import "k8s.io/api/discovery/v1alpha1" diff --git a/vendor/k8s.io/api/discovery/v1alpha1/generated.pb.go b/vendor/k8s.io/api/discovery/v1alpha1/generated.pb.go new file mode 100644 index 0000000..fa4d3ac --- /dev/null +++ b/vendor/k8s.io/api/discovery/v1alpha1/generated.pb.go @@ -0,0 +1,1730 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: k8s.io/kubernetes/vendor/k8s.io/api/discovery/v1alpha1/generated.proto + +package v1alpha1 + +import ( + fmt "fmt" + + io "io" + + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" + k8s_io_api_core_v1 "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" + + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package + +func (m *Endpoint) Reset() { *m = Endpoint{} } +func (*Endpoint) ProtoMessage() {} +func (*Endpoint) Descriptor() ([]byte, []int) { + return fileDescriptor_772f83c5b34e07a5, []int{0} +} +func (m *Endpoint) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Endpoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Endpoint) XXX_Merge(src proto.Message) { + xxx_messageInfo_Endpoint.Merge(m, src) +} +func (m *Endpoint) XXX_Size() int { + return m.Size() +} +func (m *Endpoint) XXX_DiscardUnknown() { + xxx_messageInfo_Endpoint.DiscardUnknown(m) +} + +var xxx_messageInfo_Endpoint proto.InternalMessageInfo + +func (m *EndpointConditions) Reset() { *m = EndpointConditions{} } +func (*EndpointConditions) ProtoMessage() {} +func (*EndpointConditions) Descriptor() ([]byte, []int) { + return fileDescriptor_772f83c5b34e07a5, []int{1} +} +func (m *EndpointConditions) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EndpointConditions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EndpointConditions) XXX_Merge(src proto.Message) { + xxx_messageInfo_EndpointConditions.Merge(m, src) +} +func (m *EndpointConditions) XXX_Size() int { + return m.Size() +} +func (m *EndpointConditions) XXX_DiscardUnknown() { + xxx_messageInfo_EndpointConditions.DiscardUnknown(m) +} + +var xxx_messageInfo_EndpointConditions proto.InternalMessageInfo + +func (m *EndpointPort) Reset() { *m = EndpointPort{} } +func (*EndpointPort) ProtoMessage() {} +func (*EndpointPort) Descriptor() ([]byte, []int) { + return fileDescriptor_772f83c5b34e07a5, []int{2} +} +func (m *EndpointPort) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EndpointPort) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EndpointPort) XXX_Merge(src proto.Message) { + xxx_messageInfo_EndpointPort.Merge(m, src) +} +func (m *EndpointPort) XXX_Size() int { + return m.Size() +} +func (m *EndpointPort) XXX_DiscardUnknown() { + xxx_messageInfo_EndpointPort.DiscardUnknown(m) +} + +var xxx_messageInfo_EndpointPort proto.InternalMessageInfo + +func (m *EndpointSlice) Reset() { *m = EndpointSlice{} } +func (*EndpointSlice) ProtoMessage() {} +func (*EndpointSlice) Descriptor() ([]byte, []int) { + return fileDescriptor_772f83c5b34e07a5, []int{3} +} +func (m *EndpointSlice) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EndpointSlice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EndpointSlice) XXX_Merge(src proto.Message) { + xxx_messageInfo_EndpointSlice.Merge(m, src) +} +func (m *EndpointSlice) XXX_Size() int { + return m.Size() +} +func (m *EndpointSlice) XXX_DiscardUnknown() { + xxx_messageInfo_EndpointSlice.DiscardUnknown(m) +} + +var xxx_messageInfo_EndpointSlice proto.InternalMessageInfo + +func (m *EndpointSliceList) Reset() { *m = EndpointSliceList{} } +func (*EndpointSliceList) ProtoMessage() {} +func (*EndpointSliceList) Descriptor() ([]byte, []int) { + return fileDescriptor_772f83c5b34e07a5, []int{4} +} +func (m *EndpointSliceList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EndpointSliceList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EndpointSliceList) XXX_Merge(src proto.Message) { + xxx_messageInfo_EndpointSliceList.Merge(m, src) +} +func (m *EndpointSliceList) XXX_Size() int { + return m.Size() +} +func (m *EndpointSliceList) XXX_DiscardUnknown() { + xxx_messageInfo_EndpointSliceList.DiscardUnknown(m) +} + +var xxx_messageInfo_EndpointSliceList proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Endpoint)(nil), "k8s.io.api.discovery.v1alpha1.Endpoint") + proto.RegisterMapType((map[string]string)(nil), "k8s.io.api.discovery.v1alpha1.Endpoint.TopologyEntry") + proto.RegisterType((*EndpointConditions)(nil), "k8s.io.api.discovery.v1alpha1.EndpointConditions") + proto.RegisterType((*EndpointPort)(nil), "k8s.io.api.discovery.v1alpha1.EndpointPort") + proto.RegisterType((*EndpointSlice)(nil), "k8s.io.api.discovery.v1alpha1.EndpointSlice") + proto.RegisterType((*EndpointSliceList)(nil), "k8s.io.api.discovery.v1alpha1.EndpointSliceList") +} + +func init() { + proto.RegisterFile("k8s.io/kubernetes/vendor/k8s.io/api/discovery/v1alpha1/generated.proto", fileDescriptor_772f83c5b34e07a5) +} + +var fileDescriptor_772f83c5b34e07a5 = []byte{ + // 746 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x4b, 0x6f, 0xd3, 0x4a, + 0x14, 0x8e, 0x9b, 0x5a, 0xb2, 0x27, 0x8d, 0x6e, 0x3b, 0xba, 0x8b, 0x28, 0xf7, 0x5e, 0x3b, 0xca, + 0x5d, 0x10, 0xa9, 0x30, 0x26, 0x15, 0x45, 0x15, 0xac, 0x6a, 0x28, 0x0f, 0x89, 0x47, 0x18, 0xba, + 0x40, 0x88, 0x05, 0x13, 0x7b, 0xea, 0x98, 0x24, 0x1e, 0xcb, 0x9e, 0x44, 0xca, 0x8e, 0x9f, 0xc0, + 0x0f, 0x62, 0x89, 0x50, 0x97, 0x5d, 0x76, 0x65, 0x51, 0xf7, 0x5f, 0x74, 0x85, 0x66, 0xfc, 0x4a, + 0x09, 0x8f, 0xec, 0x66, 0xbe, 0x39, 0xdf, 0x77, 0xce, 0xf9, 0xe6, 0x1c, 0xf0, 0x68, 0x7c, 0x10, + 0x23, 0x9f, 0x59, 0xe3, 0xd9, 0x90, 0x46, 0x01, 0xe5, 0x34, 0xb6, 0xe6, 0x34, 0x70, 0x59, 0x64, + 0xe5, 0x0f, 0x24, 0xf4, 0x2d, 0xd7, 0x8f, 0x1d, 0x36, 0xa7, 0xd1, 0xc2, 0x9a, 0xf7, 0xc9, 0x24, + 0x1c, 0x91, 0xbe, 0xe5, 0xd1, 0x80, 0x46, 0x84, 0x53, 0x17, 0x85, 0x11, 0xe3, 0x0c, 0xfe, 0x97, + 0x85, 0x23, 0x12, 0xfa, 0xa8, 0x0c, 0x47, 0x45, 0x78, 0xfb, 0x96, 0xe7, 0xf3, 0xd1, 0x6c, 0x88, + 0x1c, 0x36, 0xb5, 0x3c, 0xe6, 0x31, 0x4b, 0xb2, 0x86, 0xb3, 0x13, 0x79, 0x93, 0x17, 0x79, 0xca, + 0xd4, 0xda, 0xdd, 0xa5, 0xe4, 0x0e, 0x8b, 0xa8, 0x35, 0x5f, 0xc9, 0xd8, 0xbe, 0x53, 0xc5, 0x4c, + 0x89, 0x33, 0xf2, 0x03, 0x51, 0x5f, 0x38, 0xf6, 0x04, 0x10, 0x5b, 0x53, 0xca, 0xc9, 0xcf, 0x58, + 0xd6, 0xaf, 0x58, 0xd1, 0x2c, 0xe0, 0xfe, 0x94, 0xae, 0x10, 0xee, 0xfe, 0x89, 0x10, 0x3b, 0x23, + 0x3a, 0x25, 0x3f, 0xf2, 0xba, 0x9f, 0xeb, 0x40, 0x3b, 0x0a, 0xdc, 0x90, 0xf9, 0x01, 0x87, 0xbb, + 0x40, 0x27, 0xae, 0x1b, 0xd1, 0x38, 0xa6, 0x71, 0x4b, 0xe9, 0xd4, 0x7b, 0xba, 0xdd, 0x4c, 0x13, + 0x53, 0x3f, 0x2c, 0x40, 0x5c, 0xbd, 0x43, 0x0a, 0x80, 0xc3, 0x02, 0xd7, 0xe7, 0x3e, 0x0b, 0xe2, + 0xd6, 0x46, 0x47, 0xe9, 0x35, 0xf6, 0xfa, 0xe8, 0xb7, 0xfe, 0xa2, 0x22, 0xd3, 0x83, 0x92, 0x68, + 0xc3, 0xd3, 0xc4, 0xac, 0xa5, 0x89, 0x09, 0x2a, 0x0c, 0x2f, 0x09, 0xc3, 0x1e, 0xd0, 0x46, 0x2c, + 0xe6, 0x01, 0x99, 0xd2, 0x56, 0xbd, 0xa3, 0xf4, 0x74, 0x7b, 0x2b, 0x4d, 0x4c, 0xed, 0x49, 0x8e, + 0xe1, 0xf2, 0x15, 0x0e, 0x80, 0xce, 0x49, 0xe4, 0x51, 0x8e, 0xe9, 0x49, 0x6b, 0x53, 0xd6, 0xf3, + 0xff, 0x72, 0x3d, 0xe2, 0x87, 0xd0, 0xbc, 0x8f, 0x5e, 0x0e, 0x3f, 0x50, 0x47, 0x04, 0xd1, 0x88, + 0x06, 0x0e, 0xcd, 0x5a, 0x3c, 0x2e, 0x98, 0xb8, 0x12, 0x81, 0x0e, 0xd0, 0x38, 0x0b, 0xd9, 0x84, + 0x79, 0x8b, 0x96, 0xda, 0xa9, 0xf7, 0x1a, 0x7b, 0xfb, 0x6b, 0x36, 0x88, 0x8e, 0x73, 0xde, 0x51, + 0xc0, 0xa3, 0x85, 0xbd, 0x9d, 0x37, 0xa9, 0x15, 0x30, 0x2e, 0x85, 0xdb, 0xf7, 0x41, 0xf3, 0x5a, + 0x30, 0xdc, 0x06, 0xf5, 0x31, 0x5d, 0xb4, 0x14, 0xd1, 0x2c, 0x16, 0x47, 0xf8, 0x37, 0x50, 0xe7, + 0x64, 0x32, 0xa3, 0xd2, 0x65, 0x1d, 0x67, 0x97, 0x7b, 0x1b, 0x07, 0x4a, 0x77, 0x1f, 0xc0, 0x55, + 0x4f, 0xa1, 0x09, 0xd4, 0x88, 0x12, 0x37, 0xd3, 0xd0, 0x6c, 0x3d, 0x4d, 0x4c, 0x15, 0x0b, 0x00, + 0x67, 0x78, 0xf7, 0xab, 0x02, 0xb6, 0x0a, 0xde, 0x80, 0x45, 0x1c, 0xfe, 0x0b, 0x36, 0xa5, 0xc3, + 0x32, 0xa9, 0xad, 0xa5, 0x89, 0xb9, 0xf9, 0x42, 0xb8, 0x2b, 0x51, 0xf8, 0x18, 0x68, 0x72, 0x5a, + 0x1c, 0x36, 0xc9, 0x4a, 0xb0, 0x77, 0x45, 0x33, 0x83, 0x1c, 0xbb, 0x4a, 0xcc, 0x7f, 0x56, 0x37, + 0x01, 0x15, 0xcf, 0xb8, 0x24, 0x8b, 0x34, 0x21, 0x8b, 0xb8, 0xfc, 0x48, 0x35, 0x4b, 0x23, 0xd2, + 0x63, 0x89, 0xc2, 0x3e, 0x68, 0x90, 0x30, 0x2c, 0x68, 0xf2, 0x0b, 0x75, 0xfb, 0xaf, 0x34, 0x31, + 0x1b, 0x87, 0x15, 0x8c, 0x97, 0x63, 0xba, 0x97, 0x1b, 0xa0, 0x59, 0x34, 0xf2, 0x7a, 0xe2, 0x3b, + 0x14, 0xbe, 0x07, 0x9a, 0x58, 0x2a, 0x97, 0x70, 0x22, 0xbb, 0x69, 0xec, 0xdd, 0x5e, 0xfa, 0xb3, + 0x72, 0x37, 0x50, 0x38, 0xf6, 0x04, 0x10, 0x23, 0x11, 0x5d, 0x8d, 0xc5, 0x73, 0xca, 0x49, 0x35, + 0x93, 0x15, 0x86, 0x4b, 0x55, 0xf8, 0x10, 0x34, 0xf2, 0x2d, 0x38, 0x5e, 0x84, 0x34, 0x2f, 0xb3, + 0x9b, 0x53, 0x1a, 0x87, 0xd5, 0xd3, 0xd5, 0xf5, 0x2b, 0x5e, 0xa6, 0xc1, 0x37, 0x40, 0xa7, 0x79, + 0xe1, 0x62, 0x7b, 0xc4, 0x70, 0xdd, 0x58, 0x73, 0xb8, 0xec, 0x9d, 0x3c, 0x99, 0x5e, 0x20, 0x31, + 0xae, 0xc4, 0xe0, 0x00, 0xa8, 0xc2, 0xce, 0xb8, 0x55, 0x97, 0xaa, 0xbb, 0x6b, 0xaa, 0x8a, 0x8f, + 0xb0, 0x9b, 0xb9, 0xb2, 0x2a, 0x6e, 0x31, 0xce, 0x84, 0xba, 0x5f, 0x14, 0xb0, 0x73, 0xcd, 0xe5, + 0x67, 0x7e, 0xcc, 0xe1, 0xbb, 0x15, 0xa7, 0xd1, 0x7a, 0x4e, 0x0b, 0xb6, 0xf4, 0xb9, 0x5c, 0x8b, + 0x02, 0x59, 0x72, 0xf9, 0x15, 0x50, 0x7d, 0x4e, 0xa7, 0x85, 0x37, 0x37, 0xd7, 0xec, 0x42, 0x96, + 0x57, 0xb5, 0xf1, 0x54, 0x48, 0xe0, 0x4c, 0xc9, 0x46, 0xa7, 0x17, 0x46, 0xed, 0xec, 0xc2, 0xa8, + 0x9d, 0x5f, 0x18, 0xb5, 0x8f, 0xa9, 0xa1, 0x9c, 0xa6, 0x86, 0x72, 0x96, 0x1a, 0xca, 0x79, 0x6a, + 0x28, 0xdf, 0x52, 0x43, 0xf9, 0x74, 0x69, 0xd4, 0xde, 0x6a, 0x85, 0xe6, 0xf7, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x65, 0x85, 0x5a, 0x9b, 0x75, 0x06, 0x00, 0x00, +} + +func (m *Endpoint) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Endpoint) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Endpoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Topology) > 0 { + keysForTopology := make([]string, 0, len(m.Topology)) + for k := range m.Topology { + keysForTopology = append(keysForTopology, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForTopology) + for iNdEx := len(keysForTopology) - 1; iNdEx >= 0; iNdEx-- { + v := m.Topology[string(keysForTopology[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForTopology[iNdEx]) + copy(dAtA[i:], keysForTopology[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForTopology[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + if m.TargetRef != nil { + { + size, err := m.TargetRef.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Hostname != nil { + i -= len(*m.Hostname) + copy(dAtA[i:], *m.Hostname) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Hostname))) + i-- + dAtA[i] = 0x1a + } + { + size, err := m.Conditions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Addresses) > 0 { + for iNdEx := len(m.Addresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Addresses[iNdEx]) + copy(dAtA[i:], m.Addresses[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Addresses[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *EndpointConditions) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EndpointConditions) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EndpointConditions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Ready != nil { + i-- + if *m.Ready { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *EndpointPort) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EndpointPort) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EndpointPort) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AppProtocol != nil { + i -= len(*m.AppProtocol) + copy(dAtA[i:], *m.AppProtocol) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.AppProtocol))) + i-- + dAtA[i] = 0x22 + } + if m.Port != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Port)) + i-- + dAtA[i] = 0x18 + } + if m.Protocol != nil { + i -= len(*m.Protocol) + copy(dAtA[i:], *m.Protocol) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Protocol))) + i-- + dAtA[i] = 0x12 + } + if m.Name != nil { + i -= len(*m.Name) + copy(dAtA[i:], *m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EndpointSlice) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EndpointSlice) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EndpointSlice) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.AddressType) + copy(dAtA[i:], m.AddressType) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.AddressType))) + i-- + dAtA[i] = 0x22 + if len(m.Ports) > 0 { + for iNdEx := len(m.Ports) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ports[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Endpoints) > 0 { + for iNdEx := len(m.Endpoints) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Endpoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EndpointSliceList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EndpointSliceList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EndpointSliceList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { + offset -= sovGenerated(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Endpoint) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Addresses) > 0 { + for _, s := range m.Addresses { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = m.Conditions.Size() + n += 1 + l + sovGenerated(uint64(l)) + if m.Hostname != nil { + l = len(*m.Hostname) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.TargetRef != nil { + l = m.TargetRef.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Topology) > 0 { + for k, v := range m.Topology { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + +func (m *EndpointConditions) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Ready != nil { + n += 2 + } + return n +} + +func (m *EndpointPort) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Name != nil { + l = len(*m.Name) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Protocol != nil { + l = len(*m.Protocol) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Port != nil { + n += 1 + sovGenerated(uint64(*m.Port)) + } + if m.AppProtocol != nil { + l = len(*m.AppProtocol) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *EndpointSlice) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Endpoints) > 0 { + for _, e := range m.Endpoints { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Ports) > 0 { + for _, e := range m.Ports { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.AddressType) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *EndpointSliceList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func sovGenerated(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenerated(x uint64) (n int) { + return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *Endpoint) String() string { + if this == nil { + return "nil" + } + keysForTopology := make([]string, 0, len(this.Topology)) + for k := range this.Topology { + keysForTopology = append(keysForTopology, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForTopology) + mapStringForTopology := "map[string]string{" + for _, k := range keysForTopology { + mapStringForTopology += fmt.Sprintf("%v: %v,", k, this.Topology[k]) + } + mapStringForTopology += "}" + s := strings.Join([]string{`&Endpoint{`, + `Addresses:` + fmt.Sprintf("%v", this.Addresses) + `,`, + `Conditions:` + strings.Replace(strings.Replace(this.Conditions.String(), "EndpointConditions", "EndpointConditions", 1), `&`, ``, 1) + `,`, + `Hostname:` + valueToStringGenerated(this.Hostname) + `,`, + `TargetRef:` + strings.Replace(fmt.Sprintf("%v", this.TargetRef), "ObjectReference", "v1.ObjectReference", 1) + `,`, + `Topology:` + mapStringForTopology + `,`, + `}`, + }, "") + return s +} +func (this *EndpointConditions) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&EndpointConditions{`, + `Ready:` + valueToStringGenerated(this.Ready) + `,`, + `}`, + }, "") + return s +} +func (this *EndpointPort) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&EndpointPort{`, + `Name:` + valueToStringGenerated(this.Name) + `,`, + `Protocol:` + valueToStringGenerated(this.Protocol) + `,`, + `Port:` + valueToStringGenerated(this.Port) + `,`, + `AppProtocol:` + valueToStringGenerated(this.AppProtocol) + `,`, + `}`, + }, "") + return s +} +func (this *EndpointSlice) String() string { + if this == nil { + return "nil" + } + repeatedStringForEndpoints := "[]Endpoint{" + for _, f := range this.Endpoints { + repeatedStringForEndpoints += strings.Replace(strings.Replace(f.String(), "Endpoint", "Endpoint", 1), `&`, ``, 1) + "," + } + repeatedStringForEndpoints += "}" + repeatedStringForPorts := "[]EndpointPort{" + for _, f := range this.Ports { + repeatedStringForPorts += strings.Replace(strings.Replace(f.String(), "EndpointPort", "EndpointPort", 1), `&`, ``, 1) + "," + } + repeatedStringForPorts += "}" + s := strings.Join([]string{`&EndpointSlice{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v11.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Endpoints:` + repeatedStringForEndpoints + `,`, + `Ports:` + repeatedStringForPorts + `,`, + `AddressType:` + fmt.Sprintf("%v", this.AddressType) + `,`, + `}`, + }, "") + return s +} +func (this *EndpointSliceList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]EndpointSlice{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "EndpointSlice", "EndpointSlice", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&EndpointSliceList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v11.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func valueToStringGenerated(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *Endpoint) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Endpoint: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Endpoint: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Addresses", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Addresses = append(m.Addresses, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Conditions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Hostname = &s + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TargetRef", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TargetRef == nil { + m.TargetRef = &v1.ObjectReference{} + } + if err := m.TargetRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Topology", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Topology == nil { + m.Topology = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Topology[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EndpointConditions) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EndpointConditions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EndpointConditions: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Ready", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Ready = &b + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EndpointPort) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EndpointPort: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EndpointPort: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Name = &s + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := k8s_io_api_core_v1.Protocol(dAtA[iNdEx:postIndex]) + m.Protocol = &s + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Port = &v + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppProtocol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.AppProtocol = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EndpointSlice) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EndpointSlice: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EndpointSlice: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Endpoints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Endpoints = append(m.Endpoints, Endpoint{}) + if err := m.Endpoints[len(m.Endpoints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ports", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ports = append(m.Ports, EndpointPort{}) + if err := m.Ports[len(m.Ports)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AddressType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AddressType = AddressType(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EndpointSliceList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EndpointSliceList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EndpointSliceList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, EndpointSlice{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenerated(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenerated + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthGenerated + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipGenerated(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthGenerated + } + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") +) diff --git a/vendor/k8s.io/api/discovery/v1alpha1/register.go b/vendor/k8s.io/api/discovery/v1alpha1/register.go new file mode 100644 index 0000000..55b73f9 --- /dev/null +++ b/vendor/k8s.io/api/discovery/v1alpha1/register.go @@ -0,0 +1,56 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// GroupName is the group name used in this package +const GroupName = "discovery.k8s.io" + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} + +// Kind takes an unqualified kind and returns a Group qualified GroupKind +func Kind(kind string) schema.GroupKind { + return SchemeGroupVersion.WithKind(kind).GroupKind() +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + // SchemeBuilder is the scheme builder with scheme init functions to run for this API package + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + // AddToScheme is a common registration function for mapping packaged scoped group & version keys to a scheme + AddToScheme = SchemeBuilder.AddToScheme +) + +// Adds the list of known types to the given scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &EndpointSlice{}, + &EndpointSliceList{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/vendor/k8s.io/api/discovery/v1alpha1/types.go b/vendor/k8s.io/api/discovery/v1alpha1/types.go new file mode 100644 index 0000000..fff30b5 --- /dev/null +++ b/vendor/k8s.io/api/discovery/v1alpha1/types.go @@ -0,0 +1,162 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// EndpointSlice represents a subset of the endpoints that implement a service. +// For a given service there may be multiple EndpointSlice objects, selected by +// labels, which must be joined to produce the full set of endpoints. +type EndpointSlice struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + // addressType specifies the type of address carried by this EndpointSlice. + // All addresses in this slice must be the same type. This field is + // immutable after creation. The following address types are currently + // supported: + // * IPv4: Represents an IPv4 Address. + // * IPv6: Represents an IPv6 Address. + // * FQDN: Represents a Fully Qualified Domain Name. + AddressType AddressType `json:"addressType" protobuf:"bytes,4,rep,name=addressType"` + // endpoints is a list of unique endpoints in this slice. Each slice may + // include a maximum of 1000 endpoints. + // +listType=atomic + Endpoints []Endpoint `json:"endpoints" protobuf:"bytes,2,rep,name=endpoints"` + // ports specifies the list of network ports exposed by each endpoint in + // this slice. Each port must have a unique name. When ports is empty, it + // indicates that there are no defined ports. When a port is defined with a + // nil port value, it indicates "all ports". Each slice may include a + // maximum of 100 ports. + // +optional + // +listType=atomic + Ports []EndpointPort `json:"ports" protobuf:"bytes,3,rep,name=ports"` +} + +// AddressType represents the type of address referred to by an endpoint. +type AddressType string + +const ( + // AddressTypeIP represents an IP Address. + // This address type has been deprecated and has been replaced by the IPv4 + // and IPv6 adddress types. New resources with this address type will be + // considered invalid. This will be fully removed in 1.18. + // +deprecated + AddressTypeIP = AddressType("IP") + // AddressTypeIPv4 represents an IPv4 Address. + AddressTypeIPv4 = AddressType(v1.IPv4Protocol) + // AddressTypeIPv6 represents an IPv6 Address. + AddressTypeIPv6 = AddressType(v1.IPv6Protocol) + // AddressTypeFQDN represents a FQDN. + AddressTypeFQDN = AddressType("FQDN") +) + +// Endpoint represents a single logical "backend" implementing a service. +type Endpoint struct { + // addresses of this endpoint. The contents of this field are interpreted + // according to the corresponding EndpointSlice addressType field. Consumers + // must handle different types of addresses in the context of their own + // capabilities. This must contain at least one address but no more than + // 100. + // +listType=set + Addresses []string `json:"addresses" protobuf:"bytes,1,rep,name=addresses"` + // conditions contains information about the current status of the endpoint. + Conditions EndpointConditions `json:"conditions,omitempty" protobuf:"bytes,2,opt,name=conditions"` + // hostname of this endpoint. This field may be used by consumers of + // endpoints to distinguish endpoints from each other (e.g. in DNS names). + // Multiple endpoints which use the same hostname should be considered + // fungible (e.g. multiple A values in DNS). Must pass DNS Label (RFC 1123) + // validation. + // +optional + Hostname *string `json:"hostname,omitempty" protobuf:"bytes,3,opt,name=hostname"` + // targetRef is a reference to a Kubernetes object that represents this + // endpoint. + // +optional + TargetRef *v1.ObjectReference `json:"targetRef,omitempty" protobuf:"bytes,4,opt,name=targetRef"` + // topology contains arbitrary topology information associated with the + // endpoint. These key/value pairs must conform with the label format. + // https://kubernetes.io/docs/concepts/overview/working-with-objects/labels + // Topology may include a maximum of 16 key/value pairs. This includes, but + // is not limited to the following well known keys: + // * kubernetes.io/hostname: the value indicates the hostname of the node + // where the endpoint is located. This should match the corresponding + // node label. + // * topology.kubernetes.io/zone: the value indicates the zone where the + // endpoint is located. This should match the corresponding node label. + // * topology.kubernetes.io/region: the value indicates the region where the + // endpoint is located. This should match the corresponding node label. + // +optional + Topology map[string]string `json:"topology,omitempty" protobuf:"bytes,5,opt,name=topology"` +} + +// EndpointConditions represents the current condition of an endpoint. +type EndpointConditions struct { + // ready indicates that this endpoint is prepared to receive traffic, + // according to whatever system is managing the endpoint. A nil value + // indicates an unknown state. In most cases consumers should interpret this + // unknown state as ready. + // +optional + Ready *bool `json:"ready,omitempty" protobuf:"bytes,1,name=ready"` +} + +// EndpointPort represents a Port used by an EndpointSlice +type EndpointPort struct { + // The name of this port. All ports in an EndpointSlice must have a unique + // name. If the EndpointSlice is dervied from a Kubernetes service, this + // corresponds to the Service.ports[].name. + // Name must either be an empty string or pass DNS_LABEL validation: + // * must be no more than 63 characters long. + // * must consist of lower case alphanumeric characters or '-'. + // * must start and end with an alphanumeric character. + // Default is empty string. + Name *string `json:"name,omitempty" protobuf:"bytes,1,name=name"` + // The IP protocol for this port. + // Must be UDP, TCP, or SCTP. + // Default is TCP. + Protocol *v1.Protocol `json:"protocol,omitempty" protobuf:"bytes,2,name=protocol"` + // The port number of the endpoint. + // If this is not specified, ports are not restricted and must be + // interpreted in the context of the specific consumer. + Port *int32 `json:"port,omitempty" protobuf:"bytes,3,opt,name=port"` + // The application protocol for this port. + // This field follows standard Kubernetes label syntax. + // Un-prefixed names are reserved for IANA standard service names (as per + // RFC-6335 and http://www.iana.org/assignments/service-names). + // Non-standard protocols should use prefixed names. + // Default is empty string. + AppProtocol *string `json:"appProtocol,omitempty" protobuf:"bytes,4,name=appProtocol"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// EndpointSliceList represents a list of endpoint slices +type EndpointSliceList struct { + metav1.TypeMeta `json:",inline"` + // Standard list metadata. + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + // List of endpoint slices + // +listType=set + Items []EndpointSlice `json:"items" protobuf:"bytes,2,rep,name=items"` +} diff --git a/vendor/k8s.io/api/discovery/v1alpha1/types_swagger_doc_generated.go b/vendor/k8s.io/api/discovery/v1alpha1/types_swagger_doc_generated.go new file mode 100644 index 0000000..1ba2d60 --- /dev/null +++ b/vendor/k8s.io/api/discovery/v1alpha1/types_swagger_doc_generated.go @@ -0,0 +1,86 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +// This file contains a collection of methods that can be used from go-restful to +// generate Swagger API documentation for its models. Please read this PR for more +// information on the implementation: https://github.com/emicklei/go-restful/pull/215 +// +// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if +// they are on one line! For multiple line or blocks that you want to ignore use ---. +// Any context after a --- is ignored. +// +// Those methods can be generated by using hack/update-generated-swagger-docs.sh + +// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. +var map_Endpoint = map[string]string{ + "": "Endpoint represents a single logical \"backend\" implementing a service.", + "addresses": "addresses of this endpoint. The contents of this field are interpreted according to the corresponding EndpointSlice addressType field. Consumers must handle different types of addresses in the context of their own capabilities. This must contain at least one address but no more than 100.", + "conditions": "conditions contains information about the current status of the endpoint.", + "hostname": "hostname of this endpoint. This field may be used by consumers of endpoints to distinguish endpoints from each other (e.g. in DNS names). Multiple endpoints which use the same hostname should be considered fungible (e.g. multiple A values in DNS). Must pass DNS Label (RFC 1123) validation.", + "targetRef": "targetRef is a reference to a Kubernetes object that represents this endpoint.", + "topology": "topology contains arbitrary topology information associated with the endpoint. These key/value pairs must conform with the label format. https://kubernetes.io/docs/concepts/overview/working-with-objects/labels Topology may include a maximum of 16 key/value pairs. This includes, but is not limited to the following well known keys: * kubernetes.io/hostname: the value indicates the hostname of the node\n where the endpoint is located. This should match the corresponding\n node label.\n* topology.kubernetes.io/zone: the value indicates the zone where the\n endpoint is located. This should match the corresponding node label.\n* topology.kubernetes.io/region: the value indicates the region where the\n endpoint is located. This should match the corresponding node label.", +} + +func (Endpoint) SwaggerDoc() map[string]string { + return map_Endpoint +} + +var map_EndpointConditions = map[string]string{ + "": "EndpointConditions represents the current condition of an endpoint.", + "ready": "ready indicates that this endpoint is prepared to receive traffic, according to whatever system is managing the endpoint. A nil value indicates an unknown state. In most cases consumers should interpret this unknown state as ready.", +} + +func (EndpointConditions) SwaggerDoc() map[string]string { + return map_EndpointConditions +} + +var map_EndpointPort = map[string]string{ + "": "EndpointPort represents a Port used by an EndpointSlice", + "name": "The name of this port. All ports in an EndpointSlice must have a unique name. If the EndpointSlice is dervied from a Kubernetes service, this corresponds to the Service.ports[].name. Name must either be an empty string or pass DNS_LABEL validation: * must be no more than 63 characters long. * must consist of lower case alphanumeric characters or '-'. * must start and end with an alphanumeric character. Default is empty string.", + "protocol": "The IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP.", + "port": "The port number of the endpoint. If this is not specified, ports are not restricted and must be interpreted in the context of the specific consumer.", + "appProtocol": "The application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per RFC-6335 and http://www.iana.org/assignments/service-names). Non-standard protocols should use prefixed names. Default is empty string.", +} + +func (EndpointPort) SwaggerDoc() map[string]string { + return map_EndpointPort +} + +var map_EndpointSlice = map[string]string{ + "": "EndpointSlice represents a subset of the endpoints that implement a service. For a given service there may be multiple EndpointSlice objects, selected by labels, which must be joined to produce the full set of endpoints.", + "metadata": "Standard object's metadata.", + "addressType": "addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name.", + "endpoints": "endpoints is a list of unique endpoints in this slice. Each slice may include a maximum of 1000 endpoints.", + "ports": "ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. When ports is empty, it indicates that there are no defined ports. When a port is defined with a nil port value, it indicates \"all ports\". Each slice may include a maximum of 100 ports.", +} + +func (EndpointSlice) SwaggerDoc() map[string]string { + return map_EndpointSlice +} + +var map_EndpointSliceList = map[string]string{ + "": "EndpointSliceList represents a list of endpoint slices", + "metadata": "Standard list metadata.", + "items": "List of endpoint slices", +} + +func (EndpointSliceList) SwaggerDoc() map[string]string { + return map_EndpointSliceList +} + +// AUTO-GENERATED FUNCTIONS END HERE diff --git a/vendor/k8s.io/api/discovery/v1alpha1/well_known_labels.go b/vendor/k8s.io/api/discovery/v1alpha1/well_known_labels.go new file mode 100644 index 0000000..8f9c72f --- /dev/null +++ b/vendor/k8s.io/api/discovery/v1alpha1/well_known_labels.go @@ -0,0 +1,28 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +const ( + // LabelServiceName is used to indicate the name of a Kubernetes service. + LabelServiceName = "kubernetes.io/service-name" + // LabelManagedBy is used to indicate the controller or entity that manages + // an EndpointSlice. This label aims to enable different EndpointSlice + // objects to be managed by different controllers or entities within the + // same cluster. It is highly recommended to configure this label for all + // EndpointSlices. + LabelManagedBy = "endpointslice.kubernetes.io/managed-by" +) diff --git a/vendor/k8s.io/api/discovery/v1alpha1/zz_generated.deepcopy.go b/vendor/k8s.io/api/discovery/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 0000000..c72f64a --- /dev/null +++ b/vendor/k8s.io/api/discovery/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,195 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Endpoint) DeepCopyInto(out *Endpoint) { + *out = *in + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]string, len(*in)) + copy(*out, *in) + } + in.Conditions.DeepCopyInto(&out.Conditions) + if in.Hostname != nil { + in, out := &in.Hostname, &out.Hostname + *out = new(string) + **out = **in + } + if in.TargetRef != nil { + in, out := &in.TargetRef, &out.TargetRef + *out = new(v1.ObjectReference) + **out = **in + } + if in.Topology != nil { + in, out := &in.Topology, &out.Topology + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Endpoint. +func (in *Endpoint) DeepCopy() *Endpoint { + if in == nil { + return nil + } + out := new(Endpoint) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EndpointConditions) DeepCopyInto(out *EndpointConditions) { + *out = *in + if in.Ready != nil { + in, out := &in.Ready, &out.Ready + *out = new(bool) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EndpointConditions. +func (in *EndpointConditions) DeepCopy() *EndpointConditions { + if in == nil { + return nil + } + out := new(EndpointConditions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EndpointPort) DeepCopyInto(out *EndpointPort) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(v1.Protocol) + **out = **in + } + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(int32) + **out = **in + } + if in.AppProtocol != nil { + in, out := &in.AppProtocol, &out.AppProtocol + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EndpointPort. +func (in *EndpointPort) DeepCopy() *EndpointPort { + if in == nil { + return nil + } + out := new(EndpointPort) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EndpointSlice) DeepCopyInto(out *EndpointSlice) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + if in.Endpoints != nil { + in, out := &in.Endpoints, &out.Endpoints + *out = make([]Endpoint, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Ports != nil { + in, out := &in.Ports, &out.Ports + *out = make([]EndpointPort, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EndpointSlice. +func (in *EndpointSlice) DeepCopy() *EndpointSlice { + if in == nil { + return nil + } + out := new(EndpointSlice) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EndpointSlice) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EndpointSliceList) DeepCopyInto(out *EndpointSliceList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]EndpointSlice, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EndpointSliceList. +func (in *EndpointSliceList) DeepCopy() *EndpointSliceList { + if in == nil { + return nil + } + out := new(EndpointSliceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EndpointSliceList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} diff --git a/vendor/k8s.io/api/discovery/v1beta1/doc.go b/vendor/k8s.io/api/discovery/v1beta1/doc.go new file mode 100644 index 0000000..9b54d1b --- /dev/null +++ b/vendor/k8s.io/api/discovery/v1beta1/doc.go @@ -0,0 +1,22 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package +// +k8s:protobuf-gen=package +// +k8s:openapi-gen=true +// +groupName=discovery.k8s.io + +package v1beta1 // import "k8s.io/api/discovery/v1beta1" diff --git a/vendor/k8s.io/api/discovery/v1beta1/generated.pb.go b/vendor/k8s.io/api/discovery/v1beta1/generated.pb.go new file mode 100644 index 0000000..2283d12 --- /dev/null +++ b/vendor/k8s.io/api/discovery/v1beta1/generated.pb.go @@ -0,0 +1,1730 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: k8s.io/kubernetes/vendor/k8s.io/api/discovery/v1beta1/generated.proto + +package v1beta1 + +import ( + fmt "fmt" + + io "io" + + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" + k8s_io_api_core_v1 "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" + + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package + +func (m *Endpoint) Reset() { *m = Endpoint{} } +func (*Endpoint) ProtoMessage() {} +func (*Endpoint) Descriptor() ([]byte, []int) { + return fileDescriptor_ece80bbc872d519b, []int{0} +} +func (m *Endpoint) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Endpoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Endpoint) XXX_Merge(src proto.Message) { + xxx_messageInfo_Endpoint.Merge(m, src) +} +func (m *Endpoint) XXX_Size() int { + return m.Size() +} +func (m *Endpoint) XXX_DiscardUnknown() { + xxx_messageInfo_Endpoint.DiscardUnknown(m) +} + +var xxx_messageInfo_Endpoint proto.InternalMessageInfo + +func (m *EndpointConditions) Reset() { *m = EndpointConditions{} } +func (*EndpointConditions) ProtoMessage() {} +func (*EndpointConditions) Descriptor() ([]byte, []int) { + return fileDescriptor_ece80bbc872d519b, []int{1} +} +func (m *EndpointConditions) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EndpointConditions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EndpointConditions) XXX_Merge(src proto.Message) { + xxx_messageInfo_EndpointConditions.Merge(m, src) +} +func (m *EndpointConditions) XXX_Size() int { + return m.Size() +} +func (m *EndpointConditions) XXX_DiscardUnknown() { + xxx_messageInfo_EndpointConditions.DiscardUnknown(m) +} + +var xxx_messageInfo_EndpointConditions proto.InternalMessageInfo + +func (m *EndpointPort) Reset() { *m = EndpointPort{} } +func (*EndpointPort) ProtoMessage() {} +func (*EndpointPort) Descriptor() ([]byte, []int) { + return fileDescriptor_ece80bbc872d519b, []int{2} +} +func (m *EndpointPort) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EndpointPort) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EndpointPort) XXX_Merge(src proto.Message) { + xxx_messageInfo_EndpointPort.Merge(m, src) +} +func (m *EndpointPort) XXX_Size() int { + return m.Size() +} +func (m *EndpointPort) XXX_DiscardUnknown() { + xxx_messageInfo_EndpointPort.DiscardUnknown(m) +} + +var xxx_messageInfo_EndpointPort proto.InternalMessageInfo + +func (m *EndpointSlice) Reset() { *m = EndpointSlice{} } +func (*EndpointSlice) ProtoMessage() {} +func (*EndpointSlice) Descriptor() ([]byte, []int) { + return fileDescriptor_ece80bbc872d519b, []int{3} +} +func (m *EndpointSlice) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EndpointSlice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EndpointSlice) XXX_Merge(src proto.Message) { + xxx_messageInfo_EndpointSlice.Merge(m, src) +} +func (m *EndpointSlice) XXX_Size() int { + return m.Size() +} +func (m *EndpointSlice) XXX_DiscardUnknown() { + xxx_messageInfo_EndpointSlice.DiscardUnknown(m) +} + +var xxx_messageInfo_EndpointSlice proto.InternalMessageInfo + +func (m *EndpointSliceList) Reset() { *m = EndpointSliceList{} } +func (*EndpointSliceList) ProtoMessage() {} +func (*EndpointSliceList) Descriptor() ([]byte, []int) { + return fileDescriptor_ece80bbc872d519b, []int{4} +} +func (m *EndpointSliceList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EndpointSliceList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EndpointSliceList) XXX_Merge(src proto.Message) { + xxx_messageInfo_EndpointSliceList.Merge(m, src) +} +func (m *EndpointSliceList) XXX_Size() int { + return m.Size() +} +func (m *EndpointSliceList) XXX_DiscardUnknown() { + xxx_messageInfo_EndpointSliceList.DiscardUnknown(m) +} + +var xxx_messageInfo_EndpointSliceList proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Endpoint)(nil), "k8s.io.api.discovery.v1beta1.Endpoint") + proto.RegisterMapType((map[string]string)(nil), "k8s.io.api.discovery.v1beta1.Endpoint.TopologyEntry") + proto.RegisterType((*EndpointConditions)(nil), "k8s.io.api.discovery.v1beta1.EndpointConditions") + proto.RegisterType((*EndpointPort)(nil), "k8s.io.api.discovery.v1beta1.EndpointPort") + proto.RegisterType((*EndpointSlice)(nil), "k8s.io.api.discovery.v1beta1.EndpointSlice") + proto.RegisterType((*EndpointSliceList)(nil), "k8s.io.api.discovery.v1beta1.EndpointSliceList") +} + +func init() { + proto.RegisterFile("k8s.io/kubernetes/vendor/k8s.io/api/discovery/v1beta1/generated.proto", fileDescriptor_ece80bbc872d519b) +} + +var fileDescriptor_ece80bbc872d519b = []byte{ + // 745 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcf, 0x6b, 0xdb, 0x48, + 0x14, 0xb6, 0xe2, 0x88, 0x95, 0xc6, 0x31, 0x9b, 0x0c, 0x7b, 0x30, 0xde, 0x20, 0x19, 0x2f, 0x2c, + 0x66, 0x43, 0xa4, 0x75, 0xc8, 0x2e, 0x61, 0xf7, 0x14, 0xed, 0x86, 0xb6, 0xd0, 0x36, 0x66, 0x1a, + 0x28, 0x94, 0x1e, 0x3a, 0x96, 0x26, 0xb2, 0x6a, 0x5b, 0x23, 0x34, 0x63, 0x83, 0x6f, 0xfd, 0x13, + 0xfa, 0xf7, 0xf4, 0x5a, 0x28, 0x39, 0xe6, 0x98, 0x93, 0xa8, 0xd5, 0xff, 0x22, 0xa7, 0x32, 0xa3, + 0x5f, 0x76, 0xdd, 0x1f, 0xbe, 0xcd, 0x7c, 0xf3, 0xbe, 0xef, 0xbd, 0xf7, 0xcd, 0x7b, 0xe0, 0x62, + 0x7c, 0xc6, 0xac, 0x80, 0xda, 0xe3, 0xd9, 0x90, 0xc4, 0x21, 0xe1, 0x84, 0xd9, 0x73, 0x12, 0x7a, + 0x34, 0xb6, 0xf3, 0x07, 0x1c, 0x05, 0xb6, 0x17, 0x30, 0x97, 0xce, 0x49, 0xbc, 0xb0, 0xe7, 0xfd, + 0x21, 0xe1, 0xb8, 0x6f, 0xfb, 0x24, 0x24, 0x31, 0xe6, 0xc4, 0xb3, 0xa2, 0x98, 0x72, 0x0a, 0x0f, + 0xb3, 0x68, 0x0b, 0x47, 0x81, 0x55, 0x46, 0x5b, 0x79, 0x74, 0xfb, 0xd8, 0x0f, 0xf8, 0x68, 0x36, + 0xb4, 0x5c, 0x3a, 0xb5, 0x7d, 0xea, 0x53, 0x5b, 0x92, 0x86, 0xb3, 0x6b, 0x79, 0x93, 0x17, 0x79, + 0xca, 0xc4, 0xda, 0xdd, 0x95, 0xd4, 0x2e, 0x8d, 0x89, 0x3d, 0xdf, 0x48, 0xd8, 0x3e, 0xad, 0x62, + 0xa6, 0xd8, 0x1d, 0x05, 0xa1, 0xa8, 0x2e, 0x1a, 0xfb, 0x02, 0x60, 0xf6, 0x94, 0x70, 0xfc, 0x35, + 0x96, 0xfd, 0x2d, 0x56, 0x3c, 0x0b, 0x79, 0x30, 0x25, 0x1b, 0x84, 0xbf, 0x7f, 0x44, 0x60, 0xee, + 0x88, 0x4c, 0xf1, 0x97, 0xbc, 0xee, 0xbb, 0x3a, 0xd0, 0x2e, 0x42, 0x2f, 0xa2, 0x41, 0xc8, 0xe1, + 0x11, 0xd0, 0xb1, 0xe7, 0xc5, 0x84, 0x31, 0xc2, 0x5a, 0x4a, 0xa7, 0xde, 0xd3, 0x9d, 0x66, 0x9a, + 0x98, 0xfa, 0x79, 0x01, 0xa2, 0xea, 0x1d, 0x7a, 0x00, 0xb8, 0x34, 0xf4, 0x02, 0x1e, 0xd0, 0x90, + 0xb5, 0x76, 0x3a, 0x4a, 0xaf, 0x71, 0xf2, 0xa7, 0xf5, 0x3d, 0x7b, 0xad, 0x22, 0xd1, 0x7f, 0x25, + 0xcf, 0x81, 0x37, 0x89, 0x59, 0x4b, 0x13, 0x13, 0x54, 0x18, 0x5a, 0xd1, 0x85, 0x3d, 0xa0, 0x8d, + 0x28, 0xe3, 0x21, 0x9e, 0x92, 0x56, 0xbd, 0xa3, 0xf4, 0x74, 0x67, 0x2f, 0x4d, 0x4c, 0xed, 0x61, + 0x8e, 0xa1, 0xf2, 0x15, 0x0e, 0x80, 0xce, 0x71, 0xec, 0x13, 0x8e, 0xc8, 0x75, 0x6b, 0x57, 0x96, + 0xf3, 0xdb, 0x6a, 0x39, 0xe2, 0x83, 0xac, 0x79, 0xdf, 0xba, 0x1c, 0xbe, 0x26, 0xae, 0x08, 0x22, + 0x31, 0x09, 0x5d, 0x92, 0x75, 0x78, 0x55, 0x30, 0x51, 0x25, 0x02, 0x87, 0x40, 0xe3, 0x34, 0xa2, + 0x13, 0xea, 0x2f, 0x5a, 0x6a, 0xa7, 0xde, 0x6b, 0x9c, 0x9c, 0x6e, 0xd7, 0x9f, 0x75, 0x95, 0xd3, + 0x2e, 0x42, 0x1e, 0x2f, 0x9c, 0xfd, 0xbc, 0x47, 0xad, 0x80, 0x51, 0xa9, 0xdb, 0xfe, 0x17, 0x34, + 0xd7, 0x82, 0xe1, 0x3e, 0xa8, 0x8f, 0xc9, 0xa2, 0xa5, 0x88, 0x5e, 0x91, 0x38, 0xc2, 0x5f, 0x80, + 0x3a, 0xc7, 0x93, 0x19, 0x91, 0x1e, 0xeb, 0x28, 0xbb, 0xfc, 0xb3, 0x73, 0xa6, 0x74, 0xff, 0x02, + 0x70, 0xd3, 0x52, 0x68, 0x02, 0x35, 0x26, 0xd8, 0xcb, 0x34, 0x34, 0x47, 0x4f, 0x13, 0x53, 0x45, + 0x02, 0x40, 0x19, 0xde, 0xfd, 0xa0, 0x80, 0xbd, 0x82, 0x37, 0xa0, 0x31, 0x87, 0x87, 0x60, 0x57, + 0x1a, 0x2c, 0x93, 0x3a, 0x5a, 0x9a, 0x98, 0xbb, 0x4f, 0x85, 0xb9, 0x12, 0x85, 0x0f, 0x80, 0x26, + 0x67, 0xc5, 0xa5, 0x93, 0xac, 0x04, 0xe7, 0x48, 0x34, 0x33, 0xc8, 0xb1, 0xfb, 0xc4, 0xfc, 0x75, + 0x73, 0x0f, 0xac, 0xe2, 0x19, 0x95, 0x64, 0x91, 0x26, 0xa2, 0x31, 0x97, 0xff, 0xa8, 0x66, 0x69, + 0x44, 0x7a, 0x24, 0x51, 0xd8, 0x07, 0x0d, 0x1c, 0x45, 0x05, 0x4d, 0xfe, 0xa0, 0xee, 0xfc, 0x9c, + 0x26, 0x66, 0xe3, 0xbc, 0x82, 0xd1, 0x6a, 0x4c, 0x77, 0xb9, 0x03, 0x9a, 0x45, 0x23, 0xcf, 0x26, + 0x81, 0x4b, 0xe0, 0x2b, 0xa0, 0x89, 0x95, 0xf2, 0x30, 0xc7, 0xb2, 0x9b, 0xf5, 0x91, 0x2c, 0x37, + 0xc3, 0x8a, 0xc6, 0xbe, 0x00, 0x98, 0x25, 0xa2, 0xab, 0xa9, 0x78, 0x42, 0x38, 0xae, 0x46, 0xb2, + 0xc2, 0x50, 0xa9, 0x0a, 0xff, 0x07, 0x8d, 0x7c, 0x07, 0xae, 0x16, 0x11, 0xc9, 0xcb, 0xec, 0xe6, + 0x94, 0xc6, 0x79, 0xf5, 0x74, 0xbf, 0x7e, 0x45, 0xab, 0x34, 0xf8, 0x1c, 0xe8, 0x24, 0x2f, 0x5c, + 0xec, 0x8e, 0x98, 0xad, 0xdf, 0xb7, 0x9b, 0x2d, 0xe7, 0x20, 0xcf, 0xa5, 0x17, 0x08, 0x43, 0x95, + 0x16, 0xbc, 0x04, 0xaa, 0x70, 0x93, 0xb5, 0xea, 0x52, 0xf4, 0x8f, 0xed, 0x44, 0xc5, 0x37, 0x38, + 0xcd, 0x5c, 0x58, 0x15, 0x37, 0x86, 0x32, 0x9d, 0xee, 0x7b, 0x05, 0x1c, 0xac, 0x79, 0xfc, 0x38, + 0x60, 0x1c, 0xbe, 0xdc, 0xf0, 0xd9, 0xda, 0xce, 0x67, 0xc1, 0x96, 0x2e, 0x97, 0x4b, 0x51, 0x20, + 0x2b, 0x1e, 0x0f, 0x80, 0x1a, 0x70, 0x32, 0x2d, 0x9c, 0x39, 0xda, 0xae, 0x09, 0x59, 0x5d, 0xd5, + 0xc5, 0x23, 0xa1, 0x80, 0x32, 0x21, 0xe7, 0xf8, 0x66, 0x69, 0xd4, 0x6e, 0x97, 0x46, 0xed, 0x6e, + 0x69, 0xd4, 0xde, 0xa4, 0x86, 0x72, 0x93, 0x1a, 0xca, 0x6d, 0x6a, 0x28, 0x77, 0xa9, 0xa1, 0x7c, + 0x4c, 0x0d, 0xe5, 0xed, 0x27, 0xa3, 0xf6, 0xe2, 0xa7, 0x5c, 0xf2, 0x73, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x29, 0x1a, 0xa2, 0x6f, 0x6d, 0x06, 0x00, 0x00, +} + +func (m *Endpoint) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Endpoint) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Endpoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Topology) > 0 { + keysForTopology := make([]string, 0, len(m.Topology)) + for k := range m.Topology { + keysForTopology = append(keysForTopology, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForTopology) + for iNdEx := len(keysForTopology) - 1; iNdEx >= 0; iNdEx-- { + v := m.Topology[string(keysForTopology[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForTopology[iNdEx]) + copy(dAtA[i:], keysForTopology[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForTopology[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + if m.TargetRef != nil { + { + size, err := m.TargetRef.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Hostname != nil { + i -= len(*m.Hostname) + copy(dAtA[i:], *m.Hostname) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Hostname))) + i-- + dAtA[i] = 0x1a + } + { + size, err := m.Conditions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Addresses) > 0 { + for iNdEx := len(m.Addresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Addresses[iNdEx]) + copy(dAtA[i:], m.Addresses[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Addresses[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *EndpointConditions) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EndpointConditions) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EndpointConditions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Ready != nil { + i-- + if *m.Ready { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *EndpointPort) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EndpointPort) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EndpointPort) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AppProtocol != nil { + i -= len(*m.AppProtocol) + copy(dAtA[i:], *m.AppProtocol) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.AppProtocol))) + i-- + dAtA[i] = 0x22 + } + if m.Port != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Port)) + i-- + dAtA[i] = 0x18 + } + if m.Protocol != nil { + i -= len(*m.Protocol) + copy(dAtA[i:], *m.Protocol) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Protocol))) + i-- + dAtA[i] = 0x12 + } + if m.Name != nil { + i -= len(*m.Name) + copy(dAtA[i:], *m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EndpointSlice) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EndpointSlice) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EndpointSlice) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.AddressType) + copy(dAtA[i:], m.AddressType) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.AddressType))) + i-- + dAtA[i] = 0x22 + if len(m.Ports) > 0 { + for iNdEx := len(m.Ports) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ports[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Endpoints) > 0 { + for iNdEx := len(m.Endpoints) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Endpoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EndpointSliceList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EndpointSliceList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EndpointSliceList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { + offset -= sovGenerated(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Endpoint) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Addresses) > 0 { + for _, s := range m.Addresses { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = m.Conditions.Size() + n += 1 + l + sovGenerated(uint64(l)) + if m.Hostname != nil { + l = len(*m.Hostname) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.TargetRef != nil { + l = m.TargetRef.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Topology) > 0 { + for k, v := range m.Topology { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + +func (m *EndpointConditions) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Ready != nil { + n += 2 + } + return n +} + +func (m *EndpointPort) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Name != nil { + l = len(*m.Name) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Protocol != nil { + l = len(*m.Protocol) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Port != nil { + n += 1 + sovGenerated(uint64(*m.Port)) + } + if m.AppProtocol != nil { + l = len(*m.AppProtocol) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *EndpointSlice) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Endpoints) > 0 { + for _, e := range m.Endpoints { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Ports) > 0 { + for _, e := range m.Ports { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.AddressType) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *EndpointSliceList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func sovGenerated(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenerated(x uint64) (n int) { + return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *Endpoint) String() string { + if this == nil { + return "nil" + } + keysForTopology := make([]string, 0, len(this.Topology)) + for k := range this.Topology { + keysForTopology = append(keysForTopology, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForTopology) + mapStringForTopology := "map[string]string{" + for _, k := range keysForTopology { + mapStringForTopology += fmt.Sprintf("%v: %v,", k, this.Topology[k]) + } + mapStringForTopology += "}" + s := strings.Join([]string{`&Endpoint{`, + `Addresses:` + fmt.Sprintf("%v", this.Addresses) + `,`, + `Conditions:` + strings.Replace(strings.Replace(this.Conditions.String(), "EndpointConditions", "EndpointConditions", 1), `&`, ``, 1) + `,`, + `Hostname:` + valueToStringGenerated(this.Hostname) + `,`, + `TargetRef:` + strings.Replace(fmt.Sprintf("%v", this.TargetRef), "ObjectReference", "v1.ObjectReference", 1) + `,`, + `Topology:` + mapStringForTopology + `,`, + `}`, + }, "") + return s +} +func (this *EndpointConditions) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&EndpointConditions{`, + `Ready:` + valueToStringGenerated(this.Ready) + `,`, + `}`, + }, "") + return s +} +func (this *EndpointPort) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&EndpointPort{`, + `Name:` + valueToStringGenerated(this.Name) + `,`, + `Protocol:` + valueToStringGenerated(this.Protocol) + `,`, + `Port:` + valueToStringGenerated(this.Port) + `,`, + `AppProtocol:` + valueToStringGenerated(this.AppProtocol) + `,`, + `}`, + }, "") + return s +} +func (this *EndpointSlice) String() string { + if this == nil { + return "nil" + } + repeatedStringForEndpoints := "[]Endpoint{" + for _, f := range this.Endpoints { + repeatedStringForEndpoints += strings.Replace(strings.Replace(f.String(), "Endpoint", "Endpoint", 1), `&`, ``, 1) + "," + } + repeatedStringForEndpoints += "}" + repeatedStringForPorts := "[]EndpointPort{" + for _, f := range this.Ports { + repeatedStringForPorts += strings.Replace(strings.Replace(f.String(), "EndpointPort", "EndpointPort", 1), `&`, ``, 1) + "," + } + repeatedStringForPorts += "}" + s := strings.Join([]string{`&EndpointSlice{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v11.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Endpoints:` + repeatedStringForEndpoints + `,`, + `Ports:` + repeatedStringForPorts + `,`, + `AddressType:` + fmt.Sprintf("%v", this.AddressType) + `,`, + `}`, + }, "") + return s +} +func (this *EndpointSliceList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]EndpointSlice{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "EndpointSlice", "EndpointSlice", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&EndpointSliceList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v11.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func valueToStringGenerated(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *Endpoint) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Endpoint: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Endpoint: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Addresses", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Addresses = append(m.Addresses, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Conditions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Hostname = &s + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TargetRef", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TargetRef == nil { + m.TargetRef = &v1.ObjectReference{} + } + if err := m.TargetRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Topology", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Topology == nil { + m.Topology = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Topology[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EndpointConditions) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EndpointConditions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EndpointConditions: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Ready", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Ready = &b + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EndpointPort) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EndpointPort: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EndpointPort: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Name = &s + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := k8s_io_api_core_v1.Protocol(dAtA[iNdEx:postIndex]) + m.Protocol = &s + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Port = &v + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppProtocol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.AppProtocol = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EndpointSlice) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EndpointSlice: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EndpointSlice: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Endpoints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Endpoints = append(m.Endpoints, Endpoint{}) + if err := m.Endpoints[len(m.Endpoints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ports", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ports = append(m.Ports, EndpointPort{}) + if err := m.Ports[len(m.Ports)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AddressType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AddressType = AddressType(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EndpointSliceList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EndpointSliceList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EndpointSliceList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, EndpointSlice{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenerated(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenerated + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthGenerated + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipGenerated(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthGenerated + } + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") +) diff --git a/vendor/k8s.io/api/discovery/v1beta1/register.go b/vendor/k8s.io/api/discovery/v1beta1/register.go new file mode 100644 index 0000000..fc993c5 --- /dev/null +++ b/vendor/k8s.io/api/discovery/v1beta1/register.go @@ -0,0 +1,56 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// GroupName is the group name used in this package +const GroupName = "discovery.k8s.io" + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"} + +// Kind takes an unqualified kind and returns a Group qualified GroupKind +func Kind(kind string) schema.GroupKind { + return SchemeGroupVersion.WithKind(kind).GroupKind() +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + // SchemeBuilder is the scheme builder with scheme init functions to run for this API package + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + // AddToScheme is a common registration function for mapping packaged scoped group & version keys to a scheme + AddToScheme = SchemeBuilder.AddToScheme +) + +// Adds the list of known types to the given scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &EndpointSlice{}, + &EndpointSliceList{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/vendor/k8s.io/api/discovery/v1beta1/types.go b/vendor/k8s.io/api/discovery/v1beta1/types.go new file mode 100644 index 0000000..e3dc565 --- /dev/null +++ b/vendor/k8s.io/api/discovery/v1beta1/types.go @@ -0,0 +1,162 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// EndpointSlice represents a subset of the endpoints that implement a service. +// For a given service there may be multiple EndpointSlice objects, selected by +// labels, which must be joined to produce the full set of endpoints. +type EndpointSlice struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + // addressType specifies the type of address carried by this EndpointSlice. + // All addresses in this slice must be the same type. This field is + // immutable after creation. The following address types are currently + // supported: + // * IPv4: Represents an IPv4 Address. + // * IPv6: Represents an IPv6 Address. + // * FQDN: Represents a Fully Qualified Domain Name. + AddressType AddressType `json:"addressType" protobuf:"bytes,4,rep,name=addressType"` + // endpoints is a list of unique endpoints in this slice. Each slice may + // include a maximum of 1000 endpoints. + // +listType=atomic + Endpoints []Endpoint `json:"endpoints" protobuf:"bytes,2,rep,name=endpoints"` + // ports specifies the list of network ports exposed by each endpoint in + // this slice. Each port must have a unique name. When ports is empty, it + // indicates that there are no defined ports. When a port is defined with a + // nil port value, it indicates "all ports". Each slice may include a + // maximum of 100 ports. + // +optional + // +listType=atomic + Ports []EndpointPort `json:"ports" protobuf:"bytes,3,rep,name=ports"` +} + +// AddressType represents the type of address referred to by an endpoint. +type AddressType string + +const ( + // AddressTypeIP represents an IP Address. + // This address type has been deprecated and has been replaced by the IPv4 + // and IPv6 adddress types. New resources with this address type will be + // considered invalid. This will be fully removed in 1.18. + // +deprecated + AddressTypeIP = AddressType("IP") + // AddressTypeIPv4 represents an IPv4 Address. + AddressTypeIPv4 = AddressType(v1.IPv4Protocol) + // AddressTypeIPv6 represents an IPv6 Address. + AddressTypeIPv6 = AddressType(v1.IPv6Protocol) + // AddressTypeFQDN represents a FQDN. + AddressTypeFQDN = AddressType("FQDN") +) + +// Endpoint represents a single logical "backend" implementing a service. +type Endpoint struct { + // addresses of this endpoint. The contents of this field are interpreted + // according to the corresponding EndpointSlice addressType field. Consumers + // must handle different types of addresses in the context of their own + // capabilities. This must contain at least one address but no more than + // 100. + // +listType=set + Addresses []string `json:"addresses" protobuf:"bytes,1,rep,name=addresses"` + // conditions contains information about the current status of the endpoint. + Conditions EndpointConditions `json:"conditions,omitempty" protobuf:"bytes,2,opt,name=conditions"` + // hostname of this endpoint. This field may be used by consumers of + // endpoints to distinguish endpoints from each other (e.g. in DNS names). + // Multiple endpoints which use the same hostname should be considered + // fungible (e.g. multiple A values in DNS). Must pass DNS Label (RFC 1123) + // validation. + // +optional + Hostname *string `json:"hostname,omitempty" protobuf:"bytes,3,opt,name=hostname"` + // targetRef is a reference to a Kubernetes object that represents this + // endpoint. + // +optional + TargetRef *v1.ObjectReference `json:"targetRef,omitempty" protobuf:"bytes,4,opt,name=targetRef"` + // topology contains arbitrary topology information associated with the + // endpoint. These key/value pairs must conform with the label format. + // https://kubernetes.io/docs/concepts/overview/working-with-objects/labels + // Topology may include a maximum of 16 key/value pairs. This includes, but + // is not limited to the following well known keys: + // * kubernetes.io/hostname: the value indicates the hostname of the node + // where the endpoint is located. This should match the corresponding + // node label. + // * topology.kubernetes.io/zone: the value indicates the zone where the + // endpoint is located. This should match the corresponding node label. + // * topology.kubernetes.io/region: the value indicates the region where the + // endpoint is located. This should match the corresponding node label. + // +optional + Topology map[string]string `json:"topology,omitempty" protobuf:"bytes,5,opt,name=topology"` +} + +// EndpointConditions represents the current condition of an endpoint. +type EndpointConditions struct { + // ready indicates that this endpoint is prepared to receive traffic, + // according to whatever system is managing the endpoint. A nil value + // indicates an unknown state. In most cases consumers should interpret this + // unknown state as ready. + // +optional + Ready *bool `json:"ready,omitempty" protobuf:"bytes,1,name=ready"` +} + +// EndpointPort represents a Port used by an EndpointSlice +type EndpointPort struct { + // The name of this port. All ports in an EndpointSlice must have a unique + // name. If the EndpointSlice is dervied from a Kubernetes service, this + // corresponds to the Service.ports[].name. + // Name must either be an empty string or pass DNS_LABEL validation: + // * must be no more than 63 characters long. + // * must consist of lower case alphanumeric characters or '-'. + // * must start and end with an alphanumeric character. + // Default is empty string. + Name *string `json:"name,omitempty" protobuf:"bytes,1,name=name"` + // The IP protocol for this port. + // Must be UDP, TCP, or SCTP. + // Default is TCP. + Protocol *v1.Protocol `json:"protocol,omitempty" protobuf:"bytes,2,name=protocol"` + // The port number of the endpoint. + // If this is not specified, ports are not restricted and must be + // interpreted in the context of the specific consumer. + Port *int32 `json:"port,omitempty" protobuf:"bytes,3,opt,name=port"` + // The application protocol for this port. + // This field follows standard Kubernetes label syntax. + // Un-prefixed names are reserved for IANA standard service names (as per + // RFC-6335 and http://www.iana.org/assignments/service-names). + // Non-standard protocols should use prefixed names. + // Default is empty string. + AppProtocol *string `json:"appProtocol,omitempty" protobuf:"bytes,4,name=appProtocol"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// EndpointSliceList represents a list of endpoint slices +type EndpointSliceList struct { + metav1.TypeMeta `json:",inline"` + // Standard list metadata. + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + // List of endpoint slices + // +listType=set + Items []EndpointSlice `json:"items" protobuf:"bytes,2,rep,name=items"` +} diff --git a/vendor/k8s.io/api/discovery/v1beta1/types_swagger_doc_generated.go b/vendor/k8s.io/api/discovery/v1beta1/types_swagger_doc_generated.go new file mode 100644 index 0000000..9dd3a03 --- /dev/null +++ b/vendor/k8s.io/api/discovery/v1beta1/types_swagger_doc_generated.go @@ -0,0 +1,86 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +// This file contains a collection of methods that can be used from go-restful to +// generate Swagger API documentation for its models. Please read this PR for more +// information on the implementation: https://github.com/emicklei/go-restful/pull/215 +// +// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if +// they are on one line! For multiple line or blocks that you want to ignore use ---. +// Any context after a --- is ignored. +// +// Those methods can be generated by using hack/update-generated-swagger-docs.sh + +// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. +var map_Endpoint = map[string]string{ + "": "Endpoint represents a single logical \"backend\" implementing a service.", + "addresses": "addresses of this endpoint. The contents of this field are interpreted according to the corresponding EndpointSlice addressType field. Consumers must handle different types of addresses in the context of their own capabilities. This must contain at least one address but no more than 100.", + "conditions": "conditions contains information about the current status of the endpoint.", + "hostname": "hostname of this endpoint. This field may be used by consumers of endpoints to distinguish endpoints from each other (e.g. in DNS names). Multiple endpoints which use the same hostname should be considered fungible (e.g. multiple A values in DNS). Must pass DNS Label (RFC 1123) validation.", + "targetRef": "targetRef is a reference to a Kubernetes object that represents this endpoint.", + "topology": "topology contains arbitrary topology information associated with the endpoint. These key/value pairs must conform with the label format. https://kubernetes.io/docs/concepts/overview/working-with-objects/labels Topology may include a maximum of 16 key/value pairs. This includes, but is not limited to the following well known keys: * kubernetes.io/hostname: the value indicates the hostname of the node\n where the endpoint is located. This should match the corresponding\n node label.\n* topology.kubernetes.io/zone: the value indicates the zone where the\n endpoint is located. This should match the corresponding node label.\n* topology.kubernetes.io/region: the value indicates the region where the\n endpoint is located. This should match the corresponding node label.", +} + +func (Endpoint) SwaggerDoc() map[string]string { + return map_Endpoint +} + +var map_EndpointConditions = map[string]string{ + "": "EndpointConditions represents the current condition of an endpoint.", + "ready": "ready indicates that this endpoint is prepared to receive traffic, according to whatever system is managing the endpoint. A nil value indicates an unknown state. In most cases consumers should interpret this unknown state as ready.", +} + +func (EndpointConditions) SwaggerDoc() map[string]string { + return map_EndpointConditions +} + +var map_EndpointPort = map[string]string{ + "": "EndpointPort represents a Port used by an EndpointSlice", + "name": "The name of this port. All ports in an EndpointSlice must have a unique name. If the EndpointSlice is dervied from a Kubernetes service, this corresponds to the Service.ports[].name. Name must either be an empty string or pass DNS_LABEL validation: * must be no more than 63 characters long. * must consist of lower case alphanumeric characters or '-'. * must start and end with an alphanumeric character. Default is empty string.", + "protocol": "The IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP.", + "port": "The port number of the endpoint. If this is not specified, ports are not restricted and must be interpreted in the context of the specific consumer.", + "appProtocol": "The application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per RFC-6335 and http://www.iana.org/assignments/service-names). Non-standard protocols should use prefixed names. Default is empty string.", +} + +func (EndpointPort) SwaggerDoc() map[string]string { + return map_EndpointPort +} + +var map_EndpointSlice = map[string]string{ + "": "EndpointSlice represents a subset of the endpoints that implement a service. For a given service there may be multiple EndpointSlice objects, selected by labels, which must be joined to produce the full set of endpoints.", + "metadata": "Standard object's metadata.", + "addressType": "addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name.", + "endpoints": "endpoints is a list of unique endpoints in this slice. Each slice may include a maximum of 1000 endpoints.", + "ports": "ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. When ports is empty, it indicates that there are no defined ports. When a port is defined with a nil port value, it indicates \"all ports\". Each slice may include a maximum of 100 ports.", +} + +func (EndpointSlice) SwaggerDoc() map[string]string { + return map_EndpointSlice +} + +var map_EndpointSliceList = map[string]string{ + "": "EndpointSliceList represents a list of endpoint slices", + "metadata": "Standard list metadata.", + "items": "List of endpoint slices", +} + +func (EndpointSliceList) SwaggerDoc() map[string]string { + return map_EndpointSliceList +} + +// AUTO-GENERATED FUNCTIONS END HERE diff --git a/vendor/k8s.io/api/discovery/v1beta1/well_known_labels.go b/vendor/k8s.io/api/discovery/v1beta1/well_known_labels.go new file mode 100644 index 0000000..b0caa3c --- /dev/null +++ b/vendor/k8s.io/api/discovery/v1beta1/well_known_labels.go @@ -0,0 +1,28 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +const ( + // LabelServiceName is used to indicate the name of a Kubernetes service. + LabelServiceName = "kubernetes.io/service-name" + // LabelManagedBy is used to indicate the controller or entity that manages + // an EndpointSlice. This label aims to enable different EndpointSlice + // objects to be managed by different controllers or entities within the + // same cluster. It is highly recommended to configure this label for all + // EndpointSlices. + LabelManagedBy = "endpointslice.kubernetes.io/managed-by" +) diff --git a/vendor/k8s.io/api/discovery/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/api/discovery/v1beta1/zz_generated.deepcopy.go new file mode 100644 index 0000000..8490ec7 --- /dev/null +++ b/vendor/k8s.io/api/discovery/v1beta1/zz_generated.deepcopy.go @@ -0,0 +1,195 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1 "k8s.io/api/core/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Endpoint) DeepCopyInto(out *Endpoint) { + *out = *in + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]string, len(*in)) + copy(*out, *in) + } + in.Conditions.DeepCopyInto(&out.Conditions) + if in.Hostname != nil { + in, out := &in.Hostname, &out.Hostname + *out = new(string) + **out = **in + } + if in.TargetRef != nil { + in, out := &in.TargetRef, &out.TargetRef + *out = new(v1.ObjectReference) + **out = **in + } + if in.Topology != nil { + in, out := &in.Topology, &out.Topology + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Endpoint. +func (in *Endpoint) DeepCopy() *Endpoint { + if in == nil { + return nil + } + out := new(Endpoint) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EndpointConditions) DeepCopyInto(out *EndpointConditions) { + *out = *in + if in.Ready != nil { + in, out := &in.Ready, &out.Ready + *out = new(bool) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EndpointConditions. +func (in *EndpointConditions) DeepCopy() *EndpointConditions { + if in == nil { + return nil + } + out := new(EndpointConditions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EndpointPort) DeepCopyInto(out *EndpointPort) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(v1.Protocol) + **out = **in + } + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(int32) + **out = **in + } + if in.AppProtocol != nil { + in, out := &in.AppProtocol, &out.AppProtocol + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EndpointPort. +func (in *EndpointPort) DeepCopy() *EndpointPort { + if in == nil { + return nil + } + out := new(EndpointPort) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EndpointSlice) DeepCopyInto(out *EndpointSlice) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + if in.Endpoints != nil { + in, out := &in.Endpoints, &out.Endpoints + *out = make([]Endpoint, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Ports != nil { + in, out := &in.Ports, &out.Ports + *out = make([]EndpointPort, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EndpointSlice. +func (in *EndpointSlice) DeepCopy() *EndpointSlice { + if in == nil { + return nil + } + out := new(EndpointSlice) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EndpointSlice) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EndpointSliceList) DeepCopyInto(out *EndpointSliceList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]EndpointSlice, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EndpointSliceList. +func (in *EndpointSliceList) DeepCopy() *EndpointSliceList { + if in == nil { + return nil + } + out := new(EndpointSliceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EndpointSliceList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} diff --git a/vendor/k8s.io/api/events/v1beta1/generated.proto b/vendor/k8s.io/api/events/v1beta1/generated.proto deleted file mode 100644 index 58f5aa4..0000000 --- a/vendor/k8s.io/api/events/v1beta1/generated.proto +++ /dev/null @@ -1,122 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.events.v1beta1; - -import "k8s.io/api/core/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1beta1"; - -// Event is a report of an event somewhere in the cluster. It generally denotes some state change in the system. -message Event { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Required. Time when this Event was first observed. - optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime eventTime = 2; - - // Data about the Event series this event represents or nil if it's a singleton Event. - // +optional - optional EventSeries series = 3; - - // Name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`. - // +optional - optional string reportingController = 4; - - // ID of the controller instance, e.g. `kubelet-xyzf`. - // +optional - optional string reportingInstance = 5; - - // What action was taken/failed regarding to the regarding object. - // +optional - optional string action = 6; - - // Why the action was taken. - optional string reason = 7; - - // The object this Event is about. In most cases it's an Object reporting controller implements. - // E.g. ReplicaSetController implements ReplicaSets and this event is emitted because - // it acts on some changes in a ReplicaSet object. - // +optional - optional k8s.io.api.core.v1.ObjectReference regarding = 8; - - // Optional secondary object for more complex actions. E.g. when regarding object triggers - // a creation or deletion of related object. - // +optional - optional k8s.io.api.core.v1.ObjectReference related = 9; - - // Optional. A human-readable description of the status of this operation. - // Maximal length of the note is 1kB, but libraries should be prepared to - // handle values up to 64kB. - // +optional - optional string note = 10; - - // Type of this event (Normal, Warning), new types could be added in the - // future. - // +optional - optional string type = 11; - - // Deprecated field assuring backward compatibility with core.v1 Event type - // +optional - optional k8s.io.api.core.v1.EventSource deprecatedSource = 12; - - // Deprecated field assuring backward compatibility with core.v1 Event type - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time deprecatedFirstTimestamp = 13; - - // Deprecated field assuring backward compatibility with core.v1 Event type - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time deprecatedLastTimestamp = 14; - - // Deprecated field assuring backward compatibility with core.v1 Event type - // +optional - optional int32 deprecatedCount = 15; -} - -// EventList is a list of Event objects. -message EventList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is a list of schema objects. - repeated Event items = 2; -} - -// EventSeries contain information on series of events, i.e. thing that was/is happening -// continuously for some time. -message EventSeries { - // Number of occurrences in this series up to the last heartbeat time - optional int32 count = 1; - - // Time when last Event from the series was seen before last heartbeat. - optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime lastObservedTime = 2; - - // Information whether this series is ongoing or finished. - // Deprecated. Planned removal for 1.18 - optional string state = 3; -} - diff --git a/vendor/k8s.io/api/extensions/v1beta1/generated.proto b/vendor/k8s.io/api/extensions/v1beta1/generated.proto deleted file mode 100644 index 6c90cb3..0000000 --- a/vendor/k8s.io/api/extensions/v1beta1/generated.proto +++ /dev/null @@ -1,1193 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.extensions.v1beta1; - -import "k8s.io/api/core/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; -import "k8s.io/apimachinery/pkg/util/intstr/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1beta1"; - -// AllowedCSIDriver represents a single inline CSI Driver that is allowed to be used. -message AllowedCSIDriver { - // Name is the registered name of the CSI driver - optional string name = 1; -} - -// AllowedFlexVolume represents a single Flexvolume that is allowed to be used. -// Deprecated: use AllowedFlexVolume from policy API Group instead. -message AllowedFlexVolume { - // driver is the name of the Flexvolume driver. - optional string driver = 1; -} - -// AllowedHostPath defines the host volume conditions that will be enabled by a policy -// for pods to use. It requires the path prefix to be defined. -// Deprecated: use AllowedHostPath from policy API Group instead. -message AllowedHostPath { - // pathPrefix is the path prefix that the host volume must match. - // It does not support `*`. - // Trailing slashes are trimmed when validating the path prefix with a host path. - // - // Examples: - // `/foo` would allow `/foo`, `/foo/` and `/foo/bar` - // `/foo` would not allow `/food` or `/etc/foo` - optional string pathPrefix = 1; - - // when set to true, will allow host volumes matching the pathPrefix only if all volume mounts are readOnly. - // +optional - optional bool readOnly = 2; -} - -// DEPRECATED - This group version of DaemonSet is deprecated by apps/v1beta2/DaemonSet. See the release notes for -// more information. -// DaemonSet represents the configuration of a daemon set. -message DaemonSet { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // The desired behavior of this daemon set. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional DaemonSetSpec spec = 2; - - // The current status of this daemon set. This data may be - // out of date by some window of time. - // Populated by the system. - // Read-only. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional DaemonSetStatus status = 3; -} - -// DaemonSetCondition describes the state of a DaemonSet at a certain point. -message DaemonSetCondition { - // Type of DaemonSet condition. - optional string type = 1; - - // Status of the condition, one of True, False, Unknown. - optional string status = 2; - - // Last time the condition transitioned from one status to another. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; - - // The reason for the condition's last transition. - // +optional - optional string reason = 4; - - // A human readable message indicating details about the transition. - // +optional - optional string message = 5; -} - -// DaemonSetList is a collection of daemon sets. -message DaemonSetList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // A list of daemon sets. - repeated DaemonSet items = 2; -} - -// DaemonSetSpec is the specification of a daemon set. -message DaemonSetSpec { - // A label query over pods that are managed by the daemon set. - // Must match in order to be controlled. - // If empty, defaulted to labels on Pod template. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; - - // An object that describes the pod that will be created. - // The DaemonSet will create exactly one copy of this pod on every node - // that matches the template's node selector (or on every node if no node - // selector is specified). - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template - optional k8s.io.api.core.v1.PodTemplateSpec template = 2; - - // An update strategy to replace existing DaemonSet pods with new pods. - // +optional - optional DaemonSetUpdateStrategy updateStrategy = 3; - - // The minimum number of seconds for which a newly created DaemonSet pod should - // be ready without any of its container crashing, for it to be considered - // available. Defaults to 0 (pod will be considered available as soon as it - // is ready). - // +optional - optional int32 minReadySeconds = 4; - - // DEPRECATED. - // A sequence number representing a specific generation of the template. - // Populated by the system. It can be set only during the creation. - // +optional - optional int64 templateGeneration = 5; - - // The number of old history to retain to allow rollback. - // This is a pointer to distinguish between explicit zero and not specified. - // Defaults to 10. - // +optional - optional int32 revisionHistoryLimit = 6; -} - -// DaemonSetStatus represents the current status of a daemon set. -message DaemonSetStatus { - // The number of nodes that are running at least 1 - // daemon pod and are supposed to run the daemon pod. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ - optional int32 currentNumberScheduled = 1; - - // The number of nodes that are running the daemon pod, but are - // not supposed to run the daemon pod. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ - optional int32 numberMisscheduled = 2; - - // The total number of nodes that should be running the daemon - // pod (including nodes correctly running the daemon pod). - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ - optional int32 desiredNumberScheduled = 3; - - // The number of nodes that should be running the daemon pod and have one - // or more of the daemon pod running and ready. - optional int32 numberReady = 4; - - // The most recent generation observed by the daemon set controller. - // +optional - optional int64 observedGeneration = 5; - - // The total number of nodes that are running updated daemon pod - // +optional - optional int32 updatedNumberScheduled = 6; - - // The number of nodes that should be running the - // daemon pod and have one or more of the daemon pod running and - // available (ready for at least spec.minReadySeconds) - // +optional - optional int32 numberAvailable = 7; - - // The number of nodes that should be running the - // daemon pod and have none of the daemon pod running and available - // (ready for at least spec.minReadySeconds) - // +optional - optional int32 numberUnavailable = 8; - - // Count of hash collisions for the DaemonSet. The DaemonSet controller - // uses this field as a collision avoidance mechanism when it needs to - // create the name for the newest ControllerRevision. - // +optional - optional int32 collisionCount = 9; - - // Represents the latest available observations of a DaemonSet's current state. - // +optional - // +patchMergeKey=type - // +patchStrategy=merge - repeated DaemonSetCondition conditions = 10; -} - -message DaemonSetUpdateStrategy { - // Type of daemon set update. Can be "RollingUpdate" or "OnDelete". - // Default is OnDelete. - // +optional - optional string type = 1; - - // Rolling update config params. Present only if type = "RollingUpdate". - // --- - // TODO: Update this to follow our convention for oneOf, whatever we decide it - // to be. Same as Deployment `strategy.rollingUpdate`. - // See https://github.com/kubernetes/kubernetes/issues/35345 - // +optional - optional RollingUpdateDaemonSet rollingUpdate = 2; -} - -// DEPRECATED - This group version of Deployment is deprecated by apps/v1beta2/Deployment. See the release notes for -// more information. -// Deployment enables declarative updates for Pods and ReplicaSets. -message Deployment { - // Standard object metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Specification of the desired behavior of the Deployment. - // +optional - optional DeploymentSpec spec = 2; - - // Most recently observed status of the Deployment. - // +optional - optional DeploymentStatus status = 3; -} - -// DeploymentCondition describes the state of a deployment at a certain point. -message DeploymentCondition { - // Type of deployment condition. - optional string type = 1; - - // Status of the condition, one of True, False, Unknown. - optional string status = 2; - - // The last time this condition was updated. - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 6; - - // Last time the condition transitioned from one status to another. - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 7; - - // The reason for the condition's last transition. - optional string reason = 4; - - // A human readable message indicating details about the transition. - optional string message = 5; -} - -// DeploymentList is a list of Deployments. -message DeploymentList { - // Standard list metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is the list of Deployments. - repeated Deployment items = 2; -} - -// DEPRECATED. -// DeploymentRollback stores the information required to rollback a deployment. -message DeploymentRollback { - // Required: This must match the Name of a deployment. - optional string name = 1; - - // The annotations to be updated to a deployment - // +optional - map updatedAnnotations = 2; - - // The config of this deployment rollback. - optional RollbackConfig rollbackTo = 3; -} - -// DeploymentSpec is the specification of the desired behavior of the Deployment. -message DeploymentSpec { - // Number of desired pods. This is a pointer to distinguish between explicit - // zero and not specified. Defaults to 1. - // +optional - optional int32 replicas = 1; - - // Label selector for pods. Existing ReplicaSets whose pods are - // selected by this will be the ones affected by this deployment. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2; - - // Template describes the pods that will be created. - optional k8s.io.api.core.v1.PodTemplateSpec template = 3; - - // The deployment strategy to use to replace existing pods with new ones. - // +optional - // +patchStrategy=retainKeys - optional DeploymentStrategy strategy = 4; - - // Minimum number of seconds for which a newly created pod should be ready - // without any of its container crashing, for it to be considered available. - // Defaults to 0 (pod will be considered available as soon as it is ready) - // +optional - optional int32 minReadySeconds = 5; - - // The number of old ReplicaSets to retain to allow rollback. - // This is a pointer to distinguish between explicit zero and not specified. - // This is set to the max value of int32 (i.e. 2147483647) by default, which - // means "retaining all old RelicaSets". - // +optional - optional int32 revisionHistoryLimit = 6; - - // Indicates that the deployment is paused and will not be processed by the - // deployment controller. - // +optional - optional bool paused = 7; - - // DEPRECATED. - // The config this deployment is rolling back to. Will be cleared after rollback is done. - // +optional - optional RollbackConfig rollbackTo = 8; - - // The maximum time in seconds for a deployment to make progress before it - // is considered to be failed. The deployment controller will continue to - // process failed deployments and a condition with a ProgressDeadlineExceeded - // reason will be surfaced in the deployment status. Note that progress will - // not be estimated during the time a deployment is paused. This is set to - // the max value of int32 (i.e. 2147483647) by default, which means "no deadline". - // +optional - optional int32 progressDeadlineSeconds = 9; -} - -// DeploymentStatus is the most recently observed status of the Deployment. -message DeploymentStatus { - // The generation observed by the deployment controller. - // +optional - optional int64 observedGeneration = 1; - - // Total number of non-terminated pods targeted by this deployment (their labels match the selector). - // +optional - optional int32 replicas = 2; - - // Total number of non-terminated pods targeted by this deployment that have the desired template spec. - // +optional - optional int32 updatedReplicas = 3; - - // Total number of ready pods targeted by this deployment. - // +optional - optional int32 readyReplicas = 7; - - // Total number of available pods (ready for at least minReadySeconds) targeted by this deployment. - // +optional - optional int32 availableReplicas = 4; - - // Total number of unavailable pods targeted by this deployment. This is the total number of - // pods that are still required for the deployment to have 100% available capacity. They may - // either be pods that are running but not yet available or pods that still have not been created. - // +optional - optional int32 unavailableReplicas = 5; - - // Represents the latest available observations of a deployment's current state. - // +patchMergeKey=type - // +patchStrategy=merge - repeated DeploymentCondition conditions = 6; - - // Count of hash collisions for the Deployment. The Deployment controller uses this - // field as a collision avoidance mechanism when it needs to create the name for the - // newest ReplicaSet. - // +optional - optional int32 collisionCount = 8; -} - -// DeploymentStrategy describes how to replace existing pods with new ones. -message DeploymentStrategy { - // Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate. - // +optional - optional string type = 1; - - // Rolling update config params. Present only if DeploymentStrategyType = - // RollingUpdate. - // --- - // TODO: Update this to follow our convention for oneOf, whatever we decide it - // to be. - // +optional - optional RollingUpdateDeployment rollingUpdate = 2; -} - -// FSGroupStrategyOptions defines the strategy type and options used to create the strategy. -// Deprecated: use FSGroupStrategyOptions from policy API Group instead. -message FSGroupStrategyOptions { - // rule is the strategy that will dictate what FSGroup is used in the SecurityContext. - // +optional - optional string rule = 1; - - // ranges are the allowed ranges of fs groups. If you would like to force a single - // fs group then supply a single range with the same start and end. Required for MustRunAs. - // +optional - repeated IDRange ranges = 2; -} - -// HTTPIngressPath associates a path regex with a backend. Incoming urls matching -// the path are forwarded to the backend. -message HTTPIngressPath { - // Path is an extended POSIX regex as defined by IEEE Std 1003.1, - // (i.e this follows the egrep/unix syntax, not the perl syntax) - // matched against the path of an incoming request. Currently it can - // contain characters disallowed from the conventional "path" - // part of a URL as defined by RFC 3986. Paths must begin with - // a '/'. If unspecified, the path defaults to a catch all sending - // traffic to the backend. - // +optional - optional string path = 1; - - // Backend defines the referenced service endpoint to which the traffic - // will be forwarded to. - optional IngressBackend backend = 2; -} - -// HTTPIngressRuleValue is a list of http selectors pointing to backends. -// In the example: http:///? -> backend where -// where parts of the url correspond to RFC 3986, this resource will be used -// to match against everything after the last '/' and before the first '?' -// or '#'. -message HTTPIngressRuleValue { - // A collection of paths that map requests to backends. - repeated HTTPIngressPath paths = 1; -} - -// HostPortRange defines a range of host ports that will be enabled by a policy -// for pods to use. It requires both the start and end to be defined. -// Deprecated: use HostPortRange from policy API Group instead. -message HostPortRange { - // min is the start of the range, inclusive. - optional int32 min = 1; - - // max is the end of the range, inclusive. - optional int32 max = 2; -} - -// IDRange provides a min/max of an allowed range of IDs. -// Deprecated: use IDRange from policy API Group instead. -message IDRange { - // min is the start of the range, inclusive. - optional int64 min = 1; - - // max is the end of the range, inclusive. - optional int64 max = 2; -} - -// DEPRECATED 1.9 - This group version of IPBlock is deprecated by networking/v1/IPBlock. -// IPBlock describes a particular CIDR (Ex. "192.168.1.1/24") that is allowed to the pods -// matched by a NetworkPolicySpec's podSelector. The except entry describes CIDRs that should -// not be included within this rule. -message IPBlock { - // CIDR is a string representing the IP Block - // Valid examples are "192.168.1.1/24" - optional string cidr = 1; - - // Except is a slice of CIDRs that should not be included within an IP Block - // Valid examples are "192.168.1.1/24" - // Except values will be rejected if they are outside the CIDR range - // +optional - repeated string except = 2; -} - -// Ingress is a collection of rules that allow inbound connections to reach the -// endpoints defined by a backend. An Ingress can be configured to give services -// externally-reachable urls, load balance traffic, terminate SSL, offer name -// based virtual hosting etc. -// DEPRECATED - This group version of Ingress is deprecated by networking.k8s.io/v1beta1 Ingress. See the release notes for more information. -message Ingress { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec is the desired state of the Ingress. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional IngressSpec spec = 2; - - // Status is the current state of the Ingress. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional IngressStatus status = 3; -} - -// IngressBackend describes all endpoints for a given service and port. -message IngressBackend { - // Specifies the name of the referenced service. - optional string serviceName = 1; - - // Specifies the port of the referenced service. - optional k8s.io.apimachinery.pkg.util.intstr.IntOrString servicePort = 2; -} - -// IngressList is a collection of Ingress. -message IngressList { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is the list of Ingress. - repeated Ingress items = 2; -} - -// IngressRule represents the rules mapping the paths under a specified host to -// the related backend services. Incoming requests are first evaluated for a host -// match, then routed to the backend associated with the matching IngressRuleValue. -message IngressRule { - // Host is the fully qualified domain name of a network host, as defined - // by RFC 3986. Note the following deviations from the "host" part of the - // URI as defined in the RFC: - // 1. IPs are not allowed. Currently an IngressRuleValue can only apply to the - // IP in the Spec of the parent Ingress. - // 2. The `:` delimiter is not respected because ports are not allowed. - // Currently the port of an Ingress is implicitly :80 for http and - // :443 for https. - // Both these may change in the future. - // Incoming requests are matched against the host before the IngressRuleValue. - // If the host is unspecified, the Ingress routes all traffic based on the - // specified IngressRuleValue. - // +optional - optional string host = 1; - - // IngressRuleValue represents a rule to route requests for this IngressRule. - // If unspecified, the rule defaults to a http catch-all. Whether that sends - // just traffic matching the host to the default backend or all traffic to the - // default backend, is left to the controller fulfilling the Ingress. Http is - // currently the only supported IngressRuleValue. - // +optional - optional IngressRuleValue ingressRuleValue = 2; -} - -// IngressRuleValue represents a rule to apply against incoming requests. If the -// rule is satisfied, the request is routed to the specified backend. Currently -// mixing different types of rules in a single Ingress is disallowed, so exactly -// one of the following must be set. -message IngressRuleValue { - // +optional - optional HTTPIngressRuleValue http = 1; -} - -// IngressSpec describes the Ingress the user wishes to exist. -message IngressSpec { - // A default backend capable of servicing requests that don't match any - // rule. At least one of 'backend' or 'rules' must be specified. This field - // is optional to allow the loadbalancer controller or defaulting logic to - // specify a global default. - // +optional - optional IngressBackend backend = 1; - - // TLS configuration. Currently the Ingress only supports a single TLS - // port, 443. If multiple members of this list specify different hosts, they - // will be multiplexed on the same port according to the hostname specified - // through the SNI TLS extension, if the ingress controller fulfilling the - // ingress supports SNI. - // +optional - repeated IngressTLS tls = 2; - - // A list of host rules used to configure the Ingress. If unspecified, or - // no rule matches, all traffic is sent to the default backend. - // +optional - repeated IngressRule rules = 3; -} - -// IngressStatus describe the current state of the Ingress. -message IngressStatus { - // LoadBalancer contains the current status of the load-balancer. - // +optional - optional k8s.io.api.core.v1.LoadBalancerStatus loadBalancer = 1; -} - -// IngressTLS describes the transport layer security associated with an Ingress. -message IngressTLS { - // Hosts are a list of hosts included in the TLS certificate. The values in - // this list must match the name/s used in the tlsSecret. Defaults to the - // wildcard host setting for the loadbalancer controller fulfilling this - // Ingress, if left unspecified. - // +optional - repeated string hosts = 1; - - // SecretName is the name of the secret used to terminate SSL traffic on 443. - // Field is left optional to allow SSL routing based on SNI hostname alone. - // If the SNI host in a listener conflicts with the "Host" header field used - // by an IngressRule, the SNI host is used for termination and value of the - // Host header is used for routing. - // +optional - optional string secretName = 2; -} - -// DEPRECATED 1.9 - This group version of NetworkPolicy is deprecated by networking/v1/NetworkPolicy. -// NetworkPolicy describes what network traffic is allowed for a set of Pods -message NetworkPolicy { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Specification of the desired behavior for this NetworkPolicy. - // +optional - optional NetworkPolicySpec spec = 2; -} - -// DEPRECATED 1.9 - This group version of NetworkPolicyEgressRule is deprecated by networking/v1/NetworkPolicyEgressRule. -// NetworkPolicyEgressRule describes a particular set of traffic that is allowed out of pods -// matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and to. -// This type is beta-level in 1.8 -message NetworkPolicyEgressRule { - // List of destination ports for outgoing traffic. - // Each item in this list is combined using a logical OR. If this field is - // empty or missing, this rule matches all ports (traffic not restricted by port). - // If this field is present and contains at least one item, then this rule allows - // traffic only if the traffic matches at least one port in the list. - // +optional - repeated NetworkPolicyPort ports = 1; - - // List of destinations for outgoing traffic of pods selected for this rule. - // Items in this list are combined using a logical OR operation. If this field is - // empty or missing, this rule matches all destinations (traffic not restricted by - // destination). If this field is present and contains at least one item, this rule - // allows traffic only if the traffic matches at least one item in the to list. - // +optional - repeated NetworkPolicyPeer to = 2; -} - -// DEPRECATED 1.9 - This group version of NetworkPolicyIngressRule is deprecated by networking/v1/NetworkPolicyIngressRule. -// This NetworkPolicyIngressRule matches traffic if and only if the traffic matches both ports AND from. -message NetworkPolicyIngressRule { - // List of ports which should be made accessible on the pods selected for this rule. - // Each item in this list is combined using a logical OR. - // If this field is empty or missing, this rule matches all ports (traffic not restricted by port). - // If this field is present and contains at least one item, then this rule allows traffic - // only if the traffic matches at least one port in the list. - // +optional - repeated NetworkPolicyPort ports = 1; - - // List of sources which should be able to access the pods selected for this rule. - // Items in this list are combined using a logical OR operation. - // If this field is empty or missing, this rule matches all sources (traffic not restricted by source). - // If this field is present and contains at least one item, this rule allows traffic only if the - // traffic matches at least one item in the from list. - // +optional - repeated NetworkPolicyPeer from = 2; -} - -// DEPRECATED 1.9 - This group version of NetworkPolicyList is deprecated by networking/v1/NetworkPolicyList. -// Network Policy List is a list of NetworkPolicy objects. -message NetworkPolicyList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is a list of schema objects. - repeated NetworkPolicy items = 2; -} - -// DEPRECATED 1.9 - This group version of NetworkPolicyPeer is deprecated by networking/v1/NetworkPolicyPeer. -message NetworkPolicyPeer { - // This is a label selector which selects Pods. This field follows standard label - // selector semantics; if present but empty, it selects all pods. - // - // If NamespaceSelector is also set, then the NetworkPolicyPeer as a whole selects - // the Pods matching PodSelector in the Namespaces selected by NamespaceSelector. - // Otherwise it selects the Pods matching PodSelector in the policy's own Namespace. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector podSelector = 1; - - // Selects Namespaces using cluster-scoped labels. This field follows standard label - // selector semantics; if present but empty, it selects all namespaces. - // - // If PodSelector is also set, then the NetworkPolicyPeer as a whole selects - // the Pods matching PodSelector in the Namespaces selected by NamespaceSelector. - // Otherwise it selects all Pods in the Namespaces selected by NamespaceSelector. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 2; - - // IPBlock defines policy on a particular IPBlock. If this field is set then - // neither of the other fields can be. - // +optional - optional IPBlock ipBlock = 3; -} - -// DEPRECATED 1.9 - This group version of NetworkPolicyPort is deprecated by networking/v1/NetworkPolicyPort. -message NetworkPolicyPort { - // Optional. The protocol (TCP, UDP, or SCTP) which traffic must match. - // If not specified, this field defaults to TCP. - // +optional - optional string protocol = 1; - - // If specified, the port on the given protocol. This can - // either be a numerical or named port on a pod. If this field is not provided, - // this matches all port names and numbers. - // If present, only traffic on the specified protocol AND port - // will be matched. - // +optional - optional k8s.io.apimachinery.pkg.util.intstr.IntOrString port = 2; -} - -// DEPRECATED 1.9 - This group version of NetworkPolicySpec is deprecated by networking/v1/NetworkPolicySpec. -message NetworkPolicySpec { - // Selects the pods to which this NetworkPolicy object applies. The array of ingress rules - // is applied to any pods selected by this field. Multiple network policies can select the - // same set of pods. In this case, the ingress rules for each are combined additively. - // This field is NOT optional and follows standard label selector semantics. - // An empty podSelector matches all pods in this namespace. - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector podSelector = 1; - - // List of ingress rules to be applied to the selected pods. - // Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod - // OR if the traffic source is the pod's local node, - // OR if the traffic matches at least one ingress rule across all of the NetworkPolicy - // objects whose podSelector matches the pod. - // If this field is empty then this NetworkPolicy does not allow any traffic - // (and serves solely to ensure that the pods it selects are isolated by default). - // +optional - repeated NetworkPolicyIngressRule ingress = 2; - - // List of egress rules to be applied to the selected pods. Outgoing traffic is - // allowed if there are no NetworkPolicies selecting the pod (and cluster policy - // otherwise allows the traffic), OR if the traffic matches at least one egress rule - // across all of the NetworkPolicy objects whose podSelector matches the pod. If - // this field is empty then this NetworkPolicy limits all outgoing traffic (and serves - // solely to ensure that the pods it selects are isolated by default). - // This field is beta-level in 1.8 - // +optional - repeated NetworkPolicyEgressRule egress = 3; - - // List of rule types that the NetworkPolicy relates to. - // Valid options are "Ingress", "Egress", or "Ingress,Egress". - // If this field is not specified, it will default based on the existence of Ingress or Egress rules; - // policies that contain an Egress section are assumed to affect Egress, and all policies - // (whether or not they contain an Ingress section) are assumed to affect Ingress. - // If you want to write an egress-only policy, you must explicitly specify policyTypes [ "Egress" ]. - // Likewise, if you want to write a policy that specifies that no egress is allowed, - // you must specify a policyTypes value that include "Egress" (since such a policy would not include - // an Egress section and would otherwise default to just [ "Ingress" ]). - // This field is beta-level in 1.8 - // +optional - repeated string policyTypes = 4; -} - -// PodSecurityPolicy governs the ability to make requests that affect the Security Context -// that will be applied to a pod and container. -// Deprecated: use PodSecurityPolicy from policy API Group instead. -message PodSecurityPolicy { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // spec defines the policy enforced. - // +optional - optional PodSecurityPolicySpec spec = 2; -} - -// PodSecurityPolicyList is a list of PodSecurityPolicy objects. -// Deprecated: use PodSecurityPolicyList from policy API Group instead. -message PodSecurityPolicyList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // items is a list of schema objects. - repeated PodSecurityPolicy items = 2; -} - -// PodSecurityPolicySpec defines the policy enforced. -// Deprecated: use PodSecurityPolicySpec from policy API Group instead. -message PodSecurityPolicySpec { - // privileged determines if a pod can request to be run as privileged. - // +optional - optional bool privileged = 1; - - // defaultAddCapabilities is the default set of capabilities that will be added to the container - // unless the pod spec specifically drops the capability. You may not list a capability in both - // defaultAddCapabilities and requiredDropCapabilities. Capabilities added here are implicitly - // allowed, and need not be included in the allowedCapabilities list. - // +optional - repeated string defaultAddCapabilities = 2; - - // requiredDropCapabilities are the capabilities that will be dropped from the container. These - // are required to be dropped and cannot be added. - // +optional - repeated string requiredDropCapabilities = 3; - - // allowedCapabilities is a list of capabilities that can be requested to add to the container. - // Capabilities in this field may be added at the pod author's discretion. - // You must not list a capability in both allowedCapabilities and requiredDropCapabilities. - // +optional - repeated string allowedCapabilities = 4; - - // volumes is a white list of allowed volume plugins. Empty indicates that - // no volumes may be used. To allow all volumes you may use '*'. - // +optional - repeated string volumes = 5; - - // hostNetwork determines if the policy allows the use of HostNetwork in the pod spec. - // +optional - optional bool hostNetwork = 6; - - // hostPorts determines which host port ranges are allowed to be exposed. - // +optional - repeated HostPortRange hostPorts = 7; - - // hostPID determines if the policy allows the use of HostPID in the pod spec. - // +optional - optional bool hostPID = 8; - - // hostIPC determines if the policy allows the use of HostIPC in the pod spec. - // +optional - optional bool hostIPC = 9; - - // seLinux is the strategy that will dictate the allowable labels that may be set. - optional SELinuxStrategyOptions seLinux = 10; - - // runAsUser is the strategy that will dictate the allowable RunAsUser values that may be set. - optional RunAsUserStrategyOptions runAsUser = 11; - - // RunAsGroup is the strategy that will dictate the allowable RunAsGroup values that may be set. - // If this field is omitted, the pod's RunAsGroup can take any value. This field requires the - // RunAsGroup feature gate to be enabled. - // +optional - optional RunAsGroupStrategyOptions runAsGroup = 22; - - // supplementalGroups is the strategy that will dictate what supplemental groups are used by the SecurityContext. - optional SupplementalGroupsStrategyOptions supplementalGroups = 12; - - // fsGroup is the strategy that will dictate what fs group is used by the SecurityContext. - optional FSGroupStrategyOptions fsGroup = 13; - - // readOnlyRootFilesystem when set to true will force containers to run with a read only root file - // system. If the container specifically requests to run with a non-read only root file system - // the PSP should deny the pod. - // If set to false the container may run with a read only root file system if it wishes but it - // will not be forced to. - // +optional - optional bool readOnlyRootFilesystem = 14; - - // defaultAllowPrivilegeEscalation controls the default setting for whether a - // process can gain more privileges than its parent process. - // +optional - optional bool defaultAllowPrivilegeEscalation = 15; - - // allowPrivilegeEscalation determines if a pod can request to allow - // privilege escalation. If unspecified, defaults to true. - // +optional - optional bool allowPrivilegeEscalation = 16; - - // allowedHostPaths is a white list of allowed host paths. Empty indicates - // that all host paths may be used. - // +optional - repeated AllowedHostPath allowedHostPaths = 17; - - // allowedFlexVolumes is a whitelist of allowed Flexvolumes. Empty or nil indicates that all - // Flexvolumes may be used. This parameter is effective only when the usage of the Flexvolumes - // is allowed in the "volumes" field. - // +optional - repeated AllowedFlexVolume allowedFlexVolumes = 18; - - // AllowedCSIDrivers is a whitelist of inline CSI drivers that must be explicitly set to be embedded within a pod spec. - // An empty value indicates that any CSI driver can be used for inline ephemeral volumes. - // +optional - repeated AllowedCSIDriver allowedCSIDrivers = 23; - - // allowedUnsafeSysctls is a list of explicitly allowed unsafe sysctls, defaults to none. - // Each entry is either a plain sysctl name or ends in "*" in which case it is considered - // as a prefix of allowed sysctls. Single * means all unsafe sysctls are allowed. - // Kubelet has to whitelist all allowed unsafe sysctls explicitly to avoid rejection. - // - // Examples: - // e.g. "foo/*" allows "foo/bar", "foo/baz", etc. - // e.g. "foo.*" allows "foo.bar", "foo.baz", etc. - // +optional - repeated string allowedUnsafeSysctls = 19; - - // forbiddenSysctls is a list of explicitly forbidden sysctls, defaults to none. - // Each entry is either a plain sysctl name or ends in "*" in which case it is considered - // as a prefix of forbidden sysctls. Single * means all sysctls are forbidden. - // - // Examples: - // e.g. "foo/*" forbids "foo/bar", "foo/baz", etc. - // e.g. "foo.*" forbids "foo.bar", "foo.baz", etc. - // +optional - repeated string forbiddenSysctls = 20; - - // AllowedProcMountTypes is a whitelist of allowed ProcMountTypes. - // Empty or nil indicates that only the DefaultProcMountType may be used. - // This requires the ProcMountType feature flag to be enabled. - // +optional - repeated string allowedProcMountTypes = 21; - - // runtimeClass is the strategy that will dictate the allowable RuntimeClasses for a pod. - // If this field is omitted, the pod's runtimeClassName field is unrestricted. - // Enforcement of this field depends on the RuntimeClass feature gate being enabled. - // +optional - optional RuntimeClassStrategyOptions runtimeClass = 24; -} - -// DEPRECATED - This group version of ReplicaSet is deprecated by apps/v1beta2/ReplicaSet. See the release notes for -// more information. -// ReplicaSet ensures that a specified number of pod replicas are running at any given time. -message ReplicaSet { - // If the Labels of a ReplicaSet are empty, they are defaulted to - // be the same as the Pod(s) that the ReplicaSet manages. - // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec defines the specification of the desired behavior of the ReplicaSet. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional ReplicaSetSpec spec = 2; - - // Status is the most recently observed status of the ReplicaSet. - // This data may be out of date by some window of time. - // Populated by the system. - // Read-only. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional ReplicaSetStatus status = 3; -} - -// ReplicaSetCondition describes the state of a replica set at a certain point. -message ReplicaSetCondition { - // Type of replica set condition. - optional string type = 1; - - // Status of the condition, one of True, False, Unknown. - optional string status = 2; - - // The last time the condition transitioned from one status to another. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; - - // The reason for the condition's last transition. - // +optional - optional string reason = 4; - - // A human readable message indicating details about the transition. - // +optional - optional string message = 5; -} - -// ReplicaSetList is a collection of ReplicaSets. -message ReplicaSetList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // List of ReplicaSets. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller - repeated ReplicaSet items = 2; -} - -// ReplicaSetSpec is the specification of a ReplicaSet. -message ReplicaSetSpec { - // Replicas is the number of desired replicas. - // This is a pointer to distinguish between explicit zero and unspecified. - // Defaults to 1. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller - // +optional - optional int32 replicas = 1; - - // Minimum number of seconds for which a newly created pod should be ready - // without any of its container crashing, for it to be considered available. - // Defaults to 0 (pod will be considered available as soon as it is ready) - // +optional - optional int32 minReadySeconds = 4; - - // Selector is a label query over pods that should match the replica count. - // If the selector is empty, it is defaulted to the labels present on the pod template. - // Label keys and values that must match in order to be controlled by this replica set. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2; - - // Template is the object that describes the pod that will be created if - // insufficient replicas are detected. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template - // +optional - optional k8s.io.api.core.v1.PodTemplateSpec template = 3; -} - -// ReplicaSetStatus represents the current status of a ReplicaSet. -message ReplicaSetStatus { - // Replicas is the most recently oberved number of replicas. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller - optional int32 replicas = 1; - - // The number of pods that have labels matching the labels of the pod template of the replicaset. - // +optional - optional int32 fullyLabeledReplicas = 2; - - // The number of ready replicas for this replica set. - // +optional - optional int32 readyReplicas = 4; - - // The number of available replicas (ready for at least minReadySeconds) for this replica set. - // +optional - optional int32 availableReplicas = 5; - - // ObservedGeneration reflects the generation of the most recently observed ReplicaSet. - // +optional - optional int64 observedGeneration = 3; - - // Represents the latest available observations of a replica set's current state. - // +optional - // +patchMergeKey=type - // +patchStrategy=merge - repeated ReplicaSetCondition conditions = 6; -} - -// Dummy definition -message ReplicationControllerDummy { -} - -// DEPRECATED. -message RollbackConfig { - // The revision to rollback to. If set to 0, rollback to the last revision. - // +optional - optional int64 revision = 1; -} - -// Spec to control the desired behavior of daemon set rolling update. -message RollingUpdateDaemonSet { - // The maximum number of DaemonSet pods that can be unavailable during the - // update. Value can be an absolute number (ex: 5) or a percentage of total - // number of DaemonSet pods at the start of the update (ex: 10%). Absolute - // number is calculated from percentage by rounding up. - // This cannot be 0. - // Default value is 1. - // Example: when this is set to 30%, at most 30% of the total number of nodes - // that should be running the daemon pod (i.e. status.desiredNumberScheduled) - // can have their pods stopped for an update at any given - // time. The update starts by stopping at most 30% of those DaemonSet pods - // and then brings up new DaemonSet pods in their place. Once the new pods - // are available, it then proceeds onto other DaemonSet pods, thus ensuring - // that at least 70% of original number of DaemonSet pods are available at - // all times during the update. - // +optional - optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 1; -} - -// Spec to control the desired behavior of rolling update. -message RollingUpdateDeployment { - // The maximum number of pods that can be unavailable during the update. - // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). - // Absolute number is calculated from percentage by rounding down. - // This can not be 0 if MaxSurge is 0. - // By default, a fixed value of 1 is used. - // Example: when this is set to 30%, the old RC can be scaled down to 70% of desired pods - // immediately when the rolling update starts. Once new pods are ready, old RC - // can be scaled down further, followed by scaling up the new RC, ensuring - // that the total number of pods available at all times during the update is at - // least 70% of desired pods. - // +optional - optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 1; - - // The maximum number of pods that can be scheduled above the desired number of - // pods. - // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). - // This can not be 0 if MaxUnavailable is 0. - // Absolute number is calculated from percentage by rounding up. - // By default, a value of 1 is used. - // Example: when this is set to 30%, the new RC can be scaled up immediately when - // the rolling update starts, such that the total number of old and new pods do not exceed - // 130% of desired pods. Once old pods have been killed, - // new RC can be scaled up further, ensuring that total number of pods running - // at any time during the update is at most 130% of desired pods. - // +optional - optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxSurge = 2; -} - -// RunAsGroupStrategyOptions defines the strategy type and any options used to create the strategy. -// Deprecated: use RunAsGroupStrategyOptions from policy API Group instead. -message RunAsGroupStrategyOptions { - // rule is the strategy that will dictate the allowable RunAsGroup values that may be set. - optional string rule = 1; - - // ranges are the allowed ranges of gids that may be used. If you would like to force a single gid - // then supply a single range with the same start and end. Required for MustRunAs. - // +optional - repeated IDRange ranges = 2; -} - -// RunAsUserStrategyOptions defines the strategy type and any options used to create the strategy. -// Deprecated: use RunAsUserStrategyOptions from policy API Group instead. -message RunAsUserStrategyOptions { - // rule is the strategy that will dictate the allowable RunAsUser values that may be set. - optional string rule = 1; - - // ranges are the allowed ranges of uids that may be used. If you would like to force a single uid - // then supply a single range with the same start and end. Required for MustRunAs. - // +optional - repeated IDRange ranges = 2; -} - -// RuntimeClassStrategyOptions define the strategy that will dictate the allowable RuntimeClasses -// for a pod. -message RuntimeClassStrategyOptions { - // allowedRuntimeClassNames is a whitelist of RuntimeClass names that may be specified on a pod. - // A value of "*" means that any RuntimeClass name is allowed, and must be the only item in the - // list. An empty list requires the RuntimeClassName field to be unset. - repeated string allowedRuntimeClassNames = 1; - - // defaultRuntimeClassName is the default RuntimeClassName to set on the pod. - // The default MUST be allowed by the allowedRuntimeClassNames list. - // A value of nil does not mutate the Pod. - // +optional - optional string defaultRuntimeClassName = 2; -} - -// SELinuxStrategyOptions defines the strategy type and any options used to create the strategy. -// Deprecated: use SELinuxStrategyOptions from policy API Group instead. -message SELinuxStrategyOptions { - // rule is the strategy that will dictate the allowable labels that may be set. - optional string rule = 1; - - // seLinuxOptions required to run as; required for MustRunAs - // More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ - // +optional - optional k8s.io.api.core.v1.SELinuxOptions seLinuxOptions = 2; -} - -// represents a scaling request for a resource. -message Scale { - // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. - // +optional - optional ScaleSpec spec = 2; - - // current status of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. Read-only. - // +optional - optional ScaleStatus status = 3; -} - -// describes the attributes of a scale subresource -message ScaleSpec { - // desired number of instances for the scaled object. - // +optional - optional int32 replicas = 1; -} - -// represents the current status of a scale subresource. -message ScaleStatus { - // actual number of observed instances of the scaled object. - optional int32 replicas = 1; - - // label query over pods that should match the replicas count. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors - // +optional - map selector = 2; - - // label selector for pods that should match the replicas count. This is a serializated - // version of both map-based and more expressive set-based selectors. This is done to - // avoid introspection in the clients. The string will be in the same format as the - // query-param syntax. If the target type only supports map-based selectors, both this - // field and map-based selector field are populated. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - // +optional - optional string targetSelector = 3; -} - -// SupplementalGroupsStrategyOptions defines the strategy type and options used to create the strategy. -// Deprecated: use SupplementalGroupsStrategyOptions from policy API Group instead. -message SupplementalGroupsStrategyOptions { - // rule is the strategy that will dictate what supplemental groups is used in the SecurityContext. - // +optional - optional string rule = 1; - - // ranges are the allowed ranges of supplemental groups. If you would like to force a single - // supplemental group then supply a single range with the same start and end. Required for MustRunAs. - // +optional - repeated IDRange ranges = 2; -} - diff --git a/vendor/k8s.io/gengo/examples/set-gen/sets/empty.go b/vendor/k8s.io/api/flowcontrol/v1alpha1/doc.go similarity index 62% rename from vendor/k8s.io/gengo/examples/set-gen/sets/empty.go rename to vendor/k8s.io/api/flowcontrol/v1alpha1/doc.go index e11e622..31b8b5d 100644 --- a/vendor/k8s.io/gengo/examples/set-gen/sets/empty.go +++ b/vendor/k8s.io/api/flowcontrol/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,10 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by set-gen. DO NOT EDIT. +// +k8s:deepcopy-gen=package +// +k8s:protobuf-gen=package +// +k8s:openapi-gen=true -package sets +// +groupName=flowcontrol.apiserver.k8s.io -// Empty is public since it is used by some internal API objects for conversions between external -// string arrays and internal sets, and conversion logic requires public types today. -type Empty struct{} +// Package v1alpha1 holds api types of version v1alpha1 for group "flowcontrol.apiserver.k8s.io". +package v1alpha1 // import "k8s.io/api/flowcontrol/v1alpha1" diff --git a/vendor/k8s.io/api/flowcontrol/v1alpha1/generated.pb.go b/vendor/k8s.io/api/flowcontrol/v1alpha1/generated.pb.go new file mode 100644 index 0000000..d44ec3c --- /dev/null +++ b/vendor/k8s.io/api/flowcontrol/v1alpha1/generated.pb.go @@ -0,0 +1,5459 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: k8s.io/kubernetes/vendor/k8s.io/api/flowcontrol/v1alpha1/generated.proto + +package v1alpha1 + +import ( + fmt "fmt" + + io "io" + + proto "github.com/gogo/protobuf/proto" + + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package + +func (m *FlowDistinguisherMethod) Reset() { *m = FlowDistinguisherMethod{} } +func (*FlowDistinguisherMethod) ProtoMessage() {} +func (*FlowDistinguisherMethod) Descriptor() ([]byte, []int) { + return fileDescriptor_45ba024d525b289b, []int{0} +} +func (m *FlowDistinguisherMethod) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FlowDistinguisherMethod) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *FlowDistinguisherMethod) XXX_Merge(src proto.Message) { + xxx_messageInfo_FlowDistinguisherMethod.Merge(m, src) +} +func (m *FlowDistinguisherMethod) XXX_Size() int { + return m.Size() +} +func (m *FlowDistinguisherMethod) XXX_DiscardUnknown() { + xxx_messageInfo_FlowDistinguisherMethod.DiscardUnknown(m) +} + +var xxx_messageInfo_FlowDistinguisherMethod proto.InternalMessageInfo + +func (m *FlowSchema) Reset() { *m = FlowSchema{} } +func (*FlowSchema) ProtoMessage() {} +func (*FlowSchema) Descriptor() ([]byte, []int) { + return fileDescriptor_45ba024d525b289b, []int{1} +} +func (m *FlowSchema) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FlowSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *FlowSchema) XXX_Merge(src proto.Message) { + xxx_messageInfo_FlowSchema.Merge(m, src) +} +func (m *FlowSchema) XXX_Size() int { + return m.Size() +} +func (m *FlowSchema) XXX_DiscardUnknown() { + xxx_messageInfo_FlowSchema.DiscardUnknown(m) +} + +var xxx_messageInfo_FlowSchema proto.InternalMessageInfo + +func (m *FlowSchemaCondition) Reset() { *m = FlowSchemaCondition{} } +func (*FlowSchemaCondition) ProtoMessage() {} +func (*FlowSchemaCondition) Descriptor() ([]byte, []int) { + return fileDescriptor_45ba024d525b289b, []int{2} +} +func (m *FlowSchemaCondition) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FlowSchemaCondition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *FlowSchemaCondition) XXX_Merge(src proto.Message) { + xxx_messageInfo_FlowSchemaCondition.Merge(m, src) +} +func (m *FlowSchemaCondition) XXX_Size() int { + return m.Size() +} +func (m *FlowSchemaCondition) XXX_DiscardUnknown() { + xxx_messageInfo_FlowSchemaCondition.DiscardUnknown(m) +} + +var xxx_messageInfo_FlowSchemaCondition proto.InternalMessageInfo + +func (m *FlowSchemaList) Reset() { *m = FlowSchemaList{} } +func (*FlowSchemaList) ProtoMessage() {} +func (*FlowSchemaList) Descriptor() ([]byte, []int) { + return fileDescriptor_45ba024d525b289b, []int{3} +} +func (m *FlowSchemaList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FlowSchemaList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *FlowSchemaList) XXX_Merge(src proto.Message) { + xxx_messageInfo_FlowSchemaList.Merge(m, src) +} +func (m *FlowSchemaList) XXX_Size() int { + return m.Size() +} +func (m *FlowSchemaList) XXX_DiscardUnknown() { + xxx_messageInfo_FlowSchemaList.DiscardUnknown(m) +} + +var xxx_messageInfo_FlowSchemaList proto.InternalMessageInfo + +func (m *FlowSchemaSpec) Reset() { *m = FlowSchemaSpec{} } +func (*FlowSchemaSpec) ProtoMessage() {} +func (*FlowSchemaSpec) Descriptor() ([]byte, []int) { + return fileDescriptor_45ba024d525b289b, []int{4} +} +func (m *FlowSchemaSpec) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FlowSchemaSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *FlowSchemaSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_FlowSchemaSpec.Merge(m, src) +} +func (m *FlowSchemaSpec) XXX_Size() int { + return m.Size() +} +func (m *FlowSchemaSpec) XXX_DiscardUnknown() { + xxx_messageInfo_FlowSchemaSpec.DiscardUnknown(m) +} + +var xxx_messageInfo_FlowSchemaSpec proto.InternalMessageInfo + +func (m *FlowSchemaStatus) Reset() { *m = FlowSchemaStatus{} } +func (*FlowSchemaStatus) ProtoMessage() {} +func (*FlowSchemaStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_45ba024d525b289b, []int{5} +} +func (m *FlowSchemaStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FlowSchemaStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *FlowSchemaStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_FlowSchemaStatus.Merge(m, src) +} +func (m *FlowSchemaStatus) XXX_Size() int { + return m.Size() +} +func (m *FlowSchemaStatus) XXX_DiscardUnknown() { + xxx_messageInfo_FlowSchemaStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_FlowSchemaStatus proto.InternalMessageInfo + +func (m *GroupSubject) Reset() { *m = GroupSubject{} } +func (*GroupSubject) ProtoMessage() {} +func (*GroupSubject) Descriptor() ([]byte, []int) { + return fileDescriptor_45ba024d525b289b, []int{6} +} +func (m *GroupSubject) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GroupSubject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *GroupSubject) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupSubject.Merge(m, src) +} +func (m *GroupSubject) XXX_Size() int { + return m.Size() +} +func (m *GroupSubject) XXX_DiscardUnknown() { + xxx_messageInfo_GroupSubject.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupSubject proto.InternalMessageInfo + +func (m *LimitResponse) Reset() { *m = LimitResponse{} } +func (*LimitResponse) ProtoMessage() {} +func (*LimitResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_45ba024d525b289b, []int{7} +} +func (m *LimitResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LimitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *LimitResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_LimitResponse.Merge(m, src) +} +func (m *LimitResponse) XXX_Size() int { + return m.Size() +} +func (m *LimitResponse) XXX_DiscardUnknown() { + xxx_messageInfo_LimitResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_LimitResponse proto.InternalMessageInfo + +func (m *LimitedPriorityLevelConfiguration) Reset() { *m = LimitedPriorityLevelConfiguration{} } +func (*LimitedPriorityLevelConfiguration) ProtoMessage() {} +func (*LimitedPriorityLevelConfiguration) Descriptor() ([]byte, []int) { + return fileDescriptor_45ba024d525b289b, []int{8} +} +func (m *LimitedPriorityLevelConfiguration) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LimitedPriorityLevelConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *LimitedPriorityLevelConfiguration) XXX_Merge(src proto.Message) { + xxx_messageInfo_LimitedPriorityLevelConfiguration.Merge(m, src) +} +func (m *LimitedPriorityLevelConfiguration) XXX_Size() int { + return m.Size() +} +func (m *LimitedPriorityLevelConfiguration) XXX_DiscardUnknown() { + xxx_messageInfo_LimitedPriorityLevelConfiguration.DiscardUnknown(m) +} + +var xxx_messageInfo_LimitedPriorityLevelConfiguration proto.InternalMessageInfo + +func (m *NonResourcePolicyRule) Reset() { *m = NonResourcePolicyRule{} } +func (*NonResourcePolicyRule) ProtoMessage() {} +func (*NonResourcePolicyRule) Descriptor() ([]byte, []int) { + return fileDescriptor_45ba024d525b289b, []int{9} +} +func (m *NonResourcePolicyRule) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NonResourcePolicyRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *NonResourcePolicyRule) XXX_Merge(src proto.Message) { + xxx_messageInfo_NonResourcePolicyRule.Merge(m, src) +} +func (m *NonResourcePolicyRule) XXX_Size() int { + return m.Size() +} +func (m *NonResourcePolicyRule) XXX_DiscardUnknown() { + xxx_messageInfo_NonResourcePolicyRule.DiscardUnknown(m) +} + +var xxx_messageInfo_NonResourcePolicyRule proto.InternalMessageInfo + +func (m *PolicyRulesWithSubjects) Reset() { *m = PolicyRulesWithSubjects{} } +func (*PolicyRulesWithSubjects) ProtoMessage() {} +func (*PolicyRulesWithSubjects) Descriptor() ([]byte, []int) { + return fileDescriptor_45ba024d525b289b, []int{10} +} +func (m *PolicyRulesWithSubjects) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PolicyRulesWithSubjects) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PolicyRulesWithSubjects) XXX_Merge(src proto.Message) { + xxx_messageInfo_PolicyRulesWithSubjects.Merge(m, src) +} +func (m *PolicyRulesWithSubjects) XXX_Size() int { + return m.Size() +} +func (m *PolicyRulesWithSubjects) XXX_DiscardUnknown() { + xxx_messageInfo_PolicyRulesWithSubjects.DiscardUnknown(m) +} + +var xxx_messageInfo_PolicyRulesWithSubjects proto.InternalMessageInfo + +func (m *PriorityLevelConfiguration) Reset() { *m = PriorityLevelConfiguration{} } +func (*PriorityLevelConfiguration) ProtoMessage() {} +func (*PriorityLevelConfiguration) Descriptor() ([]byte, []int) { + return fileDescriptor_45ba024d525b289b, []int{11} +} +func (m *PriorityLevelConfiguration) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PriorityLevelConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PriorityLevelConfiguration) XXX_Merge(src proto.Message) { + xxx_messageInfo_PriorityLevelConfiguration.Merge(m, src) +} +func (m *PriorityLevelConfiguration) XXX_Size() int { + return m.Size() +} +func (m *PriorityLevelConfiguration) XXX_DiscardUnknown() { + xxx_messageInfo_PriorityLevelConfiguration.DiscardUnknown(m) +} + +var xxx_messageInfo_PriorityLevelConfiguration proto.InternalMessageInfo + +func (m *PriorityLevelConfigurationCondition) Reset() { *m = PriorityLevelConfigurationCondition{} } +func (*PriorityLevelConfigurationCondition) ProtoMessage() {} +func (*PriorityLevelConfigurationCondition) Descriptor() ([]byte, []int) { + return fileDescriptor_45ba024d525b289b, []int{12} +} +func (m *PriorityLevelConfigurationCondition) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PriorityLevelConfigurationCondition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PriorityLevelConfigurationCondition) XXX_Merge(src proto.Message) { + xxx_messageInfo_PriorityLevelConfigurationCondition.Merge(m, src) +} +func (m *PriorityLevelConfigurationCondition) XXX_Size() int { + return m.Size() +} +func (m *PriorityLevelConfigurationCondition) XXX_DiscardUnknown() { + xxx_messageInfo_PriorityLevelConfigurationCondition.DiscardUnknown(m) +} + +var xxx_messageInfo_PriorityLevelConfigurationCondition proto.InternalMessageInfo + +func (m *PriorityLevelConfigurationList) Reset() { *m = PriorityLevelConfigurationList{} } +func (*PriorityLevelConfigurationList) ProtoMessage() {} +func (*PriorityLevelConfigurationList) Descriptor() ([]byte, []int) { + return fileDescriptor_45ba024d525b289b, []int{13} +} +func (m *PriorityLevelConfigurationList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PriorityLevelConfigurationList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PriorityLevelConfigurationList) XXX_Merge(src proto.Message) { + xxx_messageInfo_PriorityLevelConfigurationList.Merge(m, src) +} +func (m *PriorityLevelConfigurationList) XXX_Size() int { + return m.Size() +} +func (m *PriorityLevelConfigurationList) XXX_DiscardUnknown() { + xxx_messageInfo_PriorityLevelConfigurationList.DiscardUnknown(m) +} + +var xxx_messageInfo_PriorityLevelConfigurationList proto.InternalMessageInfo + +func (m *PriorityLevelConfigurationReference) Reset() { *m = PriorityLevelConfigurationReference{} } +func (*PriorityLevelConfigurationReference) ProtoMessage() {} +func (*PriorityLevelConfigurationReference) Descriptor() ([]byte, []int) { + return fileDescriptor_45ba024d525b289b, []int{14} +} +func (m *PriorityLevelConfigurationReference) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PriorityLevelConfigurationReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PriorityLevelConfigurationReference) XXX_Merge(src proto.Message) { + xxx_messageInfo_PriorityLevelConfigurationReference.Merge(m, src) +} +func (m *PriorityLevelConfigurationReference) XXX_Size() int { + return m.Size() +} +func (m *PriorityLevelConfigurationReference) XXX_DiscardUnknown() { + xxx_messageInfo_PriorityLevelConfigurationReference.DiscardUnknown(m) +} + +var xxx_messageInfo_PriorityLevelConfigurationReference proto.InternalMessageInfo + +func (m *PriorityLevelConfigurationSpec) Reset() { *m = PriorityLevelConfigurationSpec{} } +func (*PriorityLevelConfigurationSpec) ProtoMessage() {} +func (*PriorityLevelConfigurationSpec) Descriptor() ([]byte, []int) { + return fileDescriptor_45ba024d525b289b, []int{15} +} +func (m *PriorityLevelConfigurationSpec) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PriorityLevelConfigurationSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PriorityLevelConfigurationSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_PriorityLevelConfigurationSpec.Merge(m, src) +} +func (m *PriorityLevelConfigurationSpec) XXX_Size() int { + return m.Size() +} +func (m *PriorityLevelConfigurationSpec) XXX_DiscardUnknown() { + xxx_messageInfo_PriorityLevelConfigurationSpec.DiscardUnknown(m) +} + +var xxx_messageInfo_PriorityLevelConfigurationSpec proto.InternalMessageInfo + +func (m *PriorityLevelConfigurationStatus) Reset() { *m = PriorityLevelConfigurationStatus{} } +func (*PriorityLevelConfigurationStatus) ProtoMessage() {} +func (*PriorityLevelConfigurationStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_45ba024d525b289b, []int{16} +} +func (m *PriorityLevelConfigurationStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PriorityLevelConfigurationStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PriorityLevelConfigurationStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_PriorityLevelConfigurationStatus.Merge(m, src) +} +func (m *PriorityLevelConfigurationStatus) XXX_Size() int { + return m.Size() +} +func (m *PriorityLevelConfigurationStatus) XXX_DiscardUnknown() { + xxx_messageInfo_PriorityLevelConfigurationStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_PriorityLevelConfigurationStatus proto.InternalMessageInfo + +func (m *QueuingConfiguration) Reset() { *m = QueuingConfiguration{} } +func (*QueuingConfiguration) ProtoMessage() {} +func (*QueuingConfiguration) Descriptor() ([]byte, []int) { + return fileDescriptor_45ba024d525b289b, []int{17} +} +func (m *QueuingConfiguration) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueuingConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueuingConfiguration) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueuingConfiguration.Merge(m, src) +} +func (m *QueuingConfiguration) XXX_Size() int { + return m.Size() +} +func (m *QueuingConfiguration) XXX_DiscardUnknown() { + xxx_messageInfo_QueuingConfiguration.DiscardUnknown(m) +} + +var xxx_messageInfo_QueuingConfiguration proto.InternalMessageInfo + +func (m *ResourcePolicyRule) Reset() { *m = ResourcePolicyRule{} } +func (*ResourcePolicyRule) ProtoMessage() {} +func (*ResourcePolicyRule) Descriptor() ([]byte, []int) { + return fileDescriptor_45ba024d525b289b, []int{18} +} +func (m *ResourcePolicyRule) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResourcePolicyRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ResourcePolicyRule) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResourcePolicyRule.Merge(m, src) +} +func (m *ResourcePolicyRule) XXX_Size() int { + return m.Size() +} +func (m *ResourcePolicyRule) XXX_DiscardUnknown() { + xxx_messageInfo_ResourcePolicyRule.DiscardUnknown(m) +} + +var xxx_messageInfo_ResourcePolicyRule proto.InternalMessageInfo + +func (m *ServiceAccountSubject) Reset() { *m = ServiceAccountSubject{} } +func (*ServiceAccountSubject) ProtoMessage() {} +func (*ServiceAccountSubject) Descriptor() ([]byte, []int) { + return fileDescriptor_45ba024d525b289b, []int{19} +} +func (m *ServiceAccountSubject) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ServiceAccountSubject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ServiceAccountSubject) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceAccountSubject.Merge(m, src) +} +func (m *ServiceAccountSubject) XXX_Size() int { + return m.Size() +} +func (m *ServiceAccountSubject) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceAccountSubject.DiscardUnknown(m) +} + +var xxx_messageInfo_ServiceAccountSubject proto.InternalMessageInfo + +func (m *Subject) Reset() { *m = Subject{} } +func (*Subject) ProtoMessage() {} +func (*Subject) Descriptor() ([]byte, []int) { + return fileDescriptor_45ba024d525b289b, []int{20} +} +func (m *Subject) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Subject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Subject) XXX_Merge(src proto.Message) { + xxx_messageInfo_Subject.Merge(m, src) +} +func (m *Subject) XXX_Size() int { + return m.Size() +} +func (m *Subject) XXX_DiscardUnknown() { + xxx_messageInfo_Subject.DiscardUnknown(m) +} + +var xxx_messageInfo_Subject proto.InternalMessageInfo + +func (m *UserSubject) Reset() { *m = UserSubject{} } +func (*UserSubject) ProtoMessage() {} +func (*UserSubject) Descriptor() ([]byte, []int) { + return fileDescriptor_45ba024d525b289b, []int{21} +} +func (m *UserSubject) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UserSubject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *UserSubject) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserSubject.Merge(m, src) +} +func (m *UserSubject) XXX_Size() int { + return m.Size() +} +func (m *UserSubject) XXX_DiscardUnknown() { + xxx_messageInfo_UserSubject.DiscardUnknown(m) +} + +var xxx_messageInfo_UserSubject proto.InternalMessageInfo + +func init() { + proto.RegisterType((*FlowDistinguisherMethod)(nil), "k8s.io.api.flowcontrol.v1alpha1.FlowDistinguisherMethod") + proto.RegisterType((*FlowSchema)(nil), "k8s.io.api.flowcontrol.v1alpha1.FlowSchema") + proto.RegisterType((*FlowSchemaCondition)(nil), "k8s.io.api.flowcontrol.v1alpha1.FlowSchemaCondition") + proto.RegisterType((*FlowSchemaList)(nil), "k8s.io.api.flowcontrol.v1alpha1.FlowSchemaList") + proto.RegisterType((*FlowSchemaSpec)(nil), "k8s.io.api.flowcontrol.v1alpha1.FlowSchemaSpec") + proto.RegisterType((*FlowSchemaStatus)(nil), "k8s.io.api.flowcontrol.v1alpha1.FlowSchemaStatus") + proto.RegisterType((*GroupSubject)(nil), "k8s.io.api.flowcontrol.v1alpha1.GroupSubject") + proto.RegisterType((*LimitResponse)(nil), "k8s.io.api.flowcontrol.v1alpha1.LimitResponse") + proto.RegisterType((*LimitedPriorityLevelConfiguration)(nil), "k8s.io.api.flowcontrol.v1alpha1.LimitedPriorityLevelConfiguration") + proto.RegisterType((*NonResourcePolicyRule)(nil), "k8s.io.api.flowcontrol.v1alpha1.NonResourcePolicyRule") + proto.RegisterType((*PolicyRulesWithSubjects)(nil), "k8s.io.api.flowcontrol.v1alpha1.PolicyRulesWithSubjects") + proto.RegisterType((*PriorityLevelConfiguration)(nil), "k8s.io.api.flowcontrol.v1alpha1.PriorityLevelConfiguration") + proto.RegisterType((*PriorityLevelConfigurationCondition)(nil), "k8s.io.api.flowcontrol.v1alpha1.PriorityLevelConfigurationCondition") + proto.RegisterType((*PriorityLevelConfigurationList)(nil), "k8s.io.api.flowcontrol.v1alpha1.PriorityLevelConfigurationList") + proto.RegisterType((*PriorityLevelConfigurationReference)(nil), "k8s.io.api.flowcontrol.v1alpha1.PriorityLevelConfigurationReference") + proto.RegisterType((*PriorityLevelConfigurationSpec)(nil), "k8s.io.api.flowcontrol.v1alpha1.PriorityLevelConfigurationSpec") + proto.RegisterType((*PriorityLevelConfigurationStatus)(nil), "k8s.io.api.flowcontrol.v1alpha1.PriorityLevelConfigurationStatus") + proto.RegisterType((*QueuingConfiguration)(nil), "k8s.io.api.flowcontrol.v1alpha1.QueuingConfiguration") + proto.RegisterType((*ResourcePolicyRule)(nil), "k8s.io.api.flowcontrol.v1alpha1.ResourcePolicyRule") + proto.RegisterType((*ServiceAccountSubject)(nil), "k8s.io.api.flowcontrol.v1alpha1.ServiceAccountSubject") + proto.RegisterType((*Subject)(nil), "k8s.io.api.flowcontrol.v1alpha1.Subject") + proto.RegisterType((*UserSubject)(nil), "k8s.io.api.flowcontrol.v1alpha1.UserSubject") +} + +func init() { + proto.RegisterFile("k8s.io/kubernetes/vendor/k8s.io/api/flowcontrol/v1alpha1/generated.proto", fileDescriptor_45ba024d525b289b) +} + +var fileDescriptor_45ba024d525b289b = []byte{ + // 1502 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0x4d, 0x6f, 0xdb, 0x46, + 0x13, 0x36, 0x65, 0xc9, 0xb6, 0xc6, 0x9f, 0x59, 0x27, 0xb0, 0xe0, 0x00, 0x92, 0xc3, 0x17, 0x78, + 0x93, 0xf7, 0x4d, 0x42, 0xc6, 0x69, 0x92, 0xa6, 0x08, 0x8a, 0xc0, 0x74, 0xda, 0x7c, 0xd9, 0xae, + 0xbd, 0x4e, 0x52, 0x34, 0x48, 0x81, 0xd0, 0xd4, 0x5a, 0xda, 0x58, 0x22, 0x59, 0x2e, 0xa9, 0xd4, + 0x45, 0x0e, 0x05, 0xfa, 0x07, 0xfa, 0x03, 0x72, 0xec, 0xa1, 0xe7, 0xfe, 0x82, 0x1e, 0x8d, 0xa2, + 0x87, 0x1c, 0x73, 0x12, 0x62, 0xf5, 0x5a, 0xf4, 0xdc, 0xe6, 0x54, 0xec, 0x72, 0x49, 0x8a, 0xfa, + 0xb0, 0x94, 0x1a, 0xc8, 0xa9, 0x37, 0x71, 0x3e, 0x9e, 0xd9, 0x99, 0x9d, 0x99, 0x7d, 0x04, 0x77, + 0xf6, 0xae, 0x33, 0x8d, 0x3a, 0xfa, 0x5e, 0xb0, 0x43, 0x3c, 0x9b, 0xf8, 0x84, 0xe9, 0x0d, 0x62, + 0x97, 0x1d, 0x4f, 0x97, 0x0a, 0xd3, 0xa5, 0xfa, 0x6e, 0xcd, 0x79, 0x6e, 0x39, 0xb6, 0xef, 0x39, + 0x35, 0xbd, 0xb1, 0x6c, 0xd6, 0xdc, 0xaa, 0xb9, 0xac, 0x57, 0x88, 0x4d, 0x3c, 0xd3, 0x27, 0x65, + 0xcd, 0xf5, 0x1c, 0xdf, 0x41, 0xa5, 0xd0, 0x41, 0x33, 0x5d, 0xaa, 0xb5, 0x39, 0x68, 0x91, 0xc3, + 0xe2, 0xc5, 0x0a, 0xf5, 0xab, 0xc1, 0x8e, 0x66, 0x39, 0x75, 0xbd, 0xe2, 0x54, 0x1c, 0x5d, 0xf8, + 0xed, 0x04, 0xbb, 0xe2, 0x4b, 0x7c, 0x88, 0x5f, 0x21, 0xde, 0xe2, 0x95, 0xe4, 0x00, 0x75, 0xd3, + 0xaa, 0x52, 0x9b, 0x78, 0xfb, 0xba, 0xbb, 0x57, 0xe1, 0x02, 0xa6, 0xd7, 0x89, 0x6f, 0xea, 0x8d, + 0xae, 0x53, 0x2c, 0xea, 0xfd, 0xbc, 0xbc, 0xc0, 0xf6, 0x69, 0x9d, 0x74, 0x39, 0x5c, 0x1b, 0xe4, + 0xc0, 0xac, 0x2a, 0xa9, 0x9b, 0x9d, 0x7e, 0xea, 0x63, 0x58, 0xf8, 0xb4, 0xe6, 0x3c, 0xbf, 0x45, + 0x99, 0x4f, 0xed, 0x4a, 0x40, 0x59, 0x95, 0x78, 0xeb, 0xc4, 0xaf, 0x3a, 0x65, 0x74, 0x13, 0xb2, + 0xfe, 0xbe, 0x4b, 0x0a, 0xca, 0x92, 0x72, 0x2e, 0x6f, 0x9c, 0x3f, 0x68, 0x96, 0x46, 0x5a, 0xcd, + 0x52, 0xf6, 0xc1, 0xbe, 0x4b, 0xde, 0x36, 0x4b, 0xa7, 0xfb, 0xb8, 0x71, 0x35, 0x16, 0x8e, 0xea, + 0xcb, 0x0c, 0x00, 0xb7, 0xda, 0x16, 0xa1, 0xd1, 0x53, 0x98, 0xe0, 0xe9, 0x96, 0x4d, 0xdf, 0x14, + 0x98, 0x93, 0x97, 0x2f, 0x69, 0x49, 0xb1, 0xe3, 0x53, 0x6b, 0xee, 0x5e, 0x85, 0x0b, 0x98, 0xc6, + 0xad, 0xb5, 0xc6, 0xb2, 0xf6, 0xd9, 0xce, 0x33, 0x62, 0xf9, 0xeb, 0xc4, 0x37, 0x0d, 0x24, 0x4f, + 0x01, 0x89, 0x0c, 0xc7, 0xa8, 0x68, 0x0b, 0xb2, 0xcc, 0x25, 0x56, 0x21, 0x23, 0xd0, 0x75, 0x6d, + 0xc0, 0x55, 0x6a, 0xc9, 0xe1, 0xb6, 0x5d, 0x62, 0x19, 0x53, 0x51, 0x8a, 0xfc, 0x0b, 0x0b, 0x28, + 0xf4, 0x05, 0x8c, 0x31, 0xdf, 0xf4, 0x03, 0x56, 0x18, 0x15, 0xa0, 0xcb, 0xef, 0x02, 0x2a, 0x1c, + 0x8d, 0x19, 0x09, 0x3b, 0x16, 0x7e, 0x63, 0x09, 0xa8, 0xbe, 0xce, 0xc0, 0x7c, 0x62, 0xbc, 0xea, + 0xd8, 0x65, 0xea, 0x53, 0xc7, 0x46, 0x37, 0x52, 0x75, 0x3f, 0xdb, 0x51, 0xf7, 0x85, 0x1e, 0x2e, + 0x49, 0xcd, 0xd1, 0x47, 0xf1, 0x79, 0x33, 0xc2, 0xfd, 0x4c, 0x3a, 0xf8, 0xdb, 0x66, 0x69, 0x36, + 0x76, 0x4b, 0x9f, 0x07, 0x35, 0x00, 0xd5, 0x4c, 0xe6, 0x3f, 0xf0, 0x4c, 0x9b, 0x85, 0xb0, 0xb4, + 0x4e, 0x64, 0xda, 0xff, 0x1f, 0xee, 0xa6, 0xb8, 0x87, 0xb1, 0x28, 0x43, 0xa2, 0xb5, 0x2e, 0x34, + 0xdc, 0x23, 0x02, 0xfa, 0x2f, 0x8c, 0x79, 0xc4, 0x64, 0x8e, 0x5d, 0xc8, 0x8a, 0x23, 0xc7, 0xf5, + 0xc2, 0x42, 0x8a, 0xa5, 0x16, 0xfd, 0x0f, 0xc6, 0xeb, 0x84, 0x31, 0xb3, 0x42, 0x0a, 0x39, 0x61, + 0x38, 0x2b, 0x0d, 0xc7, 0xd7, 0x43, 0x31, 0x8e, 0xf4, 0xea, 0xcf, 0x0a, 0xcc, 0x24, 0x75, 0x5a, + 0xa3, 0xcc, 0x47, 0x4f, 0xba, 0xba, 0x4f, 0x1b, 0x2e, 0x27, 0xee, 0x2d, 0x7a, 0x6f, 0x4e, 0x86, + 0x9b, 0x88, 0x24, 0x6d, 0x9d, 0xb7, 0x09, 0x39, 0xea, 0x93, 0x3a, 0xaf, 0xfa, 0xe8, 0xb9, 0xc9, + 0xcb, 0xe7, 0xdf, 0xa1, 0x4b, 0x8c, 0x69, 0x89, 0x9b, 0xbb, 0xcb, 0x11, 0x70, 0x08, 0xa4, 0xfe, + 0x3e, 0xda, 0x9e, 0x02, 0xef, 0x48, 0xf4, 0xa3, 0x02, 0x8b, 0xae, 0x47, 0x1d, 0x8f, 0xfa, 0xfb, + 0x6b, 0xa4, 0x41, 0x6a, 0xab, 0x8e, 0xbd, 0x4b, 0x2b, 0x81, 0x67, 0xf2, 0x5a, 0xca, 0xac, 0x6e, + 0x0d, 0x0c, 0xbd, 0xd9, 0x17, 0x02, 0x93, 0x5d, 0xe2, 0x11, 0xdb, 0x22, 0x86, 0x2a, 0xcf, 0xb4, + 0x78, 0x84, 0xf1, 0x11, 0x67, 0x41, 0xf7, 0x00, 0xd5, 0x4d, 0x9f, 0xd7, 0xb4, 0xb2, 0xe9, 0x11, + 0x8b, 0x94, 0x39, 0xaa, 0x68, 0xc9, 0x5c, 0xd2, 0x1f, 0xeb, 0x5d, 0x16, 0xb8, 0x87, 0x17, 0xfa, + 0x4e, 0x81, 0xf9, 0x72, 0xf7, 0xa2, 0x91, 0x9d, 0x79, 0x7d, 0xa8, 0x52, 0xf7, 0x58, 0x54, 0xc6, + 0x42, 0xab, 0x59, 0x9a, 0xef, 0xa1, 0xc0, 0xbd, 0xa2, 0xa1, 0x2f, 0x21, 0xe7, 0x05, 0x35, 0xc2, + 0x0a, 0x59, 0x71, 0xc3, 0x83, 0xc3, 0x6e, 0x3a, 0x35, 0x6a, 0xed, 0x63, 0xee, 0xf3, 0x39, 0xf5, + 0xab, 0xdb, 0x81, 0xd8, 0x58, 0x2c, 0xb9, 0x6e, 0xa1, 0xc2, 0x21, 0xaa, 0xfa, 0x02, 0xe6, 0x3a, + 0x17, 0x07, 0xaa, 0x02, 0x58, 0xd1, 0xac, 0xb2, 0x82, 0x22, 0xe2, 0x5e, 0x79, 0x87, 0xce, 0x8a, + 0x07, 0x3d, 0x59, 0x9b, 0xb1, 0x88, 0xe1, 0x36, 0x6c, 0xf5, 0x12, 0x4c, 0xdd, 0xf6, 0x9c, 0xc0, + 0x95, 0x87, 0x44, 0x4b, 0x90, 0xb5, 0xcd, 0x7a, 0xb4, 0x82, 0xe2, 0xbd, 0xb8, 0x61, 0xd6, 0x09, + 0x16, 0x1a, 0xf5, 0x07, 0x05, 0xa6, 0xd7, 0x68, 0x9d, 0xfa, 0x98, 0x30, 0xd7, 0xb1, 0x19, 0x41, + 0x57, 0x53, 0x6b, 0xeb, 0x4c, 0xc7, 0xda, 0x3a, 0x91, 0x32, 0x6e, 0x5b, 0x58, 0x4f, 0x60, 0xfc, + 0xab, 0x80, 0x04, 0xd4, 0xae, 0xc8, 0xb5, 0x7d, 0x75, 0x60, 0x86, 0x5b, 0xa1, 0x7d, 0xaa, 0xe3, + 0x8c, 0x49, 0xbe, 0x08, 0xa4, 0x06, 0x47, 0x90, 0xea, 0x1f, 0x0a, 0x9c, 0x11, 0x91, 0x49, 0xb9, + 0x7f, 0x27, 0xa3, 0x27, 0x50, 0x30, 0x19, 0x0b, 0x3c, 0x52, 0x5e, 0x75, 0x6c, 0x2b, 0xf0, 0xf8, + 0x0c, 0xec, 0x6f, 0x57, 0x4d, 0x8f, 0x30, 0x91, 0x4e, 0xce, 0x58, 0x92, 0xe9, 0x14, 0x56, 0xfa, + 0xd8, 0xe1, 0xbe, 0x08, 0x68, 0x0f, 0xa6, 0x6b, 0xed, 0xc9, 0xcb, 0x3c, 0xb5, 0x81, 0x79, 0xa6, + 0x4a, 0x66, 0x9c, 0x92, 0x47, 0x48, 0x97, 0x1d, 0xa7, 0xb1, 0xd5, 0xe7, 0x70, 0x6a, 0x83, 0x0f, + 0x32, 0x73, 0x02, 0xcf, 0x22, 0x49, 0x0f, 0xa2, 0x12, 0xe4, 0x1a, 0xc4, 0xdb, 0x09, 0xfb, 0x28, + 0x6f, 0xe4, 0x79, 0x07, 0x3e, 0xe2, 0x02, 0x1c, 0xca, 0xd1, 0xc7, 0x30, 0x6b, 0x27, 0x9e, 0x0f, + 0xf1, 0x1a, 0x2b, 0x8c, 0x09, 0xd3, 0xf9, 0x56, 0xb3, 0x34, 0xbb, 0x91, 0x56, 0xe1, 0x4e, 0x5b, + 0xf5, 0x30, 0x03, 0x0b, 0x7d, 0x5a, 0x1e, 0x3d, 0x82, 0x09, 0x26, 0x7f, 0xcb, 0x36, 0x3e, 0x37, + 0x30, 0x79, 0xe9, 0x9c, 0x6c, 0xdd, 0x08, 0x0d, 0xc7, 0x58, 0xc8, 0x85, 0x69, 0x4f, 0x9e, 0x41, + 0x04, 0x95, 0xdb, 0xf7, 0x83, 0x81, 0xe0, 0xdd, 0xf5, 0x49, 0xca, 0x8b, 0xdb, 0x11, 0x71, 0x3a, + 0x00, 0x7a, 0x01, 0x73, 0x6d, 0x89, 0x87, 0x41, 0x47, 0x45, 0xd0, 0x6b, 0x03, 0x83, 0xf6, 0xbc, + 0x17, 0xa3, 0x20, 0xe3, 0xce, 0x6d, 0x74, 0xe0, 0xe2, 0xae, 0x48, 0xea, 0xaf, 0x19, 0x38, 0x62, + 0x21, 0xbf, 0x07, 0x82, 0x65, 0xa6, 0x08, 0xd6, 0xcd, 0x63, 0x3c, 0x35, 0x7d, 0x09, 0x17, 0xed, + 0x20, 0x5c, 0x2b, 0xc7, 0x09, 0x72, 0x34, 0x01, 0xfb, 0x33, 0x03, 0xff, 0xe9, 0xef, 0x9c, 0x10, + 0xb2, 0xfb, 0xa9, 0xcd, 0xf6, 0x61, 0xc7, 0x66, 0x3b, 0x3b, 0x04, 0xc4, 0xbf, 0x04, 0xad, 0x83, + 0xa0, 0xbd, 0x51, 0xa0, 0xd8, 0xbf, 0x6e, 0xef, 0x81, 0xb0, 0x3d, 0x4d, 0x13, 0xb6, 0x1b, 0xc7, + 0xe8, 0xb2, 0x3e, 0x04, 0xee, 0xf6, 0x51, 0xcd, 0x15, 0x33, 0xad, 0x21, 0x9e, 0xda, 0x83, 0x23, + 0x6b, 0x25, 0x98, 0xe1, 0x80, 0xbf, 0x0c, 0x29, 0xef, 0x4f, 0x6c, 0x73, 0xa7, 0x46, 0xea, 0xc4, + 0xf6, 0x65, 0x47, 0x52, 0x18, 0xaf, 0x85, 0x4f, 0xa4, 0x9c, 0x6b, 0x63, 0xb8, 0x97, 0xe9, 0xa8, + 0x27, 0x35, 0x7c, 0x8e, 0xa5, 0x19, 0x8e, 0xf0, 0xd5, 0x97, 0x0a, 0x2c, 0x0d, 0x1a, 0x57, 0xf4, + 0x75, 0x0f, 0xda, 0x73, 0x1c, 0x56, 0x3b, 0x3c, 0x0d, 0xfa, 0x49, 0x81, 0x93, 0xbd, 0xc8, 0x05, + 0x9f, 0x00, 0xce, 0x28, 0x62, 0x3a, 0x10, 0x4f, 0xc0, 0x96, 0x90, 0x62, 0xa9, 0x45, 0x17, 0x60, + 0xa2, 0x6a, 0xda, 0xe5, 0x6d, 0xfa, 0x4d, 0x44, 0x76, 0xe3, 0x1e, 0xbc, 0x23, 0xe5, 0x38, 0xb6, + 0x40, 0xb7, 0x60, 0x4e, 0xf8, 0xad, 0x11, 0xbb, 0xe2, 0x57, 0x45, 0xb1, 0xc4, 0x34, 0xe7, 0x92, + 0x47, 0x61, 0xab, 0x43, 0x8f, 0xbb, 0x3c, 0xd4, 0xbf, 0x14, 0x40, 0xff, 0xe4, 0xbd, 0x3f, 0x0f, + 0x79, 0xd3, 0xa5, 0x82, 0xf6, 0x85, 0x53, 0x90, 0x37, 0xa6, 0x5b, 0xcd, 0x52, 0x7e, 0x65, 0xf3, + 0x6e, 0x28, 0xc4, 0x89, 0x9e, 0x1b, 0x47, 0x0f, 0x61, 0xf8, 0xe0, 0x49, 0xe3, 0x28, 0x30, 0xc3, + 0x89, 0x1e, 0x5d, 0x87, 0x29, 0xab, 0x16, 0x30, 0x9f, 0x78, 0xdb, 0x96, 0xe3, 0x12, 0xb1, 0x35, + 0x26, 0x8c, 0x93, 0x32, 0xa7, 0xa9, 0xd5, 0x36, 0x1d, 0x4e, 0x59, 0x22, 0x0d, 0x80, 0xb7, 0x3c, + 0x73, 0x4d, 0x1e, 0x27, 0x27, 0xe2, 0xcc, 0xf0, 0x0b, 0xdb, 0x88, 0xa5, 0xb8, 0xcd, 0x42, 0x7d, + 0x06, 0xa7, 0xb6, 0x89, 0xd7, 0xa0, 0x16, 0x59, 0xb1, 0x2c, 0x27, 0xb0, 0xfd, 0x88, 0xc0, 0xea, + 0x90, 0x8f, 0xcd, 0xe4, 0x54, 0x9c, 0x90, 0xf1, 0xf3, 0x31, 0x16, 0x4e, 0x6c, 0xe2, 0x31, 0xcc, + 0xf4, 0x1d, 0xc3, 0x5f, 0x32, 0x30, 0x9e, 0xc0, 0x67, 0xf7, 0xa8, 0x5d, 0x96, 0xc8, 0xa7, 0x23, + 0xeb, 0xfb, 0xd4, 0x2e, 0xbf, 0x6d, 0x96, 0x26, 0xa5, 0x19, 0xff, 0xc4, 0xc2, 0x10, 0xdd, 0x83, + 0x6c, 0xc0, 0x88, 0x27, 0x07, 0xec, 0xc2, 0xc0, 0x6e, 0x7e, 0xc8, 0x88, 0x17, 0x31, 0xa0, 0x09, + 0x0e, 0xcd, 0x05, 0x58, 0x60, 0xa0, 0x0d, 0xc8, 0x55, 0xf8, 0xad, 0xc8, 0xcd, 0x7f, 0x71, 0x20, + 0x58, 0x3b, 0xb5, 0x0f, 0x1b, 0x41, 0x48, 0x70, 0x08, 0x83, 0x3c, 0x98, 0x61, 0xa9, 0x22, 0x8a, + 0x0b, 0x1b, 0x86, 0xd1, 0xf4, 0xac, 0xbd, 0x81, 0x5a, 0xcd, 0xd2, 0x4c, 0x5a, 0x85, 0x3b, 0x22, + 0xa8, 0x3a, 0x4c, 0xb6, 0xa5, 0x38, 0x78, 0x09, 0x1a, 0xda, 0xc1, 0x61, 0x71, 0xe4, 0xd5, 0x61, + 0x71, 0xe4, 0xf5, 0x61, 0x71, 0xe4, 0xdb, 0x56, 0x51, 0x39, 0x68, 0x15, 0x95, 0x57, 0xad, 0xa2, + 0xf2, 0xba, 0x55, 0x54, 0xde, 0xb4, 0x8a, 0xca, 0xf7, 0xbf, 0x15, 0x47, 0x1e, 0x4f, 0x44, 0x47, + 0xfb, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xe7, 0xb3, 0x17, 0x48, 0x11, 0x14, 0x00, 0x00, +} + +func (m *FlowDistinguisherMethod) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FlowDistinguisherMethod) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FlowDistinguisherMethod) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *FlowSchema) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FlowSchema) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FlowSchema) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *FlowSchemaCondition) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FlowSchemaCondition) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FlowSchemaCondition) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x2a + i -= len(m.Reason) + copy(dAtA[i:], m.Reason) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Reason))) + i-- + dAtA[i] = 0x22 + { + size, err := m.LastTransitionTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + i -= len(m.Status) + copy(dAtA[i:], m.Status) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Status))) + i-- + dAtA[i] = 0x12 + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *FlowSchemaList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FlowSchemaList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FlowSchemaList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *FlowSchemaSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FlowSchemaSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FlowSchemaSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Rules) > 0 { + for iNdEx := len(m.Rules) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Rules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.DistinguisherMethod != nil { + { + size, err := m.DistinguisherMethod.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + i = encodeVarintGenerated(dAtA, i, uint64(m.MatchingPrecedence)) + i-- + dAtA[i] = 0x10 + { + size, err := m.PriorityLevelConfiguration.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *FlowSchemaStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FlowSchemaStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FlowSchemaStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Conditions) > 0 { + for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Conditions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *GroupSubject) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GroupSubject) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GroupSubject) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *LimitResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LimitResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LimitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Queuing != nil { + { + size, err := m.Queuing.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *LimitedPriorityLevelConfiguration) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LimitedPriorityLevelConfiguration) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LimitedPriorityLevelConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.LimitResponse.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i = encodeVarintGenerated(dAtA, i, uint64(m.AssuredConcurrencyShares)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} + +func (m *NonResourcePolicyRule) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NonResourcePolicyRule) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NonResourcePolicyRule) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.NonResourceURLs) > 0 { + for iNdEx := len(m.NonResourceURLs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NonResourceURLs[iNdEx]) + copy(dAtA[i:], m.NonResourceURLs[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.NonResourceURLs[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(m.Verbs) > 0 { + for iNdEx := len(m.Verbs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Verbs[iNdEx]) + copy(dAtA[i:], m.Verbs[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Verbs[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *PolicyRulesWithSubjects) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PolicyRulesWithSubjects) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PolicyRulesWithSubjects) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.NonResourceRules) > 0 { + for iNdEx := len(m.NonResourceRules) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.NonResourceRules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.ResourceRules) > 0 { + for iNdEx := len(m.ResourceRules) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ResourceRules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Subjects) > 0 { + for iNdEx := len(m.Subjects) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Subjects[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *PriorityLevelConfiguration) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PriorityLevelConfiguration) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PriorityLevelConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PriorityLevelConfigurationCondition) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PriorityLevelConfigurationCondition) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PriorityLevelConfigurationCondition) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x2a + i -= len(m.Reason) + copy(dAtA[i:], m.Reason) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Reason))) + i-- + dAtA[i] = 0x22 + { + size, err := m.LastTransitionTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + i -= len(m.Status) + copy(dAtA[i:], m.Status) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Status))) + i-- + dAtA[i] = 0x12 + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PriorityLevelConfigurationList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PriorityLevelConfigurationList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PriorityLevelConfigurationList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PriorityLevelConfigurationReference) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PriorityLevelConfigurationReference) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PriorityLevelConfigurationReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PriorityLevelConfigurationSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PriorityLevelConfigurationSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PriorityLevelConfigurationSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Limited != nil { + { + size, err := m.Limited.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PriorityLevelConfigurationStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PriorityLevelConfigurationStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PriorityLevelConfigurationStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Conditions) > 0 { + for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Conditions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueuingConfiguration) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueuingConfiguration) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueuingConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.QueueLengthLimit)) + i-- + dAtA[i] = 0x18 + i = encodeVarintGenerated(dAtA, i, uint64(m.HandSize)) + i-- + dAtA[i] = 0x10 + i = encodeVarintGenerated(dAtA, i, uint64(m.Queues)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} + +func (m *ResourcePolicyRule) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ResourcePolicyRule) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResourcePolicyRule) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Namespaces) > 0 { + for iNdEx := len(m.Namespaces) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Namespaces[iNdEx]) + copy(dAtA[i:], m.Namespaces[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Namespaces[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + i-- + if m.ClusterScope { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + if len(m.Resources) > 0 { + for iNdEx := len(m.Resources) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Resources[iNdEx]) + copy(dAtA[i:], m.Resources[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Resources[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.APIGroups) > 0 { + for iNdEx := len(m.APIGroups) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.APIGroups[iNdEx]) + copy(dAtA[i:], m.APIGroups[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.APIGroups[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Verbs) > 0 { + for iNdEx := len(m.Verbs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Verbs[iNdEx]) + copy(dAtA[i:], m.Verbs[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Verbs[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ServiceAccountSubject) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ServiceAccountSubject) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceAccountSubject) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + i -= len(m.Namespace) + copy(dAtA[i:], m.Namespace) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Namespace))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Subject) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Subject) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Subject) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ServiceAccount != nil { + { + size, err := m.ServiceAccount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Group != nil { + { + size, err := m.Group.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.User != nil { + { + size, err := m.User.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *UserSubject) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UserSubject) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UserSubject) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { + offset -= sovGenerated(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *FlowDistinguisherMethod) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Type) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *FlowSchema) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *FlowSchemaCondition) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Type) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Status) + n += 1 + l + sovGenerated(uint64(l)) + l = m.LastTransitionTime.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Reason) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Message) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *FlowSchemaList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *FlowSchemaSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.PriorityLevelConfiguration.Size() + n += 1 + l + sovGenerated(uint64(l)) + n += 1 + sovGenerated(uint64(m.MatchingPrecedence)) + if m.DistinguisherMethod != nil { + l = m.DistinguisherMethod.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Rules) > 0 { + for _, e := range m.Rules { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *FlowSchemaStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Conditions) > 0 { + for _, e := range m.Conditions { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *GroupSubject) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *LimitResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Type) + n += 1 + l + sovGenerated(uint64(l)) + if m.Queuing != nil { + l = m.Queuing.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *LimitedPriorityLevelConfiguration) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovGenerated(uint64(m.AssuredConcurrencyShares)) + l = m.LimitResponse.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *NonResourcePolicyRule) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Verbs) > 0 { + for _, s := range m.Verbs { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.NonResourceURLs) > 0 { + for _, s := range m.NonResourceURLs { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *PolicyRulesWithSubjects) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Subjects) > 0 { + for _, e := range m.Subjects { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.ResourceRules) > 0 { + for _, e := range m.ResourceRules { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.NonResourceRules) > 0 { + for _, e := range m.NonResourceRules { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *PriorityLevelConfiguration) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *PriorityLevelConfigurationCondition) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Type) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Status) + n += 1 + l + sovGenerated(uint64(l)) + l = m.LastTransitionTime.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Reason) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Message) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *PriorityLevelConfigurationList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *PriorityLevelConfigurationReference) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *PriorityLevelConfigurationSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Type) + n += 1 + l + sovGenerated(uint64(l)) + if m.Limited != nil { + l = m.Limited.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *PriorityLevelConfigurationStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Conditions) > 0 { + for _, e := range m.Conditions { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *QueuingConfiguration) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovGenerated(uint64(m.Queues)) + n += 1 + sovGenerated(uint64(m.HandSize)) + n += 1 + sovGenerated(uint64(m.QueueLengthLimit)) + return n +} + +func (m *ResourcePolicyRule) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Verbs) > 0 { + for _, s := range m.Verbs { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.APIGroups) > 0 { + for _, s := range m.APIGroups { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Resources) > 0 { + for _, s := range m.Resources { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + n += 2 + if len(m.Namespaces) > 0 { + for _, s := range m.Namespaces { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *ServiceAccountSubject) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Namespace) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *Subject) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Kind) + n += 1 + l + sovGenerated(uint64(l)) + if m.User != nil { + l = m.User.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Group != nil { + l = m.Group.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ServiceAccount != nil { + l = m.ServiceAccount.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *UserSubject) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func sovGenerated(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenerated(x uint64) (n int) { + return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *FlowDistinguisherMethod) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&FlowDistinguisherMethod{`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `}`, + }, "") + return s +} +func (this *FlowSchema) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&FlowSchema{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "FlowSchemaSpec", "FlowSchemaSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "FlowSchemaStatus", "FlowSchemaStatus", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *FlowSchemaCondition) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&FlowSchemaCondition{`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `Status:` + fmt.Sprintf("%v", this.Status) + `,`, + `LastTransitionTime:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.LastTransitionTime), "Time", "v1.Time", 1), `&`, ``, 1) + `,`, + `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, + `Message:` + fmt.Sprintf("%v", this.Message) + `,`, + `}`, + }, "") + return s +} +func (this *FlowSchemaList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]FlowSchema{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "FlowSchema", "FlowSchema", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&FlowSchemaList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *FlowSchemaSpec) String() string { + if this == nil { + return "nil" + } + repeatedStringForRules := "[]PolicyRulesWithSubjects{" + for _, f := range this.Rules { + repeatedStringForRules += strings.Replace(strings.Replace(f.String(), "PolicyRulesWithSubjects", "PolicyRulesWithSubjects", 1), `&`, ``, 1) + "," + } + repeatedStringForRules += "}" + s := strings.Join([]string{`&FlowSchemaSpec{`, + `PriorityLevelConfiguration:` + strings.Replace(strings.Replace(this.PriorityLevelConfiguration.String(), "PriorityLevelConfigurationReference", "PriorityLevelConfigurationReference", 1), `&`, ``, 1) + `,`, + `MatchingPrecedence:` + fmt.Sprintf("%v", this.MatchingPrecedence) + `,`, + `DistinguisherMethod:` + strings.Replace(this.DistinguisherMethod.String(), "FlowDistinguisherMethod", "FlowDistinguisherMethod", 1) + `,`, + `Rules:` + repeatedStringForRules + `,`, + `}`, + }, "") + return s +} +func (this *FlowSchemaStatus) String() string { + if this == nil { + return "nil" + } + repeatedStringForConditions := "[]FlowSchemaCondition{" + for _, f := range this.Conditions { + repeatedStringForConditions += strings.Replace(strings.Replace(f.String(), "FlowSchemaCondition", "FlowSchemaCondition", 1), `&`, ``, 1) + "," + } + repeatedStringForConditions += "}" + s := strings.Join([]string{`&FlowSchemaStatus{`, + `Conditions:` + repeatedStringForConditions + `,`, + `}`, + }, "") + return s +} +func (this *GroupSubject) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GroupSubject{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `}`, + }, "") + return s +} +func (this *LimitResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&LimitResponse{`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `Queuing:` + strings.Replace(this.Queuing.String(), "QueuingConfiguration", "QueuingConfiguration", 1) + `,`, + `}`, + }, "") + return s +} +func (this *LimitedPriorityLevelConfiguration) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&LimitedPriorityLevelConfiguration{`, + `AssuredConcurrencyShares:` + fmt.Sprintf("%v", this.AssuredConcurrencyShares) + `,`, + `LimitResponse:` + strings.Replace(strings.Replace(this.LimitResponse.String(), "LimitResponse", "LimitResponse", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *NonResourcePolicyRule) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&NonResourcePolicyRule{`, + `Verbs:` + fmt.Sprintf("%v", this.Verbs) + `,`, + `NonResourceURLs:` + fmt.Sprintf("%v", this.NonResourceURLs) + `,`, + `}`, + }, "") + return s +} +func (this *PolicyRulesWithSubjects) String() string { + if this == nil { + return "nil" + } + repeatedStringForSubjects := "[]Subject{" + for _, f := range this.Subjects { + repeatedStringForSubjects += strings.Replace(strings.Replace(f.String(), "Subject", "Subject", 1), `&`, ``, 1) + "," + } + repeatedStringForSubjects += "}" + repeatedStringForResourceRules := "[]ResourcePolicyRule{" + for _, f := range this.ResourceRules { + repeatedStringForResourceRules += strings.Replace(strings.Replace(f.String(), "ResourcePolicyRule", "ResourcePolicyRule", 1), `&`, ``, 1) + "," + } + repeatedStringForResourceRules += "}" + repeatedStringForNonResourceRules := "[]NonResourcePolicyRule{" + for _, f := range this.NonResourceRules { + repeatedStringForNonResourceRules += strings.Replace(strings.Replace(f.String(), "NonResourcePolicyRule", "NonResourcePolicyRule", 1), `&`, ``, 1) + "," + } + repeatedStringForNonResourceRules += "}" + s := strings.Join([]string{`&PolicyRulesWithSubjects{`, + `Subjects:` + repeatedStringForSubjects + `,`, + `ResourceRules:` + repeatedStringForResourceRules + `,`, + `NonResourceRules:` + repeatedStringForNonResourceRules + `,`, + `}`, + }, "") + return s +} +func (this *PriorityLevelConfiguration) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PriorityLevelConfiguration{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "PriorityLevelConfigurationSpec", "PriorityLevelConfigurationSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "PriorityLevelConfigurationStatus", "PriorityLevelConfigurationStatus", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *PriorityLevelConfigurationCondition) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PriorityLevelConfigurationCondition{`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `Status:` + fmt.Sprintf("%v", this.Status) + `,`, + `LastTransitionTime:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.LastTransitionTime), "Time", "v1.Time", 1), `&`, ``, 1) + `,`, + `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, + `Message:` + fmt.Sprintf("%v", this.Message) + `,`, + `}`, + }, "") + return s +} +func (this *PriorityLevelConfigurationList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]PriorityLevelConfiguration{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "PriorityLevelConfiguration", "PriorityLevelConfiguration", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&PriorityLevelConfigurationList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *PriorityLevelConfigurationReference) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PriorityLevelConfigurationReference{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `}`, + }, "") + return s +} +func (this *PriorityLevelConfigurationSpec) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PriorityLevelConfigurationSpec{`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `Limited:` + strings.Replace(this.Limited.String(), "LimitedPriorityLevelConfiguration", "LimitedPriorityLevelConfiguration", 1) + `,`, + `}`, + }, "") + return s +} +func (this *PriorityLevelConfigurationStatus) String() string { + if this == nil { + return "nil" + } + repeatedStringForConditions := "[]PriorityLevelConfigurationCondition{" + for _, f := range this.Conditions { + repeatedStringForConditions += strings.Replace(strings.Replace(f.String(), "PriorityLevelConfigurationCondition", "PriorityLevelConfigurationCondition", 1), `&`, ``, 1) + "," + } + repeatedStringForConditions += "}" + s := strings.Join([]string{`&PriorityLevelConfigurationStatus{`, + `Conditions:` + repeatedStringForConditions + `,`, + `}`, + }, "") + return s +} +func (this *QueuingConfiguration) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&QueuingConfiguration{`, + `Queues:` + fmt.Sprintf("%v", this.Queues) + `,`, + `HandSize:` + fmt.Sprintf("%v", this.HandSize) + `,`, + `QueueLengthLimit:` + fmt.Sprintf("%v", this.QueueLengthLimit) + `,`, + `}`, + }, "") + return s +} +func (this *ResourcePolicyRule) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ResourcePolicyRule{`, + `Verbs:` + fmt.Sprintf("%v", this.Verbs) + `,`, + `APIGroups:` + fmt.Sprintf("%v", this.APIGroups) + `,`, + `Resources:` + fmt.Sprintf("%v", this.Resources) + `,`, + `ClusterScope:` + fmt.Sprintf("%v", this.ClusterScope) + `,`, + `Namespaces:` + fmt.Sprintf("%v", this.Namespaces) + `,`, + `}`, + }, "") + return s +} +func (this *ServiceAccountSubject) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ServiceAccountSubject{`, + `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `}`, + }, "") + return s +} +func (this *Subject) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Subject{`, + `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, + `User:` + strings.Replace(this.User.String(), "UserSubject", "UserSubject", 1) + `,`, + `Group:` + strings.Replace(this.Group.String(), "GroupSubject", "GroupSubject", 1) + `,`, + `ServiceAccount:` + strings.Replace(this.ServiceAccount.String(), "ServiceAccountSubject", "ServiceAccountSubject", 1) + `,`, + `}`, + }, "") + return s +} +func (this *UserSubject) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&UserSubject{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `}`, + }, "") + return s +} +func valueToStringGenerated(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *FlowDistinguisherMethod) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FlowDistinguisherMethod: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FlowDistinguisherMethod: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = FlowDistinguisherMethodType(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FlowSchema) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FlowSchema: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FlowSchema: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FlowSchemaCondition) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FlowSchemaCondition: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FlowSchemaCondition: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = FlowSchemaConditionType(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Status = ConditionStatus(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastTransitionTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LastTransitionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FlowSchemaList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FlowSchemaList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FlowSchemaList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, FlowSchema{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FlowSchemaSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FlowSchemaSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FlowSchemaSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PriorityLevelConfiguration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PriorityLevelConfiguration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MatchingPrecedence", wireType) + } + m.MatchingPrecedence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MatchingPrecedence |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DistinguisherMethod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DistinguisherMethod == nil { + m.DistinguisherMethod = &FlowDistinguisherMethod{} + } + if err := m.DistinguisherMethod.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rules", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rules = append(m.Rules, PolicyRulesWithSubjects{}) + if err := m.Rules[len(m.Rules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FlowSchemaStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FlowSchemaStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FlowSchemaStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Conditions = append(m.Conditions, FlowSchemaCondition{}) + if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GroupSubject) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GroupSubject: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GroupSubject: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LimitResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LimitResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LimitResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = LimitResponseType(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Queuing", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Queuing == nil { + m.Queuing = &QueuingConfiguration{} + } + if err := m.Queuing.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LimitedPriorityLevelConfiguration) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LimitedPriorityLevelConfiguration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LimitedPriorityLevelConfiguration: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AssuredConcurrencyShares", wireType) + } + m.AssuredConcurrencyShares = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AssuredConcurrencyShares |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LimitResponse", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LimitResponse.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NonResourcePolicyRule) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NonResourcePolicyRule: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NonResourcePolicyRule: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Verbs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Verbs = append(m.Verbs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NonResourceURLs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NonResourceURLs = append(m.NonResourceURLs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PolicyRulesWithSubjects) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PolicyRulesWithSubjects: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PolicyRulesWithSubjects: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subjects", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subjects = append(m.Subjects, Subject{}) + if err := m.Subjects[len(m.Subjects)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceRules", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ResourceRules = append(m.ResourceRules, ResourcePolicyRule{}) + if err := m.ResourceRules[len(m.ResourceRules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NonResourceRules", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NonResourceRules = append(m.NonResourceRules, NonResourcePolicyRule{}) + if err := m.NonResourceRules[len(m.NonResourceRules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PriorityLevelConfiguration) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PriorityLevelConfiguration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PriorityLevelConfiguration: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PriorityLevelConfigurationCondition) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PriorityLevelConfigurationCondition: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PriorityLevelConfigurationCondition: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = PriorityLevelConfigurationConditionType(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Status = ConditionStatus(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastTransitionTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LastTransitionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PriorityLevelConfigurationList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PriorityLevelConfigurationList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PriorityLevelConfigurationList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, PriorityLevelConfiguration{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PriorityLevelConfigurationReference) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PriorityLevelConfigurationReference: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PriorityLevelConfigurationReference: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PriorityLevelConfigurationSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PriorityLevelConfigurationSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PriorityLevelConfigurationSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = PriorityLevelEnablement(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Limited", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Limited == nil { + m.Limited = &LimitedPriorityLevelConfiguration{} + } + if err := m.Limited.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PriorityLevelConfigurationStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PriorityLevelConfigurationStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PriorityLevelConfigurationStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Conditions = append(m.Conditions, PriorityLevelConfigurationCondition{}) + if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueuingConfiguration) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueuingConfiguration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueuingConfiguration: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Queues", wireType) + } + m.Queues = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Queues |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HandSize", wireType) + } + m.HandSize = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.HandSize |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field QueueLengthLimit", wireType) + } + m.QueueLengthLimit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.QueueLengthLimit |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResourcePolicyRule) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ResourcePolicyRule: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResourcePolicyRule: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Verbs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Verbs = append(m.Verbs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field APIGroups", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.APIGroups = append(m.APIGroups, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resources = append(m.Resources, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ClusterScope", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ClusterScope = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Namespaces", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Namespaces = append(m.Namespaces, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ServiceAccountSubject) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ServiceAccountSubject: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ServiceAccountSubject: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Namespace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Subject) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Subject: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Subject: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Kind = SubjectKind(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.User == nil { + m.User = &UserSubject{} + } + if err := m.User.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Group", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Group == nil { + m.Group = &GroupSubject{} + } + if err := m.Group.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceAccount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ServiceAccount == nil { + m.ServiceAccount = &ServiceAccountSubject{} + } + if err := m.ServiceAccount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UserSubject) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UserSubject: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UserSubject: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenerated(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenerated + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthGenerated + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipGenerated(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthGenerated + } + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") +) diff --git a/vendor/k8s.io/api/flowcontrol/v1alpha1/register.go b/vendor/k8s.io/api/flowcontrol/v1alpha1/register.go new file mode 100644 index 0000000..0c8a9cc --- /dev/null +++ b/vendor/k8s.io/api/flowcontrol/v1alpha1/register.go @@ -0,0 +1,58 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// GroupName is the name of api group +const GroupName = "flowcontrol.apiserver.k8s.io" + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} + +// Kind takes an unqualified kind and returns a Group qualified GroupKind +func Kind(kind string) schema.GroupKind { + return SchemeGroupVersion.WithKind(kind).GroupKind() +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + // SchemeBuilder installs the api group to a scheme + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + // AddToScheme adds api to a scheme + AddToScheme = SchemeBuilder.AddToScheme +) + +// Adds the list of known types to the given scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &FlowSchema{}, + &FlowSchemaList{}, + &PriorityLevelConfiguration{}, + &PriorityLevelConfigurationList{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/vendor/k8s.io/api/flowcontrol/v1alpha1/types.go b/vendor/k8s.io/api/flowcontrol/v1alpha1/types.go new file mode 100644 index 0000000..41073bd --- /dev/null +++ b/vendor/k8s.io/api/flowcontrol/v1alpha1/types.go @@ -0,0 +1,513 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// These are valid wildcards. +const ( + APIGroupAll = "*" + ResourceAll = "*" + VerbAll = "*" + NonResourceAll = "*" + NameAll = "*" + + NamespaceEvery = "*" // matches every particular namespace +) + +// System preset priority level names +const ( + PriorityLevelConfigurationNameExempt = "exempt" +) + +// Conditions +const ( + FlowSchemaConditionDangling = "Dangling" + + PriorityLevelConfigurationConditionConcurrencyShared = "ConcurrencyShared" +) + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with +// similar attributes and is identified by a pair of strings: the name of the FlowSchema and a "flow distinguisher". +type FlowSchema struct { + metav1.TypeMeta `json:",inline"` + // `metadata` is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + // `spec` is the specification of the desired behavior of a FlowSchema. + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status + // +optional + Spec FlowSchemaSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` + // `status` is the current status of a FlowSchema. + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status + // +optional + Status FlowSchemaStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// FlowSchemaList is a list of FlowSchema objects. +type FlowSchemaList struct { + metav1.TypeMeta `json:",inline"` + // `metadata` is the standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // `items` is a list of FlowSchemas. + // +listType=set + Items []FlowSchema `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// FlowSchemaSpec describes how the FlowSchema's specification looks like. +type FlowSchemaSpec struct { + // `priorityLevelConfiguration` should reference a PriorityLevelConfiguration in the cluster. If the reference cannot + // be resolved, the FlowSchema will be ignored and marked as invalid in its status. + // Required. + PriorityLevelConfiguration PriorityLevelConfigurationReference `json:"priorityLevelConfiguration" protobuf:"bytes,1,opt,name=priorityLevelConfiguration"` + // `matchingPrecedence` is used to choose among the FlowSchemas that match a given request. The chosen + // FlowSchema is among those with the numerically lowest (which we take to be logically highest) + // MatchingPrecedence. Each MatchingPrecedence value must be non-negative. + // Note that if the precedence is not specified or zero, it will be set to 1000 as default. + // +optional + MatchingPrecedence int32 `json:"matchingPrecedence" protobuf:"varint,2,opt,name=matchingPrecedence"` + // `distinguisherMethod` defines how to compute the flow distinguisher for requests that match this schema. + // `nil` specifies that the distinguisher is disabled and thus will always be the empty string. + // +optional + DistinguisherMethod *FlowDistinguisherMethod `json:"distinguisherMethod,omitempty" protobuf:"bytes,3,opt,name=distinguisherMethod"` + // `rules` describes which requests will match this flow schema. This FlowSchema matches a request if and only if + // at least one member of rules matches the request. + // if it is an empty slice, there will be no requests matching the FlowSchema. + // +listType=set + // +optional + Rules []PolicyRulesWithSubjects `json:"rules,omitempty" protobuf:"bytes,4,rep,name=rules"` +} + +// FlowDistinguisherMethodType is the type of flow distinguisher method +type FlowDistinguisherMethodType string + +// These are valid flow-distinguisher methods. +const ( + // FlowDistinguisherMethodByUserType specifies that the flow distinguisher is the username in the request. + // This type is used to provide some insulation between users. + FlowDistinguisherMethodByUserType FlowDistinguisherMethodType = "ByUser" + + // FlowDistinguisherMethodByNamespaceType specifies that the flow distinguisher is the namespace of the + // object that the request acts upon. If the object is not namespaced, or if the request is a non-resource + // request, then the distinguisher will be the empty string. An example usage of this type is to provide + // some insulation between tenants in a situation where there are multiple tenants and each namespace + // is dedicated to a tenant. + FlowDistinguisherMethodByNamespaceType FlowDistinguisherMethodType = "ByNamespace" +) + +// FlowDistinguisherMethod specifies the method of a flow distinguisher. +type FlowDistinguisherMethod struct { + // `type` is the type of flow distinguisher method + // The supported types are "ByUser" and "ByNamespace". + // Required. + Type FlowDistinguisherMethodType `json:"type" protobuf:"bytes,1,opt,name=type"` +} + +// PriorityLevelConfigurationReference contains information that points to the "request-priority" being used. +type PriorityLevelConfigurationReference struct { + // `name` is the name of the priority level configuration being referenced + // Required. + Name string `json:"name" protobuf:"bytes,1,opt,name=name"` +} + +// PolicyRulesWithSubjects prescribes a test that applies to a request to an apiserver. The test considers the subject +// making the request, the verb being requested, and the resource to be acted upon. This PolicyRulesWithSubjects matches +// a request if and only if both (a) at least one member of subjects matches the request and (b) at least one member +// of resourceRules or nonResourceRules matches the request. +type PolicyRulesWithSubjects struct { + // subjects is the list of normal user, serviceaccount, or group that this rule cares about. + // There must be at least one member in this slice. + // A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request. + // +listType=set + // Required. + Subjects []Subject `json:"subjects" protobuf:"bytes,1,rep,name=subjects"` + // `resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the + // target resource. + // At least one of `resourceRules` and `nonResourceRules` has to be non-empty. + // +listType=set + // +optional + ResourceRules []ResourcePolicyRule `json:"resourceRules,omitempty" protobuf:"bytes,2,opt,name=resourceRules"` + // `nonResourceRules` is a list of NonResourcePolicyRules that identify matching requests according to their verb + // and the target non-resource URL. + // +listType=set + // +optional + NonResourceRules []NonResourcePolicyRule `json:"nonResourceRules,omitempty" protobuf:"bytes,3,opt,name=nonResourceRules"` +} + +// Subject matches the originator of a request, as identified by the request authentication system. There are three +// ways of matching an originator; by user, group, or service account. +// +union +type Subject struct { + // Required + // +unionDiscriminator + Kind SubjectKind `json:"kind" protobuf:"bytes,1,opt,name=kind"` + // +optional + User *UserSubject `json:"user,omitempty" protobuf:"bytes,2,opt,name=user"` + // +optional + Group *GroupSubject `json:"group,omitempty" protobuf:"bytes,3,opt,name=group"` + // +optional + ServiceAccount *ServiceAccountSubject `json:"serviceAccount,omitempty" protobuf:"bytes,4,opt,name=serviceAccount"` +} + +// SubjectKind is the kind of subject. +type SubjectKind string + +// Supported subject's kinds. +const ( + SubjectKindUser SubjectKind = "User" + SubjectKindGroup SubjectKind = "Group" + SubjectKindServiceAccount SubjectKind = "ServiceAccount" +) + +// UserSubject holds detailed information for user-kind subject. +type UserSubject struct { + // `name` is the username that matches, or "*" to match all usernames. + // Required. + Name string `json:"name" protobuf:"bytes,1,opt,name=name"` +} + +// GroupSubject holds detailed information for group-kind subject. +type GroupSubject struct { + // name is the user group that matches, or "*" to match all user groups. + // See https://github.com/kubernetes/apiserver/blob/master/pkg/authentication/user/user.go for some + // well-known group names. + // Required. + Name string `json:"name" protobuf:"bytes,1,opt,name=name"` +} + +// ServiceAccountSubject holds detailed information for service-account-kind subject. +type ServiceAccountSubject struct { + // `namespace` is the namespace of matching ServiceAccount objects. + // Required. + Namespace string `json:"namespace" protobuf:"bytes,1,opt,name=namespace"` + // `name` is the name of matching ServiceAccount objects, or "*" to match regardless of name. + // Required. + Name string `json:"name" protobuf:"bytes,2,opt,name=name"` +} + +// ResourcePolicyRule is a predicate that matches some resource +// requests, testing the request's verb and the target resource. A +// ResourcePolicyRule matches a resource request if and only if: (a) +// at least one member of verbs matches the request, (b) at least one +// member of apiGroups matches the request, (c) at least one member of +// resources matches the request, and (d) least one member of +// namespaces matches the request. +type ResourcePolicyRule struct { + // `verbs` is a list of matching verbs and may not be empty. + // "*" matches all verbs and, if present, must be the only entry. + // +listType=set + // Required. + Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"` + + // `apiGroups` is a list of matching API groups and may not be empty. + // "*" matches all API groups and, if present, must be the only entry. + // +listType=set + // Required. + APIGroups []string `json:"apiGroups" protobuf:"bytes,2,rep,name=apiGroups"` + + // `resources` is a list of matching resources (i.e., lowercase + // and plural) with, if desired, subresource. For example, [ + // "services", "nodes/status" ]. This list may not be empty. + // "*" matches all resources and, if present, must be the only entry. + // Required. + // +listType=set + Resources []string `json:"resources" protobuf:"bytes,3,rep,name=resources"` + + // `clusterScope` indicates whether to match requests that do not + // specify a namespace (which happens either because the resource + // is not namespaced or the request targets all namespaces). + // If this field is omitted or false then the `namespaces` field + // must contain a non-empty list. + // +optional + ClusterScope bool `json:"clusterScope,omitempty" protobuf:"varint,4,opt,name=clusterScope"` + + // `namespaces` is a list of target namespaces that restricts + // matches. A request that specifies a target namespace matches + // only if either (a) this list contains that target namespace or + // (b) this list contains "*". Note that "*" matches any + // specified namespace but does not match a request that _does + // not specify_ a namespace (see the `clusterScope` field for + // that). + // This list may be empty, but only if `clusterScope` is true. + // +optional + // +listType=set + Namespaces []string `json:"namespaces" protobuf:"bytes,5,rep,name=namespaces"` +} + +// NonResourcePolicyRule is a predicate that matches non-resource requests according to their verb and the +// target non-resource URL. A NonResourcePolicyRule matches a request if and only if both (a) at least one member +// of verbs matches the request and (b) at least one member of nonResourceURLs matches the request. +type NonResourcePolicyRule struct { + // `verbs` is a list of matching verbs and may not be empty. + // "*" matches all verbs. If it is present, it must be the only entry. + // +listType=set + // Required. + Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"` + // `nonResourceURLs` is a set of url prefixes that a user should have access to and may not be empty. + // For example: + // - "/healthz" is legal + // - "/hea*" is illegal + // - "/hea" is legal but matches nothing + // - "/hea/*" also matches nothing + // - "/healthz/*" matches all per-component health checks. + // "*" matches all non-resource urls. if it is present, it must be the only entry. + // +listType=set + // Required. + NonResourceURLs []string `json:"nonResourceURLs" protobuf:"bytes,6,rep,name=nonResourceURLs"` +} + +// FlowSchemaStatus represents the current state of a FlowSchema. +type FlowSchemaStatus struct { + // `conditions` is a list of the current states of FlowSchema. + // +listType=map + // +listMapKey=type + // +optional + Conditions []FlowSchemaCondition `json:"conditions,omitempty" protobuf:"bytes,1,rep,name=conditions"` +} + +// FlowSchemaCondition describes conditions for a FlowSchema. +type FlowSchemaCondition struct { + // `type` is the type of the condition. + // Required. + Type FlowSchemaConditionType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type"` + // `status` is the status of the condition. + // Can be True, False, Unknown. + // Required. + Status ConditionStatus `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"` + // `lastTransitionTime` is the last time the condition transitioned from one status to another. + LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"` + // `reason` is a unique, one-word, CamelCase reason for the condition's last transition. + Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` + // `message` is a human-readable message indicating details about last transition. + Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` +} + +// FlowSchemaConditionType is a valid value for FlowSchemaStatusCondition.Type +type FlowSchemaConditionType string + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// PriorityLevelConfiguration represents the configuration of a priority level. +type PriorityLevelConfiguration struct { + metav1.TypeMeta `json:",inline"` + // `metadata` is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + // `spec` is the specification of the desired behavior of a "request-priority". + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status + // +optional + Spec PriorityLevelConfigurationSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` + // `status` is the current status of a "request-priority". + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status + // +optional + Status PriorityLevelConfigurationStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects. +type PriorityLevelConfigurationList struct { + metav1.TypeMeta `json:",inline"` + // `metadata` is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + // `items` is a list of request-priorities. + // +listType=set + Items []PriorityLevelConfiguration `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// PriorityLevelConfigurationSpec specifies the configuration of a priority level. +// +union +type PriorityLevelConfigurationSpec struct { + // `type` indicates whether this priority level is subject to + // limitation on request execution. A value of `"Exempt"` means + // that requests of this priority level are not subject to a limit + // (and thus are never queued) and do not detract from the + // capacity made available to other priority levels. A value of + // `"Limited"` means that (a) requests of this priority level + // _are_ subject to limits and (b) some of the server's limited + // capacity is made available exclusively to this priority level. + // Required. + // +unionDiscriminator + Type PriorityLevelEnablement `json:"type" protobuf:"bytes,1,opt,name=type"` + + // `limited` specifies how requests are handled for a Limited priority level. + // This field must be non-empty if and only if `type` is `"Limited"`. + // +optional + Limited *LimitedPriorityLevelConfiguration `json:"limited,omitempty" protobuf:"bytes,2,opt,name=limited"` +} + +// PriorityLevelEnablement indicates whether limits on execution are enabled for the priority level +type PriorityLevelEnablement string + +// Supported priority level enablement values. +const ( + // PriorityLevelEnablementExempt means that requests are not subject to limits + PriorityLevelEnablementExempt PriorityLevelEnablement = "Exempt" + + // PriorityLevelEnablementLimited means that requests are subject to limits + PriorityLevelEnablementLimited PriorityLevelEnablement = "Limited" +) + +// LimitedPriorityLevelConfiguration specifies how to handle requests that are subject to limits. +// It addresses two issues: +// * How are requests for this priority level limited? +// * What should be done with requests that exceed the limit? +type LimitedPriorityLevelConfiguration struct { + // `assuredConcurrencyShares` (ACS) configures the execution + // limit, which is a limit on the number of requests of this + // priority level that may be exeucting at a given time. ACS must + // be a positive number. The server's concurrency limit (SCL) is + // divided among the concurrency-controlled priority levels in + // proportion to their assured concurrency shares. This produces + // the assured concurrency value (ACV) --- the number of requests + // that may be executing at a time --- for each such priority + // level: + // + // ACV(l) = ceil( SCL * ACS(l) / ( sum[priority levels k] ACS(k) ) ) + // + // bigger numbers of ACS mean more reserved concurrent requests (at the + // expense of every other PL). + // This field has a default value of 30. + // +optional + AssuredConcurrencyShares int32 `json:"assuredConcurrencyShares" protobuf:"varint,1,opt,name=assuredConcurrencyShares"` + + // `limitResponse` indicates what to do with requests that can not be executed right now + LimitResponse LimitResponse `json:"limitResponse,omitempty" protobuf:"bytes,2,opt,name=limitResponse"` +} + +// LimitResponse defines how to handle requests that can not be executed right now. +// +union +type LimitResponse struct { + // `type` is "Queue" or "Reject". + // "Queue" means that requests that can not be executed upon arrival + // are held in a queue until they can be executed or a queuing limit + // is reached. + // "Reject" means that requests that can not be executed upon arrival + // are rejected. + // Required. + // +unionDiscriminator + Type LimitResponseType `json:"type" protobuf:"bytes,1,opt,name=type"` + + // `queuing` holds the configuration parameters for queuing. + // This field may be non-empty only if `type` is `"Queue"`. + // +optional + Queuing *QueuingConfiguration `json:"queuing,omitempty" protobuf:"bytes,2,opt,name=queuing"` +} + +// LimitResponseType identifies how a Limited priority level handles a request that can not be executed right now +type LimitResponseType string + +// Supported limit responses. +const ( + // LimitResponseTypeQueue means that requests that can not be executed right now are queued until they can be executed or a queuing limit is hit + LimitResponseTypeQueue LimitResponseType = "Queue" + + // LimitResponseTypeReject means that requests that can not be executed right now are rejected + LimitResponseTypeReject LimitResponseType = "Reject" +) + +// QueuingConfiguration holds the configuration parameters for queuing +type QueuingConfiguration struct { + // `queues` is the number of queues for this priority level. The + // queues exist independently at each apiserver. The value must be + // positive. Setting it to 1 effectively precludes + // shufflesharding and thus makes the distinguisher method of + // associated flow schemas irrelevant. This field has a default + // value of 64. + // +optional + Queues int32 `json:"queues" protobuf:"varint,1,opt,name=queues"` + + // `handSize` is a small positive number that configures the + // shuffle sharding of requests into queues. When enqueuing a request + // at this priority level the request's flow identifier (a string + // pair) is hashed and the hash value is used to shuffle the list + // of queues and deal a hand of the size specified here. The + // request is put into one of the shortest queues in that hand. + // `handSize` must be no larger than `queues`, and should be + // significantly smaller (so that a few heavy flows do not + // saturate most of the queues). See the user-facing + // documentation for more extensive guidance on setting this + // field. This field has a default value of 8. + // +optional + HandSize int32 `json:"handSize" protobuf:"varint,2,opt,name=handSize"` + + // `queueLengthLimit` is the maximum number of requests allowed to + // be waiting in a given queue of this priority level at a time; + // excess requests are rejected. This value must be positive. If + // not specified, it will be defaulted to 50. + // +optional + QueueLengthLimit int32 `json:"queueLengthLimit" protobuf:"varint,3,opt,name=queueLengthLimit"` +} + +// PriorityLevelConfigurationConditionType is a valid value for PriorityLevelConfigurationStatusCondition.Type +type PriorityLevelConfigurationConditionType string + +// PriorityLevelConfigurationStatus represents the current state of a "request-priority". +type PriorityLevelConfigurationStatus struct { + // `conditions` is the current state of "request-priority". + // +listType=map + // +listMapKey=type + // +optional + Conditions []PriorityLevelConfigurationCondition `json:"conditions,omitempty" protobuf:"bytes,1,rep,name=conditions"` +} + +// PriorityLevelConfigurationCondition defines the condition of priority level. +type PriorityLevelConfigurationCondition struct { + // `type` is the type of the condition. + // Required. + Type PriorityLevelConfigurationConditionType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type"` + // `status` is the status of the condition. + // Can be True, False, Unknown. + // Required. + Status ConditionStatus `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"` + // `lastTransitionTime` is the last time the condition transitioned from one status to another. + LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"` + // `reason` is a unique, one-word, CamelCase reason for the condition's last transition. + Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` + // `message` is a human-readable message indicating details about last transition. + Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` +} + +// ConditionStatus is the status of the condition. +type ConditionStatus string + +// These are valid condition statuses. "ConditionTrue" means a resource is in the condition. +// "ConditionFalse" means a resource is not in the condition. "ConditionUnknown" means kubernetes +// can't decide if a resource is in the condition or not. In the future, we could add other +// intermediate conditions, e.g. ConditionDegraded. +const ( + ConditionTrue ConditionStatus = "True" + ConditionFalse ConditionStatus = "False" + ConditionUnknown ConditionStatus = "Unknown" +) diff --git a/vendor/k8s.io/api/flowcontrol/v1alpha1/types_swagger_doc_generated.go b/vendor/k8s.io/api/flowcontrol/v1alpha1/types_swagger_doc_generated.go new file mode 100644 index 0000000..08380a1 --- /dev/null +++ b/vendor/k8s.io/api/flowcontrol/v1alpha1/types_swagger_doc_generated.go @@ -0,0 +1,258 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +// This file contains a collection of methods that can be used from go-restful to +// generate Swagger API documentation for its models. Please read this PR for more +// information on the implementation: https://github.com/emicklei/go-restful/pull/215 +// +// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if +// they are on one line! For multiple line or blocks that you want to ignore use ---. +// Any context after a --- is ignored. +// +// Those methods can be generated by using hack/update-generated-swagger-docs.sh + +// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. +var map_FlowDistinguisherMethod = map[string]string{ + "": "FlowDistinguisherMethod specifies the method of a flow distinguisher.", + "type": "`type` is the type of flow distinguisher method The supported types are \"ByUser\" and \"ByNamespace\". Required.", +} + +func (FlowDistinguisherMethod) SwaggerDoc() map[string]string { + return map_FlowDistinguisherMethod +} + +var map_FlowSchema = map[string]string{ + "": "FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with similar attributes and is identified by a pair of strings: the name of the FlowSchema and a \"flow distinguisher\".", + "metadata": "`metadata` is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", + "spec": "`spec` is the specification of the desired behavior of a FlowSchema. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", + "status": "`status` is the current status of a FlowSchema. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", +} + +func (FlowSchema) SwaggerDoc() map[string]string { + return map_FlowSchema +} + +var map_FlowSchemaCondition = map[string]string{ + "": "FlowSchemaCondition describes conditions for a FlowSchema.", + "type": "`type` is the type of the condition. Required.", + "status": "`status` is the status of the condition. Can be True, False, Unknown. Required.", + "lastTransitionTime": "`lastTransitionTime` is the last time the condition transitioned from one status to another.", + "reason": "`reason` is a unique, one-word, CamelCase reason for the condition's last transition.", + "message": "`message` is a human-readable message indicating details about last transition.", +} + +func (FlowSchemaCondition) SwaggerDoc() map[string]string { + return map_FlowSchemaCondition +} + +var map_FlowSchemaList = map[string]string{ + "": "FlowSchemaList is a list of FlowSchema objects.", + "metadata": "`metadata` is the standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", + "items": "`items` is a list of FlowSchemas.", +} + +func (FlowSchemaList) SwaggerDoc() map[string]string { + return map_FlowSchemaList +} + +var map_FlowSchemaSpec = map[string]string{ + "": "FlowSchemaSpec describes how the FlowSchema's specification looks like.", + "priorityLevelConfiguration": "`priorityLevelConfiguration` should reference a PriorityLevelConfiguration in the cluster. If the reference cannot be resolved, the FlowSchema will be ignored and marked as invalid in its status. Required.", + "matchingPrecedence": "`matchingPrecedence` is used to choose among the FlowSchemas that match a given request. The chosen FlowSchema is among those with the numerically lowest (which we take to be logically highest) MatchingPrecedence. Each MatchingPrecedence value must be non-negative. Note that if the precedence is not specified or zero, it will be set to 1000 as default.", + "distinguisherMethod": "`distinguisherMethod` defines how to compute the flow distinguisher for requests that match this schema. `nil` specifies that the distinguisher is disabled and thus will always be the empty string.", + "rules": "`rules` describes which requests will match this flow schema. This FlowSchema matches a request if and only if at least one member of rules matches the request. if it is an empty slice, there will be no requests matching the FlowSchema.", +} + +func (FlowSchemaSpec) SwaggerDoc() map[string]string { + return map_FlowSchemaSpec +} + +var map_FlowSchemaStatus = map[string]string{ + "": "FlowSchemaStatus represents the current state of a FlowSchema.", + "conditions": "`conditions` is a list of the current states of FlowSchema.", +} + +func (FlowSchemaStatus) SwaggerDoc() map[string]string { + return map_FlowSchemaStatus +} + +var map_GroupSubject = map[string]string{ + "": "GroupSubject holds detailed information for group-kind subject.", + "name": "name is the user group that matches, or \"*\" to match all user groups. See https://github.com/kubernetes/apiserver/blob/master/pkg/authentication/user/user.go for some well-known group names. Required.", +} + +func (GroupSubject) SwaggerDoc() map[string]string { + return map_GroupSubject +} + +var map_LimitResponse = map[string]string{ + "": "LimitResponse defines how to handle requests that can not be executed right now.", + "type": "`type` is \"Queue\" or \"Reject\". \"Queue\" means that requests that can not be executed upon arrival are held in a queue until they can be executed or a queuing limit is reached. \"Reject\" means that requests that can not be executed upon arrival are rejected. Required.", + "queuing": "`queuing` holds the configuration parameters for queuing. This field may be non-empty only if `type` is `\"Queue\"`.", +} + +func (LimitResponse) SwaggerDoc() map[string]string { + return map_LimitResponse +} + +var map_LimitedPriorityLevelConfiguration = map[string]string{ + "": "LimitedPriorityLevelConfiguration specifies how to handle requests that are subject to limits. It addresses two issues:\n * How are requests for this priority level limited?\n * What should be done with requests that exceed the limit?", + "assuredConcurrencyShares": "`assuredConcurrencyShares` (ACS) configures the execution limit, which is a limit on the number of requests of this priority level that may be exeucting at a given time. ACS must be a positive number. The server's concurrency limit (SCL) is divided among the concurrency-controlled priority levels in proportion to their assured concurrency shares. This produces the assured concurrency value (ACV) ", + "limitResponse": "`limitResponse` indicates what to do with requests that can not be executed right now", +} + +func (LimitedPriorityLevelConfiguration) SwaggerDoc() map[string]string { + return map_LimitedPriorityLevelConfiguration +} + +var map_NonResourcePolicyRule = map[string]string{ + "": "NonResourcePolicyRule is a predicate that matches non-resource requests according to their verb and the target non-resource URL. A NonResourcePolicyRule matches a request if and only if both (a) at least one member of verbs matches the request and (b) at least one member of nonResourceURLs matches the request.", + "verbs": "`verbs` is a list of matching verbs and may not be empty. \"*\" matches all verbs. If it is present, it must be the only entry. Required.", + "nonResourceURLs": "`nonResourceURLs` is a set of url prefixes that a user should have access to and may not be empty. For example:\n - \"/healthz\" is legal\n - \"/hea*\" is illegal\n - \"/hea\" is legal but matches nothing\n - \"/hea/*\" also matches nothing\n - \"/healthz/*\" matches all per-component health checks.\n\"*\" matches all non-resource urls. if it is present, it must be the only entry. Required.", +} + +func (NonResourcePolicyRule) SwaggerDoc() map[string]string { + return map_NonResourcePolicyRule +} + +var map_PolicyRulesWithSubjects = map[string]string{ + "": "PolicyRulesWithSubjects prescribes a test that applies to a request to an apiserver. The test considers the subject making the request, the verb being requested, and the resource to be acted upon. This PolicyRulesWithSubjects matches a request if and only if both (a) at least one member of subjects matches the request and (b) at least one member of resourceRules or nonResourceRules matches the request.", + "subjects": "subjects is the list of normal user, serviceaccount, or group that this rule cares about. There must be at least one member in this slice. A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request. Required.", + "resourceRules": "`resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the target resource. At least one of `resourceRules` and `nonResourceRules` has to be non-empty.", + "nonResourceRules": "`nonResourceRules` is a list of NonResourcePolicyRules that identify matching requests according to their verb and the target non-resource URL.", +} + +func (PolicyRulesWithSubjects) SwaggerDoc() map[string]string { + return map_PolicyRulesWithSubjects +} + +var map_PriorityLevelConfiguration = map[string]string{ + "": "PriorityLevelConfiguration represents the configuration of a priority level.", + "metadata": "`metadata` is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", + "spec": "`spec` is the specification of the desired behavior of a \"request-priority\". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", + "status": "`status` is the current status of a \"request-priority\". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", +} + +func (PriorityLevelConfiguration) SwaggerDoc() map[string]string { + return map_PriorityLevelConfiguration +} + +var map_PriorityLevelConfigurationCondition = map[string]string{ + "": "PriorityLevelConfigurationCondition defines the condition of priority level.", + "type": "`type` is the type of the condition. Required.", + "status": "`status` is the status of the condition. Can be True, False, Unknown. Required.", + "lastTransitionTime": "`lastTransitionTime` is the last time the condition transitioned from one status to another.", + "reason": "`reason` is a unique, one-word, CamelCase reason for the condition's last transition.", + "message": "`message` is a human-readable message indicating details about last transition.", +} + +func (PriorityLevelConfigurationCondition) SwaggerDoc() map[string]string { + return map_PriorityLevelConfigurationCondition +} + +var map_PriorityLevelConfigurationList = map[string]string{ + "": "PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects.", + "metadata": "`metadata` is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", + "items": "`items` is a list of request-priorities.", +} + +func (PriorityLevelConfigurationList) SwaggerDoc() map[string]string { + return map_PriorityLevelConfigurationList +} + +var map_PriorityLevelConfigurationReference = map[string]string{ + "": "PriorityLevelConfigurationReference contains information that points to the \"request-priority\" being used.", + "name": "`name` is the name of the priority level configuration being referenced Required.", +} + +func (PriorityLevelConfigurationReference) SwaggerDoc() map[string]string { + return map_PriorityLevelConfigurationReference +} + +var map_PriorityLevelConfigurationSpec = map[string]string{ + "": "PriorityLevelConfigurationSpec specifies the configuration of a priority level.", + "type": "`type` indicates whether this priority level is subject to limitation on request execution. A value of `\"Exempt\"` means that requests of this priority level are not subject to a limit (and thus are never queued) and do not detract from the capacity made available to other priority levels. A value of `\"Limited\"` means that (a) requests of this priority level _are_ subject to limits and (b) some of the server's limited capacity is made available exclusively to this priority level. Required.", + "limited": "`limited` specifies how requests are handled for a Limited priority level. This field must be non-empty if and only if `type` is `\"Limited\"`.", +} + +func (PriorityLevelConfigurationSpec) SwaggerDoc() map[string]string { + return map_PriorityLevelConfigurationSpec +} + +var map_PriorityLevelConfigurationStatus = map[string]string{ + "": "PriorityLevelConfigurationStatus represents the current state of a \"request-priority\".", + "conditions": "`conditions` is the current state of \"request-priority\".", +} + +func (PriorityLevelConfigurationStatus) SwaggerDoc() map[string]string { + return map_PriorityLevelConfigurationStatus +} + +var map_QueuingConfiguration = map[string]string{ + "": "QueuingConfiguration holds the configuration parameters for queuing", + "queues": "`queues` is the number of queues for this priority level. The queues exist independently at each apiserver. The value must be positive. Setting it to 1 effectively precludes shufflesharding and thus makes the distinguisher method of associated flow schemas irrelevant. This field has a default value of 64.", + "handSize": "`handSize` is a small positive number that configures the shuffle sharding of requests into queues. When enqueuing a request at this priority level the request's flow identifier (a string pair) is hashed and the hash value is used to shuffle the list of queues and deal a hand of the size specified here. The request is put into one of the shortest queues in that hand. `handSize` must be no larger than `queues`, and should be significantly smaller (so that a few heavy flows do not saturate most of the queues). See the user-facing documentation for more extensive guidance on setting this field. This field has a default value of 8.", + "queueLengthLimit": "`queueLengthLimit` is the maximum number of requests allowed to be waiting in a given queue of this priority level at a time; excess requests are rejected. This value must be positive. If not specified, it will be defaulted to 50.", +} + +func (QueuingConfiguration) SwaggerDoc() map[string]string { + return map_QueuingConfiguration +} + +var map_ResourcePolicyRule = map[string]string{ + "": "ResourcePolicyRule is a predicate that matches some resource requests, testing the request's verb and the target resource. A ResourcePolicyRule matches a resource request if and only if: (a) at least one member of verbs matches the request, (b) at least one member of apiGroups matches the request, (c) at least one member of resources matches the request, and (d) least one member of namespaces matches the request.", + "verbs": "`verbs` is a list of matching verbs and may not be empty. \"*\" matches all verbs and, if present, must be the only entry. Required.", + "apiGroups": "`apiGroups` is a list of matching API groups and may not be empty. \"*\" matches all API groups and, if present, must be the only entry. Required.", + "resources": "`resources` is a list of matching resources (i.e., lowercase and plural) with, if desired, subresource. For example, [ \"services\", \"nodes/status\" ]. This list may not be empty. \"*\" matches all resources and, if present, must be the only entry. Required.", + "clusterScope": "`clusterScope` indicates whether to match requests that do not specify a namespace (which happens either because the resource is not namespaced or the request targets all namespaces). If this field is omitted or false then the `namespaces` field must contain a non-empty list.", + "namespaces": "`namespaces` is a list of target namespaces that restricts matches. A request that specifies a target namespace matches only if either (a) this list contains that target namespace or (b) this list contains \"*\". Note that \"*\" matches any specified namespace but does not match a request that _does not specify_ a namespace (see the `clusterScope` field for that). This list may be empty, but only if `clusterScope` is true.", +} + +func (ResourcePolicyRule) SwaggerDoc() map[string]string { + return map_ResourcePolicyRule +} + +var map_ServiceAccountSubject = map[string]string{ + "": "ServiceAccountSubject holds detailed information for service-account-kind subject.", + "namespace": "`namespace` is the namespace of matching ServiceAccount objects. Required.", + "name": "`name` is the name of matching ServiceAccount objects, or \"*\" to match regardless of name. Required.", +} + +func (ServiceAccountSubject) SwaggerDoc() map[string]string { + return map_ServiceAccountSubject +} + +var map_Subject = map[string]string{ + "": "Subject matches the originator of a request, as identified by the request authentication system. There are three ways of matching an originator; by user, group, or service account.", + "kind": "Required", +} + +func (Subject) SwaggerDoc() map[string]string { + return map_Subject +} + +var map_UserSubject = map[string]string{ + "": "UserSubject holds detailed information for user-kind subject.", + "name": "`name` is the username that matches, or \"*\" to match all usernames. Required.", +} + +func (UserSubject) SwaggerDoc() map[string]string { + return map_UserSubject +} + +// AUTO-GENERATED FUNCTIONS END HERE diff --git a/vendor/k8s.io/api/flowcontrol/v1alpha1/zz_generated.deepcopy.go b/vendor/k8s.io/api/flowcontrol/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 0000000..f5d3795 --- /dev/null +++ b/vendor/k8s.io/api/flowcontrol/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,541 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FlowDistinguisherMethod) DeepCopyInto(out *FlowDistinguisherMethod) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlowDistinguisherMethod. +func (in *FlowDistinguisherMethod) DeepCopy() *FlowDistinguisherMethod { + if in == nil { + return nil + } + out := new(FlowDistinguisherMethod) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FlowSchema) DeepCopyInto(out *FlowSchema) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlowSchema. +func (in *FlowSchema) DeepCopy() *FlowSchema { + if in == nil { + return nil + } + out := new(FlowSchema) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FlowSchema) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FlowSchemaCondition) DeepCopyInto(out *FlowSchemaCondition) { + *out = *in + in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlowSchemaCondition. +func (in *FlowSchemaCondition) DeepCopy() *FlowSchemaCondition { + if in == nil { + return nil + } + out := new(FlowSchemaCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FlowSchemaList) DeepCopyInto(out *FlowSchemaList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]FlowSchema, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlowSchemaList. +func (in *FlowSchemaList) DeepCopy() *FlowSchemaList { + if in == nil { + return nil + } + out := new(FlowSchemaList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FlowSchemaList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FlowSchemaSpec) DeepCopyInto(out *FlowSchemaSpec) { + *out = *in + out.PriorityLevelConfiguration = in.PriorityLevelConfiguration + if in.DistinguisherMethod != nil { + in, out := &in.DistinguisherMethod, &out.DistinguisherMethod + *out = new(FlowDistinguisherMethod) + **out = **in + } + if in.Rules != nil { + in, out := &in.Rules, &out.Rules + *out = make([]PolicyRulesWithSubjects, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlowSchemaSpec. +func (in *FlowSchemaSpec) DeepCopy() *FlowSchemaSpec { + if in == nil { + return nil + } + out := new(FlowSchemaSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FlowSchemaStatus) DeepCopyInto(out *FlowSchemaStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]FlowSchemaCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlowSchemaStatus. +func (in *FlowSchemaStatus) DeepCopy() *FlowSchemaStatus { + if in == nil { + return nil + } + out := new(FlowSchemaStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GroupSubject) DeepCopyInto(out *GroupSubject) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupSubject. +func (in *GroupSubject) DeepCopy() *GroupSubject { + if in == nil { + return nil + } + out := new(GroupSubject) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LimitResponse) DeepCopyInto(out *LimitResponse) { + *out = *in + if in.Queuing != nil { + in, out := &in.Queuing, &out.Queuing + *out = new(QueuingConfiguration) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LimitResponse. +func (in *LimitResponse) DeepCopy() *LimitResponse { + if in == nil { + return nil + } + out := new(LimitResponse) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LimitedPriorityLevelConfiguration) DeepCopyInto(out *LimitedPriorityLevelConfiguration) { + *out = *in + in.LimitResponse.DeepCopyInto(&out.LimitResponse) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LimitedPriorityLevelConfiguration. +func (in *LimitedPriorityLevelConfiguration) DeepCopy() *LimitedPriorityLevelConfiguration { + if in == nil { + return nil + } + out := new(LimitedPriorityLevelConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NonResourcePolicyRule) DeepCopyInto(out *NonResourcePolicyRule) { + *out = *in + if in.Verbs != nil { + in, out := &in.Verbs, &out.Verbs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.NonResourceURLs != nil { + in, out := &in.NonResourceURLs, &out.NonResourceURLs + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NonResourcePolicyRule. +func (in *NonResourcePolicyRule) DeepCopy() *NonResourcePolicyRule { + if in == nil { + return nil + } + out := new(NonResourcePolicyRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PolicyRulesWithSubjects) DeepCopyInto(out *PolicyRulesWithSubjects) { + *out = *in + if in.Subjects != nil { + in, out := &in.Subjects, &out.Subjects + *out = make([]Subject, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ResourceRules != nil { + in, out := &in.ResourceRules, &out.ResourceRules + *out = make([]ResourcePolicyRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.NonResourceRules != nil { + in, out := &in.NonResourceRules, &out.NonResourceRules + *out = make([]NonResourcePolicyRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyRulesWithSubjects. +func (in *PolicyRulesWithSubjects) DeepCopy() *PolicyRulesWithSubjects { + if in == nil { + return nil + } + out := new(PolicyRulesWithSubjects) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PriorityLevelConfiguration) DeepCopyInto(out *PriorityLevelConfiguration) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PriorityLevelConfiguration. +func (in *PriorityLevelConfiguration) DeepCopy() *PriorityLevelConfiguration { + if in == nil { + return nil + } + out := new(PriorityLevelConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PriorityLevelConfiguration) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PriorityLevelConfigurationCondition) DeepCopyInto(out *PriorityLevelConfigurationCondition) { + *out = *in + in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PriorityLevelConfigurationCondition. +func (in *PriorityLevelConfigurationCondition) DeepCopy() *PriorityLevelConfigurationCondition { + if in == nil { + return nil + } + out := new(PriorityLevelConfigurationCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PriorityLevelConfigurationList) DeepCopyInto(out *PriorityLevelConfigurationList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PriorityLevelConfiguration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PriorityLevelConfigurationList. +func (in *PriorityLevelConfigurationList) DeepCopy() *PriorityLevelConfigurationList { + if in == nil { + return nil + } + out := new(PriorityLevelConfigurationList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PriorityLevelConfigurationList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PriorityLevelConfigurationReference) DeepCopyInto(out *PriorityLevelConfigurationReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PriorityLevelConfigurationReference. +func (in *PriorityLevelConfigurationReference) DeepCopy() *PriorityLevelConfigurationReference { + if in == nil { + return nil + } + out := new(PriorityLevelConfigurationReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PriorityLevelConfigurationSpec) DeepCopyInto(out *PriorityLevelConfigurationSpec) { + *out = *in + if in.Limited != nil { + in, out := &in.Limited, &out.Limited + *out = new(LimitedPriorityLevelConfiguration) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PriorityLevelConfigurationSpec. +func (in *PriorityLevelConfigurationSpec) DeepCopy() *PriorityLevelConfigurationSpec { + if in == nil { + return nil + } + out := new(PriorityLevelConfigurationSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PriorityLevelConfigurationStatus) DeepCopyInto(out *PriorityLevelConfigurationStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]PriorityLevelConfigurationCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PriorityLevelConfigurationStatus. +func (in *PriorityLevelConfigurationStatus) DeepCopy() *PriorityLevelConfigurationStatus { + if in == nil { + return nil + } + out := new(PriorityLevelConfigurationStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QueuingConfiguration) DeepCopyInto(out *QueuingConfiguration) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueuingConfiguration. +func (in *QueuingConfiguration) DeepCopy() *QueuingConfiguration { + if in == nil { + return nil + } + out := new(QueuingConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourcePolicyRule) DeepCopyInto(out *ResourcePolicyRule) { + *out = *in + if in.Verbs != nil { + in, out := &in.Verbs, &out.Verbs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.APIGroups != nil { + in, out := &in.APIGroups, &out.APIGroups + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Namespaces != nil { + in, out := &in.Namespaces, &out.Namespaces + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePolicyRule. +func (in *ResourcePolicyRule) DeepCopy() *ResourcePolicyRule { + if in == nil { + return nil + } + out := new(ResourcePolicyRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceAccountSubject) DeepCopyInto(out *ServiceAccountSubject) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceAccountSubject. +func (in *ServiceAccountSubject) DeepCopy() *ServiceAccountSubject { + if in == nil { + return nil + } + out := new(ServiceAccountSubject) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Subject) DeepCopyInto(out *Subject) { + *out = *in + if in.User != nil { + in, out := &in.User, &out.User + *out = new(UserSubject) + **out = **in + } + if in.Group != nil { + in, out := &in.Group, &out.Group + *out = new(GroupSubject) + **out = **in + } + if in.ServiceAccount != nil { + in, out := &in.ServiceAccount, &out.ServiceAccount + *out = new(ServiceAccountSubject) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subject. +func (in *Subject) DeepCopy() *Subject { + if in == nil { + return nil + } + out := new(Subject) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserSubject) DeepCopyInto(out *UserSubject) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserSubject. +func (in *UserSubject) DeepCopy() *UserSubject { + if in == nil { + return nil + } + out := new(UserSubject) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/k8s.io/api/networking/v1/generated.proto b/vendor/k8s.io/api/networking/v1/generated.proto deleted file mode 100644 index 3cb7380..0000000 --- a/vendor/k8s.io/api/networking/v1/generated.proto +++ /dev/null @@ -1,195 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.networking.v1; - -import "k8s.io/api/core/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; -import "k8s.io/apimachinery/pkg/util/intstr/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1"; - -// IPBlock describes a particular CIDR (Ex. "192.168.1.1/24") that is allowed to the pods -// matched by a NetworkPolicySpec's podSelector. The except entry describes CIDRs that should -// not be included within this rule. -message IPBlock { - // CIDR is a string representing the IP Block - // Valid examples are "192.168.1.1/24" - optional string cidr = 1; - - // Except is a slice of CIDRs that should not be included within an IP Block - // Valid examples are "192.168.1.1/24" - // Except values will be rejected if they are outside the CIDR range - // +optional - repeated string except = 2; -} - -// NetworkPolicy describes what network traffic is allowed for a set of Pods -message NetworkPolicy { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Specification of the desired behavior for this NetworkPolicy. - // +optional - optional NetworkPolicySpec spec = 2; -} - -// NetworkPolicyEgressRule describes a particular set of traffic that is allowed out of pods -// matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and to. -// This type is beta-level in 1.8 -message NetworkPolicyEgressRule { - // List of destination ports for outgoing traffic. - // Each item in this list is combined using a logical OR. If this field is - // empty or missing, this rule matches all ports (traffic not restricted by port). - // If this field is present and contains at least one item, then this rule allows - // traffic only if the traffic matches at least one port in the list. - // +optional - repeated NetworkPolicyPort ports = 1; - - // List of destinations for outgoing traffic of pods selected for this rule. - // Items in this list are combined using a logical OR operation. If this field is - // empty or missing, this rule matches all destinations (traffic not restricted by - // destination). If this field is present and contains at least one item, this rule - // allows traffic only if the traffic matches at least one item in the to list. - // +optional - repeated NetworkPolicyPeer to = 2; -} - -// NetworkPolicyIngressRule describes a particular set of traffic that is allowed to the pods -// matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and from. -message NetworkPolicyIngressRule { - // List of ports which should be made accessible on the pods selected for this - // rule. Each item in this list is combined using a logical OR. If this field is - // empty or missing, this rule matches all ports (traffic not restricted by port). - // If this field is present and contains at least one item, then this rule allows - // traffic only if the traffic matches at least one port in the list. - // +optional - repeated NetworkPolicyPort ports = 1; - - // List of sources which should be able to access the pods selected for this rule. - // Items in this list are combined using a logical OR operation. If this field is - // empty or missing, this rule matches all sources (traffic not restricted by - // source). If this field is present and contains at least one item, this rule - // allows traffic only if the traffic matches at least one item in the from list. - // +optional - repeated NetworkPolicyPeer from = 2; -} - -// NetworkPolicyList is a list of NetworkPolicy objects. -message NetworkPolicyList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is a list of schema objects. - repeated NetworkPolicy items = 2; -} - -// NetworkPolicyPeer describes a peer to allow traffic from. Only certain combinations of -// fields are allowed -message NetworkPolicyPeer { - // This is a label selector which selects Pods. This field follows standard label - // selector semantics; if present but empty, it selects all pods. - // - // If NamespaceSelector is also set, then the NetworkPolicyPeer as a whole selects - // the Pods matching PodSelector in the Namespaces selected by NamespaceSelector. - // Otherwise it selects the Pods matching PodSelector in the policy's own Namespace. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector podSelector = 1; - - // Selects Namespaces using cluster-scoped labels. This field follows standard label - // selector semantics; if present but empty, it selects all namespaces. - // - // If PodSelector is also set, then the NetworkPolicyPeer as a whole selects - // the Pods matching PodSelector in the Namespaces selected by NamespaceSelector. - // Otherwise it selects all Pods in the Namespaces selected by NamespaceSelector. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 2; - - // IPBlock defines policy on a particular IPBlock. If this field is set then - // neither of the other fields can be. - // +optional - optional IPBlock ipBlock = 3; -} - -// NetworkPolicyPort describes a port to allow traffic on -message NetworkPolicyPort { - // The protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this - // field defaults to TCP. - // +optional - optional string protocol = 1; - - // The port on the given protocol. This can either be a numerical or named port on - // a pod. If this field is not provided, this matches all port names and numbers. - // +optional - optional k8s.io.apimachinery.pkg.util.intstr.IntOrString port = 2; -} - -// NetworkPolicySpec provides the specification of a NetworkPolicy -message NetworkPolicySpec { - // Selects the pods to which this NetworkPolicy object applies. The array of - // ingress rules is applied to any pods selected by this field. Multiple network - // policies can select the same set of pods. In this case, the ingress rules for - // each are combined additively. This field is NOT optional and follows standard - // label selector semantics. An empty podSelector matches all pods in this - // namespace. - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector podSelector = 1; - - // List of ingress rules to be applied to the selected pods. Traffic is allowed to - // a pod if there are no NetworkPolicies selecting the pod - // (and cluster policy otherwise allows the traffic), OR if the traffic source is - // the pod's local node, OR if the traffic matches at least one ingress rule - // across all of the NetworkPolicy objects whose podSelector matches the pod. If - // this field is empty then this NetworkPolicy does not allow any traffic (and serves - // solely to ensure that the pods it selects are isolated by default) - // +optional - repeated NetworkPolicyIngressRule ingress = 2; - - // List of egress rules to be applied to the selected pods. Outgoing traffic is - // allowed if there are no NetworkPolicies selecting the pod (and cluster policy - // otherwise allows the traffic), OR if the traffic matches at least one egress rule - // across all of the NetworkPolicy objects whose podSelector matches the pod. If - // this field is empty then this NetworkPolicy limits all outgoing traffic (and serves - // solely to ensure that the pods it selects are isolated by default). - // This field is beta-level in 1.8 - // +optional - repeated NetworkPolicyEgressRule egress = 3; - - // List of rule types that the NetworkPolicy relates to. - // Valid options are "Ingress", "Egress", or "Ingress,Egress". - // If this field is not specified, it will default based on the existence of Ingress or Egress rules; - // policies that contain an Egress section are assumed to affect Egress, and all policies - // (whether or not they contain an Ingress section) are assumed to affect Ingress. - // If you want to write an egress-only policy, you must explicitly specify policyTypes [ "Egress" ]. - // Likewise, if you want to write a policy that specifies that no egress is allowed, - // you must specify a policyTypes value that include "Egress" (since such a policy would not include - // an Egress section and would otherwise default to just [ "Ingress" ]). - // This field is beta-level in 1.8 - // +optional - repeated string policyTypes = 4; -} - diff --git a/vendor/k8s.io/api/networking/v1beta1/generated.proto b/vendor/k8s.io/api/networking/v1beta1/generated.proto deleted file mode 100644 index a72545c..0000000 --- a/vendor/k8s.io/api/networking/v1beta1/generated.proto +++ /dev/null @@ -1,186 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.networking.v1beta1; - -import "k8s.io/api/core/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; -import "k8s.io/apimachinery/pkg/util/intstr/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1beta1"; - -// HTTPIngressPath associates a path regex with a backend. Incoming urls matching -// the path are forwarded to the backend. -message HTTPIngressPath { - // Path is an extended POSIX regex as defined by IEEE Std 1003.1, - // (i.e this follows the egrep/unix syntax, not the perl syntax) - // matched against the path of an incoming request. Currently it can - // contain characters disallowed from the conventional "path" - // part of a URL as defined by RFC 3986. Paths must begin with - // a '/'. If unspecified, the path defaults to a catch all sending - // traffic to the backend. - // +optional - optional string path = 1; - - // Backend defines the referenced service endpoint to which the traffic - // will be forwarded to. - optional IngressBackend backend = 2; -} - -// HTTPIngressRuleValue is a list of http selectors pointing to backends. -// In the example: http:///? -> backend where -// where parts of the url correspond to RFC 3986, this resource will be used -// to match against everything after the last '/' and before the first '?' -// or '#'. -message HTTPIngressRuleValue { - // A collection of paths that map requests to backends. - repeated HTTPIngressPath paths = 1; -} - -// Ingress is a collection of rules that allow inbound connections to reach the -// endpoints defined by a backend. An Ingress can be configured to give services -// externally-reachable urls, load balance traffic, terminate SSL, offer name -// based virtual hosting etc. -message Ingress { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec is the desired state of the Ingress. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional IngressSpec spec = 2; - - // Status is the current state of the Ingress. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional IngressStatus status = 3; -} - -// IngressBackend describes all endpoints for a given service and port. -message IngressBackend { - // Specifies the name of the referenced service. - optional string serviceName = 1; - - // Specifies the port of the referenced service. - optional k8s.io.apimachinery.pkg.util.intstr.IntOrString servicePort = 2; -} - -// IngressList is a collection of Ingress. -message IngressList { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is the list of Ingress. - repeated Ingress items = 2; -} - -// IngressRule represents the rules mapping the paths under a specified host to -// the related backend services. Incoming requests are first evaluated for a host -// match, then routed to the backend associated with the matching IngressRuleValue. -message IngressRule { - // Host is the fully qualified domain name of a network host, as defined - // by RFC 3986. Note the following deviations from the "host" part of the - // URI as defined in the RFC: - // 1. IPs are not allowed. Currently an IngressRuleValue can only apply to the - // IP in the Spec of the parent Ingress. - // 2. The `:` delimiter is not respected because ports are not allowed. - // Currently the port of an Ingress is implicitly :80 for http and - // :443 for https. - // Both these may change in the future. - // Incoming requests are matched against the host before the IngressRuleValue. - // If the host is unspecified, the Ingress routes all traffic based on the - // specified IngressRuleValue. - // +optional - optional string host = 1; - - // IngressRuleValue represents a rule to route requests for this IngressRule. - // If unspecified, the rule defaults to a http catch-all. Whether that sends - // just traffic matching the host to the default backend or all traffic to the - // default backend, is left to the controller fulfilling the Ingress. Http is - // currently the only supported IngressRuleValue. - // +optional - optional IngressRuleValue ingressRuleValue = 2; -} - -// IngressRuleValue represents a rule to apply against incoming requests. If the -// rule is satisfied, the request is routed to the specified backend. Currently -// mixing different types of rules in a single Ingress is disallowed, so exactly -// one of the following must be set. -message IngressRuleValue { - // +optional - optional HTTPIngressRuleValue http = 1; -} - -// IngressSpec describes the Ingress the user wishes to exist. -message IngressSpec { - // A default backend capable of servicing requests that don't match any - // rule. At least one of 'backend' or 'rules' must be specified. This field - // is optional to allow the loadbalancer controller or defaulting logic to - // specify a global default. - // +optional - optional IngressBackend backend = 1; - - // TLS configuration. Currently the Ingress only supports a single TLS - // port, 443. If multiple members of this list specify different hosts, they - // will be multiplexed on the same port according to the hostname specified - // through the SNI TLS extension, if the ingress controller fulfilling the - // ingress supports SNI. - // +optional - repeated IngressTLS tls = 2; - - // A list of host rules used to configure the Ingress. If unspecified, or - // no rule matches, all traffic is sent to the default backend. - // +optional - repeated IngressRule rules = 3; -} - -// IngressStatus describe the current state of the Ingress. -message IngressStatus { - // LoadBalancer contains the current status of the load-balancer. - // +optional - optional k8s.io.api.core.v1.LoadBalancerStatus loadBalancer = 1; -} - -// IngressTLS describes the transport layer security associated with an Ingress. -message IngressTLS { - // Hosts are a list of hosts included in the TLS certificate. The values in - // this list must match the name/s used in the tlsSecret. Defaults to the - // wildcard host setting for the loadbalancer controller fulfilling this - // Ingress, if left unspecified. - // +optional - repeated string hosts = 1; - - // SecretName is the name of the secret used to terminate SSL traffic on 443. - // Field is left optional to allow SSL routing based on SNI hostname alone. - // If the SNI host in a listener conflicts with the "Host" header field used - // by an IngressRule, the SNI host is used for termination and value of the - // Host header is used for routing. - // +optional - optional string secretName = 2; -} - diff --git a/vendor/k8s.io/api/node/v1alpha1/generated.proto b/vendor/k8s.io/api/node/v1alpha1/generated.proto deleted file mode 100644 index ac05f83..0000000 --- a/vendor/k8s.io/api/node/v1alpha1/generated.proto +++ /dev/null @@ -1,118 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.node.v1alpha1; - -import "k8s.io/api/core/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/api/resource/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1alpha1"; - -// Overhead structure represents the resource overhead associated with running a pod. -message Overhead { - // PodFixed represents the fixed resource overhead associated with running a pod. - // +optional - map podFixed = 1; -} - -// RuntimeClass defines a class of container runtime supported in the cluster. -// The RuntimeClass is used to determine which container runtime is used to run -// all containers in a pod. RuntimeClasses are (currently) manually defined by a -// user or cluster provisioner, and referenced in the PodSpec. The Kubelet is -// responsible for resolving the RuntimeClassName reference before running the -// pod. For more details, see -// https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md -message RuntimeClass { - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Specification of the RuntimeClass - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - optional RuntimeClassSpec spec = 2; -} - -// RuntimeClassList is a list of RuntimeClass objects. -message RuntimeClassList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is a list of schema objects. - repeated RuntimeClass items = 2; -} - -// RuntimeClassSpec is a specification of a RuntimeClass. It contains parameters -// that are required to describe the RuntimeClass to the Container Runtime -// Interface (CRI) implementation, as well as any other components that need to -// understand how the pod will be run. The RuntimeClassSpec is immutable. -message RuntimeClassSpec { - // RuntimeHandler specifies the underlying runtime and configuration that the - // CRI implementation will use to handle pods of this class. The possible - // values are specific to the node & CRI configuration. It is assumed that - // all handlers are available on every node, and handlers of the same name are - // equivalent on every node. - // For example, a handler called "runc" might specify that the runc OCI - // runtime (using native Linux containers) will be used to run the containers - // in a pod. - // The RuntimeHandler must conform to the DNS Label (RFC 1123) requirements - // and is immutable. - optional string runtimeHandler = 1; - - // Overhead represents the resource overhead associated with running a pod for a - // given RuntimeClass. For more details, see - // https://git.k8s.io/enhancements/keps/sig-node/20190226-pod-overhead.md - // This field is alpha-level as of Kubernetes v1.15, and is only honored by servers that enable the PodOverhead feature. - // +optional - optional Overhead overhead = 2; - - // Scheduling holds the scheduling constraints to ensure that pods running - // with this RuntimeClass are scheduled to nodes that support it. - // If scheduling is nil, this RuntimeClass is assumed to be supported by all - // nodes. - // +optional - optional Scheduling scheduling = 3; -} - -// Scheduling specifies the scheduling constraints for nodes supporting a -// RuntimeClass. -message Scheduling { - // nodeSelector lists labels that must be present on nodes that support this - // RuntimeClass. Pods using this RuntimeClass can only be scheduled to a - // node matched by this selector. The RuntimeClass nodeSelector is merged - // with a pod's existing nodeSelector. Any conflicts will cause the pod to - // be rejected in admission. - // +optional - map nodeSelector = 1; - - // tolerations are appended (excluding duplicates) to pods running with this - // RuntimeClass during admission, effectively unioning the set of nodes - // tolerated by the pod and the RuntimeClass. - // +optional - // +listType=atomic - repeated k8s.io.api.core.v1.Toleration tolerations = 2; -} - diff --git a/vendor/k8s.io/api/node/v1beta1/generated.proto b/vendor/k8s.io/api/node/v1beta1/generated.proto deleted file mode 100644 index 4916679..0000000 --- a/vendor/k8s.io/api/node/v1beta1/generated.proto +++ /dev/null @@ -1,108 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.node.v1beta1; - -import "k8s.io/api/core/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/api/resource/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1beta1"; - -// Overhead structure represents the resource overhead associated with running a pod. -message Overhead { - // PodFixed represents the fixed resource overhead associated with running a pod. - // +optional - map podFixed = 1; -} - -// RuntimeClass defines a class of container runtime supported in the cluster. -// The RuntimeClass is used to determine which container runtime is used to run -// all containers in a pod. RuntimeClasses are (currently) manually defined by a -// user or cluster provisioner, and referenced in the PodSpec. The Kubelet is -// responsible for resolving the RuntimeClassName reference before running the -// pod. For more details, see -// https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md -message RuntimeClass { - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Handler specifies the underlying runtime and configuration that the CRI - // implementation will use to handle pods of this class. The possible values - // are specific to the node & CRI configuration. It is assumed that all - // handlers are available on every node, and handlers of the same name are - // equivalent on every node. - // For example, a handler called "runc" might specify that the runc OCI - // runtime (using native Linux containers) will be used to run the containers - // in a pod. - // The Handler must conform to the DNS Label (RFC 1123) requirements, and is - // immutable. - optional string handler = 2; - - // Overhead represents the resource overhead associated with running a pod for a - // given RuntimeClass. For more details, see - // https://git.k8s.io/enhancements/keps/sig-node/20190226-pod-overhead.md - // This field is alpha-level as of Kubernetes v1.15, and is only honored by servers that enable the PodOverhead feature. - // +optional - optional Overhead overhead = 3; - - // Scheduling holds the scheduling constraints to ensure that pods running - // with this RuntimeClass are scheduled to nodes that support it. - // If scheduling is nil, this RuntimeClass is assumed to be supported by all - // nodes. - // +optional - optional Scheduling scheduling = 4; -} - -// RuntimeClassList is a list of RuntimeClass objects. -message RuntimeClassList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is a list of schema objects. - repeated RuntimeClass items = 2; -} - -// Scheduling specifies the scheduling constraints for nodes supporting a -// RuntimeClass. -message Scheduling { - // nodeSelector lists labels that must be present on nodes that support this - // RuntimeClass. Pods using this RuntimeClass can only be scheduled to a - // node matched by this selector. The RuntimeClass nodeSelector is merged - // with a pod's existing nodeSelector. Any conflicts will cause the pod to - // be rejected in admission. - // +optional - map nodeSelector = 1; - - // tolerations are appended (excluding duplicates) to pods running with this - // RuntimeClass during admission, effectively unioning the set of nodes - // tolerated by the pod and the RuntimeClass. - // +optional - // +listType=atomic - repeated k8s.io.api.core.v1.Toleration tolerations = 2; -} - diff --git a/vendor/k8s.io/api/policy/v1beta1/generated.proto b/vendor/k8s.io/api/policy/v1beta1/generated.proto deleted file mode 100644 index 9679daf..0000000 --- a/vendor/k8s.io/api/policy/v1beta1/generated.proto +++ /dev/null @@ -1,400 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.policy.v1beta1; - -import "k8s.io/api/core/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; -import "k8s.io/apimachinery/pkg/util/intstr/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1beta1"; - -// AllowedCSIDriver represents a single inline CSI Driver that is allowed to be used. -message AllowedCSIDriver { - // Name is the registered name of the CSI driver - optional string name = 1; -} - -// AllowedFlexVolume represents a single Flexvolume that is allowed to be used. -message AllowedFlexVolume { - // driver is the name of the Flexvolume driver. - optional string driver = 1; -} - -// AllowedHostPath defines the host volume conditions that will be enabled by a policy -// for pods to use. It requires the path prefix to be defined. -message AllowedHostPath { - // pathPrefix is the path prefix that the host volume must match. - // It does not support `*`. - // Trailing slashes are trimmed when validating the path prefix with a host path. - // - // Examples: - // `/foo` would allow `/foo`, `/foo/` and `/foo/bar` - // `/foo` would not allow `/food` or `/etc/foo` - optional string pathPrefix = 1; - - // when set to true, will allow host volumes matching the pathPrefix only if all volume mounts are readOnly. - // +optional - optional bool readOnly = 2; -} - -// Eviction evicts a pod from its node subject to certain policies and safety constraints. -// This is a subresource of Pod. A request to cause such an eviction is -// created by POSTing to .../pods//evictions. -message Eviction { - // ObjectMeta describes the pod that is being evicted. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // DeleteOptions may be provided - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.DeleteOptions deleteOptions = 2; -} - -// FSGroupStrategyOptions defines the strategy type and options used to create the strategy. -message FSGroupStrategyOptions { - // rule is the strategy that will dictate what FSGroup is used in the SecurityContext. - // +optional - optional string rule = 1; - - // ranges are the allowed ranges of fs groups. If you would like to force a single - // fs group then supply a single range with the same start and end. Required for MustRunAs. - // +optional - repeated IDRange ranges = 2; -} - -// HostPortRange defines a range of host ports that will be enabled by a policy -// for pods to use. It requires both the start and end to be defined. -message HostPortRange { - // min is the start of the range, inclusive. - optional int32 min = 1; - - // max is the end of the range, inclusive. - optional int32 max = 2; -} - -// IDRange provides a min/max of an allowed range of IDs. -message IDRange { - // min is the start of the range, inclusive. - optional int64 min = 1; - - // max is the end of the range, inclusive. - optional int64 max = 2; -} - -// PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods -message PodDisruptionBudget { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Specification of the desired behavior of the PodDisruptionBudget. - // +optional - optional PodDisruptionBudgetSpec spec = 2; - - // Most recently observed status of the PodDisruptionBudget. - // +optional - optional PodDisruptionBudgetStatus status = 3; -} - -// PodDisruptionBudgetList is a collection of PodDisruptionBudgets. -message PodDisruptionBudgetList { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - repeated PodDisruptionBudget items = 2; -} - -// PodDisruptionBudgetSpec is a description of a PodDisruptionBudget. -message PodDisruptionBudgetSpec { - // An eviction is allowed if at least "minAvailable" pods selected by - // "selector" will still be available after the eviction, i.e. even in the - // absence of the evicted pod. So for example you can prevent all voluntary - // evictions by specifying "100%". - // +optional - optional k8s.io.apimachinery.pkg.util.intstr.IntOrString minAvailable = 1; - - // Label query over pods whose evictions are managed by the disruption - // budget. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2; - - // An eviction is allowed if at most "maxUnavailable" pods selected by - // "selector" are unavailable after the eviction, i.e. even in absence of - // the evicted pod. For example, one can prevent all voluntary evictions - // by specifying 0. This is a mutually exclusive setting with "minAvailable". - // +optional - optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 3; -} - -// PodDisruptionBudgetStatus represents information about the status of a -// PodDisruptionBudget. Status may trail the actual state of a system. -message PodDisruptionBudgetStatus { - // Most recent generation observed when updating this PDB status. PodDisruptionsAllowed and other - // status information is valid only if observedGeneration equals to PDB's object generation. - // +optional - optional int64 observedGeneration = 1; - - // DisruptedPods contains information about pods whose eviction was - // processed by the API server eviction subresource handler but has not - // yet been observed by the PodDisruptionBudget controller. - // A pod will be in this map from the time when the API server processed the - // eviction request to the time when the pod is seen by PDB controller - // as having been marked for deletion (or after a timeout). The key in the map is the name of the pod - // and the value is the time when the API server processed the eviction request. If - // the deletion didn't occur and a pod is still there it will be removed from - // the list automatically by PodDisruptionBudget controller after some time. - // If everything goes smooth this map should be empty for the most of the time. - // Large number of entries in the map may indicate problems with pod deletions. - // +optional - map disruptedPods = 2; - - // Number of pod disruptions that are currently allowed. - optional int32 disruptionsAllowed = 3; - - // current number of healthy pods - optional int32 currentHealthy = 4; - - // minimum desired number of healthy pods - optional int32 desiredHealthy = 5; - - // total number of pods counted by this disruption budget - optional int32 expectedPods = 6; -} - -// PodSecurityPolicy governs the ability to make requests that affect the Security Context -// that will be applied to a pod and container. -message PodSecurityPolicy { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // spec defines the policy enforced. - // +optional - optional PodSecurityPolicySpec spec = 2; -} - -// PodSecurityPolicyList is a list of PodSecurityPolicy objects. -message PodSecurityPolicyList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // items is a list of schema objects. - repeated PodSecurityPolicy items = 2; -} - -// PodSecurityPolicySpec defines the policy enforced. -message PodSecurityPolicySpec { - // privileged determines if a pod can request to be run as privileged. - // +optional - optional bool privileged = 1; - - // defaultAddCapabilities is the default set of capabilities that will be added to the container - // unless the pod spec specifically drops the capability. You may not list a capability in both - // defaultAddCapabilities and requiredDropCapabilities. Capabilities added here are implicitly - // allowed, and need not be included in the allowedCapabilities list. - // +optional - repeated string defaultAddCapabilities = 2; - - // requiredDropCapabilities are the capabilities that will be dropped from the container. These - // are required to be dropped and cannot be added. - // +optional - repeated string requiredDropCapabilities = 3; - - // allowedCapabilities is a list of capabilities that can be requested to add to the container. - // Capabilities in this field may be added at the pod author's discretion. - // You must not list a capability in both allowedCapabilities and requiredDropCapabilities. - // +optional - repeated string allowedCapabilities = 4; - - // volumes is a white list of allowed volume plugins. Empty indicates that - // no volumes may be used. To allow all volumes you may use '*'. - // +optional - repeated string volumes = 5; - - // hostNetwork determines if the policy allows the use of HostNetwork in the pod spec. - // +optional - optional bool hostNetwork = 6; - - // hostPorts determines which host port ranges are allowed to be exposed. - // +optional - repeated HostPortRange hostPorts = 7; - - // hostPID determines if the policy allows the use of HostPID in the pod spec. - // +optional - optional bool hostPID = 8; - - // hostIPC determines if the policy allows the use of HostIPC in the pod spec. - // +optional - optional bool hostIPC = 9; - - // seLinux is the strategy that will dictate the allowable labels that may be set. - optional SELinuxStrategyOptions seLinux = 10; - - // runAsUser is the strategy that will dictate the allowable RunAsUser values that may be set. - optional RunAsUserStrategyOptions runAsUser = 11; - - // RunAsGroup is the strategy that will dictate the allowable RunAsGroup values that may be set. - // If this field is omitted, the pod's RunAsGroup can take any value. This field requires the - // RunAsGroup feature gate to be enabled. - // +optional - optional RunAsGroupStrategyOptions runAsGroup = 22; - - // supplementalGroups is the strategy that will dictate what supplemental groups are used by the SecurityContext. - optional SupplementalGroupsStrategyOptions supplementalGroups = 12; - - // fsGroup is the strategy that will dictate what fs group is used by the SecurityContext. - optional FSGroupStrategyOptions fsGroup = 13; - - // readOnlyRootFilesystem when set to true will force containers to run with a read only root file - // system. If the container specifically requests to run with a non-read only root file system - // the PSP should deny the pod. - // If set to false the container may run with a read only root file system if it wishes but it - // will not be forced to. - // +optional - optional bool readOnlyRootFilesystem = 14; - - // defaultAllowPrivilegeEscalation controls the default setting for whether a - // process can gain more privileges than its parent process. - // +optional - optional bool defaultAllowPrivilegeEscalation = 15; - - // allowPrivilegeEscalation determines if a pod can request to allow - // privilege escalation. If unspecified, defaults to true. - // +optional - optional bool allowPrivilegeEscalation = 16; - - // allowedHostPaths is a white list of allowed host paths. Empty indicates - // that all host paths may be used. - // +optional - repeated AllowedHostPath allowedHostPaths = 17; - - // allowedFlexVolumes is a whitelist of allowed Flexvolumes. Empty or nil indicates that all - // Flexvolumes may be used. This parameter is effective only when the usage of the Flexvolumes - // is allowed in the "volumes" field. - // +optional - repeated AllowedFlexVolume allowedFlexVolumes = 18; - - // AllowedCSIDrivers is a whitelist of inline CSI drivers that must be explicitly set to be embedded within a pod spec. - // An empty value indicates that any CSI driver can be used for inline ephemeral volumes. - // This is an alpha field, and is only honored if the API server enables the CSIInlineVolume feature gate. - // +optional - repeated AllowedCSIDriver allowedCSIDrivers = 23; - - // allowedUnsafeSysctls is a list of explicitly allowed unsafe sysctls, defaults to none. - // Each entry is either a plain sysctl name or ends in "*" in which case it is considered - // as a prefix of allowed sysctls. Single * means all unsafe sysctls are allowed. - // Kubelet has to whitelist all allowed unsafe sysctls explicitly to avoid rejection. - // - // Examples: - // e.g. "foo/*" allows "foo/bar", "foo/baz", etc. - // e.g. "foo.*" allows "foo.bar", "foo.baz", etc. - // +optional - repeated string allowedUnsafeSysctls = 19; - - // forbiddenSysctls is a list of explicitly forbidden sysctls, defaults to none. - // Each entry is either a plain sysctl name or ends in "*" in which case it is considered - // as a prefix of forbidden sysctls. Single * means all sysctls are forbidden. - // - // Examples: - // e.g. "foo/*" forbids "foo/bar", "foo/baz", etc. - // e.g. "foo.*" forbids "foo.bar", "foo.baz", etc. - // +optional - repeated string forbiddenSysctls = 20; - - // AllowedProcMountTypes is a whitelist of allowed ProcMountTypes. - // Empty or nil indicates that only the DefaultProcMountType may be used. - // This requires the ProcMountType feature flag to be enabled. - // +optional - repeated string allowedProcMountTypes = 21; - - // runtimeClass is the strategy that will dictate the allowable RuntimeClasses for a pod. - // If this field is omitted, the pod's runtimeClassName field is unrestricted. - // Enforcement of this field depends on the RuntimeClass feature gate being enabled. - // +optional - optional RuntimeClassStrategyOptions runtimeClass = 24; -} - -// RunAsGroupStrategyOptions defines the strategy type and any options used to create the strategy. -message RunAsGroupStrategyOptions { - // rule is the strategy that will dictate the allowable RunAsGroup values that may be set. - optional string rule = 1; - - // ranges are the allowed ranges of gids that may be used. If you would like to force a single gid - // then supply a single range with the same start and end. Required for MustRunAs. - // +optional - repeated IDRange ranges = 2; -} - -// RunAsUserStrategyOptions defines the strategy type and any options used to create the strategy. -message RunAsUserStrategyOptions { - // rule is the strategy that will dictate the allowable RunAsUser values that may be set. - optional string rule = 1; - - // ranges are the allowed ranges of uids that may be used. If you would like to force a single uid - // then supply a single range with the same start and end. Required for MustRunAs. - // +optional - repeated IDRange ranges = 2; -} - -// RuntimeClassStrategyOptions define the strategy that will dictate the allowable RuntimeClasses -// for a pod. -message RuntimeClassStrategyOptions { - // allowedRuntimeClassNames is a whitelist of RuntimeClass names that may be specified on a pod. - // A value of "*" means that any RuntimeClass name is allowed, and must be the only item in the - // list. An empty list requires the RuntimeClassName field to be unset. - repeated string allowedRuntimeClassNames = 1; - - // defaultRuntimeClassName is the default RuntimeClassName to set on the pod. - // The default MUST be allowed by the allowedRuntimeClassNames list. - // A value of nil does not mutate the Pod. - // +optional - optional string defaultRuntimeClassName = 2; -} - -// SELinuxStrategyOptions defines the strategy type and any options used to create the strategy. -message SELinuxStrategyOptions { - // rule is the strategy that will dictate the allowable labels that may be set. - optional string rule = 1; - - // seLinuxOptions required to run as; required for MustRunAs - // More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ - // +optional - optional k8s.io.api.core.v1.SELinuxOptions seLinuxOptions = 2; -} - -// SupplementalGroupsStrategyOptions defines the strategy type and options used to create the strategy. -message SupplementalGroupsStrategyOptions { - // rule is the strategy that will dictate what supplemental groups is used in the SecurityContext. - // +optional - optional string rule = 1; - - // ranges are the allowed ranges of supplemental groups. If you would like to force a single - // supplemental group then supply a single range with the same start and end. Required for MustRunAs. - // +optional - repeated IDRange ranges = 2; -} - diff --git a/vendor/k8s.io/api/rbac/v1/generated.proto b/vendor/k8s.io/api/rbac/v1/generated.proto deleted file mode 100644 index 71fa083..0000000 --- a/vendor/k8s.io/api/rbac/v1/generated.proto +++ /dev/null @@ -1,199 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.rbac.v1; - -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1"; - -// AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole -message AggregationRule { - // ClusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. - // If any of the selectors match, then the ClusterRole's permissions will be added - // +optional - repeated k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector clusterRoleSelectors = 1; -} - -// ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. -message ClusterRole { - // Standard object's metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Rules holds all the PolicyRules for this ClusterRole - // +optional - repeated PolicyRule rules = 2; - - // AggregationRule is an optional field that describes how to build the Rules for this ClusterRole. - // If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be - // stomped by the controller. - // +optional - optional AggregationRule aggregationRule = 3; -} - -// ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, -// and adds who information via Subject. -message ClusterRoleBinding { - // Standard object's metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Subjects holds references to the objects the role applies to. - // +optional - repeated Subject subjects = 2; - - // RoleRef can only reference a ClusterRole in the global namespace. - // If the RoleRef cannot be resolved, the Authorizer must return an error. - optional RoleRef roleRef = 3; -} - -// ClusterRoleBindingList is a collection of ClusterRoleBindings -message ClusterRoleBindingList { - // Standard object's metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is a list of ClusterRoleBindings - repeated ClusterRoleBinding items = 2; -} - -// ClusterRoleList is a collection of ClusterRoles -message ClusterRoleList { - // Standard object's metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is a list of ClusterRoles - repeated ClusterRole items = 2; -} - -// PolicyRule holds information that describes a policy rule, but does not contain information -// about who the rule applies to or which namespace the rule applies to. -message PolicyRule { - // Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. VerbAll represents all kinds. - repeated string verbs = 1; - - // APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of - // the enumerated resources in any API group will be allowed. - // +optional - repeated string apiGroups = 2; - - // Resources is a list of resources this rule applies to. ResourceAll represents all resources. - // +optional - repeated string resources = 3; - - // ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. - // +optional - repeated string resourceNames = 4; - - // NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path - // Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. - // Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both. - // +optional - repeated string nonResourceURLs = 5; -} - -// Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. -message Role { - // Standard object's metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Rules holds all the PolicyRules for this Role - // +optional - repeated PolicyRule rules = 2; -} - -// RoleBinding references a role, but does not contain it. It can reference a Role in the same namespace or a ClusterRole in the global namespace. -// It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given -// namespace only have effect in that namespace. -message RoleBinding { - // Standard object's metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Subjects holds references to the objects the role applies to. - // +optional - repeated Subject subjects = 2; - - // RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. - // If the RoleRef cannot be resolved, the Authorizer must return an error. - optional RoleRef roleRef = 3; -} - -// RoleBindingList is a collection of RoleBindings -message RoleBindingList { - // Standard object's metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is a list of RoleBindings - repeated RoleBinding items = 2; -} - -// RoleList is a collection of Roles -message RoleList { - // Standard object's metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is a list of Roles - repeated Role items = 2; -} - -// RoleRef contains information that points to the role being used -message RoleRef { - // APIGroup is the group for the resource being referenced - optional string apiGroup = 1; - - // Kind is the type of resource being referenced - optional string kind = 2; - - // Name is the name of resource being referenced - optional string name = 3; -} - -// Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, -// or a value for non-objects such as user and group names. -message Subject { - // Kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". - // If the Authorizer does not recognized the kind value, the Authorizer should report an error. - optional string kind = 1; - - // APIGroup holds the API group of the referenced subject. - // Defaults to "" for ServiceAccount subjects. - // Defaults to "rbac.authorization.k8s.io" for User and Group subjects. - // +optional - optional string apiGroup = 2; - - // Name of the object being referenced. - optional string name = 3; - - // Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty - // the Authorizer should report an error. - // +optional - optional string namespace = 4; -} - diff --git a/vendor/k8s.io/api/rbac/v1alpha1/generated.proto b/vendor/k8s.io/api/rbac/v1alpha1/generated.proto deleted file mode 100644 index 5c50a87..0000000 --- a/vendor/k8s.io/api/rbac/v1alpha1/generated.proto +++ /dev/null @@ -1,209 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.rbac.v1alpha1; - -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1alpha1"; - -// AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole -message AggregationRule { - // ClusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. - // If any of the selectors match, then the ClusterRole's permissions will be added - // +optional - repeated k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector clusterRoleSelectors = 1; -} - -// ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. -// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRole, and will no longer be served in v1.20. -message ClusterRole { - // Standard object's metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Rules holds all the PolicyRules for this ClusterRole - // +optional - repeated PolicyRule rules = 2; - - // AggregationRule is an optional field that describes how to build the Rules for this ClusterRole. - // If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be - // stomped by the controller. - // +optional - optional AggregationRule aggregationRule = 3; -} - -// ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, -// and adds who information via Subject. -// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBinding, and will no longer be served in v1.20. -message ClusterRoleBinding { - // Standard object's metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Subjects holds references to the objects the role applies to. - // +optional - repeated Subject subjects = 2; - - // RoleRef can only reference a ClusterRole in the global namespace. - // If the RoleRef cannot be resolved, the Authorizer must return an error. - optional RoleRef roleRef = 3; -} - -// ClusterRoleBindingList is a collection of ClusterRoleBindings. -// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBindings, and will no longer be served in v1.20. -message ClusterRoleBindingList { - // Standard object's metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is a list of ClusterRoleBindings - repeated ClusterRoleBinding items = 2; -} - -// ClusterRoleList is a collection of ClusterRoles. -// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoles, and will no longer be served in v1.20. -message ClusterRoleList { - // Standard object's metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is a list of ClusterRoles - repeated ClusterRole items = 2; -} - -// PolicyRule holds information that describes a policy rule, but does not contain information -// about who the rule applies to or which namespace the rule applies to. -message PolicyRule { - // Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. VerbAll represents all kinds. - repeated string verbs = 1; - - // APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of - // the enumerated resources in any API group will be allowed. - // +optional - repeated string apiGroups = 3; - - // Resources is a list of resources this rule applies to. ResourceAll represents all resources. - // +optional - repeated string resources = 4; - - // ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. - // +optional - repeated string resourceNames = 5; - - // NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path - // This name is intentionally different than the internal type so that the DefaultConvert works nicely and because the ordering may be different. - // Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. - // Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both. - // +optional - repeated string nonResourceURLs = 6; -} - -// Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. -// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 Role, and will no longer be served in v1.20. -message Role { - // Standard object's metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Rules holds all the PolicyRules for this Role - // +optional - repeated PolicyRule rules = 2; -} - -// RoleBinding references a role, but does not contain it. It can reference a Role in the same namespace or a ClusterRole in the global namespace. -// It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given -// namespace only have effect in that namespace. -// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBinding, and will no longer be served in v1.20. -message RoleBinding { - // Standard object's metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Subjects holds references to the objects the role applies to. - // +optional - repeated Subject subjects = 2; - - // RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. - // If the RoleRef cannot be resolved, the Authorizer must return an error. - optional RoleRef roleRef = 3; -} - -// RoleBindingList is a collection of RoleBindings -// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBindingList, and will no longer be served in v1.20. -message RoleBindingList { - // Standard object's metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is a list of RoleBindings - repeated RoleBinding items = 2; -} - -// RoleList is a collection of Roles. -// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleList, and will no longer be served in v1.20. -message RoleList { - // Standard object's metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is a list of Roles - repeated Role items = 2; -} - -// RoleRef contains information that points to the role being used -message RoleRef { - // APIGroup is the group for the resource being referenced - optional string apiGroup = 1; - - // Kind is the type of resource being referenced - optional string kind = 2; - - // Name is the name of resource being referenced - optional string name = 3; -} - -// Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, -// or a value for non-objects such as user and group names. -message Subject { - // Kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". - // If the Authorizer does not recognized the kind value, the Authorizer should report an error. - optional string kind = 1; - - // APIVersion holds the API group and version of the referenced subject. - // Defaults to "v1" for ServiceAccount subjects. - // Defaults to "rbac.authorization.k8s.io/v1alpha1" for User and Group subjects. - // +k8s:conversion-gen=false - // +optional - optional string apiVersion = 2; - - // Name of the object being referenced. - optional string name = 3; - - // Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty - // the Authorizer should report an error. - // +optional - optional string namespace = 4; -} - diff --git a/vendor/k8s.io/api/rbac/v1beta1/generated.proto b/vendor/k8s.io/api/rbac/v1beta1/generated.proto deleted file mode 100644 index 87e0dbd..0000000 --- a/vendor/k8s.io/api/rbac/v1beta1/generated.proto +++ /dev/null @@ -1,208 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.rbac.v1beta1; - -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1beta1"; - -// AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole -message AggregationRule { - // ClusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. - // If any of the selectors match, then the ClusterRole's permissions will be added - // +optional - repeated k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector clusterRoleSelectors = 1; -} - -// ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. -// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRole, and will no longer be served in v1.20. -message ClusterRole { - // Standard object's metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Rules holds all the PolicyRules for this ClusterRole - // +optional - repeated PolicyRule rules = 2; - - // AggregationRule is an optional field that describes how to build the Rules for this ClusterRole. - // If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be - // stomped by the controller. - // +optional - optional AggregationRule aggregationRule = 3; -} - -// ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, -// and adds who information via Subject. -// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBinding, and will no longer be served in v1.20. -message ClusterRoleBinding { - // Standard object's metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Subjects holds references to the objects the role applies to. - // +optional - repeated Subject subjects = 2; - - // RoleRef can only reference a ClusterRole in the global namespace. - // If the RoleRef cannot be resolved, the Authorizer must return an error. - optional RoleRef roleRef = 3; -} - -// ClusterRoleBindingList is a collection of ClusterRoleBindings. -// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBindingList, and will no longer be served in v1.20. -message ClusterRoleBindingList { - // Standard object's metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is a list of ClusterRoleBindings - repeated ClusterRoleBinding items = 2; -} - -// ClusterRoleList is a collection of ClusterRoles. -// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoles, and will no longer be served in v1.20. -message ClusterRoleList { - // Standard object's metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is a list of ClusterRoles - repeated ClusterRole items = 2; -} - -// PolicyRule holds information that describes a policy rule, but does not contain information -// about who the rule applies to or which namespace the rule applies to. -message PolicyRule { - // Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. VerbAll represents all kinds. - repeated string verbs = 1; - - // APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of - // the enumerated resources in any API group will be allowed. - // +optional - repeated string apiGroups = 2; - - // Resources is a list of resources this rule applies to. '*' represents all resources in the specified apiGroups. - // '*/foo' represents the subresource 'foo' for all resources in the specified apiGroups. - // +optional - repeated string resources = 3; - - // ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. - // +optional - repeated string resourceNames = 4; - - // NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path - // Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. - // Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both. - // +optional - repeated string nonResourceURLs = 5; -} - -// Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. -// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 Role, and will no longer be served in v1.20. -message Role { - // Standard object's metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Rules holds all the PolicyRules for this Role - // +optional - repeated PolicyRule rules = 2; -} - -// RoleBinding references a role, but does not contain it. It can reference a Role in the same namespace or a ClusterRole in the global namespace. -// It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given -// namespace only have effect in that namespace. -// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBinding, and will no longer be served in v1.20. -message RoleBinding { - // Standard object's metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Subjects holds references to the objects the role applies to. - // +optional - repeated Subject subjects = 2; - - // RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. - // If the RoleRef cannot be resolved, the Authorizer must return an error. - optional RoleRef roleRef = 3; -} - -// RoleBindingList is a collection of RoleBindings -// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBindingList, and will no longer be served in v1.20. -message RoleBindingList { - // Standard object's metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is a list of RoleBindings - repeated RoleBinding items = 2; -} - -// RoleList is a collection of Roles -// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleList, and will no longer be served in v1.20. -message RoleList { - // Standard object's metadata. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is a list of Roles - repeated Role items = 2; -} - -// RoleRef contains information that points to the role being used -message RoleRef { - // APIGroup is the group for the resource being referenced - optional string apiGroup = 1; - - // Kind is the type of resource being referenced - optional string kind = 2; - - // Name is the name of resource being referenced - optional string name = 3; -} - -// Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, -// or a value for non-objects such as user and group names. -message Subject { - // Kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". - // If the Authorizer does not recognized the kind value, the Authorizer should report an error. - optional string kind = 1; - - // APIGroup holds the API group of the referenced subject. - // Defaults to "" for ServiceAccount subjects. - // Defaults to "rbac.authorization.k8s.io" for User and Group subjects. - // +optional - optional string apiGroup = 2; - - // Name of the object being referenced. - optional string name = 3; - - // Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty - // the Authorizer should report an error. - // +optional - optional string namespace = 4; -} - diff --git a/vendor/k8s.io/api/scheduling/v1/generated.proto b/vendor/k8s.io/api/scheduling/v1/generated.proto deleted file mode 100644 index 82f6e0a..0000000 --- a/vendor/k8s.io/api/scheduling/v1/generated.proto +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.scheduling.v1; - -import "k8s.io/api/core/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1"; - -// PriorityClass defines mapping from a priority class name to the priority -// integer value. The value can be any valid integer. -message PriorityClass { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // The value of this priority class. This is the actual priority that pods - // receive when they have the name of this class in their pod spec. - optional int32 value = 2; - - // globalDefault specifies whether this PriorityClass should be considered as - // the default priority for pods that do not have any priority class. - // Only one PriorityClass can be marked as `globalDefault`. However, if more than - // one PriorityClasses exists with their `globalDefault` field set to true, - // the smallest value of such global default PriorityClasses will be used as the default priority. - // +optional - optional bool globalDefault = 3; - - // description is an arbitrary string that usually provides guidelines on - // when this priority class should be used. - // +optional - optional string description = 4; - - // PreemptionPolicy is the Policy for preempting pods with lower priority. - // One of Never, PreemptLowerPriority. - // Defaults to PreemptLowerPriority if unset. - // This field is alpha-level and is only honored by servers that enable the NonPreemptingPriority feature. - // +optional - optional string preemptionPolicy = 5; -} - -// PriorityClassList is a collection of priority classes. -message PriorityClassList { - // Standard list metadata - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // items is the list of PriorityClasses - repeated PriorityClass items = 2; -} - diff --git a/vendor/k8s.io/api/scheduling/v1alpha1/generated.proto b/vendor/k8s.io/api/scheduling/v1alpha1/generated.proto deleted file mode 100644 index 682fb87..0000000 --- a/vendor/k8s.io/api/scheduling/v1alpha1/generated.proto +++ /dev/null @@ -1,76 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.scheduling.v1alpha1; - -import "k8s.io/api/core/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1alpha1"; - -// DEPRECATED - This group version of PriorityClass is deprecated by scheduling.k8s.io/v1/PriorityClass. -// PriorityClass defines mapping from a priority class name to the priority -// integer value. The value can be any valid integer. -message PriorityClass { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // The value of this priority class. This is the actual priority that pods - // receive when they have the name of this class in their pod spec. - optional int32 value = 2; - - // globalDefault specifies whether this PriorityClass should be considered as - // the default priority for pods that do not have any priority class. - // Only one PriorityClass can be marked as `globalDefault`. However, if more than - // one PriorityClasses exists with their `globalDefault` field set to true, - // the smallest value of such global default PriorityClasses will be used as the default priority. - // +optional - optional bool globalDefault = 3; - - // description is an arbitrary string that usually provides guidelines on - // when this priority class should be used. - // +optional - optional string description = 4; - - // PreemptionPolicy is the Policy for preempting pods with lower priority. - // One of Never, PreemptLowerPriority. - // Defaults to PreemptLowerPriority if unset. - // This field is alpha-level and is only honored by servers that enable the NonPreemptingPriority feature. - // +optional - optional string preemptionPolicy = 5; -} - -// PriorityClassList is a collection of priority classes. -message PriorityClassList { - // Standard list metadata - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // items is the list of PriorityClasses - repeated PriorityClass items = 2; -} - diff --git a/vendor/k8s.io/api/scheduling/v1beta1/generated.proto b/vendor/k8s.io/api/scheduling/v1beta1/generated.proto deleted file mode 100644 index 2582891..0000000 --- a/vendor/k8s.io/api/scheduling/v1beta1/generated.proto +++ /dev/null @@ -1,76 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.scheduling.v1beta1; - -import "k8s.io/api/core/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1beta1"; - -// DEPRECATED - This group version of PriorityClass is deprecated by scheduling.k8s.io/v1/PriorityClass. -// PriorityClass defines mapping from a priority class name to the priority -// integer value. The value can be any valid integer. -message PriorityClass { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // The value of this priority class. This is the actual priority that pods - // receive when they have the name of this class in their pod spec. - optional int32 value = 2; - - // globalDefault specifies whether this PriorityClass should be considered as - // the default priority for pods that do not have any priority class. - // Only one PriorityClass can be marked as `globalDefault`. However, if more than - // one PriorityClasses exists with their `globalDefault` field set to true, - // the smallest value of such global default PriorityClasses will be used as the default priority. - // +optional - optional bool globalDefault = 3; - - // description is an arbitrary string that usually provides guidelines on - // when this priority class should be used. - // +optional - optional string description = 4; - - // PreemptionPolicy is the Policy for preempting pods with lower priority. - // One of Never, PreemptLowerPriority. - // Defaults to PreemptLowerPriority if unset. - // This field is alpha-level and is only honored by servers that enable the NonPreemptingPriority feature. - // +optional - optional string preemptionPolicy = 5; -} - -// PriorityClassList is a collection of priority classes. -message PriorityClassList { - // Standard list metadata - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // items is the list of PriorityClasses - repeated PriorityClass items = 2; -} - diff --git a/vendor/k8s.io/api/settings/v1alpha1/generated.proto b/vendor/k8s.io/api/settings/v1alpha1/generated.proto deleted file mode 100644 index db1ec93..0000000 --- a/vendor/k8s.io/api/settings/v1alpha1/generated.proto +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.settings.v1alpha1; - -import "k8s.io/api/core/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1alpha1"; - -// PodPreset is a policy resource that defines additional runtime -// requirements for a Pod. -message PodPreset { - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // +optional - optional PodPresetSpec spec = 2; -} - -// PodPresetList is a list of PodPreset objects. -message PodPresetList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is a list of schema objects. - repeated PodPreset items = 2; -} - -// PodPresetSpec is a description of a pod preset. -message PodPresetSpec { - // Selector is a label query over a set of resources, in this case pods. - // Required. - optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; - - // Env defines the collection of EnvVar to inject into containers. - // +optional - repeated k8s.io.api.core.v1.EnvVar env = 2; - - // EnvFrom defines the collection of EnvFromSource to inject into containers. - // +optional - repeated k8s.io.api.core.v1.EnvFromSource envFrom = 3; - - // Volumes defines the collection of Volume to inject into the pod. - // +optional - repeated k8s.io.api.core.v1.Volume volumes = 4; - - // VolumeMounts defines the collection of VolumeMount to inject into containers. - // +optional - repeated k8s.io.api.core.v1.VolumeMount volumeMounts = 5; -} - diff --git a/vendor/k8s.io/api/storage/v1/generated.proto b/vendor/k8s.io/api/storage/v1/generated.proto deleted file mode 100644 index e5004c8..0000000 --- a/vendor/k8s.io/api/storage/v1/generated.proto +++ /dev/null @@ -1,279 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.storage.v1; - -import "k8s.io/api/core/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1"; - -// CSINode holds information about all CSI drivers installed on a node. -// CSI drivers do not need to create the CSINode object directly. As long as -// they use the node-driver-registrar sidecar container, the kubelet will -// automatically populate the CSINode object for the CSI driver as part of -// kubelet plugin registration. -// CSINode has the same name as a node. If the object is missing, it means either -// there are no CSI Drivers available on the node, or the Kubelet version is low -// enough that it doesn't create this object. -// CSINode has an OwnerReference that points to the corresponding node object. -message CSINode { - // metadata.name must be the Kubernetes node name. - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // spec is the specification of CSINode - optional CSINodeSpec spec = 2; -} - -// CSINodeDriver holds information about the specification of one CSI driver installed on a node -message CSINodeDriver { - // This is the name of the CSI driver that this object refers to. - // This MUST be the same name returned by the CSI GetPluginName() call for - // that driver. - optional string name = 1; - - // nodeID of the node from the driver point of view. - // This field enables Kubernetes to communicate with storage systems that do - // not share the same nomenclature for nodes. For example, Kubernetes may - // refer to a given node as "node1", but the storage system may refer to - // the same node as "nodeA". When Kubernetes issues a command to the storage - // system to attach a volume to a specific node, it can use this field to - // refer to the node name using the ID that the storage system will - // understand, e.g. "nodeA" instead of "node1". This field is required. - optional string nodeID = 2; - - // topologyKeys is the list of keys supported by the driver. - // When a driver is initialized on a cluster, it provides a set of topology - // keys that it understands (e.g. "company.com/zone", "company.com/region"). - // When a driver is initialized on a node, it provides the same topology keys - // along with values. Kubelet will expose these topology keys as labels - // on its own node object. - // When Kubernetes does topology aware provisioning, it can use this list to - // determine which labels it should retrieve from the node object and pass - // back to the driver. - // It is possible for different nodes to use different topology keys. - // This can be empty if driver does not support topology. - // +optional - repeated string topologyKeys = 3; - - // allocatable represents the volume resources of a node that are available for scheduling. - // This field is beta. - // +optional - optional VolumeNodeResources allocatable = 4; -} - -// CSINodeList is a collection of CSINode objects. -message CSINodeList { - // Standard list metadata - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // items is the list of CSINode - repeated CSINode items = 2; -} - -// CSINodeSpec holds information about the specification of all CSI drivers installed on a node -message CSINodeSpec { - // drivers is a list of information of all CSI Drivers existing on a node. - // If all drivers in the list are uninstalled, this can become empty. - // +patchMergeKey=name - // +patchStrategy=merge - repeated CSINodeDriver drivers = 1; -} - -// StorageClass describes the parameters for a class of storage for -// which PersistentVolumes can be dynamically provisioned. -// -// StorageClasses are non-namespaced; the name of the storage class -// according to etcd is in ObjectMeta.Name. -message StorageClass { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Provisioner indicates the type of the provisioner. - optional string provisioner = 2; - - // Parameters holds the parameters for the provisioner that should - // create volumes of this storage class. - // +optional - map parameters = 3; - - // Dynamically provisioned PersistentVolumes of this storage class are - // created with this reclaimPolicy. Defaults to Delete. - // +optional - optional string reclaimPolicy = 4; - - // Dynamically provisioned PersistentVolumes of this storage class are - // created with these mountOptions, e.g. ["ro", "soft"]. Not validated - - // mount of the PVs will simply fail if one is invalid. - // +optional - repeated string mountOptions = 5; - - // AllowVolumeExpansion shows whether the storage class allow volume expand - // +optional - optional bool allowVolumeExpansion = 6; - - // VolumeBindingMode indicates how PersistentVolumeClaims should be - // provisioned and bound. When unset, VolumeBindingImmediate is used. - // This field is only honored by servers that enable the VolumeScheduling feature. - // +optional - optional string volumeBindingMode = 7; - - // Restrict the node topologies where volumes can be dynamically provisioned. - // Each volume plugin defines its own supported topology specifications. - // An empty TopologySelectorTerm list means there is no topology restriction. - // This field is only honored by servers that enable the VolumeScheduling feature. - // +optional - repeated k8s.io.api.core.v1.TopologySelectorTerm allowedTopologies = 8; -} - -// StorageClassList is a collection of storage classes. -message StorageClassList { - // Standard list metadata - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is the list of StorageClasses - repeated StorageClass items = 2; -} - -// VolumeAttachment captures the intent to attach or detach the specified volume -// to/from the specified node. -// -// VolumeAttachment objects are non-namespaced. -message VolumeAttachment { - // Standard object metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Specification of the desired attach/detach volume behavior. - // Populated by the Kubernetes system. - optional VolumeAttachmentSpec spec = 2; - - // Status of the VolumeAttachment request. - // Populated by the entity completing the attach or detach - // operation, i.e. the external-attacher. - // +optional - optional VolumeAttachmentStatus status = 3; -} - -// VolumeAttachmentList is a collection of VolumeAttachment objects. -message VolumeAttachmentList { - // Standard list metadata - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is the list of VolumeAttachments - repeated VolumeAttachment items = 2; -} - -// VolumeAttachmentSource represents a volume that should be attached. -// Right now only PersistenVolumes can be attached via external attacher, -// in future we may allow also inline volumes in pods. -// Exactly one member can be set. -message VolumeAttachmentSource { - // Name of the persistent volume to attach. - // +optional - optional string persistentVolumeName = 1; - - // inlineVolumeSpec contains all the information necessary to attach - // a persistent volume defined by a pod's inline VolumeSource. This field - // is populated only for the CSIMigration feature. It contains - // translated fields from a pod's inline VolumeSource to a - // PersistentVolumeSpec. This field is alpha-level and is only - // honored by servers that enabled the CSIMigration feature. - // +optional - optional k8s.io.api.core.v1.PersistentVolumeSpec inlineVolumeSpec = 2; -} - -// VolumeAttachmentSpec is the specification of a VolumeAttachment request. -message VolumeAttachmentSpec { - // Attacher indicates the name of the volume driver that MUST handle this - // request. This is the name returned by GetPluginName(). - optional string attacher = 1; - - // Source represents the volume that should be attached. - optional VolumeAttachmentSource source = 2; - - // The node that the volume should be attached to. - optional string nodeName = 3; -} - -// VolumeAttachmentStatus is the status of a VolumeAttachment request. -message VolumeAttachmentStatus { - // Indicates the volume is successfully attached. - // This field must only be set by the entity completing the attach - // operation, i.e. the external-attacher. - optional bool attached = 1; - - // Upon successful attach, this field is populated with any - // information returned by the attach operation that must be passed - // into subsequent WaitForAttach or Mount calls. - // This field must only be set by the entity completing the attach - // operation, i.e. the external-attacher. - // +optional - map attachmentMetadata = 2; - - // The last error encountered during attach operation, if any. - // This field must only be set by the entity completing the attach - // operation, i.e. the external-attacher. - // +optional - optional VolumeError attachError = 3; - - // The last error encountered during detach operation, if any. - // This field must only be set by the entity completing the detach - // operation, i.e. the external-attacher. - // +optional - optional VolumeError detachError = 4; -} - -// VolumeError captures an error encountered during a volume operation. -message VolumeError { - // Time the error was encountered. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time time = 1; - - // String detailing the error encountered during Attach or Detach operation. - // This string may be logged, so it should not contain sensitive - // information. - // +optional - optional string message = 2; -} - -// VolumeNodeResources is a set of resource limits for scheduling of volumes. -message VolumeNodeResources { - // Maximum number of unique volumes managed by the CSI driver that can be used on a node. - // A volume that is both attached and mounted on a node is considered to be used once, not twice. - // The same rule applies for a unique volume that is shared among multiple pods on the same node. - // If this field is not specified, then the supported number of volumes on this node is unbounded. - // +optional - optional int32 count = 1; -} - diff --git a/vendor/k8s.io/api/storage/v1alpha1/generated.proto b/vendor/k8s.io/api/storage/v1alpha1/generated.proto deleted file mode 100644 index 7601963..0000000 --- a/vendor/k8s.io/api/storage/v1alpha1/generated.proto +++ /dev/null @@ -1,136 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.storage.v1alpha1; - -import "k8s.io/api/core/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1alpha1"; - -// VolumeAttachment captures the intent to attach or detach the specified volume -// to/from the specified node. -// -// VolumeAttachment objects are non-namespaced. -message VolumeAttachment { - // Standard object metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Specification of the desired attach/detach volume behavior. - // Populated by the Kubernetes system. - optional VolumeAttachmentSpec spec = 2; - - // Status of the VolumeAttachment request. - // Populated by the entity completing the attach or detach - // operation, i.e. the external-attacher. - // +optional - optional VolumeAttachmentStatus status = 3; -} - -// VolumeAttachmentList is a collection of VolumeAttachment objects. -message VolumeAttachmentList { - // Standard list metadata - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is the list of VolumeAttachments - repeated VolumeAttachment items = 2; -} - -// VolumeAttachmentSource represents a volume that should be attached. -// Right now only PersistenVolumes can be attached via external attacher, -// in future we may allow also inline volumes in pods. -// Exactly one member can be set. -message VolumeAttachmentSource { - // Name of the persistent volume to attach. - // +optional - optional string persistentVolumeName = 1; - - // inlineVolumeSpec contains all the information necessary to attach - // a persistent volume defined by a pod's inline VolumeSource. This field - // is populated only for the CSIMigration feature. It contains - // translated fields from a pod's inline VolumeSource to a - // PersistentVolumeSpec. This field is alpha-level and is only - // honored by servers that enabled the CSIMigration feature. - // +optional - optional k8s.io.api.core.v1.PersistentVolumeSpec inlineVolumeSpec = 2; -} - -// VolumeAttachmentSpec is the specification of a VolumeAttachment request. -message VolumeAttachmentSpec { - // Attacher indicates the name of the volume driver that MUST handle this - // request. This is the name returned by GetPluginName(). - optional string attacher = 1; - - // Source represents the volume that should be attached. - optional VolumeAttachmentSource source = 2; - - // The node that the volume should be attached to. - optional string nodeName = 3; -} - -// VolumeAttachmentStatus is the status of a VolumeAttachment request. -message VolumeAttachmentStatus { - // Indicates the volume is successfully attached. - // This field must only be set by the entity completing the attach - // operation, i.e. the external-attacher. - optional bool attached = 1; - - // Upon successful attach, this field is populated with any - // information returned by the attach operation that must be passed - // into subsequent WaitForAttach or Mount calls. - // This field must only be set by the entity completing the attach - // operation, i.e. the external-attacher. - // +optional - map attachmentMetadata = 2; - - // The last error encountered during attach operation, if any. - // This field must only be set by the entity completing the attach - // operation, i.e. the external-attacher. - // +optional - optional VolumeError attachError = 3; - - // The last error encountered during detach operation, if any. - // This field must only be set by the entity completing the detach - // operation, i.e. the external-attacher. - // +optional - optional VolumeError detachError = 4; -} - -// VolumeError captures an error encountered during a volume operation. -message VolumeError { - // Time the error was encountered. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time time = 1; - - // String detailing the error encountered during Attach or Detach operation. - // This string maybe logged, so it should not contain sensitive - // information. - // +optional - optional string message = 2; -} - diff --git a/vendor/k8s.io/api/storage/v1beta1/generated.proto b/vendor/k8s.io/api/storage/v1beta1/generated.proto deleted file mode 100644 index 373a154..0000000 --- a/vendor/k8s.io/api/storage/v1beta1/generated.proto +++ /dev/null @@ -1,372 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.api.storage.v1beta1; - -import "k8s.io/api/core/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1beta1"; - -// CSIDriver captures information about a Container Storage Interface (CSI) -// volume driver deployed on the cluster. -// CSI drivers do not need to create the CSIDriver object directly. Instead they may use the -// cluster-driver-registrar sidecar container. When deployed with a CSI driver it automatically -// creates a CSIDriver object representing the driver. -// Kubernetes attach detach controller uses this object to determine whether attach is required. -// Kubelet uses this object to determine whether pod information needs to be passed on mount. -// CSIDriver objects are non-namespaced. -message CSIDriver { - // Standard object metadata. - // metadata.Name indicates the name of the CSI driver that this object - // refers to; it MUST be the same name returned by the CSI GetPluginName() - // call for that driver. - // The driver name must be 63 characters or less, beginning and ending with - // an alphanumeric character ([a-z0-9A-Z]) with dashes (-), dots (.), and - // alphanumerics between. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Specification of the CSI Driver. - optional CSIDriverSpec spec = 2; -} - -// CSIDriverList is a collection of CSIDriver objects. -message CSIDriverList { - // Standard list metadata - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // items is the list of CSIDriver - repeated CSIDriver items = 2; -} - -// CSIDriverSpec is the specification of a CSIDriver. -message CSIDriverSpec { - // attachRequired indicates this CSI volume driver requires an attach - // operation (because it implements the CSI ControllerPublishVolume() - // method), and that the Kubernetes attach detach controller should call - // the attach volume interface which checks the volumeattachment status - // and waits until the volume is attached before proceeding to mounting. - // The CSI external-attacher coordinates with CSI volume driver and updates - // the volumeattachment status when the attach operation is complete. - // If the CSIDriverRegistry feature gate is enabled and the value is - // specified to false, the attach operation will be skipped. - // Otherwise the attach operation will be called. - // +optional - optional bool attachRequired = 1; - - // If set to true, podInfoOnMount indicates this CSI volume driver - // requires additional pod information (like podName, podUID, etc.) during - // mount operations. - // If set to false, pod information will not be passed on mount. - // Default is false. - // The CSI driver specifies podInfoOnMount as part of driver deployment. - // If true, Kubelet will pass pod information as VolumeContext in the CSI - // NodePublishVolume() calls. - // The CSI driver is responsible for parsing and validating the information - // passed in as VolumeContext. - // The following VolumeConext will be passed if podInfoOnMount is set to true. - // This list might grow, but the prefix will be used. - // "csi.storage.k8s.io/pod.name": pod.Name - // "csi.storage.k8s.io/pod.namespace": pod.Namespace - // "csi.storage.k8s.io/pod.uid": string(pod.UID) - // "csi.storage.k8s.io/ephemeral": "true" iff the volume is an ephemeral inline volume - // defined by a CSIVolumeSource, otherwise "false" - // - // "csi.storage.k8s.io/ephemeral" is a new feature in Kubernetes 1.16. It is only - // required for drivers which support both the "Persistent" and "Ephemeral" VolumeLifecycleMode. - // Other drivers can leave pod info disabled and/or ignore this field. - // As Kubernetes 1.15 doesn't support this field, drivers can only support one mode when - // deployed on such a cluster and the deployment determines which mode that is, for example - // via a command line parameter of the driver. - // +optional - optional bool podInfoOnMount = 2; - - // VolumeLifecycleModes defines what kind of volumes this CSI volume driver supports. - // The default if the list is empty is "Persistent", which is the usage - // defined by the CSI specification and implemented in Kubernetes via the usual - // PV/PVC mechanism. - // The other mode is "Ephemeral". In this mode, volumes are defined inline - // inside the pod spec with CSIVolumeSource and their lifecycle is tied to - // the lifecycle of that pod. A driver has to be aware of this - // because it is only going to get a NodePublishVolume call for such a volume. - // For more information about implementing this mode, see - // https://kubernetes-csi.github.io/docs/ephemeral-local-volumes.html - // A driver can support one or more of these modes and - // more modes may be added in the future. - // +optional - repeated string volumeLifecycleModes = 3; -} - -// DEPRECATED - This group version of CSINode is deprecated by storage/v1/CSINode. -// See the release notes for more information. -// CSINode holds information about all CSI drivers installed on a node. -// CSI drivers do not need to create the CSINode object directly. As long as -// they use the node-driver-registrar sidecar container, the kubelet will -// automatically populate the CSINode object for the CSI driver as part of -// kubelet plugin registration. -// CSINode has the same name as a node. If the object is missing, it means either -// there are no CSI Drivers available on the node, or the Kubelet version is low -// enough that it doesn't create this object. -// CSINode has an OwnerReference that points to the corresponding node object. -message CSINode { - // metadata.name must be the Kubernetes node name. - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // spec is the specification of CSINode - optional CSINodeSpec spec = 2; -} - -// CSINodeDriver holds information about the specification of one CSI driver installed on a node -message CSINodeDriver { - // This is the name of the CSI driver that this object refers to. - // This MUST be the same name returned by the CSI GetPluginName() call for - // that driver. - optional string name = 1; - - // nodeID of the node from the driver point of view. - // This field enables Kubernetes to communicate with storage systems that do - // not share the same nomenclature for nodes. For example, Kubernetes may - // refer to a given node as "node1", but the storage system may refer to - // the same node as "nodeA". When Kubernetes issues a command to the storage - // system to attach a volume to a specific node, it can use this field to - // refer to the node name using the ID that the storage system will - // understand, e.g. "nodeA" instead of "node1". This field is required. - optional string nodeID = 2; - - // topologyKeys is the list of keys supported by the driver. - // When a driver is initialized on a cluster, it provides a set of topology - // keys that it understands (e.g. "company.com/zone", "company.com/region"). - // When a driver is initialized on a node, it provides the same topology keys - // along with values. Kubelet will expose these topology keys as labels - // on its own node object. - // When Kubernetes does topology aware provisioning, it can use this list to - // determine which labels it should retrieve from the node object and pass - // back to the driver. - // It is possible for different nodes to use different topology keys. - // This can be empty if driver does not support topology. - // +optional - repeated string topologyKeys = 3; - - // allocatable represents the volume resources of a node that are available for scheduling. - // +optional - optional VolumeNodeResources allocatable = 4; -} - -// CSINodeList is a collection of CSINode objects. -message CSINodeList { - // Standard list metadata - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // items is the list of CSINode - repeated CSINode items = 2; -} - -// CSINodeSpec holds information about the specification of all CSI drivers installed on a node -message CSINodeSpec { - // drivers is a list of information of all CSI Drivers existing on a node. - // If all drivers in the list are uninstalled, this can become empty. - // +patchMergeKey=name - // +patchStrategy=merge - repeated CSINodeDriver drivers = 1; -} - -// StorageClass describes the parameters for a class of storage for -// which PersistentVolumes can be dynamically provisioned. -// -// StorageClasses are non-namespaced; the name of the storage class -// according to etcd is in ObjectMeta.Name. -message StorageClass { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Provisioner indicates the type of the provisioner. - optional string provisioner = 2; - - // Parameters holds the parameters for the provisioner that should - // create volumes of this storage class. - // +optional - map parameters = 3; - - // Dynamically provisioned PersistentVolumes of this storage class are - // created with this reclaimPolicy. Defaults to Delete. - // +optional - optional string reclaimPolicy = 4; - - // Dynamically provisioned PersistentVolumes of this storage class are - // created with these mountOptions, e.g. ["ro", "soft"]. Not validated - - // mount of the PVs will simply fail if one is invalid. - // +optional - repeated string mountOptions = 5; - - // AllowVolumeExpansion shows whether the storage class allow volume expand - // +optional - optional bool allowVolumeExpansion = 6; - - // VolumeBindingMode indicates how PersistentVolumeClaims should be - // provisioned and bound. When unset, VolumeBindingImmediate is used. - // This field is only honored by servers that enable the VolumeScheduling feature. - // +optional - optional string volumeBindingMode = 7; - - // Restrict the node topologies where volumes can be dynamically provisioned. - // Each volume plugin defines its own supported topology specifications. - // An empty TopologySelectorTerm list means there is no topology restriction. - // This field is only honored by servers that enable the VolumeScheduling feature. - // +optional - repeated k8s.io.api.core.v1.TopologySelectorTerm allowedTopologies = 8; -} - -// StorageClassList is a collection of storage classes. -message StorageClassList { - // Standard list metadata - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is the list of StorageClasses - repeated StorageClass items = 2; -} - -// VolumeAttachment captures the intent to attach or detach the specified volume -// to/from the specified node. -// -// VolumeAttachment objects are non-namespaced. -message VolumeAttachment { - // Standard object metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Specification of the desired attach/detach volume behavior. - // Populated by the Kubernetes system. - optional VolumeAttachmentSpec spec = 2; - - // Status of the VolumeAttachment request. - // Populated by the entity completing the attach or detach - // operation, i.e. the external-attacher. - // +optional - optional VolumeAttachmentStatus status = 3; -} - -// VolumeAttachmentList is a collection of VolumeAttachment objects. -message VolumeAttachmentList { - // Standard list metadata - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is the list of VolumeAttachments - repeated VolumeAttachment items = 2; -} - -// VolumeAttachmentSource represents a volume that should be attached. -// Right now only PersistenVolumes can be attached via external attacher, -// in future we may allow also inline volumes in pods. -// Exactly one member can be set. -message VolumeAttachmentSource { - // Name of the persistent volume to attach. - // +optional - optional string persistentVolumeName = 1; - - // inlineVolumeSpec contains all the information necessary to attach - // a persistent volume defined by a pod's inline VolumeSource. This field - // is populated only for the CSIMigration feature. It contains - // translated fields from a pod's inline VolumeSource to a - // PersistentVolumeSpec. This field is alpha-level and is only - // honored by servers that enabled the CSIMigration feature. - // +optional - optional k8s.io.api.core.v1.PersistentVolumeSpec inlineVolumeSpec = 2; -} - -// VolumeAttachmentSpec is the specification of a VolumeAttachment request. -message VolumeAttachmentSpec { - // Attacher indicates the name of the volume driver that MUST handle this - // request. This is the name returned by GetPluginName(). - optional string attacher = 1; - - // Source represents the volume that should be attached. - optional VolumeAttachmentSource source = 2; - - // The node that the volume should be attached to. - optional string nodeName = 3; -} - -// VolumeAttachmentStatus is the status of a VolumeAttachment request. -message VolumeAttachmentStatus { - // Indicates the volume is successfully attached. - // This field must only be set by the entity completing the attach - // operation, i.e. the external-attacher. - optional bool attached = 1; - - // Upon successful attach, this field is populated with any - // information returned by the attach operation that must be passed - // into subsequent WaitForAttach or Mount calls. - // This field must only be set by the entity completing the attach - // operation, i.e. the external-attacher. - // +optional - map attachmentMetadata = 2; - - // The last error encountered during attach operation, if any. - // This field must only be set by the entity completing the attach - // operation, i.e. the external-attacher. - // +optional - optional VolumeError attachError = 3; - - // The last error encountered during detach operation, if any. - // This field must only be set by the entity completing the detach - // operation, i.e. the external-attacher. - // +optional - optional VolumeError detachError = 4; -} - -// VolumeError captures an error encountered during a volume operation. -message VolumeError { - // Time the error was encountered. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time time = 1; - - // String detailing the error encountered during Attach or Detach operation. - // This string may be logged, so it should not contain sensitive - // information. - // +optional - optional string message = 2; -} - -// VolumeNodeResources is a set of resource limits for scheduling of volumes. -message VolumeNodeResources { - // Maximum number of unique volumes managed by the CSI driver that can be used on a node. - // A volume that is both attached and mounted on a node is considered to be used once, not twice. - // The same rule applies for a unique volume that is shared among multiple pods on the same node. - // If this field is nil, then the supported number of volumes on this node is unbounded. - // +optional - optional int32 count = 1; -} - diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.proto b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.proto deleted file mode 100644 index de4229c..0000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.proto +++ /dev/null @@ -1,631 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1; - -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1"; - -// ConversionRequest describes the conversion request parameters. -message ConversionRequest { - // uid is an identifier for the individual request/response. It allows distinguishing instances of requests which are - // otherwise identical (parallel requests, etc). - // The UID is meant to track the round trip (request/response) between the Kubernetes API server and the webhook, not the user request. - // It is suitable for correlating log entries between the webhook and apiserver, for either auditing or debugging. - optional string uid = 1; - - // desiredAPIVersion is the version to convert given objects to. e.g. "myapi.example.com/v1" - optional string desiredAPIVersion = 2; - - // objects is the list of custom resource objects to be converted. - repeated k8s.io.apimachinery.pkg.runtime.RawExtension objects = 3; -} - -// ConversionResponse describes a conversion response. -message ConversionResponse { - // uid is an identifier for the individual request/response. - // This should be copied over from the corresponding `request.uid`. - optional string uid = 1; - - // convertedObjects is the list of converted version of `request.objects` if the `result` is successful, otherwise empty. - // The webhook is expected to set `apiVersion` of these objects to the `request.desiredAPIVersion`. The list - // must also have the same size as the input list with the same objects in the same order (equal kind, metadata.uid, metadata.name and metadata.namespace). - // The webhook is allowed to mutate labels and annotations. Any other change to the metadata is silently ignored. - repeated k8s.io.apimachinery.pkg.runtime.RawExtension convertedObjects = 2; - - // result contains the result of conversion with extra details if the conversion failed. `result.status` determines if - // the conversion failed or succeeded. The `result.status` field is required and represents the success or failure of the - // conversion. A successful conversion must set `result.status` to `Success`. A failed conversion must set - // `result.status` to `Failure` and provide more details in `result.message` and return http status 200. The `result.message` - // will be used to construct an error message for the end user. - optional k8s.io.apimachinery.pkg.apis.meta.v1.Status result = 3; -} - -// ConversionReview describes a conversion request/response. -message ConversionReview { - // request describes the attributes for the conversion request. - // +optional - optional ConversionRequest request = 1; - - // response describes the attributes for the conversion response. - // +optional - optional ConversionResponse response = 2; -} - -// CustomResourceColumnDefinition specifies a column for server side printing. -message CustomResourceColumnDefinition { - // name is a human readable name for the column. - optional string name = 1; - - // type is an OpenAPI type definition for this column. - // See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details. - optional string type = 2; - - // format is an optional OpenAPI type definition for this column. The 'name' format is applied - // to the primary identifier column to assist in clients identifying column is the resource name. - // See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details. - // +optional - optional string format = 3; - - // description is a human readable description of this column. - // +optional - optional string description = 4; - - // priority is an integer defining the relative importance of this column compared to others. Lower - // numbers are considered higher priority. Columns that may be omitted in limited space scenarios - // should be given a priority greater than 0. - // +optional - optional int32 priority = 5; - - // jsonPath is a simple JSON path (i.e. with array notation) which is evaluated against - // each custom resource to produce the value for this column. - optional string jsonPath = 6; -} - -// CustomResourceConversion describes how to convert different versions of a CR. -message CustomResourceConversion { - // strategy specifies how custom resources are converted between versions. Allowed values are: - // - `None`: The converter only change the apiVersion and would not touch any other field in the custom resource. - // - `Webhook`: API Server will call to an external webhook to do the conversion. Additional information - // is needed for this option. This requires spec.preserveUnknownFields to be false, and spec.conversion.webhook to be set. - optional string strategy = 1; - - // webhook describes how to call the conversion webhook. Required when `strategy` is set to `Webhook`. - // +optional - optional WebhookConversion webhook = 2; -} - -// CustomResourceDefinition represents a resource that should be exposed on the API server. Its name MUST be in the format -// <.spec.name>.<.spec.group>. -message CustomResourceDefinition { - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // spec describes how the user wants the resources to appear - optional CustomResourceDefinitionSpec spec = 2; - - // status indicates the actual state of the CustomResourceDefinition - // +optional - optional CustomResourceDefinitionStatus status = 3; -} - -// CustomResourceDefinitionCondition contains details for the current condition of this pod. -message CustomResourceDefinitionCondition { - // type is the type of the condition. Types include Established, NamesAccepted and Terminating. - optional string type = 1; - - // status is the status of the condition. - // Can be True, False, Unknown. - optional string status = 2; - - // lastTransitionTime last time the condition transitioned from one status to another. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; - - // reason is a unique, one-word, CamelCase reason for the condition's last transition. - // +optional - optional string reason = 4; - - // message is a human-readable message indicating details about last transition. - // +optional - optional string message = 5; -} - -// CustomResourceDefinitionList is a list of CustomResourceDefinition objects. -message CustomResourceDefinitionList { - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // items list individual CustomResourceDefinition objects - repeated CustomResourceDefinition items = 2; -} - -// CustomResourceDefinitionNames indicates the names to serve this CustomResourceDefinition -message CustomResourceDefinitionNames { - // plural is the plural name of the resource to serve. - // The custom resources are served under `/apis///.../`. - // Must match the name of the CustomResourceDefinition (in the form `.`). - // Must be all lowercase. - optional string plural = 1; - - // singular is the singular name of the resource. It must be all lowercase. Defaults to lowercased `kind`. - // +optional - optional string singular = 2; - - // shortNames are short names for the resource, exposed in API discovery documents, - // and used by clients to support invocations like `kubectl get `. - // It must be all lowercase. - // +optional - repeated string shortNames = 3; - - // kind is the serialized kind of the resource. It is normally CamelCase and singular. - // Custom resource instances will use this value as the `kind` attribute in API calls. - optional string kind = 4; - - // listKind is the serialized kind of the list for this resource. Defaults to "`kind`List". - // +optional - optional string listKind = 5; - - // categories is a list of grouped resources this custom resource belongs to (e.g. 'all'). - // This is published in API discovery documents, and used by clients to support invocations like - // `kubectl get all`. - // +optional - repeated string categories = 6; -} - -// CustomResourceDefinitionSpec describes how a user wants their resource to appear -message CustomResourceDefinitionSpec { - // group is the API group of the defined custom resource. - // The custom resources are served under `/apis//...`. - // Must match the name of the CustomResourceDefinition (in the form `.`). - optional string group = 1; - - // names specify the resource and kind names for the custom resource. - optional CustomResourceDefinitionNames names = 3; - - // scope indicates whether the defined custom resource is cluster- or namespace-scoped. - // Allowed values are `Cluster` and `Namespaced`. - optional string scope = 4; - - // versions is the list of all API versions of the defined custom resource. - // Version names are used to compute the order in which served versions are listed in API discovery. - // If the version string is "kube-like", it will sort above non "kube-like" version strings, which are ordered - // lexicographically. "Kube-like" versions start with a "v", then are followed by a number (the major version), - // then optionally the string "alpha" or "beta" and another number (the minor version). These are sorted first - // by GA > beta > alpha (where GA is a version with no suffix such as beta or alpha), and then by comparing - // major version, then minor version. An example sorted list of versions: - // v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10. - repeated CustomResourceDefinitionVersion versions = 7; - - // conversion defines conversion settings for the CRD. - // +optional - optional CustomResourceConversion conversion = 9; - - // preserveUnknownFields indicates that object fields which are not specified - // in the OpenAPI schema should be preserved when persisting to storage. - // apiVersion, kind, metadata and known fields inside metadata are always preserved. - // This field is deprecated in favor of setting `x-preserve-unknown-fields` to true in `spec.versions[*].schema.openAPIV3Schema`. - // See https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#pruning-versus-preserving-unknown-fields for details. - // +optional - optional bool preserveUnknownFields = 10; -} - -// CustomResourceDefinitionStatus indicates the state of the CustomResourceDefinition -message CustomResourceDefinitionStatus { - // conditions indicate state for particular aspects of a CustomResourceDefinition - // +optional - repeated CustomResourceDefinitionCondition conditions = 1; - - // acceptedNames are the names that are actually being used to serve discovery. - // They may be different than the names in spec. - optional CustomResourceDefinitionNames acceptedNames = 2; - - // storedVersions lists all versions of CustomResources that were ever persisted. Tracking these - // versions allows a migration path for stored versions in etcd. The field is mutable - // so a migration controller can finish a migration to another version (ensuring - // no old objects are left in storage), and then remove the rest of the - // versions from this list. - // Versions may not be removed from `spec.versions` while they exist in this list. - repeated string storedVersions = 3; -} - -// CustomResourceDefinitionVersion describes a version for CRD. -message CustomResourceDefinitionVersion { - // name is the version name, e.g. “v1”, “v2beta1”, etc. - // The custom resources are served under this version at `/apis///...` if `served` is true. - optional string name = 1; - - // served is a flag enabling/disabling this version from being served via REST APIs - optional bool served = 2; - - // storage indicates this version should be used when persisting custom resources to storage. - // There must be exactly one version with storage=true. - optional bool storage = 3; - - // schema describes the schema used for validation, pruning, and defaulting of this version of the custom resource. - // +optional - optional CustomResourceValidation schema = 4; - - // subresources specify what subresources this version of the defined custom resource have. - // +optional - optional CustomResourceSubresources subresources = 5; - - // additionalPrinterColumns specifies additional columns returned in Table output. - // See https://kubernetes.io/docs/reference/using-api/api-concepts/#receiving-resources-as-tables for details. - // If no columns are specified, a single column displaying the age of the custom resource is used. - // +optional - repeated CustomResourceColumnDefinition additionalPrinterColumns = 6; -} - -// CustomResourceSubresourceScale defines how to serve the scale subresource for CustomResources. -message CustomResourceSubresourceScale { - // specReplicasPath defines the JSON path inside of a custom resource that corresponds to Scale `spec.replicas`. - // Only JSON paths without the array notation are allowed. - // Must be a JSON Path under `.spec`. - // If there is no value under the given path in the custom resource, the `/scale` subresource will return an error on GET. - optional string specReplicasPath = 1; - - // statusReplicasPath defines the JSON path inside of a custom resource that corresponds to Scale `status.replicas`. - // Only JSON paths without the array notation are allowed. - // Must be a JSON Path under `.status`. - // If there is no value under the given path in the custom resource, the `status.replicas` value in the `/scale` subresource - // will default to 0. - optional string statusReplicasPath = 2; - - // labelSelectorPath defines the JSON path inside of a custom resource that corresponds to Scale `status.selector`. - // Only JSON paths without the array notation are allowed. - // Must be a JSON Path under `.status` or `.spec`. - // Must be set to work with HorizontalPodAutoscaler. - // The field pointed by this JSON path must be a string field (not a complex selector struct) - // which contains a serialized label selector in string form. - // More info: https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions#scale-subresource - // If there is no value under the given path in the custom resource, the `status.selector` value in the `/scale` - // subresource will default to the empty string. - // +optional - optional string labelSelectorPath = 3; -} - -// CustomResourceSubresourceStatus defines how to serve the status subresource for CustomResources. -// Status is represented by the `.status` JSON path inside of a CustomResource. When set, -// * exposes a /status subresource for the custom resource -// * PUT requests to the /status subresource take a custom resource object, and ignore changes to anything except the status stanza -// * PUT/POST/PATCH requests to the custom resource ignore changes to the status stanza -message CustomResourceSubresourceStatus { -} - -// CustomResourceSubresources defines the status and scale subresources for CustomResources. -message CustomResourceSubresources { - // status indicates the custom resource should serve a `/status` subresource. - // When enabled: - // 1. requests to the custom resource primary endpoint ignore changes to the `status` stanza of the object. - // 2. requests to the custom resource `/status` subresource ignore changes to anything other than the `status` stanza of the object. - // +optional - optional CustomResourceSubresourceStatus status = 1; - - // scale indicates the custom resource should serve a `/scale` subresource that returns an `autoscaling/v1` Scale object. - // +optional - optional CustomResourceSubresourceScale scale = 2; -} - -// CustomResourceValidation is a list of validation methods for CustomResources. -message CustomResourceValidation { - // openAPIV3Schema is the OpenAPI v3 schema to use for validation and pruning. - // +optional - optional JSONSchemaProps openAPIV3Schema = 1; -} - -// ExternalDocumentation allows referencing an external resource for extended documentation. -message ExternalDocumentation { - optional string description = 1; - - optional string url = 2; -} - -// JSON represents any valid JSON value. -// These types are supported: bool, int64, float64, string, []interface{}, map[string]interface{} and nil. -message JSON { - optional bytes raw = 1; -} - -// JSONSchemaProps is a JSON-Schema following Specification Draft 4 (http://json-schema.org/). -message JSONSchemaProps { - optional string id = 1; - - optional string schema = 2; - - optional string ref = 3; - - optional string description = 4; - - optional string type = 5; - - // format is an OpenAPI v3 format string. Unknown formats are ignored. The following formats are validated: - // - // - bsonobjectid: a bson object ID, i.e. a 24 characters hex string - // - uri: an URI as parsed by Golang net/url.ParseRequestURI - // - email: an email address as parsed by Golang net/mail.ParseAddress - // - hostname: a valid representation for an Internet host name, as defined by RFC 1034, section 3.1 [RFC1034]. - // - ipv4: an IPv4 IP as parsed by Golang net.ParseIP - // - ipv6: an IPv6 IP as parsed by Golang net.ParseIP - // - cidr: a CIDR as parsed by Golang net.ParseCIDR - // - mac: a MAC address as parsed by Golang net.ParseMAC - // - uuid: an UUID that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$ - // - uuid3: an UUID3 that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?3[0-9a-f]{3}-?[0-9a-f]{4}-?[0-9a-f]{12}$ - // - uuid4: an UUID4 that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?4[0-9a-f]{3}-?[89ab][0-9a-f]{3}-?[0-9a-f]{12}$ - // - uuid5: an UUID5 that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?5[0-9a-f]{3}-?[89ab][0-9a-f]{3}-?[0-9a-f]{12}$ - // - isbn: an ISBN10 or ISBN13 number string like "0321751043" or "978-0321751041" - // - isbn10: an ISBN10 number string like "0321751043" - // - isbn13: an ISBN13 number string like "978-0321751041" - // - creditcard: a credit card number defined by the regex ^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\d{3})\\d{11})$ with any non digit characters mixed in - // - ssn: a U.S. social security number following the regex ^\\d{3}[- ]?\\d{2}[- ]?\\d{4}$ - // - hexcolor: an hexadecimal color code like "#FFFFFF: following the regex ^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$ - // - rgbcolor: an RGB color code like rgb like "rgb(255,255,2559" - // - byte: base64 encoded binary data - // - password: any kind of string - // - date: a date string like "2006-01-02" as defined by full-date in RFC3339 - // - duration: a duration string like "22 ns" as parsed by Golang time.ParseDuration or compatible with Scala duration format - // - datetime: a date time string like "2014-12-15T19:30:20.000Z" as defined by date-time in RFC3339. - optional string format = 6; - - optional string title = 7; - - // default is a default value for undefined object fields. - // Defaulting is a beta feature under the CustomResourceDefaulting feature gate. - // Defaulting requires spec.preserveUnknownFields to be false. - optional JSON default = 8; - - optional double maximum = 9; - - optional bool exclusiveMaximum = 10; - - optional double minimum = 11; - - optional bool exclusiveMinimum = 12; - - optional int64 maxLength = 13; - - optional int64 minLength = 14; - - optional string pattern = 15; - - optional int64 maxItems = 16; - - optional int64 minItems = 17; - - optional bool uniqueItems = 18; - - optional double multipleOf = 19; - - repeated JSON enum = 20; - - optional int64 maxProperties = 21; - - optional int64 minProperties = 22; - - repeated string required = 23; - - optional JSONSchemaPropsOrArray items = 24; - - repeated JSONSchemaProps allOf = 25; - - repeated JSONSchemaProps oneOf = 26; - - repeated JSONSchemaProps anyOf = 27; - - optional JSONSchemaProps not = 28; - - map properties = 29; - - optional JSONSchemaPropsOrBool additionalProperties = 30; - - map patternProperties = 31; - - map dependencies = 32; - - optional JSONSchemaPropsOrBool additionalItems = 33; - - map definitions = 34; - - optional ExternalDocumentation externalDocs = 35; - - optional JSON example = 36; - - optional bool nullable = 37; - - // x-kubernetes-preserve-unknown-fields stops the API server - // decoding step from pruning fields which are not specified - // in the validation schema. This affects fields recursively, - // but switches back to normal pruning behaviour if nested - // properties or additionalProperties are specified in the schema. - // This can either be true or undefined. False is forbidden. - optional bool xKubernetesPreserveUnknownFields = 38; - - // x-kubernetes-embedded-resource defines that the value is an - // embedded Kubernetes runtime.Object, with TypeMeta and - // ObjectMeta. The type must be object. It is allowed to further - // restrict the embedded object. kind, apiVersion and metadata - // are validated automatically. x-kubernetes-preserve-unknown-fields - // is allowed to be true, but does not have to be if the object - // is fully specified (up to kind, apiVersion, metadata). - optional bool xKubernetesEmbeddedResource = 39; - - // x-kubernetes-int-or-string specifies that this value is - // either an integer or a string. If this is true, an empty - // type is allowed and type as child of anyOf is permitted - // if following one of the following patterns: - // - // 1) anyOf: - // - type: integer - // - type: string - // 2) allOf: - // - anyOf: - // - type: integer - // - type: string - // - ... zero or more - optional bool xKubernetesIntOrString = 40; - - // x-kubernetes-list-map-keys annotates an array with the x-kubernetes-list-type `map` by specifying the keys used - // as the index of the map. - // - // This tag MUST only be used on lists that have the "x-kubernetes-list-type" - // extension set to "map". Also, the values specified for this attribute must - // be a scalar typed field of the child structure (no nesting is supported). - // - // +optional - repeated string xKubernetesListMapKeys = 41; - - // x-kubernetes-list-type annotates an array to further describe its topology. - // This extension must only be used on lists and may have 3 possible values: - // - // 1) `atomic`: the list is treated as a single entity, like a scalar. - // Atomic lists will be entirely replaced when updated. This extension - // may be used on any type of list (struct, scalar, ...). - // 2) `set`: - // Sets are lists that must not have multiple items with the same value. Each - // value must be a scalar, an object with x-kubernetes-map-type `atomic` or an - // array with x-kubernetes-list-type `atomic`. - // 3) `map`: - // These lists are like maps in that their elements have a non-index key - // used to identify them. Order is preserved upon merge. The map tag - // must only be used on a list with elements of type object. - // Defaults to atomic for arrays. - // +optional - optional string xKubernetesListType = 42; - - // x-kubernetes-map-type annotates an object to further describe its topology. - // This extension must only be used when type is object and may have 2 possible values: - // - // 1) `granular`: - // These maps are actual maps (key-value pairs) and each fields are independent - // from each other (they can each be manipulated by separate actors). This is - // the default behaviour for all maps. - // 2) `atomic`: the list is treated as a single entity, like a scalar. - // Atomic maps will be entirely replaced when updated. - // +optional - optional string xKubernetesMapType = 43; -} - -// JSONSchemaPropsOrArray represents a value that can either be a JSONSchemaProps -// or an array of JSONSchemaProps. Mainly here for serialization purposes. -message JSONSchemaPropsOrArray { - optional JSONSchemaProps schema = 1; - - repeated JSONSchemaProps jSONSchemas = 2; -} - -// JSONSchemaPropsOrBool represents JSONSchemaProps or a boolean value. -// Defaults to true for the boolean property. -message JSONSchemaPropsOrBool { - optional bool allows = 1; - - optional JSONSchemaProps schema = 2; -} - -// JSONSchemaPropsOrStringArray represents a JSONSchemaProps or a string array. -message JSONSchemaPropsOrStringArray { - optional JSONSchemaProps schema = 1; - - repeated string property = 2; -} - -// ServiceReference holds a reference to Service.legacy.k8s.io -message ServiceReference { - // namespace is the namespace of the service. - // Required - optional string namespace = 1; - - // name is the name of the service. - // Required - optional string name = 2; - - // path is an optional URL path at which the webhook will be contacted. - // +optional - optional string path = 3; - - // port is an optional service port at which the webhook will be contacted. - // `port` should be a valid port number (1-65535, inclusive). - // Defaults to 443 for backward compatibility. - // +optional - optional int32 port = 4; -} - -// WebhookClientConfig contains the information to make a TLS connection with the webhook. -message WebhookClientConfig { - // url gives the location of the webhook, in standard URL form - // (`scheme://host:port/path`). Exactly one of `url` or `service` - // must be specified. - // - // The `host` should not refer to a service running in the cluster; use - // the `service` field instead. The host might be resolved via external - // DNS in some apiservers (e.g., `kube-apiserver` cannot resolve - // in-cluster DNS as that would be a layering violation). `host` may - // also be an IP address. - // - // Please note that using `localhost` or `127.0.0.1` as a `host` is - // risky unless you take great care to run this webhook on all hosts - // which run an apiserver which might need to make calls to this - // webhook. Such installs are likely to be non-portable, i.e., not easy - // to turn up in a new cluster. - // - // The scheme must be "https"; the URL must begin with "https://". - // - // A path is optional, and if present may be any string permissible in - // a URL. You may use the path to pass an arbitrary string to the - // webhook, for example, a cluster identifier. - // - // Attempting to use a user or basic auth e.g. "user:password@" is not - // allowed. Fragments ("#...") and query parameters ("?...") are not - // allowed, either. - // - // +optional - optional string url = 3; - - // service is a reference to the service for this webhook. Either - // service or url must be specified. - // - // If the webhook is running within the cluster, then you should use `service`. - // - // +optional - optional ServiceReference service = 1; - - // caBundle is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. - // If unspecified, system trust roots on the apiserver are used. - // +optional - optional bytes caBundle = 2; -} - -// WebhookConversion describes how to call a conversion webhook -message WebhookConversion { - // clientConfig is the instructions for how to call the webhook if strategy is `Webhook`. - // +optional - optional WebhookClientConfig clientConfig = 2; - - // conversionReviewVersions is an ordered list of preferred `ConversionReview` - // versions the Webhook expects. The API server will use the first version in - // the list which it supports. If none of the versions specified in this list - // are supported by API server, conversion will fail for the custom resource. - // If a persisted Webhook configuration specifies allowed versions and does not - // include any versions known to the API Server, calls to the webhook will fail. - repeated string conversionReviewVersions = 3; -} - diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto deleted file mode 100644 index 705ca07..0000000 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto +++ /dev/null @@ -1,668 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.apiextensions_apiserver.pkg.apis.apiextensions.v1beta1; - -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1beta1"; - -// ConversionRequest describes the conversion request parameters. -message ConversionRequest { - // uid is an identifier for the individual request/response. It allows distinguishing instances of requests which are - // otherwise identical (parallel requests, etc). - // The UID is meant to track the round trip (request/response) between the Kubernetes API server and the webhook, not the user request. - // It is suitable for correlating log entries between the webhook and apiserver, for either auditing or debugging. - optional string uid = 1; - - // desiredAPIVersion is the version to convert given objects to. e.g. "myapi.example.com/v1" - optional string desiredAPIVersion = 2; - - // objects is the list of custom resource objects to be converted. - repeated k8s.io.apimachinery.pkg.runtime.RawExtension objects = 3; -} - -// ConversionResponse describes a conversion response. -message ConversionResponse { - // uid is an identifier for the individual request/response. - // This should be copied over from the corresponding `request.uid`. - optional string uid = 1; - - // convertedObjects is the list of converted version of `request.objects` if the `result` is successful, otherwise empty. - // The webhook is expected to set `apiVersion` of these objects to the `request.desiredAPIVersion`. The list - // must also have the same size as the input list with the same objects in the same order (equal kind, metadata.uid, metadata.name and metadata.namespace). - // The webhook is allowed to mutate labels and annotations. Any other change to the metadata is silently ignored. - repeated k8s.io.apimachinery.pkg.runtime.RawExtension convertedObjects = 2; - - // result contains the result of conversion with extra details if the conversion failed. `result.status` determines if - // the conversion failed or succeeded. The `result.status` field is required and represents the success or failure of the - // conversion. A successful conversion must set `result.status` to `Success`. A failed conversion must set - // `result.status` to `Failure` and provide more details in `result.message` and return http status 200. The `result.message` - // will be used to construct an error message for the end user. - optional k8s.io.apimachinery.pkg.apis.meta.v1.Status result = 3; -} - -// ConversionReview describes a conversion request/response. -message ConversionReview { - // request describes the attributes for the conversion request. - // +optional - optional ConversionRequest request = 1; - - // response describes the attributes for the conversion response. - // +optional - optional ConversionResponse response = 2; -} - -// CustomResourceColumnDefinition specifies a column for server side printing. -message CustomResourceColumnDefinition { - // name is a human readable name for the column. - optional string name = 1; - - // type is an OpenAPI type definition for this column. - // See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details. - optional string type = 2; - - // format is an optional OpenAPI type definition for this column. The 'name' format is applied - // to the primary identifier column to assist in clients identifying column is the resource name. - // See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details. - // +optional - optional string format = 3; - - // description is a human readable description of this column. - // +optional - optional string description = 4; - - // priority is an integer defining the relative importance of this column compared to others. Lower - // numbers are considered higher priority. Columns that may be omitted in limited space scenarios - // should be given a priority greater than 0. - // +optional - optional int32 priority = 5; - - // JSONPath is a simple JSON path (i.e. with array notation) which is evaluated against - // each custom resource to produce the value for this column. - optional string JSONPath = 6; -} - -// CustomResourceConversion describes how to convert different versions of a CR. -message CustomResourceConversion { - // strategy specifies how custom resources are converted between versions. Allowed values are: - // - `None`: The converter only change the apiVersion and would not touch any other field in the custom resource. - // - `Webhook`: API Server will call to an external webhook to do the conversion. Additional information - // is needed for this option. This requires spec.preserveUnknownFields to be false, and spec.conversion.webhookClientConfig to be set. - optional string strategy = 1; - - // webhookClientConfig is the instructions for how to call the webhook if strategy is `Webhook`. - // Required when `strategy` is set to `Webhook`. - // +optional - optional WebhookClientConfig webhookClientConfig = 2; - - // conversionReviewVersions is an ordered list of preferred `ConversionReview` - // versions the Webhook expects. The API server will use the first version in - // the list which it supports. If none of the versions specified in this list - // are supported by API server, conversion will fail for the custom resource. - // If a persisted Webhook configuration specifies allowed versions and does not - // include any versions known to the API Server, calls to the webhook will fail. - // Defaults to `["v1beta1"]`. - // +optional - repeated string conversionReviewVersions = 3; -} - -// CustomResourceDefinition represents a resource that should be exposed on the API server. Its name MUST be in the format -// <.spec.name>.<.spec.group>. -// Deprecated in v1.16, planned for removal in v1.19. Use apiextensions.k8s.io/v1 CustomResourceDefinition instead. -message CustomResourceDefinition { - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // spec describes how the user wants the resources to appear - optional CustomResourceDefinitionSpec spec = 2; - - // status indicates the actual state of the CustomResourceDefinition - // +optional - optional CustomResourceDefinitionStatus status = 3; -} - -// CustomResourceDefinitionCondition contains details for the current condition of this pod. -message CustomResourceDefinitionCondition { - // type is the type of the condition. Types include Established, NamesAccepted and Terminating. - optional string type = 1; - - // status is the status of the condition. - // Can be True, False, Unknown. - optional string status = 2; - - // lastTransitionTime last time the condition transitioned from one status to another. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; - - // reason is a unique, one-word, CamelCase reason for the condition's last transition. - // +optional - optional string reason = 4; - - // message is a human-readable message indicating details about last transition. - // +optional - optional string message = 5; -} - -// CustomResourceDefinitionList is a list of CustomResourceDefinition objects. -message CustomResourceDefinitionList { - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // items list individual CustomResourceDefinition objects - repeated CustomResourceDefinition items = 2; -} - -// CustomResourceDefinitionNames indicates the names to serve this CustomResourceDefinition -message CustomResourceDefinitionNames { - // plural is the plural name of the resource to serve. - // The custom resources are served under `/apis///.../`. - // Must match the name of the CustomResourceDefinition (in the form `.`). - // Must be all lowercase. - optional string plural = 1; - - // singular is the singular name of the resource. It must be all lowercase. Defaults to lowercased `kind`. - // +optional - optional string singular = 2; - - // shortNames are short names for the resource, exposed in API discovery documents, - // and used by clients to support invocations like `kubectl get `. - // It must be all lowercase. - // +optional - repeated string shortNames = 3; - - // kind is the serialized kind of the resource. It is normally CamelCase and singular. - // Custom resource instances will use this value as the `kind` attribute in API calls. - optional string kind = 4; - - // listKind is the serialized kind of the list for this resource. Defaults to "`kind`List". - // +optional - optional string listKind = 5; - - // categories is a list of grouped resources this custom resource belongs to (e.g. 'all'). - // This is published in API discovery documents, and used by clients to support invocations like - // `kubectl get all`. - // +optional - repeated string categories = 6; -} - -// CustomResourceDefinitionSpec describes how a user wants their resource to appear -message CustomResourceDefinitionSpec { - // group is the API group of the defined custom resource. - // The custom resources are served under `/apis//...`. - // Must match the name of the CustomResourceDefinition (in the form `.`). - optional string group = 1; - - // version is the API version of the defined custom resource. - // The custom resources are served under `/apis///...`. - // Must match the name of the first item in the `versions` list if `version` and `versions` are both specified. - // Optional if `versions` is specified. - // Deprecated: use `versions` instead. - // +optional - optional string version = 2; - - // names specify the resource and kind names for the custom resource. - optional CustomResourceDefinitionNames names = 3; - - // scope indicates whether the defined custom resource is cluster- or namespace-scoped. - // Allowed values are `Cluster` and `Namespaced`. Default is `Namespaced`. - optional string scope = 4; - - // validation describes the schema used for validation and pruning of the custom resource. - // If present, this validation schema is used to validate all versions. - // Top-level and per-version schemas are mutually exclusive. - // +optional - optional CustomResourceValidation validation = 5; - - // subresources specify what subresources the defined custom resource has. - // If present, this field configures subresources for all versions. - // Top-level and per-version subresources are mutually exclusive. - // +optional - optional CustomResourceSubresources subresources = 6; - - // versions is the list of all API versions of the defined custom resource. - // Optional if `version` is specified. - // The name of the first item in the `versions` list must match the `version` field if `version` and `versions` are both specified. - // Version names are used to compute the order in which served versions are listed in API discovery. - // If the version string is "kube-like", it will sort above non "kube-like" version strings, which are ordered - // lexicographically. "Kube-like" versions start with a "v", then are followed by a number (the major version), - // then optionally the string "alpha" or "beta" and another number (the minor version). These are sorted first - // by GA > beta > alpha (where GA is a version with no suffix such as beta or alpha), and then by comparing - // major version, then minor version. An example sorted list of versions: - // v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10. - // +optional - repeated CustomResourceDefinitionVersion versions = 7; - - // additionalPrinterColumns specifies additional columns returned in Table output. - // See https://kubernetes.io/docs/reference/using-api/api-concepts/#receiving-resources-as-tables for details. - // If present, this field configures columns for all versions. - // Top-level and per-version columns are mutually exclusive. - // If no top-level or per-version columns are specified, a single column displaying the age of the custom resource is used. - // +optional - repeated CustomResourceColumnDefinition additionalPrinterColumns = 8; - - // conversion defines conversion settings for the CRD. - // +optional - optional CustomResourceConversion conversion = 9; - - // preserveUnknownFields indicates that object fields which are not specified - // in the OpenAPI schema should be preserved when persisting to storage. - // apiVersion, kind, metadata and known fields inside metadata are always preserved. - // If false, schemas must be defined for all versions. - // Defaults to true in v1beta for backwards compatibility. - // Deprecated: will be required to be false in v1. Preservation of unknown fields can be specified - // in the validation schema using the `x-kubernetes-preserve-unknown-fields: true` extension. - // See https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#pruning-versus-preserving-unknown-fields for details. - // +optional - optional bool preserveUnknownFields = 10; -} - -// CustomResourceDefinitionStatus indicates the state of the CustomResourceDefinition -message CustomResourceDefinitionStatus { - // conditions indicate state for particular aspects of a CustomResourceDefinition - // +optional - repeated CustomResourceDefinitionCondition conditions = 1; - - // acceptedNames are the names that are actually being used to serve discovery. - // They may be different than the names in spec. - optional CustomResourceDefinitionNames acceptedNames = 2; - - // storedVersions lists all versions of CustomResources that were ever persisted. Tracking these - // versions allows a migration path for stored versions in etcd. The field is mutable - // so a migration controller can finish a migration to another version (ensuring - // no old objects are left in storage), and then remove the rest of the - // versions from this list. - // Versions may not be removed from `spec.versions` while they exist in this list. - repeated string storedVersions = 3; -} - -// CustomResourceDefinitionVersion describes a version for CRD. -message CustomResourceDefinitionVersion { - // name is the version name, e.g. “v1”, “v2beta1”, etc. - // The custom resources are served under this version at `/apis///...` if `served` is true. - optional string name = 1; - - // served is a flag enabling/disabling this version from being served via REST APIs - optional bool served = 2; - - // storage indicates this version should be used when persisting custom resources to storage. - // There must be exactly one version with storage=true. - optional bool storage = 3; - - // schema describes the schema used for validation and pruning of this version of the custom resource. - // Top-level and per-version schemas are mutually exclusive. - // Per-version schemas must not all be set to identical values (top-level validation schema should be used instead). - // +optional - optional CustomResourceValidation schema = 4; - - // subresources specify what subresources this version of the defined custom resource have. - // Top-level and per-version subresources are mutually exclusive. - // Per-version subresources must not all be set to identical values (top-level subresources should be used instead). - // +optional - optional CustomResourceSubresources subresources = 5; - - // additionalPrinterColumns specifies additional columns returned in Table output. - // See https://kubernetes.io/docs/reference/using-api/api-concepts/#receiving-resources-as-tables for details. - // Top-level and per-version columns are mutually exclusive. - // Per-version columns must not all be set to identical values (top-level columns should be used instead). - // If no top-level or per-version columns are specified, a single column displaying the age of the custom resource is used. - // +optional - repeated CustomResourceColumnDefinition additionalPrinterColumns = 6; -} - -// CustomResourceSubresourceScale defines how to serve the scale subresource for CustomResources. -message CustomResourceSubresourceScale { - // specReplicasPath defines the JSON path inside of a custom resource that corresponds to Scale `spec.replicas`. - // Only JSON paths without the array notation are allowed. - // Must be a JSON Path under `.spec`. - // If there is no value under the given path in the custom resource, the `/scale` subresource will return an error on GET. - optional string specReplicasPath = 1; - - // statusReplicasPath defines the JSON path inside of a custom resource that corresponds to Scale `status.replicas`. - // Only JSON paths without the array notation are allowed. - // Must be a JSON Path under `.status`. - // If there is no value under the given path in the custom resource, the `status.replicas` value in the `/scale` subresource - // will default to 0. - optional string statusReplicasPath = 2; - - // labelSelectorPath defines the JSON path inside of a custom resource that corresponds to Scale `status.selector`. - // Only JSON paths without the array notation are allowed. - // Must be a JSON Path under `.status` or `.spec`. - // Must be set to work with HorizontalPodAutoscaler. - // The field pointed by this JSON path must be a string field (not a complex selector struct) - // which contains a serialized label selector in string form. - // More info: https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions#scale-subresource - // If there is no value under the given path in the custom resource, the `status.selector` value in the `/scale` - // subresource will default to the empty string. - // +optional - optional string labelSelectorPath = 3; -} - -// CustomResourceSubresourceStatus defines how to serve the status subresource for CustomResources. -// Status is represented by the `.status` JSON path inside of a CustomResource. When set, -// * exposes a /status subresource for the custom resource -// * PUT requests to the /status subresource take a custom resource object, and ignore changes to anything except the status stanza -// * PUT/POST/PATCH requests to the custom resource ignore changes to the status stanza -message CustomResourceSubresourceStatus { -} - -// CustomResourceSubresources defines the status and scale subresources for CustomResources. -message CustomResourceSubresources { - // status indicates the custom resource should serve a `/status` subresource. - // When enabled: - // 1. requests to the custom resource primary endpoint ignore changes to the `status` stanza of the object. - // 2. requests to the custom resource `/status` subresource ignore changes to anything other than the `status` stanza of the object. - // +optional - optional CustomResourceSubresourceStatus status = 1; - - // scale indicates the custom resource should serve a `/scale` subresource that returns an `autoscaling/v1` Scale object. - // +optional - optional CustomResourceSubresourceScale scale = 2; -} - -// CustomResourceValidation is a list of validation methods for CustomResources. -message CustomResourceValidation { - // openAPIV3Schema is the OpenAPI v3 schema to use for validation and pruning. - // +optional - optional JSONSchemaProps openAPIV3Schema = 1; -} - -// ExternalDocumentation allows referencing an external resource for extended documentation. -message ExternalDocumentation { - optional string description = 1; - - optional string url = 2; -} - -// JSON represents any valid JSON value. -// These types are supported: bool, int64, float64, string, []interface{}, map[string]interface{} and nil. -message JSON { - optional bytes raw = 1; -} - -// JSONSchemaProps is a JSON-Schema following Specification Draft 4 (http://json-schema.org/). -message JSONSchemaProps { - optional string id = 1; - - optional string schema = 2; - - optional string ref = 3; - - optional string description = 4; - - optional string type = 5; - - // format is an OpenAPI v3 format string. Unknown formats are ignored. The following formats are validated: - // - // - bsonobjectid: a bson object ID, i.e. a 24 characters hex string - // - uri: an URI as parsed by Golang net/url.ParseRequestURI - // - email: an email address as parsed by Golang net/mail.ParseAddress - // - hostname: a valid representation for an Internet host name, as defined by RFC 1034, section 3.1 [RFC1034]. - // - ipv4: an IPv4 IP as parsed by Golang net.ParseIP - // - ipv6: an IPv6 IP as parsed by Golang net.ParseIP - // - cidr: a CIDR as parsed by Golang net.ParseCIDR - // - mac: a MAC address as parsed by Golang net.ParseMAC - // - uuid: an UUID that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$ - // - uuid3: an UUID3 that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?3[0-9a-f]{3}-?[0-9a-f]{4}-?[0-9a-f]{12}$ - // - uuid4: an UUID4 that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?4[0-9a-f]{3}-?[89ab][0-9a-f]{3}-?[0-9a-f]{12}$ - // - uuid5: an UUID5 that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?5[0-9a-f]{3}-?[89ab][0-9a-f]{3}-?[0-9a-f]{12}$ - // - isbn: an ISBN10 or ISBN13 number string like "0321751043" or "978-0321751041" - // - isbn10: an ISBN10 number string like "0321751043" - // - isbn13: an ISBN13 number string like "978-0321751041" - // - creditcard: a credit card number defined by the regex ^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\d{3})\\d{11})$ with any non digit characters mixed in - // - ssn: a U.S. social security number following the regex ^\\d{3}[- ]?\\d{2}[- ]?\\d{4}$ - // - hexcolor: an hexadecimal color code like "#FFFFFF: following the regex ^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$ - // - rgbcolor: an RGB color code like rgb like "rgb(255,255,2559" - // - byte: base64 encoded binary data - // - password: any kind of string - // - date: a date string like "2006-01-02" as defined by full-date in RFC3339 - // - duration: a duration string like "22 ns" as parsed by Golang time.ParseDuration or compatible with Scala duration format - // - datetime: a date time string like "2014-12-15T19:30:20.000Z" as defined by date-time in RFC3339. - optional string format = 6; - - optional string title = 7; - - // default is a default value for undefined object fields. - // Defaulting is a beta feature under the CustomResourceDefaulting feature gate. - // CustomResourceDefinitions with defaults must be created using the v1 (or newer) CustomResourceDefinition API. - optional JSON default = 8; - - optional double maximum = 9; - - optional bool exclusiveMaximum = 10; - - optional double minimum = 11; - - optional bool exclusiveMinimum = 12; - - optional int64 maxLength = 13; - - optional int64 minLength = 14; - - optional string pattern = 15; - - optional int64 maxItems = 16; - - optional int64 minItems = 17; - - optional bool uniqueItems = 18; - - optional double multipleOf = 19; - - repeated JSON enum = 20; - - optional int64 maxProperties = 21; - - optional int64 minProperties = 22; - - repeated string required = 23; - - optional JSONSchemaPropsOrArray items = 24; - - repeated JSONSchemaProps allOf = 25; - - repeated JSONSchemaProps oneOf = 26; - - repeated JSONSchemaProps anyOf = 27; - - optional JSONSchemaProps not = 28; - - map properties = 29; - - optional JSONSchemaPropsOrBool additionalProperties = 30; - - map patternProperties = 31; - - map dependencies = 32; - - optional JSONSchemaPropsOrBool additionalItems = 33; - - map definitions = 34; - - optional ExternalDocumentation externalDocs = 35; - - optional JSON example = 36; - - optional bool nullable = 37; - - // x-kubernetes-preserve-unknown-fields stops the API server - // decoding step from pruning fields which are not specified - // in the validation schema. This affects fields recursively, - // but switches back to normal pruning behaviour if nested - // properties or additionalProperties are specified in the schema. - // This can either be true or undefined. False is forbidden. - optional bool xKubernetesPreserveUnknownFields = 38; - - // x-kubernetes-embedded-resource defines that the value is an - // embedded Kubernetes runtime.Object, with TypeMeta and - // ObjectMeta. The type must be object. It is allowed to further - // restrict the embedded object. kind, apiVersion and metadata - // are validated automatically. x-kubernetes-preserve-unknown-fields - // is allowed to be true, but does not have to be if the object - // is fully specified (up to kind, apiVersion, metadata). - optional bool xKubernetesEmbeddedResource = 39; - - // x-kubernetes-int-or-string specifies that this value is - // either an integer or a string. If this is true, an empty - // type is allowed and type as child of anyOf is permitted - // if following one of the following patterns: - // - // 1) anyOf: - // - type: integer - // - type: string - // 2) allOf: - // - anyOf: - // - type: integer - // - type: string - // - ... zero or more - optional bool xKubernetesIntOrString = 40; - - // x-kubernetes-list-map-keys annotates an array with the x-kubernetes-list-type `map` by specifying the keys used - // as the index of the map. - // - // This tag MUST only be used on lists that have the "x-kubernetes-list-type" - // extension set to "map". Also, the values specified for this attribute must - // be a scalar typed field of the child structure (no nesting is supported). - // - // +optional - repeated string xKubernetesListMapKeys = 41; - - // x-kubernetes-list-type annotates an array to further describe its topology. - // This extension must only be used on lists and may have 3 possible values: - // - // 1) `atomic`: the list is treated as a single entity, like a scalar. - // Atomic lists will be entirely replaced when updated. This extension - // may be used on any type of list (struct, scalar, ...). - // 2) `set`: - // Sets are lists that must not have multiple items with the same value. Each - // value must be a scalar, an object with x-kubernetes-map-type `atomic` or an - // array with x-kubernetes-list-type `atomic`. - // 3) `map`: - // These lists are like maps in that their elements have a non-index key - // used to identify them. Order is preserved upon merge. The map tag - // must only be used on a list with elements of type object. - // Defaults to atomic for arrays. - // +optional - optional string xKubernetesListType = 42; - - // x-kubernetes-map-type annotates an object to further describe its topology. - // This extension must only be used when type is object and may have 2 possible values: - // - // 1) `granular`: - // These maps are actual maps (key-value pairs) and each fields are independent - // from each other (they can each be manipulated by separate actors). This is - // the default behaviour for all maps. - // 2) `atomic`: the list is treated as a single entity, like a scalar. - // Atomic maps will be entirely replaced when updated. - // +optional - optional string xKubernetesMapType = 43; -} - -// JSONSchemaPropsOrArray represents a value that can either be a JSONSchemaProps -// or an array of JSONSchemaProps. Mainly here for serialization purposes. -message JSONSchemaPropsOrArray { - optional JSONSchemaProps schema = 1; - - repeated JSONSchemaProps jSONSchemas = 2; -} - -// JSONSchemaPropsOrBool represents JSONSchemaProps or a boolean value. -// Defaults to true for the boolean property. -message JSONSchemaPropsOrBool { - optional bool allows = 1; - - optional JSONSchemaProps schema = 2; -} - -// JSONSchemaPropsOrStringArray represents a JSONSchemaProps or a string array. -message JSONSchemaPropsOrStringArray { - optional JSONSchemaProps schema = 1; - - repeated string property = 2; -} - -// ServiceReference holds a reference to Service.legacy.k8s.io -message ServiceReference { - // namespace is the namespace of the service. - // Required - optional string namespace = 1; - - // name is the name of the service. - // Required - optional string name = 2; - - // path is an optional URL path at which the webhook will be contacted. - // +optional - optional string path = 3; - - // port is an optional service port at which the webhook will be contacted. - // `port` should be a valid port number (1-65535, inclusive). - // Defaults to 443 for backward compatibility. - // +optional - optional int32 port = 4; -} - -// WebhookClientConfig contains the information to make a TLS connection with the webhook. -message WebhookClientConfig { - // url gives the location of the webhook, in standard URL form - // (`scheme://host:port/path`). Exactly one of `url` or `service` - // must be specified. - // - // The `host` should not refer to a service running in the cluster; use - // the `service` field instead. The host might be resolved via external - // DNS in some apiservers (e.g., `kube-apiserver` cannot resolve - // in-cluster DNS as that would be a layering violation). `host` may - // also be an IP address. - // - // Please note that using `localhost` or `127.0.0.1` as a `host` is - // risky unless you take great care to run this webhook on all hosts - // which run an apiserver which might need to make calls to this - // webhook. Such installs are likely to be non-portable, i.e., not easy - // to turn up in a new cluster. - // - // The scheme must be "https"; the URL must begin with "https://". - // - // A path is optional, and if present may be any string permissible in - // a URL. You may use the path to pass an arbitrary string to the - // webhook, for example, a cluster identifier. - // - // Attempting to use a user or basic auth e.g. "user:password@" is not - // allowed. Fragments ("#...") and query parameters ("?...") are not - // allowed, either. - // - // +optional - optional string url = 3; - - // service is a reference to the service for this webhook. Either - // service or url must be specified. - // - // If the webhook is running within the cluster, then you should use `service`. - // - // +optional - optional ServiceReference service = 1; - - // caBundle is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. - // If unspecified, system trust roots on the apiserver are used. - // +optional - optional bytes caBundle = 2; -} - diff --git a/vendor/k8s.io/apimachinery/pkg/api/errors/OWNERS b/vendor/k8s.io/apimachinery/pkg/api/errors/OWNERS deleted file mode 100644 index 435297a..0000000 --- a/vendor/k8s.io/apimachinery/pkg/api/errors/OWNERS +++ /dev/null @@ -1,25 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: -- thockin -- lavalamp -- smarterclayton -- wojtek-t -- deads2k -- brendandburns -- derekwaynecarr -- caesarxuchao -- mikedanese -- liggitt -- nikhiljindal -- gmarek -- erictune -- saad-ali -- janetkuo -- tallclair -- eparis -- dims -- hongchaodeng -- krousey -- cjcullen -- david-mcmahon diff --git a/vendor/k8s.io/apimachinery/pkg/api/meta/OWNERS b/vendor/k8s.io/apimachinery/pkg/api/meta/OWNERS deleted file mode 100644 index 96bccff..0000000 --- a/vendor/k8s.io/apimachinery/pkg/api/meta/OWNERS +++ /dev/null @@ -1,23 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: -- thockin -- smarterclayton -- wojtek-t -- deads2k -- brendandburns -- derekwaynecarr -- caesarxuchao -- mikedanese -- liggitt -- nikhiljindal -- gmarek -- janetkuo -- ncdc -- eparis -- dims -- krousey -- resouer -- david-mcmahon -- mfojtik -- jianhuiz diff --git a/vendor/k8s.io/apimachinery/pkg/api/resource/OWNERS b/vendor/k8s.io/apimachinery/pkg/api/resource/OWNERS deleted file mode 100644 index dc77401..0000000 --- a/vendor/k8s.io/apimachinery/pkg/api/resource/OWNERS +++ /dev/null @@ -1,16 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: -- thockin -- lavalamp -- smarterclayton -- wojtek-t -- derekwaynecarr -- mikedanese -- saad-ali -- janetkuo -- tallclair -- eparis -- xiang90 -- mbohlool -- david-mcmahon diff --git a/vendor/k8s.io/apimachinery/pkg/api/resource/generated.proto b/vendor/k8s.io/apimachinery/pkg/api/resource/generated.proto deleted file mode 100644 index 18a6c7c..0000000 --- a/vendor/k8s.io/apimachinery/pkg/api/resource/generated.proto +++ /dev/null @@ -1,88 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.apimachinery.pkg.api.resource; - -// Package-wide variables from generator "generated". -option go_package = "resource"; - -// Quantity is a fixed-point representation of a number. -// It provides convenient marshaling/unmarshaling in JSON and YAML, -// in addition to String() and AsInt64() accessors. -// -// The serialization format is: -// -// ::= -// (Note that may be empty, from the "" case in .) -// ::= 0 | 1 | ... | 9 -// ::= | -// ::= | . | . | . -// ::= "+" | "-" -// ::= | -// ::= | | -// ::= Ki | Mi | Gi | Ti | Pi | Ei -// (International System of units; See: http://physics.nist.gov/cuu/Units/binary.html) -// ::= m | "" | k | M | G | T | P | E -// (Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.) -// ::= "e" | "E" -// -// No matter which of the three exponent forms is used, no quantity may represent -// a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal -// places. Numbers larger or more precise will be capped or rounded up. -// (E.g.: 0.1m will rounded up to 1m.) -// This may be extended in the future if we require larger or smaller quantities. -// -// When a Quantity is parsed from a string, it will remember the type of suffix -// it had, and will use the same type again when it is serialized. -// -// Before serializing, Quantity will be put in "canonical form". -// This means that Exponent/suffix will be adjusted up or down (with a -// corresponding increase or decrease in Mantissa) such that: -// a. No precision is lost -// b. No fractional digits will be emitted -// c. The exponent (or suffix) is as large as possible. -// The sign will be omitted unless the number is negative. -// -// Examples: -// 1.5 will be serialized as "1500m" -// 1.5Gi will be serialized as "1536Mi" -// -// Note that the quantity will NEVER be internally represented by a -// floating point number. That is the whole point of this exercise. -// -// Non-canonical values will still parse as long as they are well formed, -// but will be re-emitted in their canonical form. (So always use canonical -// form, or don't diff.) -// -// This format is intended to make it difficult to use these numbers without -// writing some sort of special handling code in the hopes that that will -// cause implementors to also use a fixed point implementation. -// -// +protobuf=true -// +protobuf.embed=string -// +protobuf.options.marshal=false -// +protobuf.options.(gogoproto.goproto_stringer)=false -// +k8s:deepcopy-gen=true -// +k8s:openapi-gen=true -message Quantity { - optional string string = 1; -} - diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/OWNERS b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/OWNERS deleted file mode 100644 index 77cfb0c..0000000 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/OWNERS +++ /dev/null @@ -1,32 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: -- thockin -- smarterclayton -- wojtek-t -- deads2k -- brendandburns -- caesarxuchao -- liggitt -- nikhiljindal -- gmarek -- erictune -- davidopp -- sttts -- quinton-hoole -- luxas -- janetkuo -- justinsb -- ncdc -- soltysh -- dims -- madhusudancs -- hongchaodeng -- krousey -- mml -- mbohlool -- david-mcmahon -- therc -- mqliang -- kevin-wangzefeng -- jianhuiz diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto deleted file mode 100644 index ba1194d..0000000 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto +++ /dev/null @@ -1,1024 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.apimachinery.pkg.apis.meta.v1; - -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1"; - -// APIGroup contains the name, the supported versions, and the preferred version -// of a group. -message APIGroup { - // name is the name of the group. - optional string name = 1; - - // versions are the versions supported in this group. - repeated GroupVersionForDiscovery versions = 2; - - // preferredVersion is the version preferred by the API server, which - // probably is the storage version. - // +optional - optional GroupVersionForDiscovery preferredVersion = 3; - - // a map of client CIDR to server address that is serving this group. - // This is to help clients reach servers in the most network-efficient way possible. - // Clients can use the appropriate server address as per the CIDR that they match. - // In case of multiple matches, clients should use the longest matching CIDR. - // The server returns only those CIDRs that it thinks that the client can match. - // For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. - // Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP. - // +optional - repeated ServerAddressByClientCIDR serverAddressByClientCIDRs = 4; -} - -// APIGroupList is a list of APIGroup, to allow clients to discover the API at -// /apis. -message APIGroupList { - // groups is a list of APIGroup. - repeated APIGroup groups = 1; -} - -// APIResource specifies the name of a resource and whether it is namespaced. -message APIResource { - // name is the plural name of the resource. - optional string name = 1; - - // singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. - // The singularName is more correct for reporting status on a single item and both singular and plural are allowed - // from the kubectl CLI interface. - optional string singularName = 6; - - // namespaced indicates if a resource is namespaced or not. - optional bool namespaced = 2; - - // group is the preferred group of the resource. Empty implies the group of the containing resource list. - // For subresources, this may have a different value, for example: Scale". - optional string group = 8; - - // version is the preferred version of the resource. Empty implies the version of the containing resource list - // For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)". - optional string version = 9; - - // kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo') - optional string kind = 3; - - // verbs is a list of supported kube verbs (this includes get, list, watch, create, - // update, patch, delete, deletecollection, and proxy) - optional Verbs verbs = 4; - - // shortNames is a list of suggested short names of the resource. - repeated string shortNames = 5; - - // categories is a list of the grouped resources this resource belongs to (e.g. 'all') - repeated string categories = 7; - - // The hash value of the storage version, the version this resource is - // converted to when written to the data store. Value must be treated - // as opaque by clients. Only equality comparison on the value is valid. - // This is an alpha feature and may change or be removed in the future. - // The field is populated by the apiserver only if the - // StorageVersionHash feature gate is enabled. - // This field will remain optional even if it graduates. - // +optional - optional string storageVersionHash = 10; -} - -// APIResourceList is a list of APIResource, it is used to expose the name of the -// resources supported in a specific group and version, and if the resource -// is namespaced. -message APIResourceList { - // groupVersion is the group and version this APIResourceList is for. - optional string groupVersion = 1; - - // resources contains the name of the resources and if they are namespaced. - repeated APIResource resources = 2; -} - -// APIVersions lists the versions that are available, to allow clients to -// discover the API at /api, which is the root path of the legacy v1 API. -// -// +protobuf.options.(gogoproto.goproto_stringer)=false -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -message APIVersions { - // versions are the api versions that are available. - repeated string versions = 1; - - // a map of client CIDR to server address that is serving this group. - // This is to help clients reach servers in the most network-efficient way possible. - // Clients can use the appropriate server address as per the CIDR that they match. - // In case of multiple matches, clients should use the longest matching CIDR. - // The server returns only those CIDRs that it thinks that the client can match. - // For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. - // Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP. - repeated ServerAddressByClientCIDR serverAddressByClientCIDRs = 2; -} - -// CreateOptions may be provided when creating an API object. -message CreateOptions { - // When present, indicates that modifications should not be - // persisted. An invalid or unrecognized dryRun directive will - // result in an error response and no further processing of the - // request. Valid values are: - // - All: all dry run stages will be processed - // +optional - repeated string dryRun = 1; - - // fieldManager is a name associated with the actor or entity - // that is making these changes. The value must be less than or - // 128 characters long, and only contain printable characters, - // as defined by https://golang.org/pkg/unicode/#IsPrint. - // +optional - optional string fieldManager = 3; -} - -// DeleteOptions may be provided when deleting an API object. -message DeleteOptions { - // The duration in seconds before the object should be deleted. Value must be non-negative integer. - // The value zero indicates delete immediately. If this value is nil, the default grace period for the - // specified type will be used. - // Defaults to a per object value if not specified. zero means delete immediately. - // +optional - optional int64 gracePeriodSeconds = 1; - - // Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be - // returned. - // +k8s:conversion-gen=false - // +optional - optional Preconditions preconditions = 2; - - // Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. - // Should the dependent objects be orphaned. If true/false, the "orphan" - // finalizer will be added to/removed from the object's finalizers list. - // Either this field or PropagationPolicy may be set, but not both. - // +optional - optional bool orphanDependents = 3; - - // Whether and how garbage collection will be performed. - // Either this field or OrphanDependents may be set, but not both. - // The default policy is decided by the existing finalizer set in the - // metadata.finalizers and the resource-specific default policy. - // Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - - // allow the garbage collector to delete the dependents in the background; - // 'Foreground' - a cascading policy that deletes all dependents in the - // foreground. - // +optional - optional string propagationPolicy = 4; - - // When present, indicates that modifications should not be - // persisted. An invalid or unrecognized dryRun directive will - // result in an error response and no further processing of the - // request. Valid values are: - // - All: all dry run stages will be processed - // +optional - repeated string dryRun = 5; -} - -// Duration is a wrapper around time.Duration which supports correct -// marshaling to YAML and JSON. In particular, it marshals into strings, which -// can be used as map keys in json. -message Duration { - optional int64 duration = 1; -} - -// ExportOptions is the query options to the standard REST get call. -// Deprecated. Planned for removal in 1.18. -message ExportOptions { - // Should this value be exported. Export strips fields that a user can not specify. - // Deprecated. Planned for removal in 1.18. - optional bool export = 1; - - // Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. - // Deprecated. Planned for removal in 1.18. - optional bool exact = 2; -} - -// FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format. -// -// Each key is either a '.' representing the field itself, and will always map to an empty set, -// or a string representing a sub-field or item. The string will follow one of these four formats: -// 'f:', where is the name of a field in a struct, or key in a map -// 'v:', where is the exact json formatted value of a list item -// 'i:', where is position of a item in a list -// 'k:', where is a map of a list item's key fields to their unique values -// If a key maps to an empty Fields value, the field that key represents is part of the set. -// -// The exact format is defined in sigs.k8s.io/structured-merge-diff -message FieldsV1 { - // Raw is the underlying serialization of this object. - optional bytes Raw = 1; -} - -// GetOptions is the standard query options to the standard REST get call. -message GetOptions { - // When specified: - // - if unset, then the result is returned from remote storage based on quorum-read flag; - // - if it's 0, then we simply return what we currently have in cache, no guarantee; - // - if set to non zero, then the result is at least as fresh as given rv. - optional string resourceVersion = 1; -} - -// GroupKind specifies a Group and a Kind, but does not force a version. This is useful for identifying -// concepts during lookup stages without having partially valid types -// -// +protobuf.options.(gogoproto.goproto_stringer)=false -message GroupKind { - optional string group = 1; - - optional string kind = 2; -} - -// GroupResource specifies a Group and a Resource, but does not force a version. This is useful for identifying -// concepts during lookup stages without having partially valid types -// -// +protobuf.options.(gogoproto.goproto_stringer)=false -message GroupResource { - optional string group = 1; - - optional string resource = 2; -} - -// GroupVersion contains the "group" and the "version", which uniquely identifies the API. -// -// +protobuf.options.(gogoproto.goproto_stringer)=false -message GroupVersion { - optional string group = 1; - - optional string version = 2; -} - -// GroupVersion contains the "group/version" and "version" string of a version. -// It is made a struct to keep extensibility. -message GroupVersionForDiscovery { - // groupVersion specifies the API group and version in the form "group/version" - optional string groupVersion = 1; - - // version specifies the version in the form of "version". This is to save - // the clients the trouble of splitting the GroupVersion. - optional string version = 2; -} - -// GroupVersionKind unambiguously identifies a kind. It doesn't anonymously include GroupVersion -// to avoid automatic coersion. It doesn't use a GroupVersion to avoid custom marshalling -// -// +protobuf.options.(gogoproto.goproto_stringer)=false -message GroupVersionKind { - optional string group = 1; - - optional string version = 2; - - optional string kind = 3; -} - -// GroupVersionResource unambiguously identifies a resource. It doesn't anonymously include GroupVersion -// to avoid automatic coersion. It doesn't use a GroupVersion to avoid custom marshalling -// -// +protobuf.options.(gogoproto.goproto_stringer)=false -message GroupVersionResource { - optional string group = 1; - - optional string version = 2; - - optional string resource = 3; -} - -// A label selector is a label query over a set of resources. The result of matchLabels and -// matchExpressions are ANDed. An empty label selector matches all objects. A null -// label selector matches no objects. -message LabelSelector { - // matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - // map is equivalent to an element of matchExpressions, whose key field is "key", the - // operator is "In", and the values array contains only "value". The requirements are ANDed. - // +optional - map matchLabels = 1; - - // matchExpressions is a list of label selector requirements. The requirements are ANDed. - // +optional - repeated LabelSelectorRequirement matchExpressions = 2; -} - -// A label selector requirement is a selector that contains values, a key, and an operator that -// relates the key and values. -message LabelSelectorRequirement { - // key is the label key that the selector applies to. - // +patchMergeKey=key - // +patchStrategy=merge - optional string key = 1; - - // operator represents a key's relationship to a set of values. - // Valid operators are In, NotIn, Exists and DoesNotExist. - optional string operator = 2; - - // values is an array of string values. If the operator is In or NotIn, - // the values array must be non-empty. If the operator is Exists or DoesNotExist, - // the values array must be empty. This array is replaced during a strategic - // merge patch. - // +optional - repeated string values = 3; -} - -// List holds a list of objects, which may not be known by the server. -message List { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional ListMeta metadata = 1; - - // List of objects - repeated k8s.io.apimachinery.pkg.runtime.RawExtension items = 2; -} - -// ListMeta describes metadata that synthetic resources must have, including lists and -// various status objects. A resource may have only one of {ObjectMeta, ListMeta}. -message ListMeta { - // selfLink is a URL representing this object. - // Populated by the system. - // Read-only. - // - // DEPRECATED - // Kubernetes will stop propagating this field in 1.20 release and the field is planned - // to be removed in 1.21 release. - // +optional - optional string selfLink = 1; - - // String that identifies the server's internal version of this object that - // can be used by clients to determine when objects have changed. - // Value must be treated as opaque by clients and passed unmodified back to the server. - // Populated by the system. - // Read-only. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - // +optional - optional string resourceVersion = 2; - - // continue may be set if the user set a limit on the number of items returned, and indicates that - // the server has more data available. The value is opaque and may be used to issue another request - // to the endpoint that served this list to retrieve the next set of available objects. Continuing a - // consistent list may not be possible if the server configuration has changed or more than a few - // minutes have passed. The resourceVersion field returned when using this continue value will be - // identical to the value in the first response, unless you have received this token from an error - // message. - optional string continue = 3; - - // remainingItemCount is the number of subsequent items in the list which are not included in this - // list response. If the list request contained label or field selectors, then the number of - // remaining items is unknown and the field will be left unset and omitted during serialization. - // If the list is complete (either because it is not chunking or because this is the last chunk), - // then there are no more remaining items and this field will be left unset and omitted during - // serialization. - // Servers older than v1.15 do not set this field. - // The intended use of the remainingItemCount is *estimating* the size of a collection. Clients - // should not rely on the remainingItemCount to be set or to be exact. - // +optional - optional int64 remainingItemCount = 4; -} - -// ListOptions is the query options to a standard REST list call. -message ListOptions { - // A selector to restrict the list of returned objects by their labels. - // Defaults to everything. - // +optional - optional string labelSelector = 1; - - // A selector to restrict the list of returned objects by their fields. - // Defaults to everything. - // +optional - optional string fieldSelector = 2; - - // Watch for changes to the described resources and return them as a stream of - // add, update, and remove notifications. Specify resourceVersion. - // +optional - optional bool watch = 3; - - // allowWatchBookmarks requests watch events with type "BOOKMARK". - // Servers that do not implement bookmarks may ignore this flag and - // bookmarks are sent at the server's discretion. Clients should not - // assume bookmarks are returned at any specific interval, nor may they - // assume the server will send any BOOKMARK event during a session. - // If this is not a watch, this field is ignored. - // If the feature gate WatchBookmarks is not enabled in apiserver, - // this field is ignored. - // +optional - optional bool allowWatchBookmarks = 9; - - // When specified with a watch call, shows changes that occur after that particular version of a resource. - // Defaults to changes from the beginning of history. - // When specified for list: - // - if unset, then the result is returned from remote storage based on quorum-read flag; - // - if it's 0, then we simply return what we currently have in cache, no guarantee; - // - if set to non zero, then the result is at least as fresh as given rv. - // +optional - optional string resourceVersion = 4; - - // Timeout for the list/watch call. - // This limits the duration of the call, regardless of any activity or inactivity. - // +optional - optional int64 timeoutSeconds = 5; - - // limit is a maximum number of responses to return for a list call. If more items exist, the - // server will set the `continue` field on the list metadata to a value that can be used with the - // same initial query to retrieve the next set of results. Setting a limit may return fewer than - // the requested amount of items (up to zero items) in the event all requested objects are - // filtered out and clients should only use the presence of the continue field to determine whether - // more results are available. Servers may choose not to support the limit argument and will return - // all of the available results. If limit is specified and the continue field is empty, clients may - // assume that no more results are available. This field is not supported if watch is true. - // - // The server guarantees that the objects returned when using continue will be identical to issuing - // a single list call without a limit - that is, no objects created, modified, or deleted after the - // first request is issued will be included in any subsequent continued requests. This is sometimes - // referred to as a consistent snapshot, and ensures that a client that is using limit to receive - // smaller chunks of a very large result can ensure they see all possible objects. If objects are - // updated during a chunked list the version of the object that was present at the time the first list - // result was calculated is returned. - optional int64 limit = 7; - - // The continue option should be set when retrieving more results from the server. Since this value is - // server defined, clients may only use the continue value from a previous query result with identical - // query parameters (except for the value of continue) and the server may reject a continue value it - // does not recognize. If the specified continue value is no longer valid whether due to expiration - // (generally five to fifteen minutes) or a configuration change on the server, the server will - // respond with a 410 ResourceExpired error together with a continue token. If the client needs a - // consistent list, it must restart their list without the continue field. Otherwise, the client may - // send another list request with the token received with the 410 error, the server will respond with - // a list starting from the next key, but from the latest snapshot, which is inconsistent from the - // previous list results - objects that are created, modified, or deleted after the first list request - // will be included in the response, as long as their keys are after the "next key". - // - // This field is not supported when watch is true. Clients may start a watch from the last - // resourceVersion value returned by the server and not miss any modifications. - optional string continue = 8; -} - -// ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource -// that the fieldset applies to. -message ManagedFieldsEntry { - // Manager is an identifier of the workflow managing these fields. - optional string manager = 1; - - // Operation is the type of operation which lead to this ManagedFieldsEntry being created. - // The only valid values for this field are 'Apply' and 'Update'. - optional string operation = 2; - - // APIVersion defines the version of this resource that this field set - // applies to. The format is "group/version" just like the top-level - // APIVersion field. It is necessary to track the version of a field - // set because it cannot be automatically converted. - optional string apiVersion = 3; - - // Time is timestamp of when these fields were set. It should always be empty if Operation is 'Apply' - // +optional - optional Time time = 4; - - // FieldsType is the discriminator for the different fields format and version. - // There is currently only one possible value: "FieldsV1" - optional string fieldsType = 6; - - // FieldsV1 holds the first JSON version format as described in the "FieldsV1" type. - // +optional - optional FieldsV1 fieldsV1 = 7; -} - -// MicroTime is version of Time with microsecond level precision. -// -// +protobuf.options.marshal=false -// +protobuf.as=Timestamp -// +protobuf.options.(gogoproto.goproto_stringer)=false -message MicroTime { - // Represents seconds of UTC time since Unix epoch - // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - // 9999-12-31T23:59:59Z inclusive. - optional int64 seconds = 1; - - // Non-negative fractions of a second at nanosecond resolution. Negative - // second values with fractions must still have non-negative nanos values - // that count forward in time. Must be from 0 to 999,999,999 - // inclusive. This field may be limited in precision depending on context. - optional int32 nanos = 2; -} - -// ObjectMeta is metadata that all persisted resources must have, which includes all objects -// users must create. -message ObjectMeta { - // Name must be unique within a namespace. Is required when creating resources, although - // some resources may allow a client to request the generation of an appropriate name - // automatically. Name is primarily intended for creation idempotence and configuration - // definition. - // Cannot be updated. - // More info: http://kubernetes.io/docs/user-guide/identifiers#names - // +optional - optional string name = 1; - - // GenerateName is an optional prefix, used by the server, to generate a unique - // name ONLY IF the Name field has not been provided. - // If this field is used, the name returned to the client will be different - // than the name passed. This value will also be combined with a unique suffix. - // The provided value has the same validation rules as the Name field, - // and may be truncated by the length of the suffix required to make the value - // unique on the server. - // - // If this field is specified and the generated name exists, the server will - // NOT return a 409 - instead, it will either return 201 Created or 500 with Reason - // ServerTimeout indicating a unique name could not be found in the time allotted, and the client - // should retry (optionally after the time indicated in the Retry-After header). - // - // Applied only if Name is not specified. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency - // +optional - optional string generateName = 2; - - // Namespace defines the space within each name must be unique. An empty namespace is - // equivalent to the "default" namespace, but "default" is the canonical representation. - // Not all objects are required to be scoped to a namespace - the value of this field for - // those objects will be empty. - // - // Must be a DNS_LABEL. - // Cannot be updated. - // More info: http://kubernetes.io/docs/user-guide/namespaces - // +optional - optional string namespace = 3; - - // SelfLink is a URL representing this object. - // Populated by the system. - // Read-only. - // - // DEPRECATED - // Kubernetes will stop propagating this field in 1.20 release and the field is planned - // to be removed in 1.21 release. - // +optional - optional string selfLink = 4; - - // UID is the unique in time and space value for this object. It is typically generated by - // the server on successful creation of a resource and is not allowed to change on PUT - // operations. - // - // Populated by the system. - // Read-only. - // More info: http://kubernetes.io/docs/user-guide/identifiers#uids - // +optional - optional string uid = 5; - - // An opaque value that represents the internal version of this object that can - // be used by clients to determine when objects have changed. May be used for optimistic - // concurrency, change detection, and the watch operation on a resource or set of resources. - // Clients must treat these values as opaque and passed unmodified back to the server. - // They may only be valid for a particular resource or set of resources. - // - // Populated by the system. - // Read-only. - // Value must be treated as opaque by clients and . - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency - // +optional - optional string resourceVersion = 6; - - // A sequence number representing a specific generation of the desired state. - // Populated by the system. Read-only. - // +optional - optional int64 generation = 7; - - // CreationTimestamp is a timestamp representing the server time when this object was - // created. It is not guaranteed to be set in happens-before order across separate operations. - // Clients may not set this value. It is represented in RFC3339 form and is in UTC. - // - // Populated by the system. - // Read-only. - // Null for lists. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional Time creationTimestamp = 8; - - // DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This - // field is set by the server when a graceful deletion is requested by the user, and is not - // directly settable by a client. The resource is expected to be deleted (no longer visible - // from resource lists, and not reachable by name) after the time in this field, once the - // finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. - // Once the deletionTimestamp is set, this value may not be unset or be set further into the - // future, although it may be shortened or the resource may be deleted prior to this time. - // For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react - // by sending a graceful termination signal to the containers in the pod. After that 30 seconds, - // the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, - // remove the pod from the API. In the presence of network partitions, this object may still - // exist after this timestamp, until an administrator or automated process can determine the - // resource is fully terminated. - // If not set, graceful deletion of the object has not been requested. - // - // Populated by the system when a graceful deletion is requested. - // Read-only. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional Time deletionTimestamp = 9; - - // Number of seconds allowed for this object to gracefully terminate before - // it will be removed from the system. Only set when deletionTimestamp is also set. - // May only be shortened. - // Read-only. - // +optional - optional int64 deletionGracePeriodSeconds = 10; - - // Map of string keys and values that can be used to organize and categorize - // (scope and select) objects. May match selectors of replication controllers - // and services. - // More info: http://kubernetes.io/docs/user-guide/labels - // +optional - map labels = 11; - - // Annotations is an unstructured key value map stored with a resource that may be - // set by external tools to store and retrieve arbitrary metadata. They are not - // queryable and should be preserved when modifying objects. - // More info: http://kubernetes.io/docs/user-guide/annotations - // +optional - map annotations = 12; - - // List of objects depended by this object. If ALL objects in the list have - // been deleted, this object will be garbage collected. If this object is managed by a controller, - // then an entry in this list will point to this controller, with the controller field set to true. - // There cannot be more than one managing controller. - // +optional - // +patchMergeKey=uid - // +patchStrategy=merge - repeated OwnerReference ownerReferences = 13; - - // Must be empty before the object is deleted from the registry. Each entry - // is an identifier for the responsible component that will remove the entry - // from the list. If the deletionTimestamp of the object is non-nil, entries - // in this list can only be removed. - // Finalizers may be processed and removed in any order. Order is NOT enforced - // because it introduces significant risk of stuck finalizers. - // finalizers is a shared field, any actor with permission can reorder it. - // If the finalizer list is processed in order, then this can lead to a situation - // in which the component responsible for the first finalizer in the list is - // waiting for a signal (field value, external system, or other) produced by a - // component responsible for a finalizer later in the list, resulting in a deadlock. - // Without enforced ordering finalizers are free to order amongst themselves and - // are not vulnerable to ordering changes in the list. - // +optional - // +patchStrategy=merge - repeated string finalizers = 14; - - // The name of the cluster which the object belongs to. - // This is used to distinguish resources with same name and namespace in different clusters. - // This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request. - // +optional - optional string clusterName = 15; - - // ManagedFields maps workflow-id and version to the set of fields - // that are managed by that workflow. This is mostly for internal - // housekeeping, and users typically shouldn't need to set or - // understand this field. A workflow can be the user's name, a - // controller's name, or the name of a specific apply path like - // "ci-cd". The set of fields is always in the version that the - // workflow used when modifying the object. - // - // +optional - repeated ManagedFieldsEntry managedFields = 17; -} - -// OwnerReference contains enough information to let you identify an owning -// object. An owning object must be in the same namespace as the dependent, or -// be cluster-scoped, so there is no namespace field. -message OwnerReference { - // API version of the referent. - optional string apiVersion = 5; - - // Kind of the referent. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - optional string kind = 1; - - // Name of the referent. - // More info: http://kubernetes.io/docs/user-guide/identifiers#names - optional string name = 3; - - // UID of the referent. - // More info: http://kubernetes.io/docs/user-guide/identifiers#uids - optional string uid = 4; - - // If true, this reference points to the managing controller. - // +optional - optional bool controller = 6; - - // If true, AND if the owner has the "foregroundDeletion" finalizer, then - // the owner cannot be deleted from the key-value store until this - // reference is removed. - // Defaults to false. - // To set this field, a user needs "delete" permission of the owner, - // otherwise 422 (Unprocessable Entity) will be returned. - // +optional - optional bool blockOwnerDeletion = 7; -} - -// PartialObjectMetadata is a generic representation of any object with ObjectMeta. It allows clients -// to get access to a particular ObjectMeta schema without knowing the details of the version. -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -message PartialObjectMetadata { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional ObjectMeta metadata = 1; -} - -// PartialObjectMetadataList contains a list of objects containing only their metadata -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -message PartialObjectMetadataList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional ListMeta metadata = 1; - - // items contains each of the included items. - repeated PartialObjectMetadata items = 2; -} - -// Patch is provided to give a concrete name and type to the Kubernetes PATCH request body. -message Patch { -} - -// PatchOptions may be provided when patching an API object. -// PatchOptions is meant to be a superset of UpdateOptions. -message PatchOptions { - // When present, indicates that modifications should not be - // persisted. An invalid or unrecognized dryRun directive will - // result in an error response and no further processing of the - // request. Valid values are: - // - All: all dry run stages will be processed - // +optional - repeated string dryRun = 1; - - // Force is going to "force" Apply requests. It means user will - // re-acquire conflicting fields owned by other people. Force - // flag must be unset for non-apply patch requests. - // +optional - optional bool force = 2; - - // fieldManager is a name associated with the actor or entity - // that is making these changes. The value must be less than or - // 128 characters long, and only contain printable characters, - // as defined by https://golang.org/pkg/unicode/#IsPrint. This - // field is required for apply requests - // (application/apply-patch) but optional for non-apply patch - // types (JsonPatch, MergePatch, StrategicMergePatch). - // +optional - optional string fieldManager = 3; -} - -// Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out. -message Preconditions { - // Specifies the target UID. - // +optional - optional string uid = 1; - - // Specifies the target ResourceVersion - // +optional - optional string resourceVersion = 2; -} - -// RootPaths lists the paths available at root. -// For example: "/healthz", "/apis". -message RootPaths { - // paths are the paths available at root. - repeated string paths = 1; -} - -// ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match. -message ServerAddressByClientCIDR { - // The CIDR with which clients can match their IP to figure out the server address that they should use. - optional string clientCIDR = 1; - - // Address of this server, suitable for a client that matches the above CIDR. - // This can be a hostname, hostname:port, IP or IP:port. - optional string serverAddress = 2; -} - -// Status is a return value for calls that don't return other objects. -message Status { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional ListMeta metadata = 1; - - // Status of the operation. - // One of: "Success" or "Failure". - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional string status = 2; - - // A human-readable description of the status of this operation. - // +optional - optional string message = 3; - - // A machine-readable description of why this operation is in the - // "Failure" status. If this value is empty there - // is no information available. A Reason clarifies an HTTP status - // code but does not override it. - // +optional - optional string reason = 4; - - // Extended data associated with the reason. Each reason may define its - // own extended details. This field is optional and the data returned - // is not guaranteed to conform to any schema except that defined by - // the reason type. - // +optional - optional StatusDetails details = 5; - - // Suggested HTTP return code for this status, 0 if not set. - // +optional - optional int32 code = 6; -} - -// StatusCause provides more information about an api.Status failure, including -// cases when multiple errors are encountered. -message StatusCause { - // A machine-readable description of the cause of the error. If this value is - // empty there is no information available. - // +optional - optional string reason = 1; - - // A human-readable description of the cause of the error. This field may be - // presented as-is to a reader. - // +optional - optional string message = 2; - - // The field of the resource that has caused this error, as named by its JSON - // serialization. May include dot and postfix notation for nested attributes. - // Arrays are zero-indexed. Fields may appear more than once in an array of - // causes due to fields having multiple errors. - // Optional. - // - // Examples: - // "name" - the field "name" on the current resource - // "items[0].name" - the field "name" on the first array entry in "items" - // +optional - optional string field = 3; -} - -// StatusDetails is a set of additional properties that MAY be set by the -// server to provide additional information about a response. The Reason -// field of a Status object defines what attributes will be set. Clients -// must ignore fields that do not match the defined type of each attribute, -// and should assume that any attribute may be empty, invalid, or under -// defined. -message StatusDetails { - // The name attribute of the resource associated with the status StatusReason - // (when there is a single name which can be described). - // +optional - optional string name = 1; - - // The group attribute of the resource associated with the status StatusReason. - // +optional - optional string group = 2; - - // The kind attribute of the resource associated with the status StatusReason. - // On some operations may differ from the requested resource Kind. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional string kind = 3; - - // UID of the resource. - // (when there is a single resource which can be described). - // More info: http://kubernetes.io/docs/user-guide/identifiers#uids - // +optional - optional string uid = 6; - - // The Causes array includes more details associated with the StatusReason - // failure. Not all StatusReasons may provide detailed causes. - // +optional - repeated StatusCause causes = 4; - - // If specified, the time in seconds before the operation should be retried. Some errors may indicate - // the client must take an alternate action - for those errors this field may indicate how long to wait - // before taking the alternate action. - // +optional - optional int32 retryAfterSeconds = 5; -} - -// TableOptions are used when a Table is requested by the caller. -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -message TableOptions { - // includeObject decides whether to include each object along with its columnar information. - // Specifying "None" will return no object, specifying "Object" will return the full object contents, and - // specifying "Metadata" (the default) will return the object's metadata in the PartialObjectMetadata kind - // in version v1beta1 of the meta.k8s.io API group. - optional string includeObject = 1; -} - -// Time is a wrapper around time.Time which supports correct -// marshaling to YAML and JSON. Wrappers are provided for many -// of the factory methods that the time package offers. -// -// +protobuf.options.marshal=false -// +protobuf.as=Timestamp -// +protobuf.options.(gogoproto.goproto_stringer)=false -message Time { - // Represents seconds of UTC time since Unix epoch - // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - // 9999-12-31T23:59:59Z inclusive. - optional int64 seconds = 1; - - // Non-negative fractions of a second at nanosecond resolution. Negative - // second values with fractions must still have non-negative nanos values - // that count forward in time. Must be from 0 to 999,999,999 - // inclusive. This field may be limited in precision depending on context. - optional int32 nanos = 2; -} - -// Timestamp is a struct that is equivalent to Time, but intended for -// protobuf marshalling/unmarshalling. It is generated into a serialization -// that matches Time. Do not use in Go structs. -message Timestamp { - // Represents seconds of UTC time since Unix epoch - // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - // 9999-12-31T23:59:59Z inclusive. - optional int64 seconds = 1; - - // Non-negative fractions of a second at nanosecond resolution. Negative - // second values with fractions must still have non-negative nanos values - // that count forward in time. Must be from 0 to 999,999,999 - // inclusive. This field may be limited in precision depending on context. - optional int32 nanos = 2; -} - -// TypeMeta describes an individual object in an API response or request -// with strings representing the type of the object and its API schema version. -// Structures that are versioned or persisted should inline TypeMeta. -// -// +k8s:deepcopy-gen=false -message TypeMeta { - // Kind is a string value representing the REST resource this object represents. - // Servers may infer this from the endpoint the client submits requests to. - // Cannot be updated. - // In CamelCase. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional string kind = 1; - - // APIVersion defines the versioned schema of this representation of an object. - // Servers should convert recognized schemas to the latest internal value, and - // may reject unrecognized values. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - // +optional - optional string apiVersion = 2; -} - -// UpdateOptions may be provided when updating an API object. -// All fields in UpdateOptions should also be present in PatchOptions. -message UpdateOptions { - // When present, indicates that modifications should not be - // persisted. An invalid or unrecognized dryRun directive will - // result in an error response and no further processing of the - // request. Valid values are: - // - All: all dry run stages will be processed - // +optional - repeated string dryRun = 1; - - // fieldManager is a name associated with the actor or entity - // that is making these changes. The value must be less than or - // 128 characters long, and only contain printable characters, - // as defined by https://golang.org/pkg/unicode/#IsPrint. - // +optional - optional string fieldManager = 2; -} - -// Verbs masks the value so protobuf can generate -// -// +protobuf.nullable=true -// +protobuf.options.(gogoproto.goproto_stringer)=false -message Verbs { - // items, if empty, will result in an empty slice - - repeated string items = 1; -} - -// Event represents a single event to a watched resource. -// -// +protobuf=true -// +k8s:deepcopy-gen=true -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -message WatchEvent { - optional string type = 1; - - // Object is: - // * If Type is Added or Modified: the new state of the object. - // * If Type is Deleted: the state of the object immediately before deletion. - // * If Type is Error: *Status is recommended; other types may make sense - // depending on context. - optional k8s.io.apimachinery.pkg.runtime.RawExtension object = 2; -} - diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/generated.proto b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/generated.proto deleted file mode 100644 index 1960666..0000000 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/generated.proto +++ /dev/null @@ -1,42 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.apimachinery.pkg.apis.meta.v1beta1; - -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1beta1"; - -// PartialObjectMetadataList contains a list of objects containing only their metadata. -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -message PartialObjectMetadataList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 2; - - // items contains each of the included items. - repeated k8s.io.apimachinery.pkg.apis.meta.v1.PartialObjectMetadata items = 1; -} - diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/generated.proto b/vendor/k8s.io/apimachinery/pkg/runtime/generated.proto deleted file mode 100644 index 0e212ec..0000000 --- a/vendor/k8s.io/apimachinery/pkg/runtime/generated.proto +++ /dev/null @@ -1,127 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.apimachinery.pkg.runtime; - -// Package-wide variables from generator "generated". -option go_package = "runtime"; - -// RawExtension is used to hold extensions in external versions. -// -// To use this, make a field which has RawExtension as its type in your external, versioned -// struct, and Object in your internal struct. You also need to register your -// various plugin types. -// -// // Internal package: -// type MyAPIObject struct { -// runtime.TypeMeta `json:",inline"` -// MyPlugin runtime.Object `json:"myPlugin"` -// } -// type PluginA struct { -// AOption string `json:"aOption"` -// } -// -// // External package: -// type MyAPIObject struct { -// runtime.TypeMeta `json:",inline"` -// MyPlugin runtime.RawExtension `json:"myPlugin"` -// } -// type PluginA struct { -// AOption string `json:"aOption"` -// } -// -// // On the wire, the JSON will look something like this: -// { -// "kind":"MyAPIObject", -// "apiVersion":"v1", -// "myPlugin": { -// "kind":"PluginA", -// "aOption":"foo", -// }, -// } -// -// So what happens? Decode first uses json or yaml to unmarshal the serialized data into -// your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. -// The next step is to copy (using pkg/conversion) into the internal struct. The runtime -// package's DefaultScheme has conversion functions installed which will unpack the -// JSON stored in RawExtension, turning it into the correct object type, and storing it -// in the Object. (TODO: In the case where the object is of an unknown type, a -// runtime.Unknown object will be created and stored.) -// -// +k8s:deepcopy-gen=true -// +protobuf=true -// +k8s:openapi-gen=true -message RawExtension { - // Raw is the underlying serialization of this object. - // - // TODO: Determine how to detect ContentType and ContentEncoding of 'Raw' data. - optional bytes raw = 1; -} - -// TypeMeta is shared by all top level objects. The proper way to use it is to inline it in your type, -// like this: -// type MyAwesomeAPIObject struct { -// runtime.TypeMeta `json:",inline"` -// ... // other fields -// } -// func (obj *MyAwesomeAPIObject) SetGroupVersionKind(gvk *metav1.GroupVersionKind) { metav1.UpdateTypeMeta(obj,gvk) }; GroupVersionKind() *GroupVersionKind -// -// TypeMeta is provided here for convenience. You may use it directly from this package or define -// your own with the same fields. -// -// +k8s:deepcopy-gen=false -// +protobuf=true -// +k8s:openapi-gen=true -message TypeMeta { - // +optional - optional string apiVersion = 1; - - // +optional - optional string kind = 2; -} - -// Unknown allows api objects with unknown types to be passed-through. This can be used -// to deal with the API objects from a plug-in. Unknown objects still have functioning -// TypeMeta features-- kind, version, etc. -// TODO: Make this object have easy access to field based accessors and settors for -// metadata and field mutatation. -// -// +k8s:deepcopy-gen=true -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +protobuf=true -// +k8s:openapi-gen=true -message Unknown { - optional TypeMeta typeMeta = 1; - - // Raw will hold the complete serialized object which couldn't be matched - // with a registered type. Most likely, nothing should be done with this - // except for passing it through the system. - optional bytes raw = 2; - - // ContentEncoding is encoding used to encode 'Raw' data. - // Unspecified means no encoding. - optional string contentEncoding = 3; - - // ContentType is serialization method used to serialize 'Raw'. - // Unspecified means ContentTypeJSON. - optional string contentType = 4; -} - diff --git a/vendor/k8s.io/apimachinery/pkg/util/intstr/generated.proto b/vendor/k8s.io/apimachinery/pkg/util/intstr/generated.proto deleted file mode 100644 index e79fb9e..0000000 --- a/vendor/k8s.io/apimachinery/pkg/util/intstr/generated.proto +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.apimachinery.pkg.util.intstr; - -// Package-wide variables from generator "generated". -option go_package = "intstr"; - -// IntOrString is a type that can hold an int32 or a string. When used in -// JSON or YAML marshalling and unmarshalling, it produces or consumes the -// inner type. This allows you to have, for example, a JSON field that can -// accept a name or number. -// TODO: Rename to Int32OrString -// -// +protobuf=true -// +protobuf.options.(gogoproto.goproto_stringer)=false -// +k8s:openapi-gen=true -message IntOrString { - optional int64 type = 1; - - optional int32 intVal = 2; - - optional string strVal = 3; -} - diff --git a/vendor/k8s.io/apimachinery/pkg/util/mergepatch/OWNERS b/vendor/k8s.io/apimachinery/pkg/util/mergepatch/OWNERS deleted file mode 100644 index 3f72c69..0000000 --- a/vendor/k8s.io/apimachinery/pkg/util/mergepatch/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: -- pwittrock -reviewers: -- mengqiy -- apelisse diff --git a/vendor/k8s.io/apimachinery/pkg/util/strategicpatch/OWNERS b/vendor/k8s.io/apimachinery/pkg/util/strategicpatch/OWNERS deleted file mode 100644 index cfee199..0000000 --- a/vendor/k8s.io/apimachinery/pkg/util/strategicpatch/OWNERS +++ /dev/null @@ -1,8 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: -- pwittrock -- mengqiy -reviewers: -- mengqiy -- apelisse diff --git a/vendor/k8s.io/apimachinery/third_party/forked/golang/json/OWNERS b/vendor/k8s.io/apimachinery/third_party/forked/golang/json/OWNERS deleted file mode 100644 index 3f72c69..0000000 --- a/vendor/k8s.io/apimachinery/third_party/forked/golang/json/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: -- pwittrock -reviewers: -- mengqiy -- apelisse diff --git a/vendor/k8s.io/client-go/discovery/discovery_client.go b/vendor/k8s.io/client-go/discovery/discovery_client.go index 61b9c44..5d89457 100644 --- a/vendor/k8s.io/client-go/discovery/discovery_client.go +++ b/vendor/k8s.io/client-go/discovery/discovery_client.go @@ -463,6 +463,13 @@ func setDiscoveryDefaults(config *restclient.Config) error { if config.Timeout == 0 { config.Timeout = defaultTimeout } + if config.Burst == 0 && config.QPS < 100 { + // discovery is expected to be bursty, increase the default burst + // to accommodate looking up resource info for many API groups. + // matches burst set by ConfigFlags#ToDiscoveryClient(). + // see https://issue.k8s.io/86149 + config.Burst = 100 + } codec := runtime.NoopEncoder{Decoder: scheme.Codecs.UniversalDecoder()} config.NegotiatedSerializer = serializer.NegotiatedSerializerWrapper(runtime.SerializerInfo{Serializer: codec}) if len(config.UserAgent) == 0 { diff --git a/vendor/k8s.io/client-go/discovery/doc.go b/vendor/k8s.io/client-go/discovery/doc.go index 7649558..6baa1ef 100644 --- a/vendor/k8s.io/client-go/discovery/doc.go +++ b/vendor/k8s.io/client-go/discovery/doc.go @@ -16,4 +16,4 @@ limitations under the License. // Package discovery provides ways to discover server-supported // API groups, versions and resources. -package discovery +package discovery // import "k8s.io/client-go/discovery" diff --git a/vendor/k8s.io/client-go/kubernetes/clientset.go b/vendor/k8s.io/client-go/kubernetes/clientset.go index fb889e6..cf98b05 100644 --- a/vendor/k8s.io/client-go/kubernetes/clientset.go +++ b/vendor/k8s.io/client-go/kubernetes/clientset.go @@ -19,7 +19,10 @@ limitations under the License. package kubernetes import ( + "fmt" + discovery "k8s.io/client-go/discovery" + admissionregistrationv1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1" admissionregistrationv1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1" appsv1 "k8s.io/client-go/kubernetes/typed/apps/v1" appsv1beta1 "k8s.io/client-go/kubernetes/typed/apps/v1beta1" @@ -39,8 +42,11 @@ import ( coordinationv1 "k8s.io/client-go/kubernetes/typed/coordination/v1" coordinationv1beta1 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1" corev1 "k8s.io/client-go/kubernetes/typed/core/v1" + discoveryv1alpha1 "k8s.io/client-go/kubernetes/typed/discovery/v1alpha1" + discoveryv1beta1 "k8s.io/client-go/kubernetes/typed/discovery/v1beta1" eventsv1beta1 "k8s.io/client-go/kubernetes/typed/events/v1beta1" extensionsv1beta1 "k8s.io/client-go/kubernetes/typed/extensions/v1beta1" + flowcontrolv1alpha1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1" networkingv1 "k8s.io/client-go/kubernetes/typed/networking/v1" networkingv1beta1 "k8s.io/client-go/kubernetes/typed/networking/v1beta1" nodev1alpha1 "k8s.io/client-go/kubernetes/typed/node/v1alpha1" @@ -62,6 +68,7 @@ import ( type Interface interface { Discovery() discovery.DiscoveryInterface + AdmissionregistrationV1() admissionregistrationv1.AdmissionregistrationV1Interface AdmissionregistrationV1beta1() admissionregistrationv1beta1.AdmissionregistrationV1beta1Interface AppsV1() appsv1.AppsV1Interface AppsV1beta1() appsv1beta1.AppsV1beta1Interface @@ -81,8 +88,11 @@ type Interface interface { CoordinationV1beta1() coordinationv1beta1.CoordinationV1beta1Interface CoordinationV1() coordinationv1.CoordinationV1Interface CoreV1() corev1.CoreV1Interface + DiscoveryV1alpha1() discoveryv1alpha1.DiscoveryV1alpha1Interface + DiscoveryV1beta1() discoveryv1beta1.DiscoveryV1beta1Interface EventsV1beta1() eventsv1beta1.EventsV1beta1Interface ExtensionsV1beta1() extensionsv1beta1.ExtensionsV1beta1Interface + FlowcontrolV1alpha1() flowcontrolv1alpha1.FlowcontrolV1alpha1Interface NetworkingV1() networkingv1.NetworkingV1Interface NetworkingV1beta1() networkingv1beta1.NetworkingV1beta1Interface NodeV1alpha1() nodev1alpha1.NodeV1alpha1Interface @@ -104,6 +114,7 @@ type Interface interface { // version included in a Clientset. type Clientset struct { *discovery.DiscoveryClient + admissionregistrationV1 *admissionregistrationv1.AdmissionregistrationV1Client admissionregistrationV1beta1 *admissionregistrationv1beta1.AdmissionregistrationV1beta1Client appsV1 *appsv1.AppsV1Client appsV1beta1 *appsv1beta1.AppsV1beta1Client @@ -123,8 +134,11 @@ type Clientset struct { coordinationV1beta1 *coordinationv1beta1.CoordinationV1beta1Client coordinationV1 *coordinationv1.CoordinationV1Client coreV1 *corev1.CoreV1Client + discoveryV1alpha1 *discoveryv1alpha1.DiscoveryV1alpha1Client + discoveryV1beta1 *discoveryv1beta1.DiscoveryV1beta1Client eventsV1beta1 *eventsv1beta1.EventsV1beta1Client extensionsV1beta1 *extensionsv1beta1.ExtensionsV1beta1Client + flowcontrolV1alpha1 *flowcontrolv1alpha1.FlowcontrolV1alpha1Client networkingV1 *networkingv1.NetworkingV1Client networkingV1beta1 *networkingv1beta1.NetworkingV1beta1Client nodeV1alpha1 *nodev1alpha1.NodeV1alpha1Client @@ -142,6 +156,11 @@ type Clientset struct { storageV1alpha1 *storagev1alpha1.StorageV1alpha1Client } +// AdmissionregistrationV1 retrieves the AdmissionregistrationV1Client +func (c *Clientset) AdmissionregistrationV1() admissionregistrationv1.AdmissionregistrationV1Interface { + return c.admissionregistrationV1 +} + // AdmissionregistrationV1beta1 retrieves the AdmissionregistrationV1beta1Client func (c *Clientset) AdmissionregistrationV1beta1() admissionregistrationv1beta1.AdmissionregistrationV1beta1Interface { return c.admissionregistrationV1beta1 @@ -237,6 +256,16 @@ func (c *Clientset) CoreV1() corev1.CoreV1Interface { return c.coreV1 } +// DiscoveryV1alpha1 retrieves the DiscoveryV1alpha1Client +func (c *Clientset) DiscoveryV1alpha1() discoveryv1alpha1.DiscoveryV1alpha1Interface { + return c.discoveryV1alpha1 +} + +// DiscoveryV1beta1 retrieves the DiscoveryV1beta1Client +func (c *Clientset) DiscoveryV1beta1() discoveryv1beta1.DiscoveryV1beta1Interface { + return c.discoveryV1beta1 +} + // EventsV1beta1 retrieves the EventsV1beta1Client func (c *Clientset) EventsV1beta1() eventsv1beta1.EventsV1beta1Interface { return c.eventsV1beta1 @@ -247,6 +276,11 @@ func (c *Clientset) ExtensionsV1beta1() extensionsv1beta1.ExtensionsV1beta1Inter return c.extensionsV1beta1 } +// FlowcontrolV1alpha1 retrieves the FlowcontrolV1alpha1Client +func (c *Clientset) FlowcontrolV1alpha1() flowcontrolv1alpha1.FlowcontrolV1alpha1Interface { + return c.flowcontrolV1alpha1 +} + // NetworkingV1 retrieves the NetworkingV1Client func (c *Clientset) NetworkingV1() networkingv1.NetworkingV1Interface { return c.networkingV1 @@ -331,13 +365,22 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface { } // NewForConfig creates a new Clientset for the given config. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfig will generate a rate-limiter in configShallowCopy. func NewForConfig(c *rest.Config) (*Clientset, error) { configShallowCopy := *c if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { + if configShallowCopy.Burst <= 0 { + return nil, fmt.Errorf("Burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + } configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) } var cs Clientset var err error + cs.admissionregistrationV1, err = admissionregistrationv1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } cs.admissionregistrationV1beta1, err = admissionregistrationv1beta1.NewForConfig(&configShallowCopy) if err != nil { return nil, err @@ -414,6 +457,14 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { if err != nil { return nil, err } + cs.discoveryV1alpha1, err = discoveryv1alpha1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + cs.discoveryV1beta1, err = discoveryv1beta1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } cs.eventsV1beta1, err = eventsv1beta1.NewForConfig(&configShallowCopy) if err != nil { return nil, err @@ -422,6 +473,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { if err != nil { return nil, err } + cs.flowcontrolV1alpha1, err = flowcontrolv1alpha1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } cs.networkingV1, err = networkingv1.NewForConfig(&configShallowCopy) if err != nil { return nil, err @@ -494,6 +549,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *Clientset { var cs Clientset + cs.admissionregistrationV1 = admissionregistrationv1.NewForConfigOrDie(c) cs.admissionregistrationV1beta1 = admissionregistrationv1beta1.NewForConfigOrDie(c) cs.appsV1 = appsv1.NewForConfigOrDie(c) cs.appsV1beta1 = appsv1beta1.NewForConfigOrDie(c) @@ -513,8 +569,11 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { cs.coordinationV1beta1 = coordinationv1beta1.NewForConfigOrDie(c) cs.coordinationV1 = coordinationv1.NewForConfigOrDie(c) cs.coreV1 = corev1.NewForConfigOrDie(c) + cs.discoveryV1alpha1 = discoveryv1alpha1.NewForConfigOrDie(c) + cs.discoveryV1beta1 = discoveryv1beta1.NewForConfigOrDie(c) cs.eventsV1beta1 = eventsv1beta1.NewForConfigOrDie(c) cs.extensionsV1beta1 = extensionsv1beta1.NewForConfigOrDie(c) + cs.flowcontrolV1alpha1 = flowcontrolv1alpha1.NewForConfigOrDie(c) cs.networkingV1 = networkingv1.NewForConfigOrDie(c) cs.networkingV1beta1 = networkingv1beta1.NewForConfigOrDie(c) cs.nodeV1alpha1 = nodev1alpha1.NewForConfigOrDie(c) @@ -538,6 +597,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { // New creates a new Clientset for the given RESTClient. func New(c rest.Interface) *Clientset { var cs Clientset + cs.admissionregistrationV1 = admissionregistrationv1.New(c) cs.admissionregistrationV1beta1 = admissionregistrationv1beta1.New(c) cs.appsV1 = appsv1.New(c) cs.appsV1beta1 = appsv1beta1.New(c) @@ -557,8 +617,11 @@ func New(c rest.Interface) *Clientset { cs.coordinationV1beta1 = coordinationv1beta1.New(c) cs.coordinationV1 = coordinationv1.New(c) cs.coreV1 = corev1.New(c) + cs.discoveryV1alpha1 = discoveryv1alpha1.New(c) + cs.discoveryV1beta1 = discoveryv1beta1.New(c) cs.eventsV1beta1 = eventsv1beta1.New(c) cs.extensionsV1beta1 = extensionsv1beta1.New(c) + cs.flowcontrolV1alpha1 = flowcontrolv1alpha1.New(c) cs.networkingV1 = networkingv1.New(c) cs.networkingV1beta1 = networkingv1beta1.New(c) cs.nodeV1alpha1 = nodev1alpha1.New(c) diff --git a/vendor/k8s.io/client-go/kubernetes/scheme/register.go b/vendor/k8s.io/client-go/kubernetes/scheme/register.go index 8346d26..4d8e8b7 100644 --- a/vendor/k8s.io/client-go/kubernetes/scheme/register.go +++ b/vendor/k8s.io/client-go/kubernetes/scheme/register.go @@ -19,6 +19,7 @@ limitations under the License. package scheme import ( + admissionregistrationv1 "k8s.io/api/admissionregistration/v1" admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" appsv1 "k8s.io/api/apps/v1" appsv1beta1 "k8s.io/api/apps/v1beta1" @@ -38,8 +39,11 @@ import ( coordinationv1 "k8s.io/api/coordination/v1" coordinationv1beta1 "k8s.io/api/coordination/v1beta1" corev1 "k8s.io/api/core/v1" + discoveryv1alpha1 "k8s.io/api/discovery/v1alpha1" + discoveryv1beta1 "k8s.io/api/discovery/v1beta1" eventsv1beta1 "k8s.io/api/events/v1beta1" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" + flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" networkingv1 "k8s.io/api/networking/v1" networkingv1beta1 "k8s.io/api/networking/v1beta1" nodev1alpha1 "k8s.io/api/node/v1alpha1" @@ -66,6 +70,7 @@ var Scheme = runtime.NewScheme() var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ + admissionregistrationv1.AddToScheme, admissionregistrationv1beta1.AddToScheme, appsv1.AddToScheme, appsv1beta1.AddToScheme, @@ -85,8 +90,11 @@ var localSchemeBuilder = runtime.SchemeBuilder{ coordinationv1beta1.AddToScheme, coordinationv1.AddToScheme, corev1.AddToScheme, + discoveryv1alpha1.AddToScheme, + discoveryv1beta1.AddToScheme, eventsv1beta1.AddToScheme, extensionsv1beta1.AddToScheme, + flowcontrolv1alpha1.AddToScheme, networkingv1.AddToScheme, networkingv1beta1.AddToScheme, nodev1alpha1.AddToScheme, diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/admissionregistration_client.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/admissionregistration_client.go new file mode 100644 index 0000000..7512731 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/admissionregistration_client.go @@ -0,0 +1,94 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/admissionregistration/v1" + "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +type AdmissionregistrationV1Interface interface { + RESTClient() rest.Interface + MutatingWebhookConfigurationsGetter + ValidatingWebhookConfigurationsGetter +} + +// AdmissionregistrationV1Client is used to interact with features provided by the admissionregistration.k8s.io group. +type AdmissionregistrationV1Client struct { + restClient rest.Interface +} + +func (c *AdmissionregistrationV1Client) MutatingWebhookConfigurations() MutatingWebhookConfigurationInterface { + return newMutatingWebhookConfigurations(c) +} + +func (c *AdmissionregistrationV1Client) ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInterface { + return newValidatingWebhookConfigurations(c) +} + +// NewForConfig creates a new AdmissionregistrationV1Client for the given config. +func NewForConfig(c *rest.Config) (*AdmissionregistrationV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &AdmissionregistrationV1Client{client}, nil +} + +// NewForConfigOrDie creates a new AdmissionregistrationV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *AdmissionregistrationV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new AdmissionregistrationV1Client for the given RESTClient. +func New(c rest.Interface) *AdmissionregistrationV1Client { + return &AdmissionregistrationV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *AdmissionregistrationV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/k8s.io/kube-openapi/pkg/common/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/doc.go similarity index 77% rename from vendor/k8s.io/kube-openapi/pkg/common/doc.go rename to vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/doc.go index 2ba6d24..3af5d05 100644 --- a/vendor/k8s.io/kube-openapi/pkg/common/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors. +Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// package common holds shared code and types between open API code -// generator and spec generator. -package common +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1 diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.proto b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/generated_expansion.go similarity index 71% rename from vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.proto rename to vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/generated_expansion.go index 5aeeaa1..a5b062e 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.proto +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/generated_expansion.go @@ -14,13 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Code generated by client-gen. DO NOT EDIT. -// This file was autogenerated by go-to-protobuf. Do not edit it manually! +package v1 -syntax = 'proto2'; - -package k8s.io.apimachinery.pkg.runtime.schema; - -// Package-wide variables from generator "generated". -option go_package = "schema"; +type MutatingWebhookConfigurationExpansion interface{} +type ValidatingWebhookConfigurationExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go new file mode 100644 index 0000000..1f5e5e3 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go @@ -0,0 +1,164 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "time" + + v1 "k8s.io/api/admissionregistration/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +// MutatingWebhookConfigurationsGetter has a method to return a MutatingWebhookConfigurationInterface. +// A group's client should implement this interface. +type MutatingWebhookConfigurationsGetter interface { + MutatingWebhookConfigurations() MutatingWebhookConfigurationInterface +} + +// MutatingWebhookConfigurationInterface has methods to work with MutatingWebhookConfiguration resources. +type MutatingWebhookConfigurationInterface interface { + Create(*v1.MutatingWebhookConfiguration) (*v1.MutatingWebhookConfiguration, error) + Update(*v1.MutatingWebhookConfiguration) (*v1.MutatingWebhookConfiguration, error) + Delete(name string, options *metav1.DeleteOptions) error + DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error + Get(name string, options metav1.GetOptions) (*v1.MutatingWebhookConfiguration, error) + List(opts metav1.ListOptions) (*v1.MutatingWebhookConfigurationList, error) + Watch(opts metav1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.MutatingWebhookConfiguration, err error) + MutatingWebhookConfigurationExpansion +} + +// mutatingWebhookConfigurations implements MutatingWebhookConfigurationInterface +type mutatingWebhookConfigurations struct { + client rest.Interface +} + +// newMutatingWebhookConfigurations returns a MutatingWebhookConfigurations +func newMutatingWebhookConfigurations(c *AdmissionregistrationV1Client) *mutatingWebhookConfigurations { + return &mutatingWebhookConfigurations{ + client: c.RESTClient(), + } +} + +// Get takes name of the mutatingWebhookConfiguration, and returns the corresponding mutatingWebhookConfiguration object, and an error if there is any. +func (c *mutatingWebhookConfigurations) Get(name string, options metav1.GetOptions) (result *v1.MutatingWebhookConfiguration, err error) { + result = &v1.MutatingWebhookConfiguration{} + err = c.client.Get(). + Resource("mutatingwebhookconfigurations"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. +func (c *mutatingWebhookConfigurations) List(opts metav1.ListOptions) (result *v1.MutatingWebhookConfigurationList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.MutatingWebhookConfigurationList{} + err = c.client.Get(). + Resource("mutatingwebhookconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations. +func (c *mutatingWebhookConfigurations) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("mutatingwebhookconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch() +} + +// Create takes the representation of a mutatingWebhookConfiguration and creates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. +func (c *mutatingWebhookConfigurations) Create(mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration) (result *v1.MutatingWebhookConfiguration, err error) { + result = &v1.MutatingWebhookConfiguration{} + err = c.client.Post(). + Resource("mutatingwebhookconfigurations"). + Body(mutatingWebhookConfiguration). + Do(). + Into(result) + return +} + +// Update takes the representation of a mutatingWebhookConfiguration and updates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. +func (c *mutatingWebhookConfigurations) Update(mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration) (result *v1.MutatingWebhookConfiguration, err error) { + result = &v1.MutatingWebhookConfiguration{} + err = c.client.Put(). + Resource("mutatingwebhookconfigurations"). + Name(mutatingWebhookConfiguration.Name). + Body(mutatingWebhookConfiguration). + Do(). + Into(result) + return +} + +// Delete takes name of the mutatingWebhookConfiguration and deletes it. Returns an error if one occurs. +func (c *mutatingWebhookConfigurations) Delete(name string, options *metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("mutatingwebhookconfigurations"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *mutatingWebhookConfigurations) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("mutatingwebhookconfigurations"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched mutatingWebhookConfiguration. +func (c *mutatingWebhookConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.MutatingWebhookConfiguration, err error) { + result = &v1.MutatingWebhookConfiguration{} + err = c.client.Patch(pt). + Resource("mutatingwebhookconfigurations"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go new file mode 100644 index 0000000..7987b6e --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go @@ -0,0 +1,164 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "time" + + v1 "k8s.io/api/admissionregistration/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +// ValidatingWebhookConfigurationsGetter has a method to return a ValidatingWebhookConfigurationInterface. +// A group's client should implement this interface. +type ValidatingWebhookConfigurationsGetter interface { + ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInterface +} + +// ValidatingWebhookConfigurationInterface has methods to work with ValidatingWebhookConfiguration resources. +type ValidatingWebhookConfigurationInterface interface { + Create(*v1.ValidatingWebhookConfiguration) (*v1.ValidatingWebhookConfiguration, error) + Update(*v1.ValidatingWebhookConfiguration) (*v1.ValidatingWebhookConfiguration, error) + Delete(name string, options *metav1.DeleteOptions) error + DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error + Get(name string, options metav1.GetOptions) (*v1.ValidatingWebhookConfiguration, error) + List(opts metav1.ListOptions) (*v1.ValidatingWebhookConfigurationList, error) + Watch(opts metav1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ValidatingWebhookConfiguration, err error) + ValidatingWebhookConfigurationExpansion +} + +// validatingWebhookConfigurations implements ValidatingWebhookConfigurationInterface +type validatingWebhookConfigurations struct { + client rest.Interface +} + +// newValidatingWebhookConfigurations returns a ValidatingWebhookConfigurations +func newValidatingWebhookConfigurations(c *AdmissionregistrationV1Client) *validatingWebhookConfigurations { + return &validatingWebhookConfigurations{ + client: c.RESTClient(), + } +} + +// Get takes name of the validatingWebhookConfiguration, and returns the corresponding validatingWebhookConfiguration object, and an error if there is any. +func (c *validatingWebhookConfigurations) Get(name string, options metav1.GetOptions) (result *v1.ValidatingWebhookConfiguration, err error) { + result = &v1.ValidatingWebhookConfiguration{} + err = c.client.Get(). + Resource("validatingwebhookconfigurations"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. +func (c *validatingWebhookConfigurations) List(opts metav1.ListOptions) (result *v1.ValidatingWebhookConfigurationList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ValidatingWebhookConfigurationList{} + err = c.client.Get(). + Resource("validatingwebhookconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations. +func (c *validatingWebhookConfigurations) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("validatingwebhookconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch() +} + +// Create takes the representation of a validatingWebhookConfiguration and creates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. +func (c *validatingWebhookConfigurations) Create(validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration) (result *v1.ValidatingWebhookConfiguration, err error) { + result = &v1.ValidatingWebhookConfiguration{} + err = c.client.Post(). + Resource("validatingwebhookconfigurations"). + Body(validatingWebhookConfiguration). + Do(). + Into(result) + return +} + +// Update takes the representation of a validatingWebhookConfiguration and updates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. +func (c *validatingWebhookConfigurations) Update(validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration) (result *v1.ValidatingWebhookConfiguration, err error) { + result = &v1.ValidatingWebhookConfiguration{} + err = c.client.Put(). + Resource("validatingwebhookconfigurations"). + Name(validatingWebhookConfiguration.Name). + Body(validatingWebhookConfiguration). + Do(). + Into(result) + return +} + +// Delete takes name of the validatingWebhookConfiguration and deletes it. Returns an error if one occurs. +func (c *validatingWebhookConfigurations) Delete(name string, options *metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("validatingwebhookconfigurations"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *validatingWebhookConfigurations) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("validatingwebhookconfigurations"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched validatingWebhookConfiguration. +func (c *validatingWebhookConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ValidatingWebhookConfiguration, err error) { + result = &v1.ValidatingWebhookConfiguration{} + err = c.client.Patch(pt). + Resource("validatingwebhookconfigurations"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/tokenreview_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/tokenreview_expansion.go index ea21f1b..8a21b7c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/tokenreview_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/tokenreview_expansion.go @@ -17,16 +17,24 @@ limitations under the License. package v1 import ( + "context" + authenticationapi "k8s.io/api/authentication/v1" ) type TokenReviewExpansion interface { Create(tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) + CreateContext(ctx context.Context, tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) } func (c *tokenReviews) Create(tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) { + return c.CreateContext(context.Background(), tokenReview) +} + +func (c *tokenReviews) CreateContext(ctx context.Context, tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) { result = &authenticationapi.TokenReview{} err = c.client.Post(). + Context(ctx). Resource("tokenreviews"). Body(tokenReview). Do(). diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview_expansion.go index 8f186fa..0476b17 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview_expansion.go @@ -17,16 +17,24 @@ limitations under the License. package v1beta1 import ( + "context" + authenticationapi "k8s.io/api/authentication/v1beta1" ) type TokenReviewExpansion interface { Create(tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) + CreateContext(ctx context.Context, tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) } func (c *tokenReviews) Create(tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) { + return c.CreateContext(context.Background(), tokenReview) +} + +func (c *tokenReviews) CreateContext(ctx context.Context, tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) { result = &authenticationapi.TokenReview{} err = c.client.Post(). + Context(ctx). Resource("tokenreviews"). Body(tokenReview). Do(). diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/localsubjectaccessreview_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/localsubjectaccessreview_expansion.go index 0c123b0..9836308 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/localsubjectaccessreview_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/localsubjectaccessreview_expansion.go @@ -17,16 +17,24 @@ limitations under the License. package v1 import ( + "context" + authorizationapi "k8s.io/api/authorization/v1" ) type LocalSubjectAccessReviewExpansion interface { Create(sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) + CreateContext(ctx context.Context, sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) } func (c *localSubjectAccessReviews) Create(sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) { + return c.CreateContext(context.Background(), sar) +} + +func (c *localSubjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) { result = &authorizationapi.LocalSubjectAccessReview{} err = c.client.Post(). + Context(ctx). Namespace(c.ns). Resource("localsubjectaccessreviews"). Body(sar). diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectaccessreview_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectaccessreview_expansion.go index 5b70a27..916e5b4 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectaccessreview_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectaccessreview_expansion.go @@ -17,16 +17,24 @@ limitations under the License. package v1 import ( + "context" + authorizationapi "k8s.io/api/authorization/v1" ) type SelfSubjectAccessReviewExpansion interface { Create(sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) + CreateContext(ctx context.Context, sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) } func (c *selfSubjectAccessReviews) Create(sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) { + return c.CreateContext(context.Background(), sar) +} + +func (c *selfSubjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) { result = &authorizationapi.SelfSubjectAccessReview{} err = c.client.Post(). + Context(ctx). Resource("selfsubjectaccessreviews"). Body(sar). Do(). diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectrulesreview_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectrulesreview_expansion.go index e2cad88..365282e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectrulesreview_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectrulesreview_expansion.go @@ -17,16 +17,24 @@ limitations under the License. package v1 import ( + "context" + authorizationapi "k8s.io/api/authorization/v1" ) type SelfSubjectRulesReviewExpansion interface { Create(srr *authorizationapi.SelfSubjectRulesReview) (result *authorizationapi.SelfSubjectRulesReview, err error) + CreateContext(ctx context.Context, srr *authorizationapi.SelfSubjectRulesReview) (result *authorizationapi.SelfSubjectRulesReview, err error) } func (c *selfSubjectRulesReviews) Create(srr *authorizationapi.SelfSubjectRulesReview) (result *authorizationapi.SelfSubjectRulesReview, err error) { + return c.CreateContext(context.Background(), srr) +} + +func (c *selfSubjectRulesReviews) CreateContext(ctx context.Context, srr *authorizationapi.SelfSubjectRulesReview) (result *authorizationapi.SelfSubjectRulesReview, err error) { result = &authorizationapi.SelfSubjectRulesReview{} err = c.client.Post(). + Context(ctx). Resource("selfsubjectrulesreviews"). Body(srr). Do(). diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/subjectaccessreview_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/subjectaccessreview_expansion.go index b5ed87d..927544f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/subjectaccessreview_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/subjectaccessreview_expansion.go @@ -17,17 +17,25 @@ limitations under the License. package v1 import ( + "context" + authorizationapi "k8s.io/api/authorization/v1" ) // The SubjectAccessReviewExpansion interface allows manually adding extra methods to the AuthorizationInterface. type SubjectAccessReviewExpansion interface { Create(sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) + CreateContext(ctx context.Context, sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) } func (c *subjectAccessReviews) Create(sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) { + return c.CreateContext(context.Background(), sar) +} + +func (c *subjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) { result = &authorizationapi.SubjectAccessReview{} err = c.client.Post(). + Context(ctx). Resource("subjectaccessreviews"). Body(sar). Do(). diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview_expansion.go index bf1b8a5..148cf62 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview_expansion.go @@ -17,16 +17,24 @@ limitations under the License. package v1beta1 import ( + "context" + authorizationapi "k8s.io/api/authorization/v1beta1" ) type LocalSubjectAccessReviewExpansion interface { Create(sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) + CreateContext(ctx context.Context, sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) } func (c *localSubjectAccessReviews) Create(sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) { + return c.CreateContext(context.Background(), sar) +} + +func (c *localSubjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) { result = &authorizationapi.LocalSubjectAccessReview{} err = c.client.Post(). + Context(ctx). Namespace(c.ns). Resource("localsubjectaccessreviews"). Body(sar). diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview_expansion.go index 58fecfd..6edead0 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview_expansion.go @@ -17,16 +17,24 @@ limitations under the License. package v1beta1 import ( + "context" + authorizationapi "k8s.io/api/authorization/v1beta1" ) type SelfSubjectAccessReviewExpansion interface { Create(sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) + CreateContext(ctx context.Context, sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) } func (c *selfSubjectAccessReviews) Create(sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) { + return c.CreateContext(context.Background(), sar) +} + +func (c *selfSubjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) { result = &authorizationapi.SelfSubjectAccessReview{} err = c.client.Post(). + Context(ctx). Resource("selfsubjectaccessreviews"). Body(sar). Do(). diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview_expansion.go index 5f1f37e..a459d5c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview_expansion.go @@ -17,16 +17,24 @@ limitations under the License. package v1beta1 import ( + "context" + authorizationapi "k8s.io/api/authorization/v1beta1" ) type SelfSubjectRulesReviewExpansion interface { Create(srr *authorizationapi.SelfSubjectRulesReview) (result *authorizationapi.SelfSubjectRulesReview, err error) + CreateContext(ctx context.Context, srr *authorizationapi.SelfSubjectRulesReview) (result *authorizationapi.SelfSubjectRulesReview, err error) } func (c *selfSubjectRulesReviews) Create(srr *authorizationapi.SelfSubjectRulesReview) (result *authorizationapi.SelfSubjectRulesReview, err error) { + return c.CreateContext(context.Background(), srr) +} + +func (c *selfSubjectRulesReviews) CreateContext(ctx context.Context, srr *authorizationapi.SelfSubjectRulesReview) (result *authorizationapi.SelfSubjectRulesReview, err error) { result = &authorizationapi.SelfSubjectRulesReview{} err = c.client.Post(). + Context(ctx). Resource("selfsubjectrulesreviews"). Body(srr). Do(). diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview_expansion.go index 4f93689..7072e29 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview_expansion.go @@ -17,17 +17,25 @@ limitations under the License. package v1beta1 import ( + "context" + authorizationapi "k8s.io/api/authorization/v1beta1" ) // The SubjectAccessReviewExpansion interface allows manually adding extra methods to the AuthorizationInterface. type SubjectAccessReviewExpansion interface { Create(sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) + CreateContext(ctx context.Context, sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) } func (c *subjectAccessReviews) Create(sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) { + return c.CreateContext(context.Background(), sar) +} + +func (c *subjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) { result = &authorizationapi.SubjectAccessReview{} err = c.client.Post(). + Context(ctx). Resource("subjectaccessreviews"). Body(sar). Do(). diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event_expansion.go index 6929ade..5a82afa 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event_expansion.go @@ -104,17 +104,17 @@ func (e *events) Search(scheme *runtime.Scheme, objOrRef runtime.Object) (*v1.Ev if err != nil { return nil, err } - if e.ns != "" && ref.Namespace != e.ns { + if len(e.ns) > 0 && ref.Namespace != e.ns { return nil, fmt.Errorf("won't be able to find any events of namespace '%v' in namespace '%v'", ref.Namespace, e.ns) } stringRefKind := string(ref.Kind) var refKind *string - if stringRefKind != "" { + if len(stringRefKind) > 0 { refKind = &stringRefKind } stringRefUID := string(ref.UID) var refUID *string - if stringRefUID != "" { + if len(stringRefUID) > 0 { refUID = &stringRefUID } fieldSelector := e.GetFieldSelector(&ref.Name, &ref.Namespace, refKind, refUID) @@ -124,10 +124,9 @@ func (e *events) Search(scheme *runtime.Scheme, objOrRef runtime.Object) (*v1.Ev // Returns the appropriate field selector based on the API version being used to communicate with the server. // The returned field selector can be used with List and Watch to filter desired events. func (e *events) GetFieldSelector(involvedObjectName, involvedObjectNamespace, involvedObjectKind, involvedObjectUID *string) fields.Selector { - apiVersion := e.client.APIVersion().String() field := fields.Set{} if involvedObjectName != nil { - field[GetInvolvedObjectNameFieldLabel(apiVersion)] = *involvedObjectName + field["involvedObject.name"] = *involvedObjectName } if involvedObjectNamespace != nil { field["involvedObject.namespace"] = *involvedObjectNamespace @@ -142,6 +141,7 @@ func (e *events) GetFieldSelector(involvedObjectName, involvedObjectNamespace, i } // Returns the appropriate field label to use for name of the involved object as per the given API version. +// DEPRECATED: please use "involvedObject.name" inline. func GetInvolvedObjectNameFieldLabel(version string) string { return "involvedObject.name" } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go index 8d6b6e8..feacd30 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go @@ -46,6 +46,9 @@ type PodInterface interface { List(opts metav1.ListOptions) (*v1.PodList, error) Watch(opts metav1.ListOptions) (watch.Interface, error) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Pod, err error) + GetEphemeralContainers(podName string, options metav1.GetOptions) (*v1.EphemeralContainers, error) + UpdateEphemeralContainers(podName string, ephemeralContainers *v1.EphemeralContainers) (*v1.EphemeralContainers, error) + PodExpansion } @@ -189,3 +192,31 @@ func (c *pods) Patch(name string, pt types.PatchType, data []byte, subresources Into(result) return } + +// GetEphemeralContainers takes name of the pod, and returns the corresponding v1.EphemeralContainers object, and an error if there is any. +func (c *pods) GetEphemeralContainers(podName string, options metav1.GetOptions) (result *v1.EphemeralContainers, err error) { + result = &v1.EphemeralContainers{} + err = c.client.Get(). + Namespace(c.ns). + Resource("pods"). + Name(podName). + SubResource("ephemeralcontainers"). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// UpdateEphemeralContainers takes the top resource name and the representation of a ephemeralContainers and updates it. Returns the server's representation of the ephemeralContainers, and an error, if there is any. +func (c *pods) UpdateEphemeralContainers(podName string, ephemeralContainers *v1.EphemeralContainers) (result *v1.EphemeralContainers, err error) { + result = &v1.EphemeralContainers{} + err = c.client.Put(). + Namespace(c.ns). + Resource("pods"). + Name(podName). + SubResource("ephemeralcontainers"). + Body(ephemeralContainers). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/discovery_client.go b/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/discovery_client.go new file mode 100644 index 0000000..e65a098 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/discovery_client.go @@ -0,0 +1,89 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "k8s.io/api/discovery/v1alpha1" + "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +type DiscoveryV1alpha1Interface interface { + RESTClient() rest.Interface + EndpointSlicesGetter +} + +// DiscoveryV1alpha1Client is used to interact with features provided by the discovery.k8s.io group. +type DiscoveryV1alpha1Client struct { + restClient rest.Interface +} + +func (c *DiscoveryV1alpha1Client) EndpointSlices(namespace string) EndpointSliceInterface { + return newEndpointSlices(c, namespace) +} + +// NewForConfig creates a new DiscoveryV1alpha1Client for the given config. +func NewForConfig(c *rest.Config) (*DiscoveryV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &DiscoveryV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new DiscoveryV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *DiscoveryV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new DiscoveryV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *DiscoveryV1alpha1Client { + return &DiscoveryV1alpha1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1alpha1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *DiscoveryV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/k8s.io/gengo/parser/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/doc.go similarity index 75% rename from vendor/k8s.io/gengo/parser/doc.go rename to vendor/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/doc.go index 8231b6d..df51baa 100644 --- a/vendor/k8s.io/gengo/parser/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors. +Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package parser provides code to parse go files, type-check them, extract the -// types. -package parser // import "k8s.io/gengo/parser" +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/endpointslice.go b/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/endpointslice.go new file mode 100644 index 0000000..4175147 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/endpointslice.go @@ -0,0 +1,174 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "time" + + v1alpha1 "k8s.io/api/discovery/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +// EndpointSlicesGetter has a method to return a EndpointSliceInterface. +// A group's client should implement this interface. +type EndpointSlicesGetter interface { + EndpointSlices(namespace string) EndpointSliceInterface +} + +// EndpointSliceInterface has methods to work with EndpointSlice resources. +type EndpointSliceInterface interface { + Create(*v1alpha1.EndpointSlice) (*v1alpha1.EndpointSlice, error) + Update(*v1alpha1.EndpointSlice) (*v1alpha1.EndpointSlice, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha1.EndpointSlice, error) + List(opts v1.ListOptions) (*v1alpha1.EndpointSliceList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.EndpointSlice, err error) + EndpointSliceExpansion +} + +// endpointSlices implements EndpointSliceInterface +type endpointSlices struct { + client rest.Interface + ns string +} + +// newEndpointSlices returns a EndpointSlices +func newEndpointSlices(c *DiscoveryV1alpha1Client, namespace string) *endpointSlices { + return &endpointSlices{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the endpointSlice, and returns the corresponding endpointSlice object, and an error if there is any. +func (c *endpointSlices) Get(name string, options v1.GetOptions) (result *v1alpha1.EndpointSlice, err error) { + result = &v1alpha1.EndpointSlice{} + err = c.client.Get(). + Namespace(c.ns). + Resource("endpointslices"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of EndpointSlices that match those selectors. +func (c *endpointSlices) List(opts v1.ListOptions) (result *v1alpha1.EndpointSliceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.EndpointSliceList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("endpointslices"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested endpointSlices. +func (c *endpointSlices) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("endpointslices"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch() +} + +// Create takes the representation of a endpointSlice and creates it. Returns the server's representation of the endpointSlice, and an error, if there is any. +func (c *endpointSlices) Create(endpointSlice *v1alpha1.EndpointSlice) (result *v1alpha1.EndpointSlice, err error) { + result = &v1alpha1.EndpointSlice{} + err = c.client.Post(). + Namespace(c.ns). + Resource("endpointslices"). + Body(endpointSlice). + Do(). + Into(result) + return +} + +// Update takes the representation of a endpointSlice and updates it. Returns the server's representation of the endpointSlice, and an error, if there is any. +func (c *endpointSlices) Update(endpointSlice *v1alpha1.EndpointSlice) (result *v1alpha1.EndpointSlice, err error) { + result = &v1alpha1.EndpointSlice{} + err = c.client.Put(). + Namespace(c.ns). + Resource("endpointslices"). + Name(endpointSlice.Name). + Body(endpointSlice). + Do(). + Into(result) + return +} + +// Delete takes name of the endpointSlice and deletes it. Returns an error if one occurs. +func (c *endpointSlices) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("endpointslices"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *endpointSlices) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("endpointslices"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched endpointSlice. +func (c *endpointSlices) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.EndpointSlice, err error) { + result = &v1alpha1.EndpointSlice{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("endpointslices"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/generated_expansion.go new file mode 100644 index 0000000..e8ceb59 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/generated_expansion.go @@ -0,0 +1,21 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +type EndpointSliceExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/discovery_client.go b/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/discovery_client.go new file mode 100644 index 0000000..997239a --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/discovery_client.go @@ -0,0 +1,89 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "k8s.io/api/discovery/v1beta1" + "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +type DiscoveryV1beta1Interface interface { + RESTClient() rest.Interface + EndpointSlicesGetter +} + +// DiscoveryV1beta1Client is used to interact with features provided by the discovery.k8s.io group. +type DiscoveryV1beta1Client struct { + restClient rest.Interface +} + +func (c *DiscoveryV1beta1Client) EndpointSlices(namespace string) EndpointSliceInterface { + return newEndpointSlices(c, namespace) +} + +// NewForConfig creates a new DiscoveryV1beta1Client for the given config. +func NewForConfig(c *rest.Config) (*DiscoveryV1beta1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &DiscoveryV1beta1Client{client}, nil +} + +// NewForConfigOrDie creates a new DiscoveryV1beta1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *DiscoveryV1beta1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new DiscoveryV1beta1Client for the given RESTClient. +func New(c rest.Interface) *DiscoveryV1beta1Client { + return &DiscoveryV1beta1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1beta1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *DiscoveryV1beta1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/doc.go new file mode 100644 index 0000000..7711019 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1beta1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/endpointslice.go b/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/endpointslice.go new file mode 100644 index 0000000..bba656b --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/endpointslice.go @@ -0,0 +1,174 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "time" + + v1beta1 "k8s.io/api/discovery/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +// EndpointSlicesGetter has a method to return a EndpointSliceInterface. +// A group's client should implement this interface. +type EndpointSlicesGetter interface { + EndpointSlices(namespace string) EndpointSliceInterface +} + +// EndpointSliceInterface has methods to work with EndpointSlice resources. +type EndpointSliceInterface interface { + Create(*v1beta1.EndpointSlice) (*v1beta1.EndpointSlice, error) + Update(*v1beta1.EndpointSlice) (*v1beta1.EndpointSlice, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1beta1.EndpointSlice, error) + List(opts v1.ListOptions) (*v1beta1.EndpointSliceList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.EndpointSlice, err error) + EndpointSliceExpansion +} + +// endpointSlices implements EndpointSliceInterface +type endpointSlices struct { + client rest.Interface + ns string +} + +// newEndpointSlices returns a EndpointSlices +func newEndpointSlices(c *DiscoveryV1beta1Client, namespace string) *endpointSlices { + return &endpointSlices{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the endpointSlice, and returns the corresponding endpointSlice object, and an error if there is any. +func (c *endpointSlices) Get(name string, options v1.GetOptions) (result *v1beta1.EndpointSlice, err error) { + result = &v1beta1.EndpointSlice{} + err = c.client.Get(). + Namespace(c.ns). + Resource("endpointslices"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of EndpointSlices that match those selectors. +func (c *endpointSlices) List(opts v1.ListOptions) (result *v1beta1.EndpointSliceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.EndpointSliceList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("endpointslices"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested endpointSlices. +func (c *endpointSlices) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("endpointslices"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch() +} + +// Create takes the representation of a endpointSlice and creates it. Returns the server's representation of the endpointSlice, and an error, if there is any. +func (c *endpointSlices) Create(endpointSlice *v1beta1.EndpointSlice) (result *v1beta1.EndpointSlice, err error) { + result = &v1beta1.EndpointSlice{} + err = c.client.Post(). + Namespace(c.ns). + Resource("endpointslices"). + Body(endpointSlice). + Do(). + Into(result) + return +} + +// Update takes the representation of a endpointSlice and updates it. Returns the server's representation of the endpointSlice, and an error, if there is any. +func (c *endpointSlices) Update(endpointSlice *v1beta1.EndpointSlice) (result *v1beta1.EndpointSlice, err error) { + result = &v1beta1.EndpointSlice{} + err = c.client.Put(). + Namespace(c.ns). + Resource("endpointslices"). + Name(endpointSlice.Name). + Body(endpointSlice). + Do(). + Into(result) + return +} + +// Delete takes name of the endpointSlice and deletes it. Returns an error if one occurs. +func (c *endpointSlices) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("endpointslices"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *endpointSlices) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("endpointslices"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched endpointSlice. +func (c *endpointSlices) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.EndpointSlice, err error) { + result = &v1beta1.EndpointSlice{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("endpointslices"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/gengo/examples/set-gen/sets/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/generated_expansion.go similarity index 84% rename from vendor/k8s.io/gengo/examples/set-gen/sets/doc.go rename to vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/generated_expansion.go index b152a0b..1e7769f 100644 --- a/vendor/k8s.io/gengo/examples/set-gen/sets/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/generated_expansion.go @@ -14,7 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by set-gen. DO NOT EDIT. +// Code generated by client-gen. DO NOT EDIT. -// Package sets has auto-generated set types. -package sets +package v1beta1 + +type EndpointSliceExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/doc.go new file mode 100644 index 0000000..df51baa --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/flowcontrol_client.go b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/flowcontrol_client.go new file mode 100644 index 0000000..37a1ff2 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/flowcontrol_client.go @@ -0,0 +1,94 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "k8s.io/api/flowcontrol/v1alpha1" + "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +type FlowcontrolV1alpha1Interface interface { + RESTClient() rest.Interface + FlowSchemasGetter + PriorityLevelConfigurationsGetter +} + +// FlowcontrolV1alpha1Client is used to interact with features provided by the flowcontrol.apiserver.k8s.io group. +type FlowcontrolV1alpha1Client struct { + restClient rest.Interface +} + +func (c *FlowcontrolV1alpha1Client) FlowSchemas() FlowSchemaInterface { + return newFlowSchemas(c) +} + +func (c *FlowcontrolV1alpha1Client) PriorityLevelConfigurations() PriorityLevelConfigurationInterface { + return newPriorityLevelConfigurations(c) +} + +// NewForConfig creates a new FlowcontrolV1alpha1Client for the given config. +func NewForConfig(c *rest.Config) (*FlowcontrolV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &FlowcontrolV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new FlowcontrolV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *FlowcontrolV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new FlowcontrolV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *FlowcontrolV1alpha1Client { + return &FlowcontrolV1alpha1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1alpha1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FlowcontrolV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/flowschema.go b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/flowschema.go new file mode 100644 index 0000000..db71d29 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/flowschema.go @@ -0,0 +1,180 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "time" + + v1alpha1 "k8s.io/api/flowcontrol/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +// FlowSchemasGetter has a method to return a FlowSchemaInterface. +// A group's client should implement this interface. +type FlowSchemasGetter interface { + FlowSchemas() FlowSchemaInterface +} + +// FlowSchemaInterface has methods to work with FlowSchema resources. +type FlowSchemaInterface interface { + Create(*v1alpha1.FlowSchema) (*v1alpha1.FlowSchema, error) + Update(*v1alpha1.FlowSchema) (*v1alpha1.FlowSchema, error) + UpdateStatus(*v1alpha1.FlowSchema) (*v1alpha1.FlowSchema, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha1.FlowSchema, error) + List(opts v1.ListOptions) (*v1alpha1.FlowSchemaList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.FlowSchema, err error) + FlowSchemaExpansion +} + +// flowSchemas implements FlowSchemaInterface +type flowSchemas struct { + client rest.Interface +} + +// newFlowSchemas returns a FlowSchemas +func newFlowSchemas(c *FlowcontrolV1alpha1Client) *flowSchemas { + return &flowSchemas{ + client: c.RESTClient(), + } +} + +// Get takes name of the flowSchema, and returns the corresponding flowSchema object, and an error if there is any. +func (c *flowSchemas) Get(name string, options v1.GetOptions) (result *v1alpha1.FlowSchema, err error) { + result = &v1alpha1.FlowSchema{} + err = c.client.Get(). + Resource("flowschemas"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. +func (c *flowSchemas) List(opts v1.ListOptions) (result *v1alpha1.FlowSchemaList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.FlowSchemaList{} + err = c.client.Get(). + Resource("flowschemas"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested flowSchemas. +func (c *flowSchemas) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("flowschemas"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch() +} + +// Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. +func (c *flowSchemas) Create(flowSchema *v1alpha1.FlowSchema) (result *v1alpha1.FlowSchema, err error) { + result = &v1alpha1.FlowSchema{} + err = c.client.Post(). + Resource("flowschemas"). + Body(flowSchema). + Do(). + Into(result) + return +} + +// Update takes the representation of a flowSchema and updates it. Returns the server's representation of the flowSchema, and an error, if there is any. +func (c *flowSchemas) Update(flowSchema *v1alpha1.FlowSchema) (result *v1alpha1.FlowSchema, err error) { + result = &v1alpha1.FlowSchema{} + err = c.client.Put(). + Resource("flowschemas"). + Name(flowSchema.Name). + Body(flowSchema). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *flowSchemas) UpdateStatus(flowSchema *v1alpha1.FlowSchema) (result *v1alpha1.FlowSchema, err error) { + result = &v1alpha1.FlowSchema{} + err = c.client.Put(). + Resource("flowschemas"). + Name(flowSchema.Name). + SubResource("status"). + Body(flowSchema). + Do(). + Into(result) + return +} + +// Delete takes name of the flowSchema and deletes it. Returns an error if one occurs. +func (c *flowSchemas) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Resource("flowschemas"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *flowSchemas) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("flowschemas"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched flowSchema. +func (c *flowSchemas) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.FlowSchema, err error) { + result = &v1alpha1.FlowSchema{} + err = c.client.Patch(pt). + Resource("flowschemas"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/generated_expansion.go new file mode 100644 index 0000000..065b5e6 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/generated_expansion.go @@ -0,0 +1,23 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +type FlowSchemaExpansion interface{} + +type PriorityLevelConfigurationExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/prioritylevelconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/prioritylevelconfiguration.go new file mode 100644 index 0000000..eb99cca --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/prioritylevelconfiguration.go @@ -0,0 +1,180 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "time" + + v1alpha1 "k8s.io/api/flowcontrol/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +// PriorityLevelConfigurationsGetter has a method to return a PriorityLevelConfigurationInterface. +// A group's client should implement this interface. +type PriorityLevelConfigurationsGetter interface { + PriorityLevelConfigurations() PriorityLevelConfigurationInterface +} + +// PriorityLevelConfigurationInterface has methods to work with PriorityLevelConfiguration resources. +type PriorityLevelConfigurationInterface interface { + Create(*v1alpha1.PriorityLevelConfiguration) (*v1alpha1.PriorityLevelConfiguration, error) + Update(*v1alpha1.PriorityLevelConfiguration) (*v1alpha1.PriorityLevelConfiguration, error) + UpdateStatus(*v1alpha1.PriorityLevelConfiguration) (*v1alpha1.PriorityLevelConfiguration, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha1.PriorityLevelConfiguration, error) + List(opts v1.ListOptions) (*v1alpha1.PriorityLevelConfigurationList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.PriorityLevelConfiguration, err error) + PriorityLevelConfigurationExpansion +} + +// priorityLevelConfigurations implements PriorityLevelConfigurationInterface +type priorityLevelConfigurations struct { + client rest.Interface +} + +// newPriorityLevelConfigurations returns a PriorityLevelConfigurations +func newPriorityLevelConfigurations(c *FlowcontrolV1alpha1Client) *priorityLevelConfigurations { + return &priorityLevelConfigurations{ + client: c.RESTClient(), + } +} + +// Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any. +func (c *priorityLevelConfigurations) Get(name string, options v1.GetOptions) (result *v1alpha1.PriorityLevelConfiguration, err error) { + result = &v1alpha1.PriorityLevelConfiguration{} + err = c.client.Get(). + Resource("prioritylevelconfigurations"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. +func (c *priorityLevelConfigurations) List(opts v1.ListOptions) (result *v1alpha1.PriorityLevelConfigurationList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.PriorityLevelConfigurationList{} + err = c.client.Get(). + Resource("prioritylevelconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. +func (c *priorityLevelConfigurations) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("prioritylevelconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch() +} + +// Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. +func (c *priorityLevelConfigurations) Create(priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration) (result *v1alpha1.PriorityLevelConfiguration, err error) { + result = &v1alpha1.PriorityLevelConfiguration{} + err = c.client.Post(). + Resource("prioritylevelconfigurations"). + Body(priorityLevelConfiguration). + Do(). + Into(result) + return +} + +// Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. +func (c *priorityLevelConfigurations) Update(priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration) (result *v1alpha1.PriorityLevelConfiguration, err error) { + result = &v1alpha1.PriorityLevelConfiguration{} + err = c.client.Put(). + Resource("prioritylevelconfigurations"). + Name(priorityLevelConfiguration.Name). + Body(priorityLevelConfiguration). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *priorityLevelConfigurations) UpdateStatus(priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration) (result *v1alpha1.PriorityLevelConfiguration, err error) { + result = &v1alpha1.PriorityLevelConfiguration{} + err = c.client.Put(). + Resource("prioritylevelconfigurations"). + Name(priorityLevelConfiguration.Name). + SubResource("status"). + Body(priorityLevelConfiguration). + Do(). + Into(result) + return +} + +// Delete takes name of the priorityLevelConfiguration and deletes it. Returns an error if one occurs. +func (c *priorityLevelConfigurations) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Resource("prioritylevelconfigurations"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *priorityLevelConfigurations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("prioritylevelconfigurations"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched priorityLevelConfiguration. +func (c *priorityLevelConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.PriorityLevelConfiguration, err error) { + result = &v1alpha1.PriorityLevelConfiguration{} + err = c.client.Patch(pt). + Resource("prioritylevelconfigurations"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/csinode.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/csinode.go new file mode 100644 index 0000000..2090541 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/csinode.go @@ -0,0 +1,164 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "time" + + v1 "k8s.io/api/storage/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +// CSINodesGetter has a method to return a CSINodeInterface. +// A group's client should implement this interface. +type CSINodesGetter interface { + CSINodes() CSINodeInterface +} + +// CSINodeInterface has methods to work with CSINode resources. +type CSINodeInterface interface { + Create(*v1.CSINode) (*v1.CSINode, error) + Update(*v1.CSINode) (*v1.CSINode, error) + Delete(name string, options *metav1.DeleteOptions) error + DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error + Get(name string, options metav1.GetOptions) (*v1.CSINode, error) + List(opts metav1.ListOptions) (*v1.CSINodeList, error) + Watch(opts metav1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.CSINode, err error) + CSINodeExpansion +} + +// cSINodes implements CSINodeInterface +type cSINodes struct { + client rest.Interface +} + +// newCSINodes returns a CSINodes +func newCSINodes(c *StorageV1Client) *cSINodes { + return &cSINodes{ + client: c.RESTClient(), + } +} + +// Get takes name of the cSINode, and returns the corresponding cSINode object, and an error if there is any. +func (c *cSINodes) Get(name string, options metav1.GetOptions) (result *v1.CSINode, err error) { + result = &v1.CSINode{} + err = c.client.Get(). + Resource("csinodes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of CSINodes that match those selectors. +func (c *cSINodes) List(opts metav1.ListOptions) (result *v1.CSINodeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.CSINodeList{} + err = c.client.Get(). + Resource("csinodes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested cSINodes. +func (c *cSINodes) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("csinodes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch() +} + +// Create takes the representation of a cSINode and creates it. Returns the server's representation of the cSINode, and an error, if there is any. +func (c *cSINodes) Create(cSINode *v1.CSINode) (result *v1.CSINode, err error) { + result = &v1.CSINode{} + err = c.client.Post(). + Resource("csinodes"). + Body(cSINode). + Do(). + Into(result) + return +} + +// Update takes the representation of a cSINode and updates it. Returns the server's representation of the cSINode, and an error, if there is any. +func (c *cSINodes) Update(cSINode *v1.CSINode) (result *v1.CSINode, err error) { + result = &v1.CSINode{} + err = c.client.Put(). + Resource("csinodes"). + Name(cSINode.Name). + Body(cSINode). + Do(). + Into(result) + return +} + +// Delete takes name of the cSINode and deletes it. Returns an error if one occurs. +func (c *cSINodes) Delete(name string, options *metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("csinodes"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *cSINodes) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("csinodes"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched cSINode. +func (c *cSINodes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.CSINode, err error) { + result = &v1.CSINode{} + err = c.client.Patch(pt). + Resource("csinodes"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/generated_expansion.go index ccac161..d147620 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/generated_expansion.go @@ -18,6 +18,8 @@ limitations under the License. package v1 +type CSINodeExpansion interface{} + type StorageClassExpansion interface{} type VolumeAttachmentExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go index 1afbe93..822f089 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go @@ -26,6 +26,7 @@ import ( type StorageV1Interface interface { RESTClient() rest.Interface + CSINodesGetter StorageClassesGetter VolumeAttachmentsGetter } @@ -35,6 +36,10 @@ type StorageV1Client struct { restClient rest.Interface } +func (c *StorageV1Client) CSINodes() CSINodeInterface { + return newCSINodes(c) +} + func (c *StorageV1Client) StorageClasses() StorageClassInterface { return newStorageClasses(c) } diff --git a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/OWNERS b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/OWNERS deleted file mode 100644 index e0ec62d..0000000 --- a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/OWNERS +++ /dev/null @@ -1,9 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -# approval on api packages bubbles to api-approvers -reviewers: -- sig-auth-authenticators-approvers -- sig-auth-authenticators-reviewers -labels: -- sig/auth - diff --git a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1beta1/zz_generated.conversion.go b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1beta1/zz_generated.conversion.go index 94ef4b7..0e533e4 100644 --- a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1beta1/zz_generated.conversion.go +++ b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1beta1/zz_generated.conversion.go @@ -51,11 +51,6 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*clientauthentication.ExecCredentialSpec)(nil), (*ExecCredentialSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_clientauthentication_ExecCredentialSpec_To_v1beta1_ExecCredentialSpec(a.(*clientauthentication.ExecCredentialSpec), b.(*ExecCredentialSpec), scope) - }); err != nil { - return err - } if err := s.AddGeneratedConversionFunc((*ExecCredentialStatus)(nil), (*clientauthentication.ExecCredentialStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_ExecCredentialStatus_To_clientauthentication_ExecCredentialStatus(a.(*ExecCredentialStatus), b.(*clientauthentication.ExecCredentialStatus), scope) }); err != nil { diff --git a/vendor/k8s.io/client-go/pkg/version/.gitattributes b/vendor/k8s.io/client-go/pkg/version/.gitattributes deleted file mode 100644 index 7e349ef..0000000 --- a/vendor/k8s.io/client-go/pkg/version/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -base.go export-subst diff --git a/vendor/k8s.io/client-go/pkg/version/def.bzl b/vendor/k8s.io/client-go/pkg/version/def.bzl deleted file mode 100644 index 9c018a4..0000000 --- a/vendor/k8s.io/client-go/pkg/version/def.bzl +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2017 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Implements hack/lib/version.sh's kube::version::ldflags() for Bazel. -def version_x_defs(): - # This should match the list of packages in kube::version::ldflag - stamp_pkgs = [ - "k8s.io/kubernetes/pkg/version", - # In hack/lib/version.sh, this has a vendor/ prefix. That isn't needed here? - "k8s.io/client-go/pkg/version", - ] - # This should match the list of vars in kube::version::ldflags - # It should also match the list of vars set in hack/print-workspace-status.sh. - stamp_vars = [ - "buildDate", - "gitCommit", - "gitMajor", - "gitMinor", - "gitTreeState", - "gitVersion", - ] - # Generate the cross-product. - x_defs = {} - for pkg in stamp_pkgs: - for var in stamp_vars: - x_defs["%s.%s" % (pkg, var)] = "{%s}" % var - return x_defs diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go b/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go index b88902c..741729b 100644 --- a/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go @@ -48,6 +48,7 @@ import ( ) const execInfoEnv = "KUBERNETES_EXEC_INFO" +const onRotateListWarningLength = 1000 var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) @@ -164,7 +165,7 @@ type Authenticator struct { cachedCreds *credentials exp time.Time - onRotate func() + onRotateList []func() } type credentials struct { @@ -191,7 +192,15 @@ func (a *Authenticator) UpdateTransportConfig(c *transport.Config) error { dial = (&net.Dialer{Timeout: 30 * time.Second, KeepAlive: 30 * time.Second}).DialContext } d := connrotation.NewDialer(dial) - a.onRotate = d.CloseAll + + a.mu.Lock() + defer a.mu.Unlock() + a.onRotateList = append(a.onRotateList, d.CloseAll) + onRotateListLength := len(a.onRotateList) + if onRotateListLength > onRotateListWarningLength { + klog.Warningf("constructing many client instances from the same exec auth config can cause performance problems during cert rotation and can exhaust available network connections; %d clients constructed calling %q", onRotateListLength, a.cmd) + } + c.Dial = d.DialContext return nil @@ -353,8 +362,10 @@ func (a *Authenticator) refreshCredsLocked(r *clientauthentication.Response) err a.cachedCreds = newCreds // Only close all connections when TLS cert rotates. Token rotation doesn't // need the extra noise. - if a.onRotate != nil && oldCreds != nil && !reflect.DeepEqual(oldCreds.cert, a.cachedCreds.cert) { - a.onRotate() + if len(a.onRotateList) > 0 && oldCreds != nil && !reflect.DeepEqual(oldCreds.cert, a.cachedCreds.cert) { + for _, onRotate := range a.onRotateList { + onRotate() + } } return nil } diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/OWNERS b/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/OWNERS deleted file mode 100644 index 97fcd3d..0000000 --- a/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/OWNERS +++ /dev/null @@ -1,8 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: -- cjcullen -- jlowdermilk -reviewers: -- cjcullen -- jlowdermilk diff --git a/vendor/k8s.io/client-go/rest/OWNERS b/vendor/k8s.io/client-go/rest/OWNERS deleted file mode 100644 index 49dabc6..0000000 --- a/vendor/k8s.io/client-go/rest/OWNERS +++ /dev/null @@ -1,26 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: -- thockin -- smarterclayton -- caesarxuchao -- wojtek-t -- deads2k -- brendandburns -- liggitt -- nikhiljindal -- gmarek -- erictune -- sttts -- luxas -- dims -- errordeveloper -- hongchaodeng -- krousey -- resouer -- cjcullen -- rmmh -- lixiaobing10051267 -- asalkeld -- juanvallejo -- lojies diff --git a/vendor/k8s.io/client-go/rest/client.go b/vendor/k8s.io/client-go/rest/client.go index 927403c..53c6abd 100644 --- a/vendor/k8s.io/client-go/rest/client.go +++ b/vendor/k8s.io/client-go/rest/client.go @@ -17,8 +17,6 @@ limitations under the License. package rest import ( - "fmt" - "mime" "net/http" "net/url" "os" @@ -51,6 +49,28 @@ type Interface interface { APIVersion() schema.GroupVersion } +// ClientContentConfig controls how RESTClient communicates with the server. +// +// TODO: ContentConfig will be updated to accept a Negotiator instead of a +// NegotiatedSerializer and NegotiatedSerializer will be removed. +type ClientContentConfig struct { + // AcceptContentTypes specifies the types the client will accept and is optional. + // If not set, ContentType will be used to define the Accept header + AcceptContentTypes string + // ContentType specifies the wire format used to communicate with the server. + // This value will be set as the Accept header on requests made to the server if + // AcceptContentTypes is not set, and as the default content type on any object + // sent to the server. If not set, "application/json" is used. + ContentType string + // GroupVersion is the API version to talk to. Must be provided when initializing + // a RESTClient directly. When initializing a Client, will be set with the default + // code version. This is used as the default group version for VersionedParams. + GroupVersion schema.GroupVersion + // Negotiator is used for obtaining encoders and decoders for multiple + // supported media types. + Negotiator runtime.ClientNegotiator +} + // RESTClient imposes common Kubernetes API conventions on a set of resource paths. // The baseURL is expected to point to an HTTP or HTTPS path that is the parent // of one or more resources. The server should return a decodable API resource @@ -64,34 +84,27 @@ type RESTClient struct { // versionedAPIPath is a path segment connecting the base URL to the resource root versionedAPIPath string - // contentConfig is the information used to communicate with the server. - contentConfig ContentConfig - - // serializers contain all serializers for underlying content type. - serializers Serializers + // content describes how a RESTClient encodes and decodes responses. + content ClientContentConfig // creates BackoffManager that is passed to requests. createBackoffMgr func() BackoffManager - // TODO extract this into a wrapper interface via the RESTClient interface in kubectl. - Throttle flowcontrol.RateLimiter + // rateLimiter is shared among all requests created by this client unless specifically + // overridden. + rateLimiter flowcontrol.RateLimiter // Set specific behavior of the client. If not set http.DefaultClient will be used. Client *http.Client } -type Serializers struct { - Encoder runtime.Encoder - Decoder runtime.Decoder - StreamingSerializer runtime.Serializer - Framer runtime.Framer - RenegotiatedDecoder func(contentType string, params map[string]string) (runtime.Decoder, error) -} - // NewRESTClient creates a new RESTClient. This client performs generic REST functions -// such as Get, Put, Post, and Delete on specified paths. Codec controls encoding and -// decoding of responses from the server. -func NewRESTClient(baseURL *url.URL, versionedAPIPath string, config ContentConfig, maxQPS float32, maxBurst int, rateLimiter flowcontrol.RateLimiter, client *http.Client) (*RESTClient, error) { +// such as Get, Put, Post, and Delete on specified paths. +func NewRESTClient(baseURL *url.URL, versionedAPIPath string, config ClientContentConfig, rateLimiter flowcontrol.RateLimiter, client *http.Client) (*RESTClient, error) { + if len(config.ContentType) == 0 { + config.ContentType = "application/json" + } + base := *baseURL if !strings.HasSuffix(base.Path, "/") { base.Path += "/" @@ -99,31 +112,14 @@ func NewRESTClient(baseURL *url.URL, versionedAPIPath string, config ContentConf base.RawQuery = "" base.Fragment = "" - if config.GroupVersion == nil { - config.GroupVersion = &schema.GroupVersion{} - } - if len(config.ContentType) == 0 { - config.ContentType = "application/json" - } - serializers, err := createSerializers(config) - if err != nil { - return nil, err - } - - var throttle flowcontrol.RateLimiter - if maxQPS > 0 && rateLimiter == nil { - throttle = flowcontrol.NewTokenBucketRateLimiter(maxQPS, maxBurst) - } else if rateLimiter != nil { - throttle = rateLimiter - } return &RESTClient{ base: &base, versionedAPIPath: versionedAPIPath, - contentConfig: config, - serializers: *serializers, + content: config, createBackoffMgr: readExpBackoffConfig, - Throttle: throttle, - Client: client, + rateLimiter: rateLimiter, + + Client: client, }, nil } @@ -132,7 +128,7 @@ func (c *RESTClient) GetRateLimiter() flowcontrol.RateLimiter { if c == nil { return nil } - return c.Throttle + return c.rateLimiter } // readExpBackoffConfig handles the internal logic of determining what the @@ -153,58 +149,6 @@ func readExpBackoffConfig() BackoffManager { time.Duration(backoffDurationInt)*time.Second)} } -// createSerializers creates all necessary serializers for given contentType. -// TODO: the negotiated serializer passed to this method should probably return -// serializers that control decoding and versioning without this package -// being aware of the types. Depends on whether RESTClient must deal with -// generic infrastructure. -func createSerializers(config ContentConfig) (*Serializers, error) { - mediaTypes := config.NegotiatedSerializer.SupportedMediaTypes() - contentType := config.ContentType - mediaType, _, err := mime.ParseMediaType(contentType) - if err != nil { - return nil, fmt.Errorf("the content type specified in the client configuration is not recognized: %v", err) - } - info, ok := runtime.SerializerInfoForMediaType(mediaTypes, mediaType) - if !ok { - if len(contentType) != 0 || len(mediaTypes) == 0 { - return nil, fmt.Errorf("no serializers registered for %s", contentType) - } - info = mediaTypes[0] - } - - internalGV := schema.GroupVersions{ - { - Group: config.GroupVersion.Group, - Version: runtime.APIVersionInternal, - }, - // always include the legacy group as a decoding target to handle non-error `Status` return types - { - Group: "", - Version: runtime.APIVersionInternal, - }, - } - - s := &Serializers{ - Encoder: config.NegotiatedSerializer.EncoderForVersion(info.Serializer, *config.GroupVersion), - Decoder: config.NegotiatedSerializer.DecoderToVersion(info.Serializer, internalGV), - - RenegotiatedDecoder: func(contentType string, params map[string]string) (runtime.Decoder, error) { - info, ok := runtime.SerializerInfoForMediaType(mediaTypes, contentType) - if !ok { - return nil, fmt.Errorf("serializer for %s not registered", contentType) - } - return config.NegotiatedSerializer.DecoderToVersion(info.Serializer, internalGV), nil - }, - } - if info.StreamSerializer != nil { - s.StreamingSerializer = info.StreamSerializer.Serializer - s.Framer = info.StreamSerializer.Framer - } - - return s, nil -} - // Verb begins a request with a verb (GET, POST, PUT, DELETE). // // Example usage of RESTClient's request building interface: @@ -219,12 +163,7 @@ func createSerializers(config ContentConfig) (*Serializers, error) { // list, ok := resp.(*api.PodList) // func (c *RESTClient) Verb(verb string) *Request { - backoff := c.createBackoffMgr() - - if c.Client == nil { - return NewRequest(nil, verb, c.base, c.versionedAPIPath, c.contentConfig, c.serializers, backoff, c.Throttle, 0) - } - return NewRequest(c.Client, verb, c.base, c.versionedAPIPath, c.contentConfig, c.serializers, backoff, c.Throttle, c.Client.Timeout) + return NewRequest(c).Verb(verb) } // Post begins a POST request. Short for c.Verb("POST"). @@ -254,5 +193,5 @@ func (c *RESTClient) Delete() *Request { // APIVersion returns the APIVersion this RESTClient is expected to use. func (c *RESTClient) APIVersion() schema.GroupVersion { - return *c.contentConfig.GroupVersion + return c.content.GroupVersion } diff --git a/vendor/k8s.io/client-go/rest/config.go b/vendor/k8s.io/client-go/rest/config.go index c75825e..f58f518 100644 --- a/vendor/k8s.io/client-go/rest/config.go +++ b/vendor/k8s.io/client-go/rest/config.go @@ -94,6 +94,10 @@ type Config struct { // UserAgent is an optional field that specifies the caller of this request. UserAgent string + // DisableCompression bypasses automatic GZip compression requests to the + // server. + DisableCompression bool + // Transport may be used for custom HTTP behavior. This attribute may not // be specified with the TLS client certificate options. Use WrapTransport // to provide additional per-server middleware behavior. @@ -207,6 +211,12 @@ type TLSClientConfig struct { // CAData holds PEM-encoded bytes (typically read from a root certificates bundle). // CAData takes precedence over CAFile CAData []byte + + // NextProtos is a list of supported application level protocols, in order of preference. + // Used to populate tls.Config.NextProtos. + // To indicate to the server http/1.1 is preferred over http/2, set to ["http/1.1", "h2"] (though the server is free to ignore that preference). + // To use only http/1.1, set to ["http/1.1"]. + NextProtos []string } var _ fmt.Stringer = TLSClientConfig{} @@ -232,6 +242,7 @@ func (c TLSClientConfig) String() string { CertData: c.CertData, KeyData: c.KeyData, CAData: c.CAData, + NextProtos: c.NextProtos, } // Explicitly mark non-empty credential fields as redacted. if len(cc.CertData) != 0 { @@ -258,6 +269,9 @@ type ContentConfig struct { GroupVersion *schema.GroupVersion // NegotiatedSerializer is used for obtaining encoders and decoders for multiple // supported media types. + // + // TODO: NegotiatedSerializer will be phased out as internal clients are removed + // from Kubernetes. NegotiatedSerializer runtime.NegotiatedSerializer } @@ -272,14 +286,6 @@ func RESTClientFor(config *Config) (*RESTClient, error) { if config.NegotiatedSerializer == nil { return nil, fmt.Errorf("NegotiatedSerializer is required when initializing a RESTClient") } - qps := config.QPS - if config.QPS == 0.0 { - qps = DefaultQPS - } - burst := config.Burst - if config.Burst == 0 { - burst = DefaultBurst - } baseURL, versionedAPIPath, err := defaultServerUrlFor(config) if err != nil { @@ -299,7 +305,33 @@ func RESTClientFor(config *Config) (*RESTClient, error) { } } - return NewRESTClient(baseURL, versionedAPIPath, config.ContentConfig, qps, burst, config.RateLimiter, httpClient) + rateLimiter := config.RateLimiter + if rateLimiter == nil { + qps := config.QPS + if config.QPS == 0.0 { + qps = DefaultQPS + } + burst := config.Burst + if config.Burst == 0 { + burst = DefaultBurst + } + if qps > 0 { + rateLimiter = flowcontrol.NewTokenBucketRateLimiter(qps, burst) + } + } + + var gv schema.GroupVersion + if config.GroupVersion != nil { + gv = *config.GroupVersion + } + clientContent := ClientContentConfig{ + AcceptContentTypes: config.AcceptContentTypes, + ContentType: config.ContentType, + GroupVersion: gv, + Negotiator: runtime.NewClientNegotiator(config.NegotiatedSerializer, gv), + } + + return NewRESTClient(baseURL, versionedAPIPath, clientContent, rateLimiter, httpClient) } // UnversionedRESTClientFor is the same as RESTClientFor, except that it allows @@ -327,13 +359,33 @@ func UnversionedRESTClientFor(config *Config) (*RESTClient, error) { } } - versionConfig := config.ContentConfig - if versionConfig.GroupVersion == nil { - v := metav1.SchemeGroupVersion - versionConfig.GroupVersion = &v + rateLimiter := config.RateLimiter + if rateLimiter == nil { + qps := config.QPS + if config.QPS == 0.0 { + qps = DefaultQPS + } + burst := config.Burst + if config.Burst == 0 { + burst = DefaultBurst + } + if qps > 0 { + rateLimiter = flowcontrol.NewTokenBucketRateLimiter(qps, burst) + } + } + + gv := metav1.SchemeGroupVersion + if config.GroupVersion != nil { + gv = *config.GroupVersion + } + clientContent := ClientContentConfig{ + AcceptContentTypes: config.AcceptContentTypes, + ContentType: config.ContentType, + GroupVersion: gv, + Negotiator: runtime.NewClientNegotiator(config.NegotiatedSerializer, gv), } - return NewRESTClient(baseURL, versionedAPIPath, versionConfig, config.QPS, config.Burst, config.RateLimiter, httpClient) + return NewRESTClient(baseURL, versionedAPIPath, clientContent, rateLimiter, httpClient) } // SetKubernetesDefaults sets default values on the provided client config for accessing the @@ -499,13 +551,15 @@ func AnonymousClientConfig(config *Config) *Config { ServerName: config.ServerName, CAFile: config.TLSClientConfig.CAFile, CAData: config.TLSClientConfig.CAData, + NextProtos: config.TLSClientConfig.NextProtos, }, - RateLimiter: config.RateLimiter, - UserAgent: config.UserAgent, - QPS: config.QPS, - Burst: config.Burst, - Timeout: config.Timeout, - Dial: config.Dial, + RateLimiter: config.RateLimiter, + UserAgent: config.UserAgent, + DisableCompression: config.DisableCompression, + QPS: config.QPS, + Burst: config.Burst, + Timeout: config.Timeout, + Dial: config.Dial, } } @@ -536,14 +590,16 @@ func CopyConfig(config *Config) *Config { CertData: config.TLSClientConfig.CertData, KeyData: config.TLSClientConfig.KeyData, CAData: config.TLSClientConfig.CAData, + NextProtos: config.TLSClientConfig.NextProtos, }, - UserAgent: config.UserAgent, - Transport: config.Transport, - WrapTransport: config.WrapTransport, - QPS: config.QPS, - Burst: config.Burst, - RateLimiter: config.RateLimiter, - Timeout: config.Timeout, - Dial: config.Dial, + UserAgent: config.UserAgent, + DisableCompression: config.DisableCompression, + Transport: config.Transport, + WrapTransport: config.WrapTransport, + QPS: config.QPS, + Burst: config.Burst, + RateLimiter: config.RateLimiter, + Timeout: config.Timeout, + Dial: config.Dial, } } diff --git a/vendor/k8s.io/client-go/rest/plugin.go b/vendor/k8s.io/client-go/rest/plugin.go index 83ef5ae..0bc2d03 100644 --- a/vendor/k8s.io/client-go/rest/plugin.go +++ b/vendor/k8s.io/client-go/rest/plugin.go @@ -55,7 +55,7 @@ func RegisterAuthProviderPlugin(name string, plugin Factory) error { pluginsLock.Lock() defer pluginsLock.Unlock() if _, found := plugins[name]; found { - return fmt.Errorf("Auth Provider Plugin %q was registered twice", name) + return fmt.Errorf("auth Provider Plugin %q was registered twice", name) } klog.V(4).Infof("Registered Auth Provider Plugin %q", name) plugins[name] = plugin @@ -67,7 +67,7 @@ func GetAuthProvider(clusterAddress string, apc *clientcmdapi.AuthProviderConfig defer pluginsLock.Unlock() p, ok := plugins[apc.Name] if !ok { - return nil, fmt.Errorf("No Auth Provider found for name %q", apc.Name) + return nil, fmt.Errorf("no Auth Provider found for name %q", apc.Name) } return p(clusterAddress, apc.Config, persister) } diff --git a/vendor/k8s.io/client-go/rest/request.go b/vendor/k8s.io/client-go/rest/request.go index 0570615..9e0c261 100644 --- a/vendor/k8s.io/client-go/rest/request.go +++ b/vendor/k8s.io/client-go/rest/request.go @@ -48,7 +48,8 @@ import ( var ( // longThrottleLatency defines threshold for logging requests. All requests being - // throttle for more than longThrottleLatency will be logged. + // throttled (via the provided rateLimiter) for more than longThrottleLatency will + // be logged. longThrottleLatency = 50 * time.Millisecond ) @@ -74,19 +75,20 @@ func (r *RequestConstructionError) Error() string { return fmt.Sprintf("request construction error: '%v'", r.Err) } +var noBackoff = &NoBackoff{} + // Request allows for building up a request to a server in a chained fashion. // Any errors are stored until the end of your call, so you only have to // check once. type Request struct { - // required - client HTTPClient - verb string + c *RESTClient - baseURL *url.URL - content ContentConfig - serializers Serializers + rateLimiter flowcontrol.RateLimiter + backoff BackoffManager + timeout time.Duration // generic components accessible via method setters + verb string pathPrefix string subpath string params url.Values @@ -98,7 +100,6 @@ type Request struct { resource string resourceName string subresource string - timeout time.Duration // output err error @@ -106,42 +107,63 @@ type Request struct { // This is only used for per-request timeouts, deadlines, and cancellations. ctx context.Context - - backoffMgr BackoffManager - throttle flowcontrol.RateLimiter } // NewRequest creates a new request helper object for accessing runtime.Objects on a server. -func NewRequest(client HTTPClient, verb string, baseURL *url.URL, versionedAPIPath string, content ContentConfig, serializers Serializers, backoff BackoffManager, throttle flowcontrol.RateLimiter, timeout time.Duration) *Request { +func NewRequest(c *RESTClient) *Request { + var backoff BackoffManager + if c.createBackoffMgr != nil { + backoff = c.createBackoffMgr() + } if backoff == nil { - klog.V(2).Infof("Not implementing request backoff strategy.") - backoff = &NoBackoff{} + backoff = noBackoff + } + + var pathPrefix string + if c.base != nil { + pathPrefix = path.Join("/", c.base.Path, c.versionedAPIPath) + } else { + pathPrefix = path.Join("/", c.versionedAPIPath) } - pathPrefix := "/" - if baseURL != nil { - pathPrefix = path.Join(pathPrefix, baseURL.Path) + var timeout time.Duration + if c.Client != nil { + timeout = c.Client.Timeout } + r := &Request{ - client: client, - verb: verb, - baseURL: baseURL, - pathPrefix: path.Join(pathPrefix, versionedAPIPath), - content: content, - serializers: serializers, - backoffMgr: backoff, - throttle: throttle, + c: c, + rateLimiter: c.rateLimiter, + backoff: backoff, timeout: timeout, + pathPrefix: pathPrefix, } + switch { - case len(content.AcceptContentTypes) > 0: - r.SetHeader("Accept", content.AcceptContentTypes) - case len(content.ContentType) > 0: - r.SetHeader("Accept", content.ContentType+", */*") + case len(c.content.AcceptContentTypes) > 0: + r.SetHeader("Accept", c.content.AcceptContentTypes) + case len(c.content.ContentType) > 0: + r.SetHeader("Accept", c.content.ContentType+", */*") } return r } +// NewRequestWithClient creates a Request with an embedded RESTClient for use in test scenarios. +func NewRequestWithClient(base *url.URL, versionedAPIPath string, content ClientContentConfig, client *http.Client) *Request { + return NewRequest(&RESTClient{ + base: base, + versionedAPIPath: versionedAPIPath, + content: content, + Client: client, + }) +} + +// Verb sets the verb this request will use. +func (r *Request) Verb(verb string) *Request { + r.verb = verb + return r +} + // Prefix adds segments to the relative beginning to the request path. These // items will be placed before the optional Namespace, Resource, or Name sections. // Setting AbsPath will clear any previously set Prefix segments @@ -184,17 +206,17 @@ func (r *Request) Resource(resource string) *Request { // or defaults to the stub implementation if nil is provided func (r *Request) BackOff(manager BackoffManager) *Request { if manager == nil { - r.backoffMgr = &NoBackoff{} + r.backoff = &NoBackoff{} return r } - r.backoffMgr = manager + r.backoff = manager return r } // Throttle receives a rate-limiter and sets or replaces an existing request limiter func (r *Request) Throttle(limiter flowcontrol.RateLimiter) *Request { - r.throttle = limiter + r.rateLimiter = limiter return r } @@ -272,8 +294,8 @@ func (r *Request) AbsPath(segments ...string) *Request { if r.err != nil { return r } - r.pathPrefix = path.Join(r.baseURL.Path, path.Join(segments...)) - if len(segments) == 1 && (len(r.baseURL.Path) > 1 || len(segments[0]) > 1) && strings.HasSuffix(segments[0], "/") { + r.pathPrefix = path.Join(r.c.base.Path, path.Join(segments...)) + if len(segments) == 1 && (len(r.c.base.Path) > 1 || len(segments[0]) > 1) && strings.HasSuffix(segments[0], "/") { // preserve any trailing slashes for legacy behavior r.pathPrefix += "/" } @@ -317,7 +339,7 @@ func (r *Request) Param(paramName, s string) *Request { // VersionedParams will not write query parameters that have omitempty set and are empty. If a // parameter has already been set it is appended to (Params and VersionedParams are additive). func (r *Request) VersionedParams(obj runtime.Object, codec runtime.ParameterCodec) *Request { - return r.SpecificallyVersionedParams(obj, codec, *r.content.GroupVersion) + return r.SpecificallyVersionedParams(obj, codec, r.c.content.GroupVersion) } func (r *Request) SpecificallyVersionedParams(obj runtime.Object, codec runtime.ParameterCodec, version schema.GroupVersion) *Request { @@ -397,14 +419,19 @@ func (r *Request) Body(obj interface{}) *Request { if reflect.ValueOf(t).IsNil() { return r } - data, err := runtime.Encode(r.serializers.Encoder, t) + encoder, err := r.c.content.Negotiator.Encoder(r.c.content.ContentType, nil) + if err != nil { + r.err = err + return r + } + data, err := runtime.Encode(encoder, t) if err != nil { r.err = err return r } glogBody("Request Body", data) r.body = bytes.NewReader(data) - r.SetHeader("Content-Type", r.content.ContentType) + r.SetHeader("Content-Type", r.c.content.ContentType) default: r.err = fmt.Errorf("unknown type used for body: %+v", obj) } @@ -433,8 +460,8 @@ func (r *Request) URL() *url.URL { } finalURL := &url.URL{} - if r.baseURL != nil { - *finalURL = *r.baseURL + if r.c.base != nil { + *finalURL = *r.c.base } finalURL.Path = p @@ -468,8 +495,8 @@ func (r Request) finalURLTemplate() url.URL { segments := strings.Split(r.URL().Path, "/") groupIndex := 0 index := 0 - if r.URL() != nil && r.baseURL != nil && strings.Contains(r.URL().Path, r.baseURL.Path) { - groupIndex += len(strings.Split(r.baseURL.Path, "/")) + if r.URL() != nil && r.c.base != nil && strings.Contains(r.URL().Path, r.c.base.Path) { + groupIndex += len(strings.Split(r.c.base.Path, "/")) } if groupIndex >= len(segments) { return *url @@ -521,40 +548,34 @@ func (r Request) finalURLTemplate() url.URL { return *url } -func (r *Request) tryThrottle() { +func (r *Request) tryThrottle() error { + if r.rateLimiter == nil { + return nil + } + now := time.Now() - if r.throttle != nil { - r.throttle.Accept() + var err error + if r.ctx != nil { + err = r.rateLimiter.Wait(r.ctx) + } else { + r.rateLimiter.Accept() } + if latency := time.Since(now); latency > longThrottleLatency { klog.V(4).Infof("Throttling request took %v, request: %s:%s", latency, r.verb, r.URL().String()) } + + return err } // Watch attempts to begin watching the requested location. // Returns a watch.Interface, or an error. func (r *Request) Watch() (watch.Interface, error) { - return r.WatchWithSpecificDecoders( - func(body io.ReadCloser) streaming.Decoder { - framer := r.serializers.Framer.NewFrameReader(body) - return streaming.NewDecoder(framer, r.serializers.StreamingSerializer) - }, - r.serializers.Decoder, - ) -} - -// WatchWithSpecificDecoders attempts to begin watching the requested location with a *different* decoder. -// Turns out that you want one "standard" decoder for the watch event and one "personal" decoder for the content -// Returns a watch.Interface, or an error. -func (r *Request) WatchWithSpecificDecoders(wrapperDecoderFn func(io.ReadCloser) streaming.Decoder, embeddedDecoder runtime.Decoder) (watch.Interface, error) { // We specifically don't want to rate limit watches, so we - // don't use r.throttle here. + // don't use r.rateLimiter here. if r.err != nil { return nil, r.err } - if r.serializers.Framer == nil { - return nil, fmt.Errorf("watching resources is not possible with this client (content-type: %s)", r.content.ContentType) - } url := r.URL().String() req, err := http.NewRequest(r.verb, url, r.body) @@ -565,18 +586,18 @@ func (r *Request) WatchWithSpecificDecoders(wrapperDecoderFn func(io.ReadCloser) req = req.WithContext(r.ctx) } req.Header = r.headers - client := r.client + client := r.c.Client if client == nil { client = http.DefaultClient } - r.backoffMgr.Sleep(r.backoffMgr.CalculateBackoff(r.URL())) + r.backoff.Sleep(r.backoff.CalculateBackoff(r.URL())) resp, err := client.Do(req) updateURLMetrics(r, resp, err) - if r.baseURL != nil { + if r.c.base != nil { if err != nil { - r.backoffMgr.UpdateBackoff(r.baseURL, err, 0) + r.backoff.UpdateBackoff(r.c.base, err, 0) } else { - r.backoffMgr.UpdateBackoff(r.baseURL, err, resp.StatusCode) + r.backoff.UpdateBackoff(r.c.base, err, resp.StatusCode) } } if err != nil { @@ -594,9 +615,22 @@ func (r *Request) WatchWithSpecificDecoders(wrapperDecoderFn func(io.ReadCloser) } return nil, fmt.Errorf("for request %s, got status: %v", url, resp.StatusCode) } - wrapperDecoder := wrapperDecoderFn(resp.Body) + + contentType := resp.Header.Get("Content-Type") + mediaType, params, err := mime.ParseMediaType(contentType) + if err != nil { + klog.V(4).Infof("Unexpected content type from the server: %q: %v", contentType, err) + } + objectDecoder, streamingSerializer, framer, err := r.c.content.Negotiator.StreamDecoder(mediaType, params) + if err != nil { + return nil, err + } + + frameReader := framer.NewFrameReader(resp.Body) + watchEventDecoder := streaming.NewDecoder(frameReader, streamingSerializer) + return watch.NewStreamWatcher( - restclientwatch.NewDecoder(wrapperDecoder, embeddedDecoder), + restclientwatch.NewDecoder(watchEventDecoder, objectDecoder), // use 500 to indicate that the cause of the error is unknown - other error codes // are more specific to HTTP interactions, and set a reason errors.NewClientErrorReporter(http.StatusInternalServerError, r.verb, "ClientWatchDecoding"), @@ -607,8 +641,8 @@ func (r *Request) WatchWithSpecificDecoders(wrapperDecoderFn func(io.ReadCloser) // It also handles corner cases for incomplete/invalid request data. func updateURLMetrics(req *Request, resp *http.Response, err error) { url := "none" - if req.baseURL != nil { - url = req.baseURL.Host + if req.c.base != nil { + url = req.c.base.Host } // Errors can be arbitrary strings. Unbound label cardinality is not suitable for a metric @@ -630,29 +664,34 @@ func (r *Request) Stream() (io.ReadCloser, error) { return nil, r.err } - r.tryThrottle() + if err := r.tryThrottle(); err != nil { + return nil, err + } url := r.URL().String() req, err := http.NewRequest(r.verb, url, nil) if err != nil { return nil, err } + if r.body != nil { + req.Body = ioutil.NopCloser(r.body) + } if r.ctx != nil { req = req.WithContext(r.ctx) } req.Header = r.headers - client := r.client + client := r.c.Client if client == nil { client = http.DefaultClient } - r.backoffMgr.Sleep(r.backoffMgr.CalculateBackoff(r.URL())) + r.backoff.Sleep(r.backoff.CalculateBackoff(r.URL())) resp, err := client.Do(req) updateURLMetrics(r, resp, err) - if r.baseURL != nil { + if r.c.base != nil { if err != nil { - r.backoffMgr.UpdateBackoff(r.URL(), err, 0) + r.backoff.UpdateBackoff(r.URL(), err, 0) } else { - r.backoffMgr.UpdateBackoff(r.URL(), err, resp.StatusCode) + r.backoff.UpdateBackoff(r.URL(), err, resp.StatusCode) } } if err != nil { @@ -676,6 +715,33 @@ func (r *Request) Stream() (io.ReadCloser, error) { } } +// requestPreflightCheck looks for common programmer errors on Request. +// +// We tackle here two programmer mistakes. The first one is to try to create +// something(POST) using an empty string as namespace with namespaceSet as +// true. If namespaceSet is true then namespace should also be defined. The +// second mistake is, when under the same circumstances, the programmer tries +// to GET, PUT or DELETE a named resource(resourceName != ""), again, if +// namespaceSet is true then namespace must not be empty. +func (r *Request) requestPreflightCheck() error { + if !r.namespaceSet { + return nil + } + if len(r.namespace) > 0 { + return nil + } + + switch r.verb { + case "POST": + return fmt.Errorf("an empty namespace may not be set during creation") + case "GET", "PUT", "DELETE": + if len(r.resourceName) > 0 { + return fmt.Errorf("an empty namespace may not be set when a resource name is provided") + } + } + return nil +} + // request connects to the server and invokes the provided function when a server response is // received. It handles retry behavior and up front validation of requests. It will invoke // fn at most once. It will return an error if a problem occurred prior to connecting to the @@ -692,15 +758,11 @@ func (r *Request) request(fn func(*http.Request, *http.Response)) error { return r.err } - // TODO: added to catch programmer errors (invoking operations with an object with an empty namespace) - if (r.verb == "GET" || r.verb == "PUT" || r.verb == "DELETE") && r.namespaceSet && len(r.resourceName) > 0 && len(r.namespace) == 0 { - return fmt.Errorf("an empty namespace may not be set when a resource name is provided") - } - if (r.verb == "POST") && r.namespaceSet && len(r.namespace) == 0 { - return fmt.Errorf("an empty namespace may not be set during creation") + if err := r.requestPreflightCheck(); err != nil { + return err } - client := r.client + client := r.c.Client if client == nil { client = http.DefaultClient } @@ -727,19 +789,21 @@ func (r *Request) request(fn func(*http.Request, *http.Response)) error { } req.Header = r.headers - r.backoffMgr.Sleep(r.backoffMgr.CalculateBackoff(r.URL())) + r.backoff.Sleep(r.backoff.CalculateBackoff(r.URL())) if retries > 0 { // We are retrying the request that we already send to apiserver // at least once before. - // This request should also be throttled with the client-internal throttler. - r.tryThrottle() + // This request should also be throttled with the client-internal rate limiter. + if err := r.tryThrottle(); err != nil { + return err + } } resp, err := client.Do(req) updateURLMetrics(r, resp, err) if err != nil { - r.backoffMgr.UpdateBackoff(r.URL(), err, 0) + r.backoff.UpdateBackoff(r.URL(), err, 0) } else { - r.backoffMgr.UpdateBackoff(r.URL(), err, resp.StatusCode) + r.backoff.UpdateBackoff(r.URL(), err, resp.StatusCode) } if err != nil { // "Connection reset by peer" is usually a transient error. @@ -782,7 +846,7 @@ func (r *Request) request(fn func(*http.Request, *http.Response)) error { } klog.V(4).Infof("Got a Retry-After %ds response for attempt %d to %v", seconds, retries, url) - r.backoffMgr.Sleep(time.Duration(seconds) * time.Second) + r.backoff.Sleep(time.Duration(seconds) * time.Second) return false } fn(req, resp) @@ -798,12 +862,12 @@ func (r *Request) request(fn func(*http.Request, *http.Response)) error { // processing. // // Error type: -// * If the request can't be constructed, or an error happened earlier while building its -// arguments: *RequestConstructionError // * If the server responds with a status: *errors.StatusError or *errors.UnexpectedObjectError // * http.Client.Do errors are returned directly. func (r *Request) Do() Result { - r.tryThrottle() + if err := r.tryThrottle(); err != nil { + return Result{err: err} + } var result Result err := r.request(func(req *http.Request, resp *http.Response) { @@ -817,7 +881,9 @@ func (r *Request) Do() Result { // DoRaw executes the request but does not process the response body. func (r *Request) DoRaw() ([]byte, error) { - r.tryThrottle() + if err := r.tryThrottle(); err != nil { + return nil, err + } var result Result err := r.request(func(req *http.Request, resp *http.Response) { @@ -850,13 +916,13 @@ func (r *Request) transformResponse(resp *http.Response, req *http.Request) Resu // 3. Apiserver closes connection. // 4. client-go should catch this and return an error. klog.V(2).Infof("Stream error %#v when reading response body, may be caused by closed connection.", err) - streamErr := fmt.Errorf("Stream error when reading response body, may be caused by closed connection. Please retry. Original error: %v", err) + streamErr := fmt.Errorf("stream error when reading response body, may be caused by closed connection. Please retry. Original error: %v", err) return Result{ err: streamErr, } default: klog.Errorf("Unexpected error when reading response body: %v", err) - unexpectedErr := fmt.Errorf("Unexpected error when reading response body. Please retry. Original error: %v", err) + unexpectedErr := fmt.Errorf("unexpected error when reading response body. Please retry. Original error: %v", err) return Result{ err: unexpectedErr, } @@ -866,14 +932,18 @@ func (r *Request) transformResponse(resp *http.Response, req *http.Request) Resu glogBody("Response Body", body) // verify the content type is accurate + var decoder runtime.Decoder contentType := resp.Header.Get("Content-Type") - decoder := r.serializers.Decoder - if len(contentType) > 0 && (decoder == nil || (len(r.content.ContentType) > 0 && contentType != r.content.ContentType)) { + if len(contentType) == 0 { + contentType = r.c.content.ContentType + } + if len(contentType) > 0 { + var err error mediaType, params, err := mime.ParseMediaType(contentType) if err != nil { return Result{err: errors.NewInternalError(err)} } - decoder, err = r.serializers.RenegotiatedDecoder(mediaType, params) + decoder, err = r.c.content.Negotiator.Decoder(mediaType, params) if err != nil { // if we fail to negotiate a decoder, treat this as an unstructured error switch { @@ -993,7 +1063,7 @@ func (r *Request) newUnstructuredResponseError(body []byte, isTextResponse bool, } var groupResource schema.GroupResource if len(r.resource) > 0 { - groupResource.Group = r.content.GroupVersion.Group + groupResource.Group = r.c.content.GroupVersion.Group groupResource.Resource = r.resource } return errors.NewGenericServerResponse( diff --git a/vendor/k8s.io/client-go/rest/transport.go b/vendor/k8s.io/client-go/rest/transport.go index de33ecb..0800e4e 100644 --- a/vendor/k8s.io/client-go/rest/transport.go +++ b/vendor/k8s.io/client-go/rest/transport.go @@ -61,9 +61,10 @@ func HTTPWrappersForConfig(config *Config, rt http.RoundTripper) (http.RoundTrip // TransportConfig converts a client config to an appropriate transport config. func (c *Config) TransportConfig() (*transport.Config, error) { conf := &transport.Config{ - UserAgent: c.UserAgent, - Transport: c.Transport, - WrapTransport: c.WrapTransport, + UserAgent: c.UserAgent, + Transport: c.Transport, + WrapTransport: c.WrapTransport, + DisableCompression: c.DisableCompression, TLS: transport.TLSConfig{ Insecure: c.Insecure, ServerName: c.ServerName, @@ -73,6 +74,7 @@ func (c *Config) TransportConfig() (*transport.Config, error) { CertData: c.CertData, KeyFile: c.KeyFile, KeyData: c.KeyData, + NextProtos: c.NextProtos, }, Username: c.Username, Password: c.Password, diff --git a/vendor/k8s.io/client-go/rest/zz_generated.deepcopy.go b/vendor/k8s.io/client-go/rest/zz_generated.deepcopy.go index c1ab45f..da4a162 100644 --- a/vendor/k8s.io/client-go/rest/zz_generated.deepcopy.go +++ b/vendor/k8s.io/client-go/rest/zz_generated.deepcopy.go @@ -38,6 +38,11 @@ func (in *TLSClientConfig) DeepCopyInto(out *TLSClientConfig) { *out = make([]byte, len(*in)) copy(*out, *in) } + if in.NextProtos != nil { + in, out := &in.NextProtos, &out.NextProtos + *out = make([]string, len(*in)) + copy(*out, *in) + } return } diff --git a/vendor/k8s.io/client-go/testing/actions.go b/vendor/k8s.io/client-go/testing/actions.go index e6db578..f56b34e 100644 --- a/vendor/k8s.io/client-go/testing/actions.go +++ b/vendor/k8s.io/client-go/testing/actions.go @@ -439,8 +439,8 @@ func (a ActionImpl) GetSubresource() string { return a.Subresource } func (a ActionImpl) Matches(verb, resource string) bool { - return strings.ToLower(verb) == strings.ToLower(a.Verb) && - strings.ToLower(resource) == strings.ToLower(a.Resource.Resource) + return strings.EqualFold(verb, a.Verb) && + strings.EqualFold(resource, a.Resource.Resource) } func (a ActionImpl) DeepCopy() Action { ret := a diff --git a/vendor/k8s.io/client-go/testing/fixture.go b/vendor/k8s.io/client-go/testing/fixture.go index 993fcf6..54f600a 100644 --- a/vendor/k8s.io/client-go/testing/fixture.go +++ b/vendor/k8s.io/client-go/testing/fixture.go @@ -18,9 +18,11 @@ package testing import ( "fmt" + "reflect" "sync" jsonpatch "github.com/evanphx/json-patch" + "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -139,6 +141,11 @@ func ObjectReaction(tracker ObjectTracker) ReactionFunc { return true, nil, err } + // reset the object in preparation to unmarshal, since unmarshal does not guarantee that fields + // in obj that are removed by patch are cleared + value := reflect.ValueOf(obj) + value.Elem().Set(reflect.New(value.Type().Elem()).Elem()) + switch action.GetPatchType() { case types.JSONPatchType: patch, err := jsonpatch.DecodePatch(action.GetPatch()) @@ -149,6 +156,7 @@ func ObjectReaction(tracker ObjectTracker) ReactionFunc { if err != nil { return true, nil, err } + if err = json.Unmarshal(modified, obj); err != nil { return true, nil, err } @@ -240,7 +248,7 @@ func (t *tracker) List(gvr schema.GroupVersionResource, gvk schema.GroupVersionK return list, nil } - matchingObjs, err := filterByNamespaceAndName(objs, ns, "") + matchingObjs, err := filterByNamespace(objs, ns) if err != nil { return nil, err } @@ -274,9 +282,19 @@ func (t *tracker) Get(gvr schema.GroupVersionResource, ns, name string) (runtime return nil, errNotFound } - matchingObjs, err := filterByNamespaceAndName(objs, ns, name) - if err != nil { - return nil, err + var matchingObjs []runtime.Object + for _, obj := range objs { + acc, err := meta.Accessor(obj) + if err != nil { + return nil, err + } + if acc.GetNamespace() != ns { + continue + } + if acc.GetName() != name { + continue + } + matchingObjs = append(matchingObjs, obj) } if len(matchingObjs) == 0 { return nil, errNotFound @@ -310,6 +328,11 @@ func (t *tracker) Add(obj runtime.Object) error { if err != nil { return err } + + if partial, ok := obj.(*metav1.PartialObjectMetadata); ok && len(partial.TypeMeta.APIVersion) > 0 { + gvks = []schema.GroupVersionKind{partial.TypeMeta.GroupVersionKind()} + } + if len(gvks) == 0 { return fmt.Errorf("no registered kinds for %v", obj) } @@ -459,10 +482,10 @@ func (t *tracker) Delete(gvr schema.GroupVersionResource, ns, name string) error return errors.NewNotFound(gvr.GroupResource(), name) } -// filterByNamespaceAndName returns all objects in the collection that -// match provided namespace and name. Empty namespace matches +// filterByNamespace returns all objects in the collection that +// match provided namespace. Empty namespace matches // non-namespaced objects. -func filterByNamespaceAndName(objs []runtime.Object, ns, name string) ([]runtime.Object, error) { +func filterByNamespace(objs []runtime.Object, ns string) ([]runtime.Object, error) { var res []runtime.Object for _, obj := range objs { @@ -473,9 +496,6 @@ func filterByNamespaceAndName(objs []runtime.Object, ns, name string) ([]runtime if ns != "" && acc.GetNamespace() != ns { continue } - if name != "" && acc.GetName() != name { - continue - } res = append(res, obj) } diff --git a/vendor/k8s.io/client-go/tools/auth/OWNERS b/vendor/k8s.io/client-go/tools/auth/OWNERS deleted file mode 100644 index 3e05d30..0000000 --- a/vendor/k8s.io/client-go/tools/auth/OWNERS +++ /dev/null @@ -1,9 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: -- sig-auth-authenticators-approvers -reviewers: -- sig-auth-authenticators-reviewers -labels: -- sig/auth - diff --git a/vendor/k8s.io/client-go/tools/cache/OWNERS b/vendor/k8s.io/client-go/tools/cache/OWNERS deleted file mode 100644 index a8cd4b4..0000000 --- a/vendor/k8s.io/client-go/tools/cache/OWNERS +++ /dev/null @@ -1,51 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: -- thockin -- lavalamp -- smarterclayton -- wojtek-t -- deads2k -- caesarxuchao -- liggitt -- ncdc -reviewers: -- thockin -- lavalamp -- smarterclayton -- wojtek-t -- deads2k -- brendandburns -- derekwaynecarr -- caesarxuchao -- mikedanese -- liggitt -- nikhiljindal -- erictune -- davidopp -- pmorie -- janetkuo -- justinsb -- eparis -- soltysh -- jsafrane -- dims -- madhusudancs -- hongchaodeng -- krousey -- markturansky -- fgrzadkowski -- xiang90 -- mml -- ingvagabund -- resouer -- jessfraz -- david-mcmahon -- mfojtik -- '249043822' -- lixiaobing10051267 -- ddysher -- mqliang -- feihujiang -- sdminonne -- ncdc diff --git a/vendor/k8s.io/client-go/tools/cache/controller.go b/vendor/k8s.io/client-go/tools/cache/controller.go index b5d3925..27a1c52 100644 --- a/vendor/k8s.io/client-go/tools/cache/controller.go +++ b/vendor/k8s.io/client-go/tools/cache/controller.go @@ -79,6 +79,7 @@ type controller struct { clock clock.Clock } +// Controller is a generic controller framework. type Controller interface { Run(stopCh <-chan struct{}) HasSynced() bool @@ -130,6 +131,8 @@ func (c *controller) HasSynced() bool { } func (c *controller) LastSyncResourceVersion() string { + c.reflectorMutex.RLock() + defer c.reflectorMutex.RUnlock() if c.reflector == nil { return "" } @@ -149,7 +152,7 @@ func (c *controller) processLoop() { for { obj, err := c.config.Queue.Pop(PopProcessFunc(c.config.Process)) if err != nil { - if err == FIFOClosedError { + if err == ErrFIFOClosed { return } if c.config.RetryOnError { diff --git a/vendor/k8s.io/client-go/tools/cache/delta_fifo.go b/vendor/k8s.io/client-go/tools/cache/delta_fifo.go index f24eec2..55ecdcd 100644 --- a/vendor/k8s.io/client-go/tools/cache/delta_fifo.go +++ b/vendor/k8s.io/client-go/tools/cache/delta_fifo.go @@ -160,7 +160,7 @@ func (f *DeltaFIFO) KeyOf(obj interface{}) (string, error) { return f.keyFunc(obj) } -// Return true if an Add/Update/Delete/AddIfNotPresent are called first, +// HasSynced returns true if an Add/Update/Delete/AddIfNotPresent are called first, // or an Update called first but the first batch of items inserted by Replace() has been popped func (f *DeltaFIFO) HasSynced() bool { f.lock.Lock() @@ -295,13 +295,6 @@ func isDeletionDup(a, b *Delta) *Delta { return b } -// willObjectBeDeletedLocked returns true only if the last delta for the -// given object is Delete. Caller must lock first. -func (f *DeltaFIFO) willObjectBeDeletedLocked(id string) bool { - deltas := f.items[id] - return len(deltas) > 0 && deltas[len(deltas)-1].Type == Deleted -} - // queueActionLocked appends to the delta list for the object. // Caller must lock first. func (f *DeltaFIFO) queueActionLocked(actionType DeltaType, obj interface{}) error { @@ -310,13 +303,6 @@ func (f *DeltaFIFO) queueActionLocked(actionType DeltaType, obj interface{}) err return KeyError{obj, err} } - // If object is supposed to be deleted (last event is Deleted), - // then we should ignore Sync events, because it would result in - // recreation of this object. - if actionType == Sync && f.willObjectBeDeletedLocked(id) { - return nil - } - newDeltas := append(f.items[id], Delta{actionType, obj}) newDeltas = dedupDeltas(newDeltas) @@ -389,7 +375,7 @@ func (f *DeltaFIFO) GetByKey(key string) (item interface{}, exists bool, err err return d, exists, nil } -// Checks if the queue is closed +// IsClosed checks if the queue is closed func (f *DeltaFIFO) IsClosed() bool { f.closedLock.Lock() defer f.closedLock.Unlock() @@ -417,7 +403,7 @@ func (f *DeltaFIFO) Pop(process PopProcessFunc) (interface{}, error) { // When Close() is called, the f.closed is set and the condition is broadcasted. // Which causes this loop to continue and return from the Pop(). if f.IsClosed() { - return nil, FIFOClosedError + return nil, ErrFIFOClosed } f.cond.Wait() @@ -539,13 +525,6 @@ func (f *DeltaFIFO) Resync() error { return nil } -func (f *DeltaFIFO) syncKey(key string) error { - f.lock.Lock() - defer f.lock.Unlock() - - return f.syncKeyLocked(key) -} - func (f *DeltaFIFO) syncKeyLocked(key string) error { obj, exists, err := f.knownObjects.GetByKey(key) if err != nil { @@ -593,6 +572,7 @@ type KeyGetter interface { // DeltaType is the type of a change (addition, deletion, etc) type DeltaType string +// Change type definition const ( Added DeltaType = "Added" Updated DeltaType = "Updated" diff --git a/vendor/k8s.io/client-go/tools/cache/expiration_cache.go b/vendor/k8s.io/client-go/tools/cache/expiration_cache.go index 4b00544..14ad492 100644 --- a/vendor/k8s.io/client-go/tools/cache/expiration_cache.go +++ b/vendor/k8s.io/client-go/tools/cache/expiration_cache.go @@ -55,7 +55,7 @@ type ExpirationPolicy interface { type TTLPolicy struct { // >0: Expire entries with an age > ttl // <=0: Don't expire any entry - Ttl time.Duration + TTL time.Duration // Clock used to calculate ttl expiration Clock clock.Clock @@ -64,7 +64,7 @@ type TTLPolicy struct { // IsExpired returns true if the given object is older than the ttl, or it can't // determine its age. func (p *TTLPolicy) IsExpired(obj *TimestampedEntry) bool { - return p.Ttl > 0 && p.Clock.Since(obj.Timestamp) > p.Ttl + return p.TTL > 0 && p.Clock.Since(obj.Timestamp) > p.TTL } // TimestampedEntry is the only type allowed in a ExpirationCache. @@ -74,6 +74,7 @@ func (p *TTLPolicy) IsExpired(obj *TimestampedEntry) bool { type TimestampedEntry struct { Obj interface{} Timestamp time.Time + key string } // getTimestampedEntry returns the TimestampedEntry stored under the given key. @@ -129,10 +130,8 @@ func (c *ExpirationCache) List() []interface{} { list := make([]interface{}, 0, len(items)) for _, item := range items { - obj := item.(*TimestampedEntry).Obj - if key, err := c.keyFunc(obj); err != nil { - list = append(list, obj) - } else if obj, exists := c.getOrExpire(key); exists { + key := item.(*TimestampedEntry).key + if obj, exists := c.getOrExpire(key); exists { list = append(list, obj) } } @@ -154,7 +153,7 @@ func (c *ExpirationCache) Add(obj interface{}) error { c.expirationLock.Lock() defer c.expirationLock.Unlock() - c.cacheStorage.Add(key, &TimestampedEntry{obj, c.clock.Now()}) + c.cacheStorage.Add(key, &TimestampedEntry{obj, c.clock.Now(), key}) return nil } @@ -187,7 +186,7 @@ func (c *ExpirationCache) Replace(list []interface{}, resourceVersion string) er if err != nil { return KeyError{item, err} } - items[key] = &TimestampedEntry{item, ts} + items[key] = &TimestampedEntry{item, ts, key} } c.expirationLock.Lock() defer c.expirationLock.Unlock() diff --git a/vendor/k8s.io/client-go/tools/cache/expiration_cache_fakes.go b/vendor/k8s.io/client-go/tools/cache/expiration_cache_fakes.go index d61db3d..33afd32 100644 --- a/vendor/k8s.io/client-go/tools/cache/expiration_cache_fakes.go +++ b/vendor/k8s.io/client-go/tools/cache/expiration_cache_fakes.go @@ -33,16 +33,19 @@ func (c *fakeThreadSafeMap) Delete(key string) { } } +// FakeExpirationPolicy keeps the list for keys which never expires. type FakeExpirationPolicy struct { NeverExpire sets.String RetrieveKeyFunc KeyFunc } +// IsExpired used to check if object is expired. func (p *FakeExpirationPolicy) IsExpired(obj *TimestampedEntry) bool { key, _ := p.RetrieveKeyFunc(obj) return !p.NeverExpire.Has(key) } +// NewFakeExpirationStore creates a new instance for the ExpirationCache. func NewFakeExpirationStore(keyFunc KeyFunc, deletedKeys chan<- string, expirationPolicy ExpirationPolicy, cacheClock clock.Clock) Store { cacheStorage := NewThreadSafeStore(Indexers{}, Indices{}) return &ExpirationCache{ diff --git a/vendor/k8s.io/client-go/tools/cache/fake_custom_store.go b/vendor/k8s.io/client-go/tools/cache/fake_custom_store.go index b59e2eb..462d226 100644 --- a/vendor/k8s.io/client-go/tools/cache/fake_custom_store.go +++ b/vendor/k8s.io/client-go/tools/cache/fake_custom_store.go @@ -16,7 +16,7 @@ limitations under the License. package cache -// FakeStore lets you define custom functions for store operations +// FakeCustomStore lets you define custom functions for store operations. type FakeCustomStore struct { AddFunc func(obj interface{}) error UpdateFunc func(obj interface{}) error @@ -25,7 +25,7 @@ type FakeCustomStore struct { ListKeysFunc func() []string GetFunc func(obj interface{}) (item interface{}, exists bool, err error) GetByKeyFunc func(key string) (item interface{}, exists bool, err error) - ReplaceFunc func(list []interface{}, resourceVerion string) error + ReplaceFunc func(list []interface{}, resourceVersion string) error ResyncFunc func() error } diff --git a/vendor/k8s.io/client-go/tools/cache/fifo.go b/vendor/k8s.io/client-go/tools/cache/fifo.go index 508c553..7a3bc3d 100644 --- a/vendor/k8s.io/client-go/tools/cache/fifo.go +++ b/vendor/k8s.io/client-go/tools/cache/fifo.go @@ -34,7 +34,8 @@ type ErrRequeue struct { Err error } -var FIFOClosedError error = errors.New("DeltaFIFO: manipulating with closed queue") +// ErrFIFOClosed used when FIFO is closed +var ErrFIFOClosed = errors.New("DeltaFIFO: manipulating with closed queue") func (e ErrRequeue) Error() string { if e.Err == nil { @@ -66,7 +67,7 @@ type Queue interface { Close() } -// Helper function for popping from Queue. +// Pop is helper function for popping from Queue. // WARNING: Do NOT use this function in non-test code to avoid races // unless you really really really really know what you are doing. func Pop(queue Queue) interface{} { @@ -126,7 +127,7 @@ func (f *FIFO) Close() { f.cond.Broadcast() } -// Return true if an Add/Update/Delete/AddIfNotPresent are called first, +// HasSynced returns true if an Add/Update/Delete/AddIfNotPresent are called first, // or an Update called first but the first batch of items inserted by Replace() has been popped func (f *FIFO) HasSynced() bool { f.lock.Lock() @@ -242,7 +243,7 @@ func (f *FIFO) GetByKey(key string) (item interface{}, exists bool, err error) { return item, exists, nil } -// Checks if the queue is closed +// IsClosed checks if the queue is closed func (f *FIFO) IsClosed() bool { f.closedLock.Lock() defer f.closedLock.Unlock() @@ -267,7 +268,7 @@ func (f *FIFO) Pop(process PopProcessFunc) (interface{}, error) { // When Close() is called, the f.closed is set and the condition is broadcasted. // Which causes this loop to continue and return from the Pop(). if f.IsClosed() { - return nil, FIFOClosedError + return nil, ErrFIFOClosed } f.cond.Wait() diff --git a/vendor/k8s.io/client-go/tools/cache/heap.go b/vendor/k8s.io/client-go/tools/cache/heap.go index 7357ff9..e503a45 100644 --- a/vendor/k8s.io/client-go/tools/cache/heap.go +++ b/vendor/k8s.io/client-go/tools/cache/heap.go @@ -28,7 +28,9 @@ const ( closedMsg = "heap is closed" ) +// LessFunc is used to compare two objects in the heap. type LessFunc func(interface{}, interface{}) bool + type heapItem struct { obj interface{} // The object which is stored in the heap. index int // The index of the object's key in the Heap.queue. @@ -158,7 +160,7 @@ func (h *Heap) Add(obj interface{}) error { return nil } -// Adds all the items in the list to the queue and then signals the condition +// BulkAdd adds all the items in the list to the queue and then signals the condition // variable. It is useful when the caller would like to add all of the items // to the queue before consumer starts processing them. func (h *Heap) BulkAdd(list []interface{}) error { @@ -249,11 +251,11 @@ func (h *Heap) Pop() (interface{}, error) { h.cond.Wait() } obj := heap.Pop(h.data) - if obj != nil { - return obj, nil - } else { + if obj == nil { return nil, fmt.Errorf("object was removed from heap data") } + + return obj, nil } // List returns a list of all the items. diff --git a/vendor/k8s.io/client-go/tools/cache/index.go b/vendor/k8s.io/client-go/tools/cache/index.go index 15acb16..bbfb3b5 100644 --- a/vendor/k8s.io/client-go/tools/cache/index.go +++ b/vendor/k8s.io/client-go/tools/cache/index.go @@ -23,17 +23,27 @@ import ( "k8s.io/apimachinery/pkg/util/sets" ) -// Indexer is a storage interface that lets you list objects using multiple indexing functions +// Indexer is a storage interface that lets you list objects using multiple indexing functions. +// There are three kinds of strings here. +// One is a storage key, as defined in the Store interface. +// Another kind is a name of an index. +// The third kind of string is an "indexed value", which is produced by an +// IndexFunc and can be a field value or any other string computed from the object. type Indexer interface { Store - // Retrieve list of objects that match on the named indexing function + // Index returns the stored objects whose set of indexed values + // intersects the set of indexed values of the given object, for + // the named index Index(indexName string, obj interface{}) ([]interface{}, error) - // IndexKeys returns the set of keys that match on the named indexing function. - IndexKeys(indexName, indexKey string) ([]string, error) - // ListIndexFuncValues returns the list of generated values of an Index func + // IndexKeys returns the storage keys of the stored objects whose + // set of indexed values for the named index includes the given + // indexed value + IndexKeys(indexName, indexedValue string) ([]string, error) + // ListIndexFuncValues returns all the indexed values of the given index ListIndexFuncValues(indexName string) []string - // ByIndex lists object that match on the named indexing function with the exact key - ByIndex(indexName, indexKey string) ([]interface{}, error) + // ByIndex returns the stored objects whose set of indexed values + // for the named index includes the given indexed value + ByIndex(indexName, indexedValue string) ([]interface{}, error) // GetIndexer return the indexers GetIndexers() Indexers @@ -42,11 +52,11 @@ type Indexer interface { AddIndexers(newIndexers Indexers) error } -// IndexFunc knows how to provide an indexed value for an object. +// IndexFunc knows how to compute the set of indexed values for an object. type IndexFunc func(obj interface{}) ([]string, error) // IndexFuncToKeyFuncAdapter adapts an indexFunc to a keyFunc. This is only useful if your index function returns -// unique values for every object. This is conversion can create errors when more than one key is found. You +// unique values for every object. This conversion can create errors when more than one key is found. You // should prefer to make proper key and index functions. func IndexFuncToKeyFuncAdapter(indexFunc IndexFunc) KeyFunc { return func(obj interface{}) (string, error) { @@ -65,6 +75,7 @@ func IndexFuncToKeyFuncAdapter(indexFunc IndexFunc) KeyFunc { } const ( + // NamespaceIndex is the lookup name for the most comment index function, which is to index by the namespace field. NamespaceIndex string = "namespace" ) diff --git a/vendor/k8s.io/client-go/tools/cache/listers.go b/vendor/k8s.io/client-go/tools/cache/listers.go index 311ff8c..d649cd7 100644 --- a/vendor/k8s.io/client-go/tools/cache/listers.go +++ b/vendor/k8s.io/client-go/tools/cache/listers.go @@ -30,6 +30,7 @@ import ( // AppendFunc is used to add a matching item to whatever list the caller is using type AppendFunc func(interface{}) +// ListAll calls appendFn with each value retrieved from store which matches the selector. func ListAll(store Store, selector labels.Selector, appendFn AppendFunc) error { selectAll := selector.Empty() for _, m := range store.List() { @@ -50,6 +51,7 @@ func ListAll(store Store, selector labels.Selector, appendFn AppendFunc) error { return nil } +// ListAllByNamespace used to list items belongs to namespace from Indexer. func ListAllByNamespace(indexer Indexer, namespace string, selector labels.Selector, appendFn AppendFunc) error { selectAll := selector.Empty() if namespace == metav1.NamespaceAll { @@ -124,6 +126,7 @@ type GenericNamespaceLister interface { Get(name string) (runtime.Object, error) } +// NewGenericLister creates a new instance for the genericLister. func NewGenericLister(indexer Indexer, resource schema.GroupResource) GenericLister { return &genericLister{indexer: indexer, resource: resource} } diff --git a/vendor/k8s.io/client-go/tools/cache/mutation_cache.go b/vendor/k8s.io/client-go/tools/cache/mutation_cache.go index 4c6686e..5d3245a 100644 --- a/vendor/k8s.io/client-go/tools/cache/mutation_cache.go +++ b/vendor/k8s.io/client-go/tools/cache/mutation_cache.go @@ -42,6 +42,7 @@ type MutationCache interface { Mutation(interface{}) } +// ResourceVersionComparator is able to compare object versions. type ResourceVersionComparator interface { CompareResourceVersion(lhs, rhs runtime.Object) int } diff --git a/vendor/k8s.io/client-go/tools/cache/mutation_detector.go b/vendor/k8s.io/client-go/tools/cache/mutation_detector.go index adb5b8b..fa6acab 100644 --- a/vendor/k8s.io/client-go/tools/cache/mutation_detector.go +++ b/vendor/k8s.io/client-go/tools/cache/mutation_detector.go @@ -36,17 +36,19 @@ func init() { mutationDetectionEnabled, _ = strconv.ParseBool(os.Getenv("KUBE_CACHE_MUTATION_DETECTOR")) } -type CacheMutationDetector interface { +// MutationDetector is able to monitor if the object be modified outside. +type MutationDetector interface { AddObject(obj interface{}) Run(stopCh <-chan struct{}) } -func NewCacheMutationDetector(name string) CacheMutationDetector { +// NewCacheMutationDetector creates a new instance for the defaultCacheMutationDetector. +func NewCacheMutationDetector(name string) MutationDetector { if !mutationDetectionEnabled { return dummyMutationDetector{} } klog.Warningln("Mutation detector is enabled, this will result in memory leakage.") - return &defaultCacheMutationDetector{name: name, period: 1 * time.Second} + return &defaultCacheMutationDetector{name: name, period: 1 * time.Second, retainDuration: 2 * time.Minute} } type dummyMutationDetector struct{} @@ -66,6 +68,10 @@ type defaultCacheMutationDetector struct { lock sync.Mutex cachedObjs []cacheObj + retainDuration time.Duration + lastRotated time.Time + retainedCachedObjs []cacheObj + // failureFunc is injectable for unit testing. If you don't have it, the process will panic. // This panic is intentional, since turning on this detection indicates you want a strong // failure signal. This failure is effectively a p0 bug and you can't trust process results @@ -82,6 +88,14 @@ type cacheObj struct { func (d *defaultCacheMutationDetector) Run(stopCh <-chan struct{}) { // we DON'T want protection from panics. If we're running this code, we want to die for { + if d.lastRotated.IsZero() { + d.lastRotated = time.Now() + } else if time.Now().Sub(d.lastRotated) > d.retainDuration { + d.retainedCachedObjs = d.cachedObjs + d.cachedObjs = nil + d.lastRotated = time.Now() + } + d.CompareObjects() select { @@ -114,7 +128,13 @@ func (d *defaultCacheMutationDetector) CompareObjects() { altered := false for i, obj := range d.cachedObjs { if !reflect.DeepEqual(obj.cached, obj.copied) { - fmt.Printf("CACHE %s[%d] ALTERED!\n%v\n", d.name, i, diff.ObjectDiff(obj.cached, obj.copied)) + fmt.Printf("CACHE %s[%d] ALTERED!\n%v\n", d.name, i, diff.ObjectGoPrintSideBySide(obj.cached, obj.copied)) + altered = true + } + } + for i, obj := range d.retainedCachedObjs { + if !reflect.DeepEqual(obj.cached, obj.copied) { + fmt.Printf("CACHE %s[%d] ALTERED!\n%v\n", d.name, i, diff.ObjectGoPrintSideBySide(obj.cached, obj.copied)) altered = true } } diff --git a/vendor/k8s.io/client-go/tools/cache/reflector.go b/vendor/k8s.io/client-go/tools/cache/reflector.go index 2daa44b..62749ed 100644 --- a/vendor/k8s.io/client-go/tools/cache/reflector.go +++ b/vendor/k8s.io/client-go/tools/cache/reflector.go @@ -22,19 +22,19 @@ import ( "fmt" "io" "math/rand" - "net" - "net/url" "reflect" "sync" - "syscall" "time" apierrs "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/clock" "k8s.io/apimachinery/pkg/util/naming" + utilnet "k8s.io/apimachinery/pkg/util/net" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" @@ -43,15 +43,22 @@ import ( "k8s.io/utils/trace" ) +const defaultExpectedTypeName = "" + // Reflector watches a specified resource and causes all changes to be reflected in the given store. type Reflector struct { // name identifies this reflector. By default it will be a file:line if possible. name string - // metrics tracks basic metric information about the reflector - metrics *reflectorMetrics + // The name of the type we expect to place in the store. The name + // will be the stringification of expectedGVK if provided, and the + // stringification of expectedType otherwise. It is for display + // only, and should not be used for parsing or comparison. + expectedTypeName string // The type of object we expect to place in the store. expectedType reflect.Type + // The GVK of the object we expect to place in the store if unstructured. + expectedGVK *schema.GroupVersionKind // The destination to sync up with the watch source store Store // listerWatcher is used to perform lists and watches. @@ -104,14 +111,35 @@ func NewNamedReflector(name string, lw ListerWatcher, expectedType interface{}, name: name, listerWatcher: lw, store: store, - expectedType: reflect.TypeOf(expectedType), period: time.Second, resyncPeriod: resyncPeriod, clock: &clock.RealClock{}, } + r.setExpectedType(expectedType) return r } +func (r *Reflector) setExpectedType(expectedType interface{}) { + r.expectedType = reflect.TypeOf(expectedType) + if r.expectedType == nil { + r.expectedTypeName = defaultExpectedTypeName + return + } + + r.expectedTypeName = r.expectedType.String() + + if obj, ok := expectedType.(*unstructured.Unstructured); ok { + // Use gvk to check that watch event objects are of the desired type. + gvk := obj.GroupVersionKind() + if gvk.Empty() { + klog.V(4).Infof("Reflector from %s configured with expectedType of *unstructured.Unstructured with empty GroupVersionKind.", r.name) + return + } + r.expectedGVK = &gvk + r.expectedTypeName = gvk.String() + } +} + // internalPackages are packages that ignored when creating a default reflector name. These packages are in the common // call chains to NewReflector, so they'd be low entropy names for reflectors var internalPackages = []string{"client-go/tools/cache/"} @@ -119,7 +147,7 @@ var internalPackages = []string{"client-go/tools/cache/"} // Run starts a watch and handles watch events. Will restart the watch if it is closed. // Run will exit when stopCh is closed. func (r *Reflector) Run(stopCh <-chan struct{}) { - klog.V(3).Infof("Starting reflector %v (%s) from %s", r.expectedType, r.resyncPeriod, r.name) + klog.V(3).Infof("Starting reflector %v (%s) from %s", r.expectedTypeName, r.resyncPeriod, r.name) wait.Until(func() { if err := r.ListAndWatch(stopCh); err != nil { utilruntime.HandleError(err) @@ -131,9 +159,6 @@ var ( // nothing will ever be sent down this channel neverExitWatch <-chan time.Time = make(chan time.Time) - // Used to indicate that watching stopped so that a resync could happen. - errorResyncRequested = errors.New("resync channel fired") - // Used to indicate that watching stopped because of a signal from the stop // channel passed in from a client of the reflector. errorStopRequested = errors.New("Stop requested") @@ -157,7 +182,7 @@ func (r *Reflector) resyncChan() (<-chan time.Time, func() bool) { // and then use the resource version to watch. // It returns error if ListAndWatch didn't even try to initialize watch. func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { - klog.V(3).Infof("Listing and watching %v from %s", r.expectedType, r.name) + klog.V(3).Infof("Listing and watching %v from %s", r.expectedTypeName, r.name) var resourceVersion string // Explicitly set "0" as resource version - it's fine for the List() @@ -166,7 +191,7 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { options := metav1.ListOptions{ResourceVersion: "0"} if err := func() error { - initTrace := trace.New("Reflector " + r.name + " ListAndWatch") + initTrace := trace.New("Reflector ListAndWatch", trace.Field{"name", r.name}) defer initTrace.LogIfLong(10 * time.Second) var list runtime.Object var err error @@ -198,7 +223,7 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { case <-listCh: } if err != nil { - return fmt.Errorf("%s: Failed to list %v: %v", r.name, r.expectedType, err) + return fmt.Errorf("%s: Failed to list %v: %v", r.name, r.expectedTypeName, err) } initTrace.Step("Objects listed") listMetaInterface, err := meta.ListAccessor(list) @@ -268,8 +293,7 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { // To reduce load on kube-apiserver on watch restarts, you may enable watch bookmarks. // Reflector doesn't assume bookmarks are returned at all (if the server do not support // watch bookmarks, it will ignore this field). - // Disabled in Alpha release of watch bookmarks feature. - AllowWatchBookmarks: false, + AllowWatchBookmarks: true, } w, err := r.listerWatcher.Watch(options) @@ -278,28 +302,29 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { case io.EOF: // watch closed normally case io.ErrUnexpectedEOF: - klog.V(1).Infof("%s: Watch for %v closed with unexpected EOF: %v", r.name, r.expectedType, err) + klog.V(1).Infof("%s: Watch for %v closed with unexpected EOF: %v", r.name, r.expectedTypeName, err) default: - utilruntime.HandleError(fmt.Errorf("%s: Failed to watch %v: %v", r.name, r.expectedType, err)) + utilruntime.HandleError(fmt.Errorf("%s: Failed to watch %v: %v", r.name, r.expectedTypeName, err)) } // If this is "connection refused" error, it means that most likely apiserver is not responsive. // It doesn't make sense to re-list all objects because most likely we will be able to restart // watch where we ended. // If that's the case wait and resend watch request. - if urlError, ok := err.(*url.Error); ok { - if opError, ok := urlError.Err.(*net.OpError); ok { - if errno, ok := opError.Err.(syscall.Errno); ok && errno == syscall.ECONNREFUSED { - time.Sleep(time.Second) - continue - } - } + if utilnet.IsConnectionRefused(err) { + time.Sleep(time.Second) + continue } return nil } if err := r.watchHandler(w, &resourceVersion, resyncerrc, stopCh); err != nil { if err != errorStopRequested { - klog.Warningf("%s: watch of %v ended with: %v", r.name, r.expectedType, err) + switch { + case apierrs.IsResourceExpired(err): + klog.V(4).Infof("%s: watch of %v ended with: %v", r.name, r.expectedTypeName, err) + default: + klog.Warningf("%s: watch of %v ended with: %v", r.name, r.expectedTypeName, err) + } } return nil } @@ -338,9 +363,17 @@ loop: if event.Type == watch.Error { return apierrs.FromObject(event.Object) } - if e, a := r.expectedType, reflect.TypeOf(event.Object); e != nil && e != a { - utilruntime.HandleError(fmt.Errorf("%s: expected type %v, but watch event object had type %v", r.name, e, a)) - continue + if r.expectedType != nil { + if e, a := r.expectedType, reflect.TypeOf(event.Object); e != a { + utilruntime.HandleError(fmt.Errorf("%s: expected type %v, but watch event object had type %v", r.name, e, a)) + continue + } + } + if r.expectedGVK != nil { + if e, a := *r.expectedGVK, event.Object.GetObjectKind().GroupVersionKind(); e != a { + utilruntime.HandleError(fmt.Errorf("%s: expected gvk %v, but watch event object had gvk %v", r.name, e, a)) + continue + } } meta, err := meta.Accessor(event.Object) if err != nil { @@ -382,7 +415,7 @@ loop: if watchDuration < 1*time.Second && eventCount == 0 { return fmt.Errorf("very short watch: %s: Unexpected watch close - watch lasted less than a second and no items received", r.name) } - klog.V(4).Infof("%s: Watch close - %v total %v items received", r.name, r.expectedType, eventCount) + klog.V(4).Infof("%s: Watch close - %v total %v items received", r.name, r.expectedTypeName, eventCount) return nil } diff --git a/vendor/k8s.io/client-go/tools/cache/reflector_metrics.go b/vendor/k8s.io/client-go/tools/cache/reflector_metrics.go index dd849c8..5c00115 100644 --- a/vendor/k8s.io/client-go/tools/cache/reflector_metrics.go +++ b/vendor/k8s.io/client-go/tools/cache/reflector_metrics.go @@ -47,19 +47,6 @@ func (noopMetric) Dec() {} func (noopMetric) Observe(float64) {} func (noopMetric) Set(float64) {} -type reflectorMetrics struct { - numberOfLists CounterMetric - listDuration SummaryMetric - numberOfItemsInList SummaryMetric - - numberOfWatches CounterMetric - numberOfShortWatches CounterMetric - watchDuration SummaryMetric - numberOfItemsInWatch SummaryMetric - - lastResourceVersion GaugeMetric -} - // MetricsProvider generates various metrics used by the reflector. type MetricsProvider interface { NewListsMetric(name string) CounterMetric diff --git a/vendor/k8s.io/client-go/tools/cache/shared_informer.go b/vendor/k8s.io/client-go/tools/cache/shared_informer.go index 3271d95..f59a085 100644 --- a/vendor/k8s.io/client-go/tools/cache/shared_informer.go +++ b/vendor/k8s.io/client-go/tools/cache/shared_informer.go @@ -34,56 +34,90 @@ import ( // SharedInformer provides eventually consistent linkage of its // clients to the authoritative state of a given collection of // objects. An object is identified by its API group, kind/resource, -// namespace, and name. One SharedInfomer provides linkage to objects -// of a particular API group and kind/resource. The linked object -// collection of a SharedInformer may be further restricted to one -// namespace and/or by label selector and/or field selector. +// namespace, and name; the `ObjectMeta.UID` is not part of an +// object's ID as far as this contract is concerned. One +// SharedInformer provides linkage to objects of a particular API +// group and kind/resource. The linked object collection of a +// SharedInformer may be further restricted to one namespace and/or by +// label selector and/or field selector. // // The authoritative state of an object is what apiservers provide // access to, and an object goes through a strict sequence of states. -// A state is either "absent" or present with a ResourceVersion and -// other appropriate content. +// An object state is either "absent" or present with a +// ResourceVersion and other appropriate content. // -// A SharedInformer maintains a local cache, exposed by Store(), of -// the state of each relevant object. This cache is eventually -// consistent with the authoritative state. This means that, unless -// prevented by persistent communication problems, if ever a -// particular object ID X is authoritatively associated with a state S -// then for every SharedInformer I whose collection includes (X, S) -// eventually either (1) I's cache associates X with S or a later -// state of X, (2) I is stopped, or (3) the authoritative state -// service for X terminates. To be formally complete, we say that the -// absent state meets any restriction by label selector or field -// selector. +// A SharedInformer gets object states from apiservers using a +// sequence of LIST and WATCH operations. Through this sequence the +// apiservers provide a sequence of "collection states" to the +// informer, where each collection state defines the state of every +// object of the collection. No promise --- beyond what is implied by +// other remarks here --- is made about how one informer's sequence of +// collection states relates to a different informer's sequence of +// collection states. +// +// A SharedInformer maintains a local cache, exposed by GetStore() and +// by GetIndexer() in the case of an indexed informer, of the state of +// each relevant object. This cache is eventually consistent with the +// authoritative state. This means that, unless prevented by +// persistent communication problems, if ever a particular object ID X +// is authoritatively associated with a state S then for every +// SharedInformer I whose collection includes (X, S) eventually either +// (1) I's cache associates X with S or a later state of X, (2) I is +// stopped, or (3) the authoritative state service for X terminates. +// To be formally complete, we say that the absent state meets any +// restriction by label selector or field selector. +// +// The local cache starts out empty, and gets populated and updated +// during `Run()`. // // As a simple example, if a collection of objects is henceforeth -// unchanging and a SharedInformer is created that links to that -// collection then that SharedInformer's cache eventually holds an -// exact copy of that collection (unless it is stopped too soon, the -// authoritative state service ends, or communication problems between -// the two persistently thwart achievement). +// unchanging, a SharedInformer is created that links to that +// collection, and that SharedInformer is `Run()` then that +// SharedInformer's cache eventually holds an exact copy of that +// collection (unless it is stopped too soon, the authoritative state +// service ends, or communication problems between the two +// persistently thwart achievement). // // As another simple example, if the local cache ever holds a // non-absent state for some object ID and the object is eventually // removed from the authoritative state then eventually the object is // removed from the local cache (unless the SharedInformer is stopped -// too soon, the authoritative state service emnds, or communication +// too soon, the authoritative state service ends, or communication // problems persistently thwart the desired result). // -// The keys in Store() are of the form namespace/name for namespaced +// The keys in the Store are of the form namespace/name for namespaced // objects, and are simply the name for non-namespaced objects. +// Clients can use `MetaNamespaceKeyFunc(obj)` to extract the key for +// a given object, and `SplitMetaNamespaceKey(key)` to split a key +// into its constituent parts. // // A client is identified here by a ResourceEventHandler. For every -// update to the SharedInformer's local cache and for every client, -// eventually either the SharedInformer is stopped or the client is -// notified of the update. These notifications happen after the -// corresponding cache update and, in the case of a -// SharedIndexInformer, after the corresponding index updates. It is -// possible that additional cache and index updates happen before such -// a prescribed notification. For a given SharedInformer and client, -// all notifications are delivered sequentially. For a given -// SharedInformer, client, and object ID, the notifications are -// delivered in order. +// update to the SharedInformer's local cache and for every client +// added before `Run()`, eventually either the SharedInformer is +// stopped or the client is notified of the update. A client added +// after `Run()` starts gets a startup batch of notifications of +// additions of the object existing in the cache at the time that +// client was added; also, for every update to the SharedInformer's +// local cache after that client was added, eventually either the +// SharedInformer is stopped or that client is notified of that +// update. Client notifications happen after the corresponding cache +// update and, in the case of a SharedIndexInformer, after the +// corresponding index updates. It is possible that additional cache +// and index updates happen before such a prescribed notification. +// For a given SharedInformer and client, the notifications are +// delivered sequentially. For a given SharedInformer, client, and +// object ID, the notifications are delivered in order. +// +// A client must process each notification promptly; a SharedInformer +// is not engineered to deal well with a large backlog of +// notifications to deliver. Lengthy processing should be passed off +// to something else, for example through a +// `client-go/util/workqueue`. +// +// Each query to an informer's local cache --- whether a single-object +// lookup, a list operation, or a use of one of its indices --- is +// answered entirely from one of the collection states received by +// that informer. // // A delete notification exposes the last locally known non-absent // state, except that its ResourceVersion is replaced with a @@ -116,6 +150,7 @@ type SharedInformer interface { LastSyncResourceVersion() string } +// SharedIndexInformer provides add and get Indexers ability based on SharedInformer. type SharedIndexInformer interface { SharedInformer // AddIndexers add indexers to the informer before it starts. @@ -155,10 +190,26 @@ const ( initialBufferSize = 1024 ) +// WaitForNamedCacheSync is a wrapper around WaitForCacheSync that generates log messages +// indicating that the caller identified by name is waiting for syncs, followed by +// either a successful or failed sync. +func WaitForNamedCacheSync(controllerName string, stopCh <-chan struct{}, cacheSyncs ...InformerSynced) bool { + klog.Infof("Waiting for caches to sync for %s", controllerName) + + if !WaitForCacheSync(stopCh, cacheSyncs...) { + utilruntime.HandleError(fmt.Errorf("unable to sync caches for %s", controllerName)) + return false + } + + klog.Infof("Caches are synced for %s ", controllerName) + return true +} + // WaitForCacheSync waits for caches to populate. It returns true if it was successful, false // if the controller should shutdown +// callers should prefer WaitForNamedCacheSync() func WaitForCacheSync(stopCh <-chan struct{}, cacheSyncs ...InformerSynced) bool { - err := wait.PollUntil(syncedPollPeriod, + err := wait.PollImmediateUntil(syncedPollPeriod, func() (bool, error) { for _, syncFunc := range cacheSyncs { if !syncFunc() { @@ -182,7 +233,7 @@ type sharedIndexInformer struct { controller Controller processor *sharedProcessor - cacheMutationDetector CacheMutationDetector + cacheMutationDetector MutationDetector // This block is tracked to handle late initialization of the controller listerWatcher ListerWatcher @@ -222,7 +273,7 @@ func (v *dummyController) HasSynced() bool { return v.informer.HasSynced() } -func (c *dummyController) LastSyncResourceVersion() string { +func (v *dummyController) LastSyncResourceVersion() string { return "" } diff --git a/vendor/k8s.io/client-go/tools/cache/store.go b/vendor/k8s.io/client-go/tools/cache/store.go old mode 100755 new mode 100644 diff --git a/vendor/k8s.io/client-go/tools/cache/thread_safe_store.go b/vendor/k8s.io/client-go/tools/cache/thread_safe_store.go index b74faa0..e723251 100644 --- a/vendor/k8s.io/client-go/tools/cache/thread_safe_store.go +++ b/vendor/k8s.io/client-go/tools/cache/thread_safe_store.go @@ -292,6 +292,13 @@ func (c *threadSafeMap) deleteFromIndices(obj interface{}, key string) { set := index[indexValue] if set != nil { set.Delete(key) + + // If we don't delete the set when zero, indices with high cardinality + // short lived resources can cause memory to increase over time from + // unused empty sets. See `kubernetes/kubernetes/issues/84959`. + if len(set) == 0 { + delete(index, indexValue) + } } } } @@ -302,6 +309,7 @@ func (c *threadSafeMap) Resync() error { return nil } +// NewThreadSafeStore creates a new instance of ThreadSafeStore. func NewThreadSafeStore(indexers Indexers, indices Indices) ThreadSafeStore { return &threadSafeMap{ items: map[string]interface{}{}, diff --git a/vendor/k8s.io/client-go/tools/cache/undelta_store.go b/vendor/k8s.io/client-go/tools/cache/undelta_store.go index 117df46..220845d 100644 --- a/vendor/k8s.io/client-go/tools/cache/undelta_store.go +++ b/vendor/k8s.io/client-go/tools/cache/undelta_store.go @@ -31,6 +31,7 @@ type UndeltaStore struct { // Assert that it implements the Store interface. var _ Store = &UndeltaStore{} +// Add inserts an object into the store and sends complete state by calling PushFunc. // Note about thread safety. The Store implementation (cache.cache) uses a lock for all methods. // In the functions below, the lock gets released and reacquired betweend the {Add,Delete,etc} // and the List. So, the following can happen, resulting in two identical calls to PushFunc. @@ -41,7 +42,6 @@ var _ Store = &UndeltaStore{} // 3 Store.Add(b) // 4 Store.List() -> [a,b] // 5 Store.List() -> [a,b] - func (u *UndeltaStore) Add(obj interface{}) error { if err := u.Store.Add(obj); err != nil { return err @@ -50,6 +50,7 @@ func (u *UndeltaStore) Add(obj interface{}) error { return nil } +// Update sets an item in the cache to its updated state and sends complete state by calling PushFunc. func (u *UndeltaStore) Update(obj interface{}) error { if err := u.Store.Update(obj); err != nil { return err @@ -58,6 +59,7 @@ func (u *UndeltaStore) Update(obj interface{}) error { return nil } +// Delete removes an item from the cache and sends complete state by calling PushFunc. func (u *UndeltaStore) Delete(obj interface{}) error { if err := u.Store.Delete(obj); err != nil { return err @@ -66,6 +68,10 @@ func (u *UndeltaStore) Delete(obj interface{}) error { return nil } +// Replace will delete the contents of current store, using instead the given list. +// 'u' takes ownership of the list, you should not reference the list again +// after calling this function. +// The new contents complete state will be sent by calling PushFunc after replacement. func (u *UndeltaStore) Replace(list []interface{}, resourceVersion string) error { if err := u.Store.Replace(list, resourceVersion); err != nil { return err diff --git a/vendor/k8s.io/client-go/tools/clientcmd/api/types.go b/vendor/k8s.io/client-go/tools/clientcmd/api/types.go index 990a440..1f1209f 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/api/types.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/api/types.go @@ -31,10 +31,12 @@ import ( type Config struct { // Legacy field from pkg/api/types.go TypeMeta. // TODO(jlowdermilk): remove this after eliminating downstream dependencies. + // +k8s:conversion-gen=false // +optional Kind string `json:"kind,omitempty"` // Legacy field from pkg/api/types.go TypeMeta. // TODO(jlowdermilk): remove this after eliminating downstream dependencies. + // +k8s:conversion-gen=false // +optional APIVersion string `json:"apiVersion,omitempty"` // Preferences holds general information to be use for cli interactions @@ -64,6 +66,7 @@ type Preferences struct { // Cluster contains information about how to communicate with a kubernetes cluster type Cluster struct { // LocationOfOrigin indicates where this object came from. It is used for round tripping config post-merge, but never serialized. + // +k8s:conversion-gen=false LocationOfOrigin string // Server is the address of the kubernetes cluster (https://hostname:port). Server string `json:"server"` @@ -84,6 +87,7 @@ type Cluster struct { // AuthInfo contains information that describes identity information. This is use to tell the kubernetes cluster who you are. type AuthInfo struct { // LocationOfOrigin indicates where this object came from. It is used for round tripping config post-merge, but never serialized. + // +k8s:conversion-gen=false LocationOfOrigin string // ClientCertificate is the path to a client cert file for TLS. // +optional @@ -132,6 +136,7 @@ type AuthInfo struct { // Context is a tuple of references to a cluster (how do I communicate with a kubernetes cluster), a user (how do I identify myself), and a namespace (what subset of resources do I want to work with) type Context struct { // LocationOfOrigin indicates where this object came from. It is used for round tripping config post-merge, but never serialized. + // +k8s:conversion-gen=false LocationOfOrigin string // Cluster is the name of the cluster for this context Cluster string `json:"cluster"` diff --git a/vendor/k8s.io/client-go/tools/clientcmd/api/v1/conversion.go b/vendor/k8s.io/client-go/tools/clientcmd/api/v1/conversion.go index 2d7142e..c38ebc0 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/api/v1/conversion.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/api/v1/conversion.go @@ -25,220 +25,150 @@ import ( "k8s.io/client-go/tools/clientcmd/api" ) -func addConversionFuncs(scheme *runtime.Scheme) error { - return scheme.AddConversionFuncs( - func(in *Cluster, out *api.Cluster, s conversion.Scope) error { - return s.DefaultConvert(in, out, conversion.IgnoreMissingFields) - }, - func(in *api.Cluster, out *Cluster, s conversion.Scope) error { - return s.DefaultConvert(in, out, conversion.IgnoreMissingFields) - }, - func(in *Preferences, out *api.Preferences, s conversion.Scope) error { - return s.DefaultConvert(in, out, conversion.IgnoreMissingFields) - }, - func(in *api.Preferences, out *Preferences, s conversion.Scope) error { - return s.DefaultConvert(in, out, conversion.IgnoreMissingFields) - }, - func(in *AuthInfo, out *api.AuthInfo, s conversion.Scope) error { - return s.DefaultConvert(in, out, conversion.IgnoreMissingFields) - }, - func(in *api.AuthInfo, out *AuthInfo, s conversion.Scope) error { - return s.DefaultConvert(in, out, conversion.IgnoreMissingFields) - }, - func(in *Context, out *api.Context, s conversion.Scope) error { - return s.DefaultConvert(in, out, conversion.IgnoreMissingFields) - }, - func(in *api.Context, out *Context, s conversion.Scope) error { - return s.DefaultConvert(in, out, conversion.IgnoreMissingFields) - }, - - func(in *Config, out *api.Config, s conversion.Scope) error { - out.CurrentContext = in.CurrentContext - if err := s.Convert(&in.Preferences, &out.Preferences, 0); err != nil { - return err - } - - out.Clusters = make(map[string]*api.Cluster) - if err := s.Convert(&in.Clusters, &out.Clusters, 0); err != nil { - return err - } - out.AuthInfos = make(map[string]*api.AuthInfo) - if err := s.Convert(&in.AuthInfos, &out.AuthInfos, 0); err != nil { - return err - } - out.Contexts = make(map[string]*api.Context) - if err := s.Convert(&in.Contexts, &out.Contexts, 0); err != nil { - return err - } - out.Extensions = make(map[string]runtime.Object) - if err := s.Convert(&in.Extensions, &out.Extensions, 0); err != nil { - return err - } - return nil - }, - func(in *api.Config, out *Config, s conversion.Scope) error { - out.CurrentContext = in.CurrentContext - if err := s.Convert(&in.Preferences, &out.Preferences, 0); err != nil { - return err - } - - out.Clusters = make([]NamedCluster, 0, 0) - if err := s.Convert(&in.Clusters, &out.Clusters, 0); err != nil { - return err - } - out.AuthInfos = make([]NamedAuthInfo, 0, 0) - if err := s.Convert(&in.AuthInfos, &out.AuthInfos, 0); err != nil { - return err - } - out.Contexts = make([]NamedContext, 0, 0) - if err := s.Convert(&in.Contexts, &out.Contexts, 0); err != nil { - return err - } - out.Extensions = make([]NamedExtension, 0, 0) - if err := s.Convert(&in.Extensions, &out.Extensions, 0); err != nil { - return err - } - return nil - }, - func(in *[]NamedCluster, out *map[string]*api.Cluster, s conversion.Scope) error { - for _, curr := range *in { - newCluster := api.NewCluster() - if err := s.Convert(&curr.Cluster, newCluster, 0); err != nil { - return err - } - if (*out)[curr.Name] == nil { - (*out)[curr.Name] = newCluster - } else { - return fmt.Errorf("error converting *[]NamedCluster into *map[string]*api.Cluster: duplicate name \"%v\" in list: %v", curr.Name, *in) - } - } - - return nil - }, - func(in *map[string]*api.Cluster, out *[]NamedCluster, s conversion.Scope) error { - allKeys := make([]string, 0, len(*in)) - for key := range *in { - allKeys = append(allKeys, key) - } - sort.Strings(allKeys) - - for _, key := range allKeys { - newCluster := (*in)[key] - oldCluster := &Cluster{} - if err := s.Convert(newCluster, oldCluster, 0); err != nil { - return err - } - - namedCluster := NamedCluster{key, *oldCluster} - *out = append(*out, namedCluster) - } +func Convert_Slice_v1_NamedCluster_To_Map_string_To_Pointer_api_Cluster(in *[]NamedCluster, out *map[string]*api.Cluster, s conversion.Scope) error { + for _, curr := range *in { + newCluster := api.NewCluster() + if err := Convert_v1_Cluster_To_api_Cluster(&curr.Cluster, newCluster, s); err != nil { + return err + } + if *out == nil { + *out = make(map[string]*api.Cluster) + } + if (*out)[curr.Name] == nil { + (*out)[curr.Name] = newCluster + } else { + return fmt.Errorf("error converting *[]NamedCluster into *map[string]*api.Cluster: duplicate name \"%v\" in list: %v", curr.Name, *in) + } + } + return nil +} - return nil - }, - func(in *[]NamedAuthInfo, out *map[string]*api.AuthInfo, s conversion.Scope) error { - for _, curr := range *in { - newAuthInfo := api.NewAuthInfo() - if err := s.Convert(&curr.AuthInfo, newAuthInfo, 0); err != nil { - return err - } - if (*out)[curr.Name] == nil { - (*out)[curr.Name] = newAuthInfo - } else { - return fmt.Errorf("error converting *[]NamedAuthInfo into *map[string]*api.AuthInfo: duplicate name \"%v\" in list: %v", curr.Name, *in) - } - } +func Convert_Map_string_To_Pointer_api_Cluster_To_Slice_v1_NamedCluster(in *map[string]*api.Cluster, out *[]NamedCluster, s conversion.Scope) error { + allKeys := make([]string, 0, len(*in)) + for key := range *in { + allKeys = append(allKeys, key) + } + sort.Strings(allKeys) + + for _, key := range allKeys { + newCluster := (*in)[key] + oldCluster := Cluster{} + if err := Convert_api_Cluster_To_v1_Cluster(newCluster, &oldCluster, s); err != nil { + return err + } + namedCluster := NamedCluster{key, oldCluster} + *out = append(*out, namedCluster) + } + return nil +} - return nil - }, - func(in *map[string]*api.AuthInfo, out *[]NamedAuthInfo, s conversion.Scope) error { - allKeys := make([]string, 0, len(*in)) - for key := range *in { - allKeys = append(allKeys, key) - } - sort.Strings(allKeys) - - for _, key := range allKeys { - newAuthInfo := (*in)[key] - oldAuthInfo := &AuthInfo{} - if err := s.Convert(newAuthInfo, oldAuthInfo, 0); err != nil { - return err - } - - namedAuthInfo := NamedAuthInfo{key, *oldAuthInfo} - *out = append(*out, namedAuthInfo) - } +func Convert_Slice_v1_NamedAuthInfo_To_Map_string_To_Pointer_api_AuthInfo(in *[]NamedAuthInfo, out *map[string]*api.AuthInfo, s conversion.Scope) error { + for _, curr := range *in { + newAuthInfo := api.NewAuthInfo() + if err := Convert_v1_AuthInfo_To_api_AuthInfo(&curr.AuthInfo, newAuthInfo, s); err != nil { + return err + } + if *out == nil { + *out = make(map[string]*api.AuthInfo) + } + if (*out)[curr.Name] == nil { + (*out)[curr.Name] = newAuthInfo + } else { + return fmt.Errorf("error converting *[]NamedAuthInfo into *map[string]*api.AuthInfo: duplicate name \"%v\" in list: %v", curr.Name, *in) + } + } + return nil +} - return nil - }, - func(in *[]NamedContext, out *map[string]*api.Context, s conversion.Scope) error { - for _, curr := range *in { - newContext := api.NewContext() - if err := s.Convert(&curr.Context, newContext, 0); err != nil { - return err - } - if (*out)[curr.Name] == nil { - (*out)[curr.Name] = newContext - } else { - return fmt.Errorf("error converting *[]NamedContext into *map[string]*api.Context: duplicate name \"%v\" in list: %v", curr.Name, *in) - } - } +func Convert_Map_string_To_Pointer_api_AuthInfo_To_Slice_v1_NamedAuthInfo(in *map[string]*api.AuthInfo, out *[]NamedAuthInfo, s conversion.Scope) error { + allKeys := make([]string, 0, len(*in)) + for key := range *in { + allKeys = append(allKeys, key) + } + sort.Strings(allKeys) + + for _, key := range allKeys { + newAuthInfo := (*in)[key] + oldAuthInfo := AuthInfo{} + if err := Convert_api_AuthInfo_To_v1_AuthInfo(newAuthInfo, &oldAuthInfo, s); err != nil { + return err + } + namedAuthInfo := NamedAuthInfo{key, oldAuthInfo} + *out = append(*out, namedAuthInfo) + } + return nil +} - return nil - }, - func(in *map[string]*api.Context, out *[]NamedContext, s conversion.Scope) error { - allKeys := make([]string, 0, len(*in)) - for key := range *in { - allKeys = append(allKeys, key) - } - sort.Strings(allKeys) - - for _, key := range allKeys { - newContext := (*in)[key] - oldContext := &Context{} - if err := s.Convert(newContext, oldContext, 0); err != nil { - return err - } - - namedContext := NamedContext{key, *oldContext} - *out = append(*out, namedContext) - } +func Convert_Slice_v1_NamedContext_To_Map_string_To_Pointer_api_Context(in *[]NamedContext, out *map[string]*api.Context, s conversion.Scope) error { + for _, curr := range *in { + newContext := api.NewContext() + if err := Convert_v1_Context_To_api_Context(&curr.Context, newContext, s); err != nil { + return err + } + if *out == nil { + *out = make(map[string]*api.Context) + } + if (*out)[curr.Name] == nil { + (*out)[curr.Name] = newContext + } else { + return fmt.Errorf("error converting *[]NamedContext into *map[string]*api.Context: duplicate name \"%v\" in list: %v", curr.Name, *in) + } + } + return nil +} - return nil - }, - func(in *[]NamedExtension, out *map[string]runtime.Object, s conversion.Scope) error { - for _, curr := range *in { - var newExtension runtime.Object - if err := s.Convert(&curr.Extension, &newExtension, 0); err != nil { - return err - } - if (*out)[curr.Name] == nil { - (*out)[curr.Name] = newExtension - } else { - return fmt.Errorf("error converting *[]NamedExtension into *map[string]runtime.Object: duplicate name \"%v\" in list: %v", curr.Name, *in) - } - } +func Convert_Map_string_To_Pointer_api_Context_To_Slice_v1_NamedContext(in *map[string]*api.Context, out *[]NamedContext, s conversion.Scope) error { + allKeys := make([]string, 0, len(*in)) + for key := range *in { + allKeys = append(allKeys, key) + } + sort.Strings(allKeys) + + for _, key := range allKeys { + newContext := (*in)[key] + oldContext := Context{} + if err := Convert_api_Context_To_v1_Context(newContext, &oldContext, s); err != nil { + return err + } + namedContext := NamedContext{key, oldContext} + *out = append(*out, namedContext) + } + return nil +} - return nil - }, - func(in *map[string]runtime.Object, out *[]NamedExtension, s conversion.Scope) error { - allKeys := make([]string, 0, len(*in)) - for key := range *in { - allKeys = append(allKeys, key) - } - sort.Strings(allKeys) - - for _, key := range allKeys { - newExtension := (*in)[key] - oldExtension := &runtime.RawExtension{} - if err := s.Convert(newExtension, oldExtension, 0); err != nil { - return err - } - - namedExtension := NamedExtension{key, *oldExtension} - *out = append(*out, namedExtension) - } +func Convert_Slice_v1_NamedExtension_To_Map_string_To_runtime_Object(in *[]NamedExtension, out *map[string]runtime.Object, s conversion.Scope) error { + for _, curr := range *in { + var newExtension runtime.Object + if err := runtime.Convert_runtime_RawExtension_To_runtime_Object(&curr.Extension, &newExtension, s); err != nil { + return err + } + if *out == nil { + *out = make(map[string]runtime.Object) + } + if (*out)[curr.Name] == nil { + (*out)[curr.Name] = newExtension + } else { + return fmt.Errorf("error converting *[]NamedExtension into *map[string]runtime.Object: duplicate name \"%v\" in list: %v", curr.Name, *in) + } + } + return nil +} +func Convert_Map_string_To_runtime_Object_To_Slice_v1_NamedExtension(in *map[string]runtime.Object, out *[]NamedExtension, s conversion.Scope) error { + allKeys := make([]string, 0, len(*in)) + for key := range *in { + allKeys = append(allKeys, key) + } + sort.Strings(allKeys) + + for _, key := range allKeys { + newExtension := (*in)[key] + oldExtension := runtime.RawExtension{} + if err := runtime.Convert_runtime_Object_To_runtime_RawExtension(&newExtension, &oldExtension, s); err != nil { return nil - }, - ) + } + namedExtension := NamedExtension{key, oldExtension} + *out = append(*out, namedExtension) + } + return nil } diff --git a/vendor/k8s.io/client-go/tools/clientcmd/api/v1/doc.go b/vendor/k8s.io/client-go/tools/clientcmd/api/v1/doc.go index cbf29cc..ba5572a 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/api/v1/doc.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/api/v1/doc.go @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// +k8s:conversion-gen=k8s.io/client-go/tools/clientcmd/api // +k8s:deepcopy-gen=package package v1 diff --git a/vendor/k8s.io/client-go/tools/clientcmd/api/v1/register.go b/vendor/k8s.io/client-go/tools/clientcmd/api/v1/register.go index 7b91d50..24f6284 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/api/v1/register.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/api/v1/register.go @@ -37,7 +37,7 @@ func init() { // We only register manually written functions here. The registration of the // generated functions takes place in the generated files. The separation // makes the code compile even when the generated files are missing. - localSchemeBuilder.Register(addKnownTypes, addConversionFuncs) + localSchemeBuilder.Register(addKnownTypes) } func addKnownTypes(scheme *runtime.Scheme) error { diff --git a/vendor/k8s.io/client-go/tools/clientcmd/api/v1/types.go b/vendor/k8s.io/client-go/tools/clientcmd/api/v1/types.go index 56afb60..2159ffc 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/api/v1/types.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/api/v1/types.go @@ -28,10 +28,12 @@ import ( type Config struct { // Legacy field from pkg/api/types.go TypeMeta. // TODO(jlowdermilk): remove this after eliminating downstream dependencies. + // +k8s:conversion-gen=false // +optional Kind string `json:"kind,omitempty"` // Legacy field from pkg/api/types.go TypeMeta. // TODO(jlowdermilk): remove this after eliminating downstream dependencies. + // +k8s:conversion-gen=false // +optional APIVersion string `json:"apiVersion,omitempty"` // Preferences holds general information to be use for cli interactions diff --git a/vendor/k8s.io/client-go/tools/clientcmd/api/v1/zz_generated.conversion.go b/vendor/k8s.io/client-go/tools/clientcmd/api/v1/zz_generated.conversion.go new file mode 100644 index 0000000..31e00ea --- /dev/null +++ b/vendor/k8s.io/client-go/tools/clientcmd/api/v1/zz_generated.conversion.go @@ -0,0 +1,424 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by conversion-gen. DO NOT EDIT. + +package v1 + +import ( + unsafe "unsafe" + + conversion "k8s.io/apimachinery/pkg/conversion" + runtime "k8s.io/apimachinery/pkg/runtime" + api "k8s.io/client-go/tools/clientcmd/api" +) + +func init() { + localSchemeBuilder.Register(RegisterConversions) +} + +// RegisterConversions adds conversion functions to the given scheme. +// Public to allow building arbitrary schemes. +func RegisterConversions(s *runtime.Scheme) error { + if err := s.AddGeneratedConversionFunc((*AuthInfo)(nil), (*api.AuthInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_AuthInfo_To_api_AuthInfo(a.(*AuthInfo), b.(*api.AuthInfo), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*api.AuthInfo)(nil), (*AuthInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_api_AuthInfo_To_v1_AuthInfo(a.(*api.AuthInfo), b.(*AuthInfo), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AuthProviderConfig)(nil), (*api.AuthProviderConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_AuthProviderConfig_To_api_AuthProviderConfig(a.(*AuthProviderConfig), b.(*api.AuthProviderConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*api.AuthProviderConfig)(nil), (*AuthProviderConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_api_AuthProviderConfig_To_v1_AuthProviderConfig(a.(*api.AuthProviderConfig), b.(*AuthProviderConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Cluster)(nil), (*api.Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_Cluster_To_api_Cluster(a.(*Cluster), b.(*api.Cluster), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*api.Cluster)(nil), (*Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_api_Cluster_To_v1_Cluster(a.(*api.Cluster), b.(*Cluster), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Config)(nil), (*api.Config)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_Config_To_api_Config(a.(*Config), b.(*api.Config), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*api.Config)(nil), (*Config)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_api_Config_To_v1_Config(a.(*api.Config), b.(*Config), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Context)(nil), (*api.Context)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_Context_To_api_Context(a.(*Context), b.(*api.Context), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*api.Context)(nil), (*Context)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_api_Context_To_v1_Context(a.(*api.Context), b.(*Context), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ExecConfig)(nil), (*api.ExecConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_ExecConfig_To_api_ExecConfig(a.(*ExecConfig), b.(*api.ExecConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*api.ExecConfig)(nil), (*ExecConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_api_ExecConfig_To_v1_ExecConfig(a.(*api.ExecConfig), b.(*ExecConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ExecEnvVar)(nil), (*api.ExecEnvVar)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_ExecEnvVar_To_api_ExecEnvVar(a.(*ExecEnvVar), b.(*api.ExecEnvVar), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*api.ExecEnvVar)(nil), (*ExecEnvVar)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_api_ExecEnvVar_To_v1_ExecEnvVar(a.(*api.ExecEnvVar), b.(*ExecEnvVar), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Preferences)(nil), (*api.Preferences)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_Preferences_To_api_Preferences(a.(*Preferences), b.(*api.Preferences), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*api.Preferences)(nil), (*Preferences)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_api_Preferences_To_v1_Preferences(a.(*api.Preferences), b.(*Preferences), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*map[string]*api.AuthInfo)(nil), (*[]NamedAuthInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_Map_string_To_Pointer_api_AuthInfo_To_Slice_v1_NamedAuthInfo(a.(*map[string]*api.AuthInfo), b.(*[]NamedAuthInfo), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*map[string]*api.Cluster)(nil), (*[]NamedCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_Map_string_To_Pointer_api_Cluster_To_Slice_v1_NamedCluster(a.(*map[string]*api.Cluster), b.(*[]NamedCluster), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*map[string]*api.Context)(nil), (*[]NamedContext)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_Map_string_To_Pointer_api_Context_To_Slice_v1_NamedContext(a.(*map[string]*api.Context), b.(*[]NamedContext), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*map[string]runtime.Object)(nil), (*[]NamedExtension)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_Map_string_To_runtime_Object_To_Slice_v1_NamedExtension(a.(*map[string]runtime.Object), b.(*[]NamedExtension), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*[]NamedAuthInfo)(nil), (*map[string]*api.AuthInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_Slice_v1_NamedAuthInfo_To_Map_string_To_Pointer_api_AuthInfo(a.(*[]NamedAuthInfo), b.(*map[string]*api.AuthInfo), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*[]NamedCluster)(nil), (*map[string]*api.Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_Slice_v1_NamedCluster_To_Map_string_To_Pointer_api_Cluster(a.(*[]NamedCluster), b.(*map[string]*api.Cluster), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*[]NamedContext)(nil), (*map[string]*api.Context)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_Slice_v1_NamedContext_To_Map_string_To_Pointer_api_Context(a.(*[]NamedContext), b.(*map[string]*api.Context), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*[]NamedExtension)(nil), (*map[string]runtime.Object)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_Slice_v1_NamedExtension_To_Map_string_To_runtime_Object(a.(*[]NamedExtension), b.(*map[string]runtime.Object), scope) + }); err != nil { + return err + } + return nil +} + +func autoConvert_v1_AuthInfo_To_api_AuthInfo(in *AuthInfo, out *api.AuthInfo, s conversion.Scope) error { + out.ClientCertificate = in.ClientCertificate + out.ClientCertificateData = *(*[]byte)(unsafe.Pointer(&in.ClientCertificateData)) + out.ClientKey = in.ClientKey + out.ClientKeyData = *(*[]byte)(unsafe.Pointer(&in.ClientKeyData)) + out.Token = in.Token + out.TokenFile = in.TokenFile + out.Impersonate = in.Impersonate + out.ImpersonateGroups = *(*[]string)(unsafe.Pointer(&in.ImpersonateGroups)) + out.ImpersonateUserExtra = *(*map[string][]string)(unsafe.Pointer(&in.ImpersonateUserExtra)) + out.Username = in.Username + out.Password = in.Password + out.AuthProvider = (*api.AuthProviderConfig)(unsafe.Pointer(in.AuthProvider)) + out.Exec = (*api.ExecConfig)(unsafe.Pointer(in.Exec)) + if err := Convert_Slice_v1_NamedExtension_To_Map_string_To_runtime_Object(&in.Extensions, &out.Extensions, s); err != nil { + return err + } + return nil +} + +// Convert_v1_AuthInfo_To_api_AuthInfo is an autogenerated conversion function. +func Convert_v1_AuthInfo_To_api_AuthInfo(in *AuthInfo, out *api.AuthInfo, s conversion.Scope) error { + return autoConvert_v1_AuthInfo_To_api_AuthInfo(in, out, s) +} + +func autoConvert_api_AuthInfo_To_v1_AuthInfo(in *api.AuthInfo, out *AuthInfo, s conversion.Scope) error { + // INFO: in.LocationOfOrigin opted out of conversion generation + out.ClientCertificate = in.ClientCertificate + out.ClientCertificateData = *(*[]byte)(unsafe.Pointer(&in.ClientCertificateData)) + out.ClientKey = in.ClientKey + out.ClientKeyData = *(*[]byte)(unsafe.Pointer(&in.ClientKeyData)) + out.Token = in.Token + out.TokenFile = in.TokenFile + out.Impersonate = in.Impersonate + out.ImpersonateGroups = *(*[]string)(unsafe.Pointer(&in.ImpersonateGroups)) + out.ImpersonateUserExtra = *(*map[string][]string)(unsafe.Pointer(&in.ImpersonateUserExtra)) + out.Username = in.Username + out.Password = in.Password + out.AuthProvider = (*AuthProviderConfig)(unsafe.Pointer(in.AuthProvider)) + out.Exec = (*ExecConfig)(unsafe.Pointer(in.Exec)) + if err := Convert_Map_string_To_runtime_Object_To_Slice_v1_NamedExtension(&in.Extensions, &out.Extensions, s); err != nil { + return err + } + return nil +} + +// Convert_api_AuthInfo_To_v1_AuthInfo is an autogenerated conversion function. +func Convert_api_AuthInfo_To_v1_AuthInfo(in *api.AuthInfo, out *AuthInfo, s conversion.Scope) error { + return autoConvert_api_AuthInfo_To_v1_AuthInfo(in, out, s) +} + +func autoConvert_v1_AuthProviderConfig_To_api_AuthProviderConfig(in *AuthProviderConfig, out *api.AuthProviderConfig, s conversion.Scope) error { + out.Name = in.Name + out.Config = *(*map[string]string)(unsafe.Pointer(&in.Config)) + return nil +} + +// Convert_v1_AuthProviderConfig_To_api_AuthProviderConfig is an autogenerated conversion function. +func Convert_v1_AuthProviderConfig_To_api_AuthProviderConfig(in *AuthProviderConfig, out *api.AuthProviderConfig, s conversion.Scope) error { + return autoConvert_v1_AuthProviderConfig_To_api_AuthProviderConfig(in, out, s) +} + +func autoConvert_api_AuthProviderConfig_To_v1_AuthProviderConfig(in *api.AuthProviderConfig, out *AuthProviderConfig, s conversion.Scope) error { + out.Name = in.Name + out.Config = *(*map[string]string)(unsafe.Pointer(&in.Config)) + return nil +} + +// Convert_api_AuthProviderConfig_To_v1_AuthProviderConfig is an autogenerated conversion function. +func Convert_api_AuthProviderConfig_To_v1_AuthProviderConfig(in *api.AuthProviderConfig, out *AuthProviderConfig, s conversion.Scope) error { + return autoConvert_api_AuthProviderConfig_To_v1_AuthProviderConfig(in, out, s) +} + +func autoConvert_v1_Cluster_To_api_Cluster(in *Cluster, out *api.Cluster, s conversion.Scope) error { + out.Server = in.Server + out.InsecureSkipTLSVerify = in.InsecureSkipTLSVerify + out.CertificateAuthority = in.CertificateAuthority + out.CertificateAuthorityData = *(*[]byte)(unsafe.Pointer(&in.CertificateAuthorityData)) + if err := Convert_Slice_v1_NamedExtension_To_Map_string_To_runtime_Object(&in.Extensions, &out.Extensions, s); err != nil { + return err + } + return nil +} + +// Convert_v1_Cluster_To_api_Cluster is an autogenerated conversion function. +func Convert_v1_Cluster_To_api_Cluster(in *Cluster, out *api.Cluster, s conversion.Scope) error { + return autoConvert_v1_Cluster_To_api_Cluster(in, out, s) +} + +func autoConvert_api_Cluster_To_v1_Cluster(in *api.Cluster, out *Cluster, s conversion.Scope) error { + // INFO: in.LocationOfOrigin opted out of conversion generation + out.Server = in.Server + out.InsecureSkipTLSVerify = in.InsecureSkipTLSVerify + out.CertificateAuthority = in.CertificateAuthority + out.CertificateAuthorityData = *(*[]byte)(unsafe.Pointer(&in.CertificateAuthorityData)) + if err := Convert_Map_string_To_runtime_Object_To_Slice_v1_NamedExtension(&in.Extensions, &out.Extensions, s); err != nil { + return err + } + return nil +} + +// Convert_api_Cluster_To_v1_Cluster is an autogenerated conversion function. +func Convert_api_Cluster_To_v1_Cluster(in *api.Cluster, out *Cluster, s conversion.Scope) error { + return autoConvert_api_Cluster_To_v1_Cluster(in, out, s) +} + +func autoConvert_v1_Config_To_api_Config(in *Config, out *api.Config, s conversion.Scope) error { + // INFO: in.Kind opted out of conversion generation + // INFO: in.APIVersion opted out of conversion generation + if err := Convert_v1_Preferences_To_api_Preferences(&in.Preferences, &out.Preferences, s); err != nil { + return err + } + if err := Convert_Slice_v1_NamedCluster_To_Map_string_To_Pointer_api_Cluster(&in.Clusters, &out.Clusters, s); err != nil { + return err + } + if err := Convert_Slice_v1_NamedAuthInfo_To_Map_string_To_Pointer_api_AuthInfo(&in.AuthInfos, &out.AuthInfos, s); err != nil { + return err + } + if err := Convert_Slice_v1_NamedContext_To_Map_string_To_Pointer_api_Context(&in.Contexts, &out.Contexts, s); err != nil { + return err + } + out.CurrentContext = in.CurrentContext + if err := Convert_Slice_v1_NamedExtension_To_Map_string_To_runtime_Object(&in.Extensions, &out.Extensions, s); err != nil { + return err + } + return nil +} + +// Convert_v1_Config_To_api_Config is an autogenerated conversion function. +func Convert_v1_Config_To_api_Config(in *Config, out *api.Config, s conversion.Scope) error { + return autoConvert_v1_Config_To_api_Config(in, out, s) +} + +func autoConvert_api_Config_To_v1_Config(in *api.Config, out *Config, s conversion.Scope) error { + // INFO: in.Kind opted out of conversion generation + // INFO: in.APIVersion opted out of conversion generation + if err := Convert_api_Preferences_To_v1_Preferences(&in.Preferences, &out.Preferences, s); err != nil { + return err + } + if err := Convert_Map_string_To_Pointer_api_Cluster_To_Slice_v1_NamedCluster(&in.Clusters, &out.Clusters, s); err != nil { + return err + } + if err := Convert_Map_string_To_Pointer_api_AuthInfo_To_Slice_v1_NamedAuthInfo(&in.AuthInfos, &out.AuthInfos, s); err != nil { + return err + } + if err := Convert_Map_string_To_Pointer_api_Context_To_Slice_v1_NamedContext(&in.Contexts, &out.Contexts, s); err != nil { + return err + } + out.CurrentContext = in.CurrentContext + if err := Convert_Map_string_To_runtime_Object_To_Slice_v1_NamedExtension(&in.Extensions, &out.Extensions, s); err != nil { + return err + } + return nil +} + +// Convert_api_Config_To_v1_Config is an autogenerated conversion function. +func Convert_api_Config_To_v1_Config(in *api.Config, out *Config, s conversion.Scope) error { + return autoConvert_api_Config_To_v1_Config(in, out, s) +} + +func autoConvert_v1_Context_To_api_Context(in *Context, out *api.Context, s conversion.Scope) error { + out.Cluster = in.Cluster + out.AuthInfo = in.AuthInfo + out.Namespace = in.Namespace + if err := Convert_Slice_v1_NamedExtension_To_Map_string_To_runtime_Object(&in.Extensions, &out.Extensions, s); err != nil { + return err + } + return nil +} + +// Convert_v1_Context_To_api_Context is an autogenerated conversion function. +func Convert_v1_Context_To_api_Context(in *Context, out *api.Context, s conversion.Scope) error { + return autoConvert_v1_Context_To_api_Context(in, out, s) +} + +func autoConvert_api_Context_To_v1_Context(in *api.Context, out *Context, s conversion.Scope) error { + // INFO: in.LocationOfOrigin opted out of conversion generation + out.Cluster = in.Cluster + out.AuthInfo = in.AuthInfo + out.Namespace = in.Namespace + if err := Convert_Map_string_To_runtime_Object_To_Slice_v1_NamedExtension(&in.Extensions, &out.Extensions, s); err != nil { + return err + } + return nil +} + +// Convert_api_Context_To_v1_Context is an autogenerated conversion function. +func Convert_api_Context_To_v1_Context(in *api.Context, out *Context, s conversion.Scope) error { + return autoConvert_api_Context_To_v1_Context(in, out, s) +} + +func autoConvert_v1_ExecConfig_To_api_ExecConfig(in *ExecConfig, out *api.ExecConfig, s conversion.Scope) error { + out.Command = in.Command + out.Args = *(*[]string)(unsafe.Pointer(&in.Args)) + out.Env = *(*[]api.ExecEnvVar)(unsafe.Pointer(&in.Env)) + out.APIVersion = in.APIVersion + return nil +} + +// Convert_v1_ExecConfig_To_api_ExecConfig is an autogenerated conversion function. +func Convert_v1_ExecConfig_To_api_ExecConfig(in *ExecConfig, out *api.ExecConfig, s conversion.Scope) error { + return autoConvert_v1_ExecConfig_To_api_ExecConfig(in, out, s) +} + +func autoConvert_api_ExecConfig_To_v1_ExecConfig(in *api.ExecConfig, out *ExecConfig, s conversion.Scope) error { + out.Command = in.Command + out.Args = *(*[]string)(unsafe.Pointer(&in.Args)) + out.Env = *(*[]ExecEnvVar)(unsafe.Pointer(&in.Env)) + out.APIVersion = in.APIVersion + return nil +} + +// Convert_api_ExecConfig_To_v1_ExecConfig is an autogenerated conversion function. +func Convert_api_ExecConfig_To_v1_ExecConfig(in *api.ExecConfig, out *ExecConfig, s conversion.Scope) error { + return autoConvert_api_ExecConfig_To_v1_ExecConfig(in, out, s) +} + +func autoConvert_v1_ExecEnvVar_To_api_ExecEnvVar(in *ExecEnvVar, out *api.ExecEnvVar, s conversion.Scope) error { + out.Name = in.Name + out.Value = in.Value + return nil +} + +// Convert_v1_ExecEnvVar_To_api_ExecEnvVar is an autogenerated conversion function. +func Convert_v1_ExecEnvVar_To_api_ExecEnvVar(in *ExecEnvVar, out *api.ExecEnvVar, s conversion.Scope) error { + return autoConvert_v1_ExecEnvVar_To_api_ExecEnvVar(in, out, s) +} + +func autoConvert_api_ExecEnvVar_To_v1_ExecEnvVar(in *api.ExecEnvVar, out *ExecEnvVar, s conversion.Scope) error { + out.Name = in.Name + out.Value = in.Value + return nil +} + +// Convert_api_ExecEnvVar_To_v1_ExecEnvVar is an autogenerated conversion function. +func Convert_api_ExecEnvVar_To_v1_ExecEnvVar(in *api.ExecEnvVar, out *ExecEnvVar, s conversion.Scope) error { + return autoConvert_api_ExecEnvVar_To_v1_ExecEnvVar(in, out, s) +} + +func autoConvert_v1_Preferences_To_api_Preferences(in *Preferences, out *api.Preferences, s conversion.Scope) error { + out.Colors = in.Colors + if err := Convert_Slice_v1_NamedExtension_To_Map_string_To_runtime_Object(&in.Extensions, &out.Extensions, s); err != nil { + return err + } + return nil +} + +// Convert_v1_Preferences_To_api_Preferences is an autogenerated conversion function. +func Convert_v1_Preferences_To_api_Preferences(in *Preferences, out *api.Preferences, s conversion.Scope) error { + return autoConvert_v1_Preferences_To_api_Preferences(in, out, s) +} + +func autoConvert_api_Preferences_To_v1_Preferences(in *api.Preferences, out *Preferences, s conversion.Scope) error { + out.Colors = in.Colors + if err := Convert_Map_string_To_runtime_Object_To_Slice_v1_NamedExtension(&in.Extensions, &out.Extensions, s); err != nil { + return err + } + return nil +} + +// Convert_api_Preferences_To_v1_Preferences is an autogenerated conversion function. +func Convert_api_Preferences_To_v1_Preferences(in *api.Preferences, out *Preferences, s conversion.Scope) error { + return autoConvert_api_Preferences_To_v1_Preferences(in, out, s) +} diff --git a/vendor/k8s.io/client-go/tools/clientcmd/client_config.go b/vendor/k8s.io/client-go/tools/clientcmd/client_config.go index 9c6ac3b..4411513 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/client_config.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/client_config.go @@ -449,13 +449,15 @@ func (config *DirectClientConfig) getCluster() (clientcmdapi.Cluster, error) { return clientcmdapi.Cluster{}, fmt.Errorf("cluster %q does not exist", clusterInfoName) } mergo.MergeWithOverwrite(mergedClusterInfo, config.overrides.ClusterInfo) - // An override of --insecure-skip-tls-verify=true and no accompanying CA/CA data should clear already-set CA/CA data - // otherwise, a kubeconfig containing a CA reference would return an error that "CA and insecure-skip-tls-verify couldn't both be set" + // * An override of --insecure-skip-tls-verify=true and no accompanying CA/CA data should clear already-set CA/CA data + // otherwise, a kubeconfig containing a CA reference would return an error that "CA and insecure-skip-tls-verify couldn't both be set". + // * An override of --certificate-authority should also override TLS skip settings and CA data, otherwise existing CA data will take precedence. caLen := len(config.overrides.ClusterInfo.CertificateAuthority) caDataLen := len(config.overrides.ClusterInfo.CertificateAuthorityData) - if config.overrides.ClusterInfo.InsecureSkipTLSVerify && caLen == 0 && caDataLen == 0 { - mergedClusterInfo.CertificateAuthority = "" - mergedClusterInfo.CertificateAuthorityData = nil + if config.overrides.ClusterInfo.InsecureSkipTLSVerify || caLen > 0 || caDataLen > 0 { + mergedClusterInfo.InsecureSkipTLSVerify = config.overrides.ClusterInfo.InsecureSkipTLSVerify + mergedClusterInfo.CertificateAuthority = config.overrides.ClusterInfo.CertificateAuthority + mergedClusterInfo.CertificateAuthorityData = config.overrides.ClusterInfo.CertificateAuthorityData } return *mergedClusterInfo, nil diff --git a/vendor/k8s.io/client-go/tools/clientcmd/loader.go b/vendor/k8s.io/client-go/tools/clientcmd/loader.go index e00ea38..4e37e79 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/loader.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/loader.go @@ -127,6 +127,10 @@ type ClientConfigLoadingRules struct { // DefaultClientConfig is an optional field indicating what rules to use to calculate a default configuration. // This should match the overrides passed in to ClientConfig loader. DefaultClientConfig ClientConfig + + // WarnIfAllMissing indicates whether the configuration files pointed by KUBECONFIG environment variable are present or not. + // In case of missing files, it warns the user about the missing files. + WarnIfAllMissing bool } // ClientConfigLoadingRules implements the ClientConfigLoader interface. @@ -136,20 +140,23 @@ var _ ClientConfigLoader = &ClientConfigLoadingRules{} // use this constructor func NewDefaultClientConfigLoadingRules() *ClientConfigLoadingRules { chain := []string{} + warnIfAllMissing := false envVarFiles := os.Getenv(RecommendedConfigPathEnvVar) if len(envVarFiles) != 0 { fileList := filepath.SplitList(envVarFiles) // prevent the same path load multiple times chain = append(chain, deduplicate(fileList)...) + warnIfAllMissing = true } else { chain = append(chain, RecommendedHomeFile) } return &ClientConfigLoadingRules{ - Precedence: chain, - MigrationRules: currentMigrationRules(), + Precedence: chain, + MigrationRules: currentMigrationRules(), + WarnIfAllMissing: warnIfAllMissing, } } @@ -172,6 +179,7 @@ func (rules *ClientConfigLoadingRules) Load() (*clientcmdapi.Config, error) { } errlist := []error{} + missingList := []string{} kubeConfigFiles := []string{} @@ -195,18 +203,26 @@ func (rules *ClientConfigLoadingRules) Load() (*clientcmdapi.Config, error) { } config, err := LoadFromFile(filename) + if os.IsNotExist(err) { // skip missing files + // Add to the missing list to produce a warning + missingList = append(missingList, filename) continue } + if err != nil { - errlist = append(errlist, fmt.Errorf("Error loading config file \"%s\": %v", filename, err)) + errlist = append(errlist, fmt.Errorf("error loading config file \"%s\": %v", filename, err)) continue } kubeconfigs = append(kubeconfigs, config) } + if rules.WarnIfAllMissing && len(missingList) > 0 && len(kubeconfigs) == 0 { + klog.Warningf("Config not found: %s", strings.Join(missingList, ", ")) + } + // first merge all of our maps mapConfig := clientcmdapi.NewConfig() @@ -467,7 +483,7 @@ func ResolveLocalPaths(config *clientcmdapi.Config) error { } base, err := filepath.Abs(filepath.Dir(cluster.LocationOfOrigin)) if err != nil { - return fmt.Errorf("Could not determine the absolute path of config file %s: %v", cluster.LocationOfOrigin, err) + return fmt.Errorf("could not determine the absolute path of config file %s: %v", cluster.LocationOfOrigin, err) } if err := ResolvePaths(GetClusterFileReferences(cluster), base); err != nil { @@ -480,7 +496,7 @@ func ResolveLocalPaths(config *clientcmdapi.Config) error { } base, err := filepath.Abs(filepath.Dir(authInfo.LocationOfOrigin)) if err != nil { - return fmt.Errorf("Could not determine the absolute path of config file %s: %v", authInfo.LocationOfOrigin, err) + return fmt.Errorf("could not determine the absolute path of config file %s: %v", authInfo.LocationOfOrigin, err) } if err := ResolvePaths(GetAuthInfoFileReferences(authInfo), base); err != nil { diff --git a/vendor/k8s.io/client-go/tools/clientcmd/validation.go b/vendor/k8s.io/client-go/tools/clientcmd/validation.go index 629c0b3..2f92707 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/validation.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/validation.go @@ -185,9 +185,10 @@ func validateClusterInfo(clusterName string, clusterInfo clientcmdapi.Cluster) [ } if len(clusterInfo.CertificateAuthority) != 0 { clientCertCA, err := os.Open(clusterInfo.CertificateAuthority) - defer clientCertCA.Close() if err != nil { validationErrors = append(validationErrors, fmt.Errorf("unable to read certificate-authority %v for %v due to %v", clusterInfo.CertificateAuthority, clusterName, err)) + } else { + defer clientCertCA.Close() } } @@ -223,16 +224,18 @@ func validateAuthInfo(authInfoName string, authInfo clientcmdapi.AuthInfo) []err if len(authInfo.ClientCertificate) != 0 { clientCertFile, err := os.Open(authInfo.ClientCertificate) - defer clientCertFile.Close() if err != nil { validationErrors = append(validationErrors, fmt.Errorf("unable to read client-cert %v for %v due to %v", authInfo.ClientCertificate, authInfoName, err)) + } else { + defer clientCertFile.Close() } } if len(authInfo.ClientKey) != 0 { clientKeyFile, err := os.Open(authInfo.ClientKey) - defer clientKeyFile.Close() if err != nil { validationErrors = append(validationErrors, fmt.Errorf("unable to read client-key %v for %v due to %v", authInfo.ClientKey, authInfoName, err)) + } else { + defer clientKeyFile.Close() } } } @@ -250,8 +253,6 @@ func validateAuthInfo(authInfoName string, authInfo clientcmdapi.AuthInfo) []err for _, v := range authInfo.Exec.Env { if len(v.Name) == 0 { validationErrors = append(validationErrors, fmt.Errorf("env variable name must be specified for %v to use exec authentication plugin", authInfoName)) - } else if len(v.Value) == 0 { - validationErrors = append(validationErrors, fmt.Errorf("env variable %s value must be specified for %v to use exec authentication plugin", v.Name, authInfoName)) } } } diff --git a/vendor/k8s.io/client-go/tools/metrics/OWNERS b/vendor/k8s.io/client-go/tools/metrics/OWNERS deleted file mode 100644 index f150be5..0000000 --- a/vendor/k8s.io/client-go/tools/metrics/OWNERS +++ /dev/null @@ -1,9 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: -- wojtek-t -- eparis -- krousey -- jayunit100 -- fgrzadkowski -- tmrts diff --git a/vendor/k8s.io/client-go/tools/pager/pager.go b/vendor/k8s.io/client-go/tools/pager/pager.go index d265db7..307808b 100644 --- a/vendor/k8s.io/client-go/tools/pager/pager.go +++ b/vendor/k8s.io/client-go/tools/pager/pager.go @@ -77,6 +77,7 @@ func (p *ListPager) List(ctx context.Context, options metav1.ListOptions) (runti if options.Limit == 0 { options.Limit = p.PageSize } + requestedResourceVersion := options.ResourceVersion var list *metainternalversion.List for { select { @@ -87,12 +88,18 @@ func (p *ListPager) List(ctx context.Context, options metav1.ListOptions) (runti obj, err := p.PageFn(ctx, options) if err != nil { - if !errors.IsResourceExpired(err) || !p.FullListIfExpired { + // Only fallback to full list if an "Expired" errors is returned, FullListIfExpired is true, and + // the "Expired" error occurred in page 2 or later (since full list is intended to prevent a pager.List from + // failing when the resource versions is established by the first page request falls out of the compaction + // during the subsequent list requests). + if !errors.IsResourceExpired(err) || !p.FullListIfExpired || options.Continue == "" { return nil, err } - // the list expired while we were processing, fall back to a full list + // the list expired while we were processing, fall back to a full list at + // the requested ResourceVersion. options.Limit = 0 options.Continue = "" + options.ResourceVersion = requestedResourceVersion return p.PageFn(ctx, options) } m, err := meta.ListAccessor(obj) @@ -125,6 +132,10 @@ func (p *ListPager) List(ctx context.Context, options metav1.ListOptions) (runti // set the next loop up options.Continue = m.GetContinue() + // Clear the ResourceVersion on the subsequent List calls to avoid the + // `specifying resource version is not allowed when using continue` error. + // See https://github.com/kubernetes/kubernetes/issues/85221#issuecomment-553748143. + options.ResourceVersion = "" } } diff --git a/vendor/k8s.io/client-go/tools/record/OWNERS b/vendor/k8s.io/client-go/tools/record/OWNERS deleted file mode 100644 index 6ce73bb..0000000 --- a/vendor/k8s.io/client-go/tools/record/OWNERS +++ /dev/null @@ -1,29 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: -- lavalamp -- smarterclayton -- wojtek-t -- deads2k -- derekwaynecarr -- caesarxuchao -- vishh -- mikedanese -- liggitt -- nikhiljindal -- erictune -- pmorie -- dchen1107 -- saad-ali -- luxas -- yifan-gu -- eparis -- mwielgus -- timothysc -- jsafrane -- dims -- krousey -- a-robinson -- aveshagarwal -- resouer -- cjcullen diff --git a/vendor/k8s.io/client-go/tools/record/doc.go b/vendor/k8s.io/client-go/tools/record/doc.go index 657ddec..33d5fe7 100644 --- a/vendor/k8s.io/client-go/tools/record/doc.go +++ b/vendor/k8s.io/client-go/tools/record/doc.go @@ -14,5 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package record has all client logic for recording and reporting events. +// Package record has all client logic for recording and reporting +// "k8s.io/api/core/v1".Event events. package record // import "k8s.io/client-go/tools/record" diff --git a/vendor/k8s.io/client-go/tools/record/event.go b/vendor/k8s.io/client-go/tools/record/event.go index 65e48c0..66f8bd6 100644 --- a/vendor/k8s.io/client-go/tools/record/event.go +++ b/vendor/k8s.io/client-go/tools/record/event.go @@ -127,6 +127,28 @@ type EventBroadcaster interface { // NewRecorder returns an EventRecorder that can be used to send events to this EventBroadcaster // with the event source set to the given event source. NewRecorder(scheme *runtime.Scheme, source v1.EventSource) EventRecorder + + // Shutdown shuts down the broadcaster + Shutdown() +} + +// EventRecorderAdapter is a wrapper around a "k8s.io/client-go/tools/record".EventRecorder +// implementing the new "k8s.io/client-go/tools/events".EventRecorder interface. +type EventRecorderAdapter struct { + recorder EventRecorder +} + +// NewEventRecorderAdapter returns an adapter implementing the new +// "k8s.io/client-go/tools/events".EventRecorder interface. +func NewEventRecorderAdapter(recorder EventRecorder) *EventRecorderAdapter { + return &EventRecorderAdapter{ + recorder: recorder, + } +} + +// Eventf is a wrapper around v1 Eventf +func (a *EventRecorderAdapter) Eventf(regarding, _ runtime.Object, eventtype, reason, action, note string, args ...interface{}) { + a.recorder.Eventf(regarding, eventtype, reason, note, args...) } // Creates a new event broadcaster. @@ -161,18 +183,19 @@ type eventBroadcasterImpl struct { // StartRecordingToSink starts sending events received from the specified eventBroadcaster to the given sink. // The return value can be ignored or used to stop recording, if desired. // TODO: make me an object with parameterizable queue length and retry interval -func (eventBroadcaster *eventBroadcasterImpl) StartRecordingToSink(sink EventSink) watch.Interface { - // The default math/rand package functions aren't thread safe, so create a - // new Rand object for each StartRecording call. - randGen := rand.New(rand.NewSource(time.Now().UnixNano())) - eventCorrelator := NewEventCorrelatorWithOptions(eventBroadcaster.options) - return eventBroadcaster.StartEventWatcher( +func (e *eventBroadcasterImpl) StartRecordingToSink(sink EventSink) watch.Interface { + eventCorrelator := NewEventCorrelatorWithOptions(e.options) + return e.StartEventWatcher( func(event *v1.Event) { - recordToSink(sink, event, eventCorrelator, randGen, eventBroadcaster.sleepDuration) + recordToSink(sink, event, eventCorrelator, e.sleepDuration) }) } -func recordToSink(sink EventSink, event *v1.Event, eventCorrelator *EventCorrelator, randGen *rand.Rand, sleepDuration time.Duration) { +func (e *eventBroadcasterImpl) Shutdown() { + e.Broadcaster.Shutdown() +} + +func recordToSink(sink EventSink, event *v1.Event, eventCorrelator *EventCorrelator, sleepDuration time.Duration) { // Make a copy before modification, because there could be multiple listeners. // Events are safe to copy like this. eventCopy := *event @@ -197,7 +220,7 @@ func recordToSink(sink EventSink, event *v1.Event, eventCorrelator *EventCorrela // Randomize the first sleep so that various clients won't all be // synced up if the master goes down. if tries == 1 { - time.Sleep(time.Duration(float64(sleepDuration) * randGen.Float64())) + time.Sleep(time.Duration(float64(sleepDuration) * rand.Float64())) } else { time.Sleep(sleepDuration) } @@ -252,8 +275,8 @@ func recordEvent(sink EventSink, event *v1.Event, patch []byte, updateExistingEv // StartLogging starts sending events received from this EventBroadcaster to the given logging function. // The return value can be ignored or used to stop recording, if desired. -func (eventBroadcaster *eventBroadcasterImpl) StartLogging(logf func(format string, args ...interface{})) watch.Interface { - return eventBroadcaster.StartEventWatcher( +func (e *eventBroadcasterImpl) StartLogging(logf func(format string, args ...interface{})) watch.Interface { + return e.StartEventWatcher( func(e *v1.Event) { logf("Event(%#v): type: '%v' reason: '%v' %v", e.InvolvedObject, e.Type, e.Reason, e.Message) }) @@ -261,8 +284,8 @@ func (eventBroadcaster *eventBroadcasterImpl) StartLogging(logf func(format stri // StartEventWatcher starts sending events received from this EventBroadcaster to the given event handler function. // The return value can be ignored or used to stop recording, if desired. -func (eventBroadcaster *eventBroadcasterImpl) StartEventWatcher(eventHandler func(*v1.Event)) watch.Interface { - watcher := eventBroadcaster.Watch() +func (e *eventBroadcasterImpl) StartEventWatcher(eventHandler func(*v1.Event)) watch.Interface { + watcher := e.Watch() go func() { defer utilruntime.HandleCrash() for watchEvent := range watcher.ResultChan() { @@ -279,8 +302,8 @@ func (eventBroadcaster *eventBroadcasterImpl) StartEventWatcher(eventHandler fun } // NewRecorder returns an EventRecorder that records events with the given event source. -func (eventBroadcaster *eventBroadcasterImpl) NewRecorder(scheme *runtime.Scheme, source v1.EventSource) EventRecorder { - return &recorderImpl{scheme, source, eventBroadcaster.Broadcaster, clock.RealClock{}} +func (e *eventBroadcasterImpl) NewRecorder(scheme *runtime.Scheme, source v1.EventSource) EventRecorder { + return &recorderImpl{scheme, source, e.Broadcaster, clock.RealClock{}} } type recorderImpl struct { diff --git a/vendor/k8s.io/client-go/tools/reference/ref.go b/vendor/k8s.io/client-go/tools/reference/ref.go index 573d948..442a991 100644 --- a/vendor/k8s.io/client-go/tools/reference/ref.go +++ b/vendor/k8s.io/client-go/tools/reference/ref.go @@ -19,8 +19,6 @@ package reference import ( "errors" "fmt" - "net/url" - "strings" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/meta" @@ -30,8 +28,7 @@ import ( var ( // Errors that could be returned by GetReference. - ErrNilObject = errors.New("can't reference a nil object") - ErrNoSelfLink = errors.New("selfLink was empty, can't make reference") + ErrNilObject = errors.New("can't reference a nil object") ) // GetReference returns an ObjectReference which refers to the given @@ -47,20 +44,6 @@ func GetReference(scheme *runtime.Scheme, obj runtime.Object) (*v1.ObjectReferen return ref, nil } - gvk := obj.GetObjectKind().GroupVersionKind() - - // if the object referenced is actually persisted, we can just get kind from meta - // if we are building an object reference to something not yet persisted, we should fallback to scheme - kind := gvk.Kind - if len(kind) == 0 { - // TODO: this is wrong - gvks, _, err := scheme.ObjectKinds(obj) - if err != nil { - return nil, err - } - kind = gvks[0].Kind - } - // An object that implements only List has enough metadata to build a reference var listMeta metav1.Common objectMeta, err := meta.Accessor(obj) @@ -73,29 +56,29 @@ func GetReference(scheme *runtime.Scheme, obj runtime.Object) (*v1.ObjectReferen listMeta = objectMeta } - // if the object referenced is actually persisted, we can also get version from meta - version := gvk.GroupVersion().String() - if len(version) == 0 { - selfLink := listMeta.GetSelfLink() - if len(selfLink) == 0 { - return nil, ErrNoSelfLink - } - selfLinkUrl, err := url.Parse(selfLink) + gvk := obj.GetObjectKind().GroupVersionKind() + + // If object meta doesn't contain data about kind and/or version, + // we are falling back to scheme. + // + // TODO: This doesn't work for CRDs, which are not registered in scheme. + if gvk.Empty() { + gvks, _, err := scheme.ObjectKinds(obj) if err != nil { return nil, err } - // example paths: ///* - parts := strings.Split(selfLinkUrl.Path, "/") - if len(parts) < 4 { - return nil, fmt.Errorf("unexpected self link format: '%v'; got version '%v'", selfLink, version) - } - if parts[1] == "api" { - version = parts[2] - } else { - version = parts[2] + "/" + parts[3] + if len(gvks) == 0 || gvks[0].Empty() { + return nil, fmt.Errorf("unexpected gvks registered for object %T: %v", obj, gvks) } + // TODO: The same object can be registered for multiple group versions + // (although in practise this doesn't seem to be used). + // In such case, the version set may not be correct. + gvk = gvks[0] } + kind := gvk.Kind + version := gvk.GroupVersion().String() + // only has list metadata if objectMeta == nil { return &v1.ObjectReference{ diff --git a/vendor/k8s.io/client-go/transport/OWNERS b/vendor/k8s.io/client-go/transport/OWNERS deleted file mode 100644 index a521769..0000000 --- a/vendor/k8s.io/client-go/transport/OWNERS +++ /dev/null @@ -1,9 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: -- smarterclayton -- wojtek-t -- deads2k -- liggitt -- krousey -- caesarxuchao diff --git a/vendor/k8s.io/client-go/transport/cache.go b/vendor/k8s.io/client-go/transport/cache.go index 7cffe2a..980d36a 100644 --- a/vendor/k8s.io/client-go/transport/cache.go +++ b/vendor/k8s.io/client-go/transport/cache.go @@ -20,6 +20,7 @@ import ( "fmt" "net" "net/http" + "strings" "sync" "time" @@ -39,13 +40,15 @@ const idleConnsPerHost = 25 var tlsCache = &tlsTransportCache{transports: make(map[tlsCacheKey]*http.Transport)} type tlsCacheKey struct { - insecure bool - caData string - certData string - keyData string - getCert string - serverName string - dial string + insecure bool + caData string + certData string + keyData string + getCert string + serverName string + nextProtos string + dial string + disableCompression bool } func (t tlsCacheKey) String() string { @@ -53,7 +56,7 @@ func (t tlsCacheKey) String() string { if len(t.keyData) > 0 { keyText = "" } - return fmt.Sprintf("insecure:%v, caData:%#v, certData:%#v, keyData:%s, getCert: %s, serverName:%s, dial:%s", t.insecure, t.caData, t.certData, keyText, t.getCert, t.serverName, t.dial) + return fmt.Sprintf("insecure:%v, caData:%#v, certData:%#v, keyData:%s, getCert: %s, serverName:%s, dial:%s disableCompression:%t", t.insecure, t.caData, t.certData, keyText, t.getCert, t.serverName, t.dial, t.disableCompression) } func (c *tlsTransportCache) get(config *Config) (http.RoundTripper, error) { @@ -95,6 +98,7 @@ func (c *tlsTransportCache) get(config *Config) (http.RoundTripper, error) { TLSClientConfig: tlsConfig, MaxIdleConnsPerHost: idleConnsPerHost, DialContext: dial, + DisableCompression: config.DisableCompression, }) return c.transports[key], nil } @@ -106,12 +110,14 @@ func tlsConfigKey(c *Config) (tlsCacheKey, error) { return tlsCacheKey{}, err } return tlsCacheKey{ - insecure: c.TLS.Insecure, - caData: string(c.TLS.CAData), - certData: string(c.TLS.CertData), - keyData: string(c.TLS.KeyData), - getCert: fmt.Sprintf("%p", c.TLS.GetCert), - serverName: c.TLS.ServerName, - dial: fmt.Sprintf("%p", c.Dial), + insecure: c.TLS.Insecure, + caData: string(c.TLS.CAData), + certData: string(c.TLS.CertData), + keyData: string(c.TLS.KeyData), + getCert: fmt.Sprintf("%p", c.TLS.GetCert), + serverName: c.TLS.ServerName, + nextProtos: strings.Join(c.TLS.NextProtos, ","), + dial: fmt.Sprintf("%p", c.Dial), + disableCompression: c.DisableCompression, }, nil } diff --git a/vendor/k8s.io/client-go/transport/config.go b/vendor/k8s.io/client-go/transport/config.go index 5de0a2c..9e18d11 100644 --- a/vendor/k8s.io/client-go/transport/config.go +++ b/vendor/k8s.io/client-go/transport/config.go @@ -47,6 +47,10 @@ type Config struct { // Impersonate is the config that this Config will impersonate using Impersonate ImpersonationConfig + // DisableCompression bypasses automatic GZip compression requests to the + // server. + DisableCompression bool + // Transport may be used for custom HTTP behavior. This attribute may // not be specified with the TLS client certificate options. Use // WrapTransport for most client level operations. @@ -122,5 +126,11 @@ type TLSConfig struct { CertData []byte // Bytes of the PEM-encoded client certificate. Supercedes CertFile. KeyData []byte // Bytes of the PEM-encoded client key. Supercedes KeyFile. + // NextProtos is a list of supported application level protocols, in order of preference. + // Used to populate tls.Config.NextProtos. + // To indicate to the server http/1.1 is preferred over http/2, set to ["http/1.1", "h2"] (though the server is free to ignore that preference). + // To use only http/1.1, set to ["http/1.1"]. + NextProtos []string + GetCert func() (*tls.Certificate, error) // Callback that returns a TLS client certificate. CertData, CertFile, KeyData and KeyFile supercede this field. } diff --git a/vendor/k8s.io/client-go/transport/round_trippers.go b/vendor/k8s.io/client-go/transport/round_trippers.go index 117a9c8..a272753 100644 --- a/vendor/k8s.io/client-go/transport/round_trippers.go +++ b/vendor/k8s.io/client-go/transport/round_trippers.go @@ -80,10 +80,6 @@ func DebugWrappers(rt http.RoundTripper) http.RoundTripper { return rt } -type requestCanceler interface { - CancelRequest(*http.Request) -} - type authProxyRoundTripper struct { username string groups []string @@ -140,11 +136,7 @@ func SetAuthProxyHeaders(req *http.Request, username string, groups []string, ex } func (rt *authProxyRoundTripper) CancelRequest(req *http.Request) { - if canceler, ok := rt.rt.(requestCanceler); ok { - canceler.CancelRequest(req) - } else { - klog.Errorf("CancelRequest not implemented by %T", rt.rt) - } + tryCancelRequest(rt.WrappedRoundTripper(), req) } func (rt *authProxyRoundTripper) WrappedRoundTripper() http.RoundTripper { return rt.rt } @@ -168,11 +160,7 @@ func (rt *userAgentRoundTripper) RoundTrip(req *http.Request) (*http.Response, e } func (rt *userAgentRoundTripper) CancelRequest(req *http.Request) { - if canceler, ok := rt.rt.(requestCanceler); ok { - canceler.CancelRequest(req) - } else { - klog.Errorf("CancelRequest not implemented by %T", rt.rt) - } + tryCancelRequest(rt.WrappedRoundTripper(), req) } func (rt *userAgentRoundTripper) WrappedRoundTripper() http.RoundTripper { return rt.rt } @@ -199,11 +187,7 @@ func (rt *basicAuthRoundTripper) RoundTrip(req *http.Request) (*http.Response, e } func (rt *basicAuthRoundTripper) CancelRequest(req *http.Request) { - if canceler, ok := rt.rt.(requestCanceler); ok { - canceler.CancelRequest(req) - } else { - klog.Errorf("CancelRequest not implemented by %T", rt.rt) - } + tryCancelRequest(rt.WrappedRoundTripper(), req) } func (rt *basicAuthRoundTripper) WrappedRoundTripper() http.RoundTripper { return rt.rt } @@ -259,11 +243,7 @@ func (rt *impersonatingRoundTripper) RoundTrip(req *http.Request) (*http.Respons } func (rt *impersonatingRoundTripper) CancelRequest(req *http.Request) { - if canceler, ok := rt.delegate.(requestCanceler); ok { - canceler.CancelRequest(req) - } else { - klog.Errorf("CancelRequest not implemented by %T", rt.delegate) - } + tryCancelRequest(rt.WrappedRoundTripper(), req) } func (rt *impersonatingRoundTripper) WrappedRoundTripper() http.RoundTripper { return rt.delegate } @@ -318,11 +298,7 @@ func (rt *bearerAuthRoundTripper) RoundTrip(req *http.Request) (*http.Response, } func (rt *bearerAuthRoundTripper) CancelRequest(req *http.Request) { - if canceler, ok := rt.rt.(requestCanceler); ok { - canceler.CancelRequest(req) - } else { - klog.Errorf("CancelRequest not implemented by %T", rt.rt) - } + tryCancelRequest(rt.WrappedRoundTripper(), req) } func (rt *bearerAuthRoundTripper) WrappedRoundTripper() http.RoundTripper { return rt.rt } @@ -402,11 +378,39 @@ func newDebuggingRoundTripper(rt http.RoundTripper, levels ...debugLevel) *debug } func (rt *debuggingRoundTripper) CancelRequest(req *http.Request) { - if canceler, ok := rt.delegatedRoundTripper.(requestCanceler); ok { - canceler.CancelRequest(req) + tryCancelRequest(rt.WrappedRoundTripper(), req) +} + +var knownAuthTypes = map[string]bool{ + "bearer": true, + "basic": true, + "negotiate": true, +} + +// maskValue masks credential content from authorization headers +// See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization +func maskValue(key string, value string) string { + if !strings.EqualFold(key, "Authorization") { + return value + } + if len(value) == 0 { + return "" + } + var authType string + if i := strings.Index(value, " "); i > 0 { + authType = value[0:i] + } else { + authType = value + } + if !knownAuthTypes[strings.ToLower(authType)] { + return "" + } + if len(value) > len(authType)+1 { + value = authType + " " } else { - klog.Errorf("CancelRequest not implemented by %T", rt.delegatedRoundTripper) + value = authType } + return value } func (rt *debuggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { @@ -423,6 +427,7 @@ func (rt *debuggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, e klog.Infof("Request Headers:") for key, values := range reqInfo.RequestHeaders { for _, value := range values { + value = maskValue(key, value) klog.Infof(" %s: %s", key, value) } } diff --git a/vendor/k8s.io/client-go/transport/token_source.go b/vendor/k8s.io/client-go/transport/token_source.go index b8cadd3..bb32c3b 100644 --- a/vendor/k8s.io/client-go/transport/token_source.go +++ b/vendor/k8s.io/client-go/transport/token_source.go @@ -25,6 +25,7 @@ import ( "time" "golang.org/x/oauth2" + "k8s.io/klog" ) @@ -81,6 +82,14 @@ func (tst *tokenSourceTransport) RoundTrip(req *http.Request) (*http.Response, e return tst.ort.RoundTrip(req) } +func (tst *tokenSourceTransport) CancelRequest(req *http.Request) { + if req.Header.Get("Authorization") != "" { + tryCancelRequest(tst.base, req) + return + } + tryCancelRequest(tst.ort, req) +} + type fileTokenSource struct { path string period time.Duration diff --git a/vendor/k8s.io/client-go/transport/transport.go b/vendor/k8s.io/client-go/transport/transport.go index 2a145c9..cd8de98 100644 --- a/vendor/k8s.io/client-go/transport/transport.go +++ b/vendor/k8s.io/client-go/transport/transport.go @@ -23,6 +23,9 @@ import ( "fmt" "io/ioutil" "net/http" + + utilnet "k8s.io/apimachinery/pkg/util/net" + "k8s.io/klog" ) // New returns an http.RoundTripper that will provide the authentication @@ -53,7 +56,7 @@ func New(config *Config) (http.RoundTripper, error) { // TLSConfigFor returns a tls.Config that will provide the transport level security defined // by the provided Config. Will return nil if no transport level security is requested. func TLSConfigFor(c *Config) (*tls.Config, error) { - if !(c.HasCA() || c.HasCertAuth() || c.HasCertCallback() || c.TLS.Insecure || len(c.TLS.ServerName) > 0) { + if !(c.HasCA() || c.HasCertAuth() || c.HasCertCallback() || c.TLS.Insecure || len(c.TLS.ServerName) > 0 || len(c.TLS.NextProtos) > 0) { return nil, nil } if c.HasCA() && c.TLS.Insecure { @@ -70,6 +73,7 @@ func TLSConfigFor(c *Config) (*tls.Config, error) { MinVersion: tls.VersionTLS12, InsecureSkipVerify: c.TLS.Insecure, ServerName: c.TLS.ServerName, + NextProtos: c.TLS.NextProtos, } if c.HasCA() { @@ -225,3 +229,17 @@ func (b *contextCanceller) RoundTrip(req *http.Request) (*http.Response, error) return b.rt.RoundTrip(req) } } + +func tryCancelRequest(rt http.RoundTripper, req *http.Request) { + type canceler interface { + CancelRequest(*http.Request) + } + switch rt := rt.(type) { + case canceler: + rt.CancelRequest(req) + case utilnet.RoundTripperWrapper: + tryCancelRequest(rt.WrappedRoundTripper(), req) + default: + klog.Warningf("Unable to cancel request for %T", rt) + } +} diff --git a/vendor/k8s.io/client-go/util/cert/OWNERS b/vendor/k8s.io/client-go/util/cert/OWNERS deleted file mode 100644 index 3cf0364..0000000 --- a/vendor/k8s.io/client-go/util/cert/OWNERS +++ /dev/null @@ -1,9 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: -- sig-auth-certificates-approvers -reviewers: -- sig-auth-certificates-reviewers -labels: -- sig/auth - diff --git a/vendor/k8s.io/client-go/util/cert/io.go b/vendor/k8s.io/client-go/util/cert/io.go index 5efb248..35fde68 100644 --- a/vendor/k8s.io/client-go/util/cert/io.go +++ b/vendor/k8s.io/client-go/util/cert/io.go @@ -72,7 +72,22 @@ func WriteCert(certPath string, data []byte) error { // NewPool returns an x509.CertPool containing the certificates in the given PEM-encoded file. // Returns an error if the file could not be read, a certificate could not be parsed, or if the file does not contain any certificates func NewPool(filename string) (*x509.CertPool, error) { - certs, err := CertsFromFile(filename) + pemBlock, err := ioutil.ReadFile(filename) + if err != nil { + return nil, err + } + + pool, err := NewPoolFromBytes(pemBlock) + if err != nil { + return nil, fmt.Errorf("error creating pool from %s: %s", filename, err) + } + return pool, nil +} + +// NewPoolFromBytes returns an x509.CertPool containing the certificates in the given PEM-encoded bytes. +// Returns an error if the file could not be read, a certificate could not be parsed, or if the file does not contain any certificates +func NewPoolFromBytes(pemBlock []byte) (*x509.CertPool, error) { + certs, err := ParseCertsPEM(pemBlock) if err != nil { return nil, err } diff --git a/vendor/k8s.io/client-go/util/cert/pem.go b/vendor/k8s.io/client-go/util/cert/pem.go index 9185e2e..c775123 100644 --- a/vendor/k8s.io/client-go/util/cert/pem.go +++ b/vendor/k8s.io/client-go/util/cert/pem.go @@ -17,6 +17,7 @@ limitations under the License. package cert import ( + "bytes" "crypto/x509" "encoding/pem" "errors" @@ -59,3 +60,14 @@ func ParseCertsPEM(pemCerts []byte) ([]*x509.Certificate, error) { } return certs, nil } + +// EncodeCertificates returns the PEM-encoded byte array that represents by the specified certs. +func EncodeCertificates(certs ...*x509.Certificate) ([]byte, error) { + b := bytes.Buffer{} + for _, cert := range certs { + if err := pem.Encode(&b, &pem.Block{Type: CertificateBlockType, Bytes: cert.Raw}); err != nil { + return []byte{}, err + } + } + return b.Bytes(), nil +} diff --git a/vendor/k8s.io/client-go/util/cert/server_inspection.go b/vendor/k8s.io/client-go/util/cert/server_inspection.go new file mode 100644 index 0000000..f1ef292 --- /dev/null +++ b/vendor/k8s.io/client-go/util/cert/server_inspection.go @@ -0,0 +1,102 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cert + +import ( + "crypto/tls" + "crypto/x509" + "fmt" + "net/url" + "strings" +) + +// GetClientCANames gets the CA names for client certs that a server accepts. This is useful when inspecting the +// state of particular servers. apiHost is "host:port" +func GetClientCANames(apiHost string) ([]string, error) { + // when we run this the second time, we know which one we are expecting + acceptableCAs := []string{} + tlsConfig := &tls.Config{ + InsecureSkipVerify: true, // this is insecure to always get to the GetClientCertificate + GetClientCertificate: func(hello *tls.CertificateRequestInfo) (*tls.Certificate, error) { + acceptableCAs = []string{} + for _, curr := range hello.AcceptableCAs { + acceptableCAs = append(acceptableCAs, string(curr)) + } + return &tls.Certificate{}, nil + }, + } + + conn, err := tls.Dial("tcp", apiHost, tlsConfig) + if err != nil { + return nil, err + } + if err := conn.Close(); err != nil { + return nil, err + } + + return acceptableCAs, nil +} + +// GetClientCANamesForURL is GetClientCANames against a URL string like we use in kubeconfigs +func GetClientCANamesForURL(kubeConfigURL string) ([]string, error) { + apiserverURL, err := url.Parse(kubeConfigURL) + if err != nil { + return nil, err + } + return GetClientCANames(apiserverURL.Host) +} + +// GetServingCertificates returns the x509 certs used by a server as certificates and pem encoded bytes. +// The serverName is optional for specifying a different name to get SNI certificates. apiHost is "host:port" +func GetServingCertificates(apiHost, serverName string) ([]*x509.Certificate, [][]byte, error) { + tlsConfig := &tls.Config{ + InsecureSkipVerify: true, // this is insecure so that we always get connected + } + // if a name is specified for SNI, set it. + if len(serverName) > 0 { + tlsConfig.ServerName = serverName + } + + conn, err := tls.Dial("tcp", apiHost, tlsConfig) + if err != nil { + return nil, nil, err + } + if err = conn.Close(); err != nil { + return nil, nil, fmt.Errorf("failed to close connection : %v", err) + } + + peerCerts := conn.ConnectionState().PeerCertificates + peerCertBytes := [][]byte{} + for _, a := range peerCerts { + actualCert, err := EncodeCertificates(a) + if err != nil { + return nil, nil, err + } + peerCertBytes = append(peerCertBytes, []byte(strings.TrimSpace(string(actualCert)))) + } + + return peerCerts, peerCertBytes, err +} + +// GetServingCertificatesForURL is GetServingCertificates against a URL string like we use in kubeconfigs +func GetServingCertificatesForURL(kubeConfigURL, serverName string) ([]*x509.Certificate, [][]byte, error) { + apiserverURL, err := url.Parse(kubeConfigURL) + if err != nil { + return nil, nil, err + } + return GetServingCertificates(apiserverURL.Host, serverName) +} diff --git a/vendor/k8s.io/client-go/util/connrotation/connrotation.go b/vendor/k8s.io/client-go/util/connrotation/connrotation.go index 235a9e0..f98faee 100644 --- a/vendor/k8s.io/client-go/util/connrotation/connrotation.go +++ b/vendor/k8s.io/client-go/util/connrotation/connrotation.go @@ -77,11 +77,6 @@ func (d *Dialer) DialContext(ctx context.Context, network, address string) (net. closable := &closableConn{Conn: conn} - // Start tracking the connection - d.mu.Lock() - d.conns[closable] = struct{}{} - d.mu.Unlock() - // When the connection is closed, remove it from the map. This will // be no-op if the connection isn't in the map, e.g. if CloseAll() // is called. @@ -91,6 +86,11 @@ func (d *Dialer) DialContext(ctx context.Context, network, address string) (net. d.mu.Unlock() } + // Start tracking the connection + d.mu.Lock() + d.conns[closable] = struct{}{} + d.mu.Unlock() + return closable, nil } diff --git a/vendor/k8s.io/client-go/util/flowcontrol/backoff.go b/vendor/k8s.io/client-go/util/flowcontrol/backoff.go index 39cd72f..c48ba03 100644 --- a/vendor/k8s.io/client-go/util/flowcontrol/backoff.go +++ b/vendor/k8s.io/client-go/util/flowcontrol/backoff.go @@ -30,7 +30,7 @@ type backoffEntry struct { } type Backoff struct { - sync.Mutex + sync.RWMutex Clock clock.Clock defaultDuration time.Duration maxDuration time.Duration @@ -57,8 +57,8 @@ func NewBackOff(initial, max time.Duration) *Backoff { // Get the current backoff Duration func (p *Backoff) Get(id string) time.Duration { - p.Lock() - defer p.Unlock() + p.RLock() + defer p.RUnlock() var delay time.Duration entry, ok := p.perItemBackoff[id] if ok { @@ -90,8 +90,8 @@ func (p *Backoff) Reset(id string) { // Returns True if the elapsed time since eventTime is smaller than the current backoff window func (p *Backoff) IsInBackOffSince(id string, eventTime time.Time) bool { - p.Lock() - defer p.Unlock() + p.RLock() + defer p.RUnlock() entry, ok := p.perItemBackoff[id] if !ok { return false @@ -104,8 +104,8 @@ func (p *Backoff) IsInBackOffSince(id string, eventTime time.Time) bool { // Returns True if time since lastupdate is less than the current backoff window. func (p *Backoff) IsInBackOffSinceUpdate(id string, eventTime time.Time) bool { - p.Lock() - defer p.Unlock() + p.RLock() + defer p.RUnlock() entry, ok := p.perItemBackoff[id] if !ok { return false diff --git a/vendor/k8s.io/client-go/util/flowcontrol/throttle.go b/vendor/k8s.io/client-go/util/flowcontrol/throttle.go index e671c04..ffd912c 100644 --- a/vendor/k8s.io/client-go/util/flowcontrol/throttle.go +++ b/vendor/k8s.io/client-go/util/flowcontrol/throttle.go @@ -17,6 +17,8 @@ limitations under the License. package flowcontrol import ( + "context" + "errors" "sync" "time" @@ -33,6 +35,8 @@ type RateLimiter interface { Stop() // QPS returns QPS of this rate limiter QPS() float32 + // Wait returns nil if a token is taken before the Context is done. + Wait(ctx context.Context) error } type tokenBucketRateLimiter struct { @@ -98,6 +102,10 @@ func (t *tokenBucketRateLimiter) QPS() float32 { return t.qps } +func (t *tokenBucketRateLimiter) Wait(ctx context.Context) error { + return t.limiter.Wait(ctx) +} + type fakeAlwaysRateLimiter struct{} func NewFakeAlwaysRateLimiter() RateLimiter { @@ -116,6 +124,10 @@ func (t *fakeAlwaysRateLimiter) QPS() float32 { return 1 } +func (t *fakeAlwaysRateLimiter) Wait(ctx context.Context) error { + return nil +} + type fakeNeverRateLimiter struct { wg sync.WaitGroup } @@ -141,3 +153,7 @@ func (t *fakeNeverRateLimiter) Accept() { func (t *fakeNeverRateLimiter) QPS() float32 { return 1 } + +func (t *fakeNeverRateLimiter) Wait(ctx context.Context) error { + return errors.New("can not be accept") +} diff --git a/vendor/k8s.io/client-go/util/homedir/homedir.go b/vendor/k8s.io/client-go/util/homedir/homedir.go index 816db57..3fdbeb8 100644 --- a/vendor/k8s.io/client-go/util/homedir/homedir.go +++ b/vendor/k8s.io/client-go/util/homedir/homedir.go @@ -18,30 +18,75 @@ package homedir import ( "os" + "path/filepath" "runtime" ) -// HomeDir returns the home directory for the current user +// HomeDir returns the home directory for the current user. +// On Windows: +// 1. the first of %HOME%, %HOMEDRIVE%%HOMEPATH%, %USERPROFILE% containing a `.kube\config` file is returned. +// 2. if none of those locations contain a `.kube\config` file, the first of %HOME%, %USERPROFILE%, %HOMEDRIVE%%HOMEPATH% that exists and is writeable is returned. +// 3. if none of those locations are writeable, the first of %HOME%, %USERPROFILE%, %HOMEDRIVE%%HOMEPATH% that exists is returned. +// 4. if none of those locations exists, the first of %HOME%, %USERPROFILE%, %HOMEDRIVE%%HOMEPATH% that is set is returned. func HomeDir() string { if runtime.GOOS == "windows" { + home := os.Getenv("HOME") + homeDriveHomePath := "" + if homeDrive, homePath := os.Getenv("HOMEDRIVE"), os.Getenv("HOMEPATH"); len(homeDrive) > 0 && len(homePath) > 0 { + homeDriveHomePath = homeDrive + homePath + } + userProfile := os.Getenv("USERPROFILE") - // First prefer the HOME environmental variable - if home := os.Getenv("HOME"); len(home) > 0 { - if _, err := os.Stat(home); err == nil { - return home + // Return first of %HOME%, %HOMEDRIVE%/%HOMEPATH%, %USERPROFILE% that contains a `.kube\config` file. + // %HOMEDRIVE%/%HOMEPATH% is preferred over %USERPROFILE% for backwards-compatibility. + for _, p := range []string{home, homeDriveHomePath, userProfile} { + if len(p) == 0 { + continue } - } - if homeDrive, homePath := os.Getenv("HOMEDRIVE"), os.Getenv("HOMEPATH"); len(homeDrive) > 0 && len(homePath) > 0 { - homeDir := homeDrive + homePath - if _, err := os.Stat(homeDir); err == nil { - return homeDir + if _, err := os.Stat(filepath.Join(p, ".kube", "config")); err != nil { + continue } + return p } - if userProfile := os.Getenv("USERPROFILE"); len(userProfile) > 0 { - if _, err := os.Stat(userProfile); err == nil { - return userProfile + + firstSetPath := "" + firstExistingPath := "" + + // Prefer %USERPROFILE% over %HOMEDRIVE%/%HOMEPATH% for compatibility with other auth-writing tools + for _, p := range []string{home, userProfile, homeDriveHomePath} { + if len(p) == 0 { + continue + } + if len(firstSetPath) == 0 { + // remember the first path that is set + firstSetPath = p + } + info, err := os.Stat(p) + if err != nil { + continue } + if len(firstExistingPath) == 0 { + // remember the first path that exists + firstExistingPath = p + } + if info.IsDir() && info.Mode().Perm()&(1<<(uint(7))) != 0 { + // return first path that is writeable + return p + } + } + + // If none are writeable, return first location that exists + if len(firstExistingPath) > 0 { + return firstExistingPath } + + // If none exist, return first location that is set + if len(firstSetPath) > 0 { + return firstSetPath + } + + // We've got nothing + return "" } return os.Getenv("HOME") } diff --git a/vendor/k8s.io/client-go/util/jsonpath/parser.go b/vendor/k8s.io/client-go/util/jsonpath/parser.go index 1af8f26..e1aab68 100644 --- a/vendor/k8s.io/client-go/util/jsonpath/parser.go +++ b/vendor/k8s.io/client-go/util/jsonpath/parser.go @@ -37,7 +37,6 @@ type Parser struct { Name string Root *ListNode input string - cur *ListNode pos int start int width int @@ -186,8 +185,7 @@ func (p *Parser) parseInsideAction(cur *ListNode) error { func (p *Parser) parseRightDelim(cur *ListNode) error { p.pos += len(rightDelim) p.consumeText() - cur = p.Root - return p.parseText(cur) + return p.parseText(p.Root) } // parseIdentifier scans build-in keywords, like "range" "end" @@ -231,7 +229,7 @@ func (p *Parser) parseRecursive(cur *ListNode) error { func (p *Parser) parseNumber(cur *ListNode) error { r := p.peek() if r == '+' || r == '-' { - r = p.next() + p.next() } for { r = p.next() diff --git a/vendor/k8s.io/client-go/util/keyutil/OWNERS b/vendor/k8s.io/client-go/util/keyutil/OWNERS deleted file mode 100644 index 470b7a1..0000000 --- a/vendor/k8s.io/client-go/util/keyutil/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -approvers: -- sig-auth-certificates-approvers -reviewers: -- sig-auth-certificates-reviewers -labels: -- sig/auth - diff --git a/vendor/k8s.io/client-go/util/retry/OWNERS b/vendor/k8s.io/client-go/util/retry/OWNERS deleted file mode 100644 index dec3e88..0000000 --- a/vendor/k8s.io/client-go/util/retry/OWNERS +++ /dev/null @@ -1,4 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: -- caesarxuchao diff --git a/vendor/k8s.io/client-go/util/retry/util.go b/vendor/k8s.io/client-go/util/retry/util.go index 3ac0840..15e2722 100644 --- a/vendor/k8s.io/client-go/util/retry/util.go +++ b/vendor/k8s.io/client-go/util/retry/util.go @@ -42,38 +42,64 @@ var DefaultBackoff = wait.Backoff{ Jitter: 0.1, } -// RetryConflict executes the provided function repeatedly, retrying if the server returns a conflicting -// write. Callers should preserve previous executions if they wish to retry changes. It performs an -// exponential backoff. -// -// var pod *api.Pod -// err := RetryOnConflict(DefaultBackoff, func() (err error) { -// pod, err = c.Pods("mynamespace").UpdateStatus(podStatus) -// return -// }) -// if err != nil { -// // may be conflict if max retries were hit -// return err -// } -// ... -// -// TODO: Make Backoff an interface? -func RetryOnConflict(backoff wait.Backoff, fn func() error) error { - var lastConflictErr error +// OnError allows the caller to retry fn in case the error returned by fn is retriable +// according to the provided function. backoff defines the maximum retries and the wait +// interval between two retries. +func OnError(backoff wait.Backoff, retriable func(error) bool, fn func() error) error { + var lastErr error err := wait.ExponentialBackoff(backoff, func() (bool, error) { err := fn() switch { case err == nil: return true, nil - case errors.IsConflict(err): - lastConflictErr = err + case retriable(err): + lastErr = err return false, nil default: return false, err } }) if err == wait.ErrWaitTimeout { - err = lastConflictErr + err = lastErr } return err } + +// RetryOnConflict is used to make an update to a resource when you have to worry about +// conflicts caused by other code making unrelated updates to the resource at the same +// time. fn should fetch the resource to be modified, make appropriate changes to it, try +// to update it, and return (unmodified) the error from the update function. On a +// successful update, RetryOnConflict will return nil. If the update function returns a +// "Conflict" error, RetryOnConflict will wait some amount of time as described by +// backoff, and then try again. On a non-"Conflict" error, or if it retries too many times +// and gives up, RetryOnConflict will return an error to the caller. +// +// err := retry.RetryOnConflict(retry.DefaultRetry, func() error { +// // Fetch the resource here; you need to refetch it on every try, since +// // if you got a conflict on the last update attempt then you need to get +// // the current version before making your own changes. +// pod, err := c.Pods("mynamespace").Get(name, metav1.GetOptions{}) +// if err ! nil { +// return err +// } +// +// // Make whatever updates to the resource are needed +// pod.Status.Phase = v1.PodFailed +// +// // Try to update +// _, err = c.Pods("mynamespace").UpdateStatus(pod) +// // You have to return err itself here (not wrapped inside another error) +// // so that RetryOnConflict can identify it correctly. +// return err +// }) +// if err != nil { +// // May be conflict if max retries were hit, or may be something unrelated +// // like permissions or a network error +// return err +// } +// ... +// +// TODO: Make Backoff an interface? +func RetryOnConflict(backoff wait.Backoff, fn func() error) error { + return OnError(backoff, errors.IsConflict, fn) +} diff --git a/vendor/k8s.io/client-go/util/workqueue/delaying_queue.go b/vendor/k8s.io/client-go/util/workqueue/delaying_queue.go index 6c9e944..e1ab76e 100644 --- a/vendor/k8s.io/client-go/util/workqueue/delaying_queue.go +++ b/vendor/k8s.io/client-go/util/workqueue/delaying_queue.go @@ -35,22 +35,24 @@ type DelayingInterface interface { // NewDelayingQueue constructs a new workqueue with delayed queuing ability func NewDelayingQueue() DelayingInterface { - return newDelayingQueue(clock.RealClock{}, "") + return NewDelayingQueueWithCustomClock(clock.RealClock{}, "") } +// NewNamedDelayingQueue constructs a new named workqueue with delayed queuing ability func NewNamedDelayingQueue(name string) DelayingInterface { - return newDelayingQueue(clock.RealClock{}, name) + return NewDelayingQueueWithCustomClock(clock.RealClock{}, name) } -func newDelayingQueue(clock clock.Clock, name string) DelayingInterface { +// NewDelayingQueueWithCustomClock constructs a new named workqueue +// with ability to inject real or fake clock for testing purposes +func NewDelayingQueueWithCustomClock(clock clock.Clock, name string) DelayingInterface { ret := &delayingType{ - Interface: NewNamed(name), - clock: clock, - heartbeat: clock.NewTicker(maxWait), - stopCh: make(chan struct{}), - waitingForAddCh: make(chan *waitFor, 1000), - metrics: newRetryMetrics(name), - deprecatedMetrics: newDeprecatedRetryMetrics(name), + Interface: NewNamed(name), + clock: clock, + heartbeat: clock.NewTicker(maxWait), + stopCh: make(chan struct{}), + waitingForAddCh: make(chan *waitFor, 1000), + metrics: newRetryMetrics(name), } go ret.waitingLoop() @@ -77,8 +79,7 @@ type delayingType struct { waitingForAddCh chan *waitFor // metrics counts the number of retries - metrics retryMetrics - deprecatedMetrics retryMetrics + metrics retryMetrics } // waitFor holds the data to add and the time it should be added @@ -154,7 +155,6 @@ func (q *delayingType) AddAfter(item interface{}, duration time.Duration) { } q.metrics.retry() - q.deprecatedMetrics.retry() // immediately add things with no delay if duration <= 0 { @@ -181,6 +181,9 @@ func (q *delayingType) waitingLoop() { // Make a placeholder channel to use when there are no items in our list never := make(<-chan time.Time) + // Make a timer that expires when the item at the head of the waiting queue is ready + var nextReadyAtTimer clock.Timer + waitingForQueue := &waitForPriorityQueue{} heap.Init(waitingForQueue) @@ -208,8 +211,12 @@ func (q *delayingType) waitingLoop() { // Set up a wait for the first item's readyAt (if one exists) nextReadyAt := never if waitingForQueue.Len() > 0 { + if nextReadyAtTimer != nil { + nextReadyAtTimer.Stop() + } entry := waitingForQueue.Peek().(*waitFor) - nextReadyAt = q.clock.After(entry.readyAt.Sub(now)) + nextReadyAtTimer = q.clock.NewTimer(entry.readyAt.Sub(now)) + nextReadyAt = nextReadyAtTimer.C() } select { diff --git a/vendor/k8s.io/client-go/util/workqueue/doc.go b/vendor/k8s.io/client-go/util/workqueue/doc.go index 2a00c74..a5c976e 100644 --- a/vendor/k8s.io/client-go/util/workqueue/doc.go +++ b/vendor/k8s.io/client-go/util/workqueue/doc.go @@ -23,4 +23,4 @@ limitations under the License. // * Multiple consumers and producers. In particular, it is allowed for an // item to be reenqueued while it is being processed. // * Shutdown notifications. -package workqueue +package workqueue // import "k8s.io/client-go/util/workqueue" diff --git a/vendor/k8s.io/client-go/util/workqueue/metrics.go b/vendor/k8s.io/client-go/util/workqueue/metrics.go index be23ddd..a3911bf 100644 --- a/vendor/k8s.io/client-go/util/workqueue/metrics.go +++ b/vendor/k8s.io/client-go/util/workqueue/metrics.go @@ -87,14 +87,6 @@ type defaultQueueMetrics struct { // how long have current threads been working? unfinishedWorkSeconds SettableGaugeMetric longestRunningProcessor SettableGaugeMetric - - // TODO(danielqsj): Remove the following metrics, they are deprecated - deprecatedDepth GaugeMetric - deprecatedAdds CounterMetric - deprecatedLatency SummaryMetric - deprecatedWorkDuration SummaryMetric - deprecatedUnfinishedWorkSeconds SettableGaugeMetric - deprecatedLongestRunningProcessor SettableGaugeMetric } func (m *defaultQueueMetrics) add(item t) { @@ -103,9 +95,7 @@ func (m *defaultQueueMetrics) add(item t) { } m.adds.Inc() - m.deprecatedAdds.Inc() m.depth.Inc() - m.deprecatedDepth.Inc() if _, exists := m.addTimes[item]; !exists { m.addTimes[item] = m.clock.Now() } @@ -117,11 +107,9 @@ func (m *defaultQueueMetrics) get(item t) { } m.depth.Dec() - m.deprecatedDepth.Dec() m.processingStartTimes[item] = m.clock.Now() if startTime, exists := m.addTimes[item]; exists { m.latency.Observe(m.sinceInSeconds(startTime)) - m.deprecatedLatency.Observe(m.sinceInMicroseconds(startTime)) delete(m.addTimes, item) } } @@ -133,7 +121,6 @@ func (m *defaultQueueMetrics) done(item t) { if startTime, exists := m.processingStartTimes[item]; exists { m.workDuration.Observe(m.sinceInSeconds(startTime)) - m.deprecatedWorkDuration.Observe(m.sinceInMicroseconds(startTime)) delete(m.processingStartTimes, item) } } @@ -153,9 +140,7 @@ func (m *defaultQueueMetrics) updateUnfinishedWork() { // Convert to seconds; microseconds is unhelpfully granular for this. total /= 1000000 m.unfinishedWorkSeconds.Set(total) - m.deprecatedUnfinishedWorkSeconds.Set(total) m.longestRunningProcessor.Set(oldest / 1000000) - m.deprecatedLongestRunningProcessor.Set(oldest) // in microseconds. } type noMetrics struct{} @@ -200,13 +185,6 @@ type MetricsProvider interface { NewUnfinishedWorkSecondsMetric(name string) SettableGaugeMetric NewLongestRunningProcessorSecondsMetric(name string) SettableGaugeMetric NewRetriesMetric(name string) CounterMetric - NewDeprecatedDepthMetric(name string) GaugeMetric - NewDeprecatedAddsMetric(name string) CounterMetric - NewDeprecatedLatencyMetric(name string) SummaryMetric - NewDeprecatedWorkDurationMetric(name string) SummaryMetric - NewDeprecatedUnfinishedWorkSecondsMetric(name string) SettableGaugeMetric - NewDeprecatedLongestRunningProcessorMicrosecondsMetric(name string) SettableGaugeMetric - NewDeprecatedRetriesMetric(name string) CounterMetric } type noopMetricsProvider struct{} @@ -239,34 +217,6 @@ func (_ noopMetricsProvider) NewRetriesMetric(name string) CounterMetric { return noopMetric{} } -func (_ noopMetricsProvider) NewDeprecatedDepthMetric(name string) GaugeMetric { - return noopMetric{} -} - -func (_ noopMetricsProvider) NewDeprecatedAddsMetric(name string) CounterMetric { - return noopMetric{} -} - -func (_ noopMetricsProvider) NewDeprecatedLatencyMetric(name string) SummaryMetric { - return noopMetric{} -} - -func (_ noopMetricsProvider) NewDeprecatedWorkDurationMetric(name string) SummaryMetric { - return noopMetric{} -} - -func (_ noopMetricsProvider) NewDeprecatedUnfinishedWorkSecondsMetric(name string) SettableGaugeMetric { - return noopMetric{} -} - -func (_ noopMetricsProvider) NewDeprecatedLongestRunningProcessorMicrosecondsMetric(name string) SettableGaugeMetric { - return noopMetric{} -} - -func (_ noopMetricsProvider) NewDeprecatedRetriesMetric(name string) CounterMetric { - return noopMetric{} -} - var globalMetricsFactory = queueMetricsFactory{ metricsProvider: noopMetricsProvider{}, } @@ -289,21 +239,15 @@ func (f *queueMetricsFactory) newQueueMetrics(name string, clock clock.Clock) qu return noMetrics{} } return &defaultQueueMetrics{ - clock: clock, - depth: mp.NewDepthMetric(name), - adds: mp.NewAddsMetric(name), - latency: mp.NewLatencyMetric(name), - workDuration: mp.NewWorkDurationMetric(name), - unfinishedWorkSeconds: mp.NewUnfinishedWorkSecondsMetric(name), - longestRunningProcessor: mp.NewLongestRunningProcessorSecondsMetric(name), - deprecatedDepth: mp.NewDeprecatedDepthMetric(name), - deprecatedAdds: mp.NewDeprecatedAddsMetric(name), - deprecatedLatency: mp.NewDeprecatedLatencyMetric(name), - deprecatedWorkDuration: mp.NewDeprecatedWorkDurationMetric(name), - deprecatedUnfinishedWorkSeconds: mp.NewDeprecatedUnfinishedWorkSecondsMetric(name), - deprecatedLongestRunningProcessor: mp.NewDeprecatedLongestRunningProcessorMicrosecondsMetric(name), - addTimes: map[t]time.Time{}, - processingStartTimes: map[t]time.Time{}, + clock: clock, + depth: mp.NewDepthMetric(name), + adds: mp.NewAddsMetric(name), + latency: mp.NewLatencyMetric(name), + workDuration: mp.NewWorkDurationMetric(name), + unfinishedWorkSeconds: mp.NewUnfinishedWorkSecondsMetric(name), + longestRunningProcessor: mp.NewLongestRunningProcessorSecondsMetric(name), + addTimes: map[t]time.Time{}, + processingStartTimes: map[t]time.Time{}, } } @@ -317,16 +261,6 @@ func newRetryMetrics(name string) retryMetrics { } } -func newDeprecatedRetryMetrics(name string) retryMetrics { - var ret *defaultRetryMetrics - if len(name) == 0 { - return ret - } - return &defaultRetryMetrics{ - retries: globalMetricsFactory.metricsProvider.NewDeprecatedRetriesMetric(name), - } -} - // SetProvider sets the metrics provider for all subsequently created work // queues. Only the first call has an effect. func SetProvider(metricsProvider MetricsProvider) { diff --git a/vendor/k8s.io/code-generator/CONTRIBUTING.md b/vendor/k8s.io/code-generator/CONTRIBUTING.md deleted file mode 100644 index 76625b7..0000000 --- a/vendor/k8s.io/code-generator/CONTRIBUTING.md +++ /dev/null @@ -1,7 +0,0 @@ -# Contributing guidelines - -Do not open pull requests directly against this repository, they will be ignored. Instead, please open pull requests against [kubernetes/kubernetes](https://git.k8s.io/kubernetes/). Please follow the same [contributing guide](https://git.k8s.io/kubernetes/CONTRIBUTING.md) you would follow for any other pull request made to kubernetes/kubernetes. - -This repository is published from [kubernetes/kubernetes/staging/src/k8s.io/code-generator](https://git.k8s.io/kubernetes/staging/src/k8s.io/code-generator) by the [kubernetes publishing-bot](https://git.k8s.io/publishing-bot). - -Please see [Staging Directory and Publishing](https://git.k8s.io/community/contributors/devel/sig-architecture/staging.md) for more information diff --git a/vendor/k8s.io/code-generator/LICENSE b/vendor/k8s.io/code-generator/LICENSE deleted file mode 100644 index d645695..0000000 --- a/vendor/k8s.io/code-generator/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/k8s.io/code-generator/OWNERS b/vendor/k8s.io/code-generator/OWNERS deleted file mode 100644 index 6f7abe3..0000000 --- a/vendor/k8s.io/code-generator/OWNERS +++ /dev/null @@ -1,13 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: -- lavalamp -- wojtek-t -- sttts -reviewers: -- lavalamp -- wojtek-t -- sttts -labels: -- sig/api-machinery -- area/code-generation diff --git a/vendor/k8s.io/code-generator/README.md b/vendor/k8s.io/code-generator/README.md deleted file mode 100644 index e03c6bf..0000000 --- a/vendor/k8s.io/code-generator/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# code-generator - -Golang code-generators used to implement [Kubernetes-style API types](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md). - -## Purpose - -These code-generators can be used -- in the context of [CustomResourceDefinition](https://kubernetes.io/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions/) to build native, versioned clients, - informers and other helpers -- in the context of [User-provider API Servers](https://github.com/kubernetes/apiserver) to build conversions between internal and versioned types, defaulters, protobuf codecs, - internal and versioned clients and informers. - -## Resources -- The example [sample controller](https://github.com/kubernetes/sample-controller) shows a code example of a controller that uses the clients, listers and informers generated by this library. -- The article [Kubernetes Deep Dive: Code Generation for CustomResources](https://blog.openshift.com/kubernetes-deep-dive-code-generation-customresources/) gives a step by step instruction on how to use this library. - -## Compatibility - -HEAD of this repo will match HEAD of k8s.io/apiserver, k8s.io/apimachinery, and k8s.io/client-go. - -## Where does it come from? - -`code-generator` is synced from https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/code-generator. -Code changes are made in that location, merged into `k8s.io/kubernetes` and later synced here. diff --git a/vendor/k8s.io/code-generator/SECURITY_CONTACTS b/vendor/k8s.io/code-generator/SECURITY_CONTACTS deleted file mode 100644 index 6df6a4d..0000000 --- a/vendor/k8s.io/code-generator/SECURITY_CONTACTS +++ /dev/null @@ -1,17 +0,0 @@ -# Defined below are the security contacts for this repo. -# -# They are the contact point for the Product Security Committee to reach out -# to for triaging and handling of incoming issues. -# -# The below names agree to abide by the -# [Embargo Policy](https://git.k8s.io/security/private-distributors-list.md#embargo-policy) -# and will be removed and replaced if they violate that agreement. -# -# DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE -# INSTRUCTIONS AT https://kubernetes.io/security/ - -cjcullen -joelsmith -liggitt -philips -tallclair diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/OWNERS b/vendor/k8s.io/code-generator/cmd/client-gen/OWNERS deleted file mode 100644 index 62866d0..0000000 --- a/vendor/k8s.io/code-generator/cmd/client-gen/OWNERS +++ /dev/null @@ -1,10 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: -- lavalamp -- wojtek-t -- caesarxuchao -reviewers: -- lavalamp -- wojtek-t -- caesarxuchao diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/README.md b/vendor/k8s.io/code-generator/cmd/client-gen/README.md deleted file mode 100644 index 092a611..0000000 --- a/vendor/k8s.io/code-generator/cmd/client-gen/README.md +++ /dev/null @@ -1,4 +0,0 @@ -See [generating-clientset.md](https://git.k8s.io/community/contributors/devel/sig-api-machinery/generating-clientset.md) - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/staging/src/k8s.io/code-generator/client-gen/README.md?pixel)]() diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/args/args.go b/vendor/k8s.io/code-generator/cmd/client-gen/args/args.go deleted file mode 100644 index f45be1b..0000000 --- a/vendor/k8s.io/code-generator/cmd/client-gen/args/args.go +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package args - -import ( - "fmt" - "path" - - "github.com/spf13/pflag" - "k8s.io/gengo/args" - - "k8s.io/code-generator/cmd/client-gen/types" - codegenutil "k8s.io/code-generator/pkg/util" -) - -var DefaultInputDirs = []string{} - -// ClientGenArgs is a wrapper for arguments to client-gen. -type CustomArgs struct { - // A sorted list of group versions to generate. For each of them the package path is found - // in GroupVersionToInputPath. - Groups []types.GroupVersions - - // Overrides for which types should be included in the client. - IncludedTypesOverrides map[types.GroupVersion][]string - - // ClientsetName is the name of the clientset to be generated. It's - // populated from command-line arguments. - ClientsetName string - // ClientsetAPIPath is the default API HTTP path for generated clients. - ClientsetAPIPath string - // ClientsetOnly determines if we should generate the clients for groups and - // types along with the clientset. It's populated from command-line - // arguments. - ClientsetOnly bool - // FakeClient determines if client-gen generates the fake clients. - FakeClient bool -} - -func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { - genericArgs := args.Default().WithoutDefaultFlagParsing() - customArgs := &CustomArgs{ - ClientsetName: "internalclientset", - ClientsetAPIPath: "/apis", - ClientsetOnly: false, - FakeClient: true, - } - genericArgs.CustomArgs = customArgs - genericArgs.InputDirs = DefaultInputDirs - - if pkg := codegenutil.CurrentPackage(); len(pkg) != 0 { - genericArgs.OutputPackagePath = path.Join(pkg, "pkg/client/clientset") - } - - return genericArgs, customArgs -} - -func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet, inputBase string) { - gvsBuilder := NewGroupVersionsBuilder(&ca.Groups) - pflag.Var(NewGVPackagesValue(gvsBuilder, nil), "input", "group/versions that client-gen will generate clients for. At most one version per group is allowed. Specified in the format \"group1/version1,group2/version2...\".") - pflag.Var(NewGVTypesValue(&ca.IncludedTypesOverrides, []string{}), "included-types-overrides", "list of group/version/type for which client should be generated. By default, client is generated for all types which have genclient in types.go. This overrides that. For each groupVersion in this list, only the types mentioned here will be included. The default check of genclient will be used for other group versions.") - pflag.Var(NewInputBasePathValue(gvsBuilder, inputBase), "input-base", "base path to look for the api group.") - pflag.StringVarP(&ca.ClientsetName, "clientset-name", "n", ca.ClientsetName, "the name of the generated clientset package.") - pflag.StringVarP(&ca.ClientsetAPIPath, "clientset-api-path", "", ca.ClientsetAPIPath, "the value of default API HTTP path, starting with / and without trailing /.") - pflag.BoolVar(&ca.ClientsetOnly, "clientset-only", ca.ClientsetOnly, "when set, client-gen only generates the clientset shell, without generating the individual typed clients") - pflag.BoolVar(&ca.FakeClient, "fake-clientset", ca.FakeClient, "when set, client-gen will generate the fake clientset that can be used in tests") - - // support old flags - fs.SetNormalizeFunc(mapFlagName("clientset-path", "output-package", fs.GetNormalizeFunc())) -} - -func Validate(genericArgs *args.GeneratorArgs) error { - customArgs := genericArgs.CustomArgs.(*CustomArgs) - - if len(genericArgs.OutputPackagePath) == 0 { - return fmt.Errorf("output package cannot be empty") - } - if len(customArgs.ClientsetName) == 0 { - return fmt.Errorf("clientset name cannot be empty") - } - if len(customArgs.ClientsetAPIPath) == 0 { - return fmt.Errorf("clientset API path cannot be empty") - } - - return nil -} - -// GroupVersionPackages returns a map from GroupVersion to the package with the types.go. -func (ca *CustomArgs) GroupVersionPackages() map[types.GroupVersion]string { - res := map[types.GroupVersion]string{} - for _, pkg := range ca.Groups { - for _, v := range pkg.Versions { - res[types.GroupVersion{Group: pkg.Group, Version: v.Version}] = v.Package - } - } - return res -} - -func mapFlagName(from, to string, old func(fs *pflag.FlagSet, name string) pflag.NormalizedName) func(fs *pflag.FlagSet, name string) pflag.NormalizedName { - return func(fs *pflag.FlagSet, name string) pflag.NormalizedName { - if name == from { - name = to - } - return old(fs, name) - } -} diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/args/gvpackages.go b/vendor/k8s.io/code-generator/cmd/client-gen/args/gvpackages.go deleted file mode 100644 index 8da71d6..0000000 --- a/vendor/k8s.io/code-generator/cmd/client-gen/args/gvpackages.go +++ /dev/null @@ -1,183 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package args - -import ( - "bytes" - "encoding/csv" - "flag" - "path" - "sort" - "strings" - - "k8s.io/code-generator/cmd/client-gen/types" -) - -type inputBasePathValue struct { - builder *groupVersionsBuilder -} - -var _ flag.Value = &inputBasePathValue{} - -func NewInputBasePathValue(builder *groupVersionsBuilder, def string) *inputBasePathValue { - v := &inputBasePathValue{ - builder: builder, - } - v.Set(def) - return v -} - -func (s *inputBasePathValue) Set(val string) error { - s.builder.importBasePath = val - return s.builder.update() -} - -func (s *inputBasePathValue) Type() string { - return "string" -} - -func (s *inputBasePathValue) String() string { - return s.builder.importBasePath -} - -type gvPackagesValue struct { - builder *groupVersionsBuilder - groups []string - changed bool -} - -func NewGVPackagesValue(builder *groupVersionsBuilder, def []string) *gvPackagesValue { - gvp := new(gvPackagesValue) - gvp.builder = builder - if def != nil { - if err := gvp.set(def); err != nil { - panic(err) - } - } - return gvp -} - -var _ flag.Value = &gvPackagesValue{} - -func (s *gvPackagesValue) set(vs []string) error { - if s.changed { - s.groups = append(s.groups, vs...) - } else { - s.groups = append([]string(nil), vs...) - } - - s.builder.groups = s.groups - return s.builder.update() -} - -func (s *gvPackagesValue) Set(val string) error { - vs, err := readAsCSV(val) - if err != nil { - return err - } - if err := s.set(vs); err != nil { - return err - } - s.changed = true - return nil -} - -func (s *gvPackagesValue) Type() string { - return "stringSlice" -} - -func (s *gvPackagesValue) String() string { - str, _ := writeAsCSV(s.groups) - return "[" + str + "]" -} - -type groupVersionsBuilder struct { - value *[]types.GroupVersions - groups []string - importBasePath string -} - -func NewGroupVersionsBuilder(groups *[]types.GroupVersions) *groupVersionsBuilder { - return &groupVersionsBuilder{ - value: groups, - } -} - -func (p *groupVersionsBuilder) update() error { - var seenGroups = make(map[types.Group]*types.GroupVersions) - for _, v := range p.groups { - pth, gvString := parsePathGroupVersion(v) - gv, err := types.ToGroupVersion(gvString) - if err != nil { - return err - } - - versionPkg := types.PackageVersion{Package: path.Join(p.importBasePath, pth, gv.Group.NonEmpty(), gv.Version.String()), Version: gv.Version} - if group, ok := seenGroups[gv.Group]; ok { - seenGroups[gv.Group].Versions = append(group.Versions, versionPkg) - } else { - seenGroups[gv.Group] = &types.GroupVersions{ - PackageName: gv.Group.NonEmpty(), - Group: gv.Group, - Versions: []types.PackageVersion{versionPkg}, - } - } - } - - var groupNames []string - for groupName := range seenGroups { - groupNames = append(groupNames, groupName.String()) - } - sort.Strings(groupNames) - *p.value = []types.GroupVersions{} - for _, groupName := range groupNames { - *p.value = append(*p.value, *seenGroups[types.Group(groupName)]) - } - - return nil -} - -func parsePathGroupVersion(pgvString string) (gvPath string, gvString string) { - subs := strings.Split(pgvString, "/") - length := len(subs) - switch length { - case 0, 1, 2: - return "", pgvString - default: - return strings.Join(subs[:length-2], "/"), strings.Join(subs[length-2:], "/") - } -} - -func readAsCSV(val string) ([]string, error) { - if val == "" { - return []string{}, nil - } - stringReader := strings.NewReader(val) - csvReader := csv.NewReader(stringReader) - return csvReader.Read() -} - -func writeAsCSV(vals []string) (string, error) { - b := &bytes.Buffer{} - w := csv.NewWriter(b) - err := w.Write(vals) - if err != nil { - return "", err - } - w.Flush() - return strings.TrimSuffix(b.String(), "\n"), nil -} diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/args/gvtype.go b/vendor/k8s.io/code-generator/cmd/client-gen/args/gvtype.go deleted file mode 100644 index e4e3ccb..0000000 --- a/vendor/k8s.io/code-generator/cmd/client-gen/args/gvtype.go +++ /dev/null @@ -1,110 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package args - -import ( - "flag" - "fmt" - "strings" - - "k8s.io/code-generator/cmd/client-gen/types" -) - -type gvTypeValue struct { - gvToTypes *map[types.GroupVersion][]string - changed bool -} - -func NewGVTypesValue(gvToTypes *map[types.GroupVersion][]string, def []string) *gvTypeValue { - gvt := new(gvTypeValue) - gvt.gvToTypes = gvToTypes - if def != nil { - if err := gvt.set(def); err != nil { - panic(err) - } - } - return gvt -} - -var _ flag.Value = &gvTypeValue{} - -func (s *gvTypeValue) set(vs []string) error { - if !s.changed { - *s.gvToTypes = map[types.GroupVersion][]string{} - } - - for _, input := range vs { - gvString, typeStr, err := parseGroupVersionType(input) - if err != nil { - return err - } - gv, err := types.ToGroupVersion(gvString) - if err != nil { - return err - } - types, ok := (*s.gvToTypes)[gv] - if !ok { - types = []string{} - } - types = append(types, typeStr) - (*s.gvToTypes)[gv] = types - } - - return nil -} - -func (s *gvTypeValue) Set(val string) error { - vs, err := readAsCSV(val) - if err != nil { - return err - } - if err := s.set(vs); err != nil { - return err - } - s.changed = true - return nil -} - -func (s *gvTypeValue) Type() string { - return "stringSlice" -} - -func (s *gvTypeValue) String() string { - strs := make([]string, 0, len(*s.gvToTypes)) - for gv, ts := range *s.gvToTypes { - for _, t := range ts { - strs = append(strs, gv.Group.String()+"/"+gv.Version.String()+"/"+t) - } - } - str, _ := writeAsCSV(strs) - return "[" + str + "]" -} - -func parseGroupVersionType(gvtString string) (gvString string, typeStr string, err error) { - invalidFormatErr := fmt.Errorf("invalid value: %s, should be of the form group/version/type", gvtString) - subs := strings.Split(gvtString, "/") - length := len(subs) - switch length { - case 2: - // gvtString of the form group/type, e.g. api/Service,extensions/ReplicaSet - return subs[0] + "/", subs[1], nil - case 3: - return strings.Join(subs[:length-1], "/"), subs[length-1], nil - default: - return "", "", invalidFormatErr - } -} diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go deleted file mode 100644 index 1898074..0000000 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go +++ /dev/null @@ -1,403 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package generators has the generators for the client-gen utility. -package generators - -import ( - "path/filepath" - "strings" - - clientgenargs "k8s.io/code-generator/cmd/client-gen/args" - "k8s.io/code-generator/cmd/client-gen/generators/fake" - "k8s.io/code-generator/cmd/client-gen/generators/scheme" - "k8s.io/code-generator/cmd/client-gen/generators/util" - "k8s.io/code-generator/cmd/client-gen/path" - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - codegennamer "k8s.io/code-generator/pkg/namer" - "k8s.io/gengo/args" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/klog" -) - -// NameSystems returns the name system used by the generators in this package. -func NameSystems() namer.NameSystems { - pluralExceptions := map[string]string{ - "Endpoints": "Endpoints", - } - lowercaseNamer := namer.NewAllLowercasePluralNamer(pluralExceptions) - - publicNamer := &ExceptionNamer{ - Exceptions: map[string]string{ - // these exceptions are used to deconflict the generated code - // you can put your fully qualified package like - // to generate a name that doesn't conflict with your group. - // "k8s.io/apis/events/v1beta1.Event": "EventResource" - }, - KeyFunc: func(t *types.Type) string { - return t.Name.Package + "." + t.Name.Name - }, - Delegate: namer.NewPublicNamer(0), - } - privateNamer := &ExceptionNamer{ - Exceptions: map[string]string{ - // these exceptions are used to deconflict the generated code - // you can put your fully qualified package like - // to generate a name that doesn't conflict with your group. - // "k8s.io/apis/events/v1beta1.Event": "eventResource" - }, - KeyFunc: func(t *types.Type) string { - return t.Name.Package + "." + t.Name.Name - }, - Delegate: namer.NewPrivateNamer(0), - } - publicPluralNamer := &ExceptionNamer{ - Exceptions: map[string]string{ - // these exceptions are used to deconflict the generated code - // you can put your fully qualified package like - // to generate a name that doesn't conflict with your group. - // "k8s.io/apis/events/v1beta1.Event": "EventResource" - }, - KeyFunc: func(t *types.Type) string { - return t.Name.Package + "." + t.Name.Name - }, - Delegate: namer.NewPublicPluralNamer(pluralExceptions), - } - privatePluralNamer := &ExceptionNamer{ - Exceptions: map[string]string{ - // you can put your fully qualified package like - // to generate a name that doesn't conflict with your group. - // "k8s.io/apis/events/v1beta1.Event": "eventResource" - // these exceptions are used to deconflict the generated code - "k8s.io/apis/events/v1beta1.Event": "eventResources", - "k8s.io/kubernetes/pkg/apis/events.Event": "eventResources", - }, - KeyFunc: func(t *types.Type) string { - return t.Name.Package + "." + t.Name.Name - }, - Delegate: namer.NewPrivatePluralNamer(pluralExceptions), - } - - return namer.NameSystems{ - "singularKind": namer.NewPublicNamer(0), - "public": publicNamer, - "private": privateNamer, - "raw": namer.NewRawNamer("", nil), - "publicPlural": publicPluralNamer, - "privatePlural": privatePluralNamer, - "allLowercasePlural": lowercaseNamer, - "resource": codegennamer.NewTagOverrideNamer("resourceName", lowercaseNamer), - } -} - -// ExceptionNamer allows you specify exceptional cases with exact names. This allows you to have control -// for handling various conflicts, like group and resource names for instance. -type ExceptionNamer struct { - Exceptions map[string]string - KeyFunc func(*types.Type) string - - Delegate namer.Namer -} - -// Name provides the requested name for a type. -func (n *ExceptionNamer) Name(t *types.Type) string { - key := n.KeyFunc(t) - if exception, ok := n.Exceptions[key]; ok { - return exception - } - return n.Delegate.Name(t) -} - -// DefaultNameSystem returns the default name system for ordering the types to be -// processed by the generators in this package. -func DefaultNameSystem() string { - return "public" -} - -func packageForGroup(gv clientgentypes.GroupVersion, typeList []*types.Type, clientsetPackage string, groupPackageName string, groupGoName string, apiPath string, srcTreePath string, inputPackage string, boilerplate []byte) generator.Package { - groupVersionClientPackage := filepath.Join(clientsetPackage, "typed", strings.ToLower(groupPackageName), strings.ToLower(gv.Version.NonEmpty())) - return &generator.DefaultPackage{ - PackageName: strings.ToLower(gv.Version.NonEmpty()), - PackagePath: groupVersionClientPackage, - HeaderText: boilerplate, - PackageDocumentation: []byte( - `// This package has the automatically generated typed clients. -`), - // GeneratorFunc returns a list of generators. Each generator makes a - // single file. - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - generators = []generator.Generator{ - // Always generate a "doc.go" file. - generator.DefaultGen{OptionalName: "doc"}, - } - // Since we want a file per type that we generate a client for, we - // have to provide a function for this. - for _, t := range typeList { - generators = append(generators, &genClientForType{ - DefaultGen: generator.DefaultGen{ - OptionalName: strings.ToLower(c.Namers["private"].Name(t)), - }, - outputPackage: groupVersionClientPackage, - clientsetPackage: clientsetPackage, - group: gv.Group.NonEmpty(), - version: gv.Version.String(), - groupGoName: groupGoName, - typeToMatch: t, - imports: generator.NewImportTracker(), - }) - } - - generators = append(generators, &genGroup{ - DefaultGen: generator.DefaultGen{ - OptionalName: groupPackageName + "_client", - }, - outputPackage: groupVersionClientPackage, - inputPackage: inputPackage, - clientsetPackage: clientsetPackage, - group: gv.Group.NonEmpty(), - version: gv.Version.String(), - groupGoName: groupGoName, - apiPath: apiPath, - types: typeList, - imports: generator.NewImportTracker(), - }) - - expansionFileName := "generated_expansion" - generators = append(generators, &genExpansion{ - groupPackagePath: filepath.Join(srcTreePath, groupVersionClientPackage), - DefaultGen: generator.DefaultGen{ - OptionalName: expansionFileName, - }, - types: typeList, - }) - - return generators - }, - FilterFunc: func(c *generator.Context, t *types.Type) bool { - return util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)).GenerateClient - }, - } -} - -func packageForClientset(customArgs *clientgenargs.CustomArgs, clientsetPackage string, groupGoNames map[clientgentypes.GroupVersion]string, boilerplate []byte) generator.Package { - return &generator.DefaultPackage{ - PackageName: customArgs.ClientsetName, - PackagePath: clientsetPackage, - HeaderText: boilerplate, - PackageDocumentation: []byte( - `// This package has the automatically generated clientset. -`), - // GeneratorFunc returns a list of generators. Each generator generates a - // single file. - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - generators = []generator.Generator{ - // Always generate a "doc.go" file. - generator.DefaultGen{OptionalName: "doc"}, - - &genClientset{ - DefaultGen: generator.DefaultGen{ - OptionalName: "clientset", - }, - groups: customArgs.Groups, - groupGoNames: groupGoNames, - clientsetPackage: clientsetPackage, - outputPackage: customArgs.ClientsetName, - imports: generator.NewImportTracker(), - }, - } - return generators - }, - } -} - -func packageForScheme(customArgs *clientgenargs.CustomArgs, clientsetPackage string, srcTreePath string, groupGoNames map[clientgentypes.GroupVersion]string, boilerplate []byte) generator.Package { - schemePackage := filepath.Join(clientsetPackage, "scheme") - - // create runtime.Registry for internal client because it has to know about group versions - internalClient := false -NextGroup: - for _, group := range customArgs.Groups { - for _, v := range group.Versions { - if v.String() == "" { - internalClient = true - break NextGroup - } - } - } - - return &generator.DefaultPackage{ - PackageName: "scheme", - PackagePath: schemePackage, - HeaderText: boilerplate, - PackageDocumentation: []byte( - `// This package contains the scheme of the automatically generated clientset. -`), - // GeneratorFunc returns a list of generators. Each generator generates a - // single file. - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - generators = []generator.Generator{ - // Always generate a "doc.go" file. - generator.DefaultGen{OptionalName: "doc"}, - - &scheme.GenScheme{ - DefaultGen: generator.DefaultGen{ - OptionalName: "register", - }, - InputPackages: customArgs.GroupVersionPackages(), - OutputPackage: schemePackage, - OutputPath: filepath.Join(srcTreePath, schemePackage), - Groups: customArgs.Groups, - GroupGoNames: groupGoNames, - ImportTracker: generator.NewImportTracker(), - CreateRegistry: internalClient, - }, - } - return generators - }, - } -} - -// applyGroupOverrides applies group name overrides to each package, if applicable. If there is a -// comment of the form "// +groupName=somegroup" or "// +groupName=somegroup.foo.bar.io", use the -// first field (somegroup) as the name of the group in Go code, e.g. as the func name in a clientset. -// -// If the first field of the groupName is not unique within the clientset, use "// +groupName=unique -func applyGroupOverrides(universe types.Universe, customArgs *clientgenargs.CustomArgs) { - // Create a map from "old GV" to "new GV" so we know what changes we need to make. - changes := make(map[clientgentypes.GroupVersion]clientgentypes.GroupVersion) - for gv, inputDir := range customArgs.GroupVersionPackages() { - p := universe.Package(inputDir) - if override := types.ExtractCommentTags("+", p.Comments)["groupName"]; override != nil { - newGV := clientgentypes.GroupVersion{ - Group: clientgentypes.Group(override[0]), - Version: gv.Version, - } - changes[gv] = newGV - } - } - - // Modify customArgs.Groups based on the groupName overrides. - newGroups := make([]clientgentypes.GroupVersions, 0, len(customArgs.Groups)) - for _, gvs := range customArgs.Groups { - gv := clientgentypes.GroupVersion{ - Group: gvs.Group, - Version: gvs.Versions[0].Version, // we only need a version, and the first will do - } - if newGV, ok := changes[gv]; ok { - // There's an override, so use it. - newGVS := clientgentypes.GroupVersions{ - PackageName: gvs.PackageName, - Group: newGV.Group, - Versions: gvs.Versions, - } - newGroups = append(newGroups, newGVS) - } else { - // No override. - newGroups = append(newGroups, gvs) - } - } - customArgs.Groups = newGroups -} - -// Packages makes the client package definition. -func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { - boilerplate, err := arguments.LoadGoBoilerplate() - if err != nil { - klog.Fatalf("Failed loading boilerplate: %v", err) - } - - customArgs, ok := arguments.CustomArgs.(*clientgenargs.CustomArgs) - if !ok { - klog.Fatalf("cannot convert arguments.CustomArgs to clientgenargs.CustomArgs") - } - includedTypesOverrides := customArgs.IncludedTypesOverrides - - applyGroupOverrides(context.Universe, customArgs) - - gvToTypes := map[clientgentypes.GroupVersion][]*types.Type{} - groupGoNames := make(map[clientgentypes.GroupVersion]string) - for gv, inputDir := range customArgs.GroupVersionPackages() { - p := context.Universe.Package(path.Vendorless(inputDir)) - - // If there's a comment of the form "// +groupGoName=SomeUniqueShortName", use that as - // the Go group identifier in CamelCase. It defaults - groupGoNames[gv] = namer.IC(strings.Split(gv.Group.NonEmpty(), ".")[0]) - if override := types.ExtractCommentTags("+", p.Comments)["groupGoName"]; override != nil { - groupGoNames[gv] = namer.IC(override[0]) - } - - // Package are indexed with the vendor prefix stripped - for n, t := range p.Types { - // filter out types which are not included in user specified overrides. - typesOverride, ok := includedTypesOverrides[gv] - if ok { - found := false - for _, typeStr := range typesOverride { - if typeStr == n { - found = true - break - } - } - if !found { - continue - } - } else { - // User has not specified any override for this group version. - // filter out types which dont have genclient. - if tags := util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)); !tags.GenerateClient { - continue - } - } - if _, found := gvToTypes[gv]; !found { - gvToTypes[gv] = []*types.Type{} - } - gvToTypes[gv] = append(gvToTypes[gv], t) - } - } - - var packageList []generator.Package - clientsetPackage := filepath.Join(arguments.OutputPackagePath, customArgs.ClientsetName) - - packageList = append(packageList, packageForClientset(customArgs, clientsetPackage, groupGoNames, boilerplate)) - packageList = append(packageList, packageForScheme(customArgs, clientsetPackage, arguments.OutputBase, groupGoNames, boilerplate)) - if customArgs.FakeClient { - packageList = append(packageList, fake.PackageForClientset(customArgs, clientsetPackage, groupGoNames, boilerplate)) - } - - // If --clientset-only=true, we don't regenerate the individual typed clients. - if customArgs.ClientsetOnly { - return generator.Packages(packageList) - } - - orderer := namer.Orderer{Namer: namer.NewPrivateNamer(0)} - gvPackages := customArgs.GroupVersionPackages() - for _, group := range customArgs.Groups { - for _, version := range group.Versions { - gv := clientgentypes.GroupVersion{Group: group.Group, Version: version.Version} - types := gvToTypes[gv] - inputPath := gvPackages[gv] - packageList = append(packageList, packageForGroup(gv, orderer.OrderTypes(types), clientsetPackage, group.PackageName, groupGoNames[gv], customArgs.ClientsetAPIPath, arguments.OutputBase, inputPath, boilerplate)) - if customArgs.FakeClient { - packageList = append(packageList, fake.PackageForGroup(gv, orderer.OrderTypes(types), clientsetPackage, group.PackageName, groupGoNames[gv], inputPath, boilerplate)) - } - } - } - - return generator.Packages(packageList) -} diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/fake_client_generator.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/fake_client_generator.go deleted file mode 100644 index 4b3854b..0000000 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/fake_client_generator.go +++ /dev/null @@ -1,130 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - "path/filepath" - "strings" - - "k8s.io/gengo/generator" - "k8s.io/gengo/types" - - clientgenargs "k8s.io/code-generator/cmd/client-gen/args" - scheme "k8s.io/code-generator/cmd/client-gen/generators/scheme" - "k8s.io/code-generator/cmd/client-gen/generators/util" - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" -) - -func PackageForGroup(gv clientgentypes.GroupVersion, typeList []*types.Type, clientsetPackage string, groupPackageName string, groupGoName string, inputPackage string, boilerplate []byte) generator.Package { - outputPackage := filepath.Join(clientsetPackage, "typed", strings.ToLower(groupPackageName), strings.ToLower(gv.Version.NonEmpty()), "fake") - // TODO: should make this a function, called by here and in client-generator.go - realClientPackage := filepath.Join(clientsetPackage, "typed", strings.ToLower(groupPackageName), strings.ToLower(gv.Version.NonEmpty())) - return &generator.DefaultPackage{ - PackageName: "fake", - PackagePath: outputPackage, - HeaderText: boilerplate, - PackageDocumentation: []byte( - `// Package fake has the automatically generated clients. -`), - // GeneratorFunc returns a list of generators. Each generator makes a - // single file. - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - generators = []generator.Generator{ - // Always generate a "doc.go" file. - generator.DefaultGen{OptionalName: "doc"}, - } - // Since we want a file per type that we generate a client for, we - // have to provide a function for this. - for _, t := range typeList { - generators = append(generators, &genFakeForType{ - DefaultGen: generator.DefaultGen{ - OptionalName: "fake_" + strings.ToLower(c.Namers["private"].Name(t)), - }, - outputPackage: outputPackage, - inputPackage: inputPackage, - group: gv.Group.NonEmpty(), - version: gv.Version.String(), - groupGoName: groupGoName, - typeToMatch: t, - imports: generator.NewImportTracker(), - }) - } - - generators = append(generators, &genFakeForGroup{ - DefaultGen: generator.DefaultGen{ - OptionalName: "fake_" + groupPackageName + "_client", - }, - outputPackage: outputPackage, - realClientPackage: realClientPackage, - group: gv.Group.NonEmpty(), - version: gv.Version.String(), - groupGoName: groupGoName, - types: typeList, - imports: generator.NewImportTracker(), - }) - return generators - }, - FilterFunc: func(c *generator.Context, t *types.Type) bool { - return util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)).GenerateClient - }, - } -} - -func PackageForClientset(customArgs *clientgenargs.CustomArgs, clientsetPackage string, groupGoNames map[clientgentypes.GroupVersion]string, boilerplate []byte) generator.Package { - return &generator.DefaultPackage{ - // TODO: we'll generate fake clientset for different release in the future. - // Package name and path are hard coded for now. - PackageName: "fake", - PackagePath: filepath.Join(clientsetPackage, "fake"), - HeaderText: boilerplate, - PackageDocumentation: []byte( - `// This package has the automatically generated fake clientset. -`), - // GeneratorFunc returns a list of generators. Each generator generates a - // single file. - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - generators = []generator.Generator{ - // Always generate a "doc.go" file. - generator.DefaultGen{OptionalName: "doc"}, - - &genClientset{ - DefaultGen: generator.DefaultGen{ - OptionalName: "clientset_generated", - }, - groups: customArgs.Groups, - groupGoNames: groupGoNames, - fakeClientsetPackage: clientsetPackage, - outputPackage: "fake", - imports: generator.NewImportTracker(), - realClientsetPackage: clientsetPackage, - }, - &scheme.GenScheme{ - DefaultGen: generator.DefaultGen{ - OptionalName: "register", - }, - InputPackages: customArgs.GroupVersionPackages(), - OutputPackage: clientsetPackage, - Groups: customArgs.Groups, - GroupGoNames: groupGoNames, - ImportTracker: generator.NewImportTracker(), - PrivateScheme: true, - }, - } - return generators - }, - } -} diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_clientset.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_clientset.go deleted file mode 100644 index d23b800..0000000 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_clientset.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - "fmt" - "io" - "path/filepath" - "strings" - - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -// genClientset generates a package for a clientset. -type genClientset struct { - generator.DefaultGen - groups []clientgentypes.GroupVersions - groupGoNames map[clientgentypes.GroupVersion]string - fakeClientsetPackage string - outputPackage string - imports namer.ImportTracker - clientsetGenerated bool - // the import path of the generated real clientset. - realClientsetPackage string -} - -var _ generator.Generator = &genClientset{} - -func (g *genClientset) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -// We only want to call GenerateType() once. -func (g *genClientset) Filter(c *generator.Context, t *types.Type) bool { - ret := !g.clientsetGenerated - g.clientsetGenerated = true - return ret -} - -func (g *genClientset) Imports(c *generator.Context) (imports []string) { - imports = append(imports, g.imports.ImportLines()...) - for _, group := range g.groups { - for _, version := range group.Versions { - groupClientPackage := filepath.Join(g.fakeClientsetPackage, "typed", strings.ToLower(group.PackageName), strings.ToLower(version.NonEmpty())) - fakeGroupClientPackage := filepath.Join(groupClientPackage, "fake") - - groupAlias := strings.ToLower(g.groupGoNames[clientgentypes.GroupVersion{Group: group.Group, Version: version.Version}]) - imports = append(imports, fmt.Sprintf("%s%s \"%s\"", groupAlias, strings.ToLower(version.NonEmpty()), groupClientPackage)) - imports = append(imports, fmt.Sprintf("fake%s%s \"%s\"", groupAlias, strings.ToLower(version.NonEmpty()), fakeGroupClientPackage)) - } - } - // the package that has the clientset Interface - imports = append(imports, fmt.Sprintf("clientset \"%s\"", g.realClientsetPackage)) - // imports for the code in commonTemplate - imports = append(imports, - "k8s.io/client-go/testing", - "k8s.io/client-go/discovery", - "fakediscovery \"k8s.io/client-go/discovery/fake\"", - "k8s.io/apimachinery/pkg/runtime", - "k8s.io/apimachinery/pkg/watch", - ) - - return -} - -func (g *genClientset) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - // TODO: We actually don't need any type information to generate the clientset, - // perhaps we can adapt the go2ild framework to this kind of usage. - sw := generator.NewSnippetWriter(w, c, "$", "$") - - allGroups := clientgentypes.ToGroupVersionInfo(g.groups, g.groupGoNames) - - sw.Do(common, nil) - sw.Do(checkImpl, nil) - - for _, group := range allGroups { - m := map[string]interface{}{ - "group": group.Group, - "version": group.Version, - "PackageAlias": group.PackageAlias, - "GroupGoName": group.GroupGoName, - "Version": namer.IC(group.Version.String()), - } - - sw.Do(clientsetInterfaceImplTemplate, m) - } - - return sw.Error() -} - -// This part of code is version-independent, unchanging. -var common = ` -// NewSimpleClientset returns a clientset that will respond with the provided objects. -// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any validations and/or defaults. It shouldn't be considered a replacement -// for a real clientset and is mostly useful in simple unit tests. -func NewSimpleClientset(objects ...runtime.Object) *Clientset { - o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) - for _, obj := range objects { - if err := o.Add(obj); err != nil { - panic(err) - } - } - - cs := &Clientset{tracker: o} - cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} - cs.AddReactor("*", "*", testing.ObjectReaction(o)) - cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { - gvr := action.GetResource() - ns := action.GetNamespace() - watch, err := o.Watch(gvr, ns) - if err != nil { - return false, nil, err - } - return true, watch, nil - }) - - return cs -} - -// Clientset implements clientset.Interface. Meant to be embedded into a -// struct to get a default implementation. This makes faking out just the method -// you want to test easier. -type Clientset struct { - testing.Fake - discovery *fakediscovery.FakeDiscovery - tracker testing.ObjectTracker -} - -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - return c.discovery -} - -func (c *Clientset) Tracker() testing.ObjectTracker { - return c.tracker -} -` - -var checkImpl = ` -var _ clientset.Interface = &Clientset{} -` - -var clientsetInterfaceImplTemplate = ` -// $.GroupGoName$$.Version$ retrieves the $.GroupGoName$$.Version$Client -func (c *Clientset) $.GroupGoName$$.Version$() $.PackageAlias$.$.GroupGoName$$.Version$Interface { - return &fake$.PackageAlias$.Fake$.GroupGoName$$.Version${Fake: &c.Fake} -} -` diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_group.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_group.go deleted file mode 100644 index 8f4d578..0000000 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_group.go +++ /dev/null @@ -1,130 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - "fmt" - "io" - "path/filepath" - "strings" - - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/code-generator/cmd/client-gen/generators/util" -) - -// genFakeForGroup produces a file for a group client, e.g. ExtensionsClient for the extension group. -type genFakeForGroup struct { - generator.DefaultGen - outputPackage string - realClientPackage string - group string - version string - groupGoName string - // types in this group - types []*types.Type - imports namer.ImportTracker - // If the genGroup has been called. This generator should only execute once. - called bool -} - -var _ generator.Generator = &genFakeForGroup{} - -// We only want to call GenerateType() once per group. -func (g *genFakeForGroup) Filter(c *generator.Context, t *types.Type) bool { - if !g.called { - g.called = true - return true - } - return false -} - -func (g *genFakeForGroup) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *genFakeForGroup) Imports(c *generator.Context) (imports []string) { - imports = g.imports.ImportLines() - if len(g.types) != 0 { - imports = append(imports, fmt.Sprintf("%s \"%s\"", strings.ToLower(filepath.Base(g.realClientPackage)), g.realClientPackage)) - } - return imports -} - -func (g *genFakeForGroup) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - - m := map[string]interface{}{ - "GroupGoName": g.groupGoName, - "Version": namer.IC(g.version), - "Fake": c.Universe.Type(types.Name{Package: "k8s.io/client-go/testing", Name: "Fake"}), - "RESTClientInterface": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Interface"}), - "RESTClient": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "RESTClient"}), - } - - sw.Do(groupClientTemplate, m) - for _, t := range g.types { - tags, err := util.ParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) - if err != nil { - return err - } - wrapper := map[string]interface{}{ - "type": t, - "GroupGoName": g.groupGoName, - "Version": namer.IC(g.version), - "realClientPackage": strings.ToLower(filepath.Base(g.realClientPackage)), - } - if tags.NonNamespaced { - sw.Do(getterImplNonNamespaced, wrapper) - continue - } - sw.Do(getterImplNamespaced, wrapper) - } - sw.Do(getRESTClient, m) - return sw.Error() -} - -var groupClientTemplate = ` -type Fake$.GroupGoName$$.Version$ struct { - *$.Fake|raw$ -} -` - -var getterImplNamespaced = ` -func (c *Fake$.GroupGoName$$.Version$) $.type|publicPlural$(namespace string) $.realClientPackage$.$.type|public$Interface { - return &Fake$.type|publicPlural${c, namespace} -} -` - -var getterImplNonNamespaced = ` -func (c *Fake$.GroupGoName$$.Version$) $.type|publicPlural$() $.realClientPackage$.$.type|public$Interface { - return &Fake$.type|publicPlural${c} -} -` - -var getRESTClient = ` -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *Fake$.GroupGoName$$.Version$) RESTClient() $.RESTClientInterface|raw$ { - var ret *$.RESTClient|raw$ - return ret -} -` diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go deleted file mode 100644 index f5888ae..0000000 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go +++ /dev/null @@ -1,479 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - "io" - "path/filepath" - "strings" - - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/code-generator/cmd/client-gen/generators/util" - "k8s.io/code-generator/cmd/client-gen/path" -) - -// genFakeForType produces a file for each top-level type. -type genFakeForType struct { - generator.DefaultGen - outputPackage string - group string - version string - groupGoName string - inputPackage string - typeToMatch *types.Type - imports namer.ImportTracker -} - -var _ generator.Generator = &genFakeForType{} - -// Filter ignores all but one type because we're making a single file per type. -func (g *genFakeForType) Filter(c *generator.Context, t *types.Type) bool { return t == g.typeToMatch } - -func (g *genFakeForType) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *genFakeForType) Imports(c *generator.Context) (imports []string) { - return g.imports.ImportLines() -} - -// Ideally, we'd like genStatus to return true if there is a subresource path -// registered for "status" in the API server, but we do not have that -// information, so genStatus returns true if the type has a status field. -func genStatus(t *types.Type) bool { - // Default to true if we have a Status member - hasStatus := false - for _, m := range t.Members { - if m.Name == "Status" { - hasStatus = true - break - } - } - - tags := util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) - return hasStatus && !tags.NoStatus -} - -// hasObjectMeta returns true if the type has a ObjectMeta field. -func hasObjectMeta(t *types.Type) bool { - for _, m := range t.Members { - if m.Embedded == true && m.Name == "ObjectMeta" { - return true - } - } - return false -} - -// GenerateType makes the body of a file implementing the individual typed client for type t. -func (g *genFakeForType) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - pkg := filepath.Base(t.Name.Package) - tags, err := util.ParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) - if err != nil { - return err - } - canonicalGroup := g.group - if canonicalGroup == "core" { - canonicalGroup = "" - } - - groupName := g.group - if g.group == "core" { - groupName = "" - } - - // allow user to define a group name that's different from the one parsed from the directory. - p := c.Universe.Package(path.Vendorless(g.inputPackage)) - if override := types.ExtractCommentTags("+", p.Comments)["groupName"]; override != nil { - groupName = override[0] - } - - const pkgClientGoTesting = "k8s.io/client-go/testing" - m := map[string]interface{}{ - "type": t, - "inputType": t, - "resultType": t, - "subresourcePath": "", - "package": pkg, - "Package": namer.IC(pkg), - "namespaced": !tags.NonNamespaced, - "Group": namer.IC(g.group), - "GroupGoName": g.groupGoName, - "Version": namer.IC(g.version), - "group": canonicalGroup, - "groupName": groupName, - "version": g.version, - "DeleteOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "DeleteOptions"}), - "ListOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "ListOptions"}), - "GetOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "GetOptions"}), - "Everything": c.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/labels", Name: "Everything"}), - "GroupVersionResource": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime/schema", Name: "GroupVersionResource"}), - "GroupVersionKind": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime/schema", Name: "GroupVersionKind"}), - "PatchType": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/types", Name: "PatchType"}), - "watchInterface": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/watch", Name: "Interface"}), - - "NewRootListAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootListAction"}), - "NewListAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewListAction"}), - "NewRootGetAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootGetAction"}), - "NewGetAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewGetAction"}), - "NewRootDeleteAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootDeleteAction"}), - "NewDeleteAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewDeleteAction"}), - "NewRootDeleteCollectionAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootDeleteCollectionAction"}), - "NewDeleteCollectionAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewDeleteCollectionAction"}), - "NewRootUpdateAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootUpdateAction"}), - "NewUpdateAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewUpdateAction"}), - "NewRootCreateAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootCreateAction"}), - "NewCreateAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewCreateAction"}), - "NewRootWatchAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootWatchAction"}), - "NewWatchAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewWatchAction"}), - "NewCreateSubresourceAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewCreateSubresourceAction"}), - "NewRootCreateSubresourceAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootCreateSubresourceAction"}), - "NewUpdateSubresourceAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewUpdateSubresourceAction"}), - "NewGetSubresourceAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewGetSubresourceAction"}), - "NewRootGetSubresourceAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootGetSubresourceAction"}), - "NewRootUpdateSubresourceAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootUpdateSubresourceAction"}), - "NewRootPatchAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootPatchAction"}), - "NewPatchAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewPatchAction"}), - "NewRootPatchSubresourceAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootPatchSubresourceAction"}), - "NewPatchSubresourceAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewPatchSubresourceAction"}), - "ExtractFromListOptions": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "ExtractFromListOptions"}), - } - - if tags.NonNamespaced { - sw.Do(structNonNamespaced, m) - } else { - sw.Do(structNamespaced, m) - } - - if tags.NoVerbs { - return sw.Error() - } - sw.Do(resource, m) - sw.Do(kind, m) - - if tags.HasVerb("get") { - sw.Do(getTemplate, m) - } - if tags.HasVerb("list") { - if hasObjectMeta(t) { - sw.Do(listUsingOptionsTemplate, m) - } else { - sw.Do(listTemplate, m) - } - } - if tags.HasVerb("watch") { - sw.Do(watchTemplate, m) - } - - if tags.HasVerb("create") { - sw.Do(createTemplate, m) - } - if tags.HasVerb("update") { - sw.Do(updateTemplate, m) - } - if tags.HasVerb("updateStatus") && genStatus(t) { - sw.Do(updateStatusTemplate, m) - } - if tags.HasVerb("delete") { - sw.Do(deleteTemplate, m) - } - if tags.HasVerb("deleteCollection") { - sw.Do(deleteCollectionTemplate, m) - } - if tags.HasVerb("patch") { - sw.Do(patchTemplate, m) - } - - // generate extended client methods - for _, e := range tags.Extensions { - inputType := *t - resultType := *t - if len(e.InputTypeOverride) > 0 { - if name, pkg := e.Input(); len(pkg) > 0 { - newType := c.Universe.Type(types.Name{Package: pkg, Name: name}) - inputType = *newType - } else { - inputType.Name.Name = e.InputTypeOverride - } - } - if len(e.ResultTypeOverride) > 0 { - if name, pkg := e.Result(); len(pkg) > 0 { - newType := c.Universe.Type(types.Name{Package: pkg, Name: name}) - resultType = *newType - } else { - resultType.Name.Name = e.ResultTypeOverride - } - } - m["inputType"] = &inputType - m["resultType"] = &resultType - m["subresourcePath"] = e.SubResourcePath - - if e.HasVerb("get") { - if e.IsSubresource() { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, getSubresourceTemplate), m) - } else { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, getTemplate), m) - } - } - - if e.HasVerb("list") { - - sw.Do(adjustTemplate(e.VerbName, e.VerbType, listTemplate), m) - } - - // TODO: Figure out schemantic for watching a sub-resource. - if e.HasVerb("watch") { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, watchTemplate), m) - } - - if e.HasVerb("create") { - if e.IsSubresource() { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, createSubresourceTemplate), m) - } else { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, createTemplate), m) - } - } - - if e.HasVerb("update") { - if e.IsSubresource() { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, updateSubresourceTemplate), m) - } else { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, updateTemplate), m) - } - } - - // TODO: Figure out schemantic for deleting a sub-resource (what arguments - // are passed, does it need two names? etc. - if e.HasVerb("delete") { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, deleteTemplate), m) - } - - if e.HasVerb("patch") { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, patchTemplate), m) - } - } - - return sw.Error() -} - -// adjustTemplate adjust the origin verb template using the expansion name. -// TODO: Make the verbs in templates parametrized so the strings.Replace() is -// not needed. -func adjustTemplate(name, verbType, template string) string { - return strings.Replace(template, " "+strings.Title(verbType), " "+name, -1) -} - -// template for the struct that implements the type's interface -var structNamespaced = ` -// Fake$.type|publicPlural$ implements $.type|public$Interface -type Fake$.type|publicPlural$ struct { - Fake *Fake$.GroupGoName$$.Version$ - ns string -} -` - -// template for the struct that implements the type's interface -var structNonNamespaced = ` -// Fake$.type|publicPlural$ implements $.type|public$Interface -type Fake$.type|publicPlural$ struct { - Fake *Fake$.GroupGoName$$.Version$ -} -` - -var resource = ` -var $.type|allLowercasePlural$Resource = $.GroupVersionResource|raw${Group: "$.groupName$", Version: "$.version$", Resource: "$.type|resource$"} -` - -var kind = ` -var $.type|allLowercasePlural$Kind = $.GroupVersionKind|raw${Group: "$.groupName$", Version: "$.version$", Kind: "$.type|singularKind$"} -` - -var listTemplate = ` -// List takes label and field selectors, and returns the list of $.type|publicPlural$ that match those selectors. -func (c *Fake$.type|publicPlural$) List(opts $.ListOptions|raw$) (result *$.type|raw$List, err error) { - obj, err := c.Fake. - $if .namespaced$Invokes($.NewListAction|raw$($.type|allLowercasePlural$Resource, $.type|allLowercasePlural$Kind, c.ns, opts), &$.type|raw$List{}) - $else$Invokes($.NewRootListAction|raw$($.type|allLowercasePlural$Resource, $.type|allLowercasePlural$Kind, opts), &$.type|raw$List{})$end$ - if obj == nil { - return nil, err - } - return obj.(*$.type|raw$List), err -} -` - -var listUsingOptionsTemplate = ` -// List takes label and field selectors, and returns the list of $.type|publicPlural$ that match those selectors. -func (c *Fake$.type|publicPlural$) List(opts $.ListOptions|raw$) (result *$.type|raw$List, err error) { - obj, err := c.Fake. - $if .namespaced$Invokes($.NewListAction|raw$($.type|allLowercasePlural$Resource, $.type|allLowercasePlural$Kind, c.ns, opts), &$.type|raw$List{}) - $else$Invokes($.NewRootListAction|raw$($.type|allLowercasePlural$Resource, $.type|allLowercasePlural$Kind, opts), &$.type|raw$List{})$end$ - if obj == nil { - return nil, err - } - - label, _, _ := $.ExtractFromListOptions|raw$(opts) - if label == nil { - label = $.Everything|raw$() - } - list := &$.type|raw$List{ListMeta: obj.(*$.type|raw$List).ListMeta} - for _, item := range obj.(*$.type|raw$List).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} -` - -var getTemplate = ` -// Get takes name of the $.type|private$, and returns the corresponding $.resultType|private$ object, and an error if there is any. -func (c *Fake$.type|publicPlural$) Get(name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { - obj, err := c.Fake. - $if .namespaced$Invokes($.NewGetAction|raw$($.type|allLowercasePlural$Resource, c.ns, name), &$.resultType|raw${}) - $else$Invokes($.NewRootGetAction|raw$($.type|allLowercasePlural$Resource, name), &$.resultType|raw${})$end$ - if obj == nil { - return nil, err - } - return obj.(*$.resultType|raw$), err -} -` - -var getSubresourceTemplate = ` -// Get takes name of the $.type|private$, and returns the corresponding $.resultType|private$ object, and an error if there is any. -func (c *Fake$.type|publicPlural$) Get($.type|private$Name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { - obj, err := c.Fake. - $if .namespaced$Invokes($.NewGetSubresourceAction|raw$($.type|allLowercasePlural$Resource, c.ns, "$.subresourcePath$", $.type|private$Name), &$.resultType|raw${}) - $else$Invokes($.NewRootGetSubresourceAction|raw$($.type|allLowercasePlural$Resource, "$.subresourcePath$", $.type|private$Name), &$.resultType|raw${})$end$ - if obj == nil { - return nil, err - } - return obj.(*$.resultType|raw$), err -} -` - -var deleteTemplate = ` -// Delete takes name of the $.type|private$ and deletes it. Returns an error if one occurs. -func (c *Fake$.type|publicPlural$) Delete(name string, options *$.DeleteOptions|raw$) error { - _, err := c.Fake. - $if .namespaced$Invokes($.NewDeleteAction|raw$($.type|allLowercasePlural$Resource, c.ns, name), &$.type|raw${}) - $else$Invokes($.NewRootDeleteAction|raw$($.type|allLowercasePlural$Resource, name), &$.type|raw${})$end$ - return err -} -` - -var deleteCollectionTemplate = ` -// DeleteCollection deletes a collection of objects. -func (c *Fake$.type|publicPlural$) DeleteCollection(options *$.DeleteOptions|raw$, listOptions $.ListOptions|raw$) error { - $if .namespaced$action := $.NewDeleteCollectionAction|raw$($.type|allLowercasePlural$Resource, c.ns, listOptions) - $else$action := $.NewRootDeleteCollectionAction|raw$($.type|allLowercasePlural$Resource, listOptions) - $end$ - _, err := c.Fake.Invokes(action, &$.type|raw$List{}) - return err -} -` -var createTemplate = ` -// Create takes the representation of a $.inputType|private$ and creates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *Fake$.type|publicPlural$) Create($.inputType|private$ *$.inputType|raw$) (result *$.resultType|raw$, err error) { - obj, err := c.Fake. - $if .namespaced$Invokes($.NewCreateAction|raw$($.inputType|allLowercasePlural$Resource, c.ns, $.inputType|private$), &$.resultType|raw${}) - $else$Invokes($.NewRootCreateAction|raw$($.inputType|allLowercasePlural$Resource, $.inputType|private$), &$.resultType|raw${})$end$ - if obj == nil { - return nil, err - } - return obj.(*$.resultType|raw$), err -} -` - -var createSubresourceTemplate = ` -// Create takes the representation of a $.inputType|private$ and creates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *Fake$.type|publicPlural$) Create($.type|private$Name string, $.inputType|private$ *$.inputType|raw$) (result *$.resultType|raw$, err error) { - obj, err := c.Fake. - $if .namespaced$Invokes($.NewCreateSubresourceAction|raw$($.type|allLowercasePlural$Resource, $.type|private$Name, "$.subresourcePath$", c.ns, $.inputType|private$), &$.resultType|raw${}) - $else$Invokes($.NewRootCreateSubresourceAction|raw$($.type|allLowercasePlural$Resource, "$.subresourcePath$", $.inputType|private$), &$.resultType|raw${})$end$ - if obj == nil { - return nil, err - } - return obj.(*$.resultType|raw$), err -} -` - -var updateTemplate = ` -// Update takes the representation of a $.inputType|private$ and updates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *Fake$.type|publicPlural$) Update($.inputType|private$ *$.inputType|raw$) (result *$.resultType|raw$, err error) { - obj, err := c.Fake. - $if .namespaced$Invokes($.NewUpdateAction|raw$($.inputType|allLowercasePlural$Resource, c.ns, $.inputType|private$), &$.resultType|raw${}) - $else$Invokes($.NewRootUpdateAction|raw$($.inputType|allLowercasePlural$Resource, $.inputType|private$), &$.resultType|raw${})$end$ - if obj == nil { - return nil, err - } - return obj.(*$.resultType|raw$), err -} -` - -var updateSubresourceTemplate = ` -// Update takes the representation of a $.inputType|private$ and updates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *Fake$.type|publicPlural$) Update($.type|private$Name string, $.inputType|private$ *$.inputType|raw$) (result *$.resultType|raw$, err error) { - obj, err := c.Fake. - $if .namespaced$Invokes($.NewUpdateSubresourceAction|raw$($.type|allLowercasePlural$Resource, "$.subresourcePath$", c.ns, $.inputType|private$), &$.inputType|raw${}) - $else$Invokes($.NewRootUpdateSubresourceAction|raw$($.type|allLowercasePlural$Resource, "$.subresourcePath$", $.inputType|private$), &$.resultType|raw${})$end$ - if obj == nil { - return nil, err - } - return obj.(*$.resultType|raw$), err -} -` - -var updateStatusTemplate = ` -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *Fake$.type|publicPlural$) UpdateStatus($.type|private$ *$.type|raw$) (*$.type|raw$, error) { - obj, err := c.Fake. - $if .namespaced$Invokes($.NewUpdateSubresourceAction|raw$($.type|allLowercasePlural$Resource, "status", c.ns, $.type|private$), &$.type|raw${}) - $else$Invokes($.NewRootUpdateSubresourceAction|raw$($.type|allLowercasePlural$Resource, "status", $.type|private$), &$.type|raw${})$end$ - if obj == nil { - return nil, err - } - return obj.(*$.type|raw$), err -} -` - -var watchTemplate = ` -// Watch returns a $.watchInterface|raw$ that watches the requested $.type|privatePlural$. -func (c *Fake$.type|publicPlural$) Watch(opts $.ListOptions|raw$) ($.watchInterface|raw$, error) { - return c.Fake. - $if .namespaced$InvokesWatch($.NewWatchAction|raw$($.type|allLowercasePlural$Resource, c.ns, opts)) - $else$InvokesWatch($.NewRootWatchAction|raw$($.type|allLowercasePlural$Resource, opts))$end$ -} -` - -var patchTemplate = ` -// Patch applies the patch and returns the patched $.resultType|private$. -func (c *Fake$.type|publicPlural$) Patch(name string, pt $.PatchType|raw$, data []byte, subresources ...string) (result *$.resultType|raw$, err error) { - obj, err := c.Fake. - $if .namespaced$Invokes($.NewPatchSubresourceAction|raw$($.type|allLowercasePlural$Resource, c.ns, name, pt, data, subresources... ), &$.resultType|raw${}) - $else$Invokes($.NewRootPatchSubresourceAction|raw$($.type|allLowercasePlural$Resource, name, pt, data, subresources...), &$.resultType|raw${})$end$ - if obj == nil { - return nil, err - } - return obj.(*$.resultType|raw$), err -} -` diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go deleted file mode 100644 index f725434..0000000 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go +++ /dev/null @@ -1,183 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generators - -import ( - "fmt" - "io" - "path/filepath" - "strings" - - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -// genClientset generates a package for a clientset. -type genClientset struct { - generator.DefaultGen - groups []clientgentypes.GroupVersions - groupGoNames map[clientgentypes.GroupVersion]string - clientsetPackage string - outputPackage string - imports namer.ImportTracker - clientsetGenerated bool -} - -var _ generator.Generator = &genClientset{} - -func (g *genClientset) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -// We only want to call GenerateType() once. -func (g *genClientset) Filter(c *generator.Context, t *types.Type) bool { - ret := !g.clientsetGenerated - g.clientsetGenerated = true - return ret -} - -func (g *genClientset) Imports(c *generator.Context) (imports []string) { - imports = append(imports, g.imports.ImportLines()...) - for _, group := range g.groups { - for _, version := range group.Versions { - typedClientPath := filepath.Join(g.clientsetPackage, "typed", strings.ToLower(group.PackageName), strings.ToLower(version.NonEmpty())) - groupAlias := strings.ToLower(g.groupGoNames[clientgentypes.GroupVersion{Group: group.Group, Version: version.Version}]) - imports = append(imports, fmt.Sprintf("%s%s \"%s\"", groupAlias, strings.ToLower(version.NonEmpty()), typedClientPath)) - } - } - return -} - -func (g *genClientset) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - // TODO: We actually don't need any type information to generate the clientset, - // perhaps we can adapt the go2ild framework to this kind of usage. - sw := generator.NewSnippetWriter(w, c, "$", "$") - - allGroups := clientgentypes.ToGroupVersionInfo(g.groups, g.groupGoNames) - m := map[string]interface{}{ - "allGroups": allGroups, - "Config": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Config"}), - "DefaultKubernetesUserAgent": c.Universe.Function(types.Name{Package: "k8s.io/client-go/rest", Name: "DefaultKubernetesUserAgent"}), - "RESTClientInterface": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Interface"}), - "DiscoveryInterface": c.Universe.Type(types.Name{Package: "k8s.io/client-go/discovery", Name: "DiscoveryInterface"}), - "DiscoveryClient": c.Universe.Type(types.Name{Package: "k8s.io/client-go/discovery", Name: "DiscoveryClient"}), - "NewDiscoveryClientForConfig": c.Universe.Function(types.Name{Package: "k8s.io/client-go/discovery", Name: "NewDiscoveryClientForConfig"}), - "NewDiscoveryClientForConfigOrDie": c.Universe.Function(types.Name{Package: "k8s.io/client-go/discovery", Name: "NewDiscoveryClientForConfigOrDie"}), - "NewDiscoveryClient": c.Universe.Function(types.Name{Package: "k8s.io/client-go/discovery", Name: "NewDiscoveryClient"}), - "flowcontrolNewTokenBucketRateLimiter": c.Universe.Function(types.Name{Package: "k8s.io/client-go/util/flowcontrol", Name: "NewTokenBucketRateLimiter"}), - } - sw.Do(clientsetInterface, m) - sw.Do(clientsetTemplate, m) - for _, g := range allGroups { - sw.Do(clientsetInterfaceImplTemplate, g) - } - sw.Do(getDiscoveryTemplate, m) - sw.Do(newClientsetForConfigTemplate, m) - sw.Do(newClientsetForConfigOrDieTemplate, m) - sw.Do(newClientsetForRESTClientTemplate, m) - - return sw.Error() -} - -var clientsetInterface = ` -type Interface interface { - Discovery() $.DiscoveryInterface|raw$ - $range .allGroups$$.GroupGoName$$.Version$() $.PackageAlias$.$.GroupGoName$$.Version$Interface - $end$ -} -` - -var clientsetTemplate = ` -// Clientset contains the clients for groups. Each group has exactly one -// version included in a Clientset. -type Clientset struct { - *$.DiscoveryClient|raw$ - $range .allGroups$$.LowerCaseGroupGoName$$.Version$ *$.PackageAlias$.$.GroupGoName$$.Version$Client - $end$ -} -` - -var clientsetInterfaceImplTemplate = ` -// $.GroupGoName$$.Version$ retrieves the $.GroupGoName$$.Version$Client -func (c *Clientset) $.GroupGoName$$.Version$() $.PackageAlias$.$.GroupGoName$$.Version$Interface { - return c.$.LowerCaseGroupGoName$$.Version$ -} -` - -var getDiscoveryTemplate = ` -// Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() $.DiscoveryInterface|raw$ { - if c == nil { - return nil - } - return c.DiscoveryClient -} -` - -var newClientsetForConfigTemplate = ` -// NewForConfig creates a new Clientset for the given config. -// If config's RateLimiter is not set and QPS and Burst are acceptable, -// NewForConfig will generate a rate-limiter in configShallowCopy. -func NewForConfig(c *$.Config|raw$) (*Clientset, error) { - configShallowCopy := *c - if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { - if configShallowCopy.Burst <= 0 { - return nil, fmt.Errorf("Burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") - } - configShallowCopy.RateLimiter = $.flowcontrolNewTokenBucketRateLimiter|raw$(configShallowCopy.QPS, configShallowCopy.Burst) - } - var cs Clientset - var err error -$range .allGroups$ cs.$.LowerCaseGroupGoName$$.Version$, err =$.PackageAlias$.NewForConfig(&configShallowCopy) - if err!=nil { - return nil, err - } -$end$ - cs.DiscoveryClient, err = $.NewDiscoveryClientForConfig|raw$(&configShallowCopy) - if err!=nil { - return nil, err - } - return &cs, nil -} -` - -var newClientsetForConfigOrDieTemplate = ` -// NewForConfigOrDie creates a new Clientset for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *$.Config|raw$) *Clientset { - var cs Clientset -$range .allGroups$ cs.$.LowerCaseGroupGoName$$.Version$ =$.PackageAlias$.NewForConfigOrDie(c) -$end$ - cs.DiscoveryClient = $.NewDiscoveryClientForConfigOrDie|raw$(c) - return &cs -} -` - -var newClientsetForRESTClientTemplate = ` -// New creates a new Clientset for the given RESTClient. -func New(c $.RESTClientInterface|raw$) *Clientset { - var cs Clientset -$range .allGroups$ cs.$.LowerCaseGroupGoName$$.Version$ =$.PackageAlias$.New(c) -$end$ - cs.DiscoveryClient = $.NewDiscoveryClient|raw$(c) - return &cs -} -` diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_expansion.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_expansion.go deleted file mode 100644 index f47c079..0000000 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_expansion.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generators - -import ( - "io" - "os" - "path/filepath" - "strings" - - "k8s.io/gengo/generator" - "k8s.io/gengo/types" -) - -// genExpansion produces a file for a group client, e.g. ExtensionsClient for the extension group. -type genExpansion struct { - generator.DefaultGen - groupPackagePath string - // types in a group - types []*types.Type -} - -// We only want to call GenerateType() once per group. -func (g *genExpansion) Filter(c *generator.Context, t *types.Type) bool { - return len(g.types) == 0 || t == g.types[0] -} - -func (g *genExpansion) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - for _, t := range g.types { - if _, err := os.Stat(filepath.Join(g.groupPackagePath, strings.ToLower(t.Name.Name+"_expansion.go"))); os.IsNotExist(err) { - sw.Do(expansionInterfaceTemplate, t) - } - } - return sw.Error() -} - -var expansionInterfaceTemplate = ` -type $.|public$Expansion interface {} -` diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_group.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_group.go deleted file mode 100644 index 215a017..0000000 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_group.go +++ /dev/null @@ -1,246 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generators - -import ( - "io" - "path/filepath" - - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/code-generator/cmd/client-gen/generators/util" - "k8s.io/code-generator/cmd/client-gen/path" -) - -// genGroup produces a file for a group client, e.g. ExtensionsClient for the extension group. -type genGroup struct { - generator.DefaultGen - outputPackage string - group string - version string - groupGoName string - apiPath string - // types in this group - types []*types.Type - imports namer.ImportTracker - inputPackage string - clientsetPackage string - // If the genGroup has been called. This generator should only execute once. - called bool -} - -var _ generator.Generator = &genGroup{} - -// We only want to call GenerateType() once per group. -func (g *genGroup) Filter(c *generator.Context, t *types.Type) bool { - if !g.called { - g.called = true - return true - } - return false -} - -func (g *genGroup) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *genGroup) Imports(c *generator.Context) (imports []string) { - imports = append(imports, g.imports.ImportLines()...) - imports = append(imports, filepath.Join(g.clientsetPackage, "scheme")) - return -} - -func (g *genGroup) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - - apiPath := func(group string) string { - if group == "core" { - return `"/api"` - } - return `"` + g.apiPath + `"` - } - - groupName := g.group - if g.group == "core" { - groupName = "" - } - // allow user to define a group name that's different from the one parsed from the directory. - p := c.Universe.Package(path.Vendorless(g.inputPackage)) - if override := types.ExtractCommentTags("+", p.Comments)["groupName"]; override != nil { - groupName = override[0] - } - - m := map[string]interface{}{ - "group": g.group, - "version": g.version, - "groupName": groupName, - "GroupGoName": g.groupGoName, - "Version": namer.IC(g.version), - "types": g.types, - "apiPath": apiPath(g.group), - "schemaGroupVersion": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime/schema", Name: "GroupVersion"}), - "runtimeAPIVersionInternal": c.Universe.Variable(types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "APIVersionInternal"}), - "restConfig": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Config"}), - "restDefaultKubernetesUserAgent": c.Universe.Function(types.Name{Package: "k8s.io/client-go/rest", Name: "DefaultKubernetesUserAgent"}), - "restRESTClientInterface": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Interface"}), - "restRESTClientFor": c.Universe.Function(types.Name{Package: "k8s.io/client-go/rest", Name: "RESTClientFor"}), - "SchemeGroupVersion": c.Universe.Variable(types.Name{Package: path.Vendorless(g.inputPackage), Name: "SchemeGroupVersion"}), - } - sw.Do(groupInterfaceTemplate, m) - sw.Do(groupClientTemplate, m) - for _, t := range g.types { - tags, err := util.ParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) - if err != nil { - return err - } - wrapper := map[string]interface{}{ - "type": t, - "GroupGoName": g.groupGoName, - "Version": namer.IC(g.version), - } - if tags.NonNamespaced { - sw.Do(getterImplNonNamespaced, wrapper) - } else { - sw.Do(getterImplNamespaced, wrapper) - } - } - sw.Do(newClientForConfigTemplate, m) - sw.Do(newClientForConfigOrDieTemplate, m) - sw.Do(newClientForRESTClientTemplate, m) - if g.version == "" { - sw.Do(setInternalVersionClientDefaultsTemplate, m) - } else { - sw.Do(setClientDefaultsTemplate, m) - } - sw.Do(getRESTClient, m) - - return sw.Error() -} - -var groupInterfaceTemplate = ` -type $.GroupGoName$$.Version$Interface interface { - RESTClient() $.restRESTClientInterface|raw$ - $range .types$ $.|publicPlural$Getter - $end$ -} -` - -var groupClientTemplate = ` -// $.GroupGoName$$.Version$Client is used to interact with features provided by the $.groupName$ group. -type $.GroupGoName$$.Version$Client struct { - restClient $.restRESTClientInterface|raw$ -} -` - -var getterImplNamespaced = ` -func (c *$.GroupGoName$$.Version$Client) $.type|publicPlural$(namespace string) $.type|public$Interface { - return new$.type|publicPlural$(c, namespace) -} -` - -var getterImplNonNamespaced = ` -func (c *$.GroupGoName$$.Version$Client) $.type|publicPlural$() $.type|public$Interface { - return new$.type|publicPlural$(c) -} -` - -var newClientForConfigTemplate = ` -// NewForConfig creates a new $.GroupGoName$$.Version$Client for the given config. -func NewForConfig(c *$.restConfig|raw$) (*$.GroupGoName$$.Version$Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := $.restRESTClientFor|raw$(&config) - if err != nil { - return nil, err - } - return &$.GroupGoName$$.Version$Client{client}, nil -} -` - -var newClientForConfigOrDieTemplate = ` -// NewForConfigOrDie creates a new $.GroupGoName$$.Version$Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *$.restConfig|raw$) *$.GroupGoName$$.Version$Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} -` - -var getRESTClient = ` -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *$.GroupGoName$$.Version$Client) RESTClient() $.restRESTClientInterface|raw$ { - if c == nil { - return nil - } - return c.restClient -} -` - -var newClientForRESTClientTemplate = ` -// New creates a new $.GroupGoName$$.Version$Client for the given RESTClient. -func New(c $.restRESTClientInterface|raw$) *$.GroupGoName$$.Version$Client { - return &$.GroupGoName$$.Version$Client{c} -} -` - -var setInternalVersionClientDefaultsTemplate = ` -func setConfigDefaults(config *$.restConfig|raw$) error { - config.APIPath = $.apiPath$ - if config.UserAgent == "" { - config.UserAgent = $.restDefaultKubernetesUserAgent|raw$() - } - if config.GroupVersion == nil || config.GroupVersion.Group != scheme.Scheme.PrioritizedVersionsForGroup("$.groupName$")[0].Group { - gv := scheme.Scheme.PrioritizedVersionsForGroup("$.groupName$")[0] - config.GroupVersion = &gv - } - config.NegotiatedSerializer = scheme.Codecs - - if config.QPS == 0 { - config.QPS = 5 - } - if config.Burst == 0 { - config.Burst = 10 - } - - return nil -} -` - -var setClientDefaultsTemplate = ` -func setConfigDefaults(config *$.restConfig|raw$) error { - gv := $.SchemeGroupVersion|raw$ - config.GroupVersion = &gv - config.APIPath = $.apiPath$ - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() - - if config.UserAgent == "" { - config.UserAgent = $.restDefaultKubernetesUserAgent|raw$() - } - - return nil -} -` diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go deleted file mode 100644 index 3e8fc7c..0000000 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go +++ /dev/null @@ -1,599 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generators - -import ( - "io" - "path/filepath" - "strings" - - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/code-generator/cmd/client-gen/generators/util" -) - -// genClientForType produces a file for each top-level type. -type genClientForType struct { - generator.DefaultGen - outputPackage string - clientsetPackage string - group string - version string - groupGoName string - typeToMatch *types.Type - imports namer.ImportTracker -} - -var _ generator.Generator = &genClientForType{} - -// Filter ignores all but one type because we're making a single file per type. -func (g *genClientForType) Filter(c *generator.Context, t *types.Type) bool { return t == g.typeToMatch } - -func (g *genClientForType) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *genClientForType) Imports(c *generator.Context) (imports []string) { - return g.imports.ImportLines() -} - -// Ideally, we'd like genStatus to return true if there is a subresource path -// registered for "status" in the API server, but we do not have that -// information, so genStatus returns true if the type has a status field. -func genStatus(t *types.Type) bool { - // Default to true if we have a Status member - hasStatus := false - for _, m := range t.Members { - if m.Name == "Status" { - hasStatus = true - break - } - } - return hasStatus && !util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)).NoStatus -} - -// GenerateType makes the body of a file implementing the individual typed client for type t. -func (g *genClientForType) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - pkg := filepath.Base(t.Name.Package) - tags, err := util.ParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) - if err != nil { - return err - } - type extendedInterfaceMethod struct { - template string - args map[string]interface{} - } - extendedMethods := []extendedInterfaceMethod{} - for _, e := range tags.Extensions { - inputType := *t - resultType := *t - // TODO: Extract this to some helper method as this code is copied into - // 2 other places. - if len(e.InputTypeOverride) > 0 { - if name, pkg := e.Input(); len(pkg) > 0 { - newType := c.Universe.Type(types.Name{Package: pkg, Name: name}) - inputType = *newType - } else { - inputType.Name.Name = e.InputTypeOverride - } - } - if len(e.ResultTypeOverride) > 0 { - if name, pkg := e.Result(); len(pkg) > 0 { - newType := c.Universe.Type(types.Name{Package: pkg, Name: name}) - resultType = *newType - } else { - resultType.Name.Name = e.ResultTypeOverride - } - } - var updatedVerbtemplate string - if _, exists := subresourceDefaultVerbTemplates[e.VerbType]; e.IsSubresource() && exists { - updatedVerbtemplate = e.VerbName + "(" + strings.TrimPrefix(subresourceDefaultVerbTemplates[e.VerbType], strings.Title(e.VerbType)+"(") - } else { - updatedVerbtemplate = e.VerbName + "(" + strings.TrimPrefix(defaultVerbTemplates[e.VerbType], strings.Title(e.VerbType)+"(") - } - extendedMethods = append(extendedMethods, extendedInterfaceMethod{ - template: updatedVerbtemplate, - args: map[string]interface{}{ - "type": t, - "inputType": &inputType, - "resultType": &resultType, - "DeleteOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "DeleteOptions"}), - "ListOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "ListOptions"}), - "GetOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "GetOptions"}), - "PatchType": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/types", Name: "PatchType"}), - }, - }) - } - m := map[string]interface{}{ - "type": t, - "inputType": t, - "resultType": t, - "package": pkg, - "Package": namer.IC(pkg), - "namespaced": !tags.NonNamespaced, - "Group": namer.IC(g.group), - "subresource": false, - "subresourcePath": "", - "GroupGoName": g.groupGoName, - "Version": namer.IC(g.version), - "DeleteOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "DeleteOptions"}), - "ListOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "ListOptions"}), - "GetOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "GetOptions"}), - "PatchType": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/types", Name: "PatchType"}), - "watchInterface": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/watch", Name: "Interface"}), - "RESTClientInterface": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Interface"}), - "schemeParameterCodec": c.Universe.Variable(types.Name{Package: filepath.Join(g.clientsetPackage, "scheme"), Name: "ParameterCodec"}), - } - - sw.Do(getterComment, m) - if tags.NonNamespaced { - sw.Do(getterNonNamespaced, m) - } else { - sw.Do(getterNamespaced, m) - } - - sw.Do(interfaceTemplate1, m) - if !tags.NoVerbs { - if !genStatus(t) { - tags.SkipVerbs = append(tags.SkipVerbs, "updateStatus") - } - interfaceSuffix := "" - if len(extendedMethods) > 0 { - interfaceSuffix = "\n" - } - sw.Do("\n"+generateInterface(tags)+interfaceSuffix, m) - // add extended verbs into interface - for _, v := range extendedMethods { - sw.Do(v.template+interfaceSuffix, v.args) - } - - } - sw.Do(interfaceTemplate4, m) - - if tags.NonNamespaced { - sw.Do(structNonNamespaced, m) - sw.Do(newStructNonNamespaced, m) - } else { - sw.Do(structNamespaced, m) - sw.Do(newStructNamespaced, m) - } - - if tags.NoVerbs { - return sw.Error() - } - - if tags.HasVerb("get") { - sw.Do(getTemplate, m) - } - if tags.HasVerb("list") { - sw.Do(listTemplate, m) - } - if tags.HasVerb("watch") { - sw.Do(watchTemplate, m) - } - - if tags.HasVerb("create") { - sw.Do(createTemplate, m) - } - if tags.HasVerb("update") { - sw.Do(updateTemplate, m) - } - if tags.HasVerb("updateStatus") { - sw.Do(updateStatusTemplate, m) - } - if tags.HasVerb("delete") { - sw.Do(deleteTemplate, m) - } - if tags.HasVerb("deleteCollection") { - sw.Do(deleteCollectionTemplate, m) - } - if tags.HasVerb("patch") { - sw.Do(patchTemplate, m) - } - - // generate expansion methods - for _, e := range tags.Extensions { - inputType := *t - resultType := *t - if len(e.InputTypeOverride) > 0 { - if name, pkg := e.Input(); len(pkg) > 0 { - newType := c.Universe.Type(types.Name{Package: pkg, Name: name}) - inputType = *newType - } else { - inputType.Name.Name = e.InputTypeOverride - } - } - if len(e.ResultTypeOverride) > 0 { - if name, pkg := e.Result(); len(pkg) > 0 { - newType := c.Universe.Type(types.Name{Package: pkg, Name: name}) - resultType = *newType - } else { - resultType.Name.Name = e.ResultTypeOverride - } - } - m["inputType"] = &inputType - m["resultType"] = &resultType - m["subresourcePath"] = e.SubResourcePath - - if e.HasVerb("get") { - if e.IsSubresource() { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, getSubresourceTemplate), m) - } else { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, getTemplate), m) - } - } - - if e.HasVerb("list") { - if e.IsSubresource() { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, listSubresourceTemplate), m) - } else { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, listTemplate), m) - } - } - - // TODO: Figure out schemantic for watching a sub-resource. - if e.HasVerb("watch") { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, watchTemplate), m) - } - - if e.HasVerb("create") { - if e.IsSubresource() { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, createSubresourceTemplate), m) - } else { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, createTemplate), m) - } - } - - if e.HasVerb("update") { - if e.IsSubresource() { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, updateSubresourceTemplate), m) - } else { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, updateTemplate), m) - } - } - - // TODO: Figure out schemantic for deleting a sub-resource (what arguments - // are passed, does it need two names? etc. - if e.HasVerb("delete") { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, deleteTemplate), m) - } - - if e.HasVerb("patch") { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, patchTemplate), m) - } - } - - return sw.Error() -} - -// adjustTemplate adjust the origin verb template using the expansion name. -// TODO: Make the verbs in templates parametrized so the strings.Replace() is -// not needed. -func adjustTemplate(name, verbType, template string) string { - return strings.Replace(template, " "+strings.Title(verbType), " "+name, -1) -} - -func generateInterface(tags util.Tags) string { - // need an ordered list here to guarantee order of generated methods. - out := []string{} - for _, m := range util.SupportedVerbs { - if tags.HasVerb(m) { - out = append(out, defaultVerbTemplates[m]) - } - } - return strings.Join(out, "\n") -} - -var subresourceDefaultVerbTemplates = map[string]string{ - "create": `Create($.type|private$Name string, $.inputType|private$ *$.inputType|raw$) (*$.resultType|raw$, error)`, - "list": `List($.type|private$Name string, opts $.ListOptions|raw$) (*$.resultType|raw$List, error)`, - "update": `Update($.type|private$Name string, $.inputType|private$ *$.inputType|raw$) (*$.resultType|raw$, error)`, - "get": `Get($.type|private$Name string, options $.GetOptions|raw$) (*$.resultType|raw$, error)`, -} - -var defaultVerbTemplates = map[string]string{ - "create": `Create(*$.inputType|raw$) (*$.resultType|raw$, error)`, - "update": `Update(*$.inputType|raw$) (*$.resultType|raw$, error)`, - "updateStatus": `UpdateStatus(*$.type|raw$) (*$.type|raw$, error)`, - "delete": `Delete(name string, options *$.DeleteOptions|raw$) error`, - "deleteCollection": `DeleteCollection(options *$.DeleteOptions|raw$, listOptions $.ListOptions|raw$) error`, - "get": `Get(name string, options $.GetOptions|raw$) (*$.resultType|raw$, error)`, - "list": `List(opts $.ListOptions|raw$) (*$.resultType|raw$List, error)`, - "watch": `Watch(opts $.ListOptions|raw$) ($.watchInterface|raw$, error)`, - "patch": `Patch(name string, pt $.PatchType|raw$, data []byte, subresources ...string) (result *$.resultType|raw$, err error)`, -} - -// group client will implement this interface. -var getterComment = ` -// $.type|publicPlural$Getter has a method to return a $.type|public$Interface. -// A group's client should implement this interface.` - -var getterNamespaced = ` -type $.type|publicPlural$Getter interface { - $.type|publicPlural$(namespace string) $.type|public$Interface -} -` - -var getterNonNamespaced = ` -type $.type|publicPlural$Getter interface { - $.type|publicPlural$() $.type|public$Interface -} -` - -// this type's interface, typed client will implement this interface. -var interfaceTemplate1 = ` -// $.type|public$Interface has methods to work with $.type|public$ resources. -type $.type|public$Interface interface {` - -var interfaceTemplate4 = ` - $.type|public$Expansion -} -` - -// template for the struct that implements the type's interface -var structNamespaced = ` -// $.type|privatePlural$ implements $.type|public$Interface -type $.type|privatePlural$ struct { - client $.RESTClientInterface|raw$ - ns string -} -` - -// template for the struct that implements the type's interface -var structNonNamespaced = ` -// $.type|privatePlural$ implements $.type|public$Interface -type $.type|privatePlural$ struct { - client $.RESTClientInterface|raw$ -} -` - -var newStructNamespaced = ` -// new$.type|publicPlural$ returns a $.type|publicPlural$ -func new$.type|publicPlural$(c *$.GroupGoName$$.Version$Client, namespace string) *$.type|privatePlural$ { - return &$.type|privatePlural${ - client: c.RESTClient(), - ns: namespace, - } -} -` - -var newStructNonNamespaced = ` -// new$.type|publicPlural$ returns a $.type|publicPlural$ -func new$.type|publicPlural$(c *$.GroupGoName$$.Version$Client) *$.type|privatePlural$ { - return &$.type|privatePlural${ - client: c.RESTClient(), - } -} -` -var listTemplate = ` -// List takes label and field selectors, and returns the list of $.resultType|publicPlural$ that match those selectors. -func (c *$.type|privatePlural$) List(opts $.ListOptions|raw$) (result *$.resultType|raw$List, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil{ - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &$.resultType|raw$List{} - err = c.client.Get(). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - VersionedParams(&opts, $.schemeParameterCodec|raw$). - Timeout(timeout). - Do(). - Into(result) - return -} -` - -var listSubresourceTemplate = ` -// List takes $.type|raw$ name, label and field selectors, and returns the list of $.resultType|publicPlural$ that match those selectors. -func (c *$.type|privatePlural$) List($.type|private$Name string, opts $.ListOptions|raw$) (result *$.resultType|raw$List, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil{ - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &$.resultType|raw$List{} - err = c.client.Get(). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - Name($.type|private$Name). - SubResource("$.subresourcePath$"). - VersionedParams(&opts, $.schemeParameterCodec|raw$). - Timeout(timeout). - Do(). - Into(result) - return -} -` - -var getTemplate = ` -// Get takes name of the $.type|private$, and returns the corresponding $.resultType|private$ object, and an error if there is any. -func (c *$.type|privatePlural$) Get(name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { - result = &$.resultType|raw${} - err = c.client.Get(). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - Name(name). - VersionedParams(&options, $.schemeParameterCodec|raw$). - Do(). - Into(result) - return -} -` - -var getSubresourceTemplate = ` -// Get takes name of the $.type|private$, and returns the corresponding $.resultType|raw$ object, and an error if there is any. -func (c *$.type|privatePlural$) Get($.type|private$Name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { - result = &$.resultType|raw${} - err = c.client.Get(). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - Name($.type|private$Name). - SubResource("$.subresourcePath$"). - VersionedParams(&options, $.schemeParameterCodec|raw$). - Do(). - Into(result) - return -} -` - -var deleteTemplate = ` -// Delete takes name of the $.type|private$ and deletes it. Returns an error if one occurs. -func (c *$.type|privatePlural$) Delete(name string, options *$.DeleteOptions|raw$) error { - return c.client.Delete(). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - Name(name). - Body(options). - Do(). - Error() -} -` - -var deleteCollectionTemplate = ` -// DeleteCollection deletes a collection of objects. -func (c *$.type|privatePlural$) DeleteCollection(options *$.DeleteOptions|raw$, listOptions $.ListOptions|raw$) error { - var timeout time.Duration - if listOptions.TimeoutSeconds != nil{ - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - VersionedParams(&listOptions, $.schemeParameterCodec|raw$). - Timeout(timeout). - Body(options). - Do(). - Error() -} -` - -var createSubresourceTemplate = ` -// Create takes the representation of a $.inputType|private$ and creates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *$.type|privatePlural$) Create($.type|private$Name string, $.inputType|private$ *$.inputType|raw$) (result *$.resultType|raw$, err error) { - result = &$.resultType|raw${} - err = c.client.Post(). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - Name($.type|private$Name). - SubResource("$.subresourcePath$"). - Body($.inputType|private$). - Do(). - Into(result) - return -} -` - -var createTemplate = ` -// Create takes the representation of a $.inputType|private$ and creates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *$.type|privatePlural$) Create($.inputType|private$ *$.inputType|raw$) (result *$.resultType|raw$, err error) { - result = &$.resultType|raw${} - err = c.client.Post(). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - Body($.inputType|private$). - Do(). - Into(result) - return -} -` - -var updateSubresourceTemplate = ` -// Update takes the top resource name and the representation of a $.inputType|private$ and updates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *$.type|privatePlural$) Update($.type|private$Name string, $.inputType|private$ *$.inputType|raw$) (result *$.resultType|raw$, err error) { - result = &$.resultType|raw${} - err = c.client.Put(). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - Name($.type|private$Name). - SubResource("$.subresourcePath$"). - Body($.inputType|private$). - Do(). - Into(result) - return -} -` - -var updateTemplate = ` -// Update takes the representation of a $.inputType|private$ and updates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *$.type|privatePlural$) Update($.inputType|private$ *$.inputType|raw$) (result *$.resultType|raw$, err error) { - result = &$.resultType|raw${} - err = c.client.Put(). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - Name($.inputType|private$.Name). - Body($.inputType|private$). - Do(). - Into(result) - return -} -` - -var updateStatusTemplate = ` -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *$.type|privatePlural$) UpdateStatus($.type|private$ *$.type|raw$) (result *$.type|raw$, err error) { - result = &$.type|raw${} - err = c.client.Put(). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - Name($.type|private$.Name). - SubResource("status"). - Body($.type|private$). - Do(). - Into(result) - return -} -` - -var watchTemplate = ` -// Watch returns a $.watchInterface|raw$ that watches the requested $.type|privatePlural$. -func (c *$.type|privatePlural$) Watch(opts $.ListOptions|raw$) ($.watchInterface|raw$, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil{ - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - VersionedParams(&opts, $.schemeParameterCodec|raw$). - Timeout(timeout). - Watch() -} -` - -var patchTemplate = ` -// Patch applies the patch and returns the patched $.resultType|private$. -func (c *$.type|privatePlural$) Patch(name string, pt $.PatchType|raw$, data []byte, subresources ...string) (result *$.resultType|raw$, err error) { - result = &$.resultType|raw${} - err = c.client.Patch(pt). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} -` diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/scheme/generator_for_scheme.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/scheme/generator_for_scheme.go deleted file mode 100644 index a698a28..0000000 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/scheme/generator_for_scheme.go +++ /dev/null @@ -1,186 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package scheme - -import ( - "fmt" - "io" - "os" - "path/filepath" - "strings" - - "k8s.io/code-generator/cmd/client-gen/path" - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -// GenScheme produces a package for a clientset with the scheme, codecs and parameter codecs. -type GenScheme struct { - generator.DefaultGen - OutputPackage string - Groups []clientgentypes.GroupVersions - GroupGoNames map[clientgentypes.GroupVersion]string - InputPackages map[clientgentypes.GroupVersion]string - OutputPath string - ImportTracker namer.ImportTracker - PrivateScheme bool - CreateRegistry bool - schemeGenerated bool -} - -func (g *GenScheme) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.OutputPackage, g.ImportTracker), - } -} - -// We only want to call GenerateType() once. -func (g *GenScheme) Filter(c *generator.Context, t *types.Type) bool { - ret := !g.schemeGenerated - g.schemeGenerated = true - return ret -} - -func (g *GenScheme) Imports(c *generator.Context) (imports []string) { - imports = append(imports, g.ImportTracker.ImportLines()...) - for _, group := range g.Groups { - for _, version := range group.Versions { - packagePath := g.InputPackages[clientgentypes.GroupVersion{Group: group.Group, Version: version.Version}] - groupAlias := strings.ToLower(g.GroupGoNames[clientgentypes.GroupVersion{Group: group.Group, Version: version.Version}]) - if g.CreateRegistry { - // import the install package for internal clientsets instead of the type package with register.go - if version.Version != "" { - packagePath = filepath.Dir(packagePath) - } - packagePath = filepath.Join(packagePath, "install") - - imports = append(imports, fmt.Sprintf("%s \"%s\"", groupAlias, path.Vendorless(packagePath))) - break - } else { - imports = append(imports, fmt.Sprintf("%s%s \"%s\"", groupAlias, strings.ToLower(version.Version.NonEmpty()), path.Vendorless(packagePath))) - } - } - } - return -} - -func (g *GenScheme) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - - allGroupVersions := clientgentypes.ToGroupVersionInfo(g.Groups, g.GroupGoNames) - allInstallGroups := clientgentypes.ToGroupInstallPackages(g.Groups, g.GroupGoNames) - - m := map[string]interface{}{ - "allGroupVersions": allGroupVersions, - "allInstallGroups": allInstallGroups, - "customRegister": false, - "runtimeNewParameterCodec": c.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "NewParameterCodec"}), - "runtimeNewScheme": c.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "NewScheme"}), - "serializerNewCodecFactory": c.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/runtime/serializer", Name: "NewCodecFactory"}), - "runtimeScheme": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "Scheme"}), - "runtimeSchemeBuilder": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "SchemeBuilder"}), - "runtimeUtilMust": c.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/util/runtime", Name: "Must"}), - "schemaGroupVersion": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime/schema", Name: "GroupVersion"}), - "metav1AddToGroupVersion": c.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "AddToGroupVersion"}), - } - globals := map[string]string{ - "Scheme": "Scheme", - "Codecs": "Codecs", - "ParameterCodec": "ParameterCodec", - "Registry": "Registry", - } - for k, v := range globals { - if g.PrivateScheme { - m[k] = strings.ToLower(v[0:1]) + v[1:] - } else { - m[k] = v - } - } - - sw.Do(globalsTemplate, m) - - if g.OutputPath != "" { - if _, err := os.Stat(filepath.Join(g.OutputPath, strings.ToLower("register_custom.go"))); err == nil { - m["customRegister"] = true - } - } - - if g.CreateRegistry { - sw.Do(registryRegistration, m) - } else { - sw.Do(simpleRegistration, m) - } - - return sw.Error() -} - -var globalsTemplate = ` -var $.Scheme$ = $.runtimeNewScheme|raw$() -var $.Codecs$ = $.serializerNewCodecFactory|raw$($.Scheme$) -var $.ParameterCodec$ = $.runtimeNewParameterCodec|raw$($.Scheme$)` - -var registryRegistration = ` - -func init() { - $.metav1AddToGroupVersion|raw$($.Scheme$, $.schemaGroupVersion|raw${Version: "v1"}) - Install($.Scheme$) -} - -// Install registers the API group and adds types to a scheme -func Install(scheme *$.runtimeScheme|raw$) { - $- range .allInstallGroups$ - $.InstallPackageAlias$.Install(scheme) - $- end$ - $if .customRegister$ - ExtraInstall(scheme) - $end -$ -} -` - -var simpleRegistration = ` -var localSchemeBuilder = $.runtimeSchemeBuilder|raw${ - $- range .allGroupVersions$ - $.PackageAlias$.AddToScheme, - $- end$ - $if .customRegister$ - ExtraAddToScheme, - $end -$ -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - $.metav1AddToGroupVersion|raw$($.Scheme$, $.schemaGroupVersion|raw${Version: "v1"}) - $.runtimeUtilMust|raw$(AddToScheme($.Scheme$)) -} -` diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/util/tags.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/util/tags.go deleted file mode 100644 index 426b392..0000000 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/util/tags.go +++ /dev/null @@ -1,341 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package util - -import ( - "errors" - "fmt" - "strings" - - "k8s.io/gengo/types" -) - -var supportedTags = []string{ - "genclient", - "genclient:nonNamespaced", - "genclient:noVerbs", - "genclient:onlyVerbs", - "genclient:skipVerbs", - "genclient:noStatus", - "genclient:readonly", - "genclient:method", -} - -// SupportedVerbs is a list of supported verbs for +onlyVerbs and +skipVerbs. -var SupportedVerbs = []string{ - "create", - "update", - "updateStatus", - "delete", - "deleteCollection", - "get", - "list", - "watch", - "patch", -} - -// ReadonlyVerbs represents a list of read-only verbs. -var ReadonlyVerbs = []string{ - "get", - "list", - "watch", -} - -// genClientPrefix is the default prefix for all genclient tags. -const genClientPrefix = "genclient:" - -// unsupportedExtensionVerbs is a list of verbs we don't support generating -// extension client functions for. -var unsupportedExtensionVerbs = []string{ - "updateStatus", - "deleteCollection", - "watch", - "delete", -} - -// inputTypeSupportedVerbs is a list of verb types that supports overriding the -// input argument type. -var inputTypeSupportedVerbs = []string{ - "create", - "update", -} - -// resultTypeSupportedVerbs is a list of verb types that supports overriding the -// resulting type. -var resultTypeSupportedVerbs = []string{ - "create", - "update", - "get", - "list", - "patch", -} - -// Extensions allows to extend the default set of client verbs -// (CRUD+watch+patch+list+deleteCollection) for a given type with custom defined -// verbs. Custom verbs can have custom input and result types and also allow to -// use a sub-resource in a request instead of top-level resource type. -// -// Example: -// -// +genclient:method=UpdateScale,verb=update,subresource=scale,input=Scale,result=Scale -// -// type ReplicaSet struct { ... } -// -// The 'method=UpdateScale' is the name of the client function. -// The 'verb=update' here means the client function will use 'PUT' action. -// The 'subresource=scale' means we will use SubResource template to generate this client function. -// The 'input' is the input type used for creation (function argument). -// The 'result' (not needed in this case) is the result type returned from the -// client function. -// -type extension struct { - // VerbName is the name of the custom verb (Scale, Instantiate, etc..) - VerbName string - // VerbType is the type of the verb (only verbs from SupportedVerbs are - // supported) - VerbType string - // SubResourcePath defines a path to a sub-resource to use in the request. - // (optional) - SubResourcePath string - // InputTypeOverride overrides the input parameter type for the verb. By - // default the original type is used. Overriding the input type only works for - // "create" and "update" verb types. The given type must exists in the same - // package as the original type. - // (optional) - InputTypeOverride string - // ResultTypeOverride overrides the resulting object type for the verb. By - // default the original type is used. Overriding the result type works. - // (optional) - ResultTypeOverride string -} - -// IsSubresource indicates if this extension should generate the sub-resource. -func (e *extension) IsSubresource() bool { - return len(e.SubResourcePath) > 0 -} - -// HasVerb checks if the extension matches the given verb. -func (e *extension) HasVerb(verb string) bool { - return e.VerbType == verb -} - -// Input returns the input override package path and the type. -func (e *extension) Input() (string, string) { - parts := strings.Split(e.InputTypeOverride, ".") - return parts[len(parts)-1], strings.Join(parts[0:len(parts)-1], ".") -} - -// Result returns the result override package path and the type. -func (e *extension) Result() (string, string) { - parts := strings.Split(e.ResultTypeOverride, ".") - return parts[len(parts)-1], strings.Join(parts[0:len(parts)-1], ".") -} - -// Tags represents a genclient configuration for a single type. -type Tags struct { - // +genclient - GenerateClient bool - // +genclient:nonNamespaced - NonNamespaced bool - // +genclient:noStatus - NoStatus bool - // +genclient:noVerbs - NoVerbs bool - // +genclient:skipVerbs=get,update - // +genclient:onlyVerbs=create,delete - SkipVerbs []string - // +genclient:method=UpdateScale,verb=update,subresource=scale,input=Scale,result=Scale - Extensions []extension -} - -// HasVerb returns true if we should include the given verb in final client interface and -// generate the function for it. -func (t Tags) HasVerb(verb string) bool { - if len(t.SkipVerbs) == 0 { - return true - } - for _, s := range t.SkipVerbs { - if verb == s { - return false - } - } - return true -} - -// MustParseClientGenTags calls ParseClientGenTags but instead of returning error it panics. -func MustParseClientGenTags(lines []string) Tags { - tags, err := ParseClientGenTags(lines) - if err != nil { - panic(err.Error()) - } - return tags -} - -// ParseClientGenTags parse the provided genclient tags and validates that no unknown -// tags are provided. -func ParseClientGenTags(lines []string) (Tags, error) { - ret := Tags{} - values := types.ExtractCommentTags("+", lines) - var value []string - value, ret.GenerateClient = values["genclient"] - // Check the old format and error when used to avoid generating client when //+genclient=false - if len(value) > 0 && len(value[0]) > 0 { - return ret, fmt.Errorf("+genclient=%s is invalid, use //+genclient if you want to generate client or omit it when you want to disable generation", value) - } - _, ret.NonNamespaced = values[genClientPrefix+"nonNamespaced"] - // Check the old format and error when used - if value := values["nonNamespaced"]; len(value) > 0 && len(value[0]) > 0 { - return ret, fmt.Errorf("+nonNamespaced=%s is invalid, use //+genclient:nonNamespaced instead", value[0]) - } - _, ret.NoVerbs = values[genClientPrefix+"noVerbs"] - _, ret.NoStatus = values[genClientPrefix+"noStatus"] - onlyVerbs := []string{} - if _, isReadonly := values[genClientPrefix+"readonly"]; isReadonly { - onlyVerbs = ReadonlyVerbs - } - // Check the old format and error when used - if value := values["readonly"]; len(value) > 0 && len(value[0]) > 0 { - return ret, fmt.Errorf("+readonly=%s is invalid, use //+genclient:readonly instead", value[0]) - } - if v, exists := values[genClientPrefix+"skipVerbs"]; exists { - ret.SkipVerbs = strings.Split(v[0], ",") - } - if v, exists := values[genClientPrefix+"onlyVerbs"]; exists || len(onlyVerbs) > 0 { - if len(v) > 0 { - onlyVerbs = append(onlyVerbs, strings.Split(v[0], ",")...) - } - skipVerbs := []string{} - for _, m := range SupportedVerbs { - skip := true - for _, o := range onlyVerbs { - if o == m { - skip = false - break - } - } - // Check for conflicts - for _, v := range skipVerbs { - if v == m { - return ret, fmt.Errorf("verb %q used both in genclient:skipVerbs and genclient:onlyVerbs", v) - } - } - if skip { - skipVerbs = append(skipVerbs, m) - } - } - ret.SkipVerbs = skipVerbs - } - var err error - if ret.Extensions, err = parseClientExtensions(values); err != nil { - return ret, err - } - return ret, validateClientGenTags(values) -} - -func parseClientExtensions(tags map[string][]string) ([]extension, error) { - var ret []extension - for name, values := range tags { - if !strings.HasPrefix(name, genClientPrefix+"method") { - continue - } - for _, value := range values { - // the value comes in this form: "Foo,verb=create" - ext := extension{} - parts := strings.Split(value, ",") - if len(parts) == 0 { - return nil, fmt.Errorf("invalid of empty extension verb name: %q", value) - } - // The first part represents the name of the extension - ext.VerbName = parts[0] - if len(ext.VerbName) == 0 { - return nil, fmt.Errorf("must specify a verb name (// +genclient:method=Foo,verb=create)") - } - // Parse rest of the arguments - params := parts[1:] - for _, p := range params { - parts := strings.Split(p, "=") - if len(parts) != 2 { - return nil, fmt.Errorf("invalid extension tag specification %q", p) - } - key, val := strings.TrimSpace(parts[0]), strings.TrimSpace(parts[1]) - if len(val) == 0 { - return nil, fmt.Errorf("empty value of %q for %q extension", key, ext.VerbName) - } - switch key { - case "verb": - ext.VerbType = val - case "subresource": - ext.SubResourcePath = val - case "input": - ext.InputTypeOverride = val - case "result": - ext.ResultTypeOverride = val - default: - return nil, fmt.Errorf("unknown extension configuration key %q", key) - } - } - // Validate resulting extension configuration - if len(ext.VerbType) == 0 { - return nil, fmt.Errorf("verb type must be specified (use '// +genclient:method=%s,verb=create')", ext.VerbName) - } - if len(ext.ResultTypeOverride) > 0 { - supported := false - for _, v := range resultTypeSupportedVerbs { - if ext.VerbType == v { - supported = true - break - } - } - if !supported { - return nil, fmt.Errorf("%s: result type is not supported for %q verbs (supported verbs: %#v)", ext.VerbName, ext.VerbType, resultTypeSupportedVerbs) - } - } - if len(ext.InputTypeOverride) > 0 { - supported := false - for _, v := range inputTypeSupportedVerbs { - if ext.VerbType == v { - supported = true - break - } - } - if !supported { - return nil, fmt.Errorf("%s: input type is not supported for %q verbs (supported verbs: %#v)", ext.VerbName, ext.VerbType, inputTypeSupportedVerbs) - } - } - for _, t := range unsupportedExtensionVerbs { - if ext.VerbType == t { - return nil, fmt.Errorf("verb %q is not supported by extension generator", ext.VerbType) - } - } - ret = append(ret, ext) - } - } - return ret, nil -} - -// validateTags validates that only supported genclient tags were provided. -func validateClientGenTags(values map[string][]string) error { - for _, k := range supportedTags { - delete(values, k) - } - for key := range values { - if strings.HasPrefix(key, strings.TrimSuffix(genClientPrefix, ":")) { - return errors.New("unknown tag detected: " + key) - } - } - return nil -} diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/main.go b/vendor/k8s.io/code-generator/cmd/client-gen/main.go deleted file mode 100644 index 6e0d187..0000000 --- a/vendor/k8s.io/code-generator/cmd/client-gen/main.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// client-gen makes the individual typed clients using gengo. -package main - -import ( - "flag" - "path/filepath" - - "github.com/spf13/pflag" - "k8s.io/gengo/args" - "k8s.io/klog" - - generatorargs "k8s.io/code-generator/cmd/client-gen/args" - "k8s.io/code-generator/cmd/client-gen/generators" - "k8s.io/code-generator/pkg/util" -) - -func main() { - klog.InitFlags(nil) - genericArgs, customArgs := generatorargs.NewDefaults() - - // Override defaults. - // TODO: move this out of client-gen - genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) - genericArgs.OutputPackagePath = "k8s.io/kubernetes/pkg/client/clientset_generated/" - - genericArgs.AddFlags(pflag.CommandLine) - customArgs.AddFlags(pflag.CommandLine, "k8s.io/kubernetes/pkg/apis") // TODO: move this input path out of client-gen - flag.Set("logtostderr", "true") - pflag.CommandLine.AddGoFlagSet(flag.CommandLine) - pflag.Parse() - - // add group version package as input dirs for gengo - for _, pkg := range customArgs.Groups { - for _, v := range pkg.Versions { - genericArgs.InputDirs = append(genericArgs.InputDirs, v.Package) - } - } - - if err := generatorargs.Validate(genericArgs); err != nil { - klog.Fatalf("Error: %v", err) - } - - if err := genericArgs.Execute( - generators.NameSystems(), - generators.DefaultNameSystem(), - generators.Packages, - ); err != nil { - klog.Fatalf("Error: %v", err) - } -} diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/path/path.go b/vendor/k8s.io/code-generator/cmd/client-gen/path/path.go deleted file mode 100644 index 19b269b..0000000 --- a/vendor/k8s.io/code-generator/cmd/client-gen/path/path.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package path - -import "strings" - -// Vendorless removes the longest match of "*/vendor/" from the front of p. -// It is useful if a package locates in vendor/, e.g., -// k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/meta/v1, because gengo -// indexes the package with its import path, e.g., -// k8s.io/apimachinery/pkg/apis/meta/v1, -func Vendorless(p string) string { - if pos := strings.LastIndex(p, "/vendor/"); pos != -1 { - return p[pos+len("/vendor/"):] - } - return p -} diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/types/helpers.go b/vendor/k8s.io/code-generator/cmd/client-gen/types/helpers.go deleted file mode 100644 index 59f2fd4..0000000 --- a/vendor/k8s.io/code-generator/cmd/client-gen/types/helpers.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package types - -import ( - "fmt" - "regexp" - "sort" - "strings" - - "k8s.io/gengo/namer" -) - -// ToGroupVersion turns "group/version" string into a GroupVersion struct. It reports error -// if it cannot parse the string. -func ToGroupVersion(gv string) (GroupVersion, error) { - // this can be the internal version for the legacy kube types - // TODO once we've cleared the last uses as strings, this special case should be removed. - if (len(gv) == 0) || (gv == "/") { - return GroupVersion{}, nil - } - - switch strings.Count(gv, "/") { - case 0: - return GroupVersion{Group(gv), ""}, nil - case 1: - i := strings.Index(gv, "/") - return GroupVersion{Group(gv[:i]), Version(gv[i+1:])}, nil - default: - return GroupVersion{}, fmt.Errorf("unexpected GroupVersion string: %v", gv) - } -} - -type sortableSliceOfVersions []string - -func (a sortableSliceOfVersions) Len() int { return len(a) } -func (a sortableSliceOfVersions) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a sortableSliceOfVersions) Less(i, j int) bool { - vi, vj := strings.TrimLeft(a[i], "v"), strings.TrimLeft(a[j], "v") - major := regexp.MustCompile("^[0-9]+") - viMajor, vjMajor := major.FindString(vi), major.FindString(vj) - viRemaining, vjRemaining := strings.TrimLeft(vi, viMajor), strings.TrimLeft(vj, vjMajor) - switch { - case len(viRemaining) == 0 && len(vjRemaining) == 0: - return viMajor < vjMajor - case len(viRemaining) == 0 && len(vjRemaining) != 0: - // stable version is greater than unstable version - return false - case len(viRemaining) != 0 && len(vjRemaining) == 0: - // stable version is greater than unstable version - return true - } - // neither are stable versions - if viMajor != vjMajor { - return viMajor < vjMajor - } - // assuming at most we have one alpha or one beta version, so if vi contains "alpha", it's the lesser one. - return strings.Contains(viRemaining, "alpha") -} - -// Determine the default version among versions. If a user calls a group client -// without specifying the version (e.g., c.CoreV1(), instead of c.CoreV1()), the -// default version will be returned. -func defaultVersion(versions []PackageVersion) Version { - var versionStrings []string - for _, version := range versions { - versionStrings = append(versionStrings, version.Version.String()) - } - sort.Sort(sortableSliceOfVersions(versionStrings)) - return Version(versionStrings[len(versionStrings)-1]) -} - -// ToGroupVersionInfo is a helper function used by generators for groups. -func ToGroupVersionInfo(groups []GroupVersions, groupGoNames map[GroupVersion]string) []GroupVersionInfo { - var groupVersionPackages []GroupVersionInfo - for _, group := range groups { - for _, version := range group.Versions { - groupGoName := groupGoNames[GroupVersion{Group: group.Group, Version: version.Version}] - groupVersionPackages = append(groupVersionPackages, GroupVersionInfo{ - Group: Group(namer.IC(group.Group.NonEmpty())), - Version: Version(namer.IC(version.Version.String())), - PackageAlias: strings.ToLower(groupGoName + version.Version.NonEmpty()), - GroupGoName: groupGoName, - LowerCaseGroupGoName: namer.IL(groupGoName), - }) - } - } - return groupVersionPackages -} - -func ToGroupInstallPackages(groups []GroupVersions, groupGoNames map[GroupVersion]string) []GroupInstallPackage { - var groupInstallPackages []GroupInstallPackage - for _, group := range groups { - defaultVersion := defaultVersion(group.Versions) - groupGoName := groupGoNames[GroupVersion{Group: group.Group, Version: defaultVersion}] - groupInstallPackages = append(groupInstallPackages, GroupInstallPackage{ - Group: Group(namer.IC(group.Group.NonEmpty())), - InstallPackageAlias: strings.ToLower(groupGoName), - }) - } - return groupInstallPackages -} - -// NormalizeGroupVersion calls normalizes the GroupVersion. -//func NormalizeGroupVersion(gv GroupVersion) GroupVersion { -// return GroupVersion{Group: gv.Group.NonEmpty(), Version: gv.Version, NonEmptyVersion: normalization.Version(gv.Version)} -//} diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/types/types.go b/vendor/k8s.io/code-generator/cmd/client-gen/types/types.go deleted file mode 100644 index 7d1606c..0000000 --- a/vendor/k8s.io/code-generator/cmd/client-gen/types/types.go +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package types - -type Version string - -func (v Version) String() string { - return string(v) -} - -func (v Version) NonEmpty() string { - if v == "" { - return "internalVersion" - } - return v.String() -} - -type Group string - -func (g Group) String() string { - return string(g) -} - -func (g Group) NonEmpty() string { - if g == "api" { - return "core" - } - return string(g) -} - -type PackageVersion struct { - Version - // The fully qualified package, e.g. k8s.io/kubernetes/pkg/apis/apps, where the types.go is found. - Package string -} - -type GroupVersion struct { - Group Group - Version Version -} - -type GroupVersions struct { - // The name of the package for this group, e.g. apps. - PackageName string - Group Group - Versions []PackageVersion -} - -// GroupVersionInfo contains all the info around a group version. -type GroupVersionInfo struct { - Group Group - Version Version - PackageAlias string - GroupGoName string - LowerCaseGroupGoName string -} - -type GroupInstallPackage struct { - Group Group - InstallPackageAlias string -} diff --git a/vendor/k8s.io/code-generator/cmd/conversion-gen/args/args.go b/vendor/k8s.io/code-generator/cmd/conversion-gen/args/args.go deleted file mode 100644 index 07ce6e7..0000000 --- a/vendor/k8s.io/code-generator/cmd/conversion-gen/args/args.go +++ /dev/null @@ -1,83 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package args - -import ( - "fmt" - - "github.com/spf13/pflag" - "k8s.io/gengo/args" -) - -// DefaultBasePeerDirs are the peer-dirs nearly everybody will use, i.e. those coming from -// apimachinery. -var DefaultBasePeerDirs = []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1", - "k8s.io/apimachinery/pkg/conversion", - "k8s.io/apimachinery/pkg/runtime", -} - -// CustomArgs is used by the gengo framework to pass args specific to this generator. -type CustomArgs struct { - // Base peer dirs which nearly everybody will use, i.e. outside of Kubernetes core. Peer dirs - // are declared to make the generator pick up manually written conversion funcs from external - // packages. - BasePeerDirs []string - - // Custom peer dirs which are application specific. Peer dirs are declared to make the - // generator pick up manually written conversion funcs from external packages. - ExtraPeerDirs []string - - // SkipUnsafe indicates whether to generate unsafe conversions to improve the efficiency - // of these operations. The unsafe operation is a direct pointer assignment via unsafe - // (within the allowed uses of unsafe) and is equivalent to a proposed Golang change to - // allow structs that are identical to be assigned to each other. - SkipUnsafe bool -} - -// NewDefaults returns default arguments for the generator. -func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { - genericArgs := args.Default().WithoutDefaultFlagParsing() - customArgs := &CustomArgs{ - BasePeerDirs: DefaultBasePeerDirs, - SkipUnsafe: false, - } - genericArgs.CustomArgs = customArgs - genericArgs.OutputFileBaseName = "conversion_generated" - return genericArgs, customArgs -} - -// AddFlags add the generator flags to the flag set. -func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) { - pflag.CommandLine.StringSliceVar(&ca.BasePeerDirs, "base-peer-dirs", ca.BasePeerDirs, - "Comma-separated list of apimachinery import paths which are considered, after tag-specified peers, for conversions. Only change these if you have very good reasons.") - pflag.CommandLine.StringSliceVar(&ca.ExtraPeerDirs, "extra-peer-dirs", ca.ExtraPeerDirs, - "Application specific comma-separated list of import paths which are considered, after tag-specified peers and base-peer-dirs, for conversions.") - pflag.CommandLine.BoolVar(&ca.SkipUnsafe, "skip-unsafe", ca.SkipUnsafe, - "If true, will not generate code using unsafe pointer conversions; resulting code may be slower.") -} - -// Validate checks the given arguments. -func Validate(genericArgs *args.GeneratorArgs) error { - _ = genericArgs.CustomArgs.(*CustomArgs) - - if len(genericArgs.OutputFileBaseName) == 0 { - return fmt.Errorf("output file base name cannot be empty") - } - - return nil -} diff --git a/vendor/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go b/vendor/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go deleted file mode 100644 index 832b1ce..0000000 --- a/vendor/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go +++ /dev/null @@ -1,1195 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generators - -import ( - "bytes" - "fmt" - "io" - "path/filepath" - "reflect" - "sort" - "strings" - - "k8s.io/gengo/args" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/klog" - - conversionargs "k8s.io/code-generator/cmd/conversion-gen/args" -) - -// These are the comment tags that carry parameters for conversion generation. -const ( - // e.g., "+k8s:conversion-gen=" in doc.go, where is the - // import path of the package the peer types are defined in. - // e.g., "+k8s:conversion-gen=false" in a type's comment will let - // conversion-gen skip that type. - tagName = "k8s:conversion-gen" - // e.g. "+k8s:conversion-gen:explicit-from=net/url.Values" in the type comment - // will result in generating conversion from net/url.Values. - explicitFromTagName = "k8s:conversion-gen:explicit-from" - // e.g., "+k8s:conversion-gen-external-types=" in doc.go, where - // is the relative path to the package the types are defined in. - externalTypesTagName = "k8s:conversion-gen-external-types" -) - -func extractTag(comments []string) []string { - return types.ExtractCommentTags("+", comments)[tagName] -} - -func extractExplicitFromTag(comments []string) []string { - return types.ExtractCommentTags("+", comments)[explicitFromTagName] -} - -func extractExternalTypesTag(comments []string) []string { - return types.ExtractCommentTags("+", comments)[externalTypesTagName] -} - -func isCopyOnly(comments []string) bool { - values := types.ExtractCommentTags("+", comments)["k8s:conversion-fn"] - return len(values) == 1 && values[0] == "copy-only" -} - -func isDrop(comments []string) bool { - values := types.ExtractCommentTags("+", comments)["k8s:conversion-fn"] - return len(values) == 1 && values[0] == "drop" -} - -// TODO: This is created only to reduce number of changes in a single PR. -// Remove it and use PublicNamer instead. -func conversionNamer() *namer.NameStrategy { - return &namer.NameStrategy{ - Join: func(pre string, in []string, post string) string { - return strings.Join(in, "_") - }, - PrependPackageNames: 1, - } -} - -func defaultFnNamer() *namer.NameStrategy { - return &namer.NameStrategy{ - Prefix: "SetDefaults_", - Join: func(pre string, in []string, post string) string { - return pre + strings.Join(in, "_") + post - }, - } -} - -// NameSystems returns the name system used by the generators in this package. -func NameSystems() namer.NameSystems { - return namer.NameSystems{ - "public": conversionNamer(), - "raw": namer.NewRawNamer("", nil), - "defaultfn": defaultFnNamer(), - } -} - -// DefaultNameSystem returns the default name system for ordering the types to be -// processed by the generators in this package. -func DefaultNameSystem() string { - return "public" -} - -func getPeerTypeFor(context *generator.Context, t *types.Type, potenialPeerPkgs []string) *types.Type { - for _, ppp := range potenialPeerPkgs { - p := context.Universe.Package(ppp) - if p == nil { - continue - } - if p.Has(t.Name.Name) { - return p.Type(t.Name.Name) - } - } - return nil -} - -type conversionPair struct { - inType *types.Type - outType *types.Type -} - -// All of the types in conversions map are of type "DeclarationOf" with -// the underlying type being "Func". -type conversionFuncMap map[conversionPair]*types.Type - -// Returns all manually-defined conversion functions in the package. -func getManualConversionFunctions(context *generator.Context, pkg *types.Package, manualMap conversionFuncMap) { - if pkg == nil { - klog.Warningf("Skipping nil package passed to getManualConversionFunctions") - return - } - klog.V(5).Infof("Scanning for conversion functions in %v", pkg.Name) - - scopeName := types.Ref(conversionPackagePath, "Scope").Name - errorName := types.Ref("", "error").Name - buffer := &bytes.Buffer{} - sw := generator.NewSnippetWriter(buffer, context, "$", "$") - - for _, f := range pkg.Functions { - if f.Underlying == nil || f.Underlying.Kind != types.Func { - klog.Errorf("Malformed function: %#v", f) - continue - } - if f.Underlying.Signature == nil { - klog.Errorf("Function without signature: %#v", f) - continue - } - klog.V(8).Infof("Considering function %s", f.Name) - signature := f.Underlying.Signature - // Check whether the function is conversion function. - // Note that all of them have signature: - // func Convert_inType_To_outType(inType, outType, conversion.Scope) error - if signature.Receiver != nil { - klog.V(8).Infof("%s has a receiver", f.Name) - continue - } - if len(signature.Parameters) != 3 || signature.Parameters[2].Name != scopeName { - klog.V(8).Infof("%s has wrong parameters", f.Name) - continue - } - if len(signature.Results) != 1 || signature.Results[0].Name != errorName { - klog.V(8).Infof("%s has wrong results", f.Name) - continue - } - inType := signature.Parameters[0] - outType := signature.Parameters[1] - if inType.Kind != types.Pointer || outType.Kind != types.Pointer { - klog.V(8).Infof("%s has wrong parameter types", f.Name) - continue - } - // Now check if the name satisfies the convention. - // TODO: This should call the Namer directly. - args := argsFromType(inType.Elem, outType.Elem) - sw.Do("Convert_$.inType|public$_To_$.outType|public$", args) - if f.Name.Name == buffer.String() { - klog.V(4).Infof("Found conversion function %s", f.Name) - key := conversionPair{inType.Elem, outType.Elem} - // We might scan the same package twice, and that's OK. - if v, ok := manualMap[key]; ok && v != nil && v.Name.Package != pkg.Path { - panic(fmt.Sprintf("duplicate static conversion defined: %s -> %s from:\n%s.%s\n%s.%s", key.inType, key.outType, v.Name.Package, v.Name.Name, f.Name.Package, f.Name.Name)) - } - manualMap[key] = f - } else { - // prevent user error when they don't get the correct conversion signature - if strings.HasPrefix(f.Name.Name, "Convert_") { - klog.Errorf("Rename function %s %s -> %s to match expected conversion signature", f.Name.Package, f.Name.Name, buffer.String()) - } - klog.V(8).Infof("%s has wrong name", f.Name) - } - buffer.Reset() - } -} - -func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { - boilerplate, err := arguments.LoadGoBoilerplate() - if err != nil { - klog.Fatalf("Failed loading boilerplate: %v", err) - } - - packages := generator.Packages{} - header := append([]byte(fmt.Sprintf("// +build !%s\n\n", arguments.GeneratedBuildTag)), boilerplate...) - - // Accumulate pre-existing conversion functions. - // TODO: This is too ad-hoc. We need a better way. - manualConversions := conversionFuncMap{} - - // Record types that are memory equivalent. A type is memory equivalent - // if it has the same memory layout and no nested manual conversion is - // defined. - // TODO: in the future, relax the nested manual conversion requirement - // if we can show that a large enough types are memory identical but - // have non-trivial conversion - memoryEquivalentTypes := equalMemoryTypes{} - - // We are generating conversions only for packages that are explicitly - // passed as InputDir. - processed := map[string]bool{} - for _, i := range context.Inputs { - // skip duplicates - if processed[i] { - continue - } - processed[i] = true - - klog.V(5).Infof("considering pkg %q", i) - pkg := context.Universe[i] - // typesPkg is where the versioned types are defined. Sometimes it is - // different from pkg. For example, kubernetes core/v1 types are defined - // in vendor/k8s.io/api/core/v1, while pkg is at pkg/api/v1. - typesPkg := pkg - if pkg == nil { - // If the input had no Go files, for example. - continue - } - - // Add conversion and defaulting functions. - getManualConversionFunctions(context, pkg, manualConversions) - - // Only generate conversions for packages which explicitly request it - // by specifying one or more "+k8s:conversion-gen=" - // in their doc.go file. - peerPkgs := extractTag(pkg.Comments) - if peerPkgs != nil { - klog.V(5).Infof(" tags: %q", peerPkgs) - if len(peerPkgs) == 1 && peerPkgs[0] == "false" { - // If a single +k8s:conversion-gen=false tag is defined, we still want - // the generator to fire for this package for explicit conversions, but - // we are clearing the peerPkgs to not generate any standard conversions. - peerPkgs = nil - } - } else { - klog.V(5).Infof(" no tag") - continue - } - skipUnsafe := false - if customArgs, ok := arguments.CustomArgs.(*conversionargs.CustomArgs); ok { - if len(peerPkgs) > 0 { - peerPkgs = append(peerPkgs, customArgs.BasePeerDirs...) - peerPkgs = append(peerPkgs, customArgs.ExtraPeerDirs...) - } - skipUnsafe = customArgs.SkipUnsafe - } - - // if the external types are not in the same package where the conversion functions to be generated - externalTypesValues := extractExternalTypesTag(pkg.Comments) - if externalTypesValues != nil { - if len(externalTypesValues) != 1 { - klog.Fatalf(" expect only one value for %q tag, got: %q", externalTypesTagName, externalTypesValues) - } - externalTypes := externalTypesValues[0] - klog.V(5).Infof(" external types tags: %q", externalTypes) - var err error - typesPkg, err = context.AddDirectory(externalTypes) - if err != nil { - klog.Fatalf("cannot import package %s", externalTypes) - } - // update context.Order to the latest context.Universe - orderer := namer.Orderer{Namer: namer.NewPublicNamer(1)} - context.Order = orderer.OrderUniverse(context.Universe) - } - - // if the source path is within a /vendor/ directory (for example, - // k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/meta/v1), allow - // generation to output to the proper relative path (under vendor). - // Otherwise, the generator will create the file in the wrong location - // in the output directory. - // TODO: build a more fundamental concept in gengo for dealing with modifications - // to vendored packages. - vendorless := func(pkg string) string { - if pos := strings.LastIndex(pkg, "/vendor/"); pos != -1 { - return pkg[pos+len("/vendor/"):] - } - return pkg - } - for i := range peerPkgs { - peerPkgs[i] = vendorless(peerPkgs[i]) - } - - // Make sure our peer-packages are added and fully parsed. - for _, pp := range peerPkgs { - context.AddDir(pp) - p := context.Universe[pp] - if nil == p { - klog.Fatalf("failed to find pkg: %s", pp) - } - getManualConversionFunctions(context, p, manualConversions) - } - - unsafeEquality := TypesEqual(memoryEquivalentTypes) - if skipUnsafe { - unsafeEquality = noEquality{} - } - - path := pkg.Path - // if the source path is within a /vendor/ directory (for example, - // k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/meta/v1), allow - // generation to output to the proper relative path (under vendor). - // Otherwise, the generator will create the file in the wrong location - // in the output directory. - // TODO: build a more fundamental concept in gengo for dealing with modifications - // to vendored packages. - if strings.HasPrefix(pkg.SourcePath, arguments.OutputBase) { - expandedPath := strings.TrimPrefix(pkg.SourcePath, arguments.OutputBase) - if strings.Contains(expandedPath, "/vendor/") { - path = expandedPath - } - } - packages = append(packages, - &generator.DefaultPackage{ - PackageName: filepath.Base(pkg.Path), - PackagePath: path, - HeaderText: header, - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - return []generator.Generator{ - NewGenConversion(arguments.OutputFileBaseName, typesPkg.Path, pkg.Path, manualConversions, peerPkgs, unsafeEquality), - } - }, - FilterFunc: func(c *generator.Context, t *types.Type) bool { - return t.Name.Package == typesPkg.Path - }, - }) - } - - // If there is a manual conversion defined between two types, exclude it - // from being a candidate for unsafe conversion - for k, v := range manualConversions { - if isCopyOnly(v.CommentLines) { - klog.V(5).Infof("Conversion function %s will not block memory copy because it is copy-only", v.Name) - continue - } - // this type should be excluded from all equivalence, because the converter must be called. - memoryEquivalentTypes.Skip(k.inType, k.outType) - } - - return packages -} - -type equalMemoryTypes map[conversionPair]bool - -func (e equalMemoryTypes) Skip(a, b *types.Type) { - e[conversionPair{a, b}] = false - e[conversionPair{b, a}] = false -} - -func (e equalMemoryTypes) Equal(a, b *types.Type) bool { - // alreadyVisitedTypes holds all the types that have already been checked in the structural type recursion. - alreadyVisitedTypes := make(map[*types.Type]bool) - return e.cachingEqual(a, b, alreadyVisitedTypes) -} - -func (e equalMemoryTypes) cachingEqual(a, b *types.Type, alreadyVisitedTypes map[*types.Type]bool) bool { - if a == b { - return true - } - if equal, ok := e[conversionPair{a, b}]; ok { - return equal - } - if equal, ok := e[conversionPair{b, a}]; ok { - return equal - } - result := e.equal(a, b, alreadyVisitedTypes) - e[conversionPair{a, b}] = result - e[conversionPair{b, a}] = result - return result -} - -func (e equalMemoryTypes) equal(a, b *types.Type, alreadyVisitedTypes map[*types.Type]bool) bool { - in, out := unwrapAlias(a), unwrapAlias(b) - switch { - case in == out: - return true - case in.Kind == out.Kind: - // if the type exists already, return early to avoid recursion - if alreadyVisitedTypes[in] { - return true - } - alreadyVisitedTypes[in] = true - - switch in.Kind { - case types.Struct: - if len(in.Members) != len(out.Members) { - return false - } - for i, inMember := range in.Members { - outMember := out.Members[i] - if !e.cachingEqual(inMember.Type, outMember.Type, alreadyVisitedTypes) { - return false - } - } - return true - case types.Pointer: - return e.cachingEqual(in.Elem, out.Elem, alreadyVisitedTypes) - case types.Map: - return e.cachingEqual(in.Key, out.Key, alreadyVisitedTypes) && e.cachingEqual(in.Elem, out.Elem, alreadyVisitedTypes) - case types.Slice: - return e.cachingEqual(in.Elem, out.Elem, alreadyVisitedTypes) - case types.Interface: - // TODO: determine whether the interfaces are actually equivalent - for now, they must have the - // same type. - return false - case types.Builtin: - return in.Name.Name == out.Name.Name - } - } - return false -} - -func findMember(t *types.Type, name string) (types.Member, bool) { - if t.Kind != types.Struct { - return types.Member{}, false - } - for _, member := range t.Members { - if member.Name == name { - return member, true - } - } - return types.Member{}, false -} - -// unwrapAlias recurses down aliased types to find the bedrock type. -func unwrapAlias(in *types.Type) *types.Type { - for in.Kind == types.Alias { - in = in.Underlying - } - return in -} - -const ( - runtimePackagePath = "k8s.io/apimachinery/pkg/runtime" - conversionPackagePath = "k8s.io/apimachinery/pkg/conversion" -) - -type noEquality struct{} - -func (noEquality) Equal(_, _ *types.Type) bool { return false } - -type TypesEqual interface { - Equal(a, b *types.Type) bool -} - -// genConversion produces a file with a autogenerated conversions. -type genConversion struct { - generator.DefaultGen - // the package that contains the types that conversion func are going to be - // generated for - typesPackage string - // the package that the conversion funcs are going to be output to - outputPackage string - // packages that contain the peer of types in typesPacakge - peerPackages []string - manualConversions conversionFuncMap - imports namer.ImportTracker - types []*types.Type - explicitConversions []conversionPair - skippedFields map[*types.Type][]string - useUnsafe TypesEqual -} - -func NewGenConversion(sanitizedName, typesPackage, outputPackage string, manualConversions conversionFuncMap, peerPkgs []string, useUnsafe TypesEqual) generator.Generator { - return &genConversion{ - DefaultGen: generator.DefaultGen{ - OptionalName: sanitizedName, - }, - typesPackage: typesPackage, - outputPackage: outputPackage, - peerPackages: peerPkgs, - manualConversions: manualConversions, - imports: generator.NewImportTracker(), - types: []*types.Type{}, - explicitConversions: []conversionPair{}, - skippedFields: map[*types.Type][]string{}, - useUnsafe: useUnsafe, - } -} - -func (g *genConversion) Namers(c *generator.Context) namer.NameSystems { - // Have the raw namer for this file track what it imports. - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - "publicIT": &namerPlusImportTracking{ - delegate: conversionNamer(), - tracker: g.imports, - }, - } -} - -type namerPlusImportTracking struct { - delegate namer.Namer - tracker namer.ImportTracker -} - -func (n *namerPlusImportTracking) Name(t *types.Type) string { - n.tracker.AddType(t) - return n.delegate.Name(t) -} - -func (g *genConversion) convertibleOnlyWithinPackage(inType, outType *types.Type) bool { - var t *types.Type - var other *types.Type - if inType.Name.Package == g.typesPackage { - t, other = inType, outType - } else { - t, other = outType, inType - } - - if t.Name.Package != g.typesPackage { - return false - } - // If the type has opted out, skip it. - tagvals := extractTag(t.CommentLines) - if tagvals != nil { - if tagvals[0] != "false" { - klog.Fatalf("Type %v: unsupported %s value: %q", t, tagName, tagvals[0]) - } - klog.V(5).Infof("type %v requests no conversion generation, skipping", t) - return false - } - // TODO: Consider generating functions for other kinds too. - if t.Kind != types.Struct { - return false - } - // Also, filter out private types. - if namer.IsPrivateGoName(other.Name.Name) { - return false - } - return true -} - -func getExplicitFromTypes(t *types.Type) []types.Name { - comments := append(t.SecondClosestCommentLines, t.CommentLines...) - paths := extractExplicitFromTag(comments) - result := []types.Name{} - for _, path := range paths { - items := strings.Split(path, ".") - if len(items) != 2 { - klog.Errorf("Unexpected k8s:conversion-gen:explicit-from tag: %s", path) - continue - } - switch { - case items[0] == "net/url" && items[1] == "Values": - default: - klog.Fatalf("Not supported k8s:conversion-gen:explicit-from tag: %s", path) - } - result = append(result, types.Name{Package: items[0], Name: items[1]}) - } - return result -} - -func (g *genConversion) Filter(c *generator.Context, t *types.Type) bool { - convertibleWithPeer := func() bool { - peerType := getPeerTypeFor(c, t, g.peerPackages) - if peerType == nil { - return false - } - if !g.convertibleOnlyWithinPackage(t, peerType) { - return false - } - g.types = append(g.types, t) - return true - }() - - explicitlyConvertible := func() bool { - inTypes := getExplicitFromTypes(t) - if len(inTypes) == 0 { - return false - } - for i := range inTypes { - pair := conversionPair{ - inType: &types.Type{Name: inTypes[i]}, - outType: t, - } - g.explicitConversions = append(g.explicitConversions, pair) - } - return true - }() - - return convertibleWithPeer || explicitlyConvertible -} - -func (g *genConversion) isOtherPackage(pkg string) bool { - if pkg == g.outputPackage { - return false - } - if strings.HasSuffix(pkg, `"`+g.outputPackage+`"`) { - return false - } - return true -} - -func (g *genConversion) Imports(c *generator.Context) (imports []string) { - var importLines []string - for _, singleImport := range g.imports.ImportLines() { - if g.isOtherPackage(singleImport) { - importLines = append(importLines, singleImport) - } - } - return importLines -} - -func argsFromType(inType, outType *types.Type) generator.Args { - return generator.Args{ - "inType": inType, - "outType": outType, - } -} - -const nameTmpl = "Convert_$.inType|publicIT$_To_$.outType|publicIT$" - -func (g *genConversion) preexists(inType, outType *types.Type) (*types.Type, bool) { - function, ok := g.manualConversions[conversionPair{inType, outType}] - return function, ok -} - -func (g *genConversion) Init(c *generator.Context, w io.Writer) error { - if klog.V(5) { - if m, ok := g.useUnsafe.(equalMemoryTypes); ok { - var result []string - klog.Infof("All objects without identical memory layout:") - for k, v := range m { - if v { - continue - } - result = append(result, fmt.Sprintf(" %s -> %s = %t", k.inType, k.outType, v)) - } - sort.Strings(result) - for _, s := range result { - klog.Infof(s) - } - } - } - sw := generator.NewSnippetWriter(w, c, "$", "$") - sw.Do("func init() {\n", nil) - sw.Do("localSchemeBuilder.Register(RegisterConversions)\n", nil) - sw.Do("}\n", nil) - - scheme := c.Universe.Type(types.Name{Package: runtimePackagePath, Name: "Scheme"}) - schemePtr := &types.Type{ - Kind: types.Pointer, - Elem: scheme, - } - sw.Do("// RegisterConversions adds conversion functions to the given scheme.\n", nil) - sw.Do("// Public to allow building arbitrary schemes.\n", nil) - sw.Do("func RegisterConversions(s $.|raw$) error {\n", schemePtr) - for _, t := range g.types { - peerType := getPeerTypeFor(c, t, g.peerPackages) - if _, found := g.preexists(t, peerType); !found { - args := argsFromType(t, peerType).With("Scope", types.Ref(conversionPackagePath, "Scope")) - sw.Do("if err := s.AddGeneratedConversionFunc((*$.inType|raw$)(nil), (*$.outType|raw$)(nil), func(a, b interface{}, scope $.Scope|raw$) error { return "+nameTmpl+"(a.(*$.inType|raw$), b.(*$.outType|raw$), scope) }); err != nil { return err }\n", args) - } - if _, found := g.preexists(peerType, t); !found { - args := argsFromType(peerType, t).With("Scope", types.Ref(conversionPackagePath, "Scope")) - sw.Do("if err := s.AddGeneratedConversionFunc((*$.inType|raw$)(nil), (*$.outType|raw$)(nil), func(a, b interface{}, scope $.Scope|raw$) error { return "+nameTmpl+"(a.(*$.inType|raw$), b.(*$.outType|raw$), scope) }); err != nil { return err }\n", args) - } - } - - for i := range g.explicitConversions { - args := argsFromType(g.explicitConversions[i].inType, g.explicitConversions[i].outType).With("Scope", types.Ref(conversionPackagePath, "Scope")) - sw.Do("if err := s.AddGeneratedConversionFunc((*$.inType|raw$)(nil), (*$.outType|raw$)(nil), func(a, b interface{}, scope $.Scope|raw$) error { return "+nameTmpl+"(a.(*$.inType|raw$), b.(*$.outType|raw$), scope) }); err != nil { return err }\n", args) - } - - var pairs []conversionPair - for pair, t := range g.manualConversions { - if t.Name.Package != g.outputPackage { - continue - } - pairs = append(pairs, pair) - } - // sort by name of the conversion function - sort.Slice(pairs, func(i, j int) bool { - if g.manualConversions[pairs[i]].Name.Name < g.manualConversions[pairs[j]].Name.Name { - return true - } - return false - }) - for _, pair := range pairs { - args := argsFromType(pair.inType, pair.outType).With("Scope", types.Ref(conversionPackagePath, "Scope")).With("fn", g.manualConversions[pair]) - sw.Do("if err := s.AddConversionFunc((*$.inType|raw$)(nil), (*$.outType|raw$)(nil), func(a, b interface{}, scope $.Scope|raw$) error { return $.fn|raw$(a.(*$.inType|raw$), b.(*$.outType|raw$), scope) }); err != nil { return err }\n", args) - } - - sw.Do("return nil\n", nil) - sw.Do("}\n\n", nil) - return sw.Error() -} - -func (g *genConversion) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - klog.V(5).Infof("generating for type %v", t) - sw := generator.NewSnippetWriter(w, c, "$", "$") - - if peerType := getPeerTypeFor(c, t, g.peerPackages); peerType != nil { - g.generateConversion(t, peerType, sw) - g.generateConversion(peerType, t, sw) - } - - for _, inTypeName := range getExplicitFromTypes(t) { - inPkg, ok := c.Universe[inTypeName.Package] - if !ok { - klog.Errorf("Unrecognized package: %s", inTypeName.Package) - continue - } - inType, ok := inPkg.Types[inTypeName.Name] - if !ok { - klog.Errorf("Unrecognized type in package %s: %s", inTypeName.Package, inTypeName.Name) - continue - } - switch { - case inType.Name.Package == "net/url" && inType.Name.Name == "Values": - g.generateFromUrlValues(inType, t, sw) - default: - klog.Errorf("Not supported input type: %#v", inType.Name) - } - } - - return sw.Error() -} - -func (g *genConversion) generateConversion(inType, outType *types.Type, sw *generator.SnippetWriter) { - args := argsFromType(inType, outType). - With("Scope", types.Ref(conversionPackagePath, "Scope")) - - sw.Do("func auto"+nameTmpl+"(in *$.inType|raw$, out *$.outType|raw$, s $.Scope|raw$) error {\n", args) - g.generateFor(inType, outType, sw) - sw.Do("return nil\n", nil) - sw.Do("}\n\n", nil) - - if _, found := g.preexists(inType, outType); found { - // There is a public manual Conversion method: use it. - } else if skipped := g.skippedFields[inType]; len(skipped) != 0 { - // The inType had some fields we could not generate. - klog.Errorf("Warning: could not find nor generate a final Conversion function for %v -> %v", inType, outType) - klog.Errorf(" the following fields need manual conversion:") - for _, f := range skipped { - klog.Errorf(" - %v", f) - } - } else { - // Emit a public conversion function. - sw.Do("// "+nameTmpl+" is an autogenerated conversion function.\n", args) - sw.Do("func "+nameTmpl+"(in *$.inType|raw$, out *$.outType|raw$, s $.Scope|raw$) error {\n", args) - sw.Do("return auto"+nameTmpl+"(in, out, s)\n", args) - sw.Do("}\n\n", nil) - } -} - -// we use the system of shadowing 'in' and 'out' so that the same code is valid -// at any nesting level. This makes the autogenerator easy to understand, and -// the compiler shouldn't care. -func (g *genConversion) generateFor(inType, outType *types.Type, sw *generator.SnippetWriter) { - klog.V(5).Infof("generating %v -> %v", inType, outType) - var f func(*types.Type, *types.Type, *generator.SnippetWriter) - - switch inType.Kind { - case types.Builtin: - f = g.doBuiltin - case types.Map: - f = g.doMap - case types.Slice: - f = g.doSlice - case types.Struct: - f = g.doStruct - case types.Pointer: - f = g.doPointer - case types.Alias: - f = g.doAlias - default: - f = g.doUnknown - } - - f(inType, outType, sw) -} - -func (g *genConversion) doBuiltin(inType, outType *types.Type, sw *generator.SnippetWriter) { - if inType == outType { - sw.Do("*out = *in\n", nil) - } else { - sw.Do("*out = $.|raw$(*in)\n", outType) - } -} - -func (g *genConversion) doMap(inType, outType *types.Type, sw *generator.SnippetWriter) { - sw.Do("*out = make($.|raw$, len(*in))\n", outType) - if isDirectlyAssignable(inType.Key, outType.Key) { - sw.Do("for key, val := range *in {\n", nil) - if isDirectlyAssignable(inType.Elem, outType.Elem) { - if inType.Key == outType.Key { - sw.Do("(*out)[key] = ", nil) - } else { - sw.Do("(*out)[$.|raw$(key)] = ", outType.Key) - } - if inType.Elem == outType.Elem { - sw.Do("val\n", nil) - } else { - sw.Do("$.|raw$(val)\n", outType.Elem) - } - } else { - sw.Do("newVal := new($.|raw$)\n", outType.Elem) - if function, ok := g.preexists(inType.Elem, outType.Elem); ok { - sw.Do("if err := $.|raw$(&val, newVal, s); err != nil {\n", function) - } else if g.convertibleOnlyWithinPackage(inType.Elem, outType.Elem) { - sw.Do("if err := "+nameTmpl+"(&val, newVal, s); err != nil {\n", argsFromType(inType.Elem, outType.Elem)) - } else { - sw.Do("// TODO: Inefficient conversion - can we improve it?\n", nil) - sw.Do("if err := s.Convert(&val, newVal, 0); err != nil {\n", nil) - } - sw.Do("return err\n", nil) - sw.Do("}\n", nil) - if inType.Key == outType.Key { - sw.Do("(*out)[key] = *newVal\n", nil) - } else { - sw.Do("(*out)[$.|raw$(key)] = *newVal\n", outType.Key) - } - } - } else { - // TODO: Implement it when necessary. - sw.Do("for range *in {\n", nil) - sw.Do("// FIXME: Converting unassignable keys unsupported $.|raw$\n", inType.Key) - } - sw.Do("}\n", nil) -} - -func (g *genConversion) doSlice(inType, outType *types.Type, sw *generator.SnippetWriter) { - sw.Do("*out = make($.|raw$, len(*in))\n", outType) - if inType.Elem == outType.Elem && inType.Elem.Kind == types.Builtin { - sw.Do("copy(*out, *in)\n", nil) - } else { - sw.Do("for i := range *in {\n", nil) - if isDirectlyAssignable(inType.Elem, outType.Elem) { - if inType.Elem == outType.Elem { - sw.Do("(*out)[i] = (*in)[i]\n", nil) - } else { - sw.Do("(*out)[i] = $.|raw$((*in)[i])\n", outType.Elem) - } - } else { - if function, ok := g.preexists(inType.Elem, outType.Elem); ok { - sw.Do("if err := $.|raw$(&(*in)[i], &(*out)[i], s); err != nil {\n", function) - } else if g.convertibleOnlyWithinPackage(inType.Elem, outType.Elem) { - sw.Do("if err := "+nameTmpl+"(&(*in)[i], &(*out)[i], s); err != nil {\n", argsFromType(inType.Elem, outType.Elem)) - } else { - // TODO: This triggers on metav1.ObjectMeta <-> metav1.ObjectMeta and - // similar because neither package is the target package, and - // we really don't know which package will have the conversion - // function defined. This fires on basically every object - // conversion outside of pkg/api/v1. - sw.Do("// TODO: Inefficient conversion - can we improve it?\n", nil) - sw.Do("if err := s.Convert(&(*in)[i], &(*out)[i], 0); err != nil {\n", nil) - } - sw.Do("return err\n", nil) - sw.Do("}\n", nil) - } - sw.Do("}\n", nil) - } -} - -func (g *genConversion) doStruct(inType, outType *types.Type, sw *generator.SnippetWriter) { - for _, inMember := range inType.Members { - if tagvals := extractTag(inMember.CommentLines); tagvals != nil && tagvals[0] == "false" { - // This field is excluded from conversion. - sw.Do("// INFO: in."+inMember.Name+" opted out of conversion generation\n", nil) - continue - } - outMember, found := findMember(outType, inMember.Name) - if !found { - // This field doesn't exist in the peer. - sw.Do("// WARNING: in."+inMember.Name+" requires manual conversion: does not exist in peer-type\n", nil) - g.skippedFields[inType] = append(g.skippedFields[inType], inMember.Name) - continue - } - - inMemberType, outMemberType := inMember.Type, outMember.Type - // create a copy of both underlying types but give them the top level alias name (since aliases - // are assignable) - if underlying := unwrapAlias(inMemberType); underlying != inMemberType { - copied := *underlying - copied.Name = inMemberType.Name - inMemberType = &copied - } - if underlying := unwrapAlias(outMemberType); underlying != outMemberType { - copied := *underlying - copied.Name = outMemberType.Name - outMemberType = &copied - } - - args := argsFromType(inMemberType, outMemberType).With("name", inMember.Name) - - // try a direct memory copy for any type that has exactly equivalent values - if g.useUnsafe.Equal(inMemberType, outMemberType) { - args = args. - With("Pointer", types.Ref("unsafe", "Pointer")). - With("SliceHeader", types.Ref("reflect", "SliceHeader")) - switch inMemberType.Kind { - case types.Pointer: - sw.Do("out.$.name$ = ($.outType|raw$)($.Pointer|raw$(in.$.name$))\n", args) - continue - case types.Map: - sw.Do("out.$.name$ = *(*$.outType|raw$)($.Pointer|raw$(&in.$.name$))\n", args) - continue - case types.Slice: - sw.Do("out.$.name$ = *(*$.outType|raw$)($.Pointer|raw$(&in.$.name$))\n", args) - continue - } - } - - // check based on the top level name, not the underlying names - if function, ok := g.preexists(inMember.Type, outMember.Type); ok { - if isDrop(function.CommentLines) { - continue - } - // copy-only functions that are directly assignable can be inlined instead of invoked. - // As an example, conversion functions exist that allow types with private fields to be - // correctly copied between types. These functions are equivalent to a memory assignment, - // and are necessary for the reflection path, but should not block memory conversion. - // Convert_unversioned_Time_to_unversioned_Time is an example of this logic. - if !isCopyOnly(function.CommentLines) || !g.isFastConversion(inMemberType, outMemberType) { - args["function"] = function - sw.Do("if err := $.function|raw$(&in.$.name$, &out.$.name$, s); err != nil {\n", args) - sw.Do("return err\n", nil) - sw.Do("}\n", nil) - continue - } - klog.V(5).Infof("Skipped function %s because it is copy-only and we can use direct assignment", function.Name) - } - - // If we can't auto-convert, punt before we emit any code. - if inMemberType.Kind != outMemberType.Kind { - sw.Do("// WARNING: in."+inMember.Name+" requires manual conversion: inconvertible types ("+ - inMemberType.String()+" vs "+outMemberType.String()+")\n", nil) - g.skippedFields[inType] = append(g.skippedFields[inType], inMember.Name) - continue - } - - switch inMemberType.Kind { - case types.Builtin: - if inMemberType == outMemberType { - sw.Do("out.$.name$ = in.$.name$\n", args) - } else { - sw.Do("out.$.name$ = $.outType|raw$(in.$.name$)\n", args) - } - case types.Map, types.Slice, types.Pointer: - if g.isDirectlyAssignable(inMemberType, outMemberType) { - sw.Do("out.$.name$ = in.$.name$\n", args) - continue - } - - sw.Do("if in.$.name$ != nil {\n", args) - sw.Do("in, out := &in.$.name$, &out.$.name$\n", args) - g.generateFor(inMemberType, outMemberType, sw) - sw.Do("} else {\n", nil) - sw.Do("out.$.name$ = nil\n", args) - sw.Do("}\n", nil) - case types.Struct: - if g.isDirectlyAssignable(inMemberType, outMemberType) { - sw.Do("out.$.name$ = in.$.name$\n", args) - continue - } - if g.convertibleOnlyWithinPackage(inMemberType, outMemberType) { - sw.Do("if err := "+nameTmpl+"(&in.$.name$, &out.$.name$, s); err != nil {\n", args) - } else { - sw.Do("// TODO: Inefficient conversion - can we improve it?\n", nil) - sw.Do("if err := s.Convert(&in.$.name$, &out.$.name$, 0); err != nil {\n", args) - } - sw.Do("return err\n", nil) - sw.Do("}\n", nil) - case types.Alias: - if isDirectlyAssignable(inMemberType, outMemberType) { - if inMemberType == outMemberType { - sw.Do("out.$.name$ = in.$.name$\n", args) - } else { - sw.Do("out.$.name$ = $.outType|raw$(in.$.name$)\n", args) - } - } else { - if g.convertibleOnlyWithinPackage(inMemberType, outMemberType) { - sw.Do("if err := "+nameTmpl+"(&in.$.name$, &out.$.name$, s); err != nil {\n", args) - } else { - sw.Do("// TODO: Inefficient conversion - can we improve it?\n", nil) - sw.Do("if err := s.Convert(&in.$.name$, &out.$.name$, 0); err != nil {\n", args) - } - sw.Do("return err\n", nil) - sw.Do("}\n", nil) - } - default: - if g.convertibleOnlyWithinPackage(inMemberType, outMemberType) { - sw.Do("if err := "+nameTmpl+"(&in.$.name$, &out.$.name$, s); err != nil {\n", args) - } else { - sw.Do("// TODO: Inefficient conversion - can we improve it?\n", nil) - sw.Do("if err := s.Convert(&in.$.name$, &out.$.name$, 0); err != nil {\n", args) - } - sw.Do("return err\n", nil) - sw.Do("}\n", nil) - } - } -} - -func (g *genConversion) isFastConversion(inType, outType *types.Type) bool { - switch inType.Kind { - case types.Builtin: - return true - case types.Map, types.Slice, types.Pointer, types.Struct, types.Alias: - return g.isDirectlyAssignable(inType, outType) - default: - return false - } -} - -func (g *genConversion) isDirectlyAssignable(inType, outType *types.Type) bool { - return unwrapAlias(inType) == unwrapAlias(outType) -} - -func (g *genConversion) doPointer(inType, outType *types.Type, sw *generator.SnippetWriter) { - sw.Do("*out = new($.Elem|raw$)\n", outType) - if isDirectlyAssignable(inType.Elem, outType.Elem) { - if inType.Elem == outType.Elem { - sw.Do("**out = **in\n", nil) - } else { - sw.Do("**out = $.|raw$(**in)\n", outType.Elem) - } - } else { - if function, ok := g.preexists(inType.Elem, outType.Elem); ok { - sw.Do("if err := $.|raw$(*in, *out, s); err != nil {\n", function) - } else if g.convertibleOnlyWithinPackage(inType.Elem, outType.Elem) { - sw.Do("if err := "+nameTmpl+"(*in, *out, s); err != nil {\n", argsFromType(inType.Elem, outType.Elem)) - } else { - sw.Do("// TODO: Inefficient conversion - can we improve it?\n", nil) - sw.Do("if err := s.Convert(*in, *out, 0); err != nil {\n", nil) - } - sw.Do("return err\n", nil) - sw.Do("}\n", nil) - } -} - -func (g *genConversion) doAlias(inType, outType *types.Type, sw *generator.SnippetWriter) { - // TODO: Add support for aliases. - g.doUnknown(inType, outType, sw) -} - -func (g *genConversion) doUnknown(inType, outType *types.Type, sw *generator.SnippetWriter) { - sw.Do("// FIXME: Type $.|raw$ is unsupported.\n", inType) -} - -func (g *genConversion) generateFromUrlValues(inType, outType *types.Type, sw *generator.SnippetWriter) { - args := generator.Args{ - "inType": inType, - "outType": outType, - "Scope": types.Ref(conversionPackagePath, "Scope"), - } - sw.Do("func auto"+nameTmpl+"(in *$.inType|raw$, out *$.outType|raw$, s $.Scope|raw$) error {\n", args) - for _, outMember := range outType.Members { - if tagvals := extractTag(outMember.CommentLines); tagvals != nil && tagvals[0] == "false" { - // This field is excluded from conversion. - sw.Do("// INFO: in."+outMember.Name+" opted out of conversion generation\n", nil) - continue - } - jsonTag := reflect.StructTag(outMember.Tags).Get("json") - index := strings.Index(jsonTag, ",") - if index == -1 { - index = len(jsonTag) - } - if index == 0 { - memberArgs := generator.Args{ - "name": outMember.Name, - } - sw.Do("// WARNING: Field $.name$ does not have json tag, skipping.\n\n", memberArgs) - continue - } - memberArgs := generator.Args{ - "name": outMember.Name, - "tag": jsonTag[:index], - } - sw.Do("if values, ok := map[string][]string(*in)[\"$.tag$\"]; ok && len(values) > 0 {\n", memberArgs) - g.fromValuesEntry(inType.Underlying.Elem, outMember, sw) - sw.Do("} else {\n", nil) - g.setZeroValue(outMember, sw) - sw.Do("}\n", nil) - } - sw.Do("return nil\n", nil) - sw.Do("}\n\n", nil) - - if _, found := g.preexists(inType, outType); found { - // There is a public manual Conversion method: use it. - } else { - // Emit a public conversion function. - sw.Do("// "+nameTmpl+" is an autogenerated conversion function.\n", args) - sw.Do("func "+nameTmpl+"(in *$.inType|raw$, out *$.outType|raw$, s $.Scope|raw$) error {\n", args) - sw.Do("return auto"+nameTmpl+"(in, out, s)\n", args) - sw.Do("}\n\n", nil) - } -} - -func (g *genConversion) fromValuesEntry(inType *types.Type, outMember types.Member, sw *generator.SnippetWriter) { - memberArgs := generator.Args{ - "name": outMember.Name, - "type": outMember.Type, - } - if function, ok := g.preexists(inType, outMember.Type); ok { - args := memberArgs.With("function", function) - sw.Do("if err := $.function|raw$(&values, &out.$.name$, s); err != nil {\n", args) - sw.Do("return err\n", nil) - sw.Do("}\n", nil) - return - } - switch { - case outMember.Type == types.String: - sw.Do("out.$.name$ = values[0]\n", memberArgs) - case g.useUnsafe.Equal(inType, outMember.Type): - args := memberArgs.With("Pointer", types.Ref("unsafe", "Pointer")) - switch inType.Kind { - case types.Pointer: - sw.Do("out.$.name$ = ($.type|raw$)($.Pointer|raw$(&values))\n", args) - case types.Map, types.Slice: - sw.Do("out.$.name$ = *(*$.type|raw$)($.Pointer|raw$(&values))\n", args) - default: - // TODO: Support other types to allow more auto-conversions. - sw.Do("// FIXME: out.$.name$ is of not yet supported type and requires manual conversion\n", memberArgs) - } - default: - // TODO: Support other types to allow more auto-conversions. - sw.Do("// FIXME: out.$.name$ is of not yet supported type and requires manual conversion\n", memberArgs) - } -} - -func (g *genConversion) setZeroValue(outMember types.Member, sw *generator.SnippetWriter) { - outMemberType := unwrapAlias(outMember.Type) - memberArgs := generator.Args{ - "name": outMember.Name, - "alias": outMember.Type, - "type": outMemberType, - } - - switch outMemberType.Kind { - case types.Builtin: - switch outMemberType { - case types.String: - sw.Do("out.$.name$ = \"\"\n", memberArgs) - case types.Int64, types.Int32, types.Int16, types.Int, types.Uint64, types.Uint32, types.Uint16, types.Uint: - sw.Do("out.$.name$ = 0\n", memberArgs) - case types.Uintptr, types.Byte: - sw.Do("out.$.name$ = 0\n", memberArgs) - case types.Float64, types.Float32, types.Float: - sw.Do("out.$.name$ = 0\n", memberArgs) - case types.Bool: - sw.Do("out.$.name$ = false\n", memberArgs) - default: - sw.Do("// FIXME: out.$.name$ is of unsupported type and requires manual conversion\n", memberArgs) - } - case types.Struct: - if outMemberType == outMember.Type { - sw.Do("out.$.name$ = $.type|raw${}\n", memberArgs) - } else { - sw.Do("out.$.name$ = $.alias|raw$($.type|raw${})\n", memberArgs) - } - case types.Map, types.Slice, types.Pointer: - sw.Do("out.$.name$ = nil\n", memberArgs) - case types.Alias: - // outMemberType was already unwrapped from aliases - so that should never happen. - sw.Do("// FIXME: unexpected error for out.$.name$\n", memberArgs) - case types.Interface, types.Array: - sw.Do("out.$.name$ = nil\n", memberArgs) - default: - sw.Do("// FIXME: out.$.name$ is of unsupported type and requires manual conversion\n", memberArgs) - } -} - -func isDirectlyAssignable(inType, outType *types.Type) bool { - // TODO: This should maybe check for actual assignability between the two - // types, rather than superficial traits that happen to indicate it is - // assignable in the ways we currently use this code. - return inType.IsAssignable() && (inType.IsPrimitive() || isSamePackage(inType, outType)) -} - -func isSamePackage(inType, outType *types.Type) bool { - return inType.Name.Package == outType.Name.Package -} diff --git a/vendor/k8s.io/code-generator/cmd/conversion-gen/main.go b/vendor/k8s.io/code-generator/cmd/conversion-gen/main.go deleted file mode 100644 index 7c63418..0000000 --- a/vendor/k8s.io/code-generator/cmd/conversion-gen/main.go +++ /dev/null @@ -1,125 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// conversion-gen is a tool for auto-generating functions that convert -// between internal and external types. A general conversion code -// generation task involves three sets of packages: (1) a set of -// packages containing internal types, (2) a single package containing -// the external types, and (3) a single destination package (i.e., -// where the generated conversion functions go, and where the -// developer-authored conversion functions are). The packages -// containing the internal types play the role known as "peer -// packages" in the general code-generation framework of Kubernetes. -// -// For each conversion task, `conversion-gen` will generate functions -// that efficiently convert between same-name types in the two -// (internal, external) packages. The generated functions include -// ones named -// autoConvert___To__ -// for each such pair of types --- both with (pkg1,pkg2) = -// (internal,external) and (pkg1,pkg2) = (external,internal). -// Additionally: if the destination package does not contain one in a -// non-generated file then a function named -// Convert___To__ -// is also generated and it simply calls the `autoConvert...` -// function. The generated conversion functions use standard value -// assignment wherever possible. For compound types, the generated -// conversion functions call the `Convert...` functions for the -// subsidiary types. Thus developers can override the behavior for -// selected types. For a top-level object type (i.e., the type of an -// object that will be input to an apiserver), for such an override to -// be used by the apiserver the developer-maintained conversion -// functions must also be registered by invoking the -// `AddConversionFunc`/`AddGeneratedConversionFunc` method of the -// relevant `Scheme` object from k8s.io/apimachinery/pkg/runtime. -// -// `conversion-gen` will scan its `--input-dirs`, looking at the -// package defined in each of those directories for comment tags that -// define a conversion code generation task. A package requests -// conversion code generation by including one or more comment in the -// package's `doc.go` file (currently anywhere in that file is -// acceptable, but the recommended location is above the `package` -// statement), of the form: -// // +k8s:conversion-gen= -// This introduces a conversion task, for which the destination -// package is the one containing the file with the tag and the tag -// identifies a package containing internal types. If there is also a -// tag of the form -// // +k8s:conversion-gen-external-types= -// then it identifies the package containing the external types; -// otherwise they are in the destination package. -// -// For each conversion code generation task, the full set of internal -// packages (AKA peer packages) consists of the ones specified in the -// `k8s:conversion-gen` tags PLUS any specified in the -// `--base-peer-dirs` and `--extra-peer-dirs` flags on the command -// line. -// -// When generating for a package, individual types or fields of structs may opt -// out of Conversion generation by specifying a comment on the of the form: -// // +k8s:conversion-gen=false -package main - -import ( - "flag" - "path/filepath" - - "github.com/spf13/pflag" - "k8s.io/gengo/args" - "k8s.io/klog" - - generatorargs "k8s.io/code-generator/cmd/conversion-gen/args" - "k8s.io/code-generator/cmd/conversion-gen/generators" - "k8s.io/code-generator/pkg/util" -) - -func main() { - klog.InitFlags(nil) - genericArgs, customArgs := generatorargs.NewDefaults() - - // Override defaults. - // TODO: move this out of conversion-gen - genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) - - genericArgs.AddFlags(pflag.CommandLine) - customArgs.AddFlags(pflag.CommandLine) - flag.Set("logtostderr", "true") - pflag.CommandLine.AddGoFlagSet(flag.CommandLine) - pflag.Parse() - - // k8s.io/apimachinery/pkg/runtime contains a number of manual conversions, - // that we need to generate conversions. - // Packages being dependencies of explicitly requested packages are only - // partially scanned - only types explicitly used are being traversed. - // Not used functions or types are omitted. - // Adding this explicitly to InputDirs ensures that the package is fully - // scanned and all functions are parsed and processed. - genericArgs.InputDirs = append(genericArgs.InputDirs, "k8s.io/apimachinery/pkg/runtime") - - if err := generatorargs.Validate(genericArgs); err != nil { - klog.Fatalf("Error: %v", err) - } - - // Run it. - if err := genericArgs.Execute( - generators.NameSystems(), - generators.DefaultNameSystem(), - generators.Packages, - ); err != nil { - klog.Fatalf("Error: %v", err) - } - klog.V(2).Info("Completed successfully.") -} diff --git a/vendor/k8s.io/code-generator/cmd/deepcopy-gen/args/args.go b/vendor/k8s.io/code-generator/cmd/deepcopy-gen/args/args.go deleted file mode 100644 index 7897130..0000000 --- a/vendor/k8s.io/code-generator/cmd/deepcopy-gen/args/args.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package args - -import ( - "fmt" - - "github.com/spf13/pflag" - "k8s.io/gengo/args" - "k8s.io/gengo/examples/deepcopy-gen/generators" -) - -// CustomArgs is used by the gengo framework to pass args specific to this generator. -type CustomArgs generators.CustomArgs - -// NewDefaults returns default arguments for the generator. -func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { - genericArgs := args.Default().WithoutDefaultFlagParsing() - customArgs := &CustomArgs{} - genericArgs.CustomArgs = (*generators.CustomArgs)(customArgs) // convert to upstream type to make type-casts work there - genericArgs.OutputFileBaseName = "deepcopy_generated" - return genericArgs, customArgs -} - -// AddFlags add the generator flags to the flag set. -func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) { - pflag.CommandLine.StringSliceVar(&ca.BoundingDirs, "bounding-dirs", ca.BoundingDirs, - "Comma-separated list of import paths which bound the types for which deep-copies will be generated.") -} - -// Validate checks the given arguments. -func Validate(genericArgs *args.GeneratorArgs) error { - _ = genericArgs.CustomArgs.(*generators.CustomArgs) - - if len(genericArgs.OutputFileBaseName) == 0 { - return fmt.Errorf("output file base name cannot be empty") - } - - return nil -} diff --git a/vendor/k8s.io/code-generator/cmd/deepcopy-gen/main.go b/vendor/k8s.io/code-generator/cmd/deepcopy-gen/main.go deleted file mode 100644 index 96fb298..0000000 --- a/vendor/k8s.io/code-generator/cmd/deepcopy-gen/main.go +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// deepcopy-gen is a tool for auto-generating DeepCopy functions. -// -// Given a list of input directories, it will generate functions that -// efficiently perform a full deep-copy of each type. For any type that -// offers a `.DeepCopy()` method, it will simply call that. Otherwise it will -// use standard value assignment whenever possible. If that is not possible it -// will try to call its own generated copy function for the type, if the type is -// within the allowed root packages. Failing that, it will fall back on -// `conversion.Cloner.DeepCopy(val)` to make the copy. The resulting file will -// be stored in the same directory as the processed source package. -// -// Generation is governed by comment tags in the source. Any package may -// request DeepCopy generation by including a comment in the file-comments of -// one file, of the form: -// // +k8s:deepcopy-gen=package -// -// DeepCopy functions can be generated for individual types, rather than the -// entire package by specifying a comment on the type definion of the form: -// // +k8s:deepcopy-gen=true -// -// When generating for a whole package, individual types may opt out of -// DeepCopy generation by specifying a comment on the of the form: -// // +k8s:deepcopy-gen=false -// -// Note that registration is a whole-package option, and is not available for -// individual types. -package main - -import ( - "flag" - "path/filepath" - - "github.com/spf13/pflag" - "k8s.io/gengo/args" - "k8s.io/gengo/examples/deepcopy-gen/generators" - "k8s.io/klog" - - generatorargs "k8s.io/code-generator/cmd/deepcopy-gen/args" - "k8s.io/code-generator/pkg/util" -) - -func main() { - klog.InitFlags(nil) - genericArgs, customArgs := generatorargs.NewDefaults() - - // Override defaults. - // TODO: move this out of deepcopy-gen - genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) - - genericArgs.AddFlags(pflag.CommandLine) - customArgs.AddFlags(pflag.CommandLine) - flag.Set("logtostderr", "true") - pflag.CommandLine.AddGoFlagSet(flag.CommandLine) - pflag.Parse() - - if err := generatorargs.Validate(genericArgs); err != nil { - klog.Fatalf("Error: %v", err) - } - - // Run it. - if err := genericArgs.Execute( - generators.NameSystems(), - generators.DefaultNameSystem(), - generators.Packages, - ); err != nil { - klog.Fatalf("Error: %v", err) - } - klog.V(2).Info("Completed successfully.") -} diff --git a/vendor/k8s.io/code-generator/cmd/defaulter-gen/args/args.go b/vendor/k8s.io/code-generator/cmd/defaulter-gen/args/args.go deleted file mode 100644 index 3c5a042..0000000 --- a/vendor/k8s.io/code-generator/cmd/defaulter-gen/args/args.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package args - -import ( - "fmt" - - "github.com/spf13/pflag" - "k8s.io/gengo/args" - "k8s.io/gengo/examples/defaulter-gen/generators" -) - -// CustomArgs is used by the gengo framework to pass args specific to this generator. -type CustomArgs generators.CustomArgs - -// NewDefaults returns default arguments for the generator. -func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { - genericArgs := args.Default().WithoutDefaultFlagParsing() - customArgs := &CustomArgs{} - genericArgs.CustomArgs = (*generators.CustomArgs)(customArgs) // convert to upstream type to make type-casts work there - genericArgs.OutputFileBaseName = "zz_generated.defaults" - return genericArgs, customArgs -} - -// AddFlags add the generator flags to the flag set. -func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) { - pflag.CommandLine.StringSliceVar(&ca.ExtraPeerDirs, "extra-peer-dirs", ca.ExtraPeerDirs, - "Comma-separated list of import paths which are considered, after tag-specified peers, for conversions.") -} - -// Validate checks the given arguments. -func Validate(genericArgs *args.GeneratorArgs) error { - _ = genericArgs.CustomArgs.(*generators.CustomArgs) - - if len(genericArgs.OutputFileBaseName) == 0 { - return fmt.Errorf("output file base name cannot be empty") - } - - return nil -} diff --git a/vendor/k8s.io/code-generator/cmd/defaulter-gen/main.go b/vendor/k8s.io/code-generator/cmd/defaulter-gen/main.go deleted file mode 100644 index 40bb875..0000000 --- a/vendor/k8s.io/code-generator/cmd/defaulter-gen/main.go +++ /dev/null @@ -1,84 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// defaulter-gen is a tool for auto-generating Defaulter functions. -// -// Given a list of input directories, it will scan for top level types -// and generate efficient defaulters for an entire object from the sum -// of the SetDefault_* methods contained in the object tree. -// -// Generation is governed by comment tags in the source. Any package may -// request defaulter generation by including one or more comment tags at -// the package comment level: -// -// // +k8s:defaulter-gen= -// -// which will create defaulters for any type that contains the provided -// field name (if the type has defaulters). Any type may request explicit -// defaulting by providing the comment tag: -// -// // +k8s:defaulter-gen=true|false -// -// An existing defaulter method (`SetDefaults_TYPE`) can provide the -// comment tag: -// -// // +k8s:defaulter-gen=covers -// -// to indicate that the defaulter does not or should not call any nested -// defaulters. -package main - -import ( - "flag" - "path/filepath" - - "github.com/spf13/pflag" - "k8s.io/gengo/args" - "k8s.io/gengo/examples/defaulter-gen/generators" - "k8s.io/klog" - - generatorargs "k8s.io/code-generator/cmd/defaulter-gen/args" - "k8s.io/code-generator/pkg/util" -) - -func main() { - klog.InitFlags(nil) - genericArgs, customArgs := generatorargs.NewDefaults() - - // Override defaults. - // TODO: move this out of defaulter-gen - genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) - - genericArgs.AddFlags(pflag.CommandLine) - customArgs.AddFlags(pflag.CommandLine) - flag.Set("logtostderr", "true") - pflag.CommandLine.AddGoFlagSet(flag.CommandLine) - pflag.Parse() - - if err := generatorargs.Validate(genericArgs); err != nil { - klog.Fatalf("Error: %v", err) - } - - // Run it. - if err := genericArgs.Execute( - generators.NameSystems(), - generators.DefaultNameSystem(), - generators.Packages, - ); err != nil { - klog.Fatalf("Error: %v", err) - } - klog.V(2).Info("Completed successfully.") -} diff --git a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/.gitignore b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/.gitignore deleted file mode 100644 index 0e9aa46..0000000 --- a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/.gitignore +++ /dev/null @@ -1 +0,0 @@ -go-to-protobuf diff --git a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/OWNERS b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/OWNERS deleted file mode 100644 index 6136591..0000000 --- a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/OWNERS +++ /dev/null @@ -1,6 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: -- smarterclayton -reviewers: -- smarterclayton diff --git a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/main.go b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/main.go deleted file mode 100644 index 847a6a5..0000000 --- a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/main.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// go-to-protobuf generates a Protobuf IDL from a Go struct, respecting any -// existing IDL tags on the Go struct. -package main - -import ( - goflag "flag" - - flag "github.com/spf13/pflag" - "k8s.io/code-generator/cmd/go-to-protobuf/protobuf" -) - -var g = protobuf.New() - -func init() { - g.BindFlags(flag.CommandLine) - goflag.Set("logtostderr", "true") - flag.CommandLine.AddGoFlagSet(goflag.CommandLine) -} - -func main() { - flag.Parse() - protobuf.Run(g) -} diff --git a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/cmd.go b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/cmd.go deleted file mode 100644 index 8a7be52..0000000 --- a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/cmd.go +++ /dev/null @@ -1,428 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// go-to-protobuf generates a Protobuf IDL from a Go struct, respecting any -// existing IDL tags on the Go struct. -package protobuf - -import ( - "bytes" - "fmt" - "log" - "os" - "os/exec" - "path/filepath" - "sort" - "strings" - - flag "github.com/spf13/pflag" - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/simple" - "gonum.org/v1/gonum/graph/topo" - - "k8s.io/code-generator/pkg/util" - "k8s.io/gengo/args" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/parser" - "k8s.io/gengo/types" -) - -type Generator struct { - Common args.GeneratorArgs - APIMachineryPackages string - Packages string - OutputBase string - VendorOutputBase string - ProtoImport []string - Conditional string - Clean bool - OnlyIDL bool - KeepGogoproto bool - SkipGeneratedRewrite bool - DropEmbeddedFields string -} - -func New() *Generator { - sourceTree := args.DefaultSourceTree() - common := args.GeneratorArgs{ - OutputBase: sourceTree, - GoHeaderFilePath: filepath.Join(sourceTree, util.BoilerplatePath()), - } - defaultProtoImport := filepath.Join(sourceTree, "k8s.io", "kubernetes", "vendor", "github.com", "gogo", "protobuf", "protobuf") - cwd, err := os.Getwd() - if err != nil { - log.Fatalf("Cannot get current directory.") - } - return &Generator{ - Common: common, - OutputBase: sourceTree, - VendorOutputBase: filepath.Join(cwd, "vendor"), - ProtoImport: []string{defaultProtoImport}, - APIMachineryPackages: strings.Join([]string{ - `+k8s.io/apimachinery/pkg/util/intstr`, - `+k8s.io/apimachinery/pkg/api/resource`, - `+k8s.io/apimachinery/pkg/runtime/schema`, - `+k8s.io/apimachinery/pkg/runtime`, - `k8s.io/apimachinery/pkg/apis/meta/v1`, - `k8s.io/apimachinery/pkg/apis/meta/v1beta1`, - `k8s.io/apimachinery/pkg/apis/testapigroup/v1`, - }, ","), - Packages: "", - DropEmbeddedFields: "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta", - } -} - -func (g *Generator) BindFlags(flag *flag.FlagSet) { - flag.StringVarP(&g.Common.GoHeaderFilePath, "go-header-file", "h", g.Common.GoHeaderFilePath, "File containing boilerplate header text. The string YEAR will be replaced with the current 4-digit year.") - flag.BoolVar(&g.Common.VerifyOnly, "verify-only", g.Common.VerifyOnly, "If true, only verify existing output, do not write anything.") - flag.StringVarP(&g.Packages, "packages", "p", g.Packages, "comma-separated list of directories to get input types from. Directories prefixed with '-' are not generated, directories prefixed with '+' only create types with explicit IDL instructions.") - flag.StringVar(&g.APIMachineryPackages, "apimachinery-packages", g.APIMachineryPackages, "comma-separated list of directories to get apimachinery input types from which are needed by any API. Directories prefixed with '-' are not generated, directories prefixed with '+' only create types with explicit IDL instructions.") - flag.StringVarP(&g.OutputBase, "output-base", "o", g.OutputBase, "Output base; defaults to $GOPATH/src/") - flag.StringVar(&g.VendorOutputBase, "vendor-output-base", g.VendorOutputBase, "The vendor/ directory to look for packages in; defaults to $PWD/vendor/.") - flag.StringSliceVar(&g.ProtoImport, "proto-import", g.ProtoImport, "The search path for the core protobuf .protos, required; defaults $GOPATH/src/k8s.io/kubernetes/vendor/github.com/gogo/protobuf/protobuf.") - flag.StringVar(&g.Conditional, "conditional", g.Conditional, "An optional Golang build tag condition to add to the generated Go code") - flag.BoolVar(&g.Clean, "clean", g.Clean, "If true, remove all generated files for the specified Packages.") - flag.BoolVar(&g.OnlyIDL, "only-idl", g.OnlyIDL, "If true, only generate the IDL for each package.") - flag.BoolVar(&g.KeepGogoproto, "keep-gogoproto", g.KeepGogoproto, "If true, the generated IDL will contain gogoprotobuf extensions which are normally removed") - flag.BoolVar(&g.SkipGeneratedRewrite, "skip-generated-rewrite", g.SkipGeneratedRewrite, "If true, skip fixing up the generated.pb.go file (debugging only).") - flag.StringVar(&g.DropEmbeddedFields, "drop-embedded-fields", g.DropEmbeddedFields, "Comma-delimited list of embedded Go types to omit from generated protobufs") -} - -func Run(g *Generator) { - if g.Common.VerifyOnly { - g.OnlyIDL = true - g.Clean = false - } - - b := parser.New() - b.AddBuildTags("proto") - - omitTypes := map[types.Name]struct{}{} - for _, t := range strings.Split(g.DropEmbeddedFields, ",") { - name := types.Name{} - if i := strings.LastIndex(t, "."); i != -1 { - name.Package, name.Name = t[:i], t[i+1:] - } else { - name.Name = t - } - if len(name.Name) == 0 { - log.Fatalf("--drop-embedded-types requires names in the form of [GOPACKAGE.]TYPENAME: %v", t) - } - omitTypes[name] = struct{}{} - } - - boilerplate, err := g.Common.LoadGoBoilerplate() - if err != nil { - log.Fatalf("Failed loading boilerplate (consider using the go-header-file flag): %v", err) - } - - protobufNames := NewProtobufNamer() - outputPackages := generator.Packages{} - nonOutputPackages := map[string]struct{}{} - - var packages []string - if len(g.APIMachineryPackages) != 0 { - packages = append(packages, strings.Split(g.APIMachineryPackages, ",")...) - } - if len(g.Packages) != 0 { - packages = append(packages, strings.Split(g.Packages, ",")...) - } - if len(packages) == 0 { - log.Fatalf("Both apimachinery-packages and packages are empty. At least one package must be specified.") - } - - for _, d := range packages { - generateAllTypes, outputPackage := true, true - switch { - case strings.HasPrefix(d, "+"): - d = d[1:] - generateAllTypes = false - case strings.HasPrefix(d, "-"): - d = d[1:] - outputPackage = false - } - name := protoSafePackage(d) - parts := strings.SplitN(d, "=", 2) - if len(parts) > 1 { - d = parts[0] - name = parts[1] - } - p := newProtobufPackage(d, name, generateAllTypes, omitTypes) - header := append([]byte{}, boilerplate...) - header = append(header, p.HeaderText...) - p.HeaderText = header - protobufNames.Add(p) - if outputPackage { - outputPackages = append(outputPackages, p) - } else { - nonOutputPackages[name] = struct{}{} - } - } - - if !g.Common.VerifyOnly { - for _, p := range outputPackages { - if err := p.(*protobufPackage).Clean(g.OutputBase); err != nil { - log.Fatalf("Unable to clean package %s: %v", p.Name(), err) - } - } - } - - if g.Clean { - return - } - - for _, p := range protobufNames.List() { - if err := b.AddDir(p.Path()); err != nil { - log.Fatalf("Unable to add directory %q: %v", p.Path(), err) - } - } - - c, err := generator.NewContext( - b, - namer.NameSystems{ - "public": namer.NewPublicNamer(3), - "proto": protobufNames, - }, - "public", - ) - if err != nil { - log.Fatalf("Failed making a context: %v", err) - } - - c.Verify = g.Common.VerifyOnly - c.FileTypes["protoidl"] = NewProtoFile() - - // order package by imports, importees first - deps := deps(c, protobufNames.packages) - order, err := importOrder(deps) - if err != nil { - log.Fatalf("Failed to order packages by imports: %v", err) - } - topologicalPos := map[string]int{} - for i, p := range order { - topologicalPos[p] = i - } - sort.Sort(positionOrder{topologicalPos, protobufNames.packages}) - - var vendoredOutputPackages, localOutputPackages generator.Packages - for _, p := range protobufNames.packages { - if _, ok := nonOutputPackages[p.Name()]; ok { - // if we're not outputting the package, don't include it in either package list - continue - } - p.Vendored = strings.Contains(c.Universe[p.PackagePath].SourcePath, "/vendor/") - if p.Vendored { - vendoredOutputPackages = append(vendoredOutputPackages, p) - } else { - localOutputPackages = append(localOutputPackages, p) - } - } - - if err := protobufNames.AssignTypesToPackages(c); err != nil { - log.Fatalf("Failed to identify Common types: %v", err) - } - - if err := c.ExecutePackages(g.VendorOutputBase, vendoredOutputPackages); err != nil { - log.Fatalf("Failed executing vendor generator: %v", err) - } - if err := c.ExecutePackages(g.OutputBase, localOutputPackages); err != nil { - log.Fatalf("Failed executing local generator: %v", err) - } - - if g.OnlyIDL { - return - } - - if _, err := exec.LookPath("protoc"); err != nil { - log.Fatalf("Unable to find 'protoc': %v", err) - } - - searchArgs := []string{"-I", ".", "-I", g.OutputBase} - if len(g.ProtoImport) != 0 { - for _, s := range g.ProtoImport { - searchArgs = append(searchArgs, "-I", s) - } - } - args := append(searchArgs, fmt.Sprintf("--gogo_out=%s", g.OutputBase)) - - buf := &bytes.Buffer{} - if len(g.Conditional) > 0 { - fmt.Fprintf(buf, "// +build %s\n\n", g.Conditional) - } - buf.Write(boilerplate) - - for _, outputPackage := range outputPackages { - p := outputPackage.(*protobufPackage) - - path := filepath.Join(g.OutputBase, p.ImportPath()) - outputPath := filepath.Join(g.OutputBase, p.OutputPath()) - if p.Vendored { - path = filepath.Join(g.VendorOutputBase, p.ImportPath()) - outputPath = filepath.Join(g.VendorOutputBase, p.OutputPath()) - } - - // generate the gogoprotobuf protoc - cmd := exec.Command("protoc", append(args, path)...) - out, err := cmd.CombinedOutput() - if len(out) > 0 { - log.Print(string(out)) - } - if err != nil { - log.Println(strings.Join(cmd.Args, " ")) - log.Fatalf("Unable to generate protoc on %s: %v", p.PackageName, err) - } - - if g.SkipGeneratedRewrite { - continue - } - - // alter the generated protobuf file to remove the generated types (but leave the serializers) and rewrite the - // package statement to match the desired package name - if err := RewriteGeneratedGogoProtobufFile(outputPath, p.ExtractGeneratedType, p.OptionalTypeName, buf.Bytes()); err != nil { - log.Fatalf("Unable to rewrite generated %s: %v", outputPath, err) - } - - // sort imports - cmd = exec.Command("goimports", "-w", outputPath) - out, err = cmd.CombinedOutput() - if len(out) > 0 { - log.Print(string(out)) - } - if err != nil { - log.Println(strings.Join(cmd.Args, " ")) - log.Fatalf("Unable to rewrite imports for %s: %v", p.PackageName, err) - } - - // format and simplify the generated file - cmd = exec.Command("gofmt", "-s", "-w", outputPath) - out, err = cmd.CombinedOutput() - if len(out) > 0 { - log.Print(string(out)) - } - if err != nil { - log.Println(strings.Join(cmd.Args, " ")) - log.Fatalf("Unable to apply gofmt for %s: %v", p.PackageName, err) - } - } - - if g.SkipGeneratedRewrite { - return - } - - if !g.KeepGogoproto { - // generate, but do so without gogoprotobuf extensions - for _, outputPackage := range outputPackages { - p := outputPackage.(*protobufPackage) - p.OmitGogo = true - } - if err := c.ExecutePackages(g.VendorOutputBase, vendoredOutputPackages); err != nil { - log.Fatalf("Failed executing vendor generator: %v", err) - } - if err := c.ExecutePackages(g.OutputBase, localOutputPackages); err != nil { - log.Fatalf("Failed executing local generator: %v", err) - } - } - - for _, outputPackage := range outputPackages { - p := outputPackage.(*protobufPackage) - - if len(p.StructTags) == 0 { - continue - } - - pattern := filepath.Join(g.OutputBase, p.PackagePath, "*.go") - if p.Vendored { - pattern = filepath.Join(g.VendorOutputBase, p.PackagePath, "*.go") - } - files, err := filepath.Glob(pattern) - if err != nil { - log.Fatalf("Can't glob pattern %q: %v", pattern, err) - } - - for _, s := range files { - if strings.HasSuffix(s, "_test.go") { - continue - } - if err := RewriteTypesWithProtobufStructTags(s, p.StructTags); err != nil { - log.Fatalf("Unable to rewrite with struct tags %s: %v", s, err) - } - } - } -} - -func deps(c *generator.Context, pkgs []*protobufPackage) map[string][]string { - ret := map[string][]string{} - for _, p := range pkgs { - for _, d := range c.Universe[p.PackagePath].Imports { - ret[p.PackagePath] = append(ret[p.PackagePath], d.Path) - } - } - return ret -} - -func importOrder(deps map[string][]string) ([]string, error) { - nodes := map[string]graph.Node{} - names := map[int64]string{} - g := simple.NewDirectedGraph() - for pkg, imports := range deps { - for _, imp := range imports { - if _, found := nodes[pkg]; !found { - n := g.NewNode() - g.AddNode(n) - nodes[pkg] = n - names[n.ID()] = pkg - } - if _, found := nodes[imp]; !found { - n := g.NewNode() - g.AddNode(n) - nodes[imp] = n - names[n.ID()] = imp - } - g.SetEdge(g.NewEdge(nodes[imp], nodes[pkg])) - } - } - - ret := []string{} - sorted, err := topo.Sort(g) - if err != nil { - return nil, err - } - for _, n := range sorted { - ret = append(ret, names[n.ID()]) - fmt.Println("topological order", names[n.ID()]) - } - return ret, nil -} - -type positionOrder struct { - pos map[string]int - elements []*protobufPackage -} - -func (o positionOrder) Len() int { - return len(o.elements) -} - -func (o positionOrder) Less(i, j int) bool { - return o.pos[o.elements[i].PackagePath] < o.pos[o.elements[j].PackagePath] -} - -func (o positionOrder) Swap(i, j int) { - x := o.elements[i] - o.elements[i] = o.elements[j] - o.elements[j] = x -} diff --git a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go deleted file mode 100644 index 1a9803d..0000000 --- a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go +++ /dev/null @@ -1,773 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package protobuf - -import ( - "fmt" - "io" - "log" - "reflect" - "sort" - "strconv" - "strings" - - "k8s.io/klog" - - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -// genProtoIDL produces a .proto IDL. -type genProtoIDL struct { - generator.DefaultGen - localPackage types.Name - localGoPackage types.Name - imports namer.ImportTracker - - generateAll bool - omitGogo bool - omitFieldTypes map[types.Name]struct{} -} - -func (g *genProtoIDL) PackageVars(c *generator.Context) []string { - if g.omitGogo { - return []string{ - fmt.Sprintf("option go_package = %q;", g.localGoPackage.Name), - } - } - return []string{ - "option (gogoproto.marshaler_all) = true;", - "option (gogoproto.stable_marshaler_all) = true;", - "option (gogoproto.sizer_all) = true;", - "option (gogoproto.goproto_stringer_all) = false;", - "option (gogoproto.stringer_all) = true;", - "option (gogoproto.unmarshaler_all) = true;", - "option (gogoproto.goproto_unrecognized_all) = false;", - "option (gogoproto.goproto_enum_prefix_all) = false;", - "option (gogoproto.goproto_getters_all) = false;", - fmt.Sprintf("option go_package = %q;", g.localGoPackage.Name), - } -} -func (g *genProtoIDL) Filename() string { return g.OptionalName + ".proto" } -func (g *genProtoIDL) FileType() string { return "protoidl" } -func (g *genProtoIDL) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - // The local namer returns the correct protobuf name for a proto type - // in the context of a package - "local": localNamer{g.localPackage}, - } -} - -// Filter ignores types that are identified as not exportable. -func (g *genProtoIDL) Filter(c *generator.Context, t *types.Type) bool { - tagVals := types.ExtractCommentTags("+", t.CommentLines)["protobuf"] - if tagVals != nil { - if tagVals[0] == "false" { - // Type specified "false". - return false - } - if tagVals[0] == "true" { - // Type specified "true". - return true - } - klog.Fatalf(`Comment tag "protobuf" must be true or false, found: %q`, tagVals[0]) - } - if !g.generateAll { - // We're not generating everything. - return false - } - seen := map[*types.Type]bool{} - ok := isProtoable(seen, t) - return ok -} - -func isProtoable(seen map[*types.Type]bool, t *types.Type) bool { - if seen[t] { - // be optimistic in the case of type cycles. - return true - } - seen[t] = true - switch t.Kind { - case types.Builtin: - return true - case types.Alias: - return isProtoable(seen, t.Underlying) - case types.Slice, types.Pointer: - return isProtoable(seen, t.Elem) - case types.Map: - return isProtoable(seen, t.Key) && isProtoable(seen, t.Elem) - case types.Struct: - if len(t.Members) == 0 { - return true - } - for _, m := range t.Members { - if isProtoable(seen, m.Type) { - return true - } - } - return false - case types.Func, types.Chan: - return false - case types.DeclarationOf, types.Unknown, types.Unsupported: - return false - case types.Interface: - return false - default: - log.Printf("WARNING: type %q is not portable: %s", t.Kind, t.Name) - return false - } -} - -// isOptionalAlias should return true if the specified type has an underlying type -// (is an alias) of a map or slice and has the comment tag protobuf.nullable=true, -// indicating that the type should be nullable in protobuf. -func isOptionalAlias(t *types.Type) bool { - if t.Underlying == nil || (t.Underlying.Kind != types.Map && t.Underlying.Kind != types.Slice) { - return false - } - if extractBoolTagOrDie("protobuf.nullable", t.CommentLines) == false { - return false - } - return true -} - -func (g *genProtoIDL) Imports(c *generator.Context) (imports []string) { - lines := []string{} - // TODO: this could be expressed more cleanly - for _, line := range g.imports.ImportLines() { - if g.omitGogo && line == "github.com/gogo/protobuf/gogoproto/gogo.proto" { - continue - } - lines = append(lines, line) - } - return lines -} - -// GenerateType makes the body of a file implementing a set for type t. -func (g *genProtoIDL) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - b := bodyGen{ - locator: &protobufLocator{ - namer: c.Namers["proto"].(ProtobufFromGoNamer), - tracker: g.imports, - universe: c.Universe, - - localGoPackage: g.localGoPackage.Package, - }, - localPackage: g.localPackage, - - omitGogo: g.omitGogo, - omitFieldTypes: g.omitFieldTypes, - - t: t, - } - switch t.Kind { - case types.Alias: - return b.doAlias(sw) - case types.Struct: - return b.doStruct(sw) - default: - return b.unknown(sw) - } -} - -// ProtobufFromGoNamer finds the protobuf name of a type (and its package, and -// the package path) from its Go name. -type ProtobufFromGoNamer interface { - GoNameToProtoName(name types.Name) types.Name -} - -type ProtobufLocator interface { - ProtoTypeFor(t *types.Type) (*types.Type, error) - GoTypeForName(name types.Name) *types.Type - CastTypeName(name types.Name) string -} - -type protobufLocator struct { - namer ProtobufFromGoNamer - tracker namer.ImportTracker - universe types.Universe - - localGoPackage string -} - -// CastTypeName returns the cast type name of a Go type -// TODO: delegate to a new localgo namer? -func (p protobufLocator) CastTypeName(name types.Name) string { - if name.Package == p.localGoPackage { - return name.Name - } - return name.String() -} - -func (p protobufLocator) GoTypeForName(name types.Name) *types.Type { - if len(name.Package) == 0 { - name.Package = p.localGoPackage - } - return p.universe.Type(name) -} - -// ProtoTypeFor locates a Protobuf type for the provided Go type (if possible). -func (p protobufLocator) ProtoTypeFor(t *types.Type) (*types.Type, error) { - switch { - // we've already converted the type, or it's a map - case t.Kind == types.Protobuf || t.Kind == types.Map: - p.tracker.AddType(t) - return t, nil - } - // it's a fundamental type - if t, ok := isFundamentalProtoType(t); ok { - p.tracker.AddType(t) - return t, nil - } - // it's a message - if t.Kind == types.Struct || isOptionalAlias(t) { - t := &types.Type{ - Name: p.namer.GoNameToProtoName(t.Name), - Kind: types.Protobuf, - - CommentLines: t.CommentLines, - } - p.tracker.AddType(t) - return t, nil - } - return nil, errUnrecognizedType -} - -type bodyGen struct { - locator ProtobufLocator - localPackage types.Name - omitGogo bool - omitFieldTypes map[types.Name]struct{} - - t *types.Type -} - -func (b bodyGen) unknown(sw *generator.SnippetWriter) error { - return fmt.Errorf("not sure how to generate: %#v", b.t) -} - -func (b bodyGen) doAlias(sw *generator.SnippetWriter) error { - if !isOptionalAlias(b.t) { - return nil - } - - var kind string - switch b.t.Underlying.Kind { - case types.Map: - kind = "map" - default: - kind = "slice" - } - optional := &types.Type{ - Name: b.t.Name, - Kind: types.Struct, - - CommentLines: b.t.CommentLines, - SecondClosestCommentLines: b.t.SecondClosestCommentLines, - Members: []types.Member{ - { - Name: "Items", - CommentLines: []string{fmt.Sprintf("items, if empty, will result in an empty %s\n", kind)}, - Type: b.t.Underlying, - }, - }, - } - nested := b - nested.t = optional - return nested.doStruct(sw) -} - -func (b bodyGen) doStruct(sw *generator.SnippetWriter) error { - if len(b.t.Name.Name) == 0 { - return nil - } - if namer.IsPrivateGoName(b.t.Name.Name) { - return nil - } - - var alias *types.Type - var fields []protoField - options := []string{} - allOptions := types.ExtractCommentTags("+", b.t.CommentLines) - for k, v := range allOptions { - switch { - case strings.HasPrefix(k, "protobuf.options."): - key := strings.TrimPrefix(k, "protobuf.options.") - switch key { - case "marshal": - if v[0] == "false" { - if !b.omitGogo { - options = append(options, - "(gogoproto.marshaler) = false", - "(gogoproto.unmarshaler) = false", - "(gogoproto.sizer) = false", - ) - } - } - default: - if !b.omitGogo || !strings.HasPrefix(key, "(gogoproto.") { - if key == "(gogoproto.goproto_stringer)" && v[0] == "false" { - options = append(options, "(gogoproto.stringer) = false") - } - options = append(options, fmt.Sprintf("%s = %s", key, v[0])) - } - } - // protobuf.as allows a type to have the same message contents as another Go type - case k == "protobuf.as": - fields = nil - if alias = b.locator.GoTypeForName(types.Name{Name: v[0]}); alias == nil { - return fmt.Errorf("type %v references alias %q which does not exist", b.t, v[0]) - } - // protobuf.embed instructs the generator to use the named type in this package - // as an embedded message. - case k == "protobuf.embed": - fields = []protoField{ - { - Tag: 1, - Name: v[0], - Type: &types.Type{ - Name: types.Name{ - Name: v[0], - Package: b.localPackage.Package, - Path: b.localPackage.Path, - }, - }, - }, - } - } - } - if alias == nil { - alias = b.t - } - - // If we don't explicitly embed anything, generate fields by traversing fields. - if fields == nil { - memberFields, err := membersToFields(b.locator, alias, b.localPackage, b.omitFieldTypes) - if err != nil { - return fmt.Errorf("type %v cannot be converted to protobuf: %v", b.t, err) - } - fields = memberFields - } - - out := sw.Out() - genComment(out, b.t.CommentLines, "") - sw.Do(`message $.Name.Name$ { -`, b.t) - - if len(options) > 0 { - sort.Sort(sort.StringSlice(options)) - for _, s := range options { - fmt.Fprintf(out, " option %s;\n", s) - } - fmt.Fprintln(out) - } - - for i, field := range fields { - genComment(out, field.CommentLines, " ") - fmt.Fprintf(out, " ") - switch { - case field.Map: - case field.Repeated: - fmt.Fprintf(out, "repeated ") - case field.Required: - fmt.Fprintf(out, "required ") - default: - fmt.Fprintf(out, "optional ") - } - sw.Do(`$.Type|local$ $.Name$ = $.Tag$`, field) - if len(field.Extras) > 0 { - extras := []string{} - for k, v := range field.Extras { - if b.omitGogo && strings.HasPrefix(k, "(gogoproto.") { - continue - } - extras = append(extras, fmt.Sprintf("%s = %s", k, v)) - } - sort.Sort(sort.StringSlice(extras)) - if len(extras) > 0 { - fmt.Fprintf(out, " [") - fmt.Fprint(out, strings.Join(extras, ", ")) - fmt.Fprintf(out, "]") - } - } - fmt.Fprintf(out, ";\n") - if i != len(fields)-1 { - fmt.Fprintf(out, "\n") - } - } - fmt.Fprintf(out, "}\n\n") - return nil -} - -type protoField struct { - LocalPackage types.Name - - Tag int - Name string - Type *types.Type - Map bool - Repeated bool - Optional bool - Required bool - Nullable bool - Extras map[string]string - - CommentLines []string -} - -var ( - errUnrecognizedType = fmt.Errorf("did not recognize the provided type") -) - -func isFundamentalProtoType(t *types.Type) (*types.Type, bool) { - // TODO: when we enable proto3, also include other fundamental types in the google.protobuf package - // switch { - // case t.Kind == types.Struct && t.Name == types.Name{Package: "time", Name: "Time"}: - // return &types.Type{ - // Kind: types.Protobuf, - // Name: types.Name{Path: "google/protobuf/timestamp.proto", Package: "google.protobuf", Name: "Timestamp"}, - // }, true - // } - switch t.Kind { - case types.Slice: - if t.Elem.Name.Name == "byte" && len(t.Elem.Name.Package) == 0 { - return &types.Type{Name: types.Name{Name: "bytes"}, Kind: types.Protobuf}, true - } - case types.Builtin: - switch t.Name.Name { - case "string", "uint32", "int32", "uint64", "int64", "bool": - return &types.Type{Name: types.Name{Name: t.Name.Name}, Kind: types.Protobuf}, true - case "int": - return &types.Type{Name: types.Name{Name: "int64"}, Kind: types.Protobuf}, true - case "uint": - return &types.Type{Name: types.Name{Name: "uint64"}, Kind: types.Protobuf}, true - case "float64", "float": - return &types.Type{Name: types.Name{Name: "double"}, Kind: types.Protobuf}, true - case "float32": - return &types.Type{Name: types.Name{Name: "float"}, Kind: types.Protobuf}, true - case "uintptr": - return &types.Type{Name: types.Name{Name: "uint64"}, Kind: types.Protobuf}, true - } - // TODO: complex? - } - return t, false -} - -func memberTypeToProtobufField(locator ProtobufLocator, field *protoField, t *types.Type) error { - var err error - switch t.Kind { - case types.Protobuf: - field.Type, err = locator.ProtoTypeFor(t) - case types.Builtin: - field.Type, err = locator.ProtoTypeFor(t) - case types.Map: - valueField := &protoField{} - if err := memberTypeToProtobufField(locator, valueField, t.Elem); err != nil { - return err - } - keyField := &protoField{} - if err := memberTypeToProtobufField(locator, keyField, t.Key); err != nil { - return err - } - // All other protobuf types have kind types.Protobuf, so setting types.Map - // here would be very misleading. - field.Type = &types.Type{ - Kind: types.Protobuf, - Key: keyField.Type, - Elem: valueField.Type, - } - if !strings.HasPrefix(t.Name.Name, "map[") { - field.Extras["(gogoproto.casttype)"] = strconv.Quote(locator.CastTypeName(t.Name)) - } - if k, ok := keyField.Extras["(gogoproto.casttype)"]; ok { - field.Extras["(gogoproto.castkey)"] = k - } - if v, ok := valueField.Extras["(gogoproto.casttype)"]; ok { - field.Extras["(gogoproto.castvalue)"] = v - } - field.Map = true - case types.Pointer: - if err := memberTypeToProtobufField(locator, field, t.Elem); err != nil { - return err - } - field.Nullable = true - case types.Alias: - if isOptionalAlias(t) { - field.Type, err = locator.ProtoTypeFor(t) - field.Nullable = true - } else { - if err := memberTypeToProtobufField(locator, field, t.Underlying); err != nil { - log.Printf("failed to alias: %s %s: err %v", t.Name, t.Underlying.Name, err) - return err - } - // If this is not an alias to a slice, cast to the alias - if !field.Repeated { - if field.Extras == nil { - field.Extras = make(map[string]string) - } - field.Extras["(gogoproto.casttype)"] = strconv.Quote(locator.CastTypeName(t.Name)) - } - } - case types.Slice: - if t.Elem.Name.Name == "byte" && len(t.Elem.Name.Package) == 0 { - field.Type = &types.Type{Name: types.Name{Name: "bytes"}, Kind: types.Protobuf} - return nil - } - if err := memberTypeToProtobufField(locator, field, t.Elem); err != nil { - return err - } - field.Repeated = true - case types.Struct: - if len(t.Name.Name) == 0 { - return errUnrecognizedType - } - field.Type, err = locator.ProtoTypeFor(t) - field.Nullable = false - default: - return errUnrecognizedType - } - return err -} - -// protobufTagToField extracts information from an existing protobuf tag -func protobufTagToField(tag string, field *protoField, m types.Member, t *types.Type, localPackage types.Name) error { - if len(tag) == 0 || tag == "-" { - return nil - } - - // protobuf:"bytes,3,opt,name=Id,customtype=github.com/gogo/protobuf/test.Uuid" - parts := strings.Split(tag, ",") - if len(parts) < 3 { - return fmt.Errorf("member %q of %q malformed 'protobuf' tag, not enough segments\n", m.Name, t.Name) - } - protoTag, err := strconv.Atoi(parts[1]) - if err != nil { - return fmt.Errorf("member %q of %q malformed 'protobuf' tag, field ID is %q which is not an integer: %v\n", m.Name, t.Name, parts[1], err) - } - field.Tag = protoTag - - // In general there is doesn't make sense to parse the protobuf tags to get the type, - // as all auto-generated once will have wire type "bytes", "varint" or "fixed64". - // However, sometimes we explicitly set them to have a custom serialization, e.g.: - // type Time struct { - // time.Time `protobuf:"Timestamp,1,req,name=time"` - // } - // to force the generator to use a given type (that we manually wrote serialization & - // deserialization methods for). - switch parts[0] { - case "varint", "fixed32", "fixed64", "bytes", "group": - default: - name := types.Name{} - if last := strings.LastIndex(parts[0], "."); last != -1 { - prefix := parts[0][:last] - name = types.Name{ - Name: parts[0][last+1:], - Package: prefix, - Path: strings.Replace(prefix, ".", "/", -1), - } - } else { - name = types.Name{ - Name: parts[0], - Package: localPackage.Package, - Path: localPackage.Path, - } - } - field.Type = &types.Type{ - Name: name, - Kind: types.Protobuf, - } - } - - protoExtra := make(map[string]string) - for i, extra := range parts[3:] { - parts := strings.SplitN(extra, "=", 2) - if len(parts) != 2 { - return fmt.Errorf("member %q of %q malformed 'protobuf' tag, tag %d should be key=value, got %q\n", m.Name, t.Name, i+4, extra) - } - switch parts[0] { - case "name": - protoExtra[parts[0]] = parts[1] - case "casttype", "castkey", "castvalue": - parts[0] = fmt.Sprintf("(gogoproto.%s)", parts[0]) - protoExtra[parts[0]] = strconv.Quote(parts[1]) - } - } - - field.Extras = protoExtra - if name, ok := protoExtra["name"]; ok { - field.Name = name - delete(protoExtra, "name") - } - - return nil -} - -func membersToFields(locator ProtobufLocator, t *types.Type, localPackage types.Name, omitFieldTypes map[types.Name]struct{}) ([]protoField, error) { - fields := []protoField{} - - for _, m := range t.Members { - if namer.IsPrivateGoName(m.Name) { - // skip private fields - continue - } - if _, ok := omitFieldTypes[types.Name{Name: m.Type.Name.Name, Package: m.Type.Name.Package}]; ok { - continue - } - tags := reflect.StructTag(m.Tags) - field := protoField{ - LocalPackage: localPackage, - - Tag: -1, - Extras: make(map[string]string), - } - - protobufTag := tags.Get("protobuf") - if protobufTag == "-" { - continue - } - - if err := protobufTagToField(protobufTag, &field, m, t, localPackage); err != nil { - return nil, err - } - - // extract information from JSON field tag - if tag := tags.Get("json"); len(tag) > 0 { - parts := strings.Split(tag, ",") - if len(field.Name) == 0 && len(parts[0]) != 0 { - field.Name = parts[0] - } - if field.Tag == -1 && field.Name == "-" { - continue - } - } - - if field.Type == nil { - if err := memberTypeToProtobufField(locator, &field, m.Type); err != nil { - return nil, fmt.Errorf("unable to embed type %q as field %q in %q: %v", m.Type, field.Name, t.Name, err) - } - } - if len(field.Name) == 0 { - field.Name = namer.IL(m.Name) - } - - if field.Map && field.Repeated { - // maps cannot be repeated - field.Repeated = false - field.Nullable = true - } - - if !field.Nullable { - field.Extras["(gogoproto.nullable)"] = "false" - } - if (field.Type.Name.Name == "bytes" && field.Type.Name.Package == "") || (field.Repeated && field.Type.Name.Package == "" && namer.IsPrivateGoName(field.Type.Name.Name)) { - delete(field.Extras, "(gogoproto.nullable)") - } - if field.Name != m.Name { - field.Extras["(gogoproto.customname)"] = strconv.Quote(m.Name) - } - field.CommentLines = m.CommentLines - fields = append(fields, field) - } - - // assign tags - highest := 0 - byTag := make(map[int]*protoField) - // fields are in Go struct order, which we preserve - for i := range fields { - field := &fields[i] - tag := field.Tag - if tag != -1 { - if existing, ok := byTag[tag]; ok { - return nil, fmt.Errorf("field %q and %q both have tag %d", field.Name, existing.Name, tag) - } - byTag[tag] = field - } - if tag > highest { - highest = tag - } - } - // starting from the highest observed tag, assign new field tags - for i := range fields { - field := &fields[i] - if field.Tag != -1 { - continue - } - highest++ - field.Tag = highest - byTag[field.Tag] = field - } - return fields, nil -} - -func genComment(out io.Writer, lines []string, indent string) { - for { - l := len(lines) - if l == 0 || len(lines[l-1]) != 0 { - break - } - lines = lines[:l-1] - } - for _, c := range lines { - if len(c) == 0 { - fmt.Fprintf(out, "%s//\n", indent) // avoid trailing whitespace - continue - } - fmt.Fprintf(out, "%s// %s\n", indent, c) - } -} - -func formatProtoFile(source []byte) ([]byte, error) { - // TODO; Is there any protobuf formatter? - return source, nil -} - -func assembleProtoFile(w io.Writer, f *generator.File) { - w.Write(f.Header) - - fmt.Fprint(w, "syntax = 'proto2';\n\n") - - if len(f.PackageName) > 0 { - fmt.Fprintf(w, "package %s;\n\n", f.PackageName) - } - - if len(f.Imports) > 0 { - imports := []string{} - for i := range f.Imports { - imports = append(imports, i) - } - sort.Strings(imports) - for _, s := range imports { - fmt.Fprintf(w, "import %q;\n", s) - } - fmt.Fprint(w, "\n") - } - - if f.Vars.Len() > 0 { - fmt.Fprintf(w, "%s\n", f.Vars.String()) - } - - w.Write(f.Body.Bytes()) -} - -func NewProtoFile() *generator.DefaultFileType { - return &generator.DefaultFileType{ - Format: formatProtoFile, - Assemble: assembleProtoFile, - } -} diff --git a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/import_tracker.go b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/import_tracker.go deleted file mode 100644 index 08a991b..0000000 --- a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/import_tracker.go +++ /dev/null @@ -1,50 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package protobuf - -import ( - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -type ImportTracker struct { - namer.DefaultImportTracker -} - -func NewImportTracker(local types.Name, typesToAdd ...*types.Type) *ImportTracker { - tracker := namer.NewDefaultImportTracker(local) - tracker.IsInvalidType = func(t *types.Type) bool { return t.Kind != types.Protobuf } - tracker.LocalName = func(name types.Name) string { return name.Package } - tracker.PrintImport = func(path, name string) string { return path } - - tracker.AddTypes(typesToAdd...) - return &ImportTracker{ - DefaultImportTracker: tracker, - } -} - -// AddNullable ensures that support for the nullable Gogo-protobuf extension is added. -func (tracker *ImportTracker) AddNullable() { - tracker.AddType(&types.Type{ - Kind: types.Protobuf, - Name: types.Name{ - Name: "nullable", - Package: "gogoproto", - Path: "github.com/gogo/protobuf/gogoproto/gogo.proto", - }, - }) -} diff --git a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/namer.go b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/namer.go deleted file mode 100644 index e3b21c6..0000000 --- a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/namer.go +++ /dev/null @@ -1,208 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package protobuf - -import ( - "fmt" - "reflect" - "strings" - - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -type localNamer struct { - localPackage types.Name -} - -func (n localNamer) Name(t *types.Type) string { - if t.Key != nil && t.Elem != nil { - return fmt.Sprintf("map<%s, %s>", n.Name(t.Key), n.Name(t.Elem)) - } - if len(n.localPackage.Package) != 0 && n.localPackage.Package == t.Name.Package { - return t.Name.Name - } - return t.Name.String() -} - -type protobufNamer struct { - packages []*protobufPackage - packagesByPath map[string]*protobufPackage -} - -func NewProtobufNamer() *protobufNamer { - return &protobufNamer{ - packagesByPath: make(map[string]*protobufPackage), - } -} - -func (n *protobufNamer) Name(t *types.Type) string { - if t.Kind == types.Map { - return fmt.Sprintf("map<%s, %s>", n.Name(t.Key), n.Name(t.Elem)) - } - return t.Name.String() -} - -func (n *protobufNamer) List() []generator.Package { - packages := make([]generator.Package, 0, len(n.packages)) - for i := range n.packages { - packages = append(packages, n.packages[i]) - } - return packages -} - -func (n *protobufNamer) Add(p *protobufPackage) { - if _, ok := n.packagesByPath[p.PackagePath]; !ok { - n.packagesByPath[p.PackagePath] = p - n.packages = append(n.packages, p) - } -} - -func (n *protobufNamer) GoNameToProtoName(name types.Name) types.Name { - if p, ok := n.packagesByPath[name.Package]; ok { - return types.Name{ - Name: name.Name, - Package: p.PackageName, - Path: p.ImportPath(), - } - } - for _, p := range n.packages { - if _, ok := p.FilterTypes[name]; ok { - return types.Name{ - Name: name.Name, - Package: p.PackageName, - Path: p.ImportPath(), - } - } - } - return types.Name{Name: name.Name} -} - -func protoSafePackage(name string) string { - pkg := strings.Replace(name, "/", ".", -1) - return strings.Replace(pkg, "-", "_", -1) -} - -type typeNameSet map[types.Name]*protobufPackage - -// assignGoTypeToProtoPackage looks for Go and Protobuf types that are referenced by a type in -// a package. It will not recurse into protobuf types. -func assignGoTypeToProtoPackage(p *protobufPackage, t *types.Type, local, global typeNameSet, optional map[types.Name]struct{}) { - newT, isProto := isFundamentalProtoType(t) - if isProto { - t = newT - } - if otherP, ok := global[t.Name]; ok { - if _, ok := local[t.Name]; !ok { - p.Imports.AddType(&types.Type{ - Kind: types.Protobuf, - Name: otherP.ProtoTypeName(), - }) - } - return - } - if t.Name.Package == p.PackagePath { - // Associate types only to their own package - global[t.Name] = p - } - if _, ok := local[t.Name]; ok { - return - } - // don't recurse into existing proto types - if isProto { - p.Imports.AddType(t) - return - } - - local[t.Name] = p - for _, m := range t.Members { - if namer.IsPrivateGoName(m.Name) { - continue - } - field := &protoField{} - tag := reflect.StructTag(m.Tags).Get("protobuf") - if tag == "-" { - continue - } - if err := protobufTagToField(tag, field, m, t, p.ProtoTypeName()); err == nil && field.Type != nil { - assignGoTypeToProtoPackage(p, field.Type, local, global, optional) - continue - } - assignGoTypeToProtoPackage(p, m.Type, local, global, optional) - } - // TODO: should methods be walked? - if t.Elem != nil { - assignGoTypeToProtoPackage(p, t.Elem, local, global, optional) - } - if t.Key != nil { - assignGoTypeToProtoPackage(p, t.Key, local, global, optional) - } - if t.Underlying != nil { - if t.Kind == types.Alias && isOptionalAlias(t) { - optional[t.Name] = struct{}{} - } - assignGoTypeToProtoPackage(p, t.Underlying, local, global, optional) - } -} - -// isTypeApplicableToProtobuf checks to see if a type is relevant for protobuf processing. -// Currently, it filters out functions and private types. -func isTypeApplicableToProtobuf(t *types.Type) bool { - // skip functions -- we don't care about them for protobuf - if t.Kind == types.Func || (t.Kind == types.DeclarationOf && t.Underlying.Kind == types.Func) { - return false - } - // skip private types - if namer.IsPrivateGoName(t.Name.Name) { - return false - } - - return true -} - -func (n *protobufNamer) AssignTypesToPackages(c *generator.Context) error { - global := make(typeNameSet) - for _, p := range n.packages { - local := make(typeNameSet) - optional := make(map[types.Name]struct{}) - p.Imports = NewImportTracker(p.ProtoTypeName()) - for _, t := range c.Order { - if t.Name.Package != p.PackagePath { - continue - } - if !isTypeApplicableToProtobuf(t) { - // skip types that we don't care about, like functions - continue - } - assignGoTypeToProtoPackage(p, t, local, global, optional) - } - p.FilterTypes = make(map[types.Name]struct{}) - p.LocalNames = make(map[string]struct{}) - p.OptionalTypeNames = make(map[string]struct{}) - for k, v := range local { - if v == p { - p.FilterTypes[k] = struct{}{} - p.LocalNames[k.Name] = struct{}{} - if _, ok := optional[k]; ok { - p.OptionalTypeNames[k.Name] = struct{}{} - } - } - } - } - return nil -} diff --git a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/package.go b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/package.go deleted file mode 100644 index bed4c3e..0000000 --- a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/package.go +++ /dev/null @@ -1,215 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package protobuf - -import ( - "fmt" - "go/ast" - "log" - "os" - "path/filepath" - "reflect" - "strings" - - "k8s.io/gengo/generator" - "k8s.io/gengo/types" -) - -func newProtobufPackage(packagePath, packageName string, generateAll bool, omitFieldTypes map[types.Name]struct{}) *protobufPackage { - pkg := &protobufPackage{ - DefaultPackage: generator.DefaultPackage{ - // The protobuf package name (foo.bar.baz) - PackageName: packageName, - // A path segment relative to the GOPATH root (foo/bar/baz) - PackagePath: packagePath, - HeaderText: []byte( - ` -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -`), - PackageDocumentation: []byte(fmt.Sprintf( - `// Package %s is an autogenerated protobuf IDL. -`, packageName)), - }, - GenerateAll: generateAll, - OmitFieldTypes: omitFieldTypes, - } - pkg.FilterFunc = pkg.filterFunc - pkg.GeneratorFunc = pkg.generatorFunc - return pkg -} - -// protobufPackage contains the protobuf implementation of Package. -type protobufPackage struct { - generator.DefaultPackage - - // If true, this package has been vendored into our source tree and thus can - // only be generated by changing the vendor tree. - Vendored bool - - // If true, generate protobuf serializations for all public types. - // If false, only generate protobuf serializations for structs that - // request serialization. - GenerateAll bool - - // A list of types to filter to; if not specified all types will be included. - FilterTypes map[types.Name]struct{} - - // If true, omit any gogoprotobuf extensions not defined as types. - OmitGogo bool - - // A list of field types that will be excluded from the output struct - OmitFieldTypes map[types.Name]struct{} - - // A list of names that this package exports - LocalNames map[string]struct{} - - // A list of type names in this package that will need marshaller rewriting - // to remove synthetic protobuf fields. - OptionalTypeNames map[string]struct{} - - // A list of struct tags to generate onto named struct fields - StructTags map[string]map[string]string - - // An import tracker for this package - Imports *ImportTracker -} - -func (p *protobufPackage) Clean(outputBase string) error { - for _, s := range []string{p.ImportPath(), p.OutputPath()} { - if err := os.Remove(filepath.Join(outputBase, s)); err != nil && !os.IsNotExist(err) { - return err - } - } - return nil -} - -func (p *protobufPackage) ProtoTypeName() types.Name { - return types.Name{ - Name: p.Path(), // the go path "foo/bar/baz" - Package: p.Name(), // the protobuf package "foo.bar.baz" - Path: p.ImportPath(), // the path of the import to get the proto - } -} - -func (p *protobufPackage) filterFunc(c *generator.Context, t *types.Type) bool { - switch t.Kind { - case types.Func, types.Chan: - return false - case types.Struct: - if t.Name.Name == "struct{}" { - return false - } - case types.Builtin: - return false - case types.Alias: - if !isOptionalAlias(t) { - return false - } - case types.Slice, types.Array, types.Map: - return false - case types.Pointer: - return false - } - if _, ok := isFundamentalProtoType(t); ok { - return false - } - _, ok := p.FilterTypes[t.Name] - return ok -} - -func (p *protobufPackage) HasGoType(name string) bool { - _, ok := p.LocalNames[name] - return ok -} - -func (p *protobufPackage) OptionalTypeName(name string) bool { - _, ok := p.OptionalTypeNames[name] - return ok -} - -func (p *protobufPackage) ExtractGeneratedType(t *ast.TypeSpec) bool { - if !p.HasGoType(t.Name.Name) { - return false - } - - switch s := t.Type.(type) { - case *ast.StructType: - for i, f := range s.Fields.List { - if len(f.Tag.Value) == 0 { - continue - } - tag := strings.Trim(f.Tag.Value, "`") - protobufTag := reflect.StructTag(tag).Get("protobuf") - if len(protobufTag) == 0 { - continue - } - if len(f.Names) > 1 { - log.Printf("WARNING: struct %s field %d %s: defined multiple names but single protobuf tag", t.Name.Name, i, f.Names[0].Name) - // TODO hard error? - } - if p.StructTags == nil { - p.StructTags = make(map[string]map[string]string) - } - m := p.StructTags[t.Name.Name] - if m == nil { - m = make(map[string]string) - p.StructTags[t.Name.Name] = m - } - m[f.Names[0].Name] = tag - } - default: - log.Printf("WARNING: unexpected Go AST type definition: %#v", t) - } - - return true -} - -func (p *protobufPackage) generatorFunc(c *generator.Context) []generator.Generator { - generators := []generator.Generator{} - - p.Imports.AddNullable() - - generators = append(generators, &genProtoIDL{ - DefaultGen: generator.DefaultGen{ - OptionalName: "generated", - }, - localPackage: types.Name{Package: p.PackageName, Path: p.PackagePath}, - localGoPackage: types.Name{Package: p.PackagePath, Name: p.GoPackageName()}, - imports: p.Imports, - generateAll: p.GenerateAll, - omitGogo: p.OmitGogo, - omitFieldTypes: p.OmitFieldTypes, - }) - return generators -} - -func (p *protobufPackage) GoPackageName() string { - return filepath.Base(p.PackagePath) -} - -func (p *protobufPackage) ImportPath() string { - return filepath.Join(p.PackagePath, "generated.proto") -} - -func (p *protobufPackage) OutputPath() string { - return filepath.Join(p.PackagePath, "generated.pb.go") -} - -var ( - _ = generator.Package(&protobufPackage{}) -) diff --git a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/parser.go b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/parser.go deleted file mode 100644 index 3115bc6..0000000 --- a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/parser.go +++ /dev/null @@ -1,452 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package protobuf - -import ( - "bytes" - "errors" - "fmt" - "go/ast" - "go/format" - "go/parser" - "go/printer" - "go/token" - "io/ioutil" - "os" - "reflect" - "strings" - - customreflect "k8s.io/code-generator/third_party/forked/golang/reflect" -) - -func rewriteFile(name string, header []byte, rewriteFn func(*token.FileSet, *ast.File) error) error { - fset := token.NewFileSet() - src, err := ioutil.ReadFile(name) - if err != nil { - return err - } - file, err := parser.ParseFile(fset, name, src, parser.DeclarationErrors|parser.ParseComments) - if err != nil { - return err - } - - if err := rewriteFn(fset, file); err != nil { - return err - } - - b := &bytes.Buffer{} - b.Write(header) - if err := printer.Fprint(b, fset, file); err != nil { - return err - } - - body, err := format.Source(b.Bytes()) - if err != nil { - return err - } - - f, err := os.OpenFile(name, os.O_WRONLY|os.O_TRUNC, 0644) - if err != nil { - return err - } - defer f.Close() - if _, err := f.Write(body); err != nil { - return err - } - return f.Close() -} - -// ExtractFunc extracts information from the provided TypeSpec and returns true if the type should be -// removed from the destination file. -type ExtractFunc func(*ast.TypeSpec) bool - -// OptionalFunc returns true if the provided local name is a type that has protobuf.nullable=true -// and should have its marshal functions adjusted to remove the 'Items' accessor. -type OptionalFunc func(name string) bool - -func RewriteGeneratedGogoProtobufFile(name string, extractFn ExtractFunc, optionalFn OptionalFunc, header []byte) error { - return rewriteFile(name, header, func(fset *token.FileSet, file *ast.File) error { - cmap := ast.NewCommentMap(fset, file, file.Comments) - - // transform methods that point to optional maps or slices - for _, d := range file.Decls { - rewriteOptionalMethods(d, optionalFn) - } - - // remove types that are already declared - decls := []ast.Decl{} - for _, d := range file.Decls { - if dropExistingTypeDeclarations(d, extractFn) { - continue - } - if dropEmptyImportDeclarations(d) { - continue - } - decls = append(decls, d) - } - file.Decls = decls - - // remove unmapped comments - file.Comments = cmap.Filter(file).Comments() - return nil - }) -} - -// rewriteOptionalMethods makes specific mutations to marshaller methods that belong to types identified -// as being "optional" (they may be nil on the wire). This allows protobuf to serialize a map or slice and -// properly discriminate between empty and nil (which is not possible in protobuf). -// TODO: move into upstream gogo-protobuf once https://github.com/gogo/protobuf/issues/181 -// has agreement -func rewriteOptionalMethods(decl ast.Decl, isOptional OptionalFunc) { - switch t := decl.(type) { - case *ast.FuncDecl: - ident, ptr, ok := receiver(t) - if !ok { - return - } - - // correct initialization of the form `m.Field = &OptionalType{}` to - // `m.Field = OptionalType{}` - if t.Name.Name == "Unmarshal" { - ast.Walk(optionalAssignmentVisitor{fn: isOptional}, t.Body) - } - - if !isOptional(ident.Name) { - return - } - - switch t.Name.Name { - case "Unmarshal": - ast.Walk(&optionalItemsVisitor{}, t.Body) - case "MarshalTo", "Size", "String", "MarshalToSizedBuffer": - ast.Walk(&optionalItemsVisitor{}, t.Body) - fallthrough - case "Marshal": - // if the method has a pointer receiver, set it back to a normal receiver - if ptr { - t.Recv.List[0].Type = ident - } - } - } -} - -type optionalAssignmentVisitor struct { - fn OptionalFunc -} - -// Visit walks the provided node, transforming field initializations of the form -// m.Field = &OptionalType{} -> m.Field = OptionalType{} -func (v optionalAssignmentVisitor) Visit(n ast.Node) ast.Visitor { - switch t := n.(type) { - case *ast.AssignStmt: - if len(t.Lhs) == 1 && len(t.Rhs) == 1 { - if !isFieldSelector(t.Lhs[0], "m", "") { - return nil - } - unary, ok := t.Rhs[0].(*ast.UnaryExpr) - if !ok || unary.Op != token.AND { - return nil - } - composite, ok := unary.X.(*ast.CompositeLit) - if !ok || composite.Type == nil || len(composite.Elts) != 0 { - return nil - } - if ident, ok := composite.Type.(*ast.Ident); ok && v.fn(ident.Name) { - t.Rhs[0] = composite - } - } - return nil - } - return v -} - -type optionalItemsVisitor struct{} - -// Visit walks the provided node, looking for specific patterns to transform that match -// the effective outcome of turning struct{ map[x]y || []x } into map[x]y or []x. -func (v *optionalItemsVisitor) Visit(n ast.Node) ast.Visitor { - switch t := n.(type) { - case *ast.RangeStmt: - if isFieldSelector(t.X, "m", "Items") { - t.X = &ast.Ident{Name: "m"} - } - case *ast.AssignStmt: - if len(t.Lhs) == 1 && len(t.Rhs) == 1 { - switch lhs := t.Lhs[0].(type) { - case *ast.IndexExpr: - if isFieldSelector(lhs.X, "m", "Items") { - lhs.X = &ast.StarExpr{X: &ast.Ident{Name: "m"}} - } - default: - if isFieldSelector(t.Lhs[0], "m", "Items") { - t.Lhs[0] = &ast.StarExpr{X: &ast.Ident{Name: "m"}} - } - } - switch rhs := t.Rhs[0].(type) { - case *ast.CallExpr: - if ident, ok := rhs.Fun.(*ast.Ident); ok && ident.Name == "append" { - ast.Walk(v, rhs) - if len(rhs.Args) > 0 { - switch arg := rhs.Args[0].(type) { - case *ast.Ident: - if arg.Name == "m" { - rhs.Args[0] = &ast.StarExpr{X: &ast.Ident{Name: "m"}} - } - } - } - return nil - } - } - } - case *ast.IfStmt: - switch cond := t.Cond.(type) { - case *ast.BinaryExpr: - if cond.Op == token.EQL { - if isFieldSelector(cond.X, "m", "Items") && isIdent(cond.Y, "nil") { - cond.X = &ast.StarExpr{X: &ast.Ident{Name: "m"}} - } - } - } - if t.Init != nil { - // Find form: - // if err := m[len(m.Items)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - // return err - // } - switch s := t.Init.(type) { - case *ast.AssignStmt: - if call, ok := s.Rhs[0].(*ast.CallExpr); ok { - if sel, ok := call.Fun.(*ast.SelectorExpr); ok { - if x, ok := sel.X.(*ast.IndexExpr); ok { - // m[] -> (*m)[] - if sel2, ok := x.X.(*ast.SelectorExpr); ok { - if ident, ok := sel2.X.(*ast.Ident); ok && ident.Name == "m" { - x.X = &ast.StarExpr{X: &ast.Ident{Name: "m"}} - } - } - // len(m.Items) -> len(*m) - if bin, ok := x.Index.(*ast.BinaryExpr); ok { - if call2, ok := bin.X.(*ast.CallExpr); ok && len(call2.Args) == 1 { - if isFieldSelector(call2.Args[0], "m", "Items") { - call2.Args[0] = &ast.StarExpr{X: &ast.Ident{Name: "m"}} - } - } - } - } - } - } - } - } - case *ast.IndexExpr: - if isFieldSelector(t.X, "m", "Items") { - t.X = &ast.Ident{Name: "m"} - return nil - } - case *ast.CallExpr: - changed := false - for i := range t.Args { - if isFieldSelector(t.Args[i], "m", "Items") { - t.Args[i] = &ast.Ident{Name: "m"} - changed = true - } - } - if changed { - return nil - } - } - return v -} - -func isFieldSelector(n ast.Expr, name, field string) bool { - s, ok := n.(*ast.SelectorExpr) - if !ok || s.Sel == nil || (field != "" && s.Sel.Name != field) { - return false - } - return isIdent(s.X, name) -} - -func isIdent(n ast.Expr, value string) bool { - ident, ok := n.(*ast.Ident) - return ok && ident.Name == value -} - -func receiver(f *ast.FuncDecl) (ident *ast.Ident, pointer bool, ok bool) { - if f.Recv == nil || len(f.Recv.List) != 1 { - return nil, false, false - } - switch t := f.Recv.List[0].Type.(type) { - case *ast.StarExpr: - identity, ok := t.X.(*ast.Ident) - if !ok { - return nil, false, false - } - return identity, true, true - case *ast.Ident: - return t, false, true - } - return nil, false, false -} - -// dropExistingTypeDeclarations removes any type declaration for which extractFn returns true. The function -// returns true if the entire declaration should be dropped. -func dropExistingTypeDeclarations(decl ast.Decl, extractFn ExtractFunc) bool { - switch t := decl.(type) { - case *ast.GenDecl: - if t.Tok != token.TYPE { - return false - } - specs := []ast.Spec{} - for _, s := range t.Specs { - switch spec := s.(type) { - case *ast.TypeSpec: - if extractFn(spec) { - continue - } - specs = append(specs, spec) - } - } - if len(specs) == 0 { - return true - } - t.Specs = specs - } - return false -} - -// dropEmptyImportDeclarations strips any generated but no-op imports from the generated code -// to prevent generation from being able to define side-effects. The function returns true -// if the entire declaration should be dropped. -func dropEmptyImportDeclarations(decl ast.Decl) bool { - switch t := decl.(type) { - case *ast.GenDecl: - if t.Tok != token.IMPORT { - return false - } - specs := []ast.Spec{} - for _, s := range t.Specs { - switch spec := s.(type) { - case *ast.ImportSpec: - if spec.Name != nil && spec.Name.Name == "_" { - continue - } - specs = append(specs, spec) - } - } - if len(specs) == 0 { - return true - } - t.Specs = specs - } - return false -} - -func RewriteTypesWithProtobufStructTags(name string, structTags map[string]map[string]string) error { - return rewriteFile(name, []byte{}, func(fset *token.FileSet, file *ast.File) error { - allErrs := []error{} - - // set any new struct tags - for _, d := range file.Decls { - if errs := updateStructTags(d, structTags, []string{"protobuf"}); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - } - - if len(allErrs) > 0 { - var s string - for _, err := range allErrs { - s += err.Error() + "\n" - } - return errors.New(s) - } - return nil - }) -} - -func updateStructTags(decl ast.Decl, structTags map[string]map[string]string, toCopy []string) []error { - var errs []error - t, ok := decl.(*ast.GenDecl) - if !ok { - return nil - } - if t.Tok != token.TYPE { - return nil - } - - for _, s := range t.Specs { - spec, ok := s.(*ast.TypeSpec) - if !ok { - continue - } - typeName := spec.Name.Name - fieldTags, ok := structTags[typeName] - if !ok { - continue - } - st, ok := spec.Type.(*ast.StructType) - if !ok { - continue - } - - for i := range st.Fields.List { - f := st.Fields.List[i] - var name string - if len(f.Names) == 0 { - switch t := f.Type.(type) { - case *ast.Ident: - name = t.Name - case *ast.SelectorExpr: - name = t.Sel.Name - default: - errs = append(errs, fmt.Errorf("unable to get name for tag from struct %q, field %#v", spec.Name.Name, t)) - continue - } - } else { - name = f.Names[0].Name - } - value, ok := fieldTags[name] - if !ok { - continue - } - var tags customreflect.StructTags - if f.Tag != nil { - oldTags, err := customreflect.ParseStructTags(strings.Trim(f.Tag.Value, "`")) - if err != nil { - errs = append(errs, fmt.Errorf("unable to read struct tag from struct %q, field %q: %v", spec.Name.Name, name, err)) - continue - } - tags = oldTags - } - for _, name := range toCopy { - // don't overwrite existing tags - if tags.Has(name) { - continue - } - // append new tags - if v := reflect.StructTag(value).Get(name); len(v) > 0 { - tags = append(tags, customreflect.StructTag{Name: name, Value: v}) - } - } - if len(tags) == 0 { - continue - } - if f.Tag == nil { - f.Tag = &ast.BasicLit{} - } - f.Tag.Value = tags.String() - } - } - return errs -} diff --git a/vendor/k8s.io/code-generator/cmd/import-boss/.gitignore b/vendor/k8s.io/code-generator/cmd/import-boss/.gitignore deleted file mode 100644 index a5c47b6..0000000 --- a/vendor/k8s.io/code-generator/cmd/import-boss/.gitignore +++ /dev/null @@ -1 +0,0 @@ -import-boss diff --git a/vendor/k8s.io/code-generator/cmd/import-boss/main.go b/vendor/k8s.io/code-generator/cmd/import-boss/main.go deleted file mode 100644 index 0080f01..0000000 --- a/vendor/k8s.io/code-generator/cmd/import-boss/main.go +++ /dev/null @@ -1,96 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// import-boss enforces import restrictions in a given repository. -// -// When a directory is verified, import-boss looks for a file called -// ".import-restrictions". If this file is not found, parent directories will be -// recursively searched. -// -// If an ".import-restrictions" file is found, then all imports of the package -// are checked against each "rule" in the file. A rule consists of three parts: -// -// - A SelectorRegexp, to select the import paths that the rule applies to. -// -// - A list of AllowedPrefixes -// -// - A list of ForbiddenPrefixes -// -// An import is allowed if it matches at least one allowed prefix and does not -// match any forbidden prefix. An example file looks like this: -// -// { -// "Rules": [ -// { -// "SelectorRegexp": "k8s[.]io", -// "AllowedPrefixes": [ -// "k8s.io/gengo/examples", -// "k8s.io/kubernetes/third_party" -// ], -// "ForbiddenPrefixes": [ -// "k8s.io/kubernetes/pkg/third_party/deprecated" -// ] -// }, -// { -// "SelectorRegexp": "^unsafe$", -// "AllowedPrefixes": [ -// ], -// "ForbiddenPrefixes": [ -// "" -// ] -// } -// ] -// } -// -// Note the second block explicitly matches the unsafe package, and forbids it -// ("" is a prefix of everything). -package main - -import ( - "os" - "path/filepath" - - "github.com/spf13/pflag" - "k8s.io/code-generator/pkg/util" - "k8s.io/gengo/args" - "k8s.io/gengo/examples/import-boss/generators" - - "k8s.io/klog" -) - -func main() { - klog.InitFlags(nil) - arguments := args.Default() - - // Override defaults. - arguments.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) - arguments.InputDirs = []string{ - "k8s.io/kubernetes/pkg/...", - "k8s.io/kubernetes/cmd/...", - "k8s.io/kubernetes/plugin/...", - } - pflag.CommandLine.BoolVar(&arguments.IncludeTestFiles, "include-test-files", false, "If true, include *_test.go files.") - - if err := arguments.Execute( - generators.NameSystems(), - generators.DefaultNameSystem(), - generators.Packages, - ); err != nil { - klog.Errorf("Error: %v", err) - os.Exit(1) - } - klog.V(2).Info("Completed successfully.") -} diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/args/args.go b/vendor/k8s.io/code-generator/cmd/informer-gen/args/args.go deleted file mode 100644 index ba7f720..0000000 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/args/args.go +++ /dev/null @@ -1,77 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package args - -import ( - "fmt" - "path" - - "github.com/spf13/pflag" - codegenutil "k8s.io/code-generator/pkg/util" - "k8s.io/gengo/args" -) - -// CustomArgs is used by the gengo framework to pass args specific to this generator. -type CustomArgs struct { - VersionedClientSetPackage string - InternalClientSetPackage string - ListersPackage string - SingleDirectory bool -} - -// NewDefaults returns default arguments for the generator. -func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { - genericArgs := args.Default().WithoutDefaultFlagParsing() - customArgs := &CustomArgs{ - SingleDirectory: false, - } - genericArgs.CustomArgs = customArgs - - if pkg := codegenutil.CurrentPackage(); len(pkg) != 0 { - genericArgs.OutputPackagePath = path.Join(pkg, "pkg/client/informers") - customArgs.VersionedClientSetPackage = path.Join(pkg, "pkg/client/clientset/versioned") - customArgs.InternalClientSetPackage = path.Join(pkg, "pkg/client/clientset/internalversion") - customArgs.ListersPackage = path.Join(pkg, "pkg/client/listers") - } - - return genericArgs, customArgs -} - -// AddFlags add the generator flags to the flag set. -func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) { - fs.StringVar(&ca.InternalClientSetPackage, "internal-clientset-package", ca.InternalClientSetPackage, "the full package name for the internal clientset to use") - fs.StringVar(&ca.VersionedClientSetPackage, "versioned-clientset-package", ca.VersionedClientSetPackage, "the full package name for the versioned clientset to use") - fs.StringVar(&ca.ListersPackage, "listers-package", ca.ListersPackage, "the full package name for the listers to use") - fs.BoolVar(&ca.SingleDirectory, "single-directory", ca.SingleDirectory, "if true, omit the intermediate \"internalversion\" and \"externalversions\" subdirectories") -} - -// Validate checks the given arguments. -func Validate(genericArgs *args.GeneratorArgs) error { - customArgs := genericArgs.CustomArgs.(*CustomArgs) - - if len(genericArgs.OutputPackagePath) == 0 { - return fmt.Errorf("output package cannot be empty") - } - if len(customArgs.VersionedClientSetPackage) == 0 { - return fmt.Errorf("versioned clientset package cannot be empty") - } - if len(customArgs.ListersPackage) == 0 { - return fmt.Errorf("listers package cannot be empty") - } - - return nil -} diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factory.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factory.go deleted file mode 100644 index 6e57931..0000000 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factory.go +++ /dev/null @@ -1,258 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generators - -import ( - "io" - "path" - - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/klog" -) - -// factoryGenerator produces a file of listers for a given GroupVersion and -// type. -type factoryGenerator struct { - generator.DefaultGen - outputPackage string - imports namer.ImportTracker - groupVersions map[string]clientgentypes.GroupVersions - gvGoNames map[string]string - clientSetPackage string - internalInterfacesPackage string - filtered bool -} - -var _ generator.Generator = &factoryGenerator{} - -func (g *factoryGenerator) Filter(c *generator.Context, t *types.Type) bool { - if !g.filtered { - g.filtered = true - return true - } - return false -} - -func (g *factoryGenerator) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *factoryGenerator) Imports(c *generator.Context) (imports []string) { - imports = append(imports, g.imports.ImportLines()...) - return -} - -func (g *factoryGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "{{", "}}") - - klog.V(5).Infof("processing type %v", t) - - gvInterfaces := make(map[string]*types.Type) - gvNewFuncs := make(map[string]*types.Type) - for groupPkgName := range g.groupVersions { - gvInterfaces[groupPkgName] = c.Universe.Type(types.Name{Package: path.Join(g.outputPackage, groupPkgName), Name: "Interface"}) - gvNewFuncs[groupPkgName] = c.Universe.Function(types.Name{Package: path.Join(g.outputPackage, groupPkgName), Name: "New"}) - } - m := map[string]interface{}{ - "cacheSharedIndexInformer": c.Universe.Type(cacheSharedIndexInformer), - "groupVersions": g.groupVersions, - "gvInterfaces": gvInterfaces, - "gvNewFuncs": gvNewFuncs, - "gvGoNames": g.gvGoNames, - "interfacesNewInformerFunc": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "NewInformerFunc"}), - "interfacesTweakListOptionsFunc": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "TweakListOptionsFunc"}), - "informerFactoryInterface": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "SharedInformerFactory"}), - "clientSetInterface": c.Universe.Type(types.Name{Package: g.clientSetPackage, Name: "Interface"}), - "reflectType": c.Universe.Type(reflectType), - "runtimeObject": c.Universe.Type(runtimeObject), - "schemaGroupVersionResource": c.Universe.Type(schemaGroupVersionResource), - "syncMutex": c.Universe.Type(syncMutex), - "timeDuration": c.Universe.Type(timeDuration), - "namespaceAll": c.Universe.Type(metav1NamespaceAll), - "object": c.Universe.Type(metav1Object), - } - - sw.Do(sharedInformerFactoryStruct, m) - sw.Do(sharedInformerFactoryInterface, m) - - return sw.Error() -} - -var sharedInformerFactoryStruct = ` -// SharedInformerOption defines the functional option type for SharedInformerFactory. -type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory - -type sharedInformerFactory struct { - client {{.clientSetInterface|raw}} - namespace string - tweakListOptions {{.interfacesTweakListOptionsFunc|raw}} - lock {{.syncMutex|raw}} - defaultResync {{.timeDuration|raw}} - customResync map[{{.reflectType|raw}}]{{.timeDuration|raw}} - - informers map[{{.reflectType|raw}}]{{.cacheSharedIndexInformer|raw}} - // startedInformers is used for tracking which informers have been started. - // This allows Start() to be called multiple times safely. - startedInformers map[{{.reflectType|raw}}]bool -} - -// WithCustomResyncConfig sets a custom resync period for the specified informer types. -func WithCustomResyncConfig(resyncConfig map[{{.object|raw}}]{{.timeDuration|raw}}) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - for k, v := range resyncConfig { - factory.customResync[reflect.TypeOf(k)] = v - } - return factory - } -} - -// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. -func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.tweakListOptions = tweakListOptions - return factory - } -} - -// WithNamespace limits the SharedInformerFactory to the specified namespace. -func WithNamespace(namespace string) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.namespace = namespace - return factory - } -} - -// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. -func NewSharedInformerFactory(client {{.clientSetInterface|raw}}, defaultResync {{.timeDuration|raw}}) SharedInformerFactory { - return NewSharedInformerFactoryWithOptions(client, defaultResync) -} - -// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. -// Listers obtained via this SharedInformerFactory will be subject to the same filters -// as specified here. -// Deprecated: Please use NewSharedInformerFactoryWithOptions instead -func NewFilteredSharedInformerFactory(client {{.clientSetInterface|raw}}, defaultResync {{.timeDuration|raw}}, namespace string, tweakListOptions {{.interfacesTweakListOptionsFunc|raw}}) SharedInformerFactory { - return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) -} - -// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. -func NewSharedInformerFactoryWithOptions(client {{.clientSetInterface|raw}}, defaultResync {{.timeDuration|raw}}, options ...SharedInformerOption) SharedInformerFactory { - factory := &sharedInformerFactory{ - client: client, - namespace: v1.NamespaceAll, - defaultResync: defaultResync, - informers: make(map[{{.reflectType|raw}}]{{.cacheSharedIndexInformer|raw}}), - startedInformers: make(map[{{.reflectType|raw}}]bool), - customResync: make(map[{{.reflectType|raw}}]{{.timeDuration|raw}}), - } - - // Apply all options - for _, opt := range options { - factory = opt(factory) - } - - return factory -} - -// Start initializes all requested informers. -func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { - f.lock.Lock() - defer f.lock.Unlock() - - for informerType, informer := range f.informers { - if !f.startedInformers[informerType] { - go informer.Run(stopCh) - f.startedInformers[informerType] = true - } - } -} - -// WaitForCacheSync waits for all started informers' cache were synced. -func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { - informers := func()map[reflect.Type]cache.SharedIndexInformer{ - f.lock.Lock() - defer f.lock.Unlock() - - informers := map[reflect.Type]cache.SharedIndexInformer{} - for informerType, informer := range f.informers { - if f.startedInformers[informerType] { - informers[informerType] = informer - } - } - return informers - }() - - res := map[reflect.Type]bool{} - for informType, informer := range informers { - res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) - } - return res -} - -// InternalInformerFor returns the SharedIndexInformer for obj using an internal -// client. -func (f *sharedInformerFactory) InformerFor(obj {{.runtimeObject|raw}}, newFunc {{.interfacesNewInformerFunc|raw}}) {{.cacheSharedIndexInformer|raw}} { - f.lock.Lock() - defer f.lock.Unlock() - - informerType := reflect.TypeOf(obj) - informer, exists := f.informers[informerType] - if exists { - return informer - } - - resyncPeriod, exists := f.customResync[informerType] - if !exists { - resyncPeriod = f.defaultResync - } - - informer = newFunc(f.client, resyncPeriod) - f.informers[informerType] = informer - - return informer -} - -` - -var sharedInformerFactoryInterface = ` -// SharedInformerFactory provides shared informers for resources in all known -// API group versions. -type SharedInformerFactory interface { - {{.informerFactoryInterface|raw}} - ForResource(resource {{.schemaGroupVersionResource|raw}}) (GenericInformer, error) - WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool - - {{$gvInterfaces := .gvInterfaces}} - {{$gvGoNames := .gvGoNames}} - {{range $groupName, $group := .groupVersions}}{{index $gvGoNames $groupName}}() {{index $gvInterfaces $groupName|raw}} - {{end}} -} - -{{$gvNewFuncs := .gvNewFuncs}} -{{$gvGoNames := .gvGoNames}} -{{range $groupPkgName, $group := .groupVersions}} -func (f *sharedInformerFactory) {{index $gvGoNames $groupPkgName}}() {{index $gvInterfaces $groupPkgName|raw}} { - return {{index $gvNewFuncs $groupPkgName|raw}}(f, f.namespace, f.tweakListOptions) -} -{{end}} -` diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factoryinterface.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factoryinterface.go deleted file mode 100644 index fc0668c..0000000 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factoryinterface.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generators - -import ( - "io" - - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/klog" -) - -// factoryInterfaceGenerator produces a file of interfaces used to break a dependency cycle for -// informer registration -type factoryInterfaceGenerator struct { - generator.DefaultGen - outputPackage string - imports namer.ImportTracker - clientSetPackage string - filtered bool -} - -var _ generator.Generator = &factoryInterfaceGenerator{} - -func (g *factoryInterfaceGenerator) Filter(c *generator.Context, t *types.Type) bool { - if !g.filtered { - g.filtered = true - return true - } - return false -} - -func (g *factoryInterfaceGenerator) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *factoryInterfaceGenerator) Imports(c *generator.Context) (imports []string) { - imports = append(imports, g.imports.ImportLines()...) - return -} - -func (g *factoryInterfaceGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "{{", "}}") - - klog.V(5).Infof("processing type %v", t) - - m := map[string]interface{}{ - "cacheSharedIndexInformer": c.Universe.Type(cacheSharedIndexInformer), - "clientSetPackage": c.Universe.Type(types.Name{Package: g.clientSetPackage, Name: "Interface"}), - "runtimeObject": c.Universe.Type(runtimeObject), - "timeDuration": c.Universe.Type(timeDuration), - "v1ListOptions": c.Universe.Type(v1ListOptions), - } - - sw.Do(externalSharedInformerFactoryInterface, m) - - return sw.Error() -} - -var externalSharedInformerFactoryInterface = ` -// NewInformerFunc takes {{.clientSetPackage|raw}} and {{.timeDuration|raw}} to return a SharedIndexInformer. -type NewInformerFunc func({{.clientSetPackage|raw}}, {{.timeDuration|raw}}) cache.SharedIndexInformer - -// SharedInformerFactory a small interface to allow for adding an informer without an import cycle -type SharedInformerFactory interface { - Start(stopCh <-chan struct{}) - InformerFor(obj {{.runtimeObject|raw}}, newFunc NewInformerFunc) {{.cacheSharedIndexInformer|raw}} -} - -// TweakListOptionsFunc is a function that transforms a {{.v1ListOptions|raw}}. -type TweakListOptionsFunc func(*{{.v1ListOptions|raw}}) -` diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/generic.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/generic.go deleted file mode 100644 index cad9079..0000000 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/generic.go +++ /dev/null @@ -1,184 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generators - -import ( - "io" - "sort" - "strings" - - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - codegennamer "k8s.io/code-generator/pkg/namer" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -// genericGenerator generates the generic informer. -type genericGenerator struct { - generator.DefaultGen - outputPackage string - imports namer.ImportTracker - groupVersions map[string]clientgentypes.GroupVersions - groupGoNames map[string]string - typesForGroupVersion map[clientgentypes.GroupVersion][]*types.Type - filtered bool -} - -var _ generator.Generator = &genericGenerator{} - -func (g *genericGenerator) Filter(c *generator.Context, t *types.Type) bool { - if !g.filtered { - g.filtered = true - return true - } - return false -} - -func (g *genericGenerator) Namers(c *generator.Context) namer.NameSystems { - pluralExceptions := map[string]string{ - "Endpoints": "Endpoints", - } - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - "allLowercasePlural": namer.NewAllLowercasePluralNamer(pluralExceptions), - "publicPlural": namer.NewPublicPluralNamer(pluralExceptions), - "resource": codegennamer.NewTagOverrideNamer("resourceName", namer.NewAllLowercasePluralNamer(pluralExceptions)), - } -} - -func (g *genericGenerator) Imports(c *generator.Context) (imports []string) { - imports = append(imports, g.imports.ImportLines()...) - imports = append(imports, "fmt") - return -} - -type group struct { - GroupGoName string - Name string - Versions []*version -} - -type groupSort []group - -func (g groupSort) Len() int { return len(g) } -func (g groupSort) Less(i, j int) bool { return strings.ToLower(g[i].Name) < strings.ToLower(g[j].Name) } -func (g groupSort) Swap(i, j int) { g[i], g[j] = g[j], g[i] } - -type version struct { - Name string - GoName string - Resources []*types.Type -} - -type versionSort []*version - -func (v versionSort) Len() int { return len(v) } -func (v versionSort) Less(i, j int) bool { - return strings.ToLower(v[i].Name) < strings.ToLower(v[j].Name) -} -func (v versionSort) Swap(i, j int) { v[i], v[j] = v[j], v[i] } - -func (g *genericGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "{{", "}}") - - groups := []group{} - schemeGVs := make(map[*version]*types.Type) - - orderer := namer.Orderer{Namer: namer.NewPrivateNamer(0)} - for groupPackageName, groupVersions := range g.groupVersions { - group := group{ - GroupGoName: g.groupGoNames[groupPackageName], - Name: groupVersions.Group.NonEmpty(), - Versions: []*version{}, - } - for _, v := range groupVersions.Versions { - gv := clientgentypes.GroupVersion{Group: groupVersions.Group, Version: v.Version} - version := &version{ - Name: v.Version.NonEmpty(), - GoName: namer.IC(v.Version.NonEmpty()), - Resources: orderer.OrderTypes(g.typesForGroupVersion[gv]), - } - func() { - schemeGVs[version] = c.Universe.Variable(types.Name{Package: g.typesForGroupVersion[gv][0].Name.Package, Name: "SchemeGroupVersion"}) - }() - group.Versions = append(group.Versions, version) - } - sort.Sort(versionSort(group.Versions)) - groups = append(groups, group) - } - sort.Sort(groupSort(groups)) - - m := map[string]interface{}{ - "cacheGenericLister": c.Universe.Type(cacheGenericLister), - "cacheNewGenericLister": c.Universe.Function(cacheNewGenericLister), - "cacheSharedIndexInformer": c.Universe.Type(cacheSharedIndexInformer), - "groups": groups, - "schemeGVs": schemeGVs, - "schemaGroupResource": c.Universe.Type(schemaGroupResource), - "schemaGroupVersionResource": c.Universe.Type(schemaGroupVersionResource), - } - - sw.Do(genericInformer, m) - sw.Do(forResource, m) - - return sw.Error() -} - -var genericInformer = ` -// GenericInformer is type of SharedIndexInformer which will locate and delegate to other -// sharedInformers based on type -type GenericInformer interface { - Informer() {{.cacheSharedIndexInformer|raw}} - Lister() {{.cacheGenericLister|raw}} -} - -type genericInformer struct { - informer {{.cacheSharedIndexInformer|raw}} - resource {{.schemaGroupResource|raw}} -} - -// Informer returns the SharedIndexInformer. -func (f *genericInformer) Informer() {{.cacheSharedIndexInformer|raw}} { - return f.informer -} - -// Lister returns the GenericLister. -func (f *genericInformer) Lister() {{.cacheGenericLister|raw}} { - return {{.cacheNewGenericLister|raw}}(f.Informer().GetIndexer(), f.resource) -} -` - -var forResource = ` -// ForResource gives generic access to a shared informer of the matching type -// TODO extend this to unknown resources with a client pool -func (f *sharedInformerFactory) ForResource(resource {{.schemaGroupVersionResource|raw}}) (GenericInformer, error) { - switch resource { - {{range $group := .groups -}}{{$GroupGoName := .GroupGoName -}} - {{range $version := .Versions -}} - // Group={{$group.Name}}, Version={{.Name}} - {{range .Resources -}} - case {{index $.schemeGVs $version|raw}}.WithResource("{{.|resource}}"): - return &genericInformer{resource: resource.GroupResource(), informer: f.{{$GroupGoName}}().{{$version.GoName}}().{{.|publicPlural}}().Informer()}, nil - {{end}} - {{end}} - {{end -}} - } - - return nil, fmt.Errorf("no informer found for %v", resource) -} -` diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/groupinterface.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/groupinterface.go deleted file mode 100644 index 0bba93c..0000000 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/groupinterface.go +++ /dev/null @@ -1,118 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generators - -import ( - "io" - "path/filepath" - "strings" - - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -// groupInterfaceGenerator generates the per-group interface file. -type groupInterfaceGenerator struct { - generator.DefaultGen - outputPackage string - imports namer.ImportTracker - groupVersions clientgentypes.GroupVersions - filtered bool - internalInterfacesPackage string -} - -var _ generator.Generator = &groupInterfaceGenerator{} - -func (g *groupInterfaceGenerator) Filter(c *generator.Context, t *types.Type) bool { - if !g.filtered { - g.filtered = true - return true - } - return false -} - -func (g *groupInterfaceGenerator) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *groupInterfaceGenerator) Imports(c *generator.Context) (imports []string) { - imports = append(imports, g.imports.ImportLines()...) - return -} - -type versionData struct { - Name string - Interface *types.Type - New *types.Type -} - -func (g *groupInterfaceGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - - versions := make([]versionData, 0, len(g.groupVersions.Versions)) - for _, version := range g.groupVersions.Versions { - gv := clientgentypes.GroupVersion{Group: g.groupVersions.Group, Version: version.Version} - versionPackage := filepath.Join(g.outputPackage, strings.ToLower(gv.Version.NonEmpty())) - iface := c.Universe.Type(types.Name{Package: versionPackage, Name: "Interface"}) - versions = append(versions, versionData{ - Name: namer.IC(version.Version.NonEmpty()), - Interface: iface, - New: c.Universe.Function(types.Name{Package: versionPackage, Name: "New"}), - }) - } - m := map[string]interface{}{ - "interfacesTweakListOptionsFunc": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "TweakListOptionsFunc"}), - "interfacesSharedInformerFactory": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "SharedInformerFactory"}), - "versions": versions, - } - - sw.Do(groupTemplate, m) - - return sw.Error() -} - -var groupTemplate = ` -// Interface provides access to each of this group's versions. -type Interface interface { - $range .versions -$ - // $.Name$ provides access to shared informers for resources in $.Name$. - $.Name$() $.Interface|raw$ - $end$ -} - -type group struct { - factory $.interfacesSharedInformerFactory|raw$ - namespace string - tweakListOptions $.interfacesTweakListOptionsFunc|raw$ -} - -// New returns a new Interface. -func New(f $.interfacesSharedInformerFactory|raw$, namespace string, tweakListOptions $.interfacesTweakListOptionsFunc|raw$) Interface { - return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -$range .versions$ -// $.Name$ returns a new $.Interface|raw$. -func (g *group) $.Name$() $.Interface|raw$ { - return $.New|raw$(g.factory, g.namespace, g.tweakListOptions) -} -$end$ -` diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/informer.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/informer.go deleted file mode 100644 index 9204d62..0000000 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/informer.go +++ /dev/null @@ -1,186 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generators - -import ( - "fmt" - "io" - "strings" - - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/code-generator/cmd/client-gen/generators/util" - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - - "k8s.io/klog" -) - -// informerGenerator produces a file of listers for a given GroupVersion and -// type. -type informerGenerator struct { - generator.DefaultGen - outputPackage string - groupPkgName string - groupVersion clientgentypes.GroupVersion - groupGoName string - typeToGenerate *types.Type - imports namer.ImportTracker - clientSetPackage string - listersPackage string - internalInterfacesPackage string -} - -var _ generator.Generator = &informerGenerator{} - -func (g *informerGenerator) Filter(c *generator.Context, t *types.Type) bool { - return t == g.typeToGenerate -} - -func (g *informerGenerator) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *informerGenerator) Imports(c *generator.Context) (imports []string) { - imports = append(imports, g.imports.ImportLines()...) - return -} - -func (g *informerGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - - klog.V(5).Infof("processing type %v", t) - - listerPackage := fmt.Sprintf("%s/%s/%s", g.listersPackage, g.groupPkgName, strings.ToLower(g.groupVersion.Version.NonEmpty())) - clientSetInterface := c.Universe.Type(types.Name{Package: g.clientSetPackage, Name: "Interface"}) - informerFor := "InformerFor" - - tags, err := util.ParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) - if err != nil { - return err - } - - m := map[string]interface{}{ - "apiScheme": c.Universe.Type(apiScheme), - "cacheIndexers": c.Universe.Type(cacheIndexers), - "cacheListWatch": c.Universe.Type(cacheListWatch), - "cacheMetaNamespaceIndexFunc": c.Universe.Function(cacheMetaNamespaceIndexFunc), - "cacheNamespaceIndex": c.Universe.Variable(cacheNamespaceIndex), - "cacheNewSharedIndexInformer": c.Universe.Function(cacheNewSharedIndexInformer), - "cacheSharedIndexInformer": c.Universe.Type(cacheSharedIndexInformer), - "clientSetInterface": clientSetInterface, - "group": namer.IC(g.groupGoName), - "informerFor": informerFor, - "interfacesTweakListOptionsFunc": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "TweakListOptionsFunc"}), - "interfacesSharedInformerFactory": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "SharedInformerFactory"}), - "listOptions": c.Universe.Type(listOptions), - "lister": c.Universe.Type(types.Name{Package: listerPackage, Name: t.Name.Name + "Lister"}), - "namespaceAll": c.Universe.Type(metav1NamespaceAll), - "namespaced": !tags.NonNamespaced, - "newLister": c.Universe.Function(types.Name{Package: listerPackage, Name: "New" + t.Name.Name + "Lister"}), - "runtimeObject": c.Universe.Type(runtimeObject), - "timeDuration": c.Universe.Type(timeDuration), - "type": t, - "v1ListOptions": c.Universe.Type(v1ListOptions), - "version": namer.IC(g.groupVersion.Version.String()), - "watchInterface": c.Universe.Type(watchInterface), - } - - sw.Do(typeInformerInterface, m) - sw.Do(typeInformerStruct, m) - sw.Do(typeInformerPublicConstructor, m) - sw.Do(typeFilteredInformerPublicConstructor, m) - sw.Do(typeInformerConstructor, m) - sw.Do(typeInformerInformer, m) - sw.Do(typeInformerLister, m) - - return sw.Error() -} - -var typeInformerInterface = ` -// $.type|public$Informer provides access to a shared informer and lister for -// $.type|publicPlural$. -type $.type|public$Informer interface { - Informer() $.cacheSharedIndexInformer|raw$ - Lister() $.lister|raw$ -} -` - -var typeInformerStruct = ` -type $.type|private$Informer struct { - factory $.interfacesSharedInformerFactory|raw$ - tweakListOptions $.interfacesTweakListOptionsFunc|raw$ - $if .namespaced$namespace string$end$ -} -` - -var typeInformerPublicConstructor = ` -// New$.type|public$Informer constructs a new informer for $.type|public$ type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func New$.type|public$Informer(client $.clientSetInterface|raw$$if .namespaced$, namespace string$end$, resyncPeriod $.timeDuration|raw$, indexers $.cacheIndexers|raw$) $.cacheSharedIndexInformer|raw$ { - return NewFiltered$.type|public$Informer(client$if .namespaced$, namespace$end$, resyncPeriod, indexers, nil) -} -` - -var typeFilteredInformerPublicConstructor = ` -// NewFiltered$.type|public$Informer constructs a new informer for $.type|public$ type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFiltered$.type|public$Informer(client $.clientSetInterface|raw$$if .namespaced$, namespace string$end$, resyncPeriod $.timeDuration|raw$, indexers $.cacheIndexers|raw$, tweakListOptions $.interfacesTweakListOptionsFunc|raw$) $.cacheSharedIndexInformer|raw$ { - return $.cacheNewSharedIndexInformer|raw$( - &$.cacheListWatch|raw${ - ListFunc: func(options $.v1ListOptions|raw$) ($.runtimeObject|raw$, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.$.group$$.version$().$.type|publicPlural$($if .namespaced$namespace$end$).List(options) - }, - WatchFunc: func(options $.v1ListOptions|raw$) ($.watchInterface|raw$, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.$.group$$.version$().$.type|publicPlural$($if .namespaced$namespace$end$).Watch(options) - }, - }, - &$.type|raw${}, - resyncPeriod, - indexers, - ) -} -` - -var typeInformerConstructor = ` -func (f *$.type|private$Informer) defaultInformer(client $.clientSetInterface|raw$, resyncPeriod $.timeDuration|raw$) $.cacheSharedIndexInformer|raw$ { - return NewFiltered$.type|public$Informer(client$if .namespaced$, f.namespace$end$, resyncPeriod, $.cacheIndexers|raw${$.cacheNamespaceIndex|raw$: $.cacheMetaNamespaceIndexFunc|raw$}, f.tweakListOptions) -} -` - -var typeInformerInformer = ` -func (f *$.type|private$Informer) Informer() $.cacheSharedIndexInformer|raw$ { - return f.factory.$.informerFor$(&$.type|raw${}, f.defaultInformer) -} -` - -var typeInformerLister = ` -func (f *$.type|private$Informer) Lister() $.lister|raw$ { - return $.newLister|raw$(f.Informer().GetIndexer()) -} -` diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/packages.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/packages.go deleted file mode 100644 index e936e29..0000000 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/packages.go +++ /dev/null @@ -1,352 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generators - -import ( - "fmt" - "path" - "path/filepath" - "strings" - - "k8s.io/gengo/args" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - "k8s.io/klog" - - "k8s.io/code-generator/cmd/client-gen/generators/util" - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - informergenargs "k8s.io/code-generator/cmd/informer-gen/args" -) - -// NameSystems returns the name system used by the generators in this package. -func NameSystems() namer.NameSystems { - pluralExceptions := map[string]string{ - "Endpoints": "Endpoints", - } - return namer.NameSystems{ - "public": namer.NewPublicNamer(0), - "private": namer.NewPrivateNamer(0), - "raw": namer.NewRawNamer("", nil), - "publicPlural": namer.NewPublicPluralNamer(pluralExceptions), - "allLowercasePlural": namer.NewAllLowercasePluralNamer(pluralExceptions), - "lowercaseSingular": &lowercaseSingularNamer{}, - } -} - -// lowercaseSingularNamer implements Namer -type lowercaseSingularNamer struct{} - -// Name returns t's name in all lowercase. -func (n *lowercaseSingularNamer) Name(t *types.Type) string { - return strings.ToLower(t.Name.Name) -} - -// DefaultNameSystem returns the default name system for ordering the types to be -// processed by the generators in this package. -func DefaultNameSystem() string { - return "public" -} - -// objectMetaForPackage returns the type of ObjectMeta used by package p. -func objectMetaForPackage(p *types.Package) (*types.Type, bool, error) { - generatingForPackage := false - for _, t := range p.Types { - if !util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)).GenerateClient { - continue - } - generatingForPackage = true - for _, member := range t.Members { - if member.Name == "ObjectMeta" { - return member.Type, isInternal(member), nil - } - } - } - if generatingForPackage { - return nil, false, fmt.Errorf("unable to find ObjectMeta for any types in package %s", p.Path) - } - return nil, false, nil -} - -// isInternal returns true if the tags for a member do not contain a json tag -func isInternal(m types.Member) bool { - return !strings.Contains(m.Tags, "json") -} - -func packageForInternalInterfaces(base string) string { - return filepath.Join(base, "internalinterfaces") -} - -func vendorless(p string) string { - if pos := strings.LastIndex(p, "/vendor/"); pos != -1 { - return p[pos+len("/vendor/"):] - } - return p -} - -// Packages makes the client package definition. -func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { - boilerplate, err := arguments.LoadGoBoilerplate() - if err != nil { - klog.Fatalf("Failed loading boilerplate: %v", err) - } - - customArgs, ok := arguments.CustomArgs.(*informergenargs.CustomArgs) - if !ok { - klog.Fatalf("Wrong CustomArgs type: %T", arguments.CustomArgs) - } - - internalVersionPackagePath := filepath.Join(arguments.OutputPackagePath) - externalVersionPackagePath := filepath.Join(arguments.OutputPackagePath) - if !customArgs.SingleDirectory { - internalVersionPackagePath = filepath.Join(arguments.OutputPackagePath, "internalversion") - externalVersionPackagePath = filepath.Join(arguments.OutputPackagePath, "externalversions") - } - - var packageList generator.Packages - typesForGroupVersion := make(map[clientgentypes.GroupVersion][]*types.Type) - - externalGroupVersions := make(map[string]clientgentypes.GroupVersions) - internalGroupVersions := make(map[string]clientgentypes.GroupVersions) - groupGoNames := make(map[string]string) - for _, inputDir := range arguments.InputDirs { - p := context.Universe.Package(vendorless(inputDir)) - - objectMeta, internal, err := objectMetaForPackage(p) - if err != nil { - klog.Fatal(err) - } - if objectMeta == nil { - // no types in this package had genclient - continue - } - - var gv clientgentypes.GroupVersion - var targetGroupVersions map[string]clientgentypes.GroupVersions - - if internal { - lastSlash := strings.LastIndex(p.Path, "/") - if lastSlash == -1 { - klog.Fatalf("error constructing internal group version for package %q", p.Path) - } - gv.Group = clientgentypes.Group(p.Path[lastSlash+1:]) - targetGroupVersions = internalGroupVersions - } else { - parts := strings.Split(p.Path, "/") - gv.Group = clientgentypes.Group(parts[len(parts)-2]) - gv.Version = clientgentypes.Version(parts[len(parts)-1]) - targetGroupVersions = externalGroupVersions - } - groupPackageName := gv.Group.NonEmpty() - gvPackage := path.Clean(p.Path) - - // If there's a comment of the form "// +groupName=somegroup" or - // "// +groupName=somegroup.foo.bar.io", use the first field (somegroup) as the name of the - // group when generating. - if override := types.ExtractCommentTags("+", p.Comments)["groupName"]; override != nil { - gv.Group = clientgentypes.Group(override[0]) - } - - // If there's a comment of the form "// +groupGoName=SomeUniqueShortName", use that as - // the Go group identifier in CamelCase. It defaults - groupGoNames[groupPackageName] = namer.IC(strings.Split(gv.Group.NonEmpty(), ".")[0]) - if override := types.ExtractCommentTags("+", p.Comments)["groupGoName"]; override != nil { - groupGoNames[groupPackageName] = namer.IC(override[0]) - } - - var typesToGenerate []*types.Type - for _, t := range p.Types { - tags := util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) - if !tags.GenerateClient || tags.NoVerbs || !tags.HasVerb("list") || !tags.HasVerb("watch") { - continue - } - - typesToGenerate = append(typesToGenerate, t) - - if _, ok := typesForGroupVersion[gv]; !ok { - typesForGroupVersion[gv] = []*types.Type{} - } - typesForGroupVersion[gv] = append(typesForGroupVersion[gv], t) - } - if len(typesToGenerate) == 0 { - continue - } - - groupVersionsEntry, ok := targetGroupVersions[groupPackageName] - if !ok { - groupVersionsEntry = clientgentypes.GroupVersions{ - PackageName: groupPackageName, - Group: gv.Group, - } - } - groupVersionsEntry.Versions = append(groupVersionsEntry.Versions, clientgentypes.PackageVersion{Version: gv.Version, Package: gvPackage}) - targetGroupVersions[groupPackageName] = groupVersionsEntry - - orderer := namer.Orderer{Namer: namer.NewPrivateNamer(0)} - typesToGenerate = orderer.OrderTypes(typesToGenerate) - - if internal { - packageList = append(packageList, versionPackage(internalVersionPackagePath, groupPackageName, gv, groupGoNames[groupPackageName], boilerplate, typesToGenerate, customArgs.InternalClientSetPackage, customArgs.ListersPackage)) - } else { - packageList = append(packageList, versionPackage(externalVersionPackagePath, groupPackageName, gv, groupGoNames[groupPackageName], boilerplate, typesToGenerate, customArgs.VersionedClientSetPackage, customArgs.ListersPackage)) - } - } - - if len(externalGroupVersions) != 0 { - packageList = append(packageList, factoryInterfacePackage(externalVersionPackagePath, boilerplate, customArgs.VersionedClientSetPackage)) - packageList = append(packageList, factoryPackage(externalVersionPackagePath, boilerplate, groupGoNames, externalGroupVersions, customArgs.VersionedClientSetPackage, typesForGroupVersion)) - for _, gvs := range externalGroupVersions { - packageList = append(packageList, groupPackage(externalVersionPackagePath, gvs, boilerplate)) - } - } - - if len(internalGroupVersions) != 0 { - packageList = append(packageList, factoryInterfacePackage(internalVersionPackagePath, boilerplate, customArgs.InternalClientSetPackage)) - packageList = append(packageList, factoryPackage(internalVersionPackagePath, boilerplate, groupGoNames, internalGroupVersions, customArgs.InternalClientSetPackage, typesForGroupVersion)) - for _, gvs := range internalGroupVersions { - packageList = append(packageList, groupPackage(internalVersionPackagePath, gvs, boilerplate)) - } - } - - return packageList -} - -func factoryPackage(basePackage string, boilerplate []byte, groupGoNames map[string]string, groupVersions map[string]clientgentypes.GroupVersions, clientSetPackage string, typesForGroupVersion map[clientgentypes.GroupVersion][]*types.Type) generator.Package { - return &generator.DefaultPackage{ - PackageName: filepath.Base(basePackage), - PackagePath: basePackage, - HeaderText: boilerplate, - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - generators = append(generators, &factoryGenerator{ - DefaultGen: generator.DefaultGen{ - OptionalName: "factory", - }, - outputPackage: basePackage, - imports: generator.NewImportTracker(), - groupVersions: groupVersions, - clientSetPackage: clientSetPackage, - internalInterfacesPackage: packageForInternalInterfaces(basePackage), - gvGoNames: groupGoNames, - }) - - generators = append(generators, &genericGenerator{ - DefaultGen: generator.DefaultGen{ - OptionalName: "generic", - }, - outputPackage: basePackage, - imports: generator.NewImportTracker(), - groupVersions: groupVersions, - typesForGroupVersion: typesForGroupVersion, - groupGoNames: groupGoNames, - }) - - return generators - }, - } -} - -func factoryInterfacePackage(basePackage string, boilerplate []byte, clientSetPackage string) generator.Package { - packagePath := packageForInternalInterfaces(basePackage) - - return &generator.DefaultPackage{ - PackageName: filepath.Base(packagePath), - PackagePath: packagePath, - HeaderText: boilerplate, - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - generators = append(generators, &factoryInterfaceGenerator{ - DefaultGen: generator.DefaultGen{ - OptionalName: "factory_interfaces", - }, - outputPackage: packagePath, - imports: generator.NewImportTracker(), - clientSetPackage: clientSetPackage, - }) - - return generators - }, - } -} - -func groupPackage(basePackage string, groupVersions clientgentypes.GroupVersions, boilerplate []byte) generator.Package { - packagePath := filepath.Join(basePackage, groupVersions.PackageName) - groupPkgName := strings.Split(string(groupVersions.PackageName), ".")[0] - - return &generator.DefaultPackage{ - PackageName: groupPkgName, - PackagePath: packagePath, - HeaderText: boilerplate, - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - generators = append(generators, &groupInterfaceGenerator{ - DefaultGen: generator.DefaultGen{ - OptionalName: "interface", - }, - outputPackage: packagePath, - groupVersions: groupVersions, - imports: generator.NewImportTracker(), - internalInterfacesPackage: packageForInternalInterfaces(basePackage), - }) - return generators - }, - FilterFunc: func(c *generator.Context, t *types.Type) bool { - tags := util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) - return tags.GenerateClient && tags.HasVerb("list") && tags.HasVerb("watch") - }, - } -} - -func versionPackage(basePackage string, groupPkgName string, gv clientgentypes.GroupVersion, groupGoName string, boilerplate []byte, typesToGenerate []*types.Type, clientSetPackage, listersPackage string) generator.Package { - packagePath := filepath.Join(basePackage, groupPkgName, strings.ToLower(gv.Version.NonEmpty())) - - return &generator.DefaultPackage{ - PackageName: strings.ToLower(gv.Version.NonEmpty()), - PackagePath: packagePath, - HeaderText: boilerplate, - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - generators = append(generators, &versionInterfaceGenerator{ - DefaultGen: generator.DefaultGen{ - OptionalName: "interface", - }, - outputPackage: packagePath, - imports: generator.NewImportTracker(), - types: typesToGenerate, - internalInterfacesPackage: packageForInternalInterfaces(basePackage), - }) - - for _, t := range typesToGenerate { - generators = append(generators, &informerGenerator{ - DefaultGen: generator.DefaultGen{ - OptionalName: strings.ToLower(t.Name.Name), - }, - outputPackage: packagePath, - groupPkgName: groupPkgName, - groupVersion: gv, - groupGoName: groupGoName, - typeToGenerate: t, - imports: generator.NewImportTracker(), - clientSetPackage: clientSetPackage, - listersPackage: listersPackage, - internalInterfacesPackage: packageForInternalInterfaces(basePackage), - }) - } - return generators - }, - FilterFunc: func(c *generator.Context, t *types.Type) bool { - tags := util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) - return tags.GenerateClient && tags.HasVerb("list") && tags.HasVerb("watch") - }, - } -} diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/types.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/types.go deleted file mode 100644 index 27d4bd5..0000000 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/types.go +++ /dev/null @@ -1,42 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generators - -import "k8s.io/gengo/types" - -var ( - apiScheme = types.Name{Package: "k8s.io/kubernetes/pkg/api/legacyscheme", Name: "Scheme"} - cacheGenericLister = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "GenericLister"} - cacheIndexers = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "Indexers"} - cacheListWatch = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "ListWatch"} - cacheMetaNamespaceIndexFunc = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "MetaNamespaceIndexFunc"} - cacheNamespaceIndex = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "NamespaceIndex"} - cacheNewGenericLister = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "NewGenericLister"} - cacheNewSharedIndexInformer = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "NewSharedIndexInformer"} - cacheSharedIndexInformer = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "SharedIndexInformer"} - listOptions = types.Name{Package: "k8s.io/kubernetes/pkg/apis/core", Name: "ListOptions"} - reflectType = types.Name{Package: "reflect", Name: "Type"} - runtimeObject = types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "Object"} - schemaGroupResource = types.Name{Package: "k8s.io/apimachinery/pkg/runtime/schema", Name: "GroupResource"} - schemaGroupVersionResource = types.Name{Package: "k8s.io/apimachinery/pkg/runtime/schema", Name: "GroupVersionResource"} - syncMutex = types.Name{Package: "sync", Name: "Mutex"} - timeDuration = types.Name{Package: "time", Name: "Duration"} - v1ListOptions = types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "ListOptions"} - metav1NamespaceAll = types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "NamespaceAll"} - metav1Object = types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "Object"} - watchInterface = types.Name{Package: "k8s.io/apimachinery/pkg/watch", Name: "Interface"} -) diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/versioninterface.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/versioninterface.go deleted file mode 100644 index 3b51f8d..0000000 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/versioninterface.go +++ /dev/null @@ -1,109 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generators - -import ( - "io" - - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/code-generator/cmd/client-gen/generators/util" -) - -// versionInterfaceGenerator generates the per-version interface file. -type versionInterfaceGenerator struct { - generator.DefaultGen - outputPackage string - imports namer.ImportTracker - types []*types.Type - filtered bool - internalInterfacesPackage string -} - -var _ generator.Generator = &versionInterfaceGenerator{} - -func (g *versionInterfaceGenerator) Filter(c *generator.Context, t *types.Type) bool { - if !g.filtered { - g.filtered = true - return true - } - return false -} - -func (g *versionInterfaceGenerator) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *versionInterfaceGenerator) Imports(c *generator.Context) (imports []string) { - imports = append(imports, g.imports.ImportLines()...) - return -} - -func (g *versionInterfaceGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - - m := map[string]interface{}{ - "interfacesTweakListOptionsFunc": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "TweakListOptionsFunc"}), - "interfacesSharedInformerFactory": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "SharedInformerFactory"}), - "types": g.types, - } - - sw.Do(versionTemplate, m) - for _, typeDef := range g.types { - tags, err := util.ParseClientGenTags(append(typeDef.SecondClosestCommentLines, typeDef.CommentLines...)) - if err != nil { - return err - } - m["namespaced"] = !tags.NonNamespaced - m["type"] = typeDef - sw.Do(versionFuncTemplate, m) - } - - return sw.Error() -} - -var versionTemplate = ` -// Interface provides access to all the informers in this group version. -type Interface interface { - $range .types -$ - // $.|publicPlural$ returns a $.|public$Informer. - $.|publicPlural$() $.|public$Informer - $end$ -} - -type version struct { - factory $.interfacesSharedInformerFactory|raw$ - namespace string - tweakListOptions $.interfacesTweakListOptionsFunc|raw$ -} - -// New returns a new Interface. -func New(f $.interfacesSharedInformerFactory|raw$, namespace string, tweakListOptions $.interfacesTweakListOptionsFunc|raw$) Interface { - return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} -` - -var versionFuncTemplate = ` -// $.type|publicPlural$ returns a $.type|public$Informer. -func (v *version) $.type|publicPlural$() $.type|public$Informer { - return &$.type|private$Informer{factory: v.factory$if .namespaced$, namespace: v.namespace$end$, tweakListOptions: v.tweakListOptions} -} -` diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/main.go b/vendor/k8s.io/code-generator/cmd/informer-gen/main.go deleted file mode 100644 index 14f3e92..0000000 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/main.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package main - -import ( - "flag" - "path/filepath" - - "github.com/spf13/pflag" - "k8s.io/code-generator/cmd/informer-gen/generators" - "k8s.io/code-generator/pkg/util" - "k8s.io/gengo/args" - "k8s.io/klog" - - generatorargs "k8s.io/code-generator/cmd/informer-gen/args" -) - -func main() { - klog.InitFlags(nil) - genericArgs, customArgs := generatorargs.NewDefaults() - - // Override defaults. - // TODO: move out of informer-gen - genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) - genericArgs.OutputPackagePath = "k8s.io/kubernetes/pkg/client/informers/informers_generated" - customArgs.VersionedClientSetPackage = "k8s.io/kubernetes/pkg/client/clientset_generated/clientset" - customArgs.InternalClientSetPackage = "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" - customArgs.ListersPackage = "k8s.io/kubernetes/pkg/client/listers" - - genericArgs.AddFlags(pflag.CommandLine) - customArgs.AddFlags(pflag.CommandLine) - flag.Set("logtostderr", "true") - pflag.CommandLine.AddGoFlagSet(flag.CommandLine) - pflag.Parse() - - if err := generatorargs.Validate(genericArgs); err != nil { - klog.Fatalf("Error: %v", err) - } - - // Run it. - if err := genericArgs.Execute( - generators.NameSystems(), - generators.DefaultNameSystem(), - generators.Packages, - ); err != nil { - klog.Fatalf("Error: %v", err) - } - klog.V(2).Info("Completed successfully.") -} diff --git a/vendor/k8s.io/code-generator/cmd/lister-gen/.import-restrictions b/vendor/k8s.io/code-generator/cmd/lister-gen/.import-restrictions deleted file mode 100644 index 0967ef4..0000000 --- a/vendor/k8s.io/code-generator/cmd/lister-gen/.import-restrictions +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/vendor/k8s.io/code-generator/cmd/lister-gen/args/args.go b/vendor/k8s.io/code-generator/cmd/lister-gen/args/args.go deleted file mode 100644 index 34914ea..0000000 --- a/vendor/k8s.io/code-generator/cmd/lister-gen/args/args.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package args - -import ( - "fmt" - "path" - - "github.com/spf13/pflag" - codegenutil "k8s.io/code-generator/pkg/util" - "k8s.io/gengo/args" -) - -// CustomArgs is used by the gengo framework to pass args specific to this generator. -type CustomArgs struct{} - -// NewDefaults returns default arguments for the generator. -func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { - genericArgs := args.Default().WithoutDefaultFlagParsing() - customArgs := &CustomArgs{} - genericArgs.CustomArgs = customArgs - - if pkg := codegenutil.CurrentPackage(); len(pkg) != 0 { - genericArgs.OutputPackagePath = path.Join(pkg, "pkg/client/listers") - } - - return genericArgs, customArgs -} - -// AddFlags add the generator flags to the flag set. -func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) {} - -// Validate checks the given arguments. -func Validate(genericArgs *args.GeneratorArgs) error { - _ = genericArgs.CustomArgs.(*CustomArgs) - - if len(genericArgs.OutputPackagePath) == 0 { - return fmt.Errorf("output package cannot be empty") - } - - return nil -} diff --git a/vendor/k8s.io/code-generator/cmd/lister-gen/generators/expansion.go b/vendor/k8s.io/code-generator/cmd/lister-gen/generators/expansion.go deleted file mode 100644 index dd45d77..0000000 --- a/vendor/k8s.io/code-generator/cmd/lister-gen/generators/expansion.go +++ /dev/null @@ -1,67 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generators - -import ( - "io" - "os" - "path/filepath" - "strings" - - "k8s.io/gengo/generator" - "k8s.io/gengo/types" - - "k8s.io/code-generator/cmd/client-gen/generators/util" -) - -// expansionGenerator produces a file for a expansion interfaces. -type expansionGenerator struct { - generator.DefaultGen - packagePath string - types []*types.Type -} - -// We only want to call GenerateType() once per group. -func (g *expansionGenerator) Filter(c *generator.Context, t *types.Type) bool { - return t == g.types[0] -} - -func (g *expansionGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - for _, t := range g.types { - tags := util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) - if _, err := os.Stat(filepath.Join(g.packagePath, strings.ToLower(t.Name.Name+"_expansion.go"))); os.IsNotExist(err) { - sw.Do(expansionInterfaceTemplate, t) - if !tags.NonNamespaced { - sw.Do(namespacedExpansionInterfaceTemplate, t) - } - } - } - return sw.Error() -} - -var expansionInterfaceTemplate = ` -// $.|public$ListerExpansion allows custom methods to be added to -// $.|public$Lister. -type $.|public$ListerExpansion interface {} -` - -var namespacedExpansionInterfaceTemplate = ` -// $.|public$NamespaceListerExpansion allows custom methods to be added to -// $.|public$NamespaceLister. -type $.|public$NamespaceListerExpansion interface {} -` diff --git a/vendor/k8s.io/code-generator/cmd/lister-gen/generators/lister.go b/vendor/k8s.io/code-generator/cmd/lister-gen/generators/lister.go deleted file mode 100644 index c8ed5ad..0000000 --- a/vendor/k8s.io/code-generator/cmd/lister-gen/generators/lister.go +++ /dev/null @@ -1,371 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generators - -import ( - "fmt" - "io" - "path/filepath" - "strings" - - "k8s.io/gengo/args" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/code-generator/cmd/client-gen/generators/util" - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - - "k8s.io/klog" -) - -// NameSystems returns the name system used by the generators in this package. -func NameSystems() namer.NameSystems { - pluralExceptions := map[string]string{ - "Endpoints": "Endpoints", - } - return namer.NameSystems{ - "public": namer.NewPublicNamer(0), - "private": namer.NewPrivateNamer(0), - "raw": namer.NewRawNamer("", nil), - "publicPlural": namer.NewPublicPluralNamer(pluralExceptions), - "allLowercasePlural": namer.NewAllLowercasePluralNamer(pluralExceptions), - "lowercaseSingular": &lowercaseSingularNamer{}, - } -} - -// lowercaseSingularNamer implements Namer -type lowercaseSingularNamer struct{} - -// Name returns t's name in all lowercase. -func (n *lowercaseSingularNamer) Name(t *types.Type) string { - return strings.ToLower(t.Name.Name) -} - -// DefaultNameSystem returns the default name system for ordering the types to be -// processed by the generators in this package. -func DefaultNameSystem() string { - return "public" -} - -// Packages makes the client package definition. -func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { - boilerplate, err := arguments.LoadGoBoilerplate() - if err != nil { - klog.Fatalf("Failed loading boilerplate: %v", err) - } - - var packageList generator.Packages - for _, inputDir := range arguments.InputDirs { - p := context.Universe.Package(inputDir) - - objectMeta, internal, err := objectMetaForPackage(p) - if err != nil { - klog.Fatal(err) - } - if objectMeta == nil { - // no types in this package had genclient - continue - } - - var gv clientgentypes.GroupVersion - var internalGVPkg string - - if internal { - lastSlash := strings.LastIndex(p.Path, "/") - if lastSlash == -1 { - klog.Fatalf("error constructing internal group version for package %q", p.Path) - } - gv.Group = clientgentypes.Group(p.Path[lastSlash+1:]) - internalGVPkg = p.Path - } else { - parts := strings.Split(p.Path, "/") - gv.Group = clientgentypes.Group(parts[len(parts)-2]) - gv.Version = clientgentypes.Version(parts[len(parts)-1]) - - internalGVPkg = strings.Join(parts[0:len(parts)-1], "/") - } - groupPackageName := strings.ToLower(gv.Group.NonEmpty()) - - // If there's a comment of the form "// +groupName=somegroup" or - // "// +groupName=somegroup.foo.bar.io", use the first field (somegroup) as the name of the - // group when generating. - if override := types.ExtractCommentTags("+", p.Comments)["groupName"]; override != nil { - gv.Group = clientgentypes.Group(strings.SplitN(override[0], ".", 2)[0]) - } - - var typesToGenerate []*types.Type - for _, t := range p.Types { - tags := util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) - if !tags.GenerateClient || !tags.HasVerb("list") || !tags.HasVerb("get") { - continue - } - typesToGenerate = append(typesToGenerate, t) - } - if len(typesToGenerate) == 0 { - continue - } - orderer := namer.Orderer{Namer: namer.NewPrivateNamer(0)} - typesToGenerate = orderer.OrderTypes(typesToGenerate) - - packagePath := filepath.Join(arguments.OutputPackagePath, groupPackageName, strings.ToLower(gv.Version.NonEmpty())) - packageList = append(packageList, &generator.DefaultPackage{ - PackageName: strings.ToLower(gv.Version.NonEmpty()), - PackagePath: packagePath, - HeaderText: boilerplate, - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - generators = append(generators, &expansionGenerator{ - DefaultGen: generator.DefaultGen{ - OptionalName: "expansion_generated", - }, - packagePath: filepath.Join(arguments.OutputBase, packagePath), - types: typesToGenerate, - }) - - for _, t := range typesToGenerate { - generators = append(generators, &listerGenerator{ - DefaultGen: generator.DefaultGen{ - OptionalName: strings.ToLower(t.Name.Name), - }, - outputPackage: arguments.OutputPackagePath, - groupVersion: gv, - internalGVPkg: internalGVPkg, - typeToGenerate: t, - imports: generator.NewImportTracker(), - objectMeta: objectMeta, - }) - } - return generators - }, - FilterFunc: func(c *generator.Context, t *types.Type) bool { - tags := util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) - return tags.GenerateClient && tags.HasVerb("list") && tags.HasVerb("get") - }, - }) - } - - return packageList -} - -// objectMetaForPackage returns the type of ObjectMeta used by package p. -func objectMetaForPackage(p *types.Package) (*types.Type, bool, error) { - generatingForPackage := false - for _, t := range p.Types { - // filter out types which dont have genclient. - if !util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)).GenerateClient { - continue - } - generatingForPackage = true - for _, member := range t.Members { - if member.Name == "ObjectMeta" { - return member.Type, isInternal(member), nil - } - } - } - if generatingForPackage { - return nil, false, fmt.Errorf("unable to find ObjectMeta for any types in package %s", p.Path) - } - return nil, false, nil -} - -// isInternal returns true if the tags for a member do not contain a json tag -func isInternal(m types.Member) bool { - return !strings.Contains(m.Tags, "json") -} - -// listerGenerator produces a file of listers for a given GroupVersion and -// type. -type listerGenerator struct { - generator.DefaultGen - outputPackage string - groupVersion clientgentypes.GroupVersion - internalGVPkg string - typeToGenerate *types.Type - imports namer.ImportTracker - objectMeta *types.Type -} - -var _ generator.Generator = &listerGenerator{} - -func (g *listerGenerator) Filter(c *generator.Context, t *types.Type) bool { - return t == g.typeToGenerate -} - -func (g *listerGenerator) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *listerGenerator) Imports(c *generator.Context) (imports []string) { - imports = append(imports, g.imports.ImportLines()...) - imports = append(imports, "k8s.io/apimachinery/pkg/api/errors") - imports = append(imports, "k8s.io/apimachinery/pkg/labels") - // for Indexer - imports = append(imports, "k8s.io/client-go/tools/cache") - return -} - -func (g *listerGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - - klog.V(5).Infof("processing type %v", t) - m := map[string]interface{}{ - "Resource": c.Universe.Function(types.Name{Package: t.Name.Package, Name: "Resource"}), - "type": t, - "objectMeta": g.objectMeta, - } - - tags, err := util.ParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) - if err != nil { - return err - } - - if tags.NonNamespaced { - sw.Do(typeListerInterface_NonNamespaced, m) - } else { - sw.Do(typeListerInterface, m) - } - - sw.Do(typeListerStruct, m) - sw.Do(typeListerConstructor, m) - sw.Do(typeLister_List, m) - - if tags.NonNamespaced { - sw.Do(typeLister_NonNamespacedGet, m) - return sw.Error() - } - - sw.Do(typeLister_NamespaceLister, m) - sw.Do(namespaceListerInterface, m) - sw.Do(namespaceListerStruct, m) - sw.Do(namespaceLister_List, m) - sw.Do(namespaceLister_Get, m) - - return sw.Error() -} - -var typeListerInterface = ` -// $.type|public$Lister helps list $.type|publicPlural$. -type $.type|public$Lister interface { - // List lists all $.type|publicPlural$ in the indexer. - List(selector labels.Selector) (ret []*$.type|raw$, err error) - // $.type|publicPlural$ returns an object that can list and get $.type|publicPlural$. - $.type|publicPlural$(namespace string) $.type|public$NamespaceLister - $.type|public$ListerExpansion -} -` - -var typeListerInterface_NonNamespaced = ` -// $.type|public$Lister helps list $.type|publicPlural$. -type $.type|public$Lister interface { - // List lists all $.type|publicPlural$ in the indexer. - List(selector labels.Selector) (ret []*$.type|raw$, err error) - // Get retrieves the $.type|public$ from the index for a given name. - Get(name string) (*$.type|raw$, error) - $.type|public$ListerExpansion -} -` - -var typeListerStruct = ` -// $.type|private$Lister implements the $.type|public$Lister interface. -type $.type|private$Lister struct { - indexer cache.Indexer -} -` - -var typeListerConstructor = ` -// New$.type|public$Lister returns a new $.type|public$Lister. -func New$.type|public$Lister(indexer cache.Indexer) $.type|public$Lister { - return &$.type|private$Lister{indexer: indexer} -} -` - -var typeLister_List = ` -// List lists all $.type|publicPlural$ in the indexer. -func (s *$.type|private$Lister) List(selector labels.Selector) (ret []*$.type|raw$, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*$.type|raw$)) - }) - return ret, err -} -` - -var typeLister_NamespaceLister = ` -// $.type|publicPlural$ returns an object that can list and get $.type|publicPlural$. -func (s *$.type|private$Lister) $.type|publicPlural$(namespace string) $.type|public$NamespaceLister { - return $.type|private$NamespaceLister{indexer: s.indexer, namespace: namespace} -} -` - -var typeLister_NonNamespacedGet = ` -// Get retrieves the $.type|public$ from the index for a given name. -func (s *$.type|private$Lister) Get(name string) (*$.type|raw$, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound($.Resource|raw$("$.type|lowercaseSingular$"), name) - } - return obj.(*$.type|raw$), nil -} -` - -var namespaceListerInterface = ` -// $.type|public$NamespaceLister helps list and get $.type|publicPlural$. -type $.type|public$NamespaceLister interface { - // List lists all $.type|publicPlural$ in the indexer for a given namespace. - List(selector labels.Selector) (ret []*$.type|raw$, err error) - // Get retrieves the $.type|public$ from the indexer for a given namespace and name. - Get(name string) (*$.type|raw$, error) - $.type|public$NamespaceListerExpansion -} -` - -var namespaceListerStruct = ` -// $.type|private$NamespaceLister implements the $.type|public$NamespaceLister -// interface. -type $.type|private$NamespaceLister struct { - indexer cache.Indexer - namespace string -} -` - -var namespaceLister_List = ` -// List lists all $.type|publicPlural$ in the indexer for a given namespace. -func (s $.type|private$NamespaceLister) List(selector labels.Selector) (ret []*$.type|raw$, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*$.type|raw$)) - }) - return ret, err -} -` - -var namespaceLister_Get = ` -// Get retrieves the $.type|public$ from the indexer for a given namespace and name. -func (s $.type|private$NamespaceLister) Get(name string) (*$.type|raw$, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound($.Resource|raw$("$.type|lowercaseSingular$"), name) - } - return obj.(*$.type|raw$), nil -} -` diff --git a/vendor/k8s.io/code-generator/cmd/lister-gen/main.go b/vendor/k8s.io/code-generator/cmd/lister-gen/main.go deleted file mode 100644 index aca16b2..0000000 --- a/vendor/k8s.io/code-generator/cmd/lister-gen/main.go +++ /dev/null @@ -1,60 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package main - -import ( - "flag" - "path/filepath" - - "github.com/spf13/pflag" - "k8s.io/code-generator/cmd/lister-gen/generators" - "k8s.io/code-generator/pkg/util" - "k8s.io/gengo/args" - "k8s.io/klog" - - generatorargs "k8s.io/code-generator/cmd/lister-gen/args" -) - -func main() { - klog.InitFlags(nil) - genericArgs, customArgs := generatorargs.NewDefaults() - - // Override defaults. - // TODO: move this out of lister-gen - genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) - genericArgs.OutputPackagePath = "k8s.io/kubernetes/pkg/client/listers" - - genericArgs.AddFlags(pflag.CommandLine) - customArgs.AddFlags(pflag.CommandLine) - flag.Set("logtostderr", "true") - pflag.CommandLine.AddGoFlagSet(flag.CommandLine) - pflag.Parse() - - if err := generatorargs.Validate(genericArgs); err != nil { - klog.Fatalf("Error: %v", err) - } - - // Run it. - if err := genericArgs.Execute( - generators.NameSystems(), - generators.DefaultNameSystem(), - generators.Packages, - ); err != nil { - klog.Fatalf("Error: %v", err) - } - klog.V(2).Info("Completed successfully.") -} diff --git a/vendor/k8s.io/code-generator/cmd/openapi-gen/main.go b/vendor/k8s.io/code-generator/cmd/openapi-gen/main.go deleted file mode 100644 index b1098c0..0000000 --- a/vendor/k8s.io/code-generator/cmd/openapi-gen/main.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This package generates openAPI definition file to be used in open API spec generation on API servers. To generate -// definition for a specific type or package add "+k8s:openapi-gen=true" tag to the type/package comment lines. To -// exclude a type from a tagged package, add "+k8s:openapi-gen=false" tag to the type comment lines. - -package main - -import ( - "flag" - "log" - - generatorargs "k8s.io/kube-openapi/cmd/openapi-gen/args" - "k8s.io/kube-openapi/pkg/generators" - - "github.com/spf13/pflag" - - "k8s.io/klog" -) - -func main() { - klog.InitFlags(nil) - genericArgs, customArgs := generatorargs.NewDefaults() - - genericArgs.AddFlags(pflag.CommandLine) - customArgs.AddFlags(pflag.CommandLine) - flag.Set("logtostderr", "true") - pflag.CommandLine.AddGoFlagSet(flag.CommandLine) - pflag.Parse() - - if err := generatorargs.Validate(genericArgs); err != nil { - log.Fatalf("Arguments validation error: %v", err) - } - - // Generates the code for the OpenAPIDefinitions. - if err := genericArgs.Execute( - generators.NameSystems(), - generators.DefaultNameSystem(), - generators.Packages, - ); err != nil { - log.Fatalf("OpenAPI code generation error: %v", err) - } -} diff --git a/vendor/k8s.io/code-generator/cmd/register-gen/args/args.go b/vendor/k8s.io/code-generator/cmd/register-gen/args/args.go deleted file mode 100644 index 2e3ab08..0000000 --- a/vendor/k8s.io/code-generator/cmd/register-gen/args/args.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package args - -import ( - "fmt" - - "k8s.io/gengo/args" -) - -// NewDefaults returns default arguments for the generator. -func NewDefaults() *args.GeneratorArgs { - genericArgs := args.Default().WithoutDefaultFlagParsing() - genericArgs.OutputFileBaseName = "zz_generated.register" - return genericArgs -} - -// Validate checks the given arguments. -func Validate(genericArgs *args.GeneratorArgs) error { - if len(genericArgs.OutputFileBaseName) == 0 { - return fmt.Errorf("output file base name cannot be empty") - } - - return nil -} diff --git a/vendor/k8s.io/code-generator/cmd/register-gen/generators/packages.go b/vendor/k8s.io/code-generator/cmd/register-gen/generators/packages.go deleted file mode 100644 index 5186e42..0000000 --- a/vendor/k8s.io/code-generator/cmd/register-gen/generators/packages.go +++ /dev/null @@ -1,137 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generators - -import ( - "fmt" - "os" - "path" - "strings" - - "k8s.io/klog" - - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - "k8s.io/gengo/args" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -// NameSystems returns the name system used by the generators in this package. -func NameSystems() namer.NameSystems { - return namer.NameSystems{} -} - -// DefaultNameSystem returns the default name system for ordering the types to be -// processed by the generators in this package. -func DefaultNameSystem() string { - return "public" -} - -// Packages makes packages to generate. -func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { - boilerplate, err := arguments.LoadGoBoilerplate() - if err != nil { - klog.Fatalf("Failed loading boilerplate: %v", err) - } - - packages := generator.Packages{} - for _, inputDir := range arguments.InputDirs { - pkg := context.Universe.Package(inputDir) - internal, err := isInternal(pkg) - if err != nil { - klog.V(5).Infof("skipping the generation of %s file, due to err %v", arguments.OutputFileBaseName, err) - continue - } - if internal { - klog.V(5).Infof("skipping the generation of %s file because %s package contains internal types, note that internal types don't have \"json\" tags", arguments.OutputFileBaseName, pkg.Name) - continue - } - registerFileName := "register.go" - searchPath := path.Join(args.DefaultSourceTree(), inputDir, registerFileName) - if _, err := os.Stat(path.Join(searchPath)); err == nil { - klog.V(5).Infof("skipping the generation of %s file because %s already exists in the path %s", arguments.OutputFileBaseName, registerFileName, searchPath) - continue - } else if err != nil && !os.IsNotExist(err) { - klog.Fatalf("an error %v has occurred while checking if %s exists", err, registerFileName) - } - - gv := clientgentypes.GroupVersion{} - { - pathParts := strings.Split(pkg.Path, "/") - if len(pathParts) < 2 { - klog.Errorf("the path of the package must contain the group name and the version, path = %s", pkg.Path) - continue - } - gv.Group = clientgentypes.Group(pathParts[len(pathParts)-2]) - gv.Version = clientgentypes.Version(pathParts[len(pathParts)-1]) - - // if there is a comment of the form "// +groupName=somegroup" or "// +groupName=somegroup.foo.bar.io", - // extract the fully qualified API group name from it and overwrite the group inferred from the package path - if override := types.ExtractCommentTags("+", pkg.DocComments)["groupName"]; override != nil { - groupName := override[0] - klog.V(5).Infof("overriding the group name with = %s", groupName) - gv.Group = clientgentypes.Group(groupName) - } - } - - typesToRegister := []*types.Type{} - for _, t := range pkg.Types { - klog.V(5).Infof("considering type = %s", t.Name.String()) - for _, typeMember := range t.Members { - if typeMember.Name == "TypeMeta" && typeMember.Embedded == true { - typesToRegister = append(typesToRegister, t) - } - } - } - - packages = append(packages, - &generator.DefaultPackage{ - PackageName: pkg.Name, - PackagePath: pkg.Path, - HeaderText: boilerplate, - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - return []generator.Generator{ - ®isterExternalGenerator{ - DefaultGen: generator.DefaultGen{ - OptionalName: arguments.OutputFileBaseName, - }, - gv: gv, - typesToGenerate: typesToRegister, - outputPackage: pkg.Path, - imports: generator.NewImportTracker(), - }, - } - }, - }) - } - - return packages -} - -// isInternal determines whether the given package -// contains the internal types or not -func isInternal(p *types.Package) (bool, error) { - for _, t := range p.Types { - for _, member := range t.Members { - if member.Name == "TypeMeta" { - return !strings.Contains(member.Tags, "json"), nil - } - } - } - return false, fmt.Errorf("unable to find TypeMeta for any types in package %s", p.Path) -} diff --git a/vendor/k8s.io/code-generator/cmd/register-gen/generators/register_external.go b/vendor/k8s.io/code-generator/cmd/register-gen/generators/register_external.go deleted file mode 100644 index c831c57..0000000 --- a/vendor/k8s.io/code-generator/cmd/register-gen/generators/register_external.go +++ /dev/null @@ -1,117 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generators - -import ( - "io" - "sort" - - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -type registerExternalGenerator struct { - generator.DefaultGen - outputPackage string - gv clientgentypes.GroupVersion - typesToGenerate []*types.Type - imports namer.ImportTracker -} - -var _ generator.Generator = ®isterExternalGenerator{} - -func (g *registerExternalGenerator) Filter(_ *generator.Context, _ *types.Type) bool { - return false -} - -func (g *registerExternalGenerator) Imports(c *generator.Context) (imports []string) { - return g.imports.ImportLines() -} - -func (g *registerExternalGenerator) Namers(_ *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *registerExternalGenerator) Finalize(context *generator.Context, w io.Writer) error { - typesToGenerateOnlyNames := make([]string, len(g.typesToGenerate)) - for index, typeToGenerate := range g.typesToGenerate { - typesToGenerateOnlyNames[index] = typeToGenerate.Name.Name - } - - // sort the list of types to register, so that the generator produces stable output - sort.Strings(typesToGenerateOnlyNames) - - sw := generator.NewSnippetWriter(w, context, "$", "$") - m := map[string]interface{}{ - "groupName": g.gv.Group, - "version": g.gv.Version, - "types": typesToGenerateOnlyNames, - "addToGroupVersion": context.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "AddToGroupVersion"}), - "groupVersion": context.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "GroupVersion"}), - } - sw.Do(registerExternalTypesTemplate, m) - return sw.Error() -} - -var registerExternalTypesTemplate = ` -// GroupName specifies the group name used to register the objects. -const GroupName = "$.groupName$" - -// GroupVersion specifies the group and the version used to register the objects. -var GroupVersion = $.groupVersion|raw${Group: GroupName, Version: "$.version$"} - -// SchemeGroupVersion is group version used to register these objects -// Deprecated: use GroupVersion instead. -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "$.version$"} - -// Resource takes an unqualified resource and returns a Group qualified GroupResource -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. - SchemeBuilder runtime.SchemeBuilder - localSchemeBuilder = &SchemeBuilder - // Depreciated: use Install instead - AddToScheme = localSchemeBuilder.AddToScheme - Install = localSchemeBuilder.AddToScheme -) - -func init() { - // We only register manually written functions here. The registration of the - // generated functions takes place in the generated files. The separation - // makes the code compile even when the generated files are missing. - localSchemeBuilder.Register(addKnownTypes) -} - -// Adds the list of known types to Scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - $range .types -$ - &$.${}, - $end$ - ) - // AddToGroupVersion allows the serialization of client types like ListOptions. - $.addToGroupVersion|raw$(scheme, SchemeGroupVersion) - return nil -} -` diff --git a/vendor/k8s.io/code-generator/cmd/register-gen/main.go b/vendor/k8s.io/code-generator/cmd/register-gen/main.go deleted file mode 100644 index 30a175d..0000000 --- a/vendor/k8s.io/code-generator/cmd/register-gen/main.go +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package main - -import ( - "flag" - "path/filepath" - - "github.com/spf13/pflag" - "k8s.io/klog" - - generatorargs "k8s.io/code-generator/cmd/register-gen/args" - "k8s.io/code-generator/cmd/register-gen/generators" - "k8s.io/code-generator/pkg/util" - "k8s.io/gengo/args" -) - -func main() { - klog.InitFlags(nil) - genericArgs := generatorargs.NewDefaults() - genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) - genericArgs.AddFlags(pflag.CommandLine) - flag.Set("logtostderr", "true") - pflag.CommandLine.AddGoFlagSet(flag.CommandLine) - - pflag.Parse() - if err := generatorargs.Validate(genericArgs); err != nil { - klog.Fatalf("Error: %v", err) - } - - if err := genericArgs.Execute( - generators.NameSystems(), - generators.DefaultNameSystem(), - generators.Packages, - ); err != nil { - klog.Fatalf("Error: %v", err) - } - klog.V(2).Info("Completed successfully.") -} diff --git a/vendor/k8s.io/code-generator/cmd/set-gen/.gitignore b/vendor/k8s.io/code-generator/cmd/set-gen/.gitignore deleted file mode 100644 index ffe6458..0000000 --- a/vendor/k8s.io/code-generator/cmd/set-gen/.gitignore +++ /dev/null @@ -1 +0,0 @@ -set-gen diff --git a/vendor/k8s.io/code-generator/cmd/set-gen/main.go b/vendor/k8s.io/code-generator/cmd/set-gen/main.go deleted file mode 100644 index 45694d4..0000000 --- a/vendor/k8s.io/code-generator/cmd/set-gen/main.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// set-gen is an example usage of gengo. -// -// Structs in the input directories with the below line in their comments will -// have sets generated for them. -// // +genset -// -// Any builtin type referenced anywhere in the input directories will have a -// set generated for it. -package main - -import ( - "os" - "path/filepath" - - "k8s.io/code-generator/pkg/util" - "k8s.io/gengo/args" - "k8s.io/gengo/examples/set-gen/generators" - - "k8s.io/klog" -) - -func main() { - klog.InitFlags(nil) - arguments := args.Default() - - // Override defaults. - arguments.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) - arguments.InputDirs = []string{"k8s.io/kubernetes/pkg/util/sets/types"} - arguments.OutputPackagePath = "k8s.io/apimachinery/pkg/util/sets" - - if err := arguments.Execute( - generators.NameSystems(), - generators.DefaultNameSystem(), - generators.Packages, - ); err != nil { - klog.Errorf("Error: %v", err) - os.Exit(1) - } - klog.V(2).Info("Completed successfully.") -} diff --git a/vendor/k8s.io/code-generator/code-of-conduct.md b/vendor/k8s.io/code-generator/code-of-conduct.md deleted file mode 100644 index 0d15c00..0000000 --- a/vendor/k8s.io/code-generator/code-of-conduct.md +++ /dev/null @@ -1,3 +0,0 @@ -# Kubernetes Community Code of Conduct - -Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md) diff --git a/vendor/k8s.io/code-generator/generate-groups.sh b/vendor/k8s.io/code-generator/generate-groups.sh deleted file mode 100755 index 70eaa01..0000000 --- a/vendor/k8s.io/code-generator/generate-groups.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2017 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -o errexit -set -o nounset -set -o pipefail -set -x - -# generate-groups generates everything for a project with external types only, e.g. a project based -# on CustomResourceDefinitions. - -if [ "$#" -lt 4 ] || [ "${1}" == "--help" ]; then - cat < ... - the generators comma separated to run (deepcopy,defaulter,client,lister,informer) or "all". - the output package name (e.g. github.com/example/project/pkg/generated). - the external types dir (e.g. github.com/example/api or github.com/example/project/pkg/apis). - the groups and their versions in the format "groupA:v1,v2 groupB:v1 groupC:v2", relative - to . - ... arbitrary flags passed to all generator binaries. -Examples: - $(basename $0) all github.com/example/project/pkg/client github.com/example/project/pkg/apis "foo:v1 bar:v1alpha1,v1beta1" - $(basename $0) deepcopy,client github.com/example/project/pkg/client github.com/example/project/pkg/apis "foo:v1 bar:v1alpha1,v1beta1" -EOF - exit 0 -fi - -GENS="$1" -OUTPUT_PKG="$2" -APIS_PKG="$3" -GROUPS_WITH_VERSIONS="$4" -shift 4 - -go install ./$(dirname "${0}")/cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen} -function codegen::join() { local IFS="$1"; shift; echo "$*"; } - -# enumerate group versions -FQ_APIS=() # e.g. k8s.io/api/apps/v1 -for GVs in ${GROUPS_WITH_VERSIONS}; do - IFS=: read G Vs <<<"${GVs}" - - # enumerate versions - for V in ${Vs//,/ }; do - FQ_APIS+=(${APIS_PKG}/${G}/${V}) - done -done - -if [ "${GENS}" = "all" ] || grep -qw "deepcopy" <<<"${GENS}"; then - echo "Generating deepcopy funcs" - ${GOPATH}/bin/deepcopy-gen --input-dirs $(codegen::join , "${FQ_APIS[@]}") -O zz_generated.deepcopy --bounding-dirs ${APIS_PKG} "$@" -fi - -if [ "${GENS}" = "all" ] || grep -qw "defaulter" <<<"${GENS}"; then - echo "Generating defaulters" - "${GOPATH}/bin/defaulter-gen" --input-dirs "$(codegen::join , "${EXT_FQ_APIS[@]}")" -O zz_generated.defaults "$@" -fi - -if [ "${GENS}" = "all" ] || grep -qw "client" <<<"${GENS}"; then - echo "Generating clientset for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/clientset" - ${GOPATH}/bin/client-gen --clientset-name versioned --input-base "" --input $(codegen::join , "${FQ_APIS[@]}") --clientset-path ${OUTPUT_PKG}/clientset "$@" -fi - -if [ "${GENS}" = "all" ] || grep -qw "lister" <<<"${GENS}"; then - echo "Generating listers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/listers" - ${GOPATH}/bin/lister-gen --input-dirs $(codegen::join , "${FQ_APIS[@]}") --output-package ${OUTPUT_PKG}/listers "$@" -fi - -if [ "${GENS}" = "all" ] || grep -qw "informer" <<<"${GENS}"; then - echo "Generating informers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/informers" - ${GOPATH}/bin/informer-gen \ - --input-dirs $(codegen::join , "${FQ_APIS[@]}") \ - --versioned-clientset-package ${OUTPUT_PKG}/clientset/versioned \ - --listers-package ${OUTPUT_PKG}/listers \ - --output-package ${OUTPUT_PKG}/informers \ - "$@" -fi diff --git a/vendor/k8s.io/code-generator/generate-internal-groups.sh b/vendor/k8s.io/code-generator/generate-internal-groups.sh deleted file mode 100755 index 8c31d93..0000000 --- a/vendor/k8s.io/code-generator/generate-internal-groups.sh +++ /dev/null @@ -1,122 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2017 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -o errexit -set -o nounset -set -o pipefail - -# generate-internal-groups generates everything for a project with internal types, e.g. an -# user-provided API server based on k8s.io/apiserver. - -if [ "$#" -lt 5 ] || [ "${1}" == "--help" ]; then - cat < ... - - the generators comma separated to run (deepcopy,defaulter,conversion,client,lister,informer,openapi) or "all". - the output package name (e.g. github.com/example/project/pkg/generated). - the internal types dir (e.g. github.com/example/project/pkg/apis). - the external types dir (e.g. github.com/example/project/pkg/apis or githubcom/example/apis). - the groups and their versions in the format "groupA:v1,v2 groupB:v1 groupC:v2", relative - to . - ... arbitrary flags passed to all generator binaries. - -Examples: - $(basename "$0") all github.com/example/project/pkg/client github.com/example/project/pkg/apis github.com/example/project/pkg/apis "foo:v1 bar:v1alpha1,v1beta1" - $(basename "$0") deepcopy,defaulter,conversion github.com/example/project/pkg/client github.com/example/project/pkg/apis github.com/example/project/apis "foo:v1 bar:v1alpha1,v1beta1" -EOF - exit 0 -fi - -GENS="$1" -OUTPUT_PKG="$2" -INT_APIS_PKG="$3" -EXT_APIS_PKG="$4" -GROUPS_WITH_VERSIONS="$5" -shift 5 - -go install ./"$(dirname "${0}")"/cmd/{defaulter-gen,conversion-gen,client-gen,lister-gen,informer-gen,deepcopy-gen,openapi-gen} - -function codegen::join() { local IFS="$1"; shift; echo "$*"; } - -# enumerate group versions -ALL_FQ_APIS=() # e.g. k8s.io/kubernetes/pkg/apis/apps k8s.io/api/apps/v1 -INT_FQ_APIS=() # e.g. k8s.io/kubernetes/pkg/apis/apps -EXT_FQ_APIS=() # e.g. k8s.io/api/apps/v1 -for GVs in ${GROUPS_WITH_VERSIONS}; do - IFS=: read -r G Vs <<<"${GVs}" - - if [ -n "${INT_APIS_PKG}" ]; then - ALL_FQ_APIS+=("${INT_APIS_PKG}/${G}") - INT_FQ_APIS+=("${INT_APIS_PKG}/${G}") - fi - - # enumerate versions - for V in ${Vs//,/ }; do - ALL_FQ_APIS+=("${EXT_APIS_PKG}/${G}/${V}") - EXT_FQ_APIS+=("${EXT_APIS_PKG}/${G}/${V}") - done -done - -if [ "${GENS}" = "all" ] || grep -qw "deepcopy" <<<"${GENS}"; then - echo "Generating deepcopy funcs" - "${GOPATH}/bin/deepcopy-gen" --input-dirs "$(codegen::join , "${ALL_FQ_APIS[@]}")" -O zz_generated.deepcopy --bounding-dirs "${INT_APIS_PKG},${EXT_APIS_PKG}" "$@" -fi - -if [ "${GENS}" = "all" ] || grep -qw "defaulter" <<<"${GENS}"; then - echo "Generating defaulters" - "${GOPATH}/bin/defaulter-gen" --input-dirs "$(codegen::join , "${EXT_FQ_APIS[@]}")" -O zz_generated.defaults "$@" -fi - -if [ "${GENS}" = "all" ] || grep -qw "conversion" <<<"${GENS}"; then - echo "Generating conversions" - "${GOPATH}/bin/conversion-gen" --input-dirs "$(codegen::join , "${ALL_FQ_APIS[@]}")" -O zz_generated.conversion "$@" -fi - -if [ "${GENS}" = "all" ] || grep -qw "client" <<<"${GENS}"; then - echo "Generating clientset for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" - if [ -n "${INT_APIS_PKG}" ]; then - IFS=" " read -r -a APIS <<< "$(printf '%s/ ' "${INT_FQ_APIS[@]}")" - "${GOPATH}/bin/client-gen" --clientset-name "${CLIENTSET_NAME_INTERNAL:-internalversion}" --input-base "" --input "$(codegen::join , "${APIS[@]}")" --output-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" "$@" - fi - "${GOPATH}/bin/client-gen" --clientset-name "${CLIENTSET_NAME_VERSIONED:-versioned}" --input-base "" --input "$(codegen::join , "${EXT_FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" "$@" -fi - -if [ "${GENS}" = "all" ] || grep -qw "lister" <<<"${GENS}"; then - echo "Generating listers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/listers" - "${GOPATH}/bin/lister-gen" --input-dirs "$(codegen::join , "${ALL_FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}/listers" "$@" -fi - -if [ "${GENS}" = "all" ] || grep -qw "informer" <<<"${GENS}"; then - echo "Generating informers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/informers" - "${GOPATH}/bin/informer-gen" \ - --input-dirs "$(codegen::join , "${ALL_FQ_APIS[@]}")" \ - --versioned-clientset-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}/${CLIENTSET_NAME_VERSIONED:-versioned}" \ - --internal-clientset-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}/${CLIENTSET_NAME_INTERNAL:-internalversion}" \ - --listers-package "${OUTPUT_PKG}/listers" \ - --output-package "${OUTPUT_PKG}/informers" \ - "$@" -fi - -if [ "${GENS}" = "all" ] || grep -qw "openapi" <<<"${GENS}"; then - echo "Generating OpenAPI definitions for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/openapi" - declare -a OPENAPI_EXTRA_PACKAGES - "${GOPATH}/bin/openapi-gen" \ - --input-dirs "$(codegen::join , "${EXT_FQ_APIS[@]}" "${OPENAPI_EXTRA_PACKAGES[@]}")" \ - --input-dirs "k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/runtime,k8s.io/apimachinery/pkg/version" \ - --output-package "${OUTPUT_PKG}/openapi" \ - -O zz_generated.openapi \ - "$@" -fi diff --git a/vendor/k8s.io/code-generator/go.mod b/vendor/k8s.io/code-generator/go.mod deleted file mode 100644 index 891f72e..0000000 --- a/vendor/k8s.io/code-generator/go.mod +++ /dev/null @@ -1,30 +0,0 @@ -// This is a generated file. Do not edit directly. - -module k8s.io/code-generator - -go 1.12 - -require ( - github.com/emicklei/go-restful v2.9.5+incompatible // indirect - github.com/go-openapi/jsonreference v0.19.3 // indirect - github.com/go-openapi/spec v0.19.3 // indirect - github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d - github.com/json-iterator/go v1.1.8 // indirect - github.com/mailru/easyjson v0.7.0 // indirect - github.com/modern-go/reflect2 v1.0.1 // indirect - github.com/spf13/pflag v1.0.5 - github.com/stretchr/testify v1.4.0 // indirect - golang.org/x/net v0.0.0-20191004110552-13f9640d40b9 // indirect - golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72 // indirect - gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485 - gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e // indirect - gopkg.in/yaml.v2 v2.2.8 // indirect - k8s.io/gengo v0.0.0-20190822140433-26a664648505 - k8s.io/klog v1.0.0 - k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a -) - -replace ( - golang.org/x/sys => golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a // pinned to release-branch.go1.13 - golang.org/x/tools => golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7 // pinned to release-branch.go1.13 -) diff --git a/vendor/k8s.io/code-generator/go.sum b/vendor/k8s.io/code-generator/go.sum deleted file mode 100644 index afc21aa..0000000 --- a/vendor/k8s.io/code-generator/go.sum +++ /dev/null @@ -1,134 +0,0 @@ -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= -github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= -github.com/go-openapi/jsonpointer v0.19.2 h1:A9+F4Dc/MCNB5jibxf6rRvOvR/iFgQdyNx9eIhnGqq0= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= -github.com/go-openapi/jsonreference v0.19.2 h1:o20suLFB4Ri0tuzpWtyHlh7E7HnkqTNLq6aR6WVNS1w= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= -github.com/go-openapi/spec v0.19.3 h1:0XRyw8kguri6Yw4SxhsQA/atC88yqrk0+G4YhI2wabc= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= -github.com/go-openapi/swag v0.19.2 h1:jvO6bCMBEilGwMfHhrd61zIID4oIFdwb76V17SM88dE= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= -github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM= -github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495 h1:I6A9Ag9FpEKOjcKrRNjQkPHawoXIhKyTGfvvjFAiiAk= -golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9 h1:rjwSpXsdiK0dV8/Naq3kAw9ymfAeJIyd0upUIElB+lI= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7 h1:PVCvyir09Xgta5zksNZDkrL+eSm/Y+gQxRG3IfqNQ3A= -golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485 h1:OB/uP/Puiu5vS5QMRPrXCDWUPb+kt8f1KW8oQzFejQw= -gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e h1:jRyg0XfpwWlhEV8mDfdNGBeSJM2fuyh9Yjrnd8kF2Ts= -gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6 h1:4s3/R4+OYYYUKptXPhZKjQ04WJ6EhQQVFdjOFvCazDk= -k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20190822140433-26a664648505 h1:ZY6yclUKVbZ+SdWnkfY+Je5vrMpKOxmGeKRbsXVmqYM= -k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= -k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= -k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= -k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= -modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= -modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= -modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= -modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= -sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/vendor/k8s.io/code-generator/pkg/namer/tag-override.go b/vendor/k8s.io/code-generator/pkg/namer/tag-override.go deleted file mode 100644 index fd8c3a8..0000000 --- a/vendor/k8s.io/code-generator/pkg/namer/tag-override.go +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package namer - -import ( - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -// TagOverrideNamer is a namer which pulls names from a given tag, if specified, -// and otherwise falls back to a different namer. -type TagOverrideNamer struct { - tagName string - fallback namer.Namer -} - -// Name returns the tag value if it exists. It no tag was found the fallback namer will be used -func (n *TagOverrideNamer) Name(t *types.Type) string { - if nameOverride := extractTag(n.tagName, append(t.SecondClosestCommentLines, t.CommentLines...)); nameOverride != "" { - return nameOverride - } - - return n.fallback.Name(t) -} - -// NewTagOverrideNamer creates a namer.Namer which uses the contents of the given tag as -// the name, or falls back to another Namer if the tag is not present. -func NewTagOverrideNamer(tagName string, fallback namer.Namer) namer.Namer { - return &TagOverrideNamer{ - tagName: tagName, - fallback: fallback, - } -} - -// extractTag gets the comment-tags for the key. If the tag did not exist, it -// returns the empty string. -func extractTag(key string, lines []string) string { - val, present := types.ExtractCommentTags("+", lines)[key] - if !present || len(val) < 1 { - return "" - } - - return val[0] -} diff --git a/vendor/k8s.io/code-generator/pkg/util/build.go b/vendor/k8s.io/code-generator/pkg/util/build.go deleted file mode 100644 index 6ea8f52..0000000 --- a/vendor/k8s.io/code-generator/pkg/util/build.go +++ /dev/null @@ -1,61 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package util - -import ( - gobuild "go/build" - "path" - "path/filepath" - "reflect" - "strings" -) - -type empty struct{} - -// CurrentPackage returns the go package of the current directory, or "" if it cannot -// be derived from the GOPATH. -func CurrentPackage() string { - for _, root := range gobuild.Default.SrcDirs() { - if pkg, ok := hasSubdir(root, "."); ok { - return pkg - } - } - return "" -} - -func hasSubdir(root, dir string) (rel string, ok bool) { - // ensure a tailing separator to properly compare on word-boundaries - const sep = string(filepath.Separator) - root = filepath.Clean(root) - if !strings.HasSuffix(root, sep) { - root += sep - } - - // check whether root dir starts with root - dir = filepath.Clean(dir) - if !strings.HasPrefix(dir, root) { - return "", false - } - - // cut off root - return filepath.ToSlash(dir[len(root):]), true -} - -// BoilerplatePath uses the boilerplate in code-generator by calculating the relative path to it. -func BoilerplatePath() string { - return path.Join(reflect.TypeOf(empty{}).PkgPath(), "/../../hack/boilerplate.go.txt") -} diff --git a/vendor/k8s.io/code-generator/third_party/forked/golang/reflect/type.go b/vendor/k8s.io/code-generator/third_party/forked/golang/reflect/type.go deleted file mode 100644 index 67957ee..0000000 --- a/vendor/k8s.io/code-generator/third_party/forked/golang/reflect/type.go +++ /dev/null @@ -1,91 +0,0 @@ -//This package is copied from Go library reflect/type.go. -//The struct tag library provides no way to extract the list of struct tags, only -//a specific tag -package reflect - -import ( - "fmt" - - "strconv" - "strings" -) - -type StructTag struct { - Name string - Value string -} - -func (t StructTag) String() string { - return fmt.Sprintf("%s:%q", t.Name, t.Value) -} - -type StructTags []StructTag - -func (tags StructTags) String() string { - s := make([]string, 0, len(tags)) - for _, tag := range tags { - s = append(s, tag.String()) - } - return "`" + strings.Join(s, " ") + "`" -} - -func (tags StructTags) Has(name string) bool { - for i := range tags { - if tags[i].Name == name { - return true - } - } - return false -} - -// ParseStructTags returns the full set of fields in a struct tag in the order they appear in -// the struct tag. -func ParseStructTags(tag string) (StructTags, error) { - tags := StructTags{} - for tag != "" { - // Skip leading space. - i := 0 - for i < len(tag) && tag[i] == ' ' { - i++ - } - tag = tag[i:] - if tag == "" { - break - } - - // Scan to colon. A space, a quote or a control character is a syntax error. - // Strictly speaking, control chars include the range [0x7f, 0x9f], not just - // [0x00, 0x1f], but in practice, we ignore the multi-byte control characters - // as it is simpler to inspect the tag's bytes than the tag's runes. - i = 0 - for i < len(tag) && tag[i] > ' ' && tag[i] != ':' && tag[i] != '"' && tag[i] != 0x7f { - i++ - } - if i == 0 || i+1 >= len(tag) || tag[i] != ':' || tag[i+1] != '"' { - break - } - name := string(tag[:i]) - tag = tag[i+1:] - - // Scan quoted string to find value. - i = 1 - for i < len(tag) && tag[i] != '"' { - if tag[i] == '\\' { - i++ - } - i++ - } - if i >= len(tag) { - break - } - qvalue := string(tag[:i+1]) - tag = tag[i+1:] - - value, err := strconv.Unquote(qvalue) - if err != nil { - return nil, err - } - tags = append(tags, StructTag{Name: name, Value: value}) - } - return tags, nil -} diff --git a/vendor/k8s.io/code-generator/tools.go b/vendor/k8s.io/code-generator/tools.go deleted file mode 100644 index 7d13de5..0000000 --- a/vendor/k8s.io/code-generator/tools.go +++ /dev/null @@ -1,35 +0,0 @@ -// +build tools - -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This package contains code generation utilities -// This package imports things required by build scripts, to force `go mod` to see them as dependencies -package tools - -import ( - _ "k8s.io/code-generator/cmd/client-gen" - _ "k8s.io/code-generator/cmd/conversion-gen" - _ "k8s.io/code-generator/cmd/deepcopy-gen" - _ "k8s.io/code-generator/cmd/defaulter-gen" - _ "k8s.io/code-generator/cmd/go-to-protobuf" - _ "k8s.io/code-generator/cmd/import-boss" - _ "k8s.io/code-generator/cmd/informer-gen" - _ "k8s.io/code-generator/cmd/lister-gen" - _ "k8s.io/code-generator/cmd/openapi-gen" - _ "k8s.io/code-generator/cmd/register-gen" - _ "k8s.io/code-generator/cmd/set-gen" -) diff --git a/vendor/k8s.io/gengo/LICENSE b/vendor/k8s.io/gengo/LICENSE deleted file mode 100644 index 00b2401..0000000 --- a/vendor/k8s.io/gengo/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 2014 The Kubernetes Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/k8s.io/gengo/args/args.go b/vendor/k8s.io/gengo/args/args.go deleted file mode 100644 index 49cc76d..0000000 --- a/vendor/k8s.io/gengo/args/args.go +++ /dev/null @@ -1,212 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package args has common command-line flags for generation programs. -package args - -import ( - "bytes" - goflag "flag" - "fmt" - "io/ioutil" - "os" - "path" - "path/filepath" - "strconv" - "strings" - "time" - - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/parser" - "k8s.io/gengo/types" - - "github.com/spf13/pflag" -) - -// Default returns a defaulted GeneratorArgs. You may change the defaults -// before calling AddFlags. -func Default() *GeneratorArgs { - return &GeneratorArgs{ - OutputBase: DefaultSourceTree(), - GoHeaderFilePath: filepath.Join(DefaultSourceTree(), "k8s.io/gengo/boilerplate/boilerplate.go.txt"), - GeneratedBuildTag: "ignore_autogenerated", - GeneratedByCommentTemplate: "// Code generated by GENERATOR_NAME. DO NOT EDIT.", - defaultCommandLineFlags: true, - } -} - -// GeneratorArgs has arguments that are passed to generators. -type GeneratorArgs struct { - // Which directories to parse. - InputDirs []string - - // Source tree to write results to. - OutputBase string - - // Package path within the source tree. - OutputPackagePath string - - // Output file name. - OutputFileBaseName string - - // Where to get copyright header text. - GoHeaderFilePath string - - // If GeneratedByCommentTemplate is set, generate a "Code generated by" comment - // below the bloilerplate, of the format defined by this string. - // Any instances of "GENERATOR_NAME" will be replaced with the name of the code generator. - GeneratedByCommentTemplate string - - // If true, only verify, don't write anything. - VerifyOnly bool - - // If true, include *_test.go files - IncludeTestFiles bool - - // GeneratedBuildTag is the tag used to identify code generated by execution - // of this type. Each generator should use a different tag, and different - // groups of generators (external API that depends on Kube generations) should - // keep tags distinct as well. - GeneratedBuildTag string - - // Any custom arguments go here - CustomArgs interface{} - - // Whether to use default command line flags - defaultCommandLineFlags bool -} - -// WithoutDefaultFlagParsing disables implicit addition of command line flags and parsing. -func (g *GeneratorArgs) WithoutDefaultFlagParsing() *GeneratorArgs { - g.defaultCommandLineFlags = false - return g -} - -func (g *GeneratorArgs) AddFlags(fs *pflag.FlagSet) { - fs.StringSliceVarP(&g.InputDirs, "input-dirs", "i", g.InputDirs, "Comma-separated list of import paths to get input types from.") - fs.StringVarP(&g.OutputBase, "output-base", "o", g.OutputBase, "Output base; defaults to $GOPATH/src/ or ./ if $GOPATH is not set.") - fs.StringVarP(&g.OutputPackagePath, "output-package", "p", g.OutputPackagePath, "Base package path.") - fs.StringVarP(&g.OutputFileBaseName, "output-file-base", "O", g.OutputFileBaseName, "Base name (without .go suffix) for output files.") - fs.StringVarP(&g.GoHeaderFilePath, "go-header-file", "h", g.GoHeaderFilePath, "File containing boilerplate header text. The string YEAR will be replaced with the current 4-digit year.") - fs.BoolVar(&g.VerifyOnly, "verify-only", g.VerifyOnly, "If true, only verify existing output, do not write anything.") - fs.StringVar(&g.GeneratedBuildTag, "build-tag", g.GeneratedBuildTag, "A Go build tag to use to identify files generated by this command. Should be unique.") -} - -// LoadGoBoilerplate loads the boilerplate file passed to --go-header-file. -func (g *GeneratorArgs) LoadGoBoilerplate() ([]byte, error) { - b, err := ioutil.ReadFile(g.GoHeaderFilePath) - if err != nil { - return nil, err - } - b = bytes.Replace(b, []byte("YEAR"), []byte(strconv.Itoa(time.Now().UTC().Year())), -1) - - if g.GeneratedByCommentTemplate != "" { - if len(b) != 0 { - b = append(b, byte('\n')) - } - generatorName := path.Base(os.Args[0]) - generatedByComment := strings.Replace(g.GeneratedByCommentTemplate, "GENERATOR_NAME", generatorName, -1) - s := fmt.Sprintf("%s\n\n", generatedByComment) - b = append(b, []byte(s)...) - } - return b, nil -} - -// NewBuilder makes a new parser.Builder and populates it with the input -// directories. -func (g *GeneratorArgs) NewBuilder() (*parser.Builder, error) { - b := parser.New() - - // flag for including *_test.go - b.IncludeTestFiles = g.IncludeTestFiles - - // Ignore all auto-generated files. - b.AddBuildTags(g.GeneratedBuildTag) - - for _, d := range g.InputDirs { - var err error - if strings.HasSuffix(d, "/...") { - err = b.AddDirRecursive(strings.TrimSuffix(d, "/...")) - } else { - err = b.AddDir(d) - } - if err != nil { - return nil, fmt.Errorf("unable to add directory %q: %v", d, err) - } - } - return b, nil -} - -// InputIncludes returns true if the given package is a (sub) package of one of -// the InputDirs. -func (g *GeneratorArgs) InputIncludes(p *types.Package) bool { - for _, dir := range g.InputDirs { - d := dir - if strings.HasSuffix(d, "...") { - d = strings.TrimSuffix(d, "...") - } - if strings.HasPrefix(d, "./vendor/") { - d = strings.TrimPrefix(d, "./vendor/") - } - if strings.HasPrefix(p.Path, d) { - return true - } - } - return false -} - -// DefaultSourceTree returns the /src directory of the first entry in $GOPATH. -// If $GOPATH is empty, it returns "./". Useful as a default output location. -func DefaultSourceTree() string { - paths := strings.Split(os.Getenv("GOPATH"), string(filepath.ListSeparator)) - if len(paths) > 0 && len(paths[0]) > 0 { - return filepath.Join(paths[0], "src") - } - return "./" -} - -// Execute implements main(). -// If you don't need any non-default behavior, use as: -// args.Default().Execute(...) -func (g *GeneratorArgs) Execute(nameSystems namer.NameSystems, defaultSystem string, pkgs func(*generator.Context, *GeneratorArgs) generator.Packages) error { - if g.defaultCommandLineFlags { - g.AddFlags(pflag.CommandLine) - pflag.CommandLine.AddGoFlagSet(goflag.CommandLine) - pflag.Parse() - } - - b, err := g.NewBuilder() - if err != nil { - return fmt.Errorf("Failed making a parser: %v", err) - } - - // pass through the flag on whether to include *_test.go files - b.IncludeTestFiles = g.IncludeTestFiles - - c, err := generator.NewContext(b, nameSystems, defaultSystem) - if err != nil { - return fmt.Errorf("Failed making a context: %v", err) - } - - c.Verify = g.VerifyOnly - packages := pkgs(c, g) - if err := c.ExecutePackages(g.OutputBase, packages); err != nil { - return fmt.Errorf("Failed executing generator: %v", err) - } - - return nil -} diff --git a/vendor/k8s.io/gengo/examples/deepcopy-gen/generators/deepcopy.go b/vendor/k8s.io/gengo/examples/deepcopy-gen/generators/deepcopy.go deleted file mode 100644 index 40f1306..0000000 --- a/vendor/k8s.io/gengo/examples/deepcopy-gen/generators/deepcopy.go +++ /dev/null @@ -1,924 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generators - -import ( - "fmt" - "io" - "path/filepath" - "sort" - "strings" - - "k8s.io/gengo/args" - "k8s.io/gengo/examples/set-gen/sets" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/klog" -) - -// CustomArgs is used tby the go2idl framework to pass args specific to this -// generator. -type CustomArgs struct { - BoundingDirs []string // Only deal with types rooted under these dirs. -} - -// This is the comment tag that carries parameters for deep-copy generation. -const ( - tagEnabledName = "k8s:deepcopy-gen" - interfacesTagName = tagEnabledName + ":interfaces" - interfacesNonPointerTagName = tagEnabledName + ":nonpointer-interfaces" // attach the DeepCopy methods to the -) - -// Known values for the comment tag. -const tagValuePackage = "package" - -// enabledTagValue holds parameters from a tagName tag. -type enabledTagValue struct { - value string - register bool -} - -func extractEnabledTypeTag(t *types.Type) *enabledTagValue { - comments := append(append([]string{}, t.SecondClosestCommentLines...), t.CommentLines...) - return extractEnabledTag(comments) -} - -func extractEnabledTag(comments []string) *enabledTagValue { - tagVals := types.ExtractCommentTags("+", comments)[tagEnabledName] - if tagVals == nil { - // No match for the tag. - return nil - } - // If there are multiple values, abort. - if len(tagVals) > 1 { - klog.Fatalf("Found %d %s tags: %q", len(tagVals), tagEnabledName, tagVals) - } - - // If we got here we are returning something. - tag := &enabledTagValue{} - - // Get the primary value. - parts := strings.Split(tagVals[0], ",") - if len(parts) >= 1 { - tag.value = parts[0] - } - - // Parse extra arguments. - parts = parts[1:] - for i := range parts { - kv := strings.SplitN(parts[i], "=", 2) - k := kv[0] - v := "" - if len(kv) == 2 { - v = kv[1] - } - switch k { - case "register": - if v != "false" { - tag.register = true - } - default: - klog.Fatalf("Unsupported %s param: %q", tagEnabledName, parts[i]) - } - } - return tag -} - -// TODO: This is created only to reduce number of changes in a single PR. -// Remove it and use PublicNamer instead. -func deepCopyNamer() *namer.NameStrategy { - return &namer.NameStrategy{ - Join: func(pre string, in []string, post string) string { - return strings.Join(in, "_") - }, - PrependPackageNames: 1, - } -} - -// NameSystems returns the name system used by the generators in this package. -func NameSystems() namer.NameSystems { - return namer.NameSystems{ - "public": deepCopyNamer(), - "raw": namer.NewRawNamer("", nil), - } -} - -// DefaultNameSystem returns the default name system for ordering the types to be -// processed by the generators in this package. -func DefaultNameSystem() string { - return "public" -} - -func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { - boilerplate, err := arguments.LoadGoBoilerplate() - if err != nil { - klog.Fatalf("Failed loading boilerplate: %v", err) - } - - inputs := sets.NewString(context.Inputs...) - packages := generator.Packages{} - header := append([]byte(fmt.Sprintf("// +build !%s\n\n", arguments.GeneratedBuildTag)), boilerplate...) - - boundingDirs := []string{} - if customArgs, ok := arguments.CustomArgs.(*CustomArgs); ok { - if customArgs.BoundingDirs == nil { - customArgs.BoundingDirs = context.Inputs - } - for i := range customArgs.BoundingDirs { - // Strip any trailing slashes - they are not exactly "correct" but - // this is friendlier. - boundingDirs = append(boundingDirs, strings.TrimRight(customArgs.BoundingDirs[i], "/")) - } - } - - for i := range inputs { - klog.V(5).Infof("Considering pkg %q", i) - pkg := context.Universe[i] - if pkg == nil { - // If the input had no Go files, for example. - continue - } - - ptag := extractEnabledTag(pkg.Comments) - ptagValue := "" - ptagRegister := false - if ptag != nil { - ptagValue = ptag.value - if ptagValue != tagValuePackage { - klog.Fatalf("Package %v: unsupported %s value: %q", i, tagEnabledName, ptagValue) - } - ptagRegister = ptag.register - klog.V(5).Infof(" tag.value: %q, tag.register: %t", ptagValue, ptagRegister) - } else { - klog.V(5).Infof(" no tag") - } - - // If the pkg-scoped tag says to generate, we can skip scanning types. - pkgNeedsGeneration := (ptagValue == tagValuePackage) - if !pkgNeedsGeneration { - // If the pkg-scoped tag did not exist, scan all types for one that - // explicitly wants generation. - for _, t := range pkg.Types { - klog.V(5).Infof(" considering type %q", t.Name.String()) - ttag := extractEnabledTypeTag(t) - if ttag != nil && ttag.value == "true" { - klog.V(5).Infof(" tag=true") - if !copyableType(t) { - klog.Fatalf("Type %v requests deepcopy generation but is not copyable", t) - } - pkgNeedsGeneration = true - break - } - } - } - - if pkgNeedsGeneration { - klog.V(3).Infof("Package %q needs generation", i) - path := pkg.Path - // if the source path is within a /vendor/ directory (for example, - // k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/meta/v1), allow - // generation to output to the proper relative path (under vendor). - // Otherwise, the generator will create the file in the wrong location - // in the output directory. - // TODO: build a more fundamental concept in gengo for dealing with modifications - // to vendored packages. - if strings.HasPrefix(pkg.SourcePath, arguments.OutputBase) { - expandedPath := strings.TrimPrefix(pkg.SourcePath, arguments.OutputBase) - if strings.Contains(expandedPath, "/vendor/") { - path = expandedPath - } - } - packages = append(packages, - &generator.DefaultPackage{ - PackageName: strings.Split(filepath.Base(pkg.Path), ".")[0], - PackagePath: path, - HeaderText: header, - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - return []generator.Generator{ - NewGenDeepCopy(arguments.OutputFileBaseName, pkg.Path, boundingDirs, (ptagValue == tagValuePackage), ptagRegister), - } - }, - FilterFunc: func(c *generator.Context, t *types.Type) bool { - return t.Name.Package == pkg.Path - }, - }) - } - } - return packages -} - -// genDeepCopy produces a file with autogenerated deep-copy functions. -type genDeepCopy struct { - generator.DefaultGen - targetPackage string - boundingDirs []string - allTypes bool - registerTypes bool - imports namer.ImportTracker - typesForInit []*types.Type -} - -func NewGenDeepCopy(sanitizedName, targetPackage string, boundingDirs []string, allTypes, registerTypes bool) generator.Generator { - return &genDeepCopy{ - DefaultGen: generator.DefaultGen{ - OptionalName: sanitizedName, - }, - targetPackage: targetPackage, - boundingDirs: boundingDirs, - allTypes: allTypes, - registerTypes: registerTypes, - imports: generator.NewImportTracker(), - typesForInit: make([]*types.Type, 0), - } -} - -func (g *genDeepCopy) Namers(c *generator.Context) namer.NameSystems { - // Have the raw namer for this file track what it imports. - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.targetPackage, g.imports), - } -} - -func (g *genDeepCopy) Filter(c *generator.Context, t *types.Type) bool { - // Filter out types not being processed or not copyable within the package. - enabled := g.allTypes - if !enabled { - ttag := extractEnabledTypeTag(t) - if ttag != nil && ttag.value == "true" { - enabled = true - } - } - if !enabled { - return false - } - if !copyableType(t) { - klog.V(2).Infof("Type %v is not copyable", t) - return false - } - klog.V(4).Infof("Type %v is copyable", t) - g.typesForInit = append(g.typesForInit, t) - return true -} - -func (g *genDeepCopy) copyableAndInBounds(t *types.Type) bool { - if !copyableType(t) { - return false - } - // Only packages within the restricted range can be processed. - if !isRootedUnder(t.Name.Package, g.boundingDirs) { - return false - } - return true -} - -// deepCopyMethod returns the signature of a DeepCopy() method, nil or an error -// if the type does not match. This allows more efficient deep copy -// implementations to be defined by the type's author. The correct signature -// for a type T is: -// func (t T) DeepCopy() T -// or: -// func (t *T) DeepCopy() *T -func deepCopyMethod(t *types.Type) (*types.Signature, error) { - f, found := t.Methods["DeepCopy"] - if !found { - return nil, nil - } - if len(f.Signature.Parameters) != 0 { - return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected no parameters", t) - } - if len(f.Signature.Results) != 1 { - return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected exactly one result", t) - } - - ptrResult := f.Signature.Results[0].Kind == types.Pointer && f.Signature.Results[0].Elem.Name == t.Name - nonPtrResult := f.Signature.Results[0].Name == t.Name - - if !ptrResult && !nonPtrResult { - return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected to return %s or *%s", t, t.Name.Name, t.Name.Name) - } - - ptrRcvr := f.Signature.Receiver != nil && f.Signature.Receiver.Kind == types.Pointer && f.Signature.Receiver.Elem.Name == t.Name - nonPtrRcvr := f.Signature.Receiver != nil && f.Signature.Receiver.Name == t.Name - - if ptrRcvr && !ptrResult { - return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected a *%s result for a *%s receiver", t, t.Name.Name, t.Name.Name) - } - if nonPtrRcvr && !nonPtrResult { - return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected a %s result for a %s receiver", t, t.Name.Name, t.Name.Name) - } - - return f.Signature, nil -} - -// deepCopyMethodOrDie returns the signatrue of a DeepCopy method, nil or calls klog.Fatalf -// if the type does not match. -func deepCopyMethodOrDie(t *types.Type) *types.Signature { - ret, err := deepCopyMethod(t) - if err != nil { - klog.Fatal(err) - } - return ret -} - -// deepCopyIntoMethod returns the signature of a DeepCopyInto() method, nil or an error -// if the type is wrong. DeepCopyInto allows more efficient deep copy -// implementations to be defined by the type's author. The correct signature -// for a type T is: -// func (t T) DeepCopyInto(t *T) -// or: -// func (t *T) DeepCopyInto(t *T) -func deepCopyIntoMethod(t *types.Type) (*types.Signature, error) { - f, found := t.Methods["DeepCopyInto"] - if !found { - return nil, nil - } - if len(f.Signature.Parameters) != 1 { - return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected exactly one parameter", t) - } - if len(f.Signature.Results) != 0 { - return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected no result type", t) - } - - ptrParam := f.Signature.Parameters[0].Kind == types.Pointer && f.Signature.Parameters[0].Elem.Name == t.Name - - if !ptrParam { - return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected parameter of type *%s", t, t.Name.Name) - } - - ptrRcvr := f.Signature.Receiver != nil && f.Signature.Receiver.Kind == types.Pointer && f.Signature.Receiver.Elem.Name == t.Name - nonPtrRcvr := f.Signature.Receiver != nil && f.Signature.Receiver.Name == t.Name - - if !ptrRcvr && !nonPtrRcvr { - // this should never happen - return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected a receiver of type %s or *%s", t, t.Name.Name, t.Name.Name) - } - - return f.Signature, nil -} - -// deepCopyIntoMethodOrDie returns the signature of a DeepCopyInto() method, nil or calls klog.Fatalf -// if the type is wrong. -func deepCopyIntoMethodOrDie(t *types.Type) *types.Signature { - ret, err := deepCopyIntoMethod(t) - if err != nil { - klog.Fatal(err) - } - return ret -} - -func isRootedUnder(pkg string, roots []string) bool { - // Add trailing / to avoid false matches, e.g. foo/bar vs foo/barn. This - // assumes that bounding dirs do not have trailing slashes. - pkg = pkg + "/" - for _, root := range roots { - if strings.HasPrefix(pkg, root+"/") { - return true - } - } - return false -} - -func copyableType(t *types.Type) bool { - // If the type opts out of copy-generation, stop. - ttag := extractEnabledTypeTag(t) - if ttag != nil && ttag.value == "false" { - return false - } - - // Filter out private types. - if namer.IsPrivateGoName(t.Name.Name) { - return false - } - - if t.Kind == types.Alias { - // if the underlying built-in is not deepcopy-able, deepcopy is opt-in through definition of custom methods. - // Note that aliases of builtins, maps, slices can have deepcopy methods. - if deepCopyMethodOrDie(t) != nil || deepCopyIntoMethodOrDie(t) != nil { - return true - } else { - return t.Underlying.Kind != types.Builtin || copyableType(t.Underlying) - } - } - - if t.Kind != types.Struct { - return false - } - - return true -} - -func underlyingType(t *types.Type) *types.Type { - for t.Kind == types.Alias { - t = t.Underlying - } - return t -} - -func (g *genDeepCopy) isOtherPackage(pkg string) bool { - if pkg == g.targetPackage { - return false - } - if strings.HasSuffix(pkg, "\""+g.targetPackage+"\"") { - return false - } - return true -} - -func (g *genDeepCopy) Imports(c *generator.Context) (imports []string) { - importLines := []string{} - for _, singleImport := range g.imports.ImportLines() { - if g.isOtherPackage(singleImport) { - importLines = append(importLines, singleImport) - } - } - return importLines -} - -func argsFromType(ts ...*types.Type) generator.Args { - a := generator.Args{ - "type": ts[0], - } - for i, t := range ts { - a[fmt.Sprintf("type%d", i+1)] = t - } - return a -} - -func (g *genDeepCopy) Init(c *generator.Context, w io.Writer) error { - return nil -} - -func (g *genDeepCopy) needsGeneration(t *types.Type) bool { - tag := extractEnabledTypeTag(t) - tv := "" - if tag != nil { - tv = tag.value - if tv != "true" && tv != "false" { - klog.Fatalf("Type %v: unsupported %s value: %q", t, tagEnabledName, tag.value) - } - } - if g.allTypes && tv == "false" { - // The whole package is being generated, but this type has opted out. - klog.V(5).Infof("Not generating for type %v because type opted out", t) - return false - } - if !g.allTypes && tv != "true" { - // The whole package is NOT being generated, and this type has NOT opted in. - klog.V(5).Infof("Not generating for type %v because type did not opt in", t) - return false - } - return true -} - -func extractInterfacesTag(t *types.Type) []string { - var result []string - comments := append(append([]string{}, t.SecondClosestCommentLines...), t.CommentLines...) - values := types.ExtractCommentTags("+", comments)[interfacesTagName] - for _, v := range values { - if len(v) == 0 { - continue - } - intfs := strings.Split(v, ",") - for _, intf := range intfs { - if intf == "" { - continue - } - result = append(result, intf) - } - } - return result -} - -func extractNonPointerInterfaces(t *types.Type) (bool, error) { - comments := append(append([]string{}, t.SecondClosestCommentLines...), t.CommentLines...) - values := types.ExtractCommentTags("+", comments)[interfacesNonPointerTagName] - if len(values) == 0 { - return false, nil - } - result := values[0] == "true" - for _, v := range values { - if v == "true" != result { - return false, fmt.Errorf("contradicting %v value %q found to previous value %v", interfacesNonPointerTagName, v, result) - } - } - return result, nil -} - -func (g *genDeepCopy) deepCopyableInterfacesInner(c *generator.Context, t *types.Type) ([]*types.Type, error) { - if t.Kind != types.Struct { - return nil, nil - } - - intfs := extractInterfacesTag(t) - - var ts []*types.Type - for _, intf := range intfs { - t := types.ParseFullyQualifiedName(intf) - c.AddDir(t.Package) - intfT := c.Universe.Type(t) - if intfT == nil { - return nil, fmt.Errorf("unknown type %q in %s tag of type %s", intf, interfacesTagName, intfT) - } - if intfT.Kind != types.Interface { - return nil, fmt.Errorf("type %q in %s tag of type %s is not an interface, but: %q", intf, interfacesTagName, t, intfT.Kind) - } - g.imports.AddType(intfT) - ts = append(ts, intfT) - } - - return ts, nil -} - -// deepCopyableInterfaces returns the interface types to implement and whether they apply to a non-pointer receiver. -func (g *genDeepCopy) deepCopyableInterfaces(c *generator.Context, t *types.Type) ([]*types.Type, bool, error) { - ts, err := g.deepCopyableInterfacesInner(c, t) - if err != nil { - return nil, false, err - } - - set := map[string]*types.Type{} - for _, t := range ts { - set[t.String()] = t - } - - result := []*types.Type{} - for _, t := range set { - result = append(result, t) - } - - TypeSlice(result).Sort() // we need a stable sorting because it determines the order in generation - - nonPointerReceiver, err := extractNonPointerInterfaces(t) - if err != nil { - return nil, false, err - } - - return result, nonPointerReceiver, nil -} - -type TypeSlice []*types.Type - -func (s TypeSlice) Len() int { return len(s) } -func (s TypeSlice) Less(i, j int) bool { return s[i].String() < s[j].String() } -func (s TypeSlice) Swap(i, j int) { s[i], s[j] = s[j], s[i] } -func (s TypeSlice) Sort() { sort.Sort(s) } - -func (g *genDeepCopy) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - if !g.needsGeneration(t) { - return nil - } - klog.V(5).Infof("Generating deepcopy function for type %v", t) - - sw := generator.NewSnippetWriter(w, c, "$", "$") - args := argsFromType(t) - - if deepCopyIntoMethodOrDie(t) == nil { - sw.Do("// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.\n", args) - if isReference(t) { - sw.Do("func (in $.type|raw$) DeepCopyInto(out *$.type|raw$) {\n", args) - sw.Do("{in:=&in\n", nil) - } else { - sw.Do("func (in *$.type|raw$) DeepCopyInto(out *$.type|raw$) {\n", args) - } - if deepCopyMethodOrDie(t) != nil { - if t.Methods["DeepCopy"].Signature.Receiver.Kind == types.Pointer { - sw.Do("clone := in.DeepCopy()\n", nil) - sw.Do("*out = *clone\n", nil) - } else { - sw.Do("*out = in.DeepCopy()\n", nil) - } - sw.Do("return\n", nil) - } else { - g.generateFor(t, sw) - sw.Do("return\n", nil) - } - if isReference(t) { - sw.Do("}\n", nil) - } - sw.Do("}\n\n", nil) - } - - if deepCopyMethodOrDie(t) == nil { - sw.Do("// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new $.type|raw$.\n", args) - if isReference(t) { - sw.Do("func (in $.type|raw$) DeepCopy() $.type|raw$ {\n", args) - } else { - sw.Do("func (in *$.type|raw$) DeepCopy() *$.type|raw$ {\n", args) - } - sw.Do("if in == nil { return nil }\n", nil) - sw.Do("out := new($.type|raw$)\n", args) - sw.Do("in.DeepCopyInto(out)\n", nil) - if isReference(t) { - sw.Do("return *out\n", nil) - } else { - sw.Do("return out\n", nil) - } - sw.Do("}\n\n", nil) - } - - intfs, nonPointerReceiver, err := g.deepCopyableInterfaces(c, t) - if err != nil { - return err - } - for _, intf := range intfs { - sw.Do(fmt.Sprintf("// DeepCopy%s is an autogenerated deepcopy function, copying the receiver, creating a new $.type2|raw$.\n", intf.Name.Name), argsFromType(t, intf)) - if nonPointerReceiver { - sw.Do(fmt.Sprintf("func (in $.type|raw$) DeepCopy%s() $.type2|raw$ {\n", intf.Name.Name), argsFromType(t, intf)) - sw.Do("return *in.DeepCopy()", nil) - sw.Do("}\n\n", nil) - } else { - sw.Do(fmt.Sprintf("func (in *$.type|raw$) DeepCopy%s() $.type2|raw$ {\n", intf.Name.Name), argsFromType(t, intf)) - sw.Do("if c := in.DeepCopy(); c != nil {\n", nil) - sw.Do("return c\n", nil) - sw.Do("}\n", nil) - sw.Do("return nil\n", nil) - sw.Do("}\n\n", nil) - } - } - - return sw.Error() -} - -// isReference return true for pointer, maps, slices and aliases of those. -func isReference(t *types.Type) bool { - if t.Kind == types.Pointer || t.Kind == types.Map || t.Kind == types.Slice { - return true - } - return t.Kind == types.Alias && isReference(underlyingType(t)) -} - -// we use the system of shadowing 'in' and 'out' so that the same code is valid -// at any nesting level. This makes the autogenerator easy to understand, and -// the compiler shouldn't care. -func (g *genDeepCopy) generateFor(t *types.Type, sw *generator.SnippetWriter) { - // derive inner types if t is an alias. We call the do* methods below with the alias type. - // basic rule: generate according to inner type, but construct objects with the alias type. - ut := underlyingType(t) - - var f func(*types.Type, *generator.SnippetWriter) - switch ut.Kind { - case types.Builtin: - f = g.doBuiltin - case types.Map: - f = g.doMap - case types.Slice: - f = g.doSlice - case types.Struct: - f = g.doStruct - case types.Pointer: - f = g.doPointer - case types.Interface: - // interfaces are handled in-line in the other cases - klog.Fatalf("Hit an interface type %v. This should never happen.", t) - case types.Alias: - // can never happen because we branch on the underlying type which is never an alias - klog.Fatalf("Hit an alias type %v. This should never happen.", t) - default: - klog.Fatalf("Hit an unsupported type %v.", t) - } - f(t, sw) -} - -// doBuiltin generates code for a builtin or an alias to a builtin. The generated code is -// is the same for both cases, i.e. it's the code for the underlying type. -func (g *genDeepCopy) doBuiltin(t *types.Type, sw *generator.SnippetWriter) { - if deepCopyMethodOrDie(t) != nil || deepCopyIntoMethodOrDie(t) != nil { - sw.Do("*out = in.DeepCopy()\n", nil) - return - } - - sw.Do("*out = *in\n", nil) -} - -// doMap generates code for a map or an alias to a map. The generated code is -// is the same for both cases, i.e. it's the code for the underlying type. -func (g *genDeepCopy) doMap(t *types.Type, sw *generator.SnippetWriter) { - ut := underlyingType(t) - uet := underlyingType(ut.Elem) - - if deepCopyMethodOrDie(t) != nil || deepCopyIntoMethodOrDie(t) != nil { - sw.Do("*out = in.DeepCopy()\n", nil) - return - } - - if !ut.Key.IsAssignable() { - klog.Fatalf("Hit an unsupported type %v for: %v", uet, t) - } - - sw.Do("*out = make($.|raw$, len(*in))\n", t) - sw.Do("for key, val := range *in {\n", nil) - dc, dci := deepCopyMethodOrDie(ut.Elem), deepCopyIntoMethodOrDie(ut.Elem) - switch { - case dc != nil || dci != nil: - // Note: a DeepCopy exists because it is added if DeepCopyInto is manually defined - leftPointer := ut.Elem.Kind == types.Pointer - rightPointer := !isReference(ut.Elem) - if dc != nil { - rightPointer = dc.Results[0].Kind == types.Pointer - } - if leftPointer == rightPointer { - sw.Do("(*out)[key] = val.DeepCopy()\n", nil) - } else if leftPointer { - sw.Do("x := val.DeepCopy()\n", nil) - sw.Do("(*out)[key] = &x\n", nil) - } else { - sw.Do("(*out)[key] = *val.DeepCopy()\n", nil) - } - case ut.Elem.IsAnonymousStruct(): // not uet here because it needs type cast - sw.Do("(*out)[key] = val\n", nil) - case uet.IsAssignable(): - sw.Do("(*out)[key] = val\n", nil) - case uet.Kind == types.Interface: - // Note: do not generate code that won't compile as `DeepCopyinterface{}()` is not a valid function - if uet.Name.Name == "interface{}" { - klog.Fatalf("DeepCopy of %q is unsupported. Instead, use named interfaces with DeepCopy as one of the methods.", uet.Name.Name) - } - sw.Do("if val == nil {(*out)[key]=nil} else {\n", nil) - // Note: if t.Elem has been an alias "J" of an interface "I" in Go, we will see it - // as kind Interface of name "J" here, i.e. generate val.DeepCopyJ(). The golang - // parser does not give us the underlying interface name. So we cannot do any better. - sw.Do(fmt.Sprintf("(*out)[key] = val.DeepCopy%s()\n", uet.Name.Name), nil) - sw.Do("}\n", nil) - case uet.Kind == types.Slice || uet.Kind == types.Map || uet.Kind == types.Pointer: - sw.Do("var outVal $.|raw$\n", uet) - sw.Do("if val == nil { (*out)[key] = nil } else {\n", nil) - sw.Do("in, out := &val, &outVal\n", uet) - g.generateFor(ut.Elem, sw) - sw.Do("}\n", nil) - sw.Do("(*out)[key] = outVal\n", nil) - case uet.Kind == types.Struct: - sw.Do("(*out)[key] = *val.DeepCopy()\n", uet) - default: - klog.Fatalf("Hit an unsupported type %v for %v", uet, t) - } - sw.Do("}\n", nil) -} - -// doSlice generates code for a slice or an alias to a slice. The generated code is -// is the same for both cases, i.e. it's the code for the underlying type. -func (g *genDeepCopy) doSlice(t *types.Type, sw *generator.SnippetWriter) { - ut := underlyingType(t) - uet := underlyingType(ut.Elem) - - if deepCopyMethodOrDie(t) != nil || deepCopyIntoMethodOrDie(t) != nil { - sw.Do("*out = in.DeepCopy()\n", nil) - return - } - - sw.Do("*out = make($.|raw$, len(*in))\n", t) - if deepCopyMethodOrDie(ut.Elem) != nil || deepCopyIntoMethodOrDie(ut.Elem) != nil { - sw.Do("for i := range *in {\n", nil) - // Note: a DeepCopyInto exists because it is added if DeepCopy is manually defined - sw.Do("(*in)[i].DeepCopyInto(&(*out)[i])\n", nil) - sw.Do("}\n", nil) - } else if uet.Kind == types.Builtin || uet.IsAssignable() { - sw.Do("copy(*out, *in)\n", nil) - } else { - sw.Do("for i := range *in {\n", nil) - if uet.Kind == types.Slice || uet.Kind == types.Map || uet.Kind == types.Pointer || deepCopyMethodOrDie(ut.Elem) != nil || deepCopyIntoMethodOrDie(ut.Elem) != nil { - sw.Do("if (*in)[i] != nil {\n", nil) - sw.Do("in, out := &(*in)[i], &(*out)[i]\n", nil) - g.generateFor(ut.Elem, sw) - sw.Do("}\n", nil) - } else if uet.Kind == types.Interface { - // Note: do not generate code that won't compile as `DeepCopyinterface{}()` is not a valid function - if uet.Name.Name == "interface{}" { - klog.Fatalf("DeepCopy of %q is unsupported. Instead, use named interfaces with DeepCopy as one of the methods.", uet.Name.Name) - } - sw.Do("if (*in)[i] != nil {\n", nil) - // Note: if t.Elem has been an alias "J" of an interface "I" in Go, we will see it - // as kind Interface of name "J" here, i.e. generate val.DeepCopyJ(). The golang - // parser does not give us the underlying interface name. So we cannot do any better. - sw.Do(fmt.Sprintf("(*out)[i] = (*in)[i].DeepCopy%s()\n", uet.Name.Name), nil) - sw.Do("}\n", nil) - } else if uet.Kind == types.Struct { - sw.Do("(*in)[i].DeepCopyInto(&(*out)[i])\n", nil) - } else { - klog.Fatalf("Hit an unsupported type %v for %v", uet, t) - } - sw.Do("}\n", nil) - } -} - -// doStruct generates code for a struct or an alias to a struct. The generated code is -// is the same for both cases, i.e. it's the code for the underlying type. -func (g *genDeepCopy) doStruct(t *types.Type, sw *generator.SnippetWriter) { - ut := underlyingType(t) - - if deepCopyMethodOrDie(t) != nil || deepCopyIntoMethodOrDie(t) != nil { - sw.Do("*out = in.DeepCopy()\n", nil) - return - } - - // Simple copy covers a lot of cases. - sw.Do("*out = *in\n", nil) - - // Now fix-up fields as needed. - for _, m := range ut.Members { - ft := m.Type - uft := underlyingType(ft) - - args := generator.Args{ - "type": ft, - "kind": ft.Kind, - "name": m.Name, - } - dc, dci := deepCopyMethodOrDie(ft), deepCopyIntoMethodOrDie(ft) - switch { - case dc != nil || dci != nil: - // Note: a DeepCopyInto exists because it is added if DeepCopy is manually defined - leftPointer := ft.Kind == types.Pointer - rightPointer := !isReference(ft) - if dc != nil { - rightPointer = dc.Results[0].Kind == types.Pointer - } - if leftPointer == rightPointer { - sw.Do("out.$.name$ = in.$.name$.DeepCopy()\n", args) - } else if leftPointer { - sw.Do("x := in.$.name$.DeepCopy()\n", args) - sw.Do("out.$.name$ = = &x\n", args) - } else { - sw.Do("in.$.name$.DeepCopyInto(&out.$.name$)\n", args) - } - case uft.Kind == types.Builtin: - // the initial *out = *in was enough - case uft.Kind == types.Map, uft.Kind == types.Slice, uft.Kind == types.Pointer: - // Fixup non-nil reference-semantic types. - sw.Do("if in.$.name$ != nil {\n", args) - sw.Do("in, out := &in.$.name$, &out.$.name$\n", args) - g.generateFor(ft, sw) - sw.Do("}\n", nil) - case uft.Kind == types.Struct: - if ft.IsAssignable() { - sw.Do("out.$.name$ = in.$.name$\n", args) - } else { - sw.Do("in.$.name$.DeepCopyInto(&out.$.name$)\n", args) - } - case uft.Kind == types.Interface: - // Note: do not generate code that won't compile as `DeepCopyinterface{}()` is not a valid function - if uft.Name.Name == "interface{}" { - klog.Fatalf("DeepCopy of %q is unsupported. Instead, use named interfaces with DeepCopy as one of the methods.", uft.Name.Name) - } - sw.Do("if in.$.name$ != nil {\n", args) - // Note: if t.Elem has been an alias "J" of an interface "I" in Go, we will see it - // as kind Interface of name "J" here, i.e. generate val.DeepCopyJ(). The golang - // parser does not give us the underlying interface name. So we cannot do any better. - sw.Do(fmt.Sprintf("out.$.name$ = in.$.name$.DeepCopy%s()\n", uft.Name.Name), args) - sw.Do("}\n", nil) - default: - klog.Fatalf("Hit an unsupported type %v for %v, from %v", uft, ft, t) - } - } -} - -// doPointer generates code for a pointer or an alias to a pointer. The generated code is -// is the same for both cases, i.e. it's the code for the underlying type. -func (g *genDeepCopy) doPointer(t *types.Type, sw *generator.SnippetWriter) { - ut := underlyingType(t) - uet := underlyingType(ut.Elem) - - dc, dci := deepCopyMethodOrDie(ut.Elem), deepCopyIntoMethodOrDie(ut.Elem) - switch { - case dc != nil || dci != nil: - rightPointer := !isReference(ut.Elem) - if dc != nil { - rightPointer = dc.Results[0].Kind == types.Pointer - } - if rightPointer { - sw.Do("*out = (*in).DeepCopy()\n", nil) - } else { - sw.Do("x := (*in).DeepCopy()\n", nil) - sw.Do("*out = &x\n", nil) - } - case uet.IsAssignable(): - sw.Do("*out = new($.Elem|raw$)\n", ut) - sw.Do("**out = **in", nil) - case uet.Kind == types.Map, uet.Kind == types.Slice, uet.Kind == types.Pointer: - sw.Do("*out = new($.Elem|raw$)\n", ut) - sw.Do("if **in != nil {\n", nil) - sw.Do("in, out := *in, *out\n", nil) - g.generateFor(uet, sw) - sw.Do("}\n", nil) - case uet.Kind == types.Struct: - sw.Do("*out = new($.Elem|raw$)\n", ut) - sw.Do("(*in).DeepCopyInto(*out)\n", nil) - default: - klog.Fatalf("Hit an unsupported type %v for %v", uet, t) - } -} diff --git a/vendor/k8s.io/gengo/examples/defaulter-gen/generators/defaulter.go b/vendor/k8s.io/gengo/examples/defaulter-gen/generators/defaulter.go deleted file mode 100644 index 9ee7b79..0000000 --- a/vendor/k8s.io/gengo/examples/defaulter-gen/generators/defaulter.go +++ /dev/null @@ -1,832 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generators - -import ( - "bytes" - "fmt" - "io" - "path/filepath" - "reflect" - "strings" - - "k8s.io/gengo/args" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/klog" -) - -// CustomArgs is used tby the go2idl framework to pass args specific to this -// generator. -type CustomArgs struct { - ExtraPeerDirs []string // Always consider these as last-ditch possibilities for conversions. -} - -// These are the comment tags that carry parameters for defaulter generation. -const tagName = "k8s:defaulter-gen" -const intputTagName = "k8s:defaulter-gen-input" - -func extractTag(comments []string) []string { - return types.ExtractCommentTags("+", comments)[tagName] -} - -func extractInputTag(comments []string) []string { - return types.ExtractCommentTags("+", comments)[intputTagName] -} - -func checkTag(comments []string, require ...string) bool { - values := types.ExtractCommentTags("+", comments)[tagName] - if len(require) == 0 { - return len(values) == 1 && values[0] == "" - } - return reflect.DeepEqual(values, require) -} - -func defaultFnNamer() *namer.NameStrategy { - return &namer.NameStrategy{ - Prefix: "SetDefaults_", - Join: func(pre string, in []string, post string) string { - return pre + strings.Join(in, "_") + post - }, - } -} - -func objectDefaultFnNamer() *namer.NameStrategy { - return &namer.NameStrategy{ - Prefix: "SetObjectDefaults_", - Join: func(pre string, in []string, post string) string { - return pre + strings.Join(in, "_") + post - }, - } -} - -// NameSystems returns the name system used by the generators in this package. -func NameSystems() namer.NameSystems { - return namer.NameSystems{ - "public": namer.NewPublicNamer(1), - "raw": namer.NewRawNamer("", nil), - "defaultfn": defaultFnNamer(), - "objectdefaultfn": objectDefaultFnNamer(), - } -} - -// DefaultNameSystem returns the default name system for ordering the types to be -// processed by the generators in this package. -func DefaultNameSystem() string { - return "public" -} - -// defaults holds the declared defaulting functions for a given type (all defaulting functions -// are expected to be func(1)) -type defaults struct { - // object is the defaulter function for a top level type (typically one with TypeMeta) that - // invokes all child defaulters. May be nil if the object defaulter has not yet been generated. - object *types.Type - // base is a defaulter function defined for a type SetDefaults_Pod which does not invoke all - // child defaults - the base defaulter alone is insufficient to default a type - base *types.Type - // additional is zero or more defaulter functions of the form SetDefaults_Pod_XXXX that can be - // included in the Object defaulter. - additional []*types.Type -} - -// All of the types in conversions map are of type "DeclarationOf" with -// the underlying type being "Func". -type defaulterFuncMap map[*types.Type]defaults - -// Returns all manually-defined defaulting functions in the package. -func getManualDefaultingFunctions(context *generator.Context, pkg *types.Package, manualMap defaulterFuncMap) { - buffer := &bytes.Buffer{} - sw := generator.NewSnippetWriter(buffer, context, "$", "$") - - for _, f := range pkg.Functions { - if f.Underlying == nil || f.Underlying.Kind != types.Func { - klog.Errorf("Malformed function: %#v", f) - continue - } - if f.Underlying.Signature == nil { - klog.Errorf("Function without signature: %#v", f) - continue - } - signature := f.Underlying.Signature - // Check whether the function is defaulting function. - // Note that all of them have signature: - // object: func SetObjectDefaults_inType(*inType) - // base: func SetDefaults_inType(*inType) - // additional: func SetDefaults_inType_Qualifier(*inType) - if signature.Receiver != nil { - continue - } - if len(signature.Parameters) != 1 { - continue - } - if len(signature.Results) != 0 { - continue - } - inType := signature.Parameters[0] - if inType.Kind != types.Pointer { - continue - } - // Check if this is the primary defaulter. - args := defaultingArgsFromType(inType.Elem) - sw.Do("$.inType|defaultfn$", args) - switch { - case f.Name.Name == buffer.String(): - key := inType.Elem - // We might scan the same package twice, and that's OK. - v, ok := manualMap[key] - if ok && v.base != nil && v.base.Name.Package != pkg.Path { - panic(fmt.Sprintf("duplicate static defaulter defined: %#v", key)) - } - v.base = f - manualMap[key] = v - klog.V(6).Infof("found base defaulter function for %s from %s", key.Name, f.Name) - // Is one of the additional defaulters - a top level defaulter on a type that is - // also invoked. - case strings.HasPrefix(f.Name.Name, buffer.String()+"_"): - key := inType.Elem - v, ok := manualMap[key] - if ok { - exists := false - for _, existing := range v.additional { - if existing.Name == f.Name { - exists = true - break - } - } - if exists { - continue - } - } - v.additional = append(v.additional, f) - manualMap[key] = v - klog.V(6).Infof("found additional defaulter function for %s from %s", key.Name, f.Name) - } - buffer.Reset() - sw.Do("$.inType|objectdefaultfn$", args) - if f.Name.Name == buffer.String() { - key := inType.Elem - // We might scan the same package twice, and that's OK. - v, ok := manualMap[key] - if ok && v.base != nil && v.base.Name.Package != pkg.Path { - panic(fmt.Sprintf("duplicate static defaulter defined: %#v", key)) - } - v.object = f - manualMap[key] = v - klog.V(6).Infof("found object defaulter function for %s from %s", key.Name, f.Name) - } - buffer.Reset() - } -} - -func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { - boilerplate, err := arguments.LoadGoBoilerplate() - if err != nil { - klog.Fatalf("Failed loading boilerplate: %v", err) - } - - packages := generator.Packages{} - header := append([]byte(fmt.Sprintf("// +build !%s\n\n", arguments.GeneratedBuildTag)), boilerplate...) - - // Accumulate pre-existing default functions. - // TODO: This is too ad-hoc. We need a better way. - existingDefaulters := defaulterFuncMap{} - - buffer := &bytes.Buffer{} - sw := generator.NewSnippetWriter(buffer, context, "$", "$") - - // We are generating defaults only for packages that are explicitly - // passed as InputDir. - for _, i := range context.Inputs { - klog.V(5).Infof("considering pkg %q", i) - pkg := context.Universe[i] - if pkg == nil { - // If the input had no Go files, for example. - continue - } - // typesPkg is where the types that needs defaulter are defined. - // Sometimes it is different from pkg. For example, kubernetes core/v1 - // types are defined in vendor/k8s.io/api/core/v1, while pkg is at - // pkg/api/v1. - typesPkg := pkg - - // Add defaulting functions. - getManualDefaultingFunctions(context, pkg, existingDefaulters) - - var peerPkgs []string - if customArgs, ok := arguments.CustomArgs.(*CustomArgs); ok { - for _, pkg := range customArgs.ExtraPeerDirs { - if i := strings.Index(pkg, "/vendor/"); i != -1 { - pkg = pkg[i+len("/vendor/"):] - } - peerPkgs = append(peerPkgs, pkg) - } - } - // Make sure our peer-packages are added and fully parsed. - for _, pp := range peerPkgs { - context.AddDir(pp) - getManualDefaultingFunctions(context, context.Universe[pp], existingDefaulters) - } - - typesWith := extractTag(pkg.Comments) - shouldCreateObjectDefaulterFn := func(t *types.Type) bool { - if defaults, ok := existingDefaulters[t]; ok && defaults.object != nil { - // A default generator is defined - baseTypeName := "" - if defaults.base != nil { - baseTypeName = defaults.base.Name.String() - } - klog.V(5).Infof(" an object defaulter already exists as %s", baseTypeName) - return false - } - // opt-out - if checkTag(t.SecondClosestCommentLines, "false") { - return false - } - // opt-in - if checkTag(t.SecondClosestCommentLines, "true") { - return true - } - // For every k8s:defaulter-gen tag at the package level, interpret the value as a - // field name (like TypeMeta, ListMeta, ObjectMeta) and trigger defaulter generation - // for any type with any of the matching field names. Provides a more useful package - // level defaulting than global (because we only need defaulters on a subset of objects - - // usually those with TypeMeta). - if t.Kind == types.Struct && len(typesWith) > 0 { - for _, field := range t.Members { - for _, s := range typesWith { - if field.Name == s { - return true - } - } - } - } - return false - } - - // if the types are not in the same package where the defaulter functions to be generated - inputTags := extractInputTag(pkg.Comments) - if len(inputTags) > 1 { - panic(fmt.Sprintf("there could only be one input tag, got %#v", inputTags)) - } - if len(inputTags) == 1 { - var err error - typesPkg, err = context.AddDirectory(filepath.Join(pkg.Path, inputTags[0])) - if err != nil { - klog.Fatalf("cannot import package %s", inputTags[0]) - } - // update context.Order to the latest context.Universe - orderer := namer.Orderer{Namer: namer.NewPublicNamer(1)} - context.Order = orderer.OrderUniverse(context.Universe) - } - - newDefaulters := defaulterFuncMap{} - for _, t := range typesPkg.Types { - if !shouldCreateObjectDefaulterFn(t) { - continue - } - if namer.IsPrivateGoName(t.Name.Name) { - // We won't be able to convert to a private type. - klog.V(5).Infof(" found a type %v, but it is a private name", t) - continue - } - - // create a synthetic type we can use during generation - newDefaulters[t] = defaults{} - } - - // only generate defaulters for objects that actually have defined defaulters - // prevents empty defaulters from being registered - for { - promoted := 0 - for t, d := range newDefaulters { - if d.object != nil { - continue - } - if newCallTreeForType(existingDefaulters, newDefaulters).build(t, true) != nil { - args := defaultingArgsFromType(t) - sw.Do("$.inType|objectdefaultfn$", args) - newDefaulters[t] = defaults{ - object: &types.Type{ - Name: types.Name{ - Package: pkg.Path, - Name: buffer.String(), - }, - Kind: types.Func, - }, - } - buffer.Reset() - promoted++ - } - } - if promoted != 0 { - continue - } - - // prune any types that were not used - for t, d := range newDefaulters { - if d.object == nil { - klog.V(6).Infof("did not generate defaulter for %s because no child defaulters were registered", t.Name) - delete(newDefaulters, t) - } - } - break - } - - if len(newDefaulters) == 0 { - klog.V(5).Infof("no defaulters in package %s", pkg.Name) - } - - path := pkg.Path - // if the source path is within a /vendor/ directory (for example, - // k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/meta/v1), allow - // generation to output to the proper relative path (under vendor). - // Otherwise, the generator will create the file in the wrong location - // in the output directory. - // TODO: build a more fundamental concept in gengo for dealing with modifications - // to vendored packages. - if strings.HasPrefix(pkg.SourcePath, arguments.OutputBase) { - expandedPath := strings.TrimPrefix(pkg.SourcePath, arguments.OutputBase) - if strings.Contains(expandedPath, "/vendor/") { - path = expandedPath - } - } - - packages = append(packages, - &generator.DefaultPackage{ - PackageName: filepath.Base(pkg.Path), - PackagePath: path, - HeaderText: header, - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - return []generator.Generator{ - NewGenDefaulter(arguments.OutputFileBaseName, typesPkg.Path, pkg.Path, existingDefaulters, newDefaulters, peerPkgs), - } - }, - FilterFunc: func(c *generator.Context, t *types.Type) bool { - return t.Name.Package == typesPkg.Path - }, - }) - } - return packages -} - -// callTreeForType contains fields necessary to build a tree for types. -type callTreeForType struct { - existingDefaulters defaulterFuncMap - newDefaulters defaulterFuncMap - currentlyBuildingTypes map[*types.Type]bool -} - -func newCallTreeForType(existingDefaulters, newDefaulters defaulterFuncMap) *callTreeForType { - return &callTreeForType{ - existingDefaulters: existingDefaulters, - newDefaulters: newDefaulters, - currentlyBuildingTypes: make(map[*types.Type]bool), - } -} - -// build creates a tree of paths to fields (based on how they would be accessed in Go - pointer, elem, -// slice, or key) and the functions that should be invoked on each field. An in-order traversal of the resulting tree -// can be used to generate a Go function that invokes each nested function on the appropriate type. The return -// value may be nil if there are no functions to call on type or the type is a primitive (Defaulters can only be -// invoked on structs today). When root is true this function will not use a newDefaulter. existingDefaulters should -// contain all defaulting functions by type defined in code - newDefaulters should contain all object defaulters -// that could be or will be generated. If newDefaulters has an entry for a type, but the 'object' field is nil, -// this function skips adding that defaulter - this allows us to avoid generating object defaulter functions for -// list types that call empty defaulters. -func (c *callTreeForType) build(t *types.Type, root bool) *callNode { - parent := &callNode{} - - if root { - // the root node is always a pointer - parent.elem = true - } - - defaults, _ := c.existingDefaulters[t] - newDefaults, generated := c.newDefaulters[t] - switch { - case !root && generated && newDefaults.object != nil: - parent.call = append(parent.call, newDefaults.object) - // if we will be generating the defaulter, it by definition is a covering - // defaulter, so we halt recursion - klog.V(6).Infof("the defaulter %s will be generated as an object defaulter", t.Name) - return parent - - case defaults.object != nil: - // object defaulters are always covering - parent.call = append(parent.call, defaults.object) - return parent - - case defaults.base != nil: - parent.call = append(parent.call, defaults.base) - // if the base function indicates it "covers" (it already includes defaulters) - // we can halt recursion - if checkTag(defaults.base.CommentLines, "covers") { - klog.V(6).Infof("the defaulter %s indicates it covers all sub generators", t.Name) - return parent - } - } - - // base has been added already, now add any additional defaulters defined for this object - parent.call = append(parent.call, defaults.additional...) - - // if the type already exists, don't build the tree for it and don't generate anything. - // This is used to avoid recursion for nested recursive types. - if c.currentlyBuildingTypes[t] { - return nil - } - // if type doesn't exist, mark it as existing - c.currentlyBuildingTypes[t] = true - - defer func() { - // The type will now acts as a parent, not a nested recursive type. - // We can now build the tree for it safely. - c.currentlyBuildingTypes[t] = false - }() - - switch t.Kind { - case types.Pointer: - if child := c.build(t.Elem, false); child != nil { - child.elem = true - parent.children = append(parent.children, *child) - } - case types.Slice, types.Array: - if child := c.build(t.Elem, false); child != nil { - child.index = true - if t.Elem.Kind == types.Pointer { - child.elem = true - } - parent.children = append(parent.children, *child) - } - case types.Map: - if child := c.build(t.Elem, false); child != nil { - child.key = true - parent.children = append(parent.children, *child) - } - case types.Struct: - for _, field := range t.Members { - name := field.Name - if len(name) == 0 { - if field.Type.Kind == types.Pointer { - name = field.Type.Elem.Name.Name - } else { - name = field.Type.Name.Name - } - } - if child := c.build(field.Type, false); child != nil { - child.field = name - parent.children = append(parent.children, *child) - } - } - case types.Alias: - if child := c.build(t.Underlying, false); child != nil { - parent.children = append(parent.children, *child) - } - } - if len(parent.children) == 0 && len(parent.call) == 0 { - //klog.V(6).Infof("decided type %s needs no generation", t.Name) - return nil - } - return parent -} - -const ( - runtimePackagePath = "k8s.io/apimachinery/pkg/runtime" - conversionPackagePath = "k8s.io/apimachinery/pkg/conversion" -) - -// genDefaulter produces a file with a autogenerated conversions. -type genDefaulter struct { - generator.DefaultGen - typesPackage string - outputPackage string - peerPackages []string - newDefaulters defaulterFuncMap - existingDefaulters defaulterFuncMap - imports namer.ImportTracker - typesForInit []*types.Type -} - -func NewGenDefaulter(sanitizedName, typesPackage, outputPackage string, existingDefaulters, newDefaulters defaulterFuncMap, peerPkgs []string) generator.Generator { - return &genDefaulter{ - DefaultGen: generator.DefaultGen{ - OptionalName: sanitizedName, - }, - typesPackage: typesPackage, - outputPackage: outputPackage, - peerPackages: peerPkgs, - newDefaulters: newDefaulters, - existingDefaulters: existingDefaulters, - imports: generator.NewImportTracker(), - typesForInit: make([]*types.Type, 0), - } -} - -func (g *genDefaulter) Namers(c *generator.Context) namer.NameSystems { - // Have the raw namer for this file track what it imports. - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *genDefaulter) isOtherPackage(pkg string) bool { - if pkg == g.outputPackage { - return false - } - if strings.HasSuffix(pkg, `"`+g.outputPackage+`"`) { - return false - } - return true -} - -func (g *genDefaulter) Filter(c *generator.Context, t *types.Type) bool { - defaults, ok := g.newDefaulters[t] - if !ok || defaults.object == nil { - return false - } - g.typesForInit = append(g.typesForInit, t) - return true -} - -func (g *genDefaulter) Imports(c *generator.Context) (imports []string) { - var importLines []string - for _, singleImport := range g.imports.ImportLines() { - if g.isOtherPackage(singleImport) { - importLines = append(importLines, singleImport) - } - } - return importLines -} - -func (g *genDefaulter) Init(c *generator.Context, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - - scheme := c.Universe.Type(types.Name{Package: runtimePackagePath, Name: "Scheme"}) - schemePtr := &types.Type{ - Kind: types.Pointer, - Elem: scheme, - } - sw.Do("// RegisterDefaults adds defaulters functions to the given scheme.\n", nil) - sw.Do("// Public to allow building arbitrary schemes.\n", nil) - sw.Do("// All generated defaulters are covering - they call all nested defaulters.\n", nil) - sw.Do("func RegisterDefaults(scheme $.|raw$) error {\n", schemePtr) - for _, t := range g.typesForInit { - args := defaultingArgsFromType(t) - sw.Do("scheme.AddTypeDefaultingFunc(&$.inType|raw${}, func(obj interface{}) { $.inType|objectdefaultfn$(obj.(*$.inType|raw$)) })\n", args) - } - sw.Do("return nil\n", nil) - sw.Do("}\n\n", nil) - return sw.Error() -} - -func (g *genDefaulter) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - if _, ok := g.newDefaulters[t]; !ok { - return nil - } - - klog.V(5).Infof("generating for type %v", t) - - callTree := newCallTreeForType(g.existingDefaulters, g.newDefaulters).build(t, true) - if callTree == nil { - klog.V(5).Infof(" no defaulters defined") - return nil - } - i := 0 - callTree.VisitInOrder(func(ancestors []*callNode, current *callNode) { - if len(current.call) == 0 { - return - } - path := callPath(append(ancestors, current)) - klog.V(5).Infof(" %d: %s", i, path) - i++ - }) - - sw := generator.NewSnippetWriter(w, c, "$", "$") - g.generateDefaulter(t, callTree, sw) - return sw.Error() -} - -func defaultingArgsFromType(inType *types.Type) generator.Args { - return generator.Args{ - "inType": inType, - } -} - -func (g *genDefaulter) generateDefaulter(inType *types.Type, callTree *callNode, sw *generator.SnippetWriter) { - sw.Do("func $.inType|objectdefaultfn$(in *$.inType|raw$) {\n", defaultingArgsFromType(inType)) - callTree.WriteMethod("in", 0, nil, sw) - sw.Do("}\n\n", nil) -} - -// callNode represents an entry in a tree of Go type accessors - the path from the root to a leaf represents -// how in Go code an access would be performed. For example, if a defaulting function exists on a container -// lifecycle hook, to invoke that defaulter correctly would require this Go code: -// -// for i := range pod.Spec.Containers { -// o := &pod.Spec.Containers[i] -// if o.LifecycleHook != nil { -// SetDefaults_LifecycleHook(o.LifecycleHook) -// } -// } -// -// That would be represented by a call tree like: -// -// callNode -// field: "Spec" -// children: -// - field: "Containers" -// children: -// - index: true -// children: -// - field: "LifecycleHook" -// elem: true -// call: -// - SetDefaults_LifecycleHook -// -// which we can traverse to build that Go struct (you must call the field Spec, then Containers, then range over -// that field, then check whether the LifecycleHook field is nil, before calling SetDefaults_LifecycleHook on -// the pointer to that field). -type callNode struct { - // field is the name of the Go member to access - field string - // key is true if this is a map and we must range over the key and values - key bool - // index is true if this is a slice and we must range over the slice values - index bool - // elem is true if the previous elements refer to a pointer (typically just field) - elem bool - - // call is all of the functions that must be invoked on this particular node, in order - call []*types.Type - // children is the child call nodes that must also be traversed - children []callNode -} - -// CallNodeVisitorFunc is a function for visiting a call tree. ancestors is the list of all parents -// of this node to the root of the tree - will be empty at the root. -type CallNodeVisitorFunc func(ancestors []*callNode, node *callNode) - -func (n *callNode) VisitInOrder(fn CallNodeVisitorFunc) { - n.visitInOrder(nil, fn) -} - -func (n *callNode) visitInOrder(ancestors []*callNode, fn CallNodeVisitorFunc) { - fn(ancestors, n) - ancestors = append(ancestors, n) - for i := range n.children { - n.children[i].visitInOrder(ancestors, fn) - } -} - -var ( - indexVariables = "ijklmnop" - localVariables = "abcdefgh" -) - -// varsForDepth creates temporary variables guaranteed to be unique within lexical Go scopes -// of this depth in a function. It uses canonical Go loop variables for the first 7 levels -// and then resorts to uglier prefixes. -func varsForDepth(depth int) (index, local string) { - if depth > len(indexVariables) { - index = fmt.Sprintf("i%d", depth) - } else { - index = indexVariables[depth : depth+1] - } - if depth > len(localVariables) { - local = fmt.Sprintf("local%d", depth) - } else { - local = localVariables[depth : depth+1] - } - return -} - -// writeCalls generates a list of function calls based on the calls field for the provided variable -// name and pointer. -func (n *callNode) writeCalls(varName string, isVarPointer bool, sw *generator.SnippetWriter) { - accessor := varName - if !isVarPointer { - accessor = "&" + accessor - } - for _, fn := range n.call { - sw.Do("$.fn|raw$($.var$)\n", generator.Args{ - "fn": fn, - "var": accessor, - }) - } -} - -// WriteMethod performs an in-order traversal of the calltree, generating loops and if blocks as necessary -// to correctly turn the call tree into a method body that invokes all calls on all child nodes of the call tree. -// Depth is used to generate local variables at the proper depth. -func (n *callNode) WriteMethod(varName string, depth int, ancestors []*callNode, sw *generator.SnippetWriter) { - // if len(n.call) > 0 { - // sw.Do(fmt.Sprintf("// %s\n", callPath(append(ancestors, n)).String()), nil) - // } - - if len(n.field) > 0 { - varName = varName + "." + n.field - } - - index, local := varsForDepth(depth) - vars := generator.Args{ - "index": index, - "local": local, - "var": varName, - } - - isPointer := n.elem && !n.index - if isPointer && len(ancestors) > 0 { - sw.Do("if $.var$ != nil {\n", vars) - } - - switch { - case n.index: - sw.Do("for $.index$ := range $.var$ {\n", vars) - if n.elem { - sw.Do("$.local$ := $.var$[$.index$]\n", vars) - } else { - sw.Do("$.local$ := &$.var$[$.index$]\n", vars) - } - - n.writeCalls(local, true, sw) - for i := range n.children { - n.children[i].WriteMethod(local, depth+1, append(ancestors, n), sw) - } - sw.Do("}\n", nil) - case n.key: - default: - n.writeCalls(varName, isPointer, sw) - for i := range n.children { - n.children[i].WriteMethod(varName, depth, append(ancestors, n), sw) - } - } - - if isPointer && len(ancestors) > 0 { - sw.Do("}\n", nil) - } -} - -type callPath []*callNode - -// String prints a representation of a callPath that roughly approximates what a Go accessor -// would look like. Used for debugging only. -func (path callPath) String() string { - if len(path) == 0 { - return "" - } - var parts []string - for _, p := range path { - last := len(parts) - 1 - switch { - case p.elem: - if len(parts) > 0 { - parts[last] = "*" + parts[last] - } else { - parts = append(parts, "*") - } - case p.index: - if len(parts) > 0 { - parts[last] = parts[last] + "[i]" - } else { - parts = append(parts, "[i]") - } - case p.key: - if len(parts) > 0 { - parts[last] = parts[last] + "[key]" - } else { - parts = append(parts, "[key]") - } - default: - if len(p.field) > 0 { - parts = append(parts, p.field) - } else { - parts = append(parts, "") - } - } - } - var calls []string - for _, fn := range path[len(path)-1].call { - calls = append(calls, fn.Name.String()) - } - if len(calls) == 0 { - calls = append(calls, "") - } - - return strings.Join(parts, ".") + " calls " + strings.Join(calls, ", ") -} diff --git a/vendor/k8s.io/gengo/examples/import-boss/generators/import_restrict.go b/vendor/k8s.io/gengo/examples/import-boss/generators/import_restrict.go deleted file mode 100644 index 308bb6b..0000000 --- a/vendor/k8s.io/gengo/examples/import-boss/generators/import_restrict.go +++ /dev/null @@ -1,419 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package generators has the generators for the import-boss utility. -package generators - -import ( - "encoding/json" - "errors" - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "regexp" - "sort" - "strings" - - "k8s.io/gengo/args" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - "sigs.k8s.io/yaml" - - "k8s.io/klog" -) - -const ( - goModFile = "go.mod" - importBossFileType = "import-boss" -) - -// NameSystems returns the name system used by the generators in this package. -func NameSystems() namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer("", nil), - } -} - -// DefaultNameSystem returns the default name system for ordering the types to be -// processed by the generators in this package. -func DefaultNameSystem() string { - return "raw" -} - -// Packages makes the import-boss package definition. -func Packages(c *generator.Context, arguments *args.GeneratorArgs) generator.Packages { - pkgs := generator.Packages{} - c.FileTypes = map[string]generator.FileType{ - importBossFileType: importRuleFile{c}, - } - - for _, p := range c.Universe { - if !arguments.InputIncludes(p) { - // Don't run on e.g. third party dependencies. - continue - } - savedPackage := p - pkgs = append(pkgs, &generator.DefaultPackage{ - PackageName: p.Name, - PackagePath: p.Path, - Source: p.SourcePath, - // GeneratorFunc returns a list of generators. Each generator makes a - // single file. - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - return []generator.Generator{&importRules{ - myPackage: savedPackage, - }} - }, - FilterFunc: func(c *generator.Context, t *types.Type) bool { - return false - }, - }) - } - - return pkgs -} - -// A single import restriction rule. -type Rule struct { - // All import paths that match this regexp... - SelectorRegexp string - // ... must have one of these prefixes ... - AllowedPrefixes []string - // ... and must not have one of these prefixes. - ForbiddenPrefixes []string -} - -type InverseRule struct { - Rule - // True if the rule is to be applied to transitive imports. - Transitive bool -} - -type fileFormat struct { - CurrentImports []string - - Rules []Rule - InverseRules []InverseRule - - path string -} - -func readFile(path string) (*fileFormat, error) { - currentBytes, err := ioutil.ReadFile(path) - if err != nil { - return nil, fmt.Errorf("couldn't read %v: %v", path, err) - } - - var current fileFormat - err = yaml.Unmarshal(currentBytes, ¤t) - if err != nil { - return nil, fmt.Errorf("couldn't unmarshal %v: %v", path, err) - } - current.path = path - return ¤t, nil -} - -func writeFile(path string, ff *fileFormat) error { - raw, err := json.MarshalIndent(ff, "", "\t") - if err != nil { - return fmt.Errorf("couldn't format data for file %v.\n%#v", path, ff) - } - f, err := os.Create(path) - if err != nil { - return fmt.Errorf("couldn't open %v for writing: %v", path, err) - } - defer f.Close() - _, err = f.Write(raw) - return err -} - -// This does the actual checking, since it knows the literal destination file. -type importRuleFile struct { - context *generator.Context -} - -func (irf importRuleFile) AssembleFile(f *generator.File, path string) error { - return irf.VerifyFile(f, path) -} - -// TODO: make a flag to enable this, or expose this information in some other way. -func (importRuleFile) listEntireImportTree(f *generator.File, path string) error { - // If the file exists, populate its current imports. This is mostly to help - // humans figure out what they need to fix. - if _, err := os.Stat(path); err != nil { - // Ignore packages which haven't opted in by adding an .import-restrictions file. - return nil - } - - current, err := readFile(path) - if err != nil { - return err - } - - current.CurrentImports = []string{} - for v := range f.Imports { - current.CurrentImports = append(current.CurrentImports, v) - } - sort.Strings(current.CurrentImports) - - return writeFile(path, current) -} - -// removeLastDir removes the last directory, but leaves the file name -// unchanged. It returns the new path and the removed directory. So: -// "a/b/c/file" -> ("a/b/file", "c") -func removeLastDir(path string) (newPath, removedDir string) { - dir, file := filepath.Split(path) - dir = strings.TrimSuffix(dir, string(filepath.Separator)) - return filepath.Join(filepath.Dir(dir), file), filepath.Base(dir) -} - -// isGoModRoot checks if a directory is the root directory for a package -// by checking for the existence of a 'go.mod' file in that directory. -func isGoModRoot(path string) bool { - _, err := os.Stat(filepath.Join(filepath.Dir(path), goModFile)) - return err == nil -} - -// recursiveRead collects all '.import-restriction' files, between the current directory, -// and the package root when Go modules are enabled, or $GOPATH/src when they are not. -func recursiveRead(path string) ([]*fileFormat, error) { - restrictionFiles := make([]*fileFormat, 0) - - for { - if _, err := os.Stat(path); err == nil { - rules, err := readFile(path) - if err != nil { - return nil, err - } - - restrictionFiles = append(restrictionFiles, rules) - } - - nextPath, removedDir := removeLastDir(path) - if nextPath == path || isGoModRoot(path) || removedDir == "src" { - break - } - - path = nextPath - } - - return restrictionFiles, nil -} - -func (irf importRuleFile) VerifyFile(f *generator.File, path string) error { - restrictionFiles, err := recursiveRead(filepath.Join(f.PackageSourcePath, f.Name)) - if err != nil { - return fmt.Errorf("error finding rules file: %v", err) - } - - if err := irf.verifyRules(restrictionFiles, f); err != nil { - return err - } - - return irf.verifyInverseRules(restrictionFiles, f) -} - -func (irf importRuleFile) verifyRules(restrictionFiles []*fileFormat, f *generator.File) error { - selectors := make([][]*regexp.Regexp, len(restrictionFiles)) - for i, restrictionFile := range restrictionFiles { - for _, r := range restrictionFile.Rules { - re, err := regexp.Compile(r.SelectorRegexp) - if err != nil { - return fmt.Errorf("regexp `%s` in file %q doesn't compile: %v", r.SelectorRegexp, restrictionFile.path, err) - } - - selectors[i] = append(selectors[i], re) - } - } - - forbiddenImports := map[string]string{} - allowedMismatchedImports := []string{} - - for v := range f.Imports { - explicitlyAllowed := false - - NextRestrictionFiles: - for i, rules := range restrictionFiles { - for j, r := range rules.Rules { - matching := selectors[i][j].MatchString(v) - klog.V(5).Infof("Checking %v matches %v: %v\n", r.SelectorRegexp, v, matching) - if !matching { - continue - } - for _, forbidden := range r.ForbiddenPrefixes { - klog.V(4).Infof("Checking %v against %v\n", v, forbidden) - if strings.HasPrefix(v, forbidden) { - forbiddenImports[v] = forbidden - } - } - for _, allowed := range r.AllowedPrefixes { - klog.V(4).Infof("Checking %v against %v\n", v, allowed) - if strings.HasPrefix(v, allowed) { - explicitlyAllowed = true - break - } - } - - if !explicitlyAllowed { - allowedMismatchedImports = append(allowedMismatchedImports, v) - } else { - klog.V(2).Infof("%v importing %v allowed by %v\n", f.PackagePath, v, restrictionFiles[i].path) - break NextRestrictionFiles - } - } - } - } - - if len(forbiddenImports) > 0 || len(allowedMismatchedImports) > 0 { - var errorBuilder strings.Builder - for i, f := range forbiddenImports { - fmt.Fprintf(&errorBuilder, "import %v has forbidden prefix %v\n", i, f) - } - if len(allowedMismatchedImports) > 0 { - sort.Sort(sort.StringSlice(allowedMismatchedImports)) - fmt.Fprintf(&errorBuilder, "the following imports did not match any allowed prefix:\n") - for _, i := range allowedMismatchedImports { - fmt.Fprintf(&errorBuilder, " %v\n", i) - } - } - return errors.New(errorBuilder.String()) - } - - return nil -} - -// verifyInverseRules checks that all packages that import a package are allowed to import it. -func (irf importRuleFile) verifyInverseRules(restrictionFiles []*fileFormat, f *generator.File) error { - // compile all Selector regex in all restriction files - selectors := make([][]*regexp.Regexp, len(restrictionFiles)) - for i, restrictionFile := range restrictionFiles { - for _, r := range restrictionFile.InverseRules { - re, err := regexp.Compile(r.SelectorRegexp) - if err != nil { - return fmt.Errorf("regexp `%s` in file %q doesn't compile: %v", r.SelectorRegexp, restrictionFile.path, err) - } - - selectors[i] = append(selectors[i], re) - } - } - - directImport := map[string]bool{} - for _, imp := range irf.context.IncomingImports()[f.PackagePath] { - directImport[imp] = true - } - - forbiddenImports := map[string]string{} - allowedMismatchedImports := []string{} - - for _, v := range irf.context.TransitiveIncomingImports()[f.PackagePath] { - explicitlyAllowed := false - - NextRestrictionFiles: - for i, rules := range restrictionFiles { - for j, r := range rules.InverseRules { - if !r.Transitive && !directImport[v] { - continue - } - - re := selectors[i][j] - matching := re.MatchString(v) - klog.V(4).Infof("Checking %v matches %v (importing %v: %v\n", r.SelectorRegexp, v, f.PackagePath, matching) - if !matching { - continue - } - for _, forbidden := range r.ForbiddenPrefixes { - klog.V(4).Infof("Checking %v against %v\n", v, forbidden) - if strings.HasPrefix(v, forbidden) { - forbiddenImports[v] = forbidden - } - } - for _, allowed := range r.AllowedPrefixes { - klog.V(4).Infof("Checking %v against %v\n", v, allowed) - if strings.HasPrefix(v, allowed) { - explicitlyAllowed = true - break - } - } - if !explicitlyAllowed { - allowedMismatchedImports = append(allowedMismatchedImports, v) - } else { - klog.V(2).Infof("%v importing %v allowed by %v\n", v, f.PackagePath, restrictionFiles[i].path) - break NextRestrictionFiles - } - } - } - } - - if len(forbiddenImports) > 0 || len(allowedMismatchedImports) > 0 { - var errorBuilder strings.Builder - for i, f := range forbiddenImports { - fmt.Fprintf(&errorBuilder, "(inverse): import %v has forbidden prefix %v\n", i, f) - } - if len(allowedMismatchedImports) > 0 { - sort.Sort(sort.StringSlice(allowedMismatchedImports)) - fmt.Fprintf(&errorBuilder, "(inverse): the following imports did not match any allowed prefix:\n") - for _, i := range allowedMismatchedImports { - fmt.Fprintf(&errorBuilder, " %v\n", i) - } - } - return errors.New(errorBuilder.String()) - } - - return nil -} - -// importRules produces a file with a set for a single type. -type importRules struct { - myPackage *types.Package - imports namer.ImportTracker -} - -var ( - _ = generator.Generator(&importRules{}) - _ = generator.FileType(importRuleFile{}) -) - -func (r *importRules) Name() string { return "import rules" } -func (r *importRules) Filter(*generator.Context, *types.Type) bool { return false } -func (r *importRules) Namers(*generator.Context) namer.NameSystems { return nil } -func (r *importRules) PackageVars(*generator.Context) []string { return []string{} } -func (r *importRules) PackageConsts(*generator.Context) []string { return []string{} } -func (r *importRules) GenerateType(*generator.Context, *types.Type, io.Writer) error { return nil } -func (r *importRules) Filename() string { return ".import-restrictions" } -func (r *importRules) FileType() string { return importBossFileType } -func (r *importRules) Init(c *generator.Context, w io.Writer) error { return nil } -func (r *importRules) Finalize(*generator.Context, io.Writer) error { return nil } - -func dfsImports(dest *[]string, seen map[string]bool, p *types.Package) { - for _, p2 := range p.Imports { - if seen[p2.Path] { - continue - } - seen[p2.Path] = true - dfsImports(dest, seen, p2) - *dest = append(*dest, p2.Path) - } -} - -func (r *importRules) Imports(*generator.Context) []string { - all := []string{} - dfsImports(&all, map[string]bool{}, r.myPackage) - return all -} diff --git a/vendor/k8s.io/gengo/examples/set-gen/generators/sets.go b/vendor/k8s.io/gengo/examples/set-gen/generators/sets.go deleted file mode 100644 index 8ddce7e..0000000 --- a/vendor/k8s.io/gengo/examples/set-gen/generators/sets.go +++ /dev/null @@ -1,362 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package generators has the generators for the set-gen utility. -package generators - -import ( - "io" - - "k8s.io/gengo/args" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/klog" -) - -// NameSystems returns the name system used by the generators in this package. -func NameSystems() namer.NameSystems { - return namer.NameSystems{ - "public": namer.NewPublicNamer(0), - "private": namer.NewPrivateNamer(0), - "raw": namer.NewRawNamer("", nil), - } -} - -// DefaultNameSystem returns the default name system for ordering the types to be -// processed by the generators in this package. -func DefaultNameSystem() string { - return "public" -} - -// Packages makes the sets package definition. -func Packages(_ *generator.Context, arguments *args.GeneratorArgs) generator.Packages { - boilerplate, err := arguments.LoadGoBoilerplate() - if err != nil { - klog.Fatalf("Failed loading boilerplate: %v", err) - } - - return generator.Packages{&generator.DefaultPackage{ - PackageName: "sets", - PackagePath: arguments.OutputPackagePath, - HeaderText: boilerplate, - PackageDocumentation: []byte( - `// Package sets has auto-generated set types. -`), - // GeneratorFunc returns a list of generators. Each generator makes a - // single file. - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - generators = []generator.Generator{ - // Always generate a "doc.go" file. - generator.DefaultGen{OptionalName: "doc"}, - // Make a separate file for the Empty type, since it's shared by every type. - generator.DefaultGen{ - OptionalName: "empty", - OptionalBody: []byte(emptyTypeDecl), - }, - } - // Since we want a file per type that we generate a set for, we - // have to provide a function for this. - for _, t := range c.Order { - generators = append(generators, &genSet{ - DefaultGen: generator.DefaultGen{ - // Use the privatized version of the - // type name as the file name. - // - // TODO: make a namer that converts - // camelCase to '-' separation for file - // names? - OptionalName: c.Namers["private"].Name(t), - }, - outputPackage: arguments.OutputPackagePath, - typeToMatch: t, - imports: generator.NewImportTracker(), - }) - } - return generators - }, - FilterFunc: func(c *generator.Context, t *types.Type) bool { - // It would be reasonable to filter by the type's package here. - // It might be necessary if your input directory has a big - // import graph. - switch t.Kind { - case types.Map, types.Slice, types.Pointer: - // These types can't be keys in a map. - return false - case types.Builtin: - return true - case types.Struct: - // Only some structs can be keys in a map. This is triggered by the line - // // +genset - // or - // // +genset=true - return extractBoolTagOrDie("genset", t.CommentLines) == true - } - return false - }, - }} -} - -// genSet produces a file with a set for a single type. -type genSet struct { - generator.DefaultGen - outputPackage string - typeToMatch *types.Type - imports namer.ImportTracker -} - -// Filter ignores all but one type because we're making a single file per type. -func (g *genSet) Filter(c *generator.Context, t *types.Type) bool { return t == g.typeToMatch } - -func (g *genSet) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *genSet) Imports(c *generator.Context) (imports []string) { - return append(g.imports.ImportLines(), "reflect", "sort") -} - -// args constructs arguments for templates. Usage: -// g.args(t, "key1", value1, "key2", value2, ...) -// -// 't' is loaded with the key 'type'. -// -// We could use t directly as the argument, but doing it this way makes it easy -// to mix in additional parameters. This feature is not used in this set -// generator, but is present as an example. -func (g *genSet) args(t *types.Type, kv ...interface{}) interface{} { - m := map[interface{}]interface{}{"type": t} - for i := 0; i < len(kv)/2; i++ { - m[kv[i*2]] = kv[i*2+1] - } - return m -} - -// GenerateType makes the body of a file implementing a set for type t. -func (g *genSet) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - sw.Do(setCode, g.args(t)) - sw.Do("func less$.type|public$(lhs, rhs $.type|raw$) bool {\n", g.args(t)) - g.lessBody(sw, t) - sw.Do("}\n", g.args(t)) - return sw.Error() -} - -func (g *genSet) lessBody(sw *generator.SnippetWriter, t *types.Type) { - // TODO: make this recursive, handle pointers and multiple nested structs... - switch t.Kind { - case types.Struct: - for _, m := range types.FlattenMembers(t.Members) { - sw.Do("if lhs.$.Name$ < rhs.$.Name$ { return true }\n", m) - sw.Do("if lhs.$.Name$ > rhs.$.Name$ { return false }\n", m) - } - sw.Do("return false\n", nil) - default: - sw.Do("return lhs < rhs\n", nil) - } -} - -// written to the "empty.go" file. -var emptyTypeDecl = ` -// Empty is public since it is used by some internal API objects for conversions between external -// string arrays and internal sets, and conversion logic requires public types today. -type Empty struct{} -` - -// Written for every type. If you've never used text/template before: -// $.type$ refers to the source type; |public means to -// call the function giving the public name, |raw the raw type name. -var setCode = `// sets.$.type|public$ is a set of $.type|raw$s, implemented via map[$.type|raw$]struct{} for minimal memory consumption. -type $.type|public$ map[$.type|raw$]Empty - -// New$.type|public$ creates a $.type|public$ from a list of values. -func New$.type|public$(items ...$.type|raw$) $.type|public$ { - ss := $.type|public${} - ss.Insert(items...) - return ss -} - -// $.type|public$KeySet creates a $.type|public$ from a keys of a map[$.type|raw$](? extends interface{}). -// If the value passed in is not actually a map, this will panic. -func $.type|public$KeySet(theMap interface{}) $.type|public$ { - v := reflect.ValueOf(theMap) - ret := $.type|public${} - - for _, keyValue := range v.MapKeys() { - ret.Insert(keyValue.Interface().($.type|raw$)) - } - return ret -} - -// Insert adds items to the set. -func (s $.type|public$) Insert(items ...$.type|raw$) $.type|public$ { - for _, item := range items { - s[item] = Empty{} - } - return s -} - -// Delete removes all items from the set. -func (s $.type|public$) Delete(items ...$.type|raw$) $.type|public$ { - for _, item := range items { - delete(s, item) - } - return s -} - -// Has returns true if and only if item is contained in the set. -func (s $.type|public$) Has(item $.type|raw$) bool { - _, contained := s[item] - return contained -} - -// HasAll returns true if and only if all items are contained in the set. -func (s $.type|public$) HasAll(items ...$.type|raw$) bool { - for _, item := range items { - if !s.Has(item) { - return false - } - } - return true -} - -// HasAny returns true if any items are contained in the set. -func (s $.type|public$) HasAny(items ...$.type|raw$) bool { - for _, item := range items { - if s.Has(item) { - return true - } - } - return false -} - -// Difference returns a set of objects that are not in s2 -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.Difference(s2) = {a3} -// s2.Difference(s1) = {a4, a5} -func (s $.type|public$) Difference(s2 $.type|public$) $.type|public$ { - result := New$.type|public$() - for key := range s { - if !s2.Has(key) { - result.Insert(key) - } - } - return result -} - -// Union returns a new set which includes items in either s1 or s2. -// For example: -// s1 = {a1, a2} -// s2 = {a3, a4} -// s1.Union(s2) = {a1, a2, a3, a4} -// s2.Union(s1) = {a1, a2, a3, a4} -func (s1 $.type|public$) Union(s2 $.type|public$) $.type|public$ { - result := New$.type|public$() - for key := range s1 { - result.Insert(key) - } - for key := range s2 { - result.Insert(key) - } - return result -} - -// Intersection returns a new set which includes the item in BOTH s1 and s2 -// For example: -// s1 = {a1, a2} -// s2 = {a2, a3} -// s1.Intersection(s2) = {a2} -func (s1 $.type|public$) Intersection(s2 $.type|public$) $.type|public$ { - var walk, other $.type|public$ - result := New$.type|public$() - if s1.Len() < s2.Len() { - walk = s1 - other = s2 - } else { - walk = s2 - other = s1 - } - for key := range walk { - if other.Has(key) { - result.Insert(key) - } - } - return result -} - -// IsSuperset returns true if and only if s1 is a superset of s2. -func (s1 $.type|public$) IsSuperset(s2 $.type|public$) bool { - for item := range s2 { - if !s1.Has(item) { - return false - } - } - return true -} - -// Equal returns true if and only if s1 is equal (as a set) to s2. -// Two sets are equal if their membership is identical. -// (In practice, this means same elements, order doesn't matter) -func (s1 $.type|public$) Equal(s2 $.type|public$) bool { - return len(s1) == len(s2) && s1.IsSuperset(s2) -} - -type sortableSliceOf$.type|public$ []$.type|raw$ - -func (s sortableSliceOf$.type|public$) Len() int { return len(s) } -func (s sortableSliceOf$.type|public$) Less(i, j int) bool { return less$.type|public$(s[i], s[j]) } -func (s sortableSliceOf$.type|public$) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -// List returns the contents as a sorted $.type|raw$ slice. -func (s $.type|public$) List() []$.type|raw$ { - res := make(sortableSliceOf$.type|public$, 0, len(s)) - for key := range s { - res = append(res, key) - } - sort.Sort(res) - return []$.type|raw$(res) -} - -// UnsortedList returns the slice with contents in random order. -func (s $.type|public$) UnsortedList() []$.type|raw$ { - res :=make([]$.type|raw$, 0, len(s)) - for key := range s { - res = append(res, key) - } - return res -} - -// Returns a single element from the set. -func (s $.type|public$) PopAny() ($.type|raw$, bool) { - for key := range s { - s.Delete(key) - return key, true - } - var zeroValue $.type|raw$ - return zeroValue, false -} - -// Len returns the size of the set. -func (s $.type|public$) Len() int { - return len(s) -} - -` diff --git a/vendor/k8s.io/gengo/examples/set-gen/generators/tags.go b/vendor/k8s.io/gengo/examples/set-gen/generators/tags.go deleted file mode 100644 index bb3b4d2..0000000 --- a/vendor/k8s.io/gengo/examples/set-gen/generators/tags.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generators - -import ( - "k8s.io/gengo/types" - "k8s.io/klog" -) - -// extractBoolTagOrDie gets the comment-tags for the key and asserts that, if -// it exists, the value is boolean. If the tag did not exist, it returns -// false. -func extractBoolTagOrDie(key string, lines []string) bool { - val, err := types.ExtractSingleBoolCommentTag("+", key, false, lines) - if err != nil { - klog.Fatalf(err.Error()) - } - return val -} diff --git a/vendor/k8s.io/gengo/examples/set-gen/sets/byte.go b/vendor/k8s.io/gengo/examples/set-gen/sets/byte.go deleted file mode 100644 index 9bfa85d..0000000 --- a/vendor/k8s.io/gengo/examples/set-gen/sets/byte.go +++ /dev/null @@ -1,205 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by set-gen. DO NOT EDIT. - -package sets - -import ( - "reflect" - "sort" -) - -// sets.Byte is a set of bytes, implemented via map[byte]struct{} for minimal memory consumption. -type Byte map[byte]Empty - -// NewByte creates a Byte from a list of values. -func NewByte(items ...byte) Byte { - ss := Byte{} - ss.Insert(items...) - return ss -} - -// ByteKeySet creates a Byte from a keys of a map[byte](? extends interface{}). -// If the value passed in is not actually a map, this will panic. -func ByteKeySet(theMap interface{}) Byte { - v := reflect.ValueOf(theMap) - ret := Byte{} - - for _, keyValue := range v.MapKeys() { - ret.Insert(keyValue.Interface().(byte)) - } - return ret -} - -// Insert adds items to the set. -func (s Byte) Insert(items ...byte) Byte { - for _, item := range items { - s[item] = Empty{} - } - return s -} - -// Delete removes all items from the set. -func (s Byte) Delete(items ...byte) Byte { - for _, item := range items { - delete(s, item) - } - return s -} - -// Has returns true if and only if item is contained in the set. -func (s Byte) Has(item byte) bool { - _, contained := s[item] - return contained -} - -// HasAll returns true if and only if all items are contained in the set. -func (s Byte) HasAll(items ...byte) bool { - for _, item := range items { - if !s.Has(item) { - return false - } - } - return true -} - -// HasAny returns true if any items are contained in the set. -func (s Byte) HasAny(items ...byte) bool { - for _, item := range items { - if s.Has(item) { - return true - } - } - return false -} - -// Difference returns a set of objects that are not in s2 -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.Difference(s2) = {a3} -// s2.Difference(s1) = {a4, a5} -func (s Byte) Difference(s2 Byte) Byte { - result := NewByte() - for key := range s { - if !s2.Has(key) { - result.Insert(key) - } - } - return result -} - -// Union returns a new set which includes items in either s1 or s2. -// For example: -// s1 = {a1, a2} -// s2 = {a3, a4} -// s1.Union(s2) = {a1, a2, a3, a4} -// s2.Union(s1) = {a1, a2, a3, a4} -func (s1 Byte) Union(s2 Byte) Byte { - result := NewByte() - for key := range s1 { - result.Insert(key) - } - for key := range s2 { - result.Insert(key) - } - return result -} - -// Intersection returns a new set which includes the item in BOTH s1 and s2 -// For example: -// s1 = {a1, a2} -// s2 = {a2, a3} -// s1.Intersection(s2) = {a2} -func (s1 Byte) Intersection(s2 Byte) Byte { - var walk, other Byte - result := NewByte() - if s1.Len() < s2.Len() { - walk = s1 - other = s2 - } else { - walk = s2 - other = s1 - } - for key := range walk { - if other.Has(key) { - result.Insert(key) - } - } - return result -} - -// IsSuperset returns true if and only if s1 is a superset of s2. -func (s1 Byte) IsSuperset(s2 Byte) bool { - for item := range s2 { - if !s1.Has(item) { - return false - } - } - return true -} - -// Equal returns true if and only if s1 is equal (as a set) to s2. -// Two sets are equal if their membership is identical. -// (In practice, this means same elements, order doesn't matter) -func (s1 Byte) Equal(s2 Byte) bool { - return len(s1) == len(s2) && s1.IsSuperset(s2) -} - -type sortableSliceOfByte []byte - -func (s sortableSliceOfByte) Len() int { return len(s) } -func (s sortableSliceOfByte) Less(i, j int) bool { return lessByte(s[i], s[j]) } -func (s sortableSliceOfByte) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -// List returns the contents as a sorted byte slice. -func (s Byte) List() []byte { - res := make(sortableSliceOfByte, 0, len(s)) - for key := range s { - res = append(res, key) - } - sort.Sort(res) - return []byte(res) -} - -// UnsortedList returns the slice with contents in random order. -func (s Byte) UnsortedList() []byte { - res := make([]byte, 0, len(s)) - for key := range s { - res = append(res, key) - } - return res -} - -// Returns a single element from the set. -func (s Byte) PopAny() (byte, bool) { - for key := range s { - s.Delete(key) - return key, true - } - var zeroValue byte - return zeroValue, false -} - -// Len returns the size of the set. -func (s Byte) Len() int { - return len(s) -} - -func lessByte(lhs, rhs byte) bool { - return lhs < rhs -} diff --git a/vendor/k8s.io/gengo/examples/set-gen/sets/int.go b/vendor/k8s.io/gengo/examples/set-gen/sets/int.go deleted file mode 100644 index 88bd709..0000000 --- a/vendor/k8s.io/gengo/examples/set-gen/sets/int.go +++ /dev/null @@ -1,205 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by set-gen. DO NOT EDIT. - -package sets - -import ( - "reflect" - "sort" -) - -// sets.Int is a set of ints, implemented via map[int]struct{} for minimal memory consumption. -type Int map[int]Empty - -// NewInt creates a Int from a list of values. -func NewInt(items ...int) Int { - ss := Int{} - ss.Insert(items...) - return ss -} - -// IntKeySet creates a Int from a keys of a map[int](? extends interface{}). -// If the value passed in is not actually a map, this will panic. -func IntKeySet(theMap interface{}) Int { - v := reflect.ValueOf(theMap) - ret := Int{} - - for _, keyValue := range v.MapKeys() { - ret.Insert(keyValue.Interface().(int)) - } - return ret -} - -// Insert adds items to the set. -func (s Int) Insert(items ...int) Int { - for _, item := range items { - s[item] = Empty{} - } - return s -} - -// Delete removes all items from the set. -func (s Int) Delete(items ...int) Int { - for _, item := range items { - delete(s, item) - } - return s -} - -// Has returns true if and only if item is contained in the set. -func (s Int) Has(item int) bool { - _, contained := s[item] - return contained -} - -// HasAll returns true if and only if all items are contained in the set. -func (s Int) HasAll(items ...int) bool { - for _, item := range items { - if !s.Has(item) { - return false - } - } - return true -} - -// HasAny returns true if any items are contained in the set. -func (s Int) HasAny(items ...int) bool { - for _, item := range items { - if s.Has(item) { - return true - } - } - return false -} - -// Difference returns a set of objects that are not in s2 -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.Difference(s2) = {a3} -// s2.Difference(s1) = {a4, a5} -func (s Int) Difference(s2 Int) Int { - result := NewInt() - for key := range s { - if !s2.Has(key) { - result.Insert(key) - } - } - return result -} - -// Union returns a new set which includes items in either s1 or s2. -// For example: -// s1 = {a1, a2} -// s2 = {a3, a4} -// s1.Union(s2) = {a1, a2, a3, a4} -// s2.Union(s1) = {a1, a2, a3, a4} -func (s1 Int) Union(s2 Int) Int { - result := NewInt() - for key := range s1 { - result.Insert(key) - } - for key := range s2 { - result.Insert(key) - } - return result -} - -// Intersection returns a new set which includes the item in BOTH s1 and s2 -// For example: -// s1 = {a1, a2} -// s2 = {a2, a3} -// s1.Intersection(s2) = {a2} -func (s1 Int) Intersection(s2 Int) Int { - var walk, other Int - result := NewInt() - if s1.Len() < s2.Len() { - walk = s1 - other = s2 - } else { - walk = s2 - other = s1 - } - for key := range walk { - if other.Has(key) { - result.Insert(key) - } - } - return result -} - -// IsSuperset returns true if and only if s1 is a superset of s2. -func (s1 Int) IsSuperset(s2 Int) bool { - for item := range s2 { - if !s1.Has(item) { - return false - } - } - return true -} - -// Equal returns true if and only if s1 is equal (as a set) to s2. -// Two sets are equal if their membership is identical. -// (In practice, this means same elements, order doesn't matter) -func (s1 Int) Equal(s2 Int) bool { - return len(s1) == len(s2) && s1.IsSuperset(s2) -} - -type sortableSliceOfInt []int - -func (s sortableSliceOfInt) Len() int { return len(s) } -func (s sortableSliceOfInt) Less(i, j int) bool { return lessInt(s[i], s[j]) } -func (s sortableSliceOfInt) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -// List returns the contents as a sorted int slice. -func (s Int) List() []int { - res := make(sortableSliceOfInt, 0, len(s)) - for key := range s { - res = append(res, key) - } - sort.Sort(res) - return []int(res) -} - -// UnsortedList returns the slice with contents in random order. -func (s Int) UnsortedList() []int { - res := make([]int, 0, len(s)) - for key := range s { - res = append(res, key) - } - return res -} - -// Returns a single element from the set. -func (s Int) PopAny() (int, bool) { - for key := range s { - s.Delete(key) - return key, true - } - var zeroValue int - return zeroValue, false -} - -// Len returns the size of the set. -func (s Int) Len() int { - return len(s) -} - -func lessInt(lhs, rhs int) bool { - return lhs < rhs -} diff --git a/vendor/k8s.io/gengo/examples/set-gen/sets/int64.go b/vendor/k8s.io/gengo/examples/set-gen/sets/int64.go deleted file mode 100644 index b375a1b..0000000 --- a/vendor/k8s.io/gengo/examples/set-gen/sets/int64.go +++ /dev/null @@ -1,205 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by set-gen. DO NOT EDIT. - -package sets - -import ( - "reflect" - "sort" -) - -// sets.Int64 is a set of int64s, implemented via map[int64]struct{} for minimal memory consumption. -type Int64 map[int64]Empty - -// NewInt64 creates a Int64 from a list of values. -func NewInt64(items ...int64) Int64 { - ss := Int64{} - ss.Insert(items...) - return ss -} - -// Int64KeySet creates a Int64 from a keys of a map[int64](? extends interface{}). -// If the value passed in is not actually a map, this will panic. -func Int64KeySet(theMap interface{}) Int64 { - v := reflect.ValueOf(theMap) - ret := Int64{} - - for _, keyValue := range v.MapKeys() { - ret.Insert(keyValue.Interface().(int64)) - } - return ret -} - -// Insert adds items to the set. -func (s Int64) Insert(items ...int64) Int64 { - for _, item := range items { - s[item] = Empty{} - } - return s -} - -// Delete removes all items from the set. -func (s Int64) Delete(items ...int64) Int64 { - for _, item := range items { - delete(s, item) - } - return s -} - -// Has returns true if and only if item is contained in the set. -func (s Int64) Has(item int64) bool { - _, contained := s[item] - return contained -} - -// HasAll returns true if and only if all items are contained in the set. -func (s Int64) HasAll(items ...int64) bool { - for _, item := range items { - if !s.Has(item) { - return false - } - } - return true -} - -// HasAny returns true if any items are contained in the set. -func (s Int64) HasAny(items ...int64) bool { - for _, item := range items { - if s.Has(item) { - return true - } - } - return false -} - -// Difference returns a set of objects that are not in s2 -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.Difference(s2) = {a3} -// s2.Difference(s1) = {a4, a5} -func (s Int64) Difference(s2 Int64) Int64 { - result := NewInt64() - for key := range s { - if !s2.Has(key) { - result.Insert(key) - } - } - return result -} - -// Union returns a new set which includes items in either s1 or s2. -// For example: -// s1 = {a1, a2} -// s2 = {a3, a4} -// s1.Union(s2) = {a1, a2, a3, a4} -// s2.Union(s1) = {a1, a2, a3, a4} -func (s1 Int64) Union(s2 Int64) Int64 { - result := NewInt64() - for key := range s1 { - result.Insert(key) - } - for key := range s2 { - result.Insert(key) - } - return result -} - -// Intersection returns a new set which includes the item in BOTH s1 and s2 -// For example: -// s1 = {a1, a2} -// s2 = {a2, a3} -// s1.Intersection(s2) = {a2} -func (s1 Int64) Intersection(s2 Int64) Int64 { - var walk, other Int64 - result := NewInt64() - if s1.Len() < s2.Len() { - walk = s1 - other = s2 - } else { - walk = s2 - other = s1 - } - for key := range walk { - if other.Has(key) { - result.Insert(key) - } - } - return result -} - -// IsSuperset returns true if and only if s1 is a superset of s2. -func (s1 Int64) IsSuperset(s2 Int64) bool { - for item := range s2 { - if !s1.Has(item) { - return false - } - } - return true -} - -// Equal returns true if and only if s1 is equal (as a set) to s2. -// Two sets are equal if their membership is identical. -// (In practice, this means same elements, order doesn't matter) -func (s1 Int64) Equal(s2 Int64) bool { - return len(s1) == len(s2) && s1.IsSuperset(s2) -} - -type sortableSliceOfInt64 []int64 - -func (s sortableSliceOfInt64) Len() int { return len(s) } -func (s sortableSliceOfInt64) Less(i, j int) bool { return lessInt64(s[i], s[j]) } -func (s sortableSliceOfInt64) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -// List returns the contents as a sorted int64 slice. -func (s Int64) List() []int64 { - res := make(sortableSliceOfInt64, 0, len(s)) - for key := range s { - res = append(res, key) - } - sort.Sort(res) - return []int64(res) -} - -// UnsortedList returns the slice with contents in random order. -func (s Int64) UnsortedList() []int64 { - res := make([]int64, 0, len(s)) - for key := range s { - res = append(res, key) - } - return res -} - -// Returns a single element from the set. -func (s Int64) PopAny() (int64, bool) { - for key := range s { - s.Delete(key) - return key, true - } - var zeroValue int64 - return zeroValue, false -} - -// Len returns the size of the set. -func (s Int64) Len() int { - return len(s) -} - -func lessInt64(lhs, rhs int64) bool { - return lhs < rhs -} diff --git a/vendor/k8s.io/gengo/examples/set-gen/sets/string.go b/vendor/k8s.io/gengo/examples/set-gen/sets/string.go deleted file mode 100644 index e6f37db..0000000 --- a/vendor/k8s.io/gengo/examples/set-gen/sets/string.go +++ /dev/null @@ -1,205 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by set-gen. DO NOT EDIT. - -package sets - -import ( - "reflect" - "sort" -) - -// sets.String is a set of strings, implemented via map[string]struct{} for minimal memory consumption. -type String map[string]Empty - -// NewString creates a String from a list of values. -func NewString(items ...string) String { - ss := String{} - ss.Insert(items...) - return ss -} - -// StringKeySet creates a String from a keys of a map[string](? extends interface{}). -// If the value passed in is not actually a map, this will panic. -func StringKeySet(theMap interface{}) String { - v := reflect.ValueOf(theMap) - ret := String{} - - for _, keyValue := range v.MapKeys() { - ret.Insert(keyValue.Interface().(string)) - } - return ret -} - -// Insert adds items to the set. -func (s String) Insert(items ...string) String { - for _, item := range items { - s[item] = Empty{} - } - return s -} - -// Delete removes all items from the set. -func (s String) Delete(items ...string) String { - for _, item := range items { - delete(s, item) - } - return s -} - -// Has returns true if and only if item is contained in the set. -func (s String) Has(item string) bool { - _, contained := s[item] - return contained -} - -// HasAll returns true if and only if all items are contained in the set. -func (s String) HasAll(items ...string) bool { - for _, item := range items { - if !s.Has(item) { - return false - } - } - return true -} - -// HasAny returns true if any items are contained in the set. -func (s String) HasAny(items ...string) bool { - for _, item := range items { - if s.Has(item) { - return true - } - } - return false -} - -// Difference returns a set of objects that are not in s2 -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.Difference(s2) = {a3} -// s2.Difference(s1) = {a4, a5} -func (s String) Difference(s2 String) String { - result := NewString() - for key := range s { - if !s2.Has(key) { - result.Insert(key) - } - } - return result -} - -// Union returns a new set which includes items in either s1 or s2. -// For example: -// s1 = {a1, a2} -// s2 = {a3, a4} -// s1.Union(s2) = {a1, a2, a3, a4} -// s2.Union(s1) = {a1, a2, a3, a4} -func (s1 String) Union(s2 String) String { - result := NewString() - for key := range s1 { - result.Insert(key) - } - for key := range s2 { - result.Insert(key) - } - return result -} - -// Intersection returns a new set which includes the item in BOTH s1 and s2 -// For example: -// s1 = {a1, a2} -// s2 = {a2, a3} -// s1.Intersection(s2) = {a2} -func (s1 String) Intersection(s2 String) String { - var walk, other String - result := NewString() - if s1.Len() < s2.Len() { - walk = s1 - other = s2 - } else { - walk = s2 - other = s1 - } - for key := range walk { - if other.Has(key) { - result.Insert(key) - } - } - return result -} - -// IsSuperset returns true if and only if s1 is a superset of s2. -func (s1 String) IsSuperset(s2 String) bool { - for item := range s2 { - if !s1.Has(item) { - return false - } - } - return true -} - -// Equal returns true if and only if s1 is equal (as a set) to s2. -// Two sets are equal if their membership is identical. -// (In practice, this means same elements, order doesn't matter) -func (s1 String) Equal(s2 String) bool { - return len(s1) == len(s2) && s1.IsSuperset(s2) -} - -type sortableSliceOfString []string - -func (s sortableSliceOfString) Len() int { return len(s) } -func (s sortableSliceOfString) Less(i, j int) bool { return lessString(s[i], s[j]) } -func (s sortableSliceOfString) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -// List returns the contents as a sorted string slice. -func (s String) List() []string { - res := make(sortableSliceOfString, 0, len(s)) - for key := range s { - res = append(res, key) - } - sort.Sort(res) - return []string(res) -} - -// UnsortedList returns the slice with contents in random order. -func (s String) UnsortedList() []string { - res := make([]string, 0, len(s)) - for key := range s { - res = append(res, key) - } - return res -} - -// Returns a single element from the set. -func (s String) PopAny() (string, bool) { - for key := range s { - s.Delete(key) - return key, true - } - var zeroValue string - return zeroValue, false -} - -// Len returns the size of the set. -func (s String) Len() int { - return len(s) -} - -func lessString(lhs, rhs string) bool { - return lhs < rhs -} diff --git a/vendor/k8s.io/gengo/generator/default_generator.go b/vendor/k8s.io/gengo/generator/default_generator.go deleted file mode 100644 index f947668..0000000 --- a/vendor/k8s.io/gengo/generator/default_generator.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generator - -import ( - "io" - - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -const ( - GolangFileType = "golang" -) - -// DefaultGen implements a do-nothing Generator. -// -// It can be used to implement static content files. -type DefaultGen struct { - // OptionalName, if present, will be used for the generator's name, and - // the filename (with ".go" appended). - OptionalName string - - // OptionalBody, if present, will be used as the return from the "Init" - // method. This causes it to be static content for the entire file if - // no other generator touches the file. - OptionalBody []byte -} - -func (d DefaultGen) Name() string { return d.OptionalName } -func (d DefaultGen) Filter(*Context, *types.Type) bool { return true } -func (d DefaultGen) Namers(*Context) namer.NameSystems { return nil } -func (d DefaultGen) Imports(*Context) []string { return []string{} } -func (d DefaultGen) PackageVars(*Context) []string { return []string{} } -func (d DefaultGen) PackageConsts(*Context) []string { return []string{} } -func (d DefaultGen) GenerateType(*Context, *types.Type, io.Writer) error { return nil } -func (d DefaultGen) Filename() string { return d.OptionalName + ".go" } -func (d DefaultGen) FileType() string { return GolangFileType } -func (d DefaultGen) Finalize(*Context, io.Writer) error { return nil } - -func (d DefaultGen) Init(c *Context, w io.Writer) error { - _, err := w.Write(d.OptionalBody) - return err -} - -var ( - _ = Generator(DefaultGen{}) -) diff --git a/vendor/k8s.io/gengo/generator/default_package.go b/vendor/k8s.io/gengo/generator/default_package.go deleted file mode 100644 index dcf0883..0000000 --- a/vendor/k8s.io/gengo/generator/default_package.go +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generator - -import ( - "k8s.io/gengo/types" -) - -// DefaultPackage contains a default implementation of Package. -type DefaultPackage struct { - // Short name of package, used in the "package xxxx" line. - PackageName string - // Import path of the package, and the location on disk of the package. - PackagePath string - // The location of the package on disk. - Source string - - // Emitted at the top of every file. - HeaderText []byte - - // Emitted only for a "doc.go" file; appended to the HeaderText for - // that file. - PackageDocumentation []byte - - // If non-nil, will be called on "Generators"; otherwise, the static - // list will be used. So you should set only one of these two fields. - GeneratorFunc func(*Context) []Generator - GeneratorList []Generator - - // Optional; filters the types exposed to the generators. - FilterFunc func(*Context, *types.Type) bool -} - -func (d *DefaultPackage) Name() string { return d.PackageName } -func (d *DefaultPackage) Path() string { return d.PackagePath } -func (d *DefaultPackage) SourcePath() string { return d.Source } - -func (d *DefaultPackage) Filter(c *Context, t *types.Type) bool { - if d.FilterFunc != nil { - return d.FilterFunc(c, t) - } - return true -} - -func (d *DefaultPackage) Generators(c *Context) []Generator { - if d.GeneratorFunc != nil { - return d.GeneratorFunc(c) - } - return d.GeneratorList -} - -func (d *DefaultPackage) Header(filename string) []byte { - if filename == "doc.go" { - return append(d.HeaderText, d.PackageDocumentation...) - } - return d.HeaderText -} - -var ( - _ = Package(&DefaultPackage{}) -) diff --git a/vendor/k8s.io/gengo/generator/doc.go b/vendor/k8s.io/gengo/generator/doc.go deleted file mode 100644 index d8e1253..0000000 --- a/vendor/k8s.io/gengo/generator/doc.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package generator defines an interface for code generators to implement. -// -// To use this package, you'll implement the "Package" and "Generator" -// interfaces; you'll call NewContext to load up the types you want to work -// with, and then you'll call one or more of the Execute methods. See the -// interface definitions for explanations. All output will have gofmt called on -// it automatically, so you do not need to worry about generating correct -// indentation. -// -// This package also exposes SnippetWriter. SnippetWriter reduces to a minimum -// the boilerplate involved in setting up a template from go's text/template -// package. Additionally, all naming systems in the Context will be added as -// functions to the parsed template, so that they can be called directly from -// your templates! -package generator // import "k8s.io/gengo/generator" diff --git a/vendor/k8s.io/gengo/generator/error_tracker.go b/vendor/k8s.io/gengo/generator/error_tracker.go deleted file mode 100644 index 964dae3..0000000 --- a/vendor/k8s.io/gengo/generator/error_tracker.go +++ /dev/null @@ -1,50 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generator - -import ( - "io" -) - -// ErrorTracker tracks errors to the underlying writer, so that you can ignore -// them until you're ready to return. -type ErrorTracker struct { - io.Writer - err error -} - -// NewErrorTracker makes a new error tracker; note that it implements io.Writer. -func NewErrorTracker(w io.Writer) *ErrorTracker { - return &ErrorTracker{Writer: w} -} - -// Write intercepts calls to Write. -func (et *ErrorTracker) Write(p []byte) (n int, err error) { - if et.err != nil { - return 0, et.err - } - n, err = et.Writer.Write(p) - if err != nil { - et.err = err - } - return n, err -} - -// Error returns nil if no error has occurred, otherwise it returns the error. -func (et *ErrorTracker) Error() error { - return et.err -} diff --git a/vendor/k8s.io/gengo/generator/execute.go b/vendor/k8s.io/gengo/generator/execute.go deleted file mode 100644 index d1b1225..0000000 --- a/vendor/k8s.io/gengo/generator/execute.go +++ /dev/null @@ -1,314 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generator - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "strings" - - "golang.org/x/tools/imports" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/klog" -) - -func errs2strings(errors []error) []string { - strs := make([]string, len(errors)) - for i := range errors { - strs[i] = errors[i].Error() - } - return strs -} - -// ExecutePackages runs the generators for every package in 'packages'. 'outDir' -// is the base directory in which to place all the generated packages; it -// should be a physical path on disk, not an import path. e.g.: -// /path/to/home/path/to/gopath/src/ -// Each package has its import path already, this will be appended to 'outDir'. -func (c *Context) ExecutePackages(outDir string, packages Packages) error { - var errors []error - for _, p := range packages { - if err := c.ExecutePackage(outDir, p); err != nil { - errors = append(errors, err) - } - } - if len(errors) > 0 { - return fmt.Errorf("some packages had errors:\n%v\n", strings.Join(errs2strings(errors), "\n")) - } - return nil -} - -type DefaultFileType struct { - Format func([]byte) ([]byte, error) - Assemble func(io.Writer, *File) -} - -func (ft DefaultFileType) AssembleFile(f *File, pathname string) error { - klog.V(2).Infof("Assembling file %q", pathname) - destFile, err := os.Create(pathname) - if err != nil { - return err - } - defer destFile.Close() - - b := &bytes.Buffer{} - et := NewErrorTracker(b) - ft.Assemble(et, f) - if et.Error() != nil { - return et.Error() - } - if formatted, err := ft.Format(b.Bytes()); err != nil { - err = fmt.Errorf("unable to format file %q (%v).", pathname, err) - // Write the file anyway, so they can see what's going wrong and fix the generator. - if _, err2 := destFile.Write(b.Bytes()); err2 != nil { - return err2 - } - return err - } else { - _, err = destFile.Write(formatted) - return err - } -} - -func (ft DefaultFileType) VerifyFile(f *File, pathname string) error { - klog.V(2).Infof("Verifying file %q", pathname) - friendlyName := filepath.Join(f.PackageName, f.Name) - b := &bytes.Buffer{} - et := NewErrorTracker(b) - ft.Assemble(et, f) - if et.Error() != nil { - return et.Error() - } - formatted, err := ft.Format(b.Bytes()) - if err != nil { - return fmt.Errorf("unable to format the output for %q: %v", friendlyName, err) - } - existing, err := ioutil.ReadFile(pathname) - if err != nil { - return fmt.Errorf("unable to read file %q for comparison: %v", friendlyName, err) - } - if bytes.Compare(formatted, existing) == 0 { - return nil - } - // Be nice and find the first place where they differ - i := 0 - for i < len(formatted) && i < len(existing) && formatted[i] == existing[i] { - i++ - } - eDiff, fDiff := existing[i:], formatted[i:] - if len(eDiff) > 100 { - eDiff = eDiff[:100] - } - if len(fDiff) > 100 { - fDiff = fDiff[:100] - } - return fmt.Errorf("output for %q differs; first existing/expected diff: \n %q\n %q", friendlyName, string(eDiff), string(fDiff)) -} - -func assembleGolangFile(w io.Writer, f *File) { - w.Write(f.Header) - fmt.Fprintf(w, "package %v\n\n", f.PackageName) - - if len(f.Imports) > 0 { - fmt.Fprint(w, "import (\n") - for i := range f.Imports { - if strings.Contains(i, "\"") { - // they included quotes, or are using the - // `name "path/to/pkg"` format. - fmt.Fprintf(w, "\t%s\n", i) - } else { - fmt.Fprintf(w, "\t%q\n", i) - } - } - fmt.Fprint(w, ")\n\n") - } - - if f.Vars.Len() > 0 { - fmt.Fprint(w, "var (\n") - w.Write(f.Vars.Bytes()) - fmt.Fprint(w, ")\n\n") - } - - if f.Consts.Len() > 0 { - fmt.Fprint(w, "const (\n") - w.Write(f.Consts.Bytes()) - fmt.Fprint(w, ")\n\n") - } - - w.Write(f.Body.Bytes()) -} - -func importsWrapper(src []byte) ([]byte, error) { - return imports.Process("", src, nil) -} - -func NewGolangFile() *DefaultFileType { - return &DefaultFileType{ - Format: importsWrapper, - Assemble: assembleGolangFile, - } -} - -// format should be one line only, and not end with \n. -func addIndentHeaderComment(b *bytes.Buffer, format string, args ...interface{}) { - if b.Len() > 0 { - fmt.Fprintf(b, "\n// "+format+"\n", args...) - } else { - fmt.Fprintf(b, "// "+format+"\n", args...) - } -} - -func (c *Context) filteredBy(f func(*Context, *types.Type) bool) *Context { - c2 := *c - c2.Order = []*types.Type{} - for _, t := range c.Order { - if f(c, t) { - c2.Order = append(c2.Order, t) - } - } - return &c2 -} - -// make a new context; inheret c.Namers, but add on 'namers'. In case of a name -// collision, the namer in 'namers' wins. -func (c *Context) addNameSystems(namers namer.NameSystems) *Context { - if namers == nil { - return c - } - c2 := *c - // Copy the existing name systems so we don't corrupt a parent context - c2.Namers = namer.NameSystems{} - for k, v := range c.Namers { - c2.Namers[k] = v - } - - for name, namer := range namers { - c2.Namers[name] = namer - } - return &c2 -} - -// ExecutePackage executes a single package. 'outDir' is the base directory in -// which to place the package; it should be a physical path on disk, not an -// import path. e.g.: '/path/to/home/path/to/gopath/src/' The package knows its -// import path already, this will be appended to 'outDir'. -func (c *Context) ExecutePackage(outDir string, p Package) error { - path := filepath.Join(outDir, p.Path()) - klog.V(2).Infof("Processing package %q, disk location %q", p.Name(), path) - // Filter out any types the *package* doesn't care about. - packageContext := c.filteredBy(p.Filter) - os.MkdirAll(path, 0755) - files := map[string]*File{} - for _, g := range p.Generators(packageContext) { - // Filter out types the *generator* doesn't care about. - genContext := packageContext.filteredBy(g.Filter) - // Now add any extra name systems defined by this generator - genContext = genContext.addNameSystems(g.Namers(genContext)) - - fileType := g.FileType() - if len(fileType) == 0 { - return fmt.Errorf("generator %q must specify a file type", g.Name()) - } - f := files[g.Filename()] - if f == nil { - // This is the first generator to reference this file, so start it. - f = &File{ - Name: g.Filename(), - FileType: fileType, - PackageName: p.Name(), - PackagePath: p.Path(), - PackageSourcePath: p.SourcePath(), - Header: p.Header(g.Filename()), - Imports: map[string]struct{}{}, - } - files[f.Name] = f - } else { - if f.FileType != g.FileType() { - return fmt.Errorf("file %q already has type %q, but generator %q wants to use type %q", f.Name, f.FileType, g.Name(), g.FileType()) - } - } - - if vars := g.PackageVars(genContext); len(vars) > 0 { - addIndentHeaderComment(&f.Vars, "Package-wide variables from generator %q.", g.Name()) - for _, v := range vars { - if _, err := fmt.Fprintf(&f.Vars, "%s\n", v); err != nil { - return err - } - } - } - if consts := g.PackageConsts(genContext); len(consts) > 0 { - addIndentHeaderComment(&f.Consts, "Package-wide consts from generator %q.", g.Name()) - for _, v := range consts { - if _, err := fmt.Fprintf(&f.Consts, "%s\n", v); err != nil { - return err - } - } - } - if err := genContext.executeBody(&f.Body, g); err != nil { - return err - } - if imports := g.Imports(genContext); len(imports) > 0 { - for _, i := range imports { - f.Imports[i] = struct{}{} - } - } - } - - var errors []error - for _, f := range files { - finalPath := filepath.Join(path, f.Name) - assembler, ok := c.FileTypes[f.FileType] - if !ok { - return fmt.Errorf("the file type %q registered for file %q does not exist in the context", f.FileType, f.Name) - } - var err error - if c.Verify { - err = assembler.VerifyFile(f, finalPath) - } else { - err = assembler.AssembleFile(f, finalPath) - } - if err != nil { - errors = append(errors, err) - } - } - if len(errors) > 0 { - return fmt.Errorf("errors in package %q:\n%v\n", p.Path(), strings.Join(errs2strings(errors), "\n")) - } - return nil -} - -func (c *Context) executeBody(w io.Writer, generator Generator) error { - et := NewErrorTracker(w) - if err := generator.Init(c, et); err != nil { - return err - } - for _, t := range c.Order { - if err := generator.GenerateType(c, t, et); err != nil { - return err - } - } - if err := generator.Finalize(c, et); err != nil { - return err - } - return et.Error() -} diff --git a/vendor/k8s.io/gengo/generator/generator.go b/vendor/k8s.io/gengo/generator/generator.go deleted file mode 100644 index 4b48f50..0000000 --- a/vendor/k8s.io/gengo/generator/generator.go +++ /dev/null @@ -1,256 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generator - -import ( - "bytes" - "io" - - "k8s.io/gengo/namer" - "k8s.io/gengo/parser" - "k8s.io/gengo/types" -) - -// Package contains the contract for generating a package. -type Package interface { - // Name returns the package short name. - Name() string - // Path returns the package import path. - Path() string - // SourcePath returns the location of the package on disk. - SourcePath() string - - // Filter should return true if this package cares about this type. - // Otherwise, this type will be omitted from the type ordering for - // this package. - Filter(*Context, *types.Type) bool - - // Header should return a header for the file, including comment markers. - // Useful for copyright notices and doc strings. Include an - // autogeneration notice! Do not include the "package x" line. - Header(filename string) []byte - - // Generators returns the list of generators for this package. It is - // allowed for more than one generator to write to the same file. - // A Context is passed in case the list of generators depends on the - // input types. - Generators(*Context) []Generator -} - -type File struct { - Name string - FileType string - PackageName string - Header []byte - PackagePath string - PackageSourcePath string - Imports map[string]struct{} - Vars bytes.Buffer - Consts bytes.Buffer - Body bytes.Buffer -} - -type FileType interface { - AssembleFile(f *File, path string) error - VerifyFile(f *File, path string) error -} - -// Packages is a list of packages to generate. -type Packages []Package - -// Generator is the contract for anything that wants to do auto-generation. -// It's expected that the io.Writers passed to the below functions will be -// ErrorTrackers; this allows implementations to not check for io errors, -// making more readable code. -// -// The call order for the functions that take a Context is: -// 1. Filter() // Subsequent calls see only types that pass this. -// 2. Namers() // Subsequent calls see the namers provided by this. -// 3. PackageVars() -// 4. PackageConsts() -// 5. Init() -// 6. GenerateType() // Called N times, once per type in the context's Order. -// 7. Imports() -// -// You may have multiple generators for the same file. -type Generator interface { - // The name of this generator. Will be included in generated comments. - Name() string - - // Filter should return true if this generator cares about this type. - // (otherwise, GenerateType will not be called.) - // - // Filter is called before any of the generator's other functions; - // subsequent calls will get a context with only the types that passed - // this filter. - Filter(*Context, *types.Type) bool - - // If this generator needs special namers, return them here. These will - // override the original namers in the context if there is a collision. - // You may return nil if you don't need special names. These names will - // be available in the context passed to the rest of the generator's - // functions. - // - // A use case for this is to return a namer that tracks imports. - Namers(*Context) namer.NameSystems - - // Init should write an init function, and any other content that's not - // generated per-type. (It's not intended for generator specific - // initialization! Do that when your Package constructs the - // Generators.) - Init(*Context, io.Writer) error - - // Finalize should write finish up functions, and any other content that's not - // generated per-type. - Finalize(*Context, io.Writer) error - - // PackageVars should emit an array of variable lines. They will be - // placed in a var ( ... ) block. There's no need to include a leading - // \t or trailing \n. - PackageVars(*Context) []string - - // PackageConsts should emit an array of constant lines. They will be - // placed in a const ( ... ) block. There's no need to include a leading - // \t or trailing \n. - PackageConsts(*Context) []string - - // GenerateType should emit the code for a particular type. - GenerateType(*Context, *types.Type, io.Writer) error - - // Imports should return a list of necessary imports. They will be - // formatted correctly. You do not need to include quotation marks, - // return only the package name; alternatively, you can also return - // imports in the format `name "path/to/pkg"`. Imports will be called - // after Init, PackageVars, PackageConsts, and GenerateType, to allow - // you to keep track of what imports you actually need. - Imports(*Context) []string - - // Preferred file name of this generator, not including a path. It is - // allowed for multiple generators to use the same filename, but it's - // up to you to make sure they don't have colliding import names. - // TODO: provide per-file import tracking, removing the requirement - // that generators coordinate.. - Filename() string - - // A registered file type in the context to generate this file with. If - // the FileType is not found in the context, execution will stop. - FileType() string -} - -// Context is global context for individual generators to consume. -type Context struct { - // A map from the naming system to the names for that system. E.g., you - // might have public names and several private naming systems. - Namers namer.NameSystems - - // All the types, in case you want to look up something. - Universe types.Universe - - // Incoming imports, i.e. packages importing the given package. - incomingImports map[string][]string - - // Incoming transitive imports, i.e. the transitive closure of IncomingImports - incomingTransitiveImports map[string][]string - - // All the user-specified packages. This is after recursive expansion. - Inputs []string - - // The canonical ordering of the types (will be filtered by both the - // Package's and Generator's Filter methods). - Order []*types.Type - - // A set of types this context can process. If this is empty or nil, - // the default "golang" filetype will be provided. - FileTypes map[string]FileType - - // If true, Execute* calls will just verify that the existing output is - // correct. (You may set this after calling NewContext.) - Verify bool - - // Allows generators to add packages at runtime. - builder *parser.Builder -} - -// NewContext generates a context from the given builder, naming systems, and -// the naming system you wish to construct the canonical ordering from. -func NewContext(b *parser.Builder, nameSystems namer.NameSystems, canonicalOrderName string) (*Context, error) { - universe, err := b.FindTypes() - if err != nil { - return nil, err - } - - c := &Context{ - Namers: namer.NameSystems{}, - Universe: universe, - Inputs: b.FindPackages(), - FileTypes: map[string]FileType{ - GolangFileType: NewGolangFile(), - }, - builder: b, - } - - for name, systemNamer := range nameSystems { - c.Namers[name] = systemNamer - if name == canonicalOrderName { - orderer := namer.Orderer{Namer: systemNamer} - c.Order = orderer.OrderUniverse(universe) - } - } - return c, nil -} - -// IncomingImports returns the incoming imports for each package. The map is lazily computed. -func (ctxt *Context) IncomingImports() map[string][]string { - if ctxt.incomingImports == nil { - incoming := map[string][]string{} - for _, pkg := range ctxt.Universe { - for imp := range pkg.Imports { - incoming[imp] = append(incoming[imp], pkg.Path) - } - } - ctxt.incomingImports = incoming - } - return ctxt.incomingImports -} - -// TransitiveIncomingImports returns the transitive closure of the incoming imports for each package. -// The map is lazily computed. -func (ctxt *Context) TransitiveIncomingImports() map[string][]string { - if ctxt.incomingTransitiveImports == nil { - ctxt.incomingTransitiveImports = transitiveClosure(ctxt.IncomingImports()) - } - return ctxt.incomingTransitiveImports -} - -// AddDir adds a Go package to the context. The specified path must be a single -// go package import path. GOPATH, GOROOT, and the location of your go binary -// (`which go`) will all be searched, in the normal Go fashion. -// Deprecated. Please use AddDirectory. -func (ctxt *Context) AddDir(path string) error { - ctxt.incomingImports = nil - ctxt.incomingTransitiveImports = nil - return ctxt.builder.AddDirTo(path, &ctxt.Universe) -} - -// AddDirectory adds a Go package to the context. The specified path must be a -// single go package import path. GOPATH, GOROOT, and the location of your go -// binary (`which go`) will all be searched, in the normal Go fashion. -func (ctxt *Context) AddDirectory(path string) (*types.Package, error) { - ctxt.incomingImports = nil - ctxt.incomingTransitiveImports = nil - return ctxt.builder.AddDirectoryTo(path, &ctxt.Universe) -} diff --git a/vendor/k8s.io/gengo/generator/import_tracker.go b/vendor/k8s.io/gengo/generator/import_tracker.go deleted file mode 100644 index 5d87de4..0000000 --- a/vendor/k8s.io/gengo/generator/import_tracker.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generator - -import ( - "go/token" - "strings" - - "k8s.io/klog" - - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -func NewImportTracker(typesToAdd ...*types.Type) namer.ImportTracker { - tracker := namer.NewDefaultImportTracker(types.Name{}) - tracker.IsInvalidType = func(*types.Type) bool { return false } - tracker.LocalName = func(name types.Name) string { return golangTrackerLocalName(&tracker, name) } - tracker.PrintImport = func(path, name string) string { return name + " \"" + path + "\"" } - - tracker.AddTypes(typesToAdd...) - return &tracker - -} - -func golangTrackerLocalName(tracker namer.ImportTracker, t types.Name) string { - path := t.Package - - // Using backslashes in package names causes gengo to produce Go code which - // will not compile with the gc compiler. See the comment on GoSeperator. - if strings.ContainsRune(path, '\\') { - klog.Warningf("Warning: backslash used in import path '%v', this is unsupported.\n", path) - } - - dirs := strings.Split(path, namer.GoSeperator) - for n := len(dirs) - 1; n >= 0; n-- { - // follow kube convention of not having anything between directory names - name := strings.Join(dirs[n:], "") - name = strings.Replace(name, "_", "", -1) - // These characters commonly appear in import paths for go - // packages, but aren't legal go names. So we'll sanitize. - name = strings.Replace(name, ".", "", -1) - name = strings.Replace(name, "-", "", -1) - if _, found := tracker.PathOf(name); found { - // This name collides with some other package - continue - } - - // If the import name is a Go keyword, prefix with an underscore. - if token.Lookup(name).IsKeyword() { - name = "_" + name - } - return name - } - panic("can't find import for " + path) -} diff --git a/vendor/k8s.io/gengo/generator/snippet_writer.go b/vendor/k8s.io/gengo/generator/snippet_writer.go deleted file mode 100644 index eae917c..0000000 --- a/vendor/k8s.io/gengo/generator/snippet_writer.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generator - -import ( - "fmt" - "io" - "runtime" - "text/template" -) - -// SnippetWriter is an attempt to make the template library usable. -// Methods are chainable, and you don't have to check Error() until you're all -// done. -type SnippetWriter struct { - w io.Writer - context *Context - // Left & right delimiters. text/template defaults to "{{" and "}}" - // which is totally unusable for go code based templates. - left, right string - funcMap template.FuncMap - err error -} - -// w is the destination; left and right are the delimiters; @ and $ are both -// reasonable choices. -// -// c is used to make a function for every naming system, to which you can pass -// a type and get the corresponding name. -func NewSnippetWriter(w io.Writer, c *Context, left, right string) *SnippetWriter { - sw := &SnippetWriter{ - w: w, - context: c, - left: left, - right: right, - funcMap: template.FuncMap{}, - } - for name, namer := range c.Namers { - sw.funcMap[name] = namer.Name - } - return sw -} - -// Do parses format and runs args through it. You can have arbitrary logic in -// the format (see the text/template documentation), but consider running many -// short templaces, with ordinary go logic in between--this may be more -// readable. Do is chainable. Any error causes every other call to do to be -// ignored, and the error will be returned by Error(). So you can check it just -// once, at the end of your function. -// -// 'args' can be quite literally anything; read the text/template documentation -// for details. Maps and structs work particularly nicely. Conveniently, the -// types package is designed to have structs that are easily referencable from -// the template language. -// -// Example: -// -// sw := generator.NewSnippetWriter(outBuffer, context, "$", "$") -// sw.Do(`The public type name is: $.type|public$`, map[string]interface{}{"type": t}) -// return sw.Error() -// -// Where: -// * "$" starts a template directive -// * "." references the entire thing passed as args -// * "type" therefore sees a map and looks up the key "type" -// * "|" means "pass the thing on the left to the thing on the right" -// * "public" is the name of a naming system, so the SnippetWriter has given -// the template a function called "public" that takes a *types.Type and -// returns the naming system's name. E.g., if the type is "string" this might -// return "String". -// * the second "$" ends the template directive. -// -// The map is actually not necessary. The below does the same thing: -// -// sw.Do(`The public type name is: $.|public$`, t) -// -// You may or may not find it more readable to use the map with a descriptive -// key, but if you want to pass more than one arg, the map or a custom struct -// becomes a requirement. You can do arbitrary logic inside these templates, -// but you should consider doing the logic in go and stitching them together -// for the sake of your readers. -// -// TODO: Change Do() to optionally take a list of pairs of parameters (key, value) -// and have it construct a combined map with that and args. -func (s *SnippetWriter) Do(format string, args interface{}) *SnippetWriter { - if s.err != nil { - return s - } - // Name the template by source file:line so it can be found when - // there's an error. - _, file, line, _ := runtime.Caller(1) - tmpl, err := template. - New(fmt.Sprintf("%s:%d", file, line)). - Delims(s.left, s.right). - Funcs(s.funcMap). - Parse(format) - if err != nil { - s.err = err - return s - } - err = tmpl.Execute(s.w, args) - if err != nil { - s.err = err - } - return s -} - -// Args exists to make it convenient to construct arguments for -// SnippetWriter.Do. -type Args map[interface{}]interface{} - -// With makes a copy of a and adds the given key, value pair. -func (a Args) With(key, value interface{}) Args { - a2 := Args{key: value} - for k, v := range a { - a2[k] = v - } - return a2 -} - -// WithArgs makes a copy of a and adds the given arguments. -func (a Args) WithArgs(rhs Args) Args { - a2 := Args{} - for k, v := range rhs { - a2[k] = v - } - for k, v := range a { - a2[k] = v - } - return a2 -} - -func (s *SnippetWriter) Out() io.Writer { - return s.w -} - -// Error returns any encountered error. -func (s *SnippetWriter) Error() error { - return s.err -} diff --git a/vendor/k8s.io/gengo/generator/transitive_closure.go b/vendor/k8s.io/gengo/generator/transitive_closure.go deleted file mode 100644 index 385a49f..0000000 --- a/vendor/k8s.io/gengo/generator/transitive_closure.go +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generator - -import "sort" - -type edge struct { - from string - to string -} - -func transitiveClosure(in map[string][]string) map[string][]string { - adj := make(map[edge]bool) - imports := make(map[string]struct{}) - for from, tos := range in { - for _, to := range tos { - adj[edge{from, to}] = true - imports[to] = struct{}{} - } - } - - // Warshal's algorithm - for k := range in { - for i := range in { - if !adj[edge{i, k}] { - continue - } - for j := range imports { - if adj[edge{i, j}] { - continue - } - if adj[edge{k, j}] { - adj[edge{i, j}] = true - } - } - } - } - - out := make(map[string][]string, len(in)) - for i := range in { - for j := range imports { - if adj[edge{i, j}] { - out[i] = append(out[i], j) - } - } - - sort.Strings(out[i]) - } - - return out -} diff --git a/vendor/k8s.io/gengo/namer/doc.go b/vendor/k8s.io/gengo/namer/doc.go deleted file mode 100644 index 8a44ea9..0000000 --- a/vendor/k8s.io/gengo/namer/doc.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package namer has support for making different type naming systems. -// -// This is because sometimes you want to refer to the literal type, sometimes -// you want to make a name for the thing you're generating, and you want to -// make the name based on the type. For example, if you have `type foo string`, -// you want to be able to generate something like `func FooPrinter(f *foo) { -// Print(string(*f)) }`; that is, you want to refer to a public name, a literal -// name, and the underlying literal name. -// -// This package supports the idea of a "Namer" and a set of "NameSystems" to -// support these use cases. -// -// Additionally, a "RawNamer" can optionally keep track of what needs to be -// imported. -package namer // import "k8s.io/gengo/namer" diff --git a/vendor/k8s.io/gengo/namer/import_tracker.go b/vendor/k8s.io/gengo/namer/import_tracker.go deleted file mode 100644 index 37094b2..0000000 --- a/vendor/k8s.io/gengo/namer/import_tracker.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package namer - -import ( - "sort" - - "k8s.io/gengo/types" -) - -// ImportTracker may be passed to a namer.RawNamer, to track the imports needed -// for the types it names. -// -// TODO: pay attention to the package name (instead of renaming every package). -type DefaultImportTracker struct { - pathToName map[string]string - // forbidden names are in here. (e.g. "go" is a directory in which - // there is code, but "go" is not a legal name for a package, so we put - // it here to prevent us from naming any package "go") - nameToPath map[string]string - local types.Name - - // Returns true if a given types is an invalid type and should be ignored. - IsInvalidType func(*types.Type) bool - // Returns the final local name for the given name - LocalName func(types.Name) string - // Returns the "import" line for a given (path, name). - PrintImport func(string, string) string -} - -func NewDefaultImportTracker(local types.Name) DefaultImportTracker { - return DefaultImportTracker{ - pathToName: map[string]string{}, - nameToPath: map[string]string{}, - local: local, - } -} - -func (tracker *DefaultImportTracker) AddTypes(types ...*types.Type) { - for _, t := range types { - tracker.AddType(t) - } -} -func (tracker *DefaultImportTracker) AddType(t *types.Type) { - if tracker.local.Package == t.Name.Package { - return - } - - if tracker.IsInvalidType(t) { - if t.Kind == types.Builtin { - return - } - if _, ok := tracker.nameToPath[t.Name.Package]; !ok { - tracker.nameToPath[t.Name.Package] = "" - } - return - } - - if len(t.Name.Package) == 0 { - return - } - path := t.Name.Path - if len(path) == 0 { - path = t.Name.Package - } - if _, ok := tracker.pathToName[path]; ok { - return - } - name := tracker.LocalName(t.Name) - tracker.nameToPath[name] = path - tracker.pathToName[path] = name -} - -func (tracker *DefaultImportTracker) ImportLines() []string { - importPaths := []string{} - for path := range tracker.pathToName { - importPaths = append(importPaths, path) - } - sort.Sort(sort.StringSlice(importPaths)) - out := []string{} - for _, path := range importPaths { - out = append(out, tracker.PrintImport(path, tracker.pathToName[path])) - } - return out -} - -// LocalNameOf returns the name you would use to refer to the package at the -// specified path within the body of a file. -func (tracker *DefaultImportTracker) LocalNameOf(path string) string { - return tracker.pathToName[path] -} - -// PathOf returns the path that a given localName is referring to within the -// body of a file. -func (tracker *DefaultImportTracker) PathOf(localName string) (string, bool) { - name, ok := tracker.nameToPath[localName] - return name, ok -} diff --git a/vendor/k8s.io/gengo/namer/namer.go b/vendor/k8s.io/gengo/namer/namer.go deleted file mode 100644 index d700a00..0000000 --- a/vendor/k8s.io/gengo/namer/namer.go +++ /dev/null @@ -1,383 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package namer - -import ( - "path/filepath" - "strings" - - "k8s.io/gengo/types" -) - -const ( - // GoSeperator is used to split go import paths. - // Forward slash is used instead of filepath.Seperator because it is the - // only universally-accepted path delimiter and the only delimiter not - // potentially forbidden by Go compilers. (In particular gc does not allow - // the use of backslashes in import paths.) - // See https://golang.org/ref/spec#Import_declarations. - // See also https://github.com/kubernetes/gengo/issues/83#issuecomment-367040772. - GoSeperator = "/" -) - -// Returns whether a name is a private Go name. -func IsPrivateGoName(name string) bool { - return len(name) == 0 || strings.ToLower(name[:1]) == name[:1] -} - -// NewPublicNamer is a helper function that returns a namer that makes -// CamelCase names. See the NameStrategy struct for an explanation of the -// arguments to this constructor. -func NewPublicNamer(prependPackageNames int, ignoreWords ...string) *NameStrategy { - n := &NameStrategy{ - Join: Joiner(IC, IC), - IgnoreWords: map[string]bool{}, - PrependPackageNames: prependPackageNames, - } - for _, w := range ignoreWords { - n.IgnoreWords[w] = true - } - return n -} - -// NewPrivateNamer is a helper function that returns a namer that makes -// camelCase names. See the NameStrategy struct for an explanation of the -// arguments to this constructor. -func NewPrivateNamer(prependPackageNames int, ignoreWords ...string) *NameStrategy { - n := &NameStrategy{ - Join: Joiner(IL, IC), - IgnoreWords: map[string]bool{}, - PrependPackageNames: prependPackageNames, - } - for _, w := range ignoreWords { - n.IgnoreWords[w] = true - } - return n -} - -// NewRawNamer will return a Namer that makes a name by which you would -// directly refer to a type, optionally keeping track of the import paths -// necessary to reference the names it provides. Tracker may be nil. -// The 'pkg' is the full package name, in which the Namer is used - all -// types from that package will be referenced by just type name without -// referencing the package. -// -// For example, if the type is map[string]int, a raw namer will literally -// return "map[string]int". -// -// Or if the type, in package foo, is "type Bar struct { ... }", then the raw -// namer will return "foo.Bar" as the name of the type, and if 'tracker' was -// not nil, will record that package foo needs to be imported. -func NewRawNamer(pkg string, tracker ImportTracker) *rawNamer { - return &rawNamer{pkg: pkg, tracker: tracker} -} - -// Names is a map from Type to name, as defined by some Namer. -type Names map[*types.Type]string - -// Namer takes a type, and assigns a name. -// -// The purpose of this complexity is so that you can assign coherent -// side-by-side systems of names for the types. For example, you might want a -// public interface, a private implementation struct, and also to reference -// literally the type name. -// -// Note that it is safe to call your own Name() function recursively to find -// the names of keys, elements, etc. This is because anonymous types can't have -// cycles in their names, and named types don't require the sort of recursion -// that would be problematic. -type Namer interface { - Name(*types.Type) string -} - -// NameSystems is a map of a system name to a namer for that system. -type NameSystems map[string]Namer - -// NameStrategy is a general Namer. The easiest way to use it is to copy the -// Public/PrivateNamer variables, and modify the members you wish to change. -// -// The Name method produces a name for the given type, of the forms: -// Anonymous types: -// Named types: -// -// In all cases, every part of the name is run through the capitalization -// functions. -// -// The IgnoreWords map can be set if you have directory names that are -// semantically meaningless for naming purposes, e.g. "proto". -// -// Prefix and Suffix can be used to disambiguate parallel systems of type -// names. For example, if you want to generate an interface and an -// implementation, you might want to suffix one with "Interface" and the other -// with "Implementation". Another common use-- if you want to generate private -// types, and one of your source types could be "string", you can't use the -// default lowercase private namer. You'll have to add a suffix or prefix. -type NameStrategy struct { - Prefix, Suffix string - Join func(pre string, parts []string, post string) string - - // Add non-meaningful package directory names here (e.g. "proto") and - // they will be ignored. - IgnoreWords map[string]bool - - // If > 0, prepend exactly that many package directory names (or as - // many as there are). Package names listed in "IgnoreWords" will be - // ignored. - // - // For example, if Ignore words lists "proto" and type Foo is in - // pkg/server/frobbing/proto, then a value of 1 will give a type name - // of FrobbingFoo, 2 gives ServerFrobbingFoo, etc. - PrependPackageNames int - - // A cache of names thus far assigned by this namer. - Names -} - -// IC ensures the first character is uppercase. -func IC(in string) string { - if in == "" { - return in - } - return strings.ToUpper(in[:1]) + in[1:] -} - -// IL ensures the first character is lowercase. -func IL(in string) string { - if in == "" { - return in - } - return strings.ToLower(in[:1]) + in[1:] -} - -// Joiner lets you specify functions that preprocess the various components of -// a name before joining them. You can construct e.g. camelCase or CamelCase or -// any other way of joining words. (See the IC and IL convenience functions.) -func Joiner(first, others func(string) string) func(pre string, in []string, post string) string { - return func(pre string, in []string, post string) string { - tmp := []string{others(pre)} - for i := range in { - tmp = append(tmp, others(in[i])) - } - tmp = append(tmp, others(post)) - return first(strings.Join(tmp, "")) - } -} - -func (ns *NameStrategy) removePrefixAndSuffix(s string) string { - // The join function may have changed capitalization. - lowerIn := strings.ToLower(s) - lowerP := strings.ToLower(ns.Prefix) - lowerS := strings.ToLower(ns.Suffix) - b, e := 0, len(s) - if strings.HasPrefix(lowerIn, lowerP) { - b = len(ns.Prefix) - } - if strings.HasSuffix(lowerIn, lowerS) { - e -= len(ns.Suffix) - } - return s[b:e] -} - -var ( - importPathNameSanitizer = strings.NewReplacer("-", "_", ".", "") -) - -// filters out unwanted directory names and sanitizes remaining names. -func (ns *NameStrategy) filterDirs(path string) []string { - allDirs := strings.Split(path, GoSeperator) - dirs := make([]string, 0, len(allDirs)) - for _, p := range allDirs { - if ns.IgnoreWords == nil || !ns.IgnoreWords[p] { - dirs = append(dirs, importPathNameSanitizer.Replace(p)) - } - } - return dirs -} - -// See the comment on NameStrategy. -func (ns *NameStrategy) Name(t *types.Type) string { - if ns.Names == nil { - ns.Names = Names{} - } - if s, ok := ns.Names[t]; ok { - return s - } - - if t.Name.Package != "" { - dirs := append(ns.filterDirs(t.Name.Package), t.Name.Name) - i := ns.PrependPackageNames + 1 - dn := len(dirs) - if i > dn { - i = dn - } - name := ns.Join(ns.Prefix, dirs[dn-i:], ns.Suffix) - ns.Names[t] = name - return name - } - - // Only anonymous types remain. - var name string - switch t.Kind { - case types.Builtin: - name = ns.Join(ns.Prefix, []string{t.Name.Name}, ns.Suffix) - case types.Map: - name = ns.Join(ns.Prefix, []string{ - "Map", - ns.removePrefixAndSuffix(ns.Name(t.Key)), - "To", - ns.removePrefixAndSuffix(ns.Name(t.Elem)), - }, ns.Suffix) - case types.Slice: - name = ns.Join(ns.Prefix, []string{ - "Slice", - ns.removePrefixAndSuffix(ns.Name(t.Elem)), - }, ns.Suffix) - case types.Pointer: - name = ns.Join(ns.Prefix, []string{ - "Pointer", - ns.removePrefixAndSuffix(ns.Name(t.Elem)), - }, ns.Suffix) - case types.Struct: - names := []string{"Struct"} - for _, m := range t.Members { - names = append(names, ns.removePrefixAndSuffix(ns.Name(m.Type))) - } - name = ns.Join(ns.Prefix, names, ns.Suffix) - case types.Chan: - name = ns.Join(ns.Prefix, []string{ - "Chan", - ns.removePrefixAndSuffix(ns.Name(t.Elem)), - }, ns.Suffix) - case types.Interface: - // TODO: add to name test - names := []string{"Interface"} - for _, m := range t.Methods { - // TODO: include function signature - names = append(names, m.Name.Name) - } - name = ns.Join(ns.Prefix, names, ns.Suffix) - case types.Func: - // TODO: add to name test - parts := []string{"Func"} - for _, pt := range t.Signature.Parameters { - parts = append(parts, ns.removePrefixAndSuffix(ns.Name(pt))) - } - parts = append(parts, "Returns") - for _, rt := range t.Signature.Results { - parts = append(parts, ns.removePrefixAndSuffix(ns.Name(rt))) - } - name = ns.Join(ns.Prefix, parts, ns.Suffix) - default: - name = "unnameable_" + string(t.Kind) - } - ns.Names[t] = name - return name -} - -// ImportTracker allows a raw namer to keep track of the packages needed for -// import. You can implement yourself or use the one in the generation package. -type ImportTracker interface { - AddType(*types.Type) - LocalNameOf(packagePath string) string - PathOf(localName string) (string, bool) - ImportLines() []string -} - -type rawNamer struct { - pkg string - tracker ImportTracker - Names -} - -// Name makes a name the way you'd write it to literally refer to type t, -// making ordinary assumptions about how you've imported t's package (or using -// r.tracker to specifically track the package imports). -func (r *rawNamer) Name(t *types.Type) string { - if r.Names == nil { - r.Names = Names{} - } - if name, ok := r.Names[t]; ok { - return name - } - if t.Name.Package != "" { - var name string - if r.tracker != nil { - r.tracker.AddType(t) - if t.Name.Package == r.pkg { - name = t.Name.Name - } else { - name = r.tracker.LocalNameOf(t.Name.Package) + "." + t.Name.Name - } - } else { - if t.Name.Package == r.pkg { - name = t.Name.Name - } else { - name = filepath.Base(t.Name.Package) + "." + t.Name.Name - } - } - r.Names[t] = name - return name - } - var name string - switch t.Kind { - case types.Builtin: - name = t.Name.Name - case types.Map: - name = "map[" + r.Name(t.Key) + "]" + r.Name(t.Elem) - case types.Slice: - name = "[]" + r.Name(t.Elem) - case types.Pointer: - name = "*" + r.Name(t.Elem) - case types.Struct: - elems := []string{} - for _, m := range t.Members { - elems = append(elems, m.Name+" "+r.Name(m.Type)) - } - name = "struct{" + strings.Join(elems, "; ") + "}" - case types.Chan: - // TODO: include directionality - name = "chan " + r.Name(t.Elem) - case types.Interface: - // TODO: add to name test - elems := []string{} - for _, m := range t.Methods { - // TODO: include function signature - elems = append(elems, m.Name.Name) - } - name = "interface{" + strings.Join(elems, "; ") + "}" - case types.Func: - // TODO: add to name test - params := []string{} - for _, pt := range t.Signature.Parameters { - params = append(params, r.Name(pt)) - } - results := []string{} - for _, rt := range t.Signature.Results { - results = append(results, r.Name(rt)) - } - name = "func(" + strings.Join(params, ",") + ")" - if len(results) == 1 { - name += " " + results[0] - } else if len(results) > 1 { - name += " (" + strings.Join(results, ",") + ")" - } - default: - name = "unnameable_" + string(t.Kind) - } - r.Names[t] = name - return name -} diff --git a/vendor/k8s.io/gengo/namer/order.go b/vendor/k8s.io/gengo/namer/order.go deleted file mode 100644 index fd89be9..0000000 --- a/vendor/k8s.io/gengo/namer/order.go +++ /dev/null @@ -1,72 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package namer - -import ( - "sort" - - "k8s.io/gengo/types" -) - -// Orderer produces an ordering of types given a Namer. -type Orderer struct { - Namer -} - -// OrderUniverse assigns a name to every type in the Universe, including Types, -// Functions and Variables, and returns a list sorted by those names. -func (o *Orderer) OrderUniverse(u types.Universe) []*types.Type { - list := tList{ - namer: o.Namer, - } - for _, p := range u { - for _, t := range p.Types { - list.types = append(list.types, t) - } - for _, f := range p.Functions { - list.types = append(list.types, f) - } - for _, v := range p.Variables { - list.types = append(list.types, v) - } - for _, v := range p.Constants { - list.types = append(list.types, v) - } - } - sort.Sort(list) - return list.types -} - -// OrderTypes assigns a name to every type, and returns a list sorted by those -// names. -func (o *Orderer) OrderTypes(typeList []*types.Type) []*types.Type { - list := tList{ - namer: o.Namer, - types: typeList, - } - sort.Sort(list) - return list.types -} - -type tList struct { - namer Namer - types []*types.Type -} - -func (t tList) Len() int { return len(t.types) } -func (t tList) Less(i, j int) bool { return t.namer.Name(t.types[i]) < t.namer.Name(t.types[j]) } -func (t tList) Swap(i, j int) { t.types[i], t.types[j] = t.types[j], t.types[i] } diff --git a/vendor/k8s.io/gengo/namer/plural_namer.go b/vendor/k8s.io/gengo/namer/plural_namer.go deleted file mode 100644 index 0e3ebbf..0000000 --- a/vendor/k8s.io/gengo/namer/plural_namer.go +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package namer - -import ( - "strings" - - "k8s.io/gengo/types" -) - -var consonants = "bcdfghjklmnpqrstvwxyz" - -type pluralNamer struct { - // key is the case-sensitive type name, value is the case-insensitive - // intended output. - exceptions map[string]string - finalize func(string) string -} - -// NewPublicPluralNamer returns a namer that returns the plural form of the input -// type's name, starting with a uppercase letter. -func NewPublicPluralNamer(exceptions map[string]string) *pluralNamer { - return &pluralNamer{exceptions, IC} -} - -// NewPrivatePluralNamer returns a namer that returns the plural form of the input -// type's name, starting with a lowercase letter. -func NewPrivatePluralNamer(exceptions map[string]string) *pluralNamer { - return &pluralNamer{exceptions, IL} -} - -// NewAllLowercasePluralNamer returns a namer that returns the plural form of the input -// type's name, with all letters in lowercase. -func NewAllLowercasePluralNamer(exceptions map[string]string) *pluralNamer { - return &pluralNamer{exceptions, strings.ToLower} -} - -// Name returns the plural form of the type's name. If the type's name is found -// in the exceptions map, the map value is returned. -func (r *pluralNamer) Name(t *types.Type) string { - singular := t.Name.Name - var plural string - var ok bool - if plural, ok = r.exceptions[singular]; ok { - return r.finalize(plural) - } - if len(singular) < 2 { - return r.finalize(singular) - } - - switch rune(singular[len(singular)-1]) { - case 's', 'x', 'z': - plural = esPlural(singular) - case 'y': - sl := rune(singular[len(singular)-2]) - if isConsonant(sl) { - plural = iesPlural(singular) - } else { - plural = sPlural(singular) - } - case 'h': - sl := rune(singular[len(singular)-2]) - if sl == 'c' || sl == 's' { - plural = esPlural(singular) - } else { - plural = sPlural(singular) - } - case 'e': - sl := rune(singular[len(singular)-2]) - if sl == 'f' { - plural = vesPlural(singular[:len(singular)-1]) - } else { - plural = sPlural(singular) - } - case 'f': - plural = vesPlural(singular) - default: - plural = sPlural(singular) - } - return r.finalize(plural) -} - -func iesPlural(singular string) string { - return singular[:len(singular)-1] + "ies" -} - -func vesPlural(singular string) string { - return singular[:len(singular)-1] + "ves" -} - -func esPlural(singular string) string { - return singular + "es" -} - -func sPlural(singular string) string { - return singular + "s" -} - -func isConsonant(char rune) bool { - for _, c := range consonants { - if char == c { - return true - } - } - return false -} diff --git a/vendor/k8s.io/gengo/parser/parse.go b/vendor/k8s.io/gengo/parser/parse.go deleted file mode 100644 index f3abe57..0000000 --- a/vendor/k8s.io/gengo/parser/parse.go +++ /dev/null @@ -1,859 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package parser - -import ( - "fmt" - "go/ast" - "go/build" - "go/parser" - "go/token" - tc "go/types" - "io/ioutil" - "os" - "os/exec" - "path" - "path/filepath" - "regexp" - "sort" - "strings" - - "k8s.io/gengo/types" - "k8s.io/klog" -) - -// This clarifies when a pkg path has been canonicalized. -type importPathString string - -// Builder lets you add all the go files in all the packages that you care -// about, then constructs the type source data. -type Builder struct { - context *build.Context - - // If true, include *_test.go - IncludeTestFiles bool - - // Map of package names to more canonical information about the package. - // This might hold the same value for multiple names, e.g. if someone - // referenced ./pkg/name or in the case of vendoring, which canonicalizes - // differently that what humans would type. - buildPackages map[string]*build.Package - - fset *token.FileSet - // map of package path to list of parsed files - parsed map[importPathString][]parsedFile - // map of package path to absolute path (to prevent overlap) - absPaths map[importPathString]string - - // Set by typeCheckPackage(), used by importPackage() and friends. - typeCheckedPackages map[importPathString]*tc.Package - - // Map of package path to whether the user requested it or it was from - // an import. - userRequested map[importPathString]bool - - // All comments from everywhere in every parsed file. - endLineToCommentGroup map[fileLine]*ast.CommentGroup - - // map of package to list of packages it imports. - importGraph map[importPathString]map[string]struct{} -} - -// parsedFile is for tracking files with name -type parsedFile struct { - name string - file *ast.File -} - -// key type for finding comments. -type fileLine struct { - file string - line int -} - -// New constructs a new builder. -func New() *Builder { - c := build.Default - if c.GOROOT == "" { - if p, err := exec.Command("which", "go").CombinedOutput(); err == nil { - // The returned string will have some/path/bin/go, so remove the last two elements. - c.GOROOT = filepath.Dir(filepath.Dir(strings.Trim(string(p), "\n"))) - } else { - klog.Warningf("Warning: $GOROOT not set, and unable to run `which go` to find it: %v\n", err) - } - } - // Force this to off, since we don't properly parse CGo. All symbols must - // have non-CGo equivalents. - c.CgoEnabled = false - return &Builder{ - context: &c, - buildPackages: map[string]*build.Package{}, - typeCheckedPackages: map[importPathString]*tc.Package{}, - fset: token.NewFileSet(), - parsed: map[importPathString][]parsedFile{}, - absPaths: map[importPathString]string{}, - userRequested: map[importPathString]bool{}, - endLineToCommentGroup: map[fileLine]*ast.CommentGroup{}, - importGraph: map[importPathString]map[string]struct{}{}, - } -} - -// AddBuildTags adds the specified build tags to the parse context. -func (b *Builder) AddBuildTags(tags ...string) { - b.context.BuildTags = append(b.context.BuildTags, tags...) -} - -// Get package information from the go/build package. Automatically excludes -// e.g. test files and files for other platforms-- there is quite a bit of -// logic of that nature in the build package. -func (b *Builder) importBuildPackage(dir string) (*build.Package, error) { - if buildPkg, ok := b.buildPackages[dir]; ok { - return buildPkg, nil - } - // This validates the `package foo // github.com/bar/foo` comments. - buildPkg, err := b.importWithMode(dir, build.ImportComment) - if err != nil { - if _, ok := err.(*build.NoGoError); !ok { - return nil, fmt.Errorf("unable to import %q: %v", dir, err) - } - } - if buildPkg == nil { - // Might be an empty directory. Try to just find the dir. - buildPkg, err = b.importWithMode(dir, build.FindOnly) - if err != nil { - return nil, err - } - } - - // Remember it under the user-provided name. - klog.V(5).Infof("saving buildPackage %s", dir) - b.buildPackages[dir] = buildPkg - canonicalPackage := canonicalizeImportPath(buildPkg.ImportPath) - if dir != string(canonicalPackage) { - // Since `dir` is not the canonical name, see if we knew it under another name. - if buildPkg, ok := b.buildPackages[string(canonicalPackage)]; ok { - return buildPkg, nil - } - // Must be new, save it under the canonical name, too. - klog.V(5).Infof("saving buildPackage %s", canonicalPackage) - b.buildPackages[string(canonicalPackage)] = buildPkg - } - - return buildPkg, nil -} - -// AddFileForTest adds a file to the set, without verifying that the provided -// pkg actually exists on disk. The pkg must be of the form "canonical/pkg/path" -// and the path must be the absolute path to the file. Because this bypasses -// the normal recursive finding of package dependencies (on disk), test should -// sort their test files topologically first, so all deps are resolved by the -// time we need them. -func (b *Builder) AddFileForTest(pkg string, path string, src []byte) error { - if err := b.addFile(importPathString(pkg), path, src, true); err != nil { - return err - } - if _, err := b.typeCheckPackage(importPathString(pkg)); err != nil { - return err - } - return nil -} - -// addFile adds a file to the set. The pkgPath must be of the form -// "canonical/pkg/path" and the path must be the absolute path to the file. A -// flag indicates whether this file was user-requested or just from following -// the import graph. -func (b *Builder) addFile(pkgPath importPathString, path string, src []byte, userRequested bool) error { - for _, p := range b.parsed[pkgPath] { - if path == p.name { - klog.V(5).Infof("addFile %s %s already parsed, skipping", pkgPath, path) - return nil - } - } - klog.V(6).Infof("addFile %s %s", pkgPath, path) - p, err := parser.ParseFile(b.fset, path, src, parser.DeclarationErrors|parser.ParseComments) - if err != nil { - return err - } - - // This is redundant with addDir, but some tests call AddFileForTest, which - // call into here without calling addDir. - b.userRequested[pkgPath] = userRequested || b.userRequested[pkgPath] - - b.parsed[pkgPath] = append(b.parsed[pkgPath], parsedFile{path, p}) - for _, c := range p.Comments { - position := b.fset.Position(c.End()) - b.endLineToCommentGroup[fileLine{position.Filename, position.Line}] = c - } - - // We have to get the packages from this specific file, in case the - // user added individual files instead of entire directories. - if b.importGraph[pkgPath] == nil { - b.importGraph[pkgPath] = map[string]struct{}{} - } - for _, im := range p.Imports { - importedPath := strings.Trim(im.Path.Value, `"`) - b.importGraph[pkgPath][importedPath] = struct{}{} - } - return nil -} - -// AddDir adds an entire directory, scanning it for go files. 'dir' should have -// a single go package in it. GOPATH, GOROOT, and the location of your go -// binary (`which go`) will all be searched if dir doesn't literally resolve. -func (b *Builder) AddDir(dir string) error { - _, err := b.importPackage(dir, true) - return err -} - -// AddDirRecursive is just like AddDir, but it also recursively adds -// subdirectories; it returns an error only if the path couldn't be resolved; -// any directories recursed into without go source are ignored. -func (b *Builder) AddDirRecursive(dir string) error { - // Add the root. - if _, err := b.importPackage(dir, true); err != nil { - klog.Warningf("Ignoring directory %v: %v", dir, err) - } - - // filepath.Walk does not follow symlinks. We therefore evaluate symlinks and use that with - // filepath.Walk. - realPath, err := filepath.EvalSymlinks(b.buildPackages[dir].Dir) - if err != nil { - return err - } - - fn := func(filePath string, info os.FileInfo, err error) error { - if info != nil && info.IsDir() { - rel := filepath.ToSlash(strings.TrimPrefix(filePath, realPath)) - if rel != "" { - // Make a pkg path. - pkg := path.Join(string(canonicalizeImportPath(b.buildPackages[dir].ImportPath)), rel) - - // Add it. - if _, err := b.importPackage(pkg, true); err != nil { - klog.Warningf("Ignoring child directory %v: %v", pkg, err) - } - } - } - return nil - } - if err := filepath.Walk(realPath, fn); err != nil { - return err - } - return nil -} - -// AddDirTo adds an entire directory to a given Universe. Unlike AddDir, this -// processes the package immediately, which makes it safe to use from within a -// generator (rather than just at init time. 'dir' must be a single go package. -// GOPATH, GOROOT, and the location of your go binary (`which go`) will all be -// searched if dir doesn't literally resolve. -// Deprecated. Please use AddDirectoryTo. -func (b *Builder) AddDirTo(dir string, u *types.Universe) error { - // We want all types from this package, as if they were directly added - // by the user. They WERE added by the user, in effect. - if _, err := b.importPackage(dir, true); err != nil { - return err - } - return b.findTypesIn(canonicalizeImportPath(b.buildPackages[dir].ImportPath), u) -} - -// AddDirectoryTo adds an entire directory to a given Universe. Unlike AddDir, -// this processes the package immediately, which makes it safe to use from -// within a generator (rather than just at init time. 'dir' must be a single go -// package. GOPATH, GOROOT, and the location of your go binary (`which go`) -// will all be searched if dir doesn't literally resolve. -func (b *Builder) AddDirectoryTo(dir string, u *types.Universe) (*types.Package, error) { - // We want all types from this package, as if they were directly added - // by the user. They WERE added by the user, in effect. - if _, err := b.importPackage(dir, true); err != nil { - return nil, err - } - path := canonicalizeImportPath(b.buildPackages[dir].ImportPath) - if err := b.findTypesIn(path, u); err != nil { - return nil, err - } - return u.Package(string(path)), nil -} - -// The implementation of AddDir. A flag indicates whether this directory was -// user-requested or just from following the import graph. -func (b *Builder) addDir(dir string, userRequested bool) error { - klog.V(5).Infof("addDir %s", dir) - buildPkg, err := b.importBuildPackage(dir) - if err != nil { - return err - } - canonicalPackage := canonicalizeImportPath(buildPkg.ImportPath) - pkgPath := canonicalPackage - if dir != string(canonicalPackage) { - klog.V(5).Infof("addDir %s, canonical path is %s", dir, pkgPath) - } - - // Sanity check the pkg dir has not changed. - if prev, found := b.absPaths[pkgPath]; found { - if buildPkg.Dir != prev { - return fmt.Errorf("package %q (%s) previously resolved to %s", pkgPath, buildPkg.Dir, prev) - } - } else { - b.absPaths[pkgPath] = buildPkg.Dir - } - - files := []string{} - files = append(files, buildPkg.GoFiles...) - if b.IncludeTestFiles { - files = append(files, buildPkg.TestGoFiles...) - } - - for _, file := range files { - if !strings.HasSuffix(file, ".go") { - continue - } - absPath := filepath.Join(buildPkg.Dir, file) - data, err := ioutil.ReadFile(absPath) - if err != nil { - return fmt.Errorf("while loading %q: %v", absPath, err) - } - err = b.addFile(pkgPath, absPath, data, userRequested) - if err != nil { - return fmt.Errorf("while parsing %q: %v", absPath, err) - } - } - return nil -} - -var regexErrPackageNotFound = regexp.MustCompile(`^unable to import ".*?": cannot find package ".*?" in any of:`) - -func isErrPackageNotFound(err error) bool { - return regexErrPackageNotFound.MatchString(err.Error()) -} - -// importPackage is a function that will be called by the type check package when it -// needs to import a go package. 'path' is the import path. -func (b *Builder) importPackage(dir string, userRequested bool) (*tc.Package, error) { - klog.V(5).Infof("importPackage %s", dir) - var pkgPath = importPathString(dir) - - // Get the canonical path if we can. - if buildPkg := b.buildPackages[dir]; buildPkg != nil { - canonicalPackage := canonicalizeImportPath(buildPkg.ImportPath) - klog.V(5).Infof("importPackage %s, canonical path is %s", dir, canonicalPackage) - pkgPath = canonicalPackage - } - - // If we have not seen this before, process it now. - ignoreError := false - if _, found := b.parsed[pkgPath]; !found { - // Ignore errors in paths that we're importing solely because - // they're referenced by other packages. - ignoreError = true - - // Add it. - if err := b.addDir(dir, userRequested); err != nil { - if isErrPackageNotFound(err) { - klog.V(6).Info(err) - return nil, nil - } - - return nil, err - } - - // Get the canonical path now that it has been added. - if buildPkg := b.buildPackages[dir]; buildPkg != nil { - canonicalPackage := canonicalizeImportPath(buildPkg.ImportPath) - klog.V(5).Infof("importPackage %s, canonical path is %s", dir, canonicalPackage) - pkgPath = canonicalPackage - } - } - - // If it was previously known, just check that the user-requestedness hasn't - // changed. - b.userRequested[pkgPath] = userRequested || b.userRequested[pkgPath] - - // Run the type checker. We may end up doing this to pkgs that are already - // done, or are in the queue to be done later, but it will short-circuit, - // and we can't miss pkgs that are only depended on. - pkg, err := b.typeCheckPackage(pkgPath) - if err != nil { - switch { - case ignoreError && pkg != nil: - klog.V(2).Infof("type checking encountered some issues in %q, but ignoring.\n", pkgPath) - case !ignoreError && pkg != nil: - klog.V(2).Infof("type checking encountered some errors in %q\n", pkgPath) - return nil, err - default: - return nil, err - } - } - - return pkg, nil -} - -type importAdapter struct { - b *Builder -} - -func (a importAdapter) Import(path string) (*tc.Package, error) { - return a.b.importPackage(path, false) -} - -// typeCheckPackage will attempt to return the package even if there are some -// errors, so you may check whether the package is nil or not even if you get -// an error. -func (b *Builder) typeCheckPackage(pkgPath importPathString) (*tc.Package, error) { - klog.V(5).Infof("typeCheckPackage %s", pkgPath) - if pkg, ok := b.typeCheckedPackages[pkgPath]; ok { - if pkg != nil { - klog.V(6).Infof("typeCheckPackage %s already done", pkgPath) - return pkg, nil - } - // We store a nil right before starting work on a package. So - // if we get here and it's present and nil, that means there's - // another invocation of this function on the call stack - // already processing this package. - return nil, fmt.Errorf("circular dependency for %q", pkgPath) - } - parsedFiles, ok := b.parsed[pkgPath] - if !ok { - return nil, fmt.Errorf("No files for pkg %q", pkgPath) - } - files := make([]*ast.File, len(parsedFiles)) - for i := range parsedFiles { - files[i] = parsedFiles[i].file - } - b.typeCheckedPackages[pkgPath] = nil - c := tc.Config{ - IgnoreFuncBodies: true, - // Note that importAdapter can call b.importPackage which calls this - // method. So there can't be cycles in the import graph. - Importer: importAdapter{b}, - Error: func(err error) { - klog.V(2).Infof("type checker: %v\n", err) - }, - } - pkg, err := c.Check(string(pkgPath), b.fset, files, nil) - b.typeCheckedPackages[pkgPath] = pkg // record the result whether or not there was an error - return pkg, err -} - -// FindPackages fetches a list of the user-imported packages. -// Note that you need to call b.FindTypes() first. -func (b *Builder) FindPackages() []string { - // Iterate packages in a predictable order. - pkgPaths := []string{} - for k := range b.typeCheckedPackages { - pkgPaths = append(pkgPaths, string(k)) - } - sort.Strings(pkgPaths) - - result := []string{} - for _, pkgPath := range pkgPaths { - if b.userRequested[importPathString(pkgPath)] { - // Since walkType is recursive, all types that are in packages that - // were directly mentioned will be included. We don't need to - // include all types in all transitive packages, though. - result = append(result, pkgPath) - } - } - return result -} - -// FindTypes finalizes the package imports, and searches through all the -// packages for types. -func (b *Builder) FindTypes() (types.Universe, error) { - // Take a snapshot of pkgs to iterate, since this will recursively mutate - // b.parsed. Iterate in a predictable order. - pkgPaths := []string{} - for pkgPath := range b.parsed { - pkgPaths = append(pkgPaths, string(pkgPath)) - } - sort.Strings(pkgPaths) - - u := types.Universe{} - for _, pkgPath := range pkgPaths { - if err := b.findTypesIn(importPathString(pkgPath), &u); err != nil { - return nil, err - } - } - return u, nil -} - -// findTypesIn finalizes the package import and searches through the package -// for types. -func (b *Builder) findTypesIn(pkgPath importPathString, u *types.Universe) error { - klog.V(5).Infof("findTypesIn %s", pkgPath) - pkg := b.typeCheckedPackages[pkgPath] - if pkg == nil { - return fmt.Errorf("findTypesIn(%s): package is not known", pkgPath) - } - if !b.userRequested[pkgPath] { - // Since walkType is recursive, all types that the - // packages they asked for depend on will be included. - // But we don't need to include all types in all - // *packages* they depend on. - klog.V(5).Infof("findTypesIn %s: package is not user requested", pkgPath) - return nil - } - - // We're keeping this package. This call will create the record. - u.Package(string(pkgPath)).Name = pkg.Name() - u.Package(string(pkgPath)).Path = pkg.Path() - u.Package(string(pkgPath)).SourcePath = b.absPaths[pkgPath] - - for _, f := range b.parsed[pkgPath] { - if _, fileName := filepath.Split(f.name); fileName == "doc.go" { - tp := u.Package(string(pkgPath)) - // findTypesIn might be called multiple times. Clean up tp.Comments - // to avoid repeatedly fill same comments to it. - tp.Comments = []string{} - for i := range f.file.Comments { - tp.Comments = append(tp.Comments, splitLines(f.file.Comments[i].Text())...) - } - if f.file.Doc != nil { - tp.DocComments = splitLines(f.file.Doc.Text()) - } - } - } - - s := pkg.Scope() - for _, n := range s.Names() { - obj := s.Lookup(n) - tn, ok := obj.(*tc.TypeName) - if ok { - t := b.walkType(*u, nil, tn.Type()) - c1 := b.priorCommentLines(obj.Pos(), 1) - // c1.Text() is safe if c1 is nil - t.CommentLines = splitLines(c1.Text()) - if c1 == nil { - t.SecondClosestCommentLines = splitLines(b.priorCommentLines(obj.Pos(), 2).Text()) - } else { - t.SecondClosestCommentLines = splitLines(b.priorCommentLines(c1.List[0].Slash, 2).Text()) - } - } - tf, ok := obj.(*tc.Func) - // We only care about functions, not concrete/abstract methods. - if ok && tf.Type() != nil && tf.Type().(*tc.Signature).Recv() == nil { - t := b.addFunction(*u, nil, tf) - c1 := b.priorCommentLines(obj.Pos(), 1) - // c1.Text() is safe if c1 is nil - t.CommentLines = splitLines(c1.Text()) - if c1 == nil { - t.SecondClosestCommentLines = splitLines(b.priorCommentLines(obj.Pos(), 2).Text()) - } else { - t.SecondClosestCommentLines = splitLines(b.priorCommentLines(c1.List[0].Slash, 2).Text()) - } - } - tv, ok := obj.(*tc.Var) - if ok && !tv.IsField() { - b.addVariable(*u, nil, tv) - } - tconst, ok := obj.(*tc.Const) - if ok { - b.addConstant(*u, nil, tconst) - } - } - - importedPkgs := []string{} - for k := range b.importGraph[pkgPath] { - importedPkgs = append(importedPkgs, string(k)) - } - sort.Strings(importedPkgs) - for _, p := range importedPkgs { - u.AddImports(string(pkgPath), p) - } - return nil -} - -func (b *Builder) importWithMode(dir string, mode build.ImportMode) (*build.Package, error) { - // This is a bit of a hack. The srcDir argument to Import() should - // properly be the dir of the file which depends on the package to be - // imported, so that vendoring can work properly and local paths can - // resolve. We assume that there is only one level of vendoring, and that - // the CWD is inside the GOPATH, so this should be safe. Nobody should be - // using local (relative) paths except on the CLI, so CWD is also - // sufficient. - cwd, err := os.Getwd() - if err != nil { - return nil, fmt.Errorf("unable to get current directory: %v", err) - } - buildPkg, err := b.context.Import(dir, cwd, mode) - if err != nil { - return nil, err - } - return buildPkg, nil -} - -// if there's a comment on the line `lines` before pos, return its text, otherwise "". -func (b *Builder) priorCommentLines(pos token.Pos, lines int) *ast.CommentGroup { - position := b.fset.Position(pos) - key := fileLine{position.Filename, position.Line - lines} - return b.endLineToCommentGroup[key] -} - -func splitLines(str string) []string { - return strings.Split(strings.TrimRight(str, "\n"), "\n") -} - -func tcFuncNameToName(in string) types.Name { - name := strings.TrimPrefix(in, "func ") - nameParts := strings.Split(name, "(") - return tcNameToName(nameParts[0]) -} - -func tcVarNameToName(in string) types.Name { - nameParts := strings.Split(in, " ") - // nameParts[0] is "var". - // nameParts[2:] is the type of the variable, we ignore it for now. - return tcNameToName(nameParts[1]) -} - -func tcNameToName(in string) types.Name { - // Detect anonymous type names. (These may have '.' characters because - // embedded types may have packages, so we detect them specially.) - if strings.HasPrefix(in, "struct{") || - strings.HasPrefix(in, "<-chan") || - strings.HasPrefix(in, "chan<-") || - strings.HasPrefix(in, "chan ") || - strings.HasPrefix(in, "func(") || - strings.HasPrefix(in, "*") || - strings.HasPrefix(in, "map[") || - strings.HasPrefix(in, "[") { - return types.Name{Name: in} - } - - // Otherwise, if there are '.' characters present, the name has a - // package path in front. - nameParts := strings.Split(in, ".") - name := types.Name{Name: in} - if n := len(nameParts); n >= 2 { - // The final "." is the name of the type--previous ones must - // have been in the package path. - name.Package, name.Name = strings.Join(nameParts[:n-1], "."), nameParts[n-1] - } - return name -} - -func (b *Builder) convertSignature(u types.Universe, t *tc.Signature) *types.Signature { - signature := &types.Signature{} - for i := 0; i < t.Params().Len(); i++ { - signature.Parameters = append(signature.Parameters, b.walkType(u, nil, t.Params().At(i).Type())) - } - for i := 0; i < t.Results().Len(); i++ { - signature.Results = append(signature.Results, b.walkType(u, nil, t.Results().At(i).Type())) - } - if r := t.Recv(); r != nil { - signature.Receiver = b.walkType(u, nil, r.Type()) - } - signature.Variadic = t.Variadic() - return signature -} - -// walkType adds the type, and any necessary child types. -func (b *Builder) walkType(u types.Universe, useName *types.Name, in tc.Type) *types.Type { - // Most of the cases are underlying types of the named type. - name := tcNameToName(in.String()) - if useName != nil { - name = *useName - } - - switch t := in.(type) { - case *tc.Struct: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Struct - for i := 0; i < t.NumFields(); i++ { - f := t.Field(i) - m := types.Member{ - Name: f.Name(), - Embedded: f.Anonymous(), - Tags: t.Tag(i), - Type: b.walkType(u, nil, f.Type()), - CommentLines: splitLines(b.priorCommentLines(f.Pos(), 1).Text()), - } - out.Members = append(out.Members, m) - } - return out - case *tc.Map: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Map - out.Elem = b.walkType(u, nil, t.Elem()) - out.Key = b.walkType(u, nil, t.Key()) - return out - case *tc.Pointer: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Pointer - out.Elem = b.walkType(u, nil, t.Elem()) - return out - case *tc.Slice: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Slice - out.Elem = b.walkType(u, nil, t.Elem()) - return out - case *tc.Array: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Array - out.Elem = b.walkType(u, nil, t.Elem()) - // TODO: need to store array length, otherwise raw type name - // cannot be properly written. - return out - case *tc.Chan: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Chan - out.Elem = b.walkType(u, nil, t.Elem()) - // TODO: need to store direction, otherwise raw type name - // cannot be properly written. - return out - case *tc.Basic: - out := u.Type(types.Name{ - Package: "", - Name: t.Name(), - }) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Unsupported - return out - case *tc.Signature: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Func - out.Signature = b.convertSignature(u, t) - return out - case *tc.Interface: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Interface - t.Complete() - for i := 0; i < t.NumMethods(); i++ { - if out.Methods == nil { - out.Methods = map[string]*types.Type{} - } - method := t.Method(i) - mt := b.walkType(u, nil, method.Type()) - mt.CommentLines = splitLines(b.priorCommentLines(method.Pos(), 1).Text()) - out.Methods[method.Name()] = mt - } - return out - case *tc.Named: - var out *types.Type - switch t.Underlying().(type) { - case *tc.Named, *tc.Basic, *tc.Map, *tc.Slice: - name := tcNameToName(t.String()) - out = u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Alias - out.Underlying = b.walkType(u, nil, t.Underlying()) - default: - // tc package makes everything "named" with an - // underlying anonymous type--we remove that annoying - // "feature" for users. This flattens those types - // together. - name := tcNameToName(t.String()) - if out := u.Type(name); out.Kind != types.Unknown { - return out // short circuit if we've already made this. - } - out = b.walkType(u, &name, t.Underlying()) - } - // If the underlying type didn't already add methods, add them. - // (Interface types will have already added methods.) - if len(out.Methods) == 0 { - for i := 0; i < t.NumMethods(); i++ { - if out.Methods == nil { - out.Methods = map[string]*types.Type{} - } - method := t.Method(i) - mt := b.walkType(u, nil, method.Type()) - mt.CommentLines = splitLines(b.priorCommentLines(method.Pos(), 1).Text()) - out.Methods[method.Name()] = mt - } - } - return out - default: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Unsupported - klog.Warningf("Making unsupported type entry %q for: %#v\n", out, t) - return out - } -} - -func (b *Builder) addFunction(u types.Universe, useName *types.Name, in *tc.Func) *types.Type { - name := tcFuncNameToName(in.String()) - if useName != nil { - name = *useName - } - out := u.Function(name) - out.Kind = types.DeclarationOf - out.Underlying = b.walkType(u, nil, in.Type()) - return out -} - -func (b *Builder) addVariable(u types.Universe, useName *types.Name, in *tc.Var) *types.Type { - name := tcVarNameToName(in.String()) - if useName != nil { - name = *useName - } - out := u.Variable(name) - out.Kind = types.DeclarationOf - out.Underlying = b.walkType(u, nil, in.Type()) - return out -} - -func (b *Builder) addConstant(u types.Universe, useName *types.Name, in *tc.Const) *types.Type { - name := tcVarNameToName(in.String()) - if useName != nil { - name = *useName - } - out := u.Constant(name) - out.Kind = types.DeclarationOf - out.Underlying = b.walkType(u, nil, in.Type()) - return out -} - -// canonicalizeImportPath takes an import path and returns the actual package. -// It doesn't support nested vendoring. -func canonicalizeImportPath(importPath string) importPathString { - if !strings.Contains(importPath, "/vendor/") { - return importPathString(importPath) - } - - return importPathString(importPath[strings.Index(importPath, "/vendor/")+len("/vendor/"):]) -} diff --git a/vendor/k8s.io/gengo/types/comments.go b/vendor/k8s.io/gengo/types/comments.go deleted file mode 100644 index 8150c38..0000000 --- a/vendor/k8s.io/gengo/types/comments.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package types contains go type information, packaged in a way that makes -// auto-generation convenient, whether by template or straight go functions. -package types - -import ( - "fmt" - "strings" -) - -// ExtractCommentTags parses comments for lines of the form: -// -// 'marker' + "key=value". -// -// Values are optional; "" is the default. A tag can be specified more than -// one time and all values are returned. If the resulting map has an entry for -// a key, the value (a slice) is guaranteed to have at least 1 element. -// -// Example: if you pass "+" for 'marker', and the following lines are in -// the comments: -// +foo=value1 -// +bar -// +foo=value2 -// +baz="qux" -// Then this function will return: -// map[string][]string{"foo":{"value1, "value2"}, "bar": {""}, "baz": {"qux"}} -func ExtractCommentTags(marker string, lines []string) map[string][]string { - out := map[string][]string{} - for _, line := range lines { - line = strings.Trim(line, " ") - if len(line) == 0 { - continue - } - if !strings.HasPrefix(line, marker) { - continue - } - // TODO: we could support multiple values per key if we split on spaces - kv := strings.SplitN(line[len(marker):], "=", 2) - if len(kv) == 2 { - out[kv[0]] = append(out[kv[0]], kv[1]) - } else if len(kv) == 1 { - out[kv[0]] = append(out[kv[0]], "") - } - } - return out -} - -// ExtractSingleBoolCommentTag parses comments for lines of the form: -// -// 'marker' + "key=value1" -// -// If the tag is not found, the default value is returned. Values are asserted -// to be boolean ("true" or "false"), and any other value will cause an error -// to be returned. If the key has multiple values, the first one will be used. -func ExtractSingleBoolCommentTag(marker string, key string, defaultVal bool, lines []string) (bool, error) { - values := ExtractCommentTags(marker, lines)[key] - if values == nil { - return defaultVal, nil - } - if values[0] == "true" { - return true, nil - } - if values[0] == "false" { - return false, nil - } - return false, fmt.Errorf("tag value for %q is not boolean: %q", key, values[0]) -} diff --git a/vendor/k8s.io/gengo/types/flatten.go b/vendor/k8s.io/gengo/types/flatten.go deleted file mode 100644 index 585014e..0000000 --- a/vendor/k8s.io/gengo/types/flatten.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package types - -// FlattenMembers recursively takes any embedded members and puts them in the -// top level, correctly hiding them if the top level hides them. There must not -// be a cycle-- that implies infinite members. -// -// This is useful for e.g. computing all the valid keys in a json struct, -// properly considering any configuration of embedded structs. -func FlattenMembers(m []Member) []Member { - embedded := []Member{} - normal := []Member{} - type nameInfo struct { - top bool - i int - } - names := map[string]nameInfo{} - for i := range m { - if m[i].Embedded && m[i].Type.Kind == Struct { - embedded = append(embedded, m[i]) - } else { - normal = append(normal, m[i]) - names[m[i].Name] = nameInfo{true, len(normal) - 1} - } - } - for i := range embedded { - for _, e := range FlattenMembers(embedded[i].Type.Members) { - if info, found := names[e.Name]; found { - if info.top { - continue - } - if n := normal[info.i]; n.Name == e.Name && n.Type == e.Type { - continue - } - panic("conflicting members") - } - normal = append(normal, e) - names[e.Name] = nameInfo{false, len(normal) - 1} - } - } - return normal -} diff --git a/vendor/k8s.io/gengo/types/types.go b/vendor/k8s.io/gengo/types/types.go deleted file mode 100644 index 78357bc..0000000 --- a/vendor/k8s.io/gengo/types/types.go +++ /dev/null @@ -1,526 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package types - -import "strings" - -// Ref makes a reference to the given type. It can only be used for e.g. -// passing to namers. -func Ref(packageName, typeName string) *Type { - return &Type{Name: Name{ - Name: typeName, - Package: packageName, - }} -} - -// A type name may have a package qualifier. -type Name struct { - // Empty if embedded or builtin. This is the package path unless Path is specified. - Package string - // The type name. - Name string - // An optional location of the type definition for languages that can have disjoint - // packages and paths. - Path string -} - -// String returns the name formatted as a string. -func (n Name) String() string { - if n.Package == "" { - return n.Name - } - return n.Package + "." + n.Name -} - -// ParseFullyQualifiedName parses a name like k8s.io/kubernetes/pkg/api.Pod into a Name. -func ParseFullyQualifiedName(fqn string) Name { - cs := strings.Split(fqn, ".") - pkg := "" - if len(cs) > 1 { - pkg = strings.Join(cs[0:len(cs)-1], ".") - } - return Name{ - Name: cs[len(cs)-1], - Package: pkg, - } -} - -// The possible classes of types. -type Kind string - -const ( - // Builtin is a primitive, like bool, string, int. - Builtin Kind = "Builtin" - Struct Kind = "Struct" - Map Kind = "Map" - Slice Kind = "Slice" - Pointer Kind = "Pointer" - - // Alias is an alias of another type, e.g. in: - // type Foo string - // type Bar Foo - // Bar is an alias of Foo. - // - // In the real go type system, Foo is a "Named" string; but to simplify - // generation, this type system will just say that Foo *is* a builtin. - // We then need "Alias" as a way for us to say that Bar *is* a Foo. - Alias Kind = "Alias" - - // Interface is any type that could have differing types at run time. - Interface Kind = "Interface" - - // The remaining types are included for completeness, but are not well - // supported. - Array Kind = "Array" // Array is just like slice, but has a fixed length. - Chan Kind = "Chan" - Func Kind = "Func" - - // DeclarationOf is different from other Kinds; it indicates that instead of - // representing an actual Type, the type is a declaration of an instance of - // a type. E.g., a top-level function, variable, or constant. See the - // comment for Type.Name for more detail. - DeclarationOf Kind = "DeclarationOf" - Unknown Kind = "" - Unsupported Kind = "Unsupported" - - // Protobuf is protobuf type. - Protobuf Kind = "Protobuf" -) - -// Package holds package-level information. -// Fields are public, as everything in this package, to enable consumption by -// templates (for example). But it is strongly encouraged for code to build by -// using the provided functions. -type Package struct { - // Canonical name of this package-- its path. - Path string - - // The location this package was loaded from - SourcePath string - - // Short name of this package; the name that appears in the - // 'package x' line. - Name string - - // The comment right above the package declaration in doc.go, if any. - DocComments []string - - // All comments from doc.go, if any. - // TODO: remove Comments and use DocComments everywhere. - Comments []string - - // Types within this package, indexed by their name (*not* including - // package name). - Types map[string]*Type - - // Functions within this package, indexed by their name (*not* including - // package name). - Functions map[string]*Type - - // Global variables within this package, indexed by their name (*not* including - // package name). - Variables map[string]*Type - - // Global constants within this package, indexed by their name (*not* including - // package name). - Constants map[string]*Type - - // Packages imported by this package, indexed by (canonicalized) - // package path. - Imports map[string]*Package -} - -// Has returns true if the given name references a type known to this package. -func (p *Package) Has(name string) bool { - _, has := p.Types[name] - return has -} - -// Type gets the given Type in this Package. If the Type is not already -// defined, this will add it and return the new Type value. The caller is -// expected to finish initialization. -func (p *Package) Type(typeName string) *Type { - if t, ok := p.Types[typeName]; ok { - return t - } - if p.Path == "" { - // Import the standard builtin types! - if t, ok := builtins.Types[typeName]; ok { - p.Types[typeName] = t - return t - } - } - t := &Type{Name: Name{Package: p.Path, Name: typeName}} - p.Types[typeName] = t - return t -} - -// Function gets the given function Type in this Package. If the function is -// not already defined, this will add it. If a function is added, it's the -// caller's responsibility to finish construction of the function by setting -// Underlying to the correct type. -func (p *Package) Function(funcName string) *Type { - if t, ok := p.Functions[funcName]; ok { - return t - } - t := &Type{Name: Name{Package: p.Path, Name: funcName}} - t.Kind = DeclarationOf - p.Functions[funcName] = t - return t -} - -// Variable gets the given variable Type in this Package. If the variable is -// not already defined, this will add it. If a variable is added, it's the caller's -// responsibility to finish construction of the variable by setting Underlying -// to the correct type. -func (p *Package) Variable(varName string) *Type { - if t, ok := p.Variables[varName]; ok { - return t - } - t := &Type{Name: Name{Package: p.Path, Name: varName}} - t.Kind = DeclarationOf - p.Variables[varName] = t - return t -} - -// Constant gets the given constant Type in this Package. If the constant is -// not already defined, this will add it. If a constant is added, it's the caller's -// responsibility to finish construction of the constant by setting Underlying -// to the correct type. -func (p *Package) Constant(constName string) *Type { - if t, ok := p.Constants[constName]; ok { - return t - } - t := &Type{Name: Name{Package: p.Path, Name: constName}} - t.Kind = DeclarationOf - p.Constants[constName] = t - return t -} - -// HasImport returns true if p imports packageName. Package names include the -// package directory. -func (p *Package) HasImport(packageName string) bool { - _, has := p.Imports[packageName] - return has -} - -// Universe is a map of all packages. The key is the package name, but you -// should use Package(), Type(), Function(), or Variable() instead of direct -// access. -type Universe map[string]*Package - -// Type returns the canonical type for the given fully-qualified name. Builtin -// types will always be found, even if they haven't been explicitly added to -// the map. If a non-existing type is requested, this will create (a marker for) -// it. -func (u Universe) Type(n Name) *Type { - return u.Package(n.Package).Type(n.Name) -} - -// Function returns the canonical function for the given fully-qualified name. -// If a non-existing function is requested, this will create (a marker for) it. -// If a marker is created, it's the caller's responsibility to finish -// construction of the function by setting Underlying to the correct type. -func (u Universe) Function(n Name) *Type { - return u.Package(n.Package).Function(n.Name) -} - -// Variable returns the canonical variable for the given fully-qualified name. -// If a non-existing variable is requested, this will create (a marker for) it. -// If a marker is created, it's the caller's responsibility to finish -// construction of the variable by setting Underlying to the correct type. -func (u Universe) Variable(n Name) *Type { - return u.Package(n.Package).Variable(n.Name) -} - -// Constant returns the canonical constant for the given fully-qualified name. -// If a non-existing constant is requested, this will create (a marker for) it. -// If a marker is created, it's the caller's responsibility to finish -// construction of the constant by setting Underlying to the correct type. -func (u Universe) Constant(n Name) *Type { - return u.Package(n.Package).Constant(n.Name) -} - -// AddImports registers import lines for packageName. May be called multiple times. -// You are responsible for canonicalizing all package paths. -func (u Universe) AddImports(packagePath string, importPaths ...string) { - p := u.Package(packagePath) - for _, i := range importPaths { - p.Imports[i] = u.Package(i) - } -} - -// Package returns the Package for the given path. -// If a non-existing package is requested, this will create (a marker for) it. -// If a marker is created, it's the caller's responsibility to finish -// construction of the package. -func (u Universe) Package(packagePath string) *Package { - if p, ok := u[packagePath]; ok { - return p - } - p := &Package{ - Path: packagePath, - Types: map[string]*Type{}, - Functions: map[string]*Type{}, - Variables: map[string]*Type{}, - Constants: map[string]*Type{}, - Imports: map[string]*Package{}, - } - u[packagePath] = p - return p -} - -// Type represents a subset of possible go types. -type Type struct { - // There are two general categories of types, those explicitly named - // and those anonymous. Named ones will have a non-empty package in the - // name field. - // - // An exception: If Kind == DeclarationOf, then this name is the name of a - // top-level function, variable, or const, and the type can be found in Underlying. - // We do this to allow the naming system to work against these objects, even - // though they aren't strictly speaking types. - Name Name - - // The general kind of this type. - Kind Kind - - // If there are comment lines immediately before the type definition, - // they will be recorded here. - CommentLines []string - - // If there are comment lines preceding the `CommentLines`, they will be - // recorded here. There are two cases: - // --- - // SecondClosestCommentLines - // a blank line - // CommentLines - // type definition - // --- - // - // or - // --- - // SecondClosestCommentLines - // a blank line - // type definition - // --- - SecondClosestCommentLines []string - - // If Kind == Struct - Members []Member - - // If Kind == Map, Slice, Pointer, or Chan - Elem *Type - - // If Kind == Map, this is the map's key type. - Key *Type - - // If Kind == Alias, this is the underlying type. - // If Kind == DeclarationOf, this is the type of the declaration. - Underlying *Type - - // If Kind == Interface, this is the set of all required functions. - // Otherwise, if this is a named type, this is the list of methods that - // type has. (All elements will have Kind=="Func") - Methods map[string]*Type - - // If Kind == func, this is the signature of the function. - Signature *Signature - - // TODO: Add: - // * channel direction - // * array length -} - -// String returns the name of the type. -func (t *Type) String() string { - return t.Name.String() -} - -// IsPrimitive returns whether the type is a built-in type or is an alias to a -// built-in type. For example: strings and aliases of strings are primitives, -// structs are not. -func (t *Type) IsPrimitive() bool { - if t.Kind == Builtin || (t.Kind == Alias && t.Underlying.Kind == Builtin) { - return true - } - return false -} - -// IsAssignable returns whether the type is deep-assignable. For example, -// slices and maps and pointers are shallow copies, but ints and strings are -// complete. -func (t *Type) IsAssignable() bool { - if t.IsPrimitive() { - return true - } - if t.Kind == Struct { - for _, m := range t.Members { - if !m.Type.IsAssignable() { - return false - } - } - return true - } - return false -} - -// IsAnonymousStruct returns true if the type is an anonymous struct or an alias -// to an anonymous struct. -func (t *Type) IsAnonymousStruct() bool { - return (t.Kind == Struct && t.Name.Name == "struct{}") || (t.Kind == Alias && t.Underlying.IsAnonymousStruct()) -} - -// A single struct member -type Member struct { - // The name of the member. - Name string - - // If the member is embedded (anonymous) this will be true, and the - // Name will be the type name. - Embedded bool - - // If there are comment lines immediately before the member in the type - // definition, they will be recorded here. - CommentLines []string - - // If there are tags along with this member, they will be saved here. - Tags string - - // The type of this member. - Type *Type -} - -// String returns the name and type of the member. -func (m Member) String() string { - return m.Name + " " + m.Type.String() -} - -// Signature is a function's signature. -type Signature struct { - // TODO: store the parameter names, not just types. - - // If a method of some type, this is the type it's a member of. - Receiver *Type - Parameters []*Type - Results []*Type - - // True if the last in parameter is of the form ...T. - Variadic bool - - // If there are comment lines immediately before this - // signature/method/function declaration, they will be recorded here. - CommentLines []string -} - -// Built in types. -var ( - String = &Type{ - Name: Name{Name: "string"}, - Kind: Builtin, - } - Int64 = &Type{ - Name: Name{Name: "int64"}, - Kind: Builtin, - } - Int32 = &Type{ - Name: Name{Name: "int32"}, - Kind: Builtin, - } - Int16 = &Type{ - Name: Name{Name: "int16"}, - Kind: Builtin, - } - Int = &Type{ - Name: Name{Name: "int"}, - Kind: Builtin, - } - Uint64 = &Type{ - Name: Name{Name: "uint64"}, - Kind: Builtin, - } - Uint32 = &Type{ - Name: Name{Name: "uint32"}, - Kind: Builtin, - } - Uint16 = &Type{ - Name: Name{Name: "uint16"}, - Kind: Builtin, - } - Uint = &Type{ - Name: Name{Name: "uint"}, - Kind: Builtin, - } - Uintptr = &Type{ - Name: Name{Name: "uintptr"}, - Kind: Builtin, - } - Float64 = &Type{ - Name: Name{Name: "float64"}, - Kind: Builtin, - } - Float32 = &Type{ - Name: Name{Name: "float32"}, - Kind: Builtin, - } - Float = &Type{ - Name: Name{Name: "float"}, - Kind: Builtin, - } - Bool = &Type{ - Name: Name{Name: "bool"}, - Kind: Builtin, - } - Byte = &Type{ - Name: Name{Name: "byte"}, - Kind: Builtin, - } - - builtins = &Package{ - Types: map[string]*Type{ - "bool": Bool, - "string": String, - "int": Int, - "int64": Int64, - "int32": Int32, - "int16": Int16, - "int8": Byte, - "uint": Uint, - "uint64": Uint64, - "uint32": Uint32, - "uint16": Uint16, - "uint8": Byte, - "uintptr": Uintptr, - "byte": Byte, - "float": Float, - "float64": Float64, - "float32": Float32, - }, - Imports: map[string]*Package{}, - Path: "", - Name: "", - } -) - -func IsInteger(t *Type) bool { - switch t { - case Int, Int64, Int32, Int16, Uint, Uint64, Uint32, Uint16, Byte: - return true - default: - return false - } -} diff --git a/vendor/k8s.io/klog/.travis.yml b/vendor/k8s.io/klog/.travis.yml deleted file mode 100644 index 5677664..0000000 --- a/vendor/k8s.io/klog/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: go -go_import_path: k8s.io/klog -dist: xenial -go: - - 1.9.x - - 1.10.x - - 1.11.x - - 1.12.x -script: - - go get -t -v ./... - - diff -u <(echo -n) <(gofmt -d .) - - diff -u <(echo -n) <(golint $(go list -e ./...)) - - go tool vet . || go vet . - - go test -v -race ./... -install: - - go get golang.org/x/lint/golint diff --git a/vendor/k8s.io/klog/CONTRIBUTING.md b/vendor/k8s.io/klog/CONTRIBUTING.md deleted file mode 100644 index 574a56a..0000000 --- a/vendor/k8s.io/klog/CONTRIBUTING.md +++ /dev/null @@ -1,22 +0,0 @@ -# Contributing Guidelines - -Welcome to Kubernetes. We are excited about the prospect of you joining our [community](https://github.com/kubernetes/community)! The Kubernetes community abides by the CNCF [code of conduct](code-of-conduct.md). Here is an excerpt: - -_As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities._ - -## Getting Started - -We have full documentation on how to get started contributing here: - -- [Contributor License Agreement](https://git.k8s.io/community/CLA.md) Kubernetes projects require that you sign a Contributor License Agreement (CLA) before we can accept your pull requests -- [Kubernetes Contributor Guide](http://git.k8s.io/community/contributors/guide) - Main contributor documentation, or you can just jump directly to the [contributing section](http://git.k8s.io/community/contributors/guide#contributing) -- [Contributor Cheat Sheet](https://git.k8s.io/community/contributors/guide/contributor-cheatsheet.md) - Common resources for existing developers - -## Mentorship - -- [Mentoring Initiatives](https://git.k8s.io/community/mentoring) - We have a diverse set of mentorship programs available that are always looking for volunteers! - -## Contact Information - -- [Slack](https://kubernetes.slack.com/messages/sig-architecture) -- [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-architecture) diff --git a/vendor/k8s.io/klog/OWNERS b/vendor/k8s.io/klog/OWNERS deleted file mode 100644 index 380e514..0000000 --- a/vendor/k8s.io/klog/OWNERS +++ /dev/null @@ -1,19 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners -reviewers: - - jayunit100 - - hoegaarden - - andyxning - - neolit123 - - pohly - - yagonobre - - vincepri - - detiber -approvers: - - dims - - thockin - - justinsb - - tallclair - - piosz - - brancz - - DirectXMan12 - - lavalamp diff --git a/vendor/k8s.io/klog/README.md b/vendor/k8s.io/klog/README.md deleted file mode 100644 index 841468b..0000000 --- a/vendor/k8s.io/klog/README.md +++ /dev/null @@ -1,97 +0,0 @@ -klog -==== - -klog is a permanent fork of https://github.com/golang/glog. - -## Why was klog created? - -The decision to create klog was one that wasn't made lightly, but it was necessary due to some -drawbacks that are present in [glog](https://github.com/golang/glog). Ultimately, the fork was created due to glog not being under active development; this can be seen in the glog README: - -> The code in this repo [...] is not itself under development - -This makes us unable to solve many use cases without a fork. The factors that contributed to needing feature development are listed below: - - * `glog` [presents a lot "gotchas"](https://github.com/kubernetes/kubernetes/issues/61006) and introduces challenges in containerized environments, all of which aren't well documented. - * `glog` doesn't provide an easy way to test logs, which detracts from the stability of software using it - * A long term goal is to implement a logging interface that allows us to add context, change output format, etc. - -Historical context is available here: - - * https://github.com/kubernetes/kubernetes/issues/61006 - * https://github.com/kubernetes/kubernetes/issues/70264 - * https://groups.google.com/forum/#!msg/kubernetes-sig-architecture/wCWiWf3Juzs/hXRVBH90CgAJ - * https://groups.google.com/forum/#!msg/kubernetes-dev/7vnijOMhLS0/1oRiNtigBgAJ - ----- - -How to use klog -=============== -- Replace imports for `github.com/golang/glog` with `k8s.io/klog` -- Use `klog.InitFlags(nil)` explicitly for initializing global flags as we no longer use `init()` method to register the flags -- You can now use `log-file` instead of `log-dir` for logging to a single file (See `examples/log_file/usage_log_file.go`) -- If you want to redirect everything logged using klog somewhere else (say syslog!), you can use `klog.SetOutput()` method and supply a `io.Writer`. (See `examples/set_output/usage_set_output.go`) -- For more logging conventions (See [Logging Conventions](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md)) - -### Coexisting with glog -This package can be used side by side with glog. [This example](examples/coexist_glog/coexist_glog.go) shows how to initialize and syncronize flags from the global `flag.CommandLine` FlagSet. In addition, the example makes use of stderr as combined output by setting `alsologtostderr` (or `logtostderr`) to `true`. - -## Community, discussion, contribution, and support - -Learn how to engage with the Kubernetes community on the [community page](http://kubernetes.io/community/). - -You can reach the maintainers of this project at: - -- [Slack](https://kubernetes.slack.com/messages/sig-architecture) -- [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-architecture) - -### Code of conduct - -Participation in the Kubernetes community is governed by the [Kubernetes Code of Conduct](code-of-conduct.md). - ----- - -glog -==== - -Leveled execution logs for Go. - -This is an efficient pure Go implementation of leveled logs in the -manner of the open source C++ package - https://github.com/google/glog - -By binding methods to booleans it is possible to use the log package -without paying the expense of evaluating the arguments to the log. -Through the -vmodule flag, the package also provides fine-grained -control over logging at the file level. - -The comment from glog.go introduces the ideas: - - Package glog implements logging analogous to the Google-internal - C++ INFO/ERROR/V setup. It provides functions Info, Warning, - Error, Fatal, plus formatting variants such as Infof. It - also provides V-style logging controlled by the -v and - -vmodule=file=2 flags. - - Basic examples: - - glog.Info("Prepare to repel boarders") - - glog.Fatalf("Initialization failed: %s", err) - - See the documentation for the V function for an explanation - of these examples: - - if glog.V(2) { - glog.Info("Starting transaction...") - } - - glog.V(2).Infoln("Processed", nItems, "elements") - - -The repository contains an open source version of the log package -used inside Google. The master copy of the source lives inside -Google, not here. The code in this repo is for export only and is not itself -under development. Feature requests will be ignored. - -Send bug reports to golang-nuts@googlegroups.com. diff --git a/vendor/k8s.io/klog/RELEASE.md b/vendor/k8s.io/klog/RELEASE.md deleted file mode 100644 index b53eb96..0000000 --- a/vendor/k8s.io/klog/RELEASE.md +++ /dev/null @@ -1,9 +0,0 @@ -# Release Process - -The `klog` is released on an as-needed basis. The process is as follows: - -1. An issue is proposing a new release with a changelog since the last release -1. All [OWNERS](OWNERS) must LGTM this release -1. An OWNER runs `git tag -s $VERSION` and inserts the changelog and pushes the tag with `git push $VERSION` -1. The release issue is closed -1. An announcement email is sent to `kubernetes-dev@googlegroups.com` with the subject `[ANNOUNCE] kubernetes-template-project $VERSION is released` diff --git a/vendor/k8s.io/klog/SECURITY_CONTACTS b/vendor/k8s.io/klog/SECURITY_CONTACTS deleted file mode 100644 index 6128a58..0000000 --- a/vendor/k8s.io/klog/SECURITY_CONTACTS +++ /dev/null @@ -1,20 +0,0 @@ -# Defined below are the security contacts for this repo. -# -# They are the contact point for the Product Security Committee to reach out -# to for triaging and handling of incoming issues. -# -# The below names agree to abide by the -# [Embargo Policy](https://git.k8s.io/security/private-distributors-list.md#embargo-policy) -# and will be removed and replaced if they violate that agreement. -# -# DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE -# INSTRUCTIONS AT https://kubernetes.io/security/ - -dims -thockin -justinsb -tallclair -piosz -brancz -DirectXMan12 -lavalamp diff --git a/vendor/k8s.io/klog/code-of-conduct.md b/vendor/k8s.io/klog/code-of-conduct.md deleted file mode 100644 index 0d15c00..0000000 --- a/vendor/k8s.io/klog/code-of-conduct.md +++ /dev/null @@ -1,3 +0,0 @@ -# Kubernetes Community Code of Conduct - -Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md) diff --git a/vendor/k8s.io/klog/go.mod b/vendor/k8s.io/klog/go.mod deleted file mode 100644 index 3877d85..0000000 --- a/vendor/k8s.io/klog/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module k8s.io/klog - -go 1.12 - -require github.com/go-logr/logr v0.1.0 diff --git a/vendor/k8s.io/klog/go.sum b/vendor/k8s.io/klog/go.sum deleted file mode 100644 index fb64d27..0000000 --- a/vendor/k8s.io/klog/go.sum +++ /dev/null @@ -1,2 +0,0 @@ -github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= diff --git a/vendor/k8s.io/kube-openapi/cmd/openapi-gen/args/args.go b/vendor/k8s.io/kube-openapi/cmd/openapi-gen/args/args.go deleted file mode 100644 index 1978337..0000000 --- a/vendor/k8s.io/kube-openapi/cmd/openapi-gen/args/args.go +++ /dev/null @@ -1,76 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package args - -import ( - "fmt" - "path/filepath" - - "github.com/spf13/pflag" - "k8s.io/gengo/args" -) - -// CustomArgs is used by the gengo framework to pass args specific to this generator. -type CustomArgs struct { - // ReportFilename is added to CustomArgs for specifying name of report file used - // by API linter. If specified, API rule violations will be printed to report file. - // Otherwise default value "-" will be used which indicates stdout. - ReportFilename string -} - -// NewDefaults returns default arguments for the generator. Returning the arguments instead -// of using default flag parsing allows registering custom arguments afterwards -func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { - // Default() sets a couple of flag default values for example the boilerplate. - // WithoutDefaultFlagParsing() disables implicit addition of command line flags and parsing, - // which allows registering custom arguments afterwards - genericArgs := args.Default().WithoutDefaultFlagParsing() - genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), "k8s.io/kube-openapi/boilerplate/boilerplate.go.txt") - - customArgs := &CustomArgs{} - genericArgs.CustomArgs = customArgs - - // Default value for report filename is "-", which stands for stdout - customArgs.ReportFilename = "-" - // Default value for output file base name - genericArgs.OutputFileBaseName = "openapi_generated" - - return genericArgs, customArgs -} - -// AddFlags add the generator flags to the flag set. -func (c *CustomArgs) AddFlags(fs *pflag.FlagSet) { - fs.StringVarP(&c.ReportFilename, "report-filename", "r", c.ReportFilename, "Name of report file used by API linter to print API violations. Default \"-\" stands for standard output. NOTE that if valid filename other than \"-\" is specified, API linter won't return error on detected API violations. This allows further check of existing API violations without stopping the OpenAPI generation toolchain.") -} - -// Validate checks the given arguments. -func Validate(genericArgs *args.GeneratorArgs) error { - c, ok := genericArgs.CustomArgs.(*CustomArgs) - if !ok { - return fmt.Errorf("input arguments don't contain valid custom arguments") - } - if len(c.ReportFilename) == 0 { - return fmt.Errorf("report filename cannot be empty. specify a valid filename or use \"-\" for stdout") - } - if len(genericArgs.OutputFileBaseName) == 0 { - return fmt.Errorf("output file base name cannot be empty") - } - if len(genericArgs.OutputPackagePath) == 0 { - return fmt.Errorf("output package cannot be empty") - } - return nil -} diff --git a/vendor/k8s.io/kube-openapi/pkg/common/common.go b/vendor/k8s.io/kube-openapi/pkg/common/common.go deleted file mode 100644 index f1c87c3..0000000 --- a/vendor/k8s.io/kube-openapi/pkg/common/common.go +++ /dev/null @@ -1,192 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package common - -import ( - "net/http" - "strings" - - "github.com/emicklei/go-restful" - "github.com/go-openapi/spec" -) - -const ( - // TODO: Make this configurable. - ExtensionPrefix = "x-kubernetes-" - ExtensionV2Schema = ExtensionPrefix + "v2-schema" -) - -// OpenAPIDefinition describes single type. Normally these definitions are auto-generated using gen-openapi. -type OpenAPIDefinition struct { - Schema spec.Schema - Dependencies []string -} - -type ReferenceCallback func(path string) spec.Ref - -// GetOpenAPIDefinitions is collection of all definitions. -type GetOpenAPIDefinitions func(ReferenceCallback) map[string]OpenAPIDefinition - -// OpenAPIDefinitionGetter gets openAPI definitions for a given type. If a type implements this interface, -// the definition returned by it will be used, otherwise the auto-generated definitions will be used. See -// GetOpenAPITypeFormat for more information about trade-offs of using this interface or GetOpenAPITypeFormat method when -// possible. -type OpenAPIDefinitionGetter interface { - OpenAPIDefinition() *OpenAPIDefinition -} - -type OpenAPIV3DefinitionGetter interface { - OpenAPIV3Definition() *OpenAPIDefinition -} - -type PathHandler interface { - Handle(path string, handler http.Handler) -} - -// Config is set of configuration for openAPI spec generation. -type Config struct { - // List of supported protocols such as https, http, etc. - ProtocolList []string - - // Info is general information about the API. - Info *spec.Info - - // DefaultResponse will be used if an operation does not have any responses listed. It - // will show up as ... "responses" : {"default" : $DefaultResponse} in the spec. - DefaultResponse *spec.Response - - // ResponseDefinitions will be added to "responses" under the top-level swagger object. This is an object - // that holds responses definitions that can be used across operations. This property does not define - // global responses for all operations. For more info please refer: - // https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#fixed-fields - ResponseDefinitions map[string]spec.Response - - // CommonResponses will be added as a response to all operation specs. This is a good place to add common - // responses such as authorization failed. - CommonResponses map[int]spec.Response - - // List of webservice's path prefixes to ignore - IgnorePrefixes []string - - // OpenAPIDefinitions should provide definition for all models used by routes. Failure to provide this map - // or any of the models will result in spec generation failure. - GetDefinitions GetOpenAPIDefinitions - - // GetOperationIDAndTags returns operation id and tags for a restful route. It is an optional function to customize operation IDs. - GetOperationIDAndTags func(r *restful.Route) (string, []string, error) - - // GetDefinitionName returns a friendly name for a definition base on the serving path. parameter `name` is the full name of the definition. - // It is an optional function to customize model names. - GetDefinitionName func(name string) (string, spec.Extensions) - - // PostProcessSpec runs after the spec is ready to serve. It allows a final modification to the spec before serving. - PostProcessSpec func(*spec.Swagger) (*spec.Swagger, error) - - // SecurityDefinitions is list of all security definitions for OpenAPI service. If this is not nil, the user of config - // is responsible to provide DefaultSecurity and (maybe) add unauthorized response to CommonResponses. - SecurityDefinitions *spec.SecurityDefinitions - - // DefaultSecurity for all operations. This will pass as spec.SwaggerProps.Security to OpenAPI. - // For most cases, this will be list of acceptable definitions in SecurityDefinitions. - DefaultSecurity []map[string][]string -} - -var schemaTypeFormatMap = map[string][]string{ - "uint": {"integer", "int32"}, - "uint8": {"integer", "byte"}, - "uint16": {"integer", "int32"}, - "uint32": {"integer", "int64"}, - "uint64": {"integer", "int64"}, - "int": {"integer", "int32"}, - "int8": {"integer", "byte"}, - "int16": {"integer", "int32"}, - "int32": {"integer", "int32"}, - "int64": {"integer", "int64"}, - "byte": {"integer", "byte"}, - "float64": {"number", "double"}, - "float32": {"number", "float"}, - "bool": {"boolean", ""}, - "time.Time": {"string", "date-time"}, - "string": {"string", ""}, - "integer": {"integer", ""}, - "number": {"number", ""}, - "boolean": {"boolean", ""}, - "[]byte": {"string", "byte"}, // base64 encoded characters - "interface{}": {"object", ""}, -} - -// This function is a reference for converting go (or any custom type) to a simple open API type,format pair. There are -// two ways to customize spec for a type. If you add it here, a type will be converted to a simple type and the type -// comment (the comment that is added before type definition) will be lost. The spec will still have the property -// comment. The second way is to implement OpenAPIDefinitionGetter interface. That function can customize the spec (so -// the spec does not need to be simple type,format) or can even return a simple type,format (e.g. IntOrString). For simple -// type formats, the benefit of adding OpenAPIDefinitionGetter interface is to keep both type and property documentation. -// Example: -// type Sample struct { -// ... -// // port of the server -// port IntOrString -// ... -// } -// // IntOrString documentation... -// type IntOrString { ... } -// -// Adding IntOrString to this function: -// "port" : { -// format: "string", -// type: "int-or-string", -// Description: "port of the server" -// } -// -// Implement OpenAPIDefinitionGetter for IntOrString: -// -// "port" : { -// $Ref: "#/definitions/IntOrString" -// Description: "port of the server" -// } -// ... -// definitions: -// { -// "IntOrString": { -// format: "string", -// type: "int-or-string", -// Description: "IntOrString documentation..." // new -// } -// } -// -func GetOpenAPITypeFormat(typeName string) (string, string) { - mapped, ok := schemaTypeFormatMap[typeName] - if !ok { - return "", "" - } - return mapped[0], mapped[1] -} - -func EscapeJsonPointer(p string) string { - // Escaping reference name using rfc6901 - p = strings.Replace(p, "~", "~0", -1) - p = strings.Replace(p, "/", "~1", -1) - return p -} - -func EmbedOpenAPIDefinitionIntoV2Extension(main OpenAPIDefinition, embedded OpenAPIDefinition) OpenAPIDefinition { - if main.Schema.Extensions == nil { - main.Schema.Extensions = make(map[string]interface{}) - } - main.Schema.Extensions[ExtensionV2Schema] = embedded.Schema - return main -} diff --git a/vendor/k8s.io/kube-openapi/pkg/generators/README.md b/vendor/k8s.io/kube-openapi/pkg/generators/README.md deleted file mode 100644 index 72b4e5f..0000000 --- a/vendor/k8s.io/kube-openapi/pkg/generators/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# Generate OpenAPI definitions - -- To generate definition for a specific type or package add "+k8s:openapi-gen=true" tag to the type/package comment lines. -- To exclude a type or a member from a tagged package/type, add "+k8s:openapi-gen=false" tag to the comment lines. - -# OpenAPI Extensions - -OpenAPI spec can have extensions on types. To define one or more extensions on a type or its member -add `+k8s:openapi-gen=x-kubernetes-$NAME:$VALUE` to the comment lines before type/member. A type/member can -have multiple extensions. The rest of the line in the comment will be used as $VALUE so there is no need to -escape or quote the value string. Extensions can be used to pass more information to client generators or -documentation generators. For example a type might have a friendly name to be displayed in documentation or -being used in a client's fluent interface. - -# Custom OpenAPI type definitions - -Custom types which otherwise don't map directly to OpenAPI can override their -OpenAPI definition by implementing a function named "OpenAPIDefinition" with -the following signature: - -```go - import openapi "k8s.io/kube-openapi/pkg/common" - - // ... - - type Time struct { - time.Time - } - - func (_ Time) OpenAPIDefinition() openapi.OpenAPIDefinition { - return openapi.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "date-time", - }, - }, - } - } -``` - -Alternatively, the type can avoid the "openapi" import by defining the following -methods. The following example produces the same OpenAPI definition as the -example above: - -```go - func (_ Time) OpenAPISchemaType() []string { return []string{"string"} } - func (_ Time) OpenAPISchemaFormat() string { return "date-time" } -``` diff --git a/vendor/k8s.io/kube-openapi/pkg/generators/api_linter.go b/vendor/k8s.io/kube-openapi/pkg/generators/api_linter.go deleted file mode 100644 index 26b951b..0000000 --- a/vendor/k8s.io/kube-openapi/pkg/generators/api_linter.go +++ /dev/null @@ -1,220 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generators - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "os" - "sort" - - "k8s.io/kube-openapi/pkg/generators/rules" - - "k8s.io/gengo/generator" - "k8s.io/gengo/types" - "k8s.io/klog" -) - -const apiViolationFileType = "api-violation" - -type apiViolationFile struct { - // Since our file actually is unrelated to the package structure, use a - // path that hasn't been mangled by the framework. - unmangledPath string -} - -func (a apiViolationFile) AssembleFile(f *generator.File, path string) error { - path = a.unmangledPath - klog.V(2).Infof("Assembling file %q", path) - if path == "-" { - _, err := io.Copy(os.Stdout, &f.Body) - return err - } - - output, err := os.Create(path) - if err != nil { - return err - } - defer output.Close() - _, err = io.Copy(output, &f.Body) - return err -} - -func (a apiViolationFile) VerifyFile(f *generator.File, path string) error { - if path == "-" { - // Nothing to verify against. - return nil - } - path = a.unmangledPath - - formatted := f.Body.Bytes() - existing, err := ioutil.ReadFile(path) - if err != nil { - return fmt.Errorf("unable to read file %q for comparison: %v", path, err) - } - if bytes.Compare(formatted, existing) == 0 { - return nil - } - - // Be nice and find the first place where they differ - // (Copied from gengo's default file type) - i := 0 - for i < len(formatted) && i < len(existing) && formatted[i] == existing[i] { - i++ - } - eDiff, fDiff := existing[i:], formatted[i:] - if len(eDiff) > 100 { - eDiff = eDiff[:100] - } - if len(fDiff) > 100 { - fDiff = fDiff[:100] - } - return fmt.Errorf("output for %q differs; first existing/expected diff: \n %q\n %q", path, string(eDiff), string(fDiff)) -} - -func newAPIViolationGen() *apiViolationGen { - return &apiViolationGen{ - linter: newAPILinter(), - } -} - -type apiViolationGen struct { - generator.DefaultGen - - linter *apiLinter -} - -func (v *apiViolationGen) FileType() string { return apiViolationFileType } -func (v *apiViolationGen) Filename() string { - return "this file is ignored by the file assembler" -} - -func (v *apiViolationGen) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - klog.V(5).Infof("validating API rules for type %v", t) - if err := v.linter.validate(t); err != nil { - return err - } - return nil -} - -// Finalize prints the API rule violations to report file (if specified from -// arguments) or stdout (default) -func (v *apiViolationGen) Finalize(c *generator.Context, w io.Writer) error { - // NOTE: we don't return error here because we assume that the report file will - // get evaluated afterwards to determine if error should be raised. For example, - // you can have make rules that compare the report file with existing known - // violations (whitelist) and determine no error if no change is detected. - v.linter.report(w) - return nil -} - -// apiLinter is the framework hosting multiple API rules and recording API rule -// violations -type apiLinter struct { - // API rules that implement APIRule interface and output API rule violations - rules []APIRule - violations []apiViolation -} - -// newAPILinter creates an apiLinter object with API rules in package rules. Please -// add APIRule here when new API rule is implemented. -func newAPILinter() *apiLinter { - return &apiLinter{ - rules: []APIRule{ - &rules.NamesMatch{}, - &rules.OmitEmptyMatchCase{}, - &rules.ListTypeMissing{}, - }, - } -} - -// apiViolation uniquely identifies single API rule violation -type apiViolation struct { - // Name of rule from APIRule.Name() - rule string - - packageName string - typeName string - - // Optional: name of field that violates API rule. Empty fieldName implies that - // the entire type violates the rule. - field string -} - -// apiViolations implements sort.Interface for []apiViolation based on the fields: rule, -// packageName, typeName and field. -type apiViolations []apiViolation - -func (a apiViolations) Len() int { return len(a) } -func (a apiViolations) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a apiViolations) Less(i, j int) bool { - if a[i].rule != a[j].rule { - return a[i].rule < a[j].rule - } - if a[i].packageName != a[j].packageName { - return a[i].packageName < a[j].packageName - } - if a[i].typeName != a[j].typeName { - return a[i].typeName < a[j].typeName - } - return a[i].field < a[j].field -} - -// APIRule is the interface for validating API rule on Go types -type APIRule interface { - // Validate evaluates API rule on type t and returns a list of field names in - // the type that violate the rule. Empty field name [""] implies the entire - // type violates the rule. - Validate(t *types.Type) ([]string, error) - - // Name returns the name of APIRule - Name() string -} - -// validate runs all API rules on type t and records any API rule violation -func (l *apiLinter) validate(t *types.Type) error { - for _, r := range l.rules { - klog.V(5).Infof("validating API rule %v for type %v", r.Name(), t) - fields, err := r.Validate(t) - if err != nil { - return err - } - for _, field := range fields { - l.violations = append(l.violations, apiViolation{ - rule: r.Name(), - packageName: t.Name.Package, - typeName: t.Name.Name, - field: field, - }) - } - } - return nil -} - -// report prints any API rule violation to writer w and returns error if violation exists -func (l *apiLinter) report(w io.Writer) error { - sort.Sort(apiViolations(l.violations)) - for _, v := range l.violations { - fmt.Fprintf(w, "API rule violation: %s,%s,%s,%s\n", v.rule, v.packageName, v.typeName, v.field) - } - if len(l.violations) > 0 { - return fmt.Errorf("API rule violations exist") - } - return nil -} diff --git a/vendor/k8s.io/kube-openapi/pkg/generators/config.go b/vendor/k8s.io/kube-openapi/pkg/generators/config.go deleted file mode 100644 index 33cd9eb..0000000 --- a/vendor/k8s.io/kube-openapi/pkg/generators/config.go +++ /dev/null @@ -1,91 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generators - -import ( - "fmt" - "path/filepath" - - "k8s.io/gengo/args" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - "k8s.io/klog" - - generatorargs "k8s.io/kube-openapi/cmd/openapi-gen/args" -) - -type identityNamer struct{} - -func (_ identityNamer) Name(t *types.Type) string { - return t.Name.String() -} - -var _ namer.Namer = identityNamer{} - -// NameSystems returns the name system used by the generators in this package. -func NameSystems() namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer("", nil), - "sorting_namer": identityNamer{}, - } -} - -// DefaultNameSystem returns the default name system for ordering the types to be -// processed by the generators in this package. -func DefaultNameSystem() string { - return "sorting_namer" -} - -func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { - boilerplate, err := arguments.LoadGoBoilerplate() - if err != nil { - klog.Fatalf("Failed loading boilerplate: %v", err) - } - header := append([]byte(fmt.Sprintf("// +build !%s\n\n", arguments.GeneratedBuildTag)), boilerplate...) - header = append(header, []byte( - ` -// This file was autogenerated by openapi-gen. Do not edit it manually! - -`)...) - - reportPath := "-" - if customArgs, ok := arguments.CustomArgs.(*generatorargs.CustomArgs); ok { - reportPath = customArgs.ReportFilename - } - context.FileTypes[apiViolationFileType] = apiViolationFile{ - unmangledPath: reportPath, - } - - return generator.Packages{ - &generator.DefaultPackage{ - PackageName: filepath.Base(arguments.OutputPackagePath), - PackagePath: arguments.OutputPackagePath, - HeaderText: header, - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - return []generator.Generator{ - newOpenAPIGen( - arguments.OutputFileBaseName, - arguments.OutputPackagePath, - ), - newAPIViolationGen(), - } - }, - FilterFunc: apiTypeFilterFunc, - }, - } -} diff --git a/vendor/k8s.io/kube-openapi/pkg/generators/extension.go b/vendor/k8s.io/kube-openapi/pkg/generators/extension.go deleted file mode 100644 index 15a9112..0000000 --- a/vendor/k8s.io/kube-openapi/pkg/generators/extension.go +++ /dev/null @@ -1,198 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generators - -import ( - "fmt" - "sort" - "strings" - - "k8s.io/gengo/examples/set-gen/sets" - "k8s.io/gengo/types" -) - -const extensionPrefix = "x-kubernetes-" - -// extensionAttributes encapsulates common traits for particular extensions. -type extensionAttributes struct { - xName string - kind types.Kind - allowedValues sets.String - enforceArray bool -} - -// Extension tag to openapi extension attributes -var tagToExtension = map[string]extensionAttributes{ - "patchMergeKey": { - xName: "x-kubernetes-patch-merge-key", - kind: types.Slice, - }, - "patchStrategy": { - xName: "x-kubernetes-patch-strategy", - kind: types.Slice, - allowedValues: sets.NewString("merge", "retainKeys"), - }, - "listMapKey": { - xName: "x-kubernetes-list-map-keys", - kind: types.Slice, - enforceArray: true, - }, - "listType": { - xName: "x-kubernetes-list-type", - kind: types.Slice, - allowedValues: sets.NewString("atomic", "set", "map"), - }, - "mapType": { - xName: "x-kubernetes-map-type", - kind: types.Map, - allowedValues: sets.NewString("atomic", "granular"), - }, - "structType": { - xName: "x-kubernetes-map-type", - kind: types.Struct, - allowedValues: sets.NewString("atomic", "granular"), - }, -} - -// Extension encapsulates information necessary to generate an OpenAPI extension. -type extension struct { - idlTag string // Example: listType - xName string // Example: x-kubernetes-list-type - values []string // Example: [atomic] -} - -func (e extension) hasAllowedValues() bool { - return tagToExtension[e.idlTag].allowedValues.Len() > 0 -} - -func (e extension) allowedValues() sets.String { - return tagToExtension[e.idlTag].allowedValues -} - -func (e extension) hasKind() bool { - return len(tagToExtension[e.idlTag].kind) > 0 -} - -func (e extension) kind() types.Kind { - return tagToExtension[e.idlTag].kind -} - -func (e extension) validateAllowedValues() error { - // allowedValues not set means no restrictions on values. - if !e.hasAllowedValues() { - return nil - } - // Check for missing value. - if len(e.values) == 0 { - return fmt.Errorf("%s needs a value, none given.", e.idlTag) - } - // For each extension value, validate that it is allowed. - allowedValues := e.allowedValues() - if !allowedValues.HasAll(e.values...) { - return fmt.Errorf("%v not allowed for %s. Allowed values: %v", - e.values, e.idlTag, allowedValues.List()) - } - return nil -} - -func (e extension) validateType(kind types.Kind) error { - // If this extension class has no kind, then don't validate the type. - if !e.hasKind() { - return nil - } - if kind != e.kind() { - return fmt.Errorf("tag %s on type %v; only allowed on type %v", - e.idlTag, kind, e.kind()) - } - return nil -} - -func (e extension) hasMultipleValues() bool { - return len(e.values) > 1 -} - -func (e extension) isAlwaysArrayFormat() bool { - return tagToExtension[e.idlTag].enforceArray -} - -// Returns sorted list of map keys. Needed for deterministic testing. -func sortedMapKeys(m map[string][]string) []string { - keys := make([]string, len(m)) - i := 0 - for k := range m { - keys[i] = k - i++ - } - sort.Strings(keys) - return keys -} - -// Parses comments to return openapi extensions. Returns a list of -// extensions which parsed correctly, as well as a list of the -// parse errors. Validating extensions is performed separately. -// NOTE: Non-empty errors does not mean extensions is empty. -func parseExtensions(comments []string) ([]extension, []error) { - extensions := []extension{} - errors := []error{} - // First, generate extensions from "+k8s:openapi-gen=x-kubernetes-*" annotations. - values := getOpenAPITagValue(comments) - for _, val := range values { - // Example: x-kubernetes-member-tag:member_test - if strings.HasPrefix(val, extensionPrefix) { - parts := strings.SplitN(val, ":", 2) - if len(parts) != 2 { - errors = append(errors, fmt.Errorf("invalid extension value: %v", val)) - continue - } - e := extension{ - idlTag: tagName, // Example: k8s:openapi-gen - xName: parts[0], // Example: x-kubernetes-member-tag - values: []string{parts[1]}, // Example: member_test - } - extensions = append(extensions, e) - } - } - // Next, generate extensions from "idlTags" (e.g. +listType) - tagValues := types.ExtractCommentTags("+", comments) - for _, idlTag := range sortedMapKeys(tagValues) { - xAttrs, exists := tagToExtension[idlTag] - if !exists { - continue - } - values := tagValues[idlTag] - e := extension{ - idlTag: idlTag, // listType - xName: xAttrs.xName, // x-kubernetes-list-type - values: values, // [atomic] - } - extensions = append(extensions, e) - } - return extensions, errors -} - -func validateMemberExtensions(extensions []extension, m *types.Member) []error { - errors := []error{} - for _, e := range extensions { - if err := e.validateAllowedValues(); err != nil { - errors = append(errors, err) - } - if err := e.validateType(m.Type.Kind); err != nil { - errors = append(errors, err) - } - } - return errors -} diff --git a/vendor/k8s.io/kube-openapi/pkg/generators/openapi.go b/vendor/k8s.io/kube-openapi/pkg/generators/openapi.go deleted file mode 100644 index b8ec898..0000000 --- a/vendor/k8s.io/kube-openapi/pkg/generators/openapi.go +++ /dev/null @@ -1,692 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generators - -import ( - "bytes" - "fmt" - "io" - "path/filepath" - "reflect" - "sort" - "strings" - - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - openapi "k8s.io/kube-openapi/pkg/common" - - "k8s.io/klog" -) - -// This is the comment tag that carries parameters for open API generation. -const tagName = "k8s:openapi-gen" -const tagOptional = "optional" - -// Known values for the tag. -const ( - tagValueTrue = "true" - tagValueFalse = "false" -) - -// Used for temporary validation of patch struct tags. -// TODO: Remove patch struct tag validation because they we are now consuming OpenAPI on server. -var tempPatchTags = [...]string{ - "patchMergeKey", - "patchStrategy", -} - -func getOpenAPITagValue(comments []string) []string { - return types.ExtractCommentTags("+", comments)[tagName] -} - -func getSingleTagsValue(comments []string, tag string) (string, error) { - tags, ok := types.ExtractCommentTags("+", comments)[tag] - if !ok || len(tags) == 0 { - return "", nil - } - if len(tags) > 1 { - return "", fmt.Errorf("multiple values are not allowed for tag %s", tag) - } - return tags[0], nil -} - -func hasOpenAPITagValue(comments []string, value string) bool { - tagValues := getOpenAPITagValue(comments) - for _, val := range tagValues { - if val == value { - return true - } - } - return false -} - -// hasOptionalTag returns true if the member has +optional in its comments or -// omitempty in its json tags. -func hasOptionalTag(m *types.Member) bool { - hasOptionalCommentTag := types.ExtractCommentTags( - "+", m.CommentLines)[tagOptional] != nil - hasOptionalJsonTag := strings.Contains( - reflect.StructTag(m.Tags).Get("json"), "omitempty") - return hasOptionalCommentTag || hasOptionalJsonTag -} - -func apiTypeFilterFunc(c *generator.Context, t *types.Type) bool { - // There is a conflict between this codegen and codecgen, we should avoid types generated for codecgen - if strings.HasPrefix(t.Name.Name, "codecSelfer") { - return false - } - pkg := c.Universe.Package(t.Name.Package) - if hasOpenAPITagValue(pkg.Comments, tagValueTrue) { - return !hasOpenAPITagValue(t.CommentLines, tagValueFalse) - } - if hasOpenAPITagValue(t.CommentLines, tagValueTrue) { - return true - } - return false -} - -const ( - specPackagePath = "github.com/go-openapi/spec" - openAPICommonPackagePath = "k8s.io/kube-openapi/pkg/common" -) - -// openApiGen produces a file with auto-generated OpenAPI functions. -type openAPIGen struct { - generator.DefaultGen - // TargetPackage is the package that will get GetOpenAPIDefinitions function returns all open API definitions. - targetPackage string - imports namer.ImportTracker -} - -func newOpenAPIGen(sanitizedName string, targetPackage string) generator.Generator { - return &openAPIGen{ - DefaultGen: generator.DefaultGen{ - OptionalName: sanitizedName, - }, - imports: generator.NewImportTracker(), - targetPackage: targetPackage, - } -} - -const nameTmpl = "schema_$.type|private$" - -func (g *openAPIGen) Namers(c *generator.Context) namer.NameSystems { - // Have the raw namer for this file track what it imports. - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.targetPackage, g.imports), - "private": &namer.NameStrategy{ - Join: func(pre string, in []string, post string) string { - return strings.Join(in, "_") - }, - PrependPackageNames: 4, // enough to fully qualify from k8s.io/api/... - }, - } -} - -func (g *openAPIGen) isOtherPackage(pkg string) bool { - if pkg == g.targetPackage { - return false - } - if strings.HasSuffix(pkg, "\""+g.targetPackage+"\"") { - return false - } - return true -} - -func (g *openAPIGen) Imports(c *generator.Context) []string { - importLines := []string{} - for _, singleImport := range g.imports.ImportLines() { - importLines = append(importLines, singleImport) - } - return importLines -} - -func argsFromType(t *types.Type) generator.Args { - return generator.Args{ - "type": t, - "ReferenceCallback": types.Ref(openAPICommonPackagePath, "ReferenceCallback"), - "OpenAPIDefinition": types.Ref(openAPICommonPackagePath, "OpenAPIDefinition"), - "SpecSchemaType": types.Ref(specPackagePath, "Schema"), - } -} - -func (g *openAPIGen) Init(c *generator.Context, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - sw.Do("func GetOpenAPIDefinitions(ref $.ReferenceCallback|raw$) map[string]$.OpenAPIDefinition|raw$ {\n", argsFromType(nil)) - sw.Do("return map[string]$.OpenAPIDefinition|raw${\n", argsFromType(nil)) - - for _, t := range c.Order { - err := newOpenAPITypeWriter(sw, c).generateCall(t) - if err != nil { - return err - } - } - - sw.Do("}\n", nil) - sw.Do("}\n\n", nil) - - return sw.Error() -} - -func (g *openAPIGen) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - klog.V(5).Infof("generating for type %v", t) - sw := generator.NewSnippetWriter(w, c, "$", "$") - err := newOpenAPITypeWriter(sw, c).generate(t) - if err != nil { - return err - } - return sw.Error() -} - -func getJsonTags(m *types.Member) []string { - jsonTag := reflect.StructTag(m.Tags).Get("json") - if jsonTag == "" { - return []string{} - } - return strings.Split(jsonTag, ",") -} - -func getReferableName(m *types.Member) string { - jsonTags := getJsonTags(m) - if len(jsonTags) > 0 { - if jsonTags[0] == "-" { - return "" - } else { - return jsonTags[0] - } - } else { - return m.Name - } -} - -func shouldInlineMembers(m *types.Member) bool { - jsonTags := getJsonTags(m) - return len(jsonTags) > 1 && jsonTags[1] == "inline" -} - -type openAPITypeWriter struct { - *generator.SnippetWriter - context *generator.Context - refTypes map[string]*types.Type - GetDefinitionInterface *types.Type -} - -func newOpenAPITypeWriter(sw *generator.SnippetWriter, c *generator.Context) openAPITypeWriter { - return openAPITypeWriter{ - SnippetWriter: sw, - context: c, - refTypes: map[string]*types.Type{}, - } -} - -func methodReturnsValue(mt *types.Type, pkg, name string) bool { - if len(mt.Signature.Parameters) != 0 || len(mt.Signature.Results) != 1 { - return false - } - r := mt.Signature.Results[0] - return r.Name.Name == name && r.Name.Package == pkg -} - -func hasOpenAPIV3DefinitionMethod(t *types.Type) bool { - for mn, mt := range t.Methods { - if mn != "OpenAPIV3Definition" { - continue - } - return methodReturnsValue(mt, openAPICommonPackagePath, "OpenAPIDefinition") - } - return false -} - -func hasOpenAPIDefinitionMethod(t *types.Type) bool { - for mn, mt := range t.Methods { - if mn != "OpenAPIDefinition" { - continue - } - return methodReturnsValue(mt, openAPICommonPackagePath, "OpenAPIDefinition") - } - return false -} - -func hasOpenAPIDefinitionMethods(t *types.Type) bool { - var hasSchemaTypeMethod, hasOpenAPISchemaFormat bool - for mn, mt := range t.Methods { - switch mn { - case "OpenAPISchemaType": - hasSchemaTypeMethod = methodReturnsValue(mt, "", "[]string") - case "OpenAPISchemaFormat": - hasOpenAPISchemaFormat = methodReturnsValue(mt, "", "string") - } - } - return hasSchemaTypeMethod && hasOpenAPISchemaFormat -} - -// typeShortName returns short package name (e.g. the name x appears in package x definition) dot type name. -func typeShortName(t *types.Type) string { - return filepath.Base(t.Name.Package) + "." + t.Name.Name -} - -func (g openAPITypeWriter) generateMembers(t *types.Type, required []string) ([]string, error) { - var err error - for _, m := range t.Members { - if hasOpenAPITagValue(m.CommentLines, tagValueFalse) { - continue - } - if shouldInlineMembers(&m) { - required, err = g.generateMembers(m.Type, required) - if err != nil { - return required, err - } - continue - } - name := getReferableName(&m) - if name == "" { - continue - } - if !hasOptionalTag(&m) { - required = append(required, name) - } - if err = g.generateProperty(&m, t); err != nil { - klog.Errorf("Error when generating: %v, %v\n", name, m) - return required, err - } - } - return required, nil -} - -func (g openAPITypeWriter) generateCall(t *types.Type) error { - // Only generate for struct type and ignore the rest - switch t.Kind { - case types.Struct: - args := argsFromType(t) - g.Do("\"$.$\": ", t.Name) - - hasV2Definition := hasOpenAPIDefinitionMethod(t) - hasV2DefinitionTypeAndFormat := hasOpenAPIDefinitionMethods(t) - hasV3Definition := hasOpenAPIV3DefinitionMethod(t) - - switch { - case hasV2DefinitionTypeAndFormat: - g.Do(nameTmpl+"(ref),\n", args) - case hasV2Definition && hasV3Definition: - g.Do("common.EmbedOpenAPIDefinitionIntoV2Extension($.type|raw${}.OpenAPIV3Definition(), $.type|raw${}.OpenAPIDefinition()),\n", args) - case hasV2Definition: - g.Do("$.type|raw${}.OpenAPIDefinition(),\n", args) - case hasV3Definition: - g.Do("$.type|raw${}.OpenAPIV3Definition(),\n", args) - default: - g.Do(nameTmpl+"(ref),\n", args) - } - } - return g.Error() -} - -func (g openAPITypeWriter) generate(t *types.Type) error { - // Only generate for struct type and ignore the rest - switch t.Kind { - case types.Struct: - hasV2Definition := hasOpenAPIDefinitionMethod(t) - hasV2DefinitionTypeAndFormat := hasOpenAPIDefinitionMethods(t) - hasV3Definition := hasOpenAPIV3DefinitionMethod(t) - - if hasV2Definition || (hasV3Definition && !hasV2DefinitionTypeAndFormat) { - // already invoked directly - return nil - } - - args := argsFromType(t) - g.Do("func "+nameTmpl+"(ref $.ReferenceCallback|raw$) $.OpenAPIDefinition|raw$ {\n", args) - switch { - case hasV2DefinitionTypeAndFormat && hasV3Definition: - g.Do("return common.EmbedOpenAPIDefinitionIntoV2Extension($.type|raw${}.OpenAPIV3Definition(), $.OpenAPIDefinition|raw${\n"+ - "Schema: spec.Schema{\n"+ - "SchemaProps: spec.SchemaProps{\n", args) - g.generateDescription(t.CommentLines) - g.Do("Type:$.type|raw${}.OpenAPISchemaType(),\n"+ - "Format:$.type|raw${}.OpenAPISchemaFormat(),\n"+ - "},\n"+ - "},\n"+ - "})\n}\n\n", args) - return nil - case hasV2DefinitionTypeAndFormat: - g.Do("return $.OpenAPIDefinition|raw${\n"+ - "Schema: spec.Schema{\n"+ - "SchemaProps: spec.SchemaProps{\n", args) - g.generateDescription(t.CommentLines) - g.Do("Type:$.type|raw${}.OpenAPISchemaType(),\n"+ - "Format:$.type|raw${}.OpenAPISchemaFormat(),\n"+ - "},\n"+ - "},\n"+ - "}\n}\n\n", args) - return nil - } - g.Do("return $.OpenAPIDefinition|raw${\nSchema: spec.Schema{\nSchemaProps: spec.SchemaProps{\n", args) - g.generateDescription(t.CommentLines) - g.Do("Type: []string{\"object\"},\n", nil) - - // write members into a temporary buffer, in order to postpone writing out the Properties field. We only do - // that if it is not empty. - propertiesBuf := bytes.Buffer{} - bsw := g - bsw.SnippetWriter = generator.NewSnippetWriter(&propertiesBuf, g.context, "$", "$") - required, err := bsw.generateMembers(t, []string{}) - if err != nil { - return err - } - if propertiesBuf.Len() > 0 { - g.Do("Properties: map[string]$.SpecSchemaType|raw${\n", args) - g.Do(strings.Replace(propertiesBuf.String(), "$", "$\"$\"$", -1), nil) // escape $ (used as delimiter of the templates) - g.Do("},\n", nil) - } - - if len(required) > 0 { - g.Do("Required: []string{\"$.$\"},\n", strings.Join(required, "\",\"")) - } - g.Do("},\n", nil) - if err := g.generateStructExtensions(t); err != nil { - return err - } - g.Do("},\n", nil) - - // Map order is undefined, sort them or we may get a different file generated each time. - keys := []string{} - for k := range g.refTypes { - keys = append(keys, k) - } - sort.Strings(keys) - deps := []string{} - for _, k := range keys { - v := g.refTypes[k] - if t, _ := openapi.GetOpenAPITypeFormat(v.String()); t != "" { - // This is a known type, we do not need a reference to it - // Will eliminate special case of time.Time - continue - } - deps = append(deps, k) - } - if len(deps) > 0 { - g.Do("Dependencies: []string{\n", args) - for _, k := range deps { - g.Do("\"$.$\",", k) - } - g.Do("},\n", nil) - } - g.Do("}\n}\n\n", nil) - } - return nil -} - -func (g openAPITypeWriter) generateStructExtensions(t *types.Type) error { - extensions, errors := parseExtensions(t.CommentLines) - // Initially, we will only log struct extension errors. - if len(errors) > 0 { - for _, e := range errors { - klog.Errorf("[%s]: %s\n", t.String(), e) - } - } - unions, errors := parseUnions(t) - if len(errors) > 0 { - for _, e := range errors { - klog.Errorf("[%s]: %s\n", t.String(), e) - } - } - - // TODO(seans3): Validate struct extensions here. - g.emitExtensions(extensions, unions) - return nil -} - -func (g openAPITypeWriter) generateMemberExtensions(m *types.Member, parent *types.Type) error { - extensions, parseErrors := parseExtensions(m.CommentLines) - validationErrors := validateMemberExtensions(extensions, m) - errors := append(parseErrors, validationErrors...) - // Initially, we will only log member extension errors. - if len(errors) > 0 { - errorPrefix := fmt.Sprintf("[%s] %s:", parent.String(), m.String()) - for _, e := range errors { - klog.V(2).Infof("%s %s\n", errorPrefix, e) - } - } - g.emitExtensions(extensions, nil) - return nil -} - -func (g openAPITypeWriter) emitExtensions(extensions []extension, unions []union) { - // If any extensions exist, then emit code to create them. - if len(extensions) == 0 && len(unions) == 0 { - return - } - g.Do("VendorExtensible: spec.VendorExtensible{\nExtensions: spec.Extensions{\n", nil) - for _, extension := range extensions { - g.Do("\"$.$\": ", extension.xName) - if extension.hasMultipleValues() || extension.isAlwaysArrayFormat() { - g.Do("[]interface{}{\n", nil) - } - for _, value := range extension.values { - g.Do("\"$.$\",\n", value) - } - if extension.hasMultipleValues() || extension.isAlwaysArrayFormat() { - g.Do("},\n", nil) - } - } - if len(unions) > 0 { - g.Do("\"x-kubernetes-unions\": []interface{}{\n", nil) - for _, u := range unions { - u.emit(g) - } - g.Do("},\n", nil) - } - g.Do("},\n},\n", nil) -} - -// TODO(#44005): Move this validation outside of this generator (probably to policy verifier) -func (g openAPITypeWriter) validatePatchTags(m *types.Member, parent *types.Type) error { - // TODO: Remove patch struct tag validation because they we are now consuming OpenAPI on server. - for _, tagKey := range tempPatchTags { - structTagValue := reflect.StructTag(m.Tags).Get(tagKey) - commentTagValue, err := getSingleTagsValue(m.CommentLines, tagKey) - if err != nil { - return err - } - if structTagValue != commentTagValue { - return fmt.Errorf("Tags in comment and struct should match for member (%s) of (%s)", - m.Name, parent.Name.String()) - } - } - return nil -} - -func (g openAPITypeWriter) generateDescription(CommentLines []string) { - var buffer bytes.Buffer - delPrevChar := func() { - if buffer.Len() > 0 { - buffer.Truncate(buffer.Len() - 1) // Delete the last " " or "\n" - } - } - - for _, line := range CommentLines { - // Ignore all lines after --- - if line == "---" { - break - } - line = strings.TrimRight(line, " ") - leading := strings.TrimLeft(line, " ") - switch { - case len(line) == 0: // Keep paragraphs - delPrevChar() - buffer.WriteString("\n\n") - case strings.HasPrefix(leading, "TODO"): // Ignore one line TODOs - case strings.HasPrefix(leading, "+"): // Ignore instructions to go2idl - default: - if strings.HasPrefix(line, " ") || strings.HasPrefix(line, "\t") { - delPrevChar() - line = "\n" + line + "\n" // Replace it with newline. This is useful when we have a line with: "Example:\n\tJSON-someting..." - } else { - line += " " - } - buffer.WriteString(line) - } - } - - postDoc := strings.TrimRight(buffer.String(), "\n") - postDoc = strings.Replace(postDoc, "\\\"", "\"", -1) // replace user's \" to " - postDoc = strings.Replace(postDoc, "\"", "\\\"", -1) // Escape " - postDoc = strings.Replace(postDoc, "\n", "\\n", -1) - postDoc = strings.Replace(postDoc, "\t", "\\t", -1) - postDoc = strings.Trim(postDoc, " ") - if postDoc != "" { - g.Do("Description: \"$.$\",\n", postDoc) - } -} - -func (g openAPITypeWriter) generateProperty(m *types.Member, parent *types.Type) error { - name := getReferableName(m) - if name == "" { - return nil - } - if err := g.validatePatchTags(m, parent); err != nil { - return err - } - g.Do("\"$.$\": {\n", name) - if err := g.generateMemberExtensions(m, parent); err != nil { - return err - } - g.Do("SchemaProps: spec.SchemaProps{\n", nil) - g.generateDescription(m.CommentLines) - jsonTags := getJsonTags(m) - if len(jsonTags) > 1 && jsonTags[1] == "string" { - g.generateSimpleProperty("string", "") - g.Do("},\n},\n", nil) - return nil - } - t := resolveAliasAndPtrType(m.Type) - // If we can get a openAPI type and format for this type, we consider it to be simple property - typeString, format := openapi.GetOpenAPITypeFormat(t.String()) - if typeString != "" { - g.generateSimpleProperty(typeString, format) - g.Do("},\n},\n", nil) - return nil - } - switch t.Kind { - case types.Builtin: - return fmt.Errorf("please add type %v to getOpenAPITypeFormat function", t) - case types.Map: - if err := g.generateMapProperty(t); err != nil { - return err - } - case types.Slice, types.Array: - if err := g.generateSliceProperty(t); err != nil { - return err - } - case types.Struct, types.Interface: - g.generateReferenceProperty(t) - default: - return fmt.Errorf("cannot generate spec for type %v", t) - } - g.Do("},\n},\n", nil) - return g.Error() -} - -func (g openAPITypeWriter) generateSimpleProperty(typeString, format string) { - g.Do("Type: []string{\"$.$\"},\n", typeString) - g.Do("Format: \"$.$\",\n", format) -} - -func (g openAPITypeWriter) generateReferenceProperty(t *types.Type) { - g.refTypes[t.Name.String()] = t - g.Do("Ref: ref(\"$.$\"),\n", t.Name.String()) -} - -func resolveAliasAndPtrType(t *types.Type) *types.Type { - var prev *types.Type - for prev != t { - prev = t - if t.Kind == types.Alias { - t = t.Underlying - } - if t.Kind == types.Pointer { - t = t.Elem - } - } - return t -} - -func (g openAPITypeWriter) generateMapProperty(t *types.Type) error { - keyType := resolveAliasAndPtrType(t.Key) - elemType := resolveAliasAndPtrType(t.Elem) - - // According to OpenAPI examples, only map from string is supported - if keyType.Name.Name != "string" { - return fmt.Errorf("map with non-string keys are not supported by OpenAPI in %v", t) - } - g.Do("Type: []string{\"object\"},\n", nil) - g.Do("AdditionalProperties: &spec.SchemaOrBool{\nAllows: true,\nSchema: &spec.Schema{\nSchemaProps: spec.SchemaProps{\n", nil) - typeString, format := openapi.GetOpenAPITypeFormat(elemType.String()) - if typeString != "" { - g.generateSimpleProperty(typeString, format) - g.Do("},\n},\n},\n", nil) - return nil - } - switch elemType.Kind { - case types.Builtin: - return fmt.Errorf("please add type %v to getOpenAPITypeFormat function", elemType) - case types.Struct: - g.generateReferenceProperty(elemType) - case types.Slice, types.Array: - if err := g.generateSliceProperty(elemType); err != nil { - return err - } - case types.Map: - if err := g.generateMapProperty(elemType); err != nil { - return err - } - default: - return fmt.Errorf("map Element kind %v is not supported in %v", elemType.Kind, t.Name) - } - g.Do("},\n},\n},\n", nil) - return nil -} - -func (g openAPITypeWriter) generateSliceProperty(t *types.Type) error { - elemType := resolveAliasAndPtrType(t.Elem) - g.Do("Type: []string{\"array\"},\n", nil) - g.Do("Items: &spec.SchemaOrArray{\nSchema: &spec.Schema{\nSchemaProps: spec.SchemaProps{\n", nil) - typeString, format := openapi.GetOpenAPITypeFormat(elemType.String()) - if typeString != "" { - g.generateSimpleProperty(typeString, format) - g.Do("},\n},\n},\n", nil) - return nil - } - switch elemType.Kind { - case types.Builtin: - return fmt.Errorf("please add type %v to getOpenAPITypeFormat function", elemType) - case types.Struct: - g.generateReferenceProperty(elemType) - case types.Slice, types.Array: - if err := g.generateSliceProperty(elemType); err != nil { - return err - } - case types.Map: - if err := g.generateMapProperty(elemType); err != nil { - return err - } - default: - return fmt.Errorf("slice Element kind %v is not supported in %v", elemType.Kind, t) - } - g.Do("},\n},\n},\n", nil) - return nil -} diff --git a/vendor/k8s.io/kube-openapi/pkg/generators/rules/OWNERS b/vendor/k8s.io/kube-openapi/pkg/generators/rules/OWNERS deleted file mode 100644 index 235bc54..0000000 --- a/vendor/k8s.io/kube-openapi/pkg/generators/rules/OWNERS +++ /dev/null @@ -1,4 +0,0 @@ -reviewers: -- roycaihw -approvers: -- roycaihw diff --git a/vendor/k8s.io/kube-openapi/pkg/generators/rules/doc.go b/vendor/k8s.io/kube-openapi/pkg/generators/rules/doc.go deleted file mode 100644 index 384a44d..0000000 --- a/vendor/k8s.io/kube-openapi/pkg/generators/rules/doc.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package rules contains API rules that are enforced in OpenAPI spec generation -// as part of the machinery. Files under this package implement APIRule interface -// which evaluates Go type and produces list of API rule violations. -// -// Implementations of APIRule should be added to API linter under openAPIGen code- -// generator to get integrated in the generation process. -package rules diff --git a/vendor/k8s.io/kube-openapi/pkg/generators/rules/idl_tag.go b/vendor/k8s.io/kube-openapi/pkg/generators/rules/idl_tag.go deleted file mode 100644 index 474d79e..0000000 --- a/vendor/k8s.io/kube-openapi/pkg/generators/rules/idl_tag.go +++ /dev/null @@ -1,53 +0,0 @@ -package rules - -import ( - "k8s.io/gengo/types" -) - -const ListTypeIDLTag = "listType" - -// ListTypeMissing implements APIRule interface. -// A list type is required for inlined list. -type ListTypeMissing struct{} - -// Name returns the name of APIRule -func (l *ListTypeMissing) Name() string { - return "list_type_missing" -} - -// Validate evaluates API rule on type t and returns a list of field names in -// the type that violate the rule. Empty field name [""] implies the entire -// type violates the rule. -func (l *ListTypeMissing) Validate(t *types.Type) ([]string, error) { - fields := make([]string, 0) - - switch t.Kind { - case types.Struct: - for _, m := range t.Members { - hasListType := types.ExtractCommentTags("+", m.CommentLines)[ListTypeIDLTag] != nil - - if m.Name == "Items" && m.Type.Kind == types.Slice && hasNamedMember(t, "ListMeta") { - if hasListType { - fields = append(fields, m.Name) - } - continue - } - - if m.Type.Kind == types.Slice && !hasListType { - fields = append(fields, m.Name) - continue - } - } - } - - return fields, nil -} - -func hasNamedMember(t *types.Type, name string) bool { - for _, m := range t.Members { - if m.Name == name { - return true - } - } - return false -} diff --git a/vendor/k8s.io/kube-openapi/pkg/generators/rules/names_match.go b/vendor/k8s.io/kube-openapi/pkg/generators/rules/names_match.go deleted file mode 100644 index 3a71ff1..0000000 --- a/vendor/k8s.io/kube-openapi/pkg/generators/rules/names_match.go +++ /dev/null @@ -1,172 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package rules - -import ( - "reflect" - "strings" - - "k8s.io/kube-openapi/pkg/util/sets" - - "k8s.io/gengo/types" -) - -var ( - // Blacklist of JSON tags that should skip match evaluation - jsonTagBlacklist = sets.NewString( - // Omitted field is ignored by the package - "-", - ) - - // Blacklist of JSON names that should skip match evaluation - jsonNameBlacklist = sets.NewString( - // Empty name is used for inline struct field (e.g. metav1.TypeMeta) - "", - // Special case for object and list meta - "metadata", - ) - - // List of substrings that aren't allowed in Go name and JSON name - disallowedNameSubstrings = sets.NewString( - // Underscore is not allowed in either name - "_", - // Dash is not allowed in either name. Note that since dash is a valid JSON tag, this should be checked - // after JSON tag blacklist check. - "-", - ) -) - -/* -NamesMatch implements APIRule interface. -Go field names must be CamelCase. JSON field names must be camelCase. Other than capitalization of the -initial letter, the two should almost always match. No underscores nor dashes in either. -This rule verifies the convention "Other than capitalization of the initial letter, the two should almost always match." -Examples (also in unit test): - Go name | JSON name | match - podSpec false - PodSpec podSpec true - PodSpec PodSpec false - podSpec podSpec false - PodSpec spec false - Spec podSpec false - JSONSpec jsonSpec true - JSONSpec jsonspec false - HTTPJSONSpec httpJSONSpec true -NOTE: this validator cannot tell two sequential all-capital words from one word, therefore the case below -is also considered matched. - HTTPJSONSpec httpjsonSpec true -NOTE: JSON names in jsonNameBlacklist should skip evaluation - true - podSpec true - podSpec - true - podSpec metadata true -*/ -type NamesMatch struct{} - -// Name returns the name of APIRule -func (n *NamesMatch) Name() string { - return "names_match" -} - -// Validate evaluates API rule on type t and returns a list of field names in -// the type that violate the rule. Empty field name [""] implies the entire -// type violates the rule. -func (n *NamesMatch) Validate(t *types.Type) ([]string, error) { - fields := make([]string, 0) - - // Only validate struct type and ignore the rest - switch t.Kind { - case types.Struct: - for _, m := range t.Members { - goName := m.Name - jsonTag, ok := reflect.StructTag(m.Tags).Lookup("json") - // Distinguish empty JSON tag and missing JSON tag. Empty JSON tag / name is - // allowed (in JSON name blacklist) but missing JSON tag is invalid. - if !ok { - fields = append(fields, goName) - continue - } - if jsonTagBlacklist.Has(jsonTag) { - continue - } - jsonName := strings.Split(jsonTag, ",")[0] - if !namesMatch(goName, jsonName) { - fields = append(fields, goName) - } - } - } - return fields, nil -} - -// namesMatch evaluates if goName and jsonName match the API rule -// TODO: Use an off-the-shelf CamelCase solution instead of implementing this logic. The following existing -// packages have been tried out: -// github.com/markbates/inflect -// github.com/segmentio/go-camelcase -// github.com/iancoleman/strcase -// github.com/fatih/camelcase -// Please see https://github.com/kubernetes/kube-openapi/pull/83#issuecomment-400842314 for more details -// about why they don't satisfy our need. What we need can be a function that detects an acronym at the -// beginning of a string. -func namesMatch(goName, jsonName string) bool { - if jsonNameBlacklist.Has(jsonName) { - return true - } - if !isAllowedName(goName) || !isAllowedName(jsonName) { - return false - } - if strings.ToLower(goName) != strings.ToLower(jsonName) { - return false - } - // Go field names must be CamelCase. JSON field names must be camelCase. - if !isCapital(goName[0]) || isCapital(jsonName[0]) { - return false - } - for i := 0; i < len(goName); i++ { - if goName[i] == jsonName[i] { - // goName[0:i-1] is uppercase and jsonName[0:i-1] is lowercase, goName[i:] - // and jsonName[i:] should match; - // goName[i] should be lowercase if i is equal to 1, e.g.: - // goName | jsonName - // PodSpec podSpec - // or uppercase if i is greater than 1, e.g.: - // goname | jsonName - // JSONSpec jsonSpec - // This is to rule out cases like: - // goname | jsonName - // JSONSpec jsonspec - return goName[i:] == jsonName[i:] && (i == 1 || isCapital(goName[i])) - } - } - return true -} - -// isCaptical returns true if one character is capital -func isCapital(b byte) bool { - return b >= 'A' && b <= 'Z' -} - -// isAllowedName checks the list of disallowedNameSubstrings and returns true if name doesn't contain -// any disallowed substring. -func isAllowedName(name string) bool { - for _, substr := range disallowedNameSubstrings.UnsortedList() { - if strings.Contains(name, substr) { - return false - } - } - return true -} diff --git a/vendor/k8s.io/kube-openapi/pkg/generators/rules/omitempty_match_case.go b/vendor/k8s.io/kube-openapi/pkg/generators/rules/omitempty_match_case.go deleted file mode 100644 index dd37ad8..0000000 --- a/vendor/k8s.io/kube-openapi/pkg/generators/rules/omitempty_match_case.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package rules - -import ( - "reflect" - "strings" - - "k8s.io/gengo/types" -) - -// OmitEmptyMatchCase implements APIRule interface. -// "omitempty" must appear verbatim (no case variants). -type OmitEmptyMatchCase struct{} - -func (n *OmitEmptyMatchCase) Name() string { - return "omitempty_match_case" -} - -func (n *OmitEmptyMatchCase) Validate(t *types.Type) ([]string, error) { - fields := make([]string, 0) - - // Only validate struct type and ignore the rest - switch t.Kind { - case types.Struct: - for _, m := range t.Members { - goName := m.Name - jsonTag, ok := reflect.StructTag(m.Tags).Lookup("json") - if !ok { - continue - } - - parts := strings.Split(jsonTag, ",") - if len(parts) < 2 { - // no tags other than name - continue - } - if parts[0] == "-" { - // not serialized - continue - } - for _, part := range parts[1:] { - if strings.EqualFold(part, "omitempty") && part != "omitempty" { - fields = append(fields, goName) - } - } - } - } - return fields, nil -} diff --git a/vendor/k8s.io/kube-openapi/pkg/generators/union.go b/vendor/k8s.io/kube-openapi/pkg/generators/union.go deleted file mode 100644 index a0281fe..0000000 --- a/vendor/k8s.io/kube-openapi/pkg/generators/union.go +++ /dev/null @@ -1,207 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generators - -import ( - "fmt" - "sort" - - "k8s.io/gengo/types" -) - -const tagUnionMember = "union" -const tagUnionDeprecated = "unionDeprecated" -const tagUnionDiscriminator = "unionDiscriminator" - -type union struct { - discriminator string - fieldsToDiscriminated map[string]string -} - -// emit prints the union, can be called on a nil union (emits nothing) -func (u *union) emit(g openAPITypeWriter) { - if u == nil { - return - } - g.Do("map[string]interface{}{\n", nil) - if u.discriminator != "" { - g.Do("\"discriminator\": \"$.$\",\n", u.discriminator) - } - g.Do("\"fields-to-discriminateBy\": map[string]interface{}{\n", nil) - keys := []string{} - for field := range u.fieldsToDiscriminated { - keys = append(keys, field) - } - sort.Strings(keys) - for _, field := range keys { - g.Do("\"$.$\": ", field) - g.Do("\"$.$\",\n", u.fieldsToDiscriminated[field]) - } - g.Do("},\n", nil) - g.Do("},\n", nil) -} - -// Sets the discriminator if it's not set yet, otherwise return an error -func (u *union) setDiscriminator(value string) []error { - errors := []error{} - if u.discriminator != "" { - errors = append(errors, fmt.Errorf("at least two discriminators found: %v and %v", value, u.discriminator)) - } - u.discriminator = value - return errors -} - -// Add a new member to the union -func (u *union) addMember(jsonName, variableName string) { - if _, ok := u.fieldsToDiscriminated[jsonName]; ok { - panic(fmt.Errorf("same field (%v) found multiple times", jsonName)) - } - u.fieldsToDiscriminated[jsonName] = variableName -} - -// Makes sure that the union is valid, specifically looking for re-used discriminated -func (u *union) isValid() []error { - errors := []error{} - // Case 1: discriminator but no fields - if u.discriminator != "" && len(u.fieldsToDiscriminated) == 0 { - errors = append(errors, fmt.Errorf("discriminator set with no fields in union")) - } - // Case 2: two fields have the same discriminated value - discriminated := map[string]struct{}{} - for _, d := range u.fieldsToDiscriminated { - if _, ok := discriminated[d]; ok { - errors = append(errors, fmt.Errorf("discriminated value is used twice: %v", d)) - } - discriminated[d] = struct{}{} - } - // Case 3: a field is both discriminator AND part of the union - if u.discriminator != "" { - if _, ok := u.fieldsToDiscriminated[u.discriminator]; ok { - errors = append(errors, fmt.Errorf("%v can't be both discriminator and part of the union", u.discriminator)) - } - } - return errors -} - -// Find unions either directly on the members (or inlined members, not -// going across types) or on the type itself, or on embedded types. -func parseUnions(t *types.Type) ([]union, []error) { - errors := []error{} - unions := []union{} - su, err := parseUnionStruct(t) - if su != nil { - unions = append(unions, *su) - } - errors = append(errors, err...) - eu, err := parseEmbeddedUnion(t) - unions = append(unions, eu...) - errors = append(errors, err...) - mu, err := parseUnionMembers(t) - if mu != nil { - unions = append(unions, *mu) - } - errors = append(errors, err...) - return unions, errors -} - -// Find unions in embedded types, unions shouldn't go across types. -func parseEmbeddedUnion(t *types.Type) ([]union, []error) { - errors := []error{} - unions := []union{} - for _, m := range t.Members { - if hasOpenAPITagValue(m.CommentLines, tagValueFalse) { - continue - } - if !shouldInlineMembers(&m) { - continue - } - u, err := parseUnions(m.Type) - unions = append(unions, u...) - errors = append(errors, err...) - } - return unions, errors -} - -// Look for union tag on a struct, and then include all the fields -// (except the discriminator if there is one). The struct shouldn't have -// embedded types. -func parseUnionStruct(t *types.Type) (*union, []error) { - errors := []error{} - if types.ExtractCommentTags("+", t.CommentLines)[tagUnionMember] == nil { - return nil, nil - } - - u := &union{fieldsToDiscriminated: map[string]string{}} - - for _, m := range t.Members { - jsonName := getReferableName(&m) - if jsonName == "" { - continue - } - if shouldInlineMembers(&m) { - errors = append(errors, fmt.Errorf("union structures can't have embedded fields: %v.%v", t.Name, m.Name)) - continue - } - if types.ExtractCommentTags("+", m.CommentLines)[tagUnionDeprecated] != nil { - errors = append(errors, fmt.Errorf("union struct can't have unionDeprecated members: %v.%v", t.Name, m.Name)) - continue - } - if types.ExtractCommentTags("+", m.CommentLines)[tagUnionDiscriminator] != nil { - errors = append(errors, u.setDiscriminator(jsonName)...) - } else { - if !hasOptionalTag(&m) { - errors = append(errors, fmt.Errorf("union members must be optional: %v.%v", t.Name, m.Name)) - } - u.addMember(jsonName, m.Name) - } - } - - return u, errors -} - -// Find unions specifically on members. -func parseUnionMembers(t *types.Type) (*union, []error) { - errors := []error{} - u := &union{fieldsToDiscriminated: map[string]string{}} - - for _, m := range t.Members { - jsonName := getReferableName(&m) - if jsonName == "" { - continue - } - if shouldInlineMembers(&m) { - continue - } - if types.ExtractCommentTags("+", m.CommentLines)[tagUnionDiscriminator] != nil { - errors = append(errors, u.setDiscriminator(jsonName)...) - } - if types.ExtractCommentTags("+", m.CommentLines)[tagUnionMember] != nil { - errors = append(errors, fmt.Errorf("union tag is not accepted on struct members: %v.%v", t.Name, m.Name)) - continue - } - if types.ExtractCommentTags("+", m.CommentLines)[tagUnionDeprecated] != nil { - if !hasOptionalTag(&m) { - errors = append(errors, fmt.Errorf("union members must be optional: %v.%v", t.Name, m.Name)) - } - u.addMember(jsonName, m.Name) - } - } - if len(u.fieldsToDiscriminated) == 0 { - return nil, nil - } - return u, append(errors, u.isValid()...) -} diff --git a/vendor/k8s.io/kube-openapi/pkg/util/proto/OWNERS b/vendor/k8s.io/kube-openapi/pkg/util/proto/OWNERS deleted file mode 100644 index 9621a6a..0000000 --- a/vendor/k8s.io/kube-openapi/pkg/util/proto/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -approvers: -- apelisse diff --git a/vendor/k8s.io/kube-openapi/pkg/util/sets/empty.go b/vendor/k8s.io/kube-openapi/pkg/util/sets/empty.go deleted file mode 100644 index 13303ea..0000000 --- a/vendor/k8s.io/kube-openapi/pkg/util/sets/empty.go +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by set-gen. DO NOT EDIT. - -// NOTE: This file is copied from k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/sets/empty.go -// because in Kubernetes we don't allowed vendor code to import staging code. See -// https://github.com/kubernetes/kube-openapi/pull/90 for more details. - -package sets - -// Empty is public since it is used by some internal API objects for conversions between external -// string arrays and internal sets, and conversion logic requires public types today. -type Empty struct{} diff --git a/vendor/k8s.io/kube-openapi/pkg/util/sets/string.go b/vendor/k8s.io/kube-openapi/pkg/util/sets/string.go deleted file mode 100644 index 53f2bc1..0000000 --- a/vendor/k8s.io/kube-openapi/pkg/util/sets/string.go +++ /dev/null @@ -1,207 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by set-gen. DO NOT EDIT. - -// NOTE: This file is copied from k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/sets/string.go -// because in Kubernetes we don't allowed vendor code to import staging code. See -// https://github.com/kubernetes/kube-openapi/pull/90 for more details. - -package sets - -import ( - "reflect" - "sort" -) - -// sets.String is a set of strings, implemented via map[string]struct{} for minimal memory consumption. -type String map[string]Empty - -// NewString creates a String from a list of values. -func NewString(items ...string) String { - ss := String{} - ss.Insert(items...) - return ss -} - -// StringKeySet creates a String from a keys of a map[string](? extends interface{}). -// If the value passed in is not actually a map, this will panic. -func StringKeySet(theMap interface{}) String { - v := reflect.ValueOf(theMap) - ret := String{} - - for _, keyValue := range v.MapKeys() { - ret.Insert(keyValue.Interface().(string)) - } - return ret -} - -// Insert adds items to the set. -func (s String) Insert(items ...string) { - for _, item := range items { - s[item] = Empty{} - } -} - -// Delete removes all items from the set. -func (s String) Delete(items ...string) { - for _, item := range items { - delete(s, item) - } -} - -// Has returns true if and only if item is contained in the set. -func (s String) Has(item string) bool { - _, contained := s[item] - return contained -} - -// HasAll returns true if and only if all items are contained in the set. -func (s String) HasAll(items ...string) bool { - for _, item := range items { - if !s.Has(item) { - return false - } - } - return true -} - -// HasAny returns true if any items are contained in the set. -func (s String) HasAny(items ...string) bool { - for _, item := range items { - if s.Has(item) { - return true - } - } - return false -} - -// Difference returns a set of objects that are not in s2 -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.Difference(s2) = {a3} -// s2.Difference(s1) = {a4, a5} -func (s String) Difference(s2 String) String { - result := NewString() - for key := range s { - if !s2.Has(key) { - result.Insert(key) - } - } - return result -} - -// Union returns a new set which includes items in either s1 or s2. -// For example: -// s1 = {a1, a2} -// s2 = {a3, a4} -// s1.Union(s2) = {a1, a2, a3, a4} -// s2.Union(s1) = {a1, a2, a3, a4} -func (s1 String) Union(s2 String) String { - result := NewString() - for key := range s1 { - result.Insert(key) - } - for key := range s2 { - result.Insert(key) - } - return result -} - -// Intersection returns a new set which includes the item in BOTH s1 and s2 -// For example: -// s1 = {a1, a2} -// s2 = {a2, a3} -// s1.Intersection(s2) = {a2} -func (s1 String) Intersection(s2 String) String { - var walk, other String - result := NewString() - if s1.Len() < s2.Len() { - walk = s1 - other = s2 - } else { - walk = s2 - other = s1 - } - for key := range walk { - if other.Has(key) { - result.Insert(key) - } - } - return result -} - -// IsSuperset returns true if and only if s1 is a superset of s2. -func (s1 String) IsSuperset(s2 String) bool { - for item := range s2 { - if !s1.Has(item) { - return false - } - } - return true -} - -// Equal returns true if and only if s1 is equal (as a set) to s2. -// Two sets are equal if their membership is identical. -// (In practice, this means same elements, order doesn't matter) -func (s1 String) Equal(s2 String) bool { - return len(s1) == len(s2) && s1.IsSuperset(s2) -} - -type sortableSliceOfString []string - -func (s sortableSliceOfString) Len() int { return len(s) } -func (s sortableSliceOfString) Less(i, j int) bool { return lessString(s[i], s[j]) } -func (s sortableSliceOfString) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -// List returns the contents as a sorted string slice. -func (s String) List() []string { - res := make(sortableSliceOfString, 0, len(s)) - for key := range s { - res = append(res, key) - } - sort.Sort(res) - return []string(res) -} - -// UnsortedList returns the slice with contents in random order. -func (s String) UnsortedList() []string { - res := make([]string, 0, len(s)) - for key := range s { - res = append(res, key) - } - return res -} - -// Returns a single element from the set. -func (s String) PopAny() (string, bool) { - for key := range s { - s.Delete(key) - return key, true - } - var zeroValue string - return zeroValue, false -} - -// Len returns the size of the set. -func (s String) Len() int { - return len(s) -} - -func lessString(lhs, rhs string) bool { - return lhs < rhs -} diff --git a/vendor/k8s.io/utils/pointer/OWNERS b/vendor/k8s.io/utils/pointer/OWNERS deleted file mode 100644 index 0d63927..0000000 --- a/vendor/k8s.io/utils/pointer/OWNERS +++ /dev/null @@ -1,10 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: -- apelisse -- stewart-yu -- thockin -reviewers: -- apelisse -- stewart-yu -- thockin diff --git a/vendor/sigs.k8s.io/yaml/.gitignore b/vendor/sigs.k8s.io/yaml/.gitignore deleted file mode 100644 index e256a31..0000000 --- a/vendor/sigs.k8s.io/yaml/.gitignore +++ /dev/null @@ -1,20 +0,0 @@ -# OSX leaves these everywhere on SMB shares -._* - -# Eclipse files -.classpath -.project -.settings/** - -# Emacs save files -*~ - -# Vim-related files -[._]*.s[a-w][a-z] -[._]s[a-w][a-z] -*.un~ -Session.vim -.netrwhist - -# Go test binaries -*.test diff --git a/vendor/sigs.k8s.io/yaml/.travis.yml b/vendor/sigs.k8s.io/yaml/.travis.yml deleted file mode 100644 index d20e23e..0000000 --- a/vendor/sigs.k8s.io/yaml/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: go -dist: xenial -go: - - 1.12.x - - 1.13.x -script: - - diff -u <(echo -n) <(gofmt -d *.go) - - diff -u <(echo -n) <(golint $(go list -e ./...) | grep -v YAMLToJSON) - - GO111MODULE=on go vet . - - GO111MODULE=on go test -v -race ./... - - git diff --exit-code -install: - - GO111MODULE=off go get golang.org/x/lint/golint diff --git a/vendor/sigs.k8s.io/yaml/CONTRIBUTING.md b/vendor/sigs.k8s.io/yaml/CONTRIBUTING.md deleted file mode 100644 index de47115..0000000 --- a/vendor/sigs.k8s.io/yaml/CONTRIBUTING.md +++ /dev/null @@ -1,31 +0,0 @@ -# Contributing Guidelines - -Welcome to Kubernetes. We are excited about the prospect of you joining our [community](https://github.com/kubernetes/community)! The Kubernetes community abides by the CNCF [code of conduct](code-of-conduct.md). Here is an excerpt: - -_As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities._ - -## Getting Started - -We have full documentation on how to get started contributing here: - - - -- [Contributor License Agreement](https://git.k8s.io/community/CLA.md) Kubernetes projects require that you sign a Contributor License Agreement (CLA) before we can accept your pull requests -- [Kubernetes Contributor Guide](http://git.k8s.io/community/contributors/guide) - Main contributor documentation, or you can just jump directly to the [contributing section](http://git.k8s.io/community/contributors/guide#contributing) -- [Contributor Cheat Sheet](https://git.k8s.io/community/contributors/guide/contributor-cheatsheet.md) - Common resources for existing developers - -## Mentorship - -- [Mentoring Initiatives](https://git.k8s.io/community/mentoring) - We have a diverse set of mentorship programs available that are always looking for volunteers! - - diff --git a/vendor/sigs.k8s.io/yaml/OWNERS b/vendor/sigs.k8s.io/yaml/OWNERS deleted file mode 100644 index 325b40b..0000000 --- a/vendor/sigs.k8s.io/yaml/OWNERS +++ /dev/null @@ -1,27 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: -- dims -- lavalamp -- smarterclayton -- deads2k -- sttts -- liggitt -- caesarxuchao -reviewers: -- dims -- thockin -- lavalamp -- smarterclayton -- wojtek-t -- deads2k -- derekwaynecarr -- caesarxuchao -- mikedanese -- liggitt -- gmarek -- sttts -- ncdc -- tallclair -labels: -- sig/api-machinery diff --git a/vendor/sigs.k8s.io/yaml/README.md b/vendor/sigs.k8s.io/yaml/README.md deleted file mode 100644 index 5a651d9..0000000 --- a/vendor/sigs.k8s.io/yaml/README.md +++ /dev/null @@ -1,123 +0,0 @@ -# YAML marshaling and unmarshaling support for Go - -[![Build Status](https://travis-ci.org/kubernetes-sigs/yaml.svg)](https://travis-ci.org/kubernetes-sigs/yaml) - -kubernetes-sigs/yaml is a permanent fork of [ghodss/yaml](https://github.com/ghodss/yaml). - -## Introduction - -A wrapper around [go-yaml](https://github.com/go-yaml/yaml) designed to enable a better way of handling YAML when marshaling to and from structs. - -In short, this library first converts YAML to JSON using go-yaml and then uses `json.Marshal` and `json.Unmarshal` to convert to or from the struct. This means that it effectively reuses the JSON struct tags as well as the custom JSON methods `MarshalJSON` and `UnmarshalJSON` unlike go-yaml. For a detailed overview of the rationale behind this method, [see this blog post](http://web.archive.org/web/20190603050330/http://ghodss.com/2014/the-right-way-to-handle-yaml-in-golang/). - -## Compatibility - -This package uses [go-yaml](https://github.com/go-yaml/yaml) and therefore supports [everything go-yaml supports](https://github.com/go-yaml/yaml#compatibility). - -## Caveats - -**Caveat #1:** When using `yaml.Marshal` and `yaml.Unmarshal`, binary data should NOT be preceded with the `!!binary` YAML tag. If you do, go-yaml will convert the binary data from base64 to native binary data, which is not compatible with JSON. You can still use binary in your YAML files though - just store them without the `!!binary` tag and decode the base64 in your code (e.g. in the custom JSON methods `MarshalJSON` and `UnmarshalJSON`). This also has the benefit that your YAML and your JSON binary data will be decoded exactly the same way. As an example: - -``` -BAD: - exampleKey: !!binary gIGC - -GOOD: - exampleKey: gIGC -... and decode the base64 data in your code. -``` - -**Caveat #2:** When using `YAMLToJSON` directly, maps with keys that are maps will result in an error since this is not supported by JSON. This error will occur in `Unmarshal` as well since you can't unmarshal map keys anyways since struct fields can't be keys. - -## Installation and usage - -To install, run: - -``` -$ go get sigs.k8s.io/yaml -``` - -And import using: - -``` -import "sigs.k8s.io/yaml" -``` - -Usage is very similar to the JSON library: - -```go -package main - -import ( - "fmt" - - "sigs.k8s.io/yaml" -) - -type Person struct { - Name string `json:"name"` // Affects YAML field names too. - Age int `json:"age"` -} - -func main() { - // Marshal a Person struct to YAML. - p := Person{"John", 30} - y, err := yaml.Marshal(p) - if err != nil { - fmt.Printf("err: %v\n", err) - return - } - fmt.Println(string(y)) - /* Output: - age: 30 - name: John - */ - - // Unmarshal the YAML back into a Person struct. - var p2 Person - err = yaml.Unmarshal(y, &p2) - if err != nil { - fmt.Printf("err: %v\n", err) - return - } - fmt.Println(p2) - /* Output: - {John 30} - */ -} -``` - -`yaml.YAMLToJSON` and `yaml.JSONToYAML` methods are also available: - -```go -package main - -import ( - "fmt" - - "sigs.k8s.io/yaml" -) - -func main() { - j := []byte(`{"name": "John", "age": 30}`) - y, err := yaml.JSONToYAML(j) - if err != nil { - fmt.Printf("err: %v\n", err) - return - } - fmt.Println(string(y)) - /* Output: - name: John - age: 30 - */ - j2, err := yaml.YAMLToJSON(y) - if err != nil { - fmt.Printf("err: %v\n", err) - return - } - fmt.Println(string(j2)) - /* Output: - {"age":30,"name":"John"} - */ -} -``` diff --git a/vendor/sigs.k8s.io/yaml/RELEASE.md b/vendor/sigs.k8s.io/yaml/RELEASE.md deleted file mode 100644 index 6b64246..0000000 --- a/vendor/sigs.k8s.io/yaml/RELEASE.md +++ /dev/null @@ -1,9 +0,0 @@ -# Release Process - -The `yaml` Project is released on an as-needed basis. The process is as follows: - -1. An issue is proposing a new release with a changelog since the last release -1. All [OWNERS](OWNERS) must LGTM this release -1. An OWNER runs `git tag -s $VERSION` and inserts the changelog and pushes the tag with `git push $VERSION` -1. The release issue is closed -1. An announcement email is sent to `kubernetes-dev@googlegroups.com` with the subject `[ANNOUNCE] kubernetes-template-project $VERSION is released` diff --git a/vendor/sigs.k8s.io/yaml/SECURITY_CONTACTS b/vendor/sigs.k8s.io/yaml/SECURITY_CONTACTS deleted file mode 100644 index 0648a8e..0000000 --- a/vendor/sigs.k8s.io/yaml/SECURITY_CONTACTS +++ /dev/null @@ -1,17 +0,0 @@ -# Defined below are the security contacts for this repo. -# -# They are the contact point for the Product Security Team to reach out -# to for triaging and handling of incoming issues. -# -# The below names agree to abide by the -# [Embargo Policy](https://github.com/kubernetes/sig-release/blob/master/security-release-process-documentation/security-release-process.md#embargo-policy) -# and will be removed and replaced if they violate that agreement. -# -# DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE -# INSTRUCTIONS AT https://kubernetes.io/security/ - -cjcullen -jessfraz -liggitt -philips -tallclair diff --git a/vendor/sigs.k8s.io/yaml/code-of-conduct.md b/vendor/sigs.k8s.io/yaml/code-of-conduct.md deleted file mode 100644 index 0d15c00..0000000 --- a/vendor/sigs.k8s.io/yaml/code-of-conduct.md +++ /dev/null @@ -1,3 +0,0 @@ -# Kubernetes Community Code of Conduct - -Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md) diff --git a/vendor/sigs.k8s.io/yaml/go.mod b/vendor/sigs.k8s.io/yaml/go.mod deleted file mode 100644 index 7224f34..0000000 --- a/vendor/sigs.k8s.io/yaml/go.mod +++ /dev/null @@ -1,8 +0,0 @@ -module sigs.k8s.io/yaml - -go 1.12 - -require ( - github.com/davecgh/go-spew v1.1.1 - gopkg.in/yaml.v2 v2.2.8 -) diff --git a/vendor/sigs.k8s.io/yaml/go.sum b/vendor/sigs.k8s.io/yaml/go.sum deleted file mode 100644 index 76e4948..0000000 --- a/vendor/sigs.k8s.io/yaml/go.sum +++ /dev/null @@ -1,9 +0,0 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= -gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/sigs.k8s.io/yaml/yaml.go b/vendor/sigs.k8s.io/yaml/yaml.go index efbc535..0245961 100644 --- a/vendor/sigs.k8s.io/yaml/yaml.go +++ b/vendor/sigs.k8s.io/yaml/yaml.go @@ -317,64 +317,3 @@ func convertToJSONableObject(yamlObj interface{}, jsonTarget *reflect.Value) (in return yamlObj, nil } } - -// JSONObjectToYAMLObject converts an in-memory JSON object into a YAML in-memory MapSlice, -// without going through a byte representation. A nil or empty map[string]interface{} input is -// converted to an empty map, i.e. yaml.MapSlice(nil). -// -// interface{} slices stay interface{} slices. map[string]interface{} becomes yaml.MapSlice. -// -// int64 and float64 are down casted following the logic of github.com/go-yaml/yaml: -// - float64s are down-casted as far as possible without data-loss to int, int64, uint64. -// - int64s are down-casted to int if possible without data-loss. -// -// Big int/int64/uint64 do not lose precision as in the json-yaml roundtripping case. -// -// string, bool and any other types are unchanged. -func JSONObjectToYAMLObject(j map[string]interface{}) yaml.MapSlice { - if len(j) == 0 { - return nil - } - ret := make(yaml.MapSlice, 0, len(j)) - for k, v := range j { - ret = append(ret, yaml.MapItem{Key: k, Value: jsonToYAMLValue(v)}) - } - return ret -} - -func jsonToYAMLValue(j interface{}) interface{} { - switch j := j.(type) { - case map[string]interface{}: - if j == nil { - return interface{}(nil) - } - return JSONObjectToYAMLObject(j) - case []interface{}: - if j == nil { - return interface{}(nil) - } - ret := make([]interface{}, len(j)) - for i := range j { - ret[i] = jsonToYAMLValue(j[i]) - } - return ret - case float64: - // replicate the logic in https://github.com/go-yaml/yaml/blob/51d6538a90f86fe93ac480b35f37b2be17fef232/resolve.go#L151 - if i64 := int64(j); j == float64(i64) { - if i := int(i64); i64 == int64(i) { - return i - } - return i64 - } - if ui64 := uint64(j); j == float64(ui64) { - return ui64 - } - return j - case int64: - if i := int(j); j == int64(i) { - return i - } - return j - } - return j -} -- GitLab